From 16e6ec574a09893278c1a14c0d1fdcca8d5eae12 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 15 Jan 2026 11:20:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=80=81=E5=AE=A2=E6=88=B7-=E5=88=86?= =?UTF-8?q?=E6=9E=90:=20=E5=A2=9E=E5=8A=A0`=E7=9B=AE=E7=9A=84=E5=9C=B0?= =?UTF-8?q?=E5=9B=BD=E5=AE=B6`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/charts/Customer_care_regular_pivot.jsx | 20 +++++++++++++++++--- src/components/Data.jsx | 3 ++- src/stores/CustomerStore.js | 18 ++++++++++-------- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/charts/Customer_care_regular_pivot.jsx b/src/charts/Customer_care_regular_pivot.jsx index 62aebe2..aa6daae 100644 --- a/src/charts/Customer_care_regular_pivot.jsx +++ b/src/charts/Customer_care_regular_pivot.jsx @@ -1,7 +1,8 @@ import { useContext, useEffect, useState } from 'react'; import { observer } from 'mobx-react'; import { stores_Context } from '../config'; -import { Table, Row, Col, Divider, Switch, Space, Tabs } from 'antd'; +import { Table, Row, Col, Divider, Switch, Space, Tabs, Tooltip } from 'antd'; +import { InfoCircleOutlined } from '@ant-design/icons'; import SearchForm from '../components/search/SearchForm'; import { TableExportBtn, VSTag } from '../components/Data'; import { fixTo2Decimals, isEmpty } from '@haina/utils-commons'; @@ -16,6 +17,19 @@ const TdCell = (tdprops) => { const pivotOptions = [ { key: 'operatorName', label: '顾问' }, { key: 'country', label: '国籍' }, + { + key: 'destinationCountry', + value: 'destinationCountry', + labelX: '目的地国家', + label: ( + <> + 目的地国家   + + + + + ), + }, ]; const pivotColOptions = [ { key: 'hasOld', value: 'hasOld', label: '老客户+推荐' }, @@ -171,7 +185,7 @@ const CustomerCareRegularPivot = (props) => { {/* { diff --git a/src/components/Data.jsx b/src/components/Data.jsx index 00c446c..3665274 100644 --- a/src/components/Data.jsx +++ b/src/components/Data.jsx @@ -119,9 +119,10 @@ export const TableExportBtn = ({label, columns, dataSource, btnTxt, ...props}) = const export_val = typeof kset?.dataExport === 'function' ? kset.dataExport('', item) : null; const render_val = typeof kset?.render === 'function' ? kset.render('', item) : null; const data_val = kset?.dataIndex ? (Array.isArray(kset.dataIndex) ? getNestedValue(item, kset.dataIndex) : item[kset.dataIndex]) : undefined; + const data_val_str = data_val ? String(data_val) : ''; const x_val = item[`${kset.dataIndex}_X`]; // const _title = kset.title.replace('-[object Object]', ''); - const v = { [kset.title]: x_val || export_val || data_val || render_val }; + const v = { [kset.title]: x_val || export_val || data_val_str || render_val }; return { ...sv, ...v }; }, {}); return itemMapped; diff --git a/src/stores/CustomerStore.js b/src/stores/CustomerStore.js index b5c045b..1f8b45e 100644 --- a/src/stores/CustomerStore.js +++ b/src/stores/CustomerStore.js @@ -466,8 +466,8 @@ class CustomerStore { // mergedData: [], rawData: [], searchValues: { - DepartmentList: ['1', '2', '28', '7'].map(kk => groupsMappedByKey[kk]), - WebCode: ['CHT','AH','JH','GH','ZWQD','GH_ZWQD_HW','GHKYZG','GHKYHW'].map(kk => sitesMappedByCode[kk]), + DepartmentList: ['1', '2', '28', '7', '33'].map(kk => groupsMappedByKey[kk]), + WebCode: ['CHT','AH','HTravel','JH','GH','ZWQD','GH_ZWQD_HW','GHKYZG','GHKYHW'].map(kk => sitesMappedByCode[kk]), DateType: { key: 'applyDate', label: '提交日期'}, IncludeTickets: { key: '0', label: '不含门票' }, }, @@ -554,17 +554,19 @@ class CustomerStore { // console.log('regular_data_pivot -------------------------------------------------------------- rawData 000 ', toJS(this.sales_regular_data.rawData)); // console.log('regular_data_pivot ---- ', pivotRow, pivotCol); const [result1, result2] = this.sales_regular_data.rawDataArr; - const allRows = Array.from(new Set([...result1.filterHasOld.map(row=>row[pivotRow]), ...result2.filterHasOld.map(row=>row[pivotRow])])); + // const allRows = Array.from(new Set([...result1.filterHasOld.map(row=>row[pivotRow]), ...result2.filterHasOld.map(row=>row[pivotRow])])); // console.log(' ------ allRows', allRows); - const [pivot1, pivot2] = [result1, result2].map(_result => { + const [{ pivotResult: pivot1, rowValues: rowValues1 }, { pivotResult: pivot2, rowValues: rowValues2 }] = [result1, result2].map(_result => { const dataColField = pivotCol.replace('_txt', ''); const rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1'); - const { data: pivotResult } = pivotBy(rawData, [[pivotRow, pivotCol], [], []]); - return pivotResult; + const { data: pivotResult, columnValues: [[rowValues,], columnsKeys, dateKeys] } = pivotBy(rawData, [[pivotRow, pivotCol], [], []]); + return { pivotResult, rowValues }; }); + const allRowValues = Array.from(new Set([...rowValues1, ...rowValues2])); + // console.log(' ------ xx', rowValues1); const rows1 = groupBy(pivot1, pivotRow); const rows2 = groupBy(pivot2, pivotRow); - const pivotResultWithCompare = isEmpty(pivot2) ? pivot1 : allRows.reduce((r, rowName) => { + const pivotResultWithCompare = isEmpty(pivot2) ? pivot1 : allRowValues.reduce((r, rowName) => { const _default = { [pivotRow]: rowName, rowLabel: rows1?.[rowName]?.rowLabel || rows2?.[rowName]?.rowLabel, children: rows1?.[rowName], key: rowName}; const operatorRow = {...(rows1?.[rowName]?.[0] || _default), vsData: rows2?.[rowName]?.[0] || {}}; // 展开的两项: '老客户', '老客户推荐' @@ -582,7 +584,7 @@ class CustomerStore { // console.log(' ------ pivot1', pivot1, '\npivot2', pivot2, '\npivotResultWithCompare', pivotResultWithCompare); const filterColValues = uniqWith( - allRows.map((rr) => ({ text: rr, value: rr })), + allRowValues.map((rr) => ({ text: rr, value: rr })), (a, b) => JSON.stringify(a) === JSON.stringify(b) ).sort((a, b) => a.text.localeCompare(b.text, 'zh-CN'));