From 0e5c395b974b187b4227ed86dac746131425052a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 19 十一月 2023 12:21:18 +0800
Subject: [PATCH] 2023-11-19

---
 src/menu/components/chart/antv-bar/chartcompile/index.jsx      |   17 ++-
 src/menu/components/chart/antv-bar/index.jsx                   |   31 ++++++-
 src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx |    3 
 src/tabviews/custom/components/chart/antv-bar-line/index.jsx   |  154 +++++++++++++++++++++++++++++++------
 src/assets/css/viewstyle.scss                                  |   11 ++
 src/menu/components/card/data-card/options.jsx                 |    3 
 6 files changed, 180 insertions(+), 39 deletions(-)

diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss
index 14d73b8..d924c51 100644
--- a/src/assets/css/viewstyle.scss
+++ b/src/assets/css/viewstyle.scss
@@ -41,6 +41,17 @@
         }
       }
     }
+    .data-zoom.radio.deepBackFont, .data-zoom.checkbox.deepBackFont {
+      .mk-card:hover, .mk-card.active, .mk-card.selected {
+        > .card-item-box {
+          border-color: $color6!important;
+          background-color: $color6!important;
+          .ant-mk-text:not(.sign-font) {
+            color: #ffffff;
+          }
+        }
+      }
+    }
     .data-zoom.radio.font, .data-zoom.checkbox.font {
       .mk-card:hover, .mk-card.active, .mk-card.selected {
         > .card-item-box {
diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx
index 0c0bf4f..0140681 100644
--- a/src/menu/components/card/data-card/options.jsx
+++ b/src/menu/components/card/data-card/options.jsx
@@ -267,7 +267,8 @@
       options: [
         {value: 'none', label: '鏃�'},
         {value: 'active', label: '澶栭槾褰�'},
-        {value: 'backFont', label: '鑳屾櫙+鏂囧瓧'},
+        {value: 'backFont', label: '鑳屾櫙锛堟祬锛�+鏂囧瓧锛堟繁锛�'},
+        {value: 'deepBackFont', label: '鑳屾櫙锛堟繁锛�+鏂囧瓧锛堟祬锛�'},
         {value: 'font', label: '鏂囧瓧'},
         {value: 'tabs', label: '鏍囩椤�'},
         ...(subtype === 'datacard' ? [
diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
index 757c4e8..c98849c 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -394,6 +394,9 @@
       }, {
         value: 'percent',
         text: '鐧惧垎姣�'
+      }, {
+        value: 'thdSeparator',
+        text: '鍗冨垎浣�'
       }]
     }, {
       type: labelOptions.length > 20 ? 'select' : 'radio',
diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
index 617bbc3..4604d38 100644
--- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx
+++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx
@@ -209,7 +209,7 @@
         ],
         render: (text, record) => {
           let trans = {'true': '鏄剧ず', 'false': '闅愯棌'}
-          return trans[text] || '闅愯棌'
+          return trans[text] || ''
         }
       },
       {
@@ -237,10 +237,11 @@
         width: '12%',
         options: [
           { value: 'value', text: '鏁板��'},
-          { value: 'percent', text: '鐧惧垎姣�'}
+          { value: 'percent', text: '鐧惧垎姣�'},
+          { value: 'thdSeparator', text: '鍗冨垎浣�'}
         ],
         render: (text, record) => {
-          let trans = {'value': '鏁板��', 'percent': '鐧惧垎姣�'}
+          let trans = {value: '鏁板��', percent: '鐧惧垎姣�', thdSeparator: '鍗冨垎浣�'}
           return trans[text] || ''
         }
       },
@@ -249,6 +250,7 @@
         dataIndex: 'min',
         inputType: 'number',
         editable: true,
+        max: 9999999999,
         required: false,
         width: '12%'
       },
@@ -257,6 +259,7 @@
         dataIndex: 'max',
         inputType: 'number',
         editable: true,
+        max: 9999999999,
         required: false,
         width: '12%'
       },
@@ -647,8 +650,8 @@
             _plot.customs = []
             delete _plot.Yaxis
           } else if (!is(fromJS(values.Yaxis), fromJS(plot.Yaxis || []))) {
-            _plot.enabled = 'false'
-            _plot.colors = null
+            // _plot.enabled = 'false'
+            // _plot.colors = null
 
             let cus = {}
             _plot.customs && _plot.customs.forEach(m => {
@@ -662,7 +665,7 @@
                 type: item,
                 name: labels[item] || item,
                 axis: i === 0 ? 'true' : 'false',
-                label: 'false',
+                label: _plot.label === 'false' ? 'false' : true,
                 title: 'true',
                 shape: _plot.chartType === 'bar' && i === 0 ? ['bar', 'rect'] : ['line', 'smooth']
               }
@@ -820,7 +823,7 @@
         <Modal
           wrapClassName="mk-pop-modal"
           visible={visible}
-          width={1000}
+          width={1100}
           maskClosable={false}
           onOk={this.onSubmit}
           onCancel={() => { this.setState({ visible: false }) }}
diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx
index ad556b3..7d21460 100644
--- a/src/menu/components/chart/antv-bar/index.jsx
+++ b/src/menu/components/chart/antv-bar/index.jsx
@@ -581,6 +581,29 @@
         fill: '#fff'
       }
     }
+    let label = plot.label
+
+    if (Bar_axis.length) {
+      if (label === 'false') {
+        plot.customs.forEach(item => {
+          if (!Bar_axis.includes(item.type)) return
+          if (item.label === 'true') {
+            label = 'true'
+          }
+        })
+      } else {
+        let reset = true
+        plot.customs.forEach(item => {
+          if (!Bar_axis.includes(item.type)) return
+          if (item.label === 'true') {
+            reset = false
+          }
+        })
+        if (reset) {
+          label = 'false'
+        }
+      }
+    }
 
     if (plot.label === 'top') {
       lablecfg.offset = -5
@@ -682,13 +705,13 @@
         } else {
           _chart.color('key')
         }
-        if (plot.label !== 'false') {
+        if (label !== 'false') {
           _chart.label('value*key', (value, key) => {
             if (plot.show === 'percent') {
               value = value + '%'
             }
 
-            if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
+            if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
               lablecfg.style.fill = colors.get(key)
             }
             return {
@@ -733,13 +756,13 @@
         } else {
           _chart.color('key')
         }
-        if (plot.label !== 'false') {
+        if (label !== 'false') {
           _chart.label('value*key', (value, key) => {
             if (plot.show === 'percent') {
               value = value + '%'
             }
 
-            if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
+            if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
               lablecfg.style.fill = colors.get(key)
             }
 
diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
index cfe93bc..16d88bb 100644
--- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -134,6 +134,32 @@
       if (_config.plot.mutilBar !== 'overlap' && Bar_axis.length > 1) {
         _config.plot.Bar_axis = Bar_axis
       }
+
+      if (_config.plot.Bar_axis && _config.plot.Bar_axis.length) {
+        let label = _config.plot.label
+
+        if (label === 'false') {
+          _config.plot.customs.forEach(item => {
+            if (!Bar_axis.includes(item.type)) return
+            if (item.label === 'true') {
+              label = 'true'
+            }
+          })
+        } else {
+          let reset = true
+          _config.plot.customs.forEach(item => {
+            if (!Bar_axis.includes(item.type)) return
+            if (item.label === 'true') {
+              reset = false
+            }
+          })
+          if (reset) {
+            label = 'false'
+          }
+        }
+
+        _config.plot.$label = label
+      }
     } else {
       _config.plot.enabled = 'false'
     }
@@ -1051,9 +1077,17 @@
       .position(`${plot.Xaxis}*${_valfield}`)
       .shape(plot.shape || 'smooth')
       .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
+        let val = value
+        if (plot.show === 'percent') {
+          val = value + '%'
+        } else if (plot.show === 'thdSeparator') {
+          val = val + ''
+          val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+        }
+
         return {
           name: type,
-          value: plot.show === 'percent' ? value + '%' : value
+          value: val
         }
       })
 
@@ -1078,11 +1112,15 @@
         if (plot.labelValue === 'zero' && value === 0) {
           return null
         }
+        let val = value
         if (plot.show === 'percent') {
-          value = value + '%'
+          val = value + '%'
+        } else if (plot.show === 'thdSeparator') {
+          val = val + ''
+          val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
         }
         return {
-          content: value,
+          content: val,
           style: {
             fill: plot.color
           }
@@ -1292,12 +1330,16 @@
           ])
           .shape(plot.shape || 'rect')
           .tooltip(`${plot.Xaxis}*value*key`, (name, value, key) => {
+            let val = value
             if (plot.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (plot.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
             return {
               name: key,
-              value: value
+              value: val
             }
           })
 
@@ -1314,21 +1356,25 @@
         } else {
           _chart.color('key')
         }
-        if (plot.label !== 'false') {
+        if (plot.$label !== 'false') {
           _chart.label('value*key', (value, key) => {
             if (plot.labelValue === 'zero' && value === 0) {
               return null
             }
 
+            let val = value
             if (plot.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (plot.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
 
-            if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
+            if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
               lablecfg.style.fill = plot.$colors.get(key)
             }
             return {
-              content: value,
+              content: val,
               ...lablecfg
             }
           })
@@ -1347,12 +1393,16 @@
           .adjust('stack')
           .shape(plot.shape || 'rect')
           .tooltip(`${plot.Xaxis}*value*key`, (name, value, type) => {
+            let val = value
             if (plot.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (plot.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
             return {
               name: type,
-              value: value
+              value: val
             }
           })
   
@@ -1369,20 +1419,24 @@
         } else {
           _chart.color('key')
         }
-        if (plot.label !== 'false') {
+        if (plot.$label !== 'false') {
           _chart.label('value*key', (value, key) => {
             if (plot.labelValue === 'zero' && value === 0) {
               return null
             }
 
+            let val = value
             if (plot.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (plot.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
-            if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
+            if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
               lablecfg.style.fill = plot.$colors.get(key)
             }
             return {
-              content: value,
+              content: val,
               ...lablecfg
             }
           })
@@ -1438,9 +1492,16 @@
           .color(item.color)
           .shape(item.shape)
           .tooltip(`${item.name}`, (value) => {
+            let val = value
+            if (item.show === 'percent') {
+              val = value + '%'
+            } else if (item.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+            }
             return {
               name: item.name,
-              value: item.show === 'percent' ? value + '%' : value
+              value: val
             }
           })
 
@@ -1453,14 +1514,18 @@
               return null
             }
 
+            let val = value
             if (item.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (item.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
             if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) {
               lablecfg.style.fill = item.color
             }
             return {
-              content: value,
+              content: val,
               ...lablecfg
             }
           })
@@ -1493,9 +1558,17 @@
           .color(item.color)
           .shape(item.shape)
           .tooltip(`${item.name}`, (value) => {
+            let val = value
+            if (item.show === 'percent') {
+              val = value + '%'
+            } else if (item.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+            }
+
             return {
               name: item.name,
-              value: item.show === 'percent' ? value + '%' : value
+              value: val
             }
           })
 
@@ -1505,11 +1578,16 @@
               return null
             }
 
+            let val = value
             if (item.show === 'percent') {
-              value = value + '%'
+              val = value + '%'
+            } else if (item.show === 'thdSeparator') {
+              val = val + ''
+              val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
             }
+
             return {
-              content: value,
+              content: val,
               style: {
                 fill: plot.color
               }
@@ -1700,9 +1778,16 @@
         ])
         .shape(plot.shape || 'rect')
         .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
+          let val = value
+          if (plot.show === 'percent') {
+            val = value + '%'
+          } else if (plot.show === 'thdSeparator') {
+            val = val + ''
+            val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+          }
           return {
             name: type,
-            value: plot.show === 'percent' ? value + '%' : value
+            value: val
           }
         })
 
@@ -1739,8 +1824,12 @@
             return null
           }
 
+          let val = value
           if (plot.show === 'percent') {
-            value = value + '%'
+            val = value + '%'
+          } else if (plot.show === 'thdSeparator') {
+            val = val + ''
+            val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
           }
 
           if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
@@ -1748,7 +1837,7 @@
           }
 
           return {
-            content: value,
+            content: val,
             ...lablecfg
           }
         })
@@ -1776,9 +1865,16 @@
         .adjust('stack')
         .shape(plot.shape || 'rect')
         .tooltip(`${plot.Xaxis}*${_valfield}*${_typefield}`, (name, value, type) => {
+          let val = value
+          if (plot.show === 'percent') {
+            val = value + '%'
+          } else if (plot.show === 'thdSeparator') {
+            val = val + ''
+            val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+          }
           return {
             name: type,
-            value: plot.show === 'percent' ? value + '%' : value
+            value: val
           }
         })
 
@@ -1814,8 +1910,12 @@
             return null
           }
 
+          let val = value
           if (plot.show === 'percent') {
-            value = value + '%'
+            val = value + '%'
+          } else if (plot.show === 'thdSeparator') {
+            val = val + ''
+            val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
           }
 
           if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) {
@@ -1823,7 +1923,7 @@
           }
 
           return {
-            content: value,
+            content: val,
             ...lablecfg
           }
         })

--
Gitblit v1.8.0