wjx 9 months ago
parent
commit
92d0464bef

+ 1 - 1
src/pages/gsData/serverPayRetained/index.tsx

@@ -78,7 +78,7 @@ const ServerPayRetained: React.FC = () => {
             totalData={totalData}
             config={columns12()}
             configName={'GS区服付费留存'}
-            fixed={{ left: 4, right: 0 }}
+            fixed={{ left: 4, right: 1 }}
             scroll={{ x: 1000, y: 620 }}
             title='GS区服付费留存'
             loading={getServerPayRetained.loading}

+ 22 - 41
src/pages/gsData/serverPayRetained/tableConfig.tsx

@@ -48,46 +48,6 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
         return data
     })
 
-    let defaultStartM = 116
-    const Mn = Array(9).fill('').map((_item: string, index: number) => {
-        let field = `m${index + 4}`
-        let data: any = {
-            title: `M${index + 4}`,
-            dataIndex: `M${index + 4}`,
-            label: "游戏区服数据",
-            width: 140,
-            render: (a: any, b: any) => {
-                let date1 = moment()
-                if (b?.gsName === '总计') {
-                    if (b?.beginDay) {
-                        date1 = moment(b.beginDay)
-                    } else {
-                        date1 = moment()
-                    }
-                } else {
-                    date1 = moment(b.serveDayBegin)
-                }
-                let dt = moment()
-                let day = dt.diff(date1, 'day');
-                if (index <= day && b?.[field]) {
-                    let [count1, count2, count3, count4, count5, count6, count7] = b?.[field]?.split('/')
-                    return <div className={style.dbox}>
-                        <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃人数:<span>{count1}</span></span>
-                        <span style={{ color: '#a0d911', fontWeight: 600 }}>付费人数:<span>{count2}</span></span>
-                        <span style={{ color: '#1677ff', fontWeight: 600 }}>付费累计人数:<span>{count3}</span></span>
-                        <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={count4 || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
-                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>付费率:<span>{(count5 * 100)?.toFixed(2)}%</span></span>
-                        <span style={{ color: '#ff5722', fontWeight: 600 }}>活跃留存率:<span>{(count6 * 100)?.toFixed(2)}%</span></span>
-                        <span style={{ color: '#d81b60', fontWeight: 600 }}>付费留存率:<span>{(count7 * 100)?.toFixed(2)}%</span></span>
-                    </div>
-                }
-                return '--'
-            },
-        }
-        data['default'] = defaultStartM + index
-        return data
-    })
-
     return [
         {
             label: '基本信息',
@@ -218,7 +178,28 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 ...Dn,
-                ...Mn
+                {
+                    title: `D总`,
+                    dataIndex: `total`,
+                    label: "游戏区服数据",
+                    width: 140,
+                    default: 116,
+                    render: (a: string) => {
+                        if (a) {
+                            let [count1, count2, count3, count4, count5, count6, count7] = a?.split('/')
+                            return <div className={style.dbox}>
+                                <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃人数:<span>{count1}</span></span>
+                                <span style={{ color: '#a0d911', fontWeight: 600 }}>付费人数:<span>{count2}</span></span>
+                                <span style={{ color: '#1677ff', fontWeight: 600 }}>付费累计人数:<span>{count3}</span></span>
+                                <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={count4 || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
+                                <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>付费率:<span>{(Number(count5) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#ff5722', fontWeight: 600 }}>活跃留存率:<span>{(Number(count6) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#d81b60', fontWeight: 600 }}>付费留存率:<span>{(Number(count7) * 100)?.toFixed(2)}%</span></span>
+                            </div>
+                        }
+                        return '--'
+                    },
+                }
             ]
         }
     ]