Przeglądaj źródła

fix: 根据DualAxes提供的类型定义文件重新进行属性配置

lanjianrong 4 lat temu
rodzic
commit
462bab32b0

+ 1 - 1
src/components/FileModal/index.tsx

@@ -139,7 +139,7 @@ export default function FileModal(props: iFileModalProps) {
       }
     }
 
-    const reg = new RegExp(consts.UPLOAD_WHITE)
+    const reg = new RegExp(consts.UPLOAD_WHITE, 'i')
     if (!reg.test(file.name)) {
       file.status = 'error'
       message.error('不支持该类型文件')

+ 39 - 21
src/pages/Contract/Content/Summary/components/Content/index.tsx

@@ -3,7 +3,7 @@ import './index.scss'
 import { Pie, G2, DualAxes } from '@ant-design/charts'
 import { PieConfig } from '@ant-design/charts/es/pie'
 import './index.scss'
-import { dayjsFormat, formatMoney } from '@/utils/util'
+import { formatMoney } from '@/utils/util'
 import { Tooltip } from 'antd'
 import { DualAxesConfig } from '@ant-design/charts/es/dualAxes'
 import BigNumber from 'bignumber.js'
@@ -68,15 +68,22 @@ const Content: React.FC<iContentProps> = ({ data, type }) => {
   const dualAxesConfig: DualAxesConfig = {
     data: [ data.returnDate, data.returnDate ],
     autoFit: true,
-    padding: 'auto',
+    // padding: 'auto',
     xField: 'month',
     yField: [ 'value', 'count' ],
     slider: {},
-    xAxis: {
-      label: {
-        formatter: (val) => dayjsFormat(val, 'YYYY年M月')
+    limitInPlot: false,
+    padding: [ 20, 20, 60, 30 ],
+    meta: {
+      month: {
+        sync: false
       }
     },
+    // xAxis: {
+    //   label: {
+    //     formatter: (val) => dayjsFormat(val, 'YYYY年M月')
+    //   }
+    // },
     yAxis: {
       value: {
         label: {
@@ -108,34 +115,45 @@ const Content: React.FC<iContentProps> = ({ data, type }) => {
     geometryOptions: [
       {
         geometry: 'column',
-        seriesField: 'value',
         columnWidthRatio: 0.4,
         color: type === ContractType.INCOME ? '#B5C4B1' : '#A27E7E'
       },
       {
         geometry: 'line',
-        color: type === ContractType.INCOME ? '#965454' : '#8C8C8C',
-        isStack: true,
-        isPercent: true
+        color: type === ContractType.INCOME ? '#965454' : '#8C8C8C'
+        // seriesField: 'count',
+        // isPercent: true
         // smooth: true
       }
     ],
+
     legend: {
-      custom: true,
       position: 'top',
-      items: [
-        {
-          value: 'value',
-          name: '回款金额',
-          marker: { symbol: 'square', style: { fill: type === ContractType.INCOME ? '#B5C4B1' : '#A27E7E', r: 5 } }
-        },
-        {
-          value: 'count',
-          name: '占总金额比例',
-          marker: { symbol: 'square', style: { fill: type === ContractType.INCOME ? '#965454' : '#8C8C8C', r: 5 } }
+      itemName: {
+        formatter: (text: string) => {
+          if (text === 'value') {
+            return type === ContractType.INCOME ? '回款金额' : '支付金额'
+          }
+          return '占总金额比例'
         }
-      ]
+      }
     }
+    // legend: {
+    //   custom: true,
+    //   position: 'top',
+    //   items: [
+    //     {
+    //       value: 'value',
+    //       name: '回款金额',
+    //       marker: { symbol: 'square', style: { fill: type === ContractType.INCOME ? '#B5C4B1' : '#A27E7E', r: 5 } }
+    //     },
+    //     {
+    //       value: 'count',
+    //       name: '占总金额比例',
+    //       marker: { symbol: 'line', style: { fill: type === ContractType.INCOME ? '#965454' : '#8C8C8C' } }
+    //     }
+    //   ]
+    // }
   }
 
 

+ 1 - 1
src/pages/Dashboard/index.tsx

@@ -69,7 +69,7 @@ const Index = () => {
                               <div>
                                 <span className={[ 'pi-pd-lr-15', 'pi-height-18', messageType[item.dataType]?.class ].join(' ')}>{messageType[item.dataType]?.title}</span>
                                 <span className="pi-pd-lr-15">
-                                  <span>WWUJ-1 </span>
+                                  <span>{item.bidsectionName}</span>
                                   <Link to={{ pathname: messageType[item.dataType]?.path, state: { id: item.dataId } }}>{item.inspectionDetail}</Link>
                                 </span>
                               </div>

+ 20 - 17
src/pages/Quality/Content/Info/Detail/components/Modal/index.tsx

@@ -83,29 +83,32 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
   }
 
   useEffect(() => {
-    if (visible && type === 'pass') {
-      if (curAuditor.progress === '1') {
-        form.setFieldsValue({ opinion: '已按要求整改完成。' })
-      }
+    if (visible) {
+      if (type === 'pass') {
+        if (curAuditor.progress === '1') {
+          form.setFieldsValue({ opinion: '已按要求整改完成。' })
+        }
 
-      if (isLastAuditor && auditors.findIndex(item => item.progress === '1') !== -1) {
+        if (isLastAuditor && auditors.findIndex(item => item.progress === '1') !== -1) {
 
-        const auditor = auditors.find(item => item.progress === '1')
+          const auditor = auditors.find(item => item.progress === '1')
 
-        auditor && (setUser({ ...user, id: auditor.audit_id, company: auditor.company, name: auditor.name, position: auditor.position }))
+          auditor && (setUser({ ...user, id: auditor.audit_id, company: auditor.company, name: auditor.name, position: auditor.position }))
+        }
+        isLastAuditor && initGroupList()
       }
-      isLastAuditor && initGroupList()
-    }
-    if (visible && type === 'back') {
-      if (curAuditor.progress === '1') {
-        const len = auditors.filter(item => item.progress === '0').length
-        const lastChecker = auditors.filter(item => item.progress === '0')[len - 1]
-        setUser({ ...user, id: lastChecker.id, name: lastChecker.name })
-      } else {
-        const newGroup = initAuditBackGroup()
-        setGroups(newGroup)
+      if (type === 'back') {
+        if (curAuditor.progress === '1') {
+          const len = auditors.filter(item => item.progress === '0').length
+          const lastChecker = auditors.filter(item => item.progress === '0')[len - 1]
+          setUser({ ...user, id: lastChecker.id, name: lastChecker.name })
+        } else {
+          const newGroup = initAuditBackGroup()
+          setGroups(newGroup)
+        }
       }
     }
+
   }, [ visible ])
   const initGroupList = async (serach?: string) => {
     const data = await getUserGroup({ name: serach, bidsectionId: tenderStore.bid })

+ 13 - 19
src/pages/Quality/Content/Info/Summary/columnChart.tsx

@@ -14,6 +14,7 @@ const ColumnChart: React.FC<{ data: iColumnChartProps }> = props => {
     data: [ props.data.columnData, props.data.lineData ],
     xField: 'month',
     yField: [ 'count', 'percentage' ],
+    padding: [ 20, 20, 60, 30 ],
     xAxis: {
       label: {
         formatter: (val) => dayjsFormat(val, 'YYYY年M月')
@@ -60,30 +61,23 @@ const ColumnChart: React.FC<{ data: iColumnChartProps }> = props => {
       {
         geometry: 'line',
         color: '#A06666',
-        isStack: true
-        // smooth: true
+        isStack: true,
+        smooth: true
       }
     ],
     legend: {
-      custom: true,
       position: 'top',
-      items: [
-        {
-          value: 'submit',
-          name: '提交巡检',
-          marker: { symbol: 'square', style: { fill: '#B5C4B1', r: 5 } }
-        },
-        {
-          value: 'rectifyed',
-          name: '完成整改',
-          marker: { symbol: 'square', style: { fill: '#D8CAAF', r: 5 } }
-        },
-        {
-          value: 'bill',
-          name: '整改占总数比例',
-          marker: { symbol: 'square', style: { fill: '#A06666', r: 5 } }
+      itemName: {
+        formatter: (text: string) => {
+          if (text === 'submit') {
+            return '提交巡检'
+          } else if (text === 'rectifyed') {
+            return '完成整改'
+          } else {
+            return '整改占总数比例'
+          }
         }
-      ]
+      }
     }
   }
   return <DualAxes {...config} />

+ 12 - 19
src/pages/Safe/Content/Info/Summary/columnChart.tsx

@@ -14,6 +14,7 @@ const ColumnChart: React.FC<{ data: iColumnChartProps }> = props => {
     data: [ props.data.columnData, props.data.lineData ],
     xField: 'month',
     yField: [ 'count', 'percentage' ],
+    padding: [ 20, 20, 60, 30 ],
     xAxis: {
       label: {
         formatter: (val) => dayjsFormat(val, 'YYYY年M月')
@@ -60,30 +61,22 @@ const ColumnChart: React.FC<{ data: iColumnChartProps }> = props => {
       {
         geometry: 'line',
         color: '#A06666',
-        isStack: true
-        // smooth: true
+        smooth: true
       }
     ],
     legend: {
-      custom: true,
       position: 'top',
-      items: [
-        {
-          value: 'submit',
-          name: '提交巡检',
-          marker: { symbol: 'square', style: { fill: '#B5C4B1', r: 5 } }
-        },
-        {
-          value: 'rectifyed',
-          name: '完成整改',
-          marker: { symbol: 'square', style: { fill: '#D8CAAF', r: 5 } }
-        },
-        {
-          value: 'bill',
-          name: '整改占总数比例',
-          marker: { symbol: 'square', style: { fill: '#A06666', r: 5 } }
+      itemName: {
+        formatter: (text: string) => {
+          if (text === 'submit') {
+            return '提交巡检'
+          } else if (text === 'rectifyed') {
+            return '完成整改'
+          } else {
+            return '整改占总数比例'
+          }
         }
-      ]
+      }
     }
   }
   return <DualAxes {...config} />

+ 1 - 0
src/types/dashboard.d.ts

@@ -21,6 +21,7 @@ interface ApproverDatum {
   name: string;
   position: string;
   createTime: string;
+  bidsectionName: string;
 }
 interface MessageDatum {
   id: string;