From 137fb8ea6af2789b3238b22bac31d80bced41dfe Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 28 七月 2021 11:39:39 +0800
Subject: [PATCH] 2021-07-28

---
 src/menu/components/share/markcomponent/index.jsx |   40 +++++++++++++++++++++++++++++++++-------
 1 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx
index af08d0c..4518ab6 100644
--- a/src/menu/components/share/markcomponent/index.jsx
+++ b/src/menu/components/share/markcomponent/index.jsx
@@ -13,6 +13,7 @@
 import '@/assets/css/table.scss'
 
 const EditTable = asyncComponent(() => import('@/templates/zshare/editTable'))
+const { confirm } = Modal
 
 class MarkColumn extends Component {
   static propTpyes = {
@@ -128,8 +129,11 @@
   resetMark = () => {
     const { marks, columns, type } = this.props
     let markColumns = fromJS(this.state.markColumns).toJS()
+    let _columns = fromJS(columns).toJS()
 
-    let options = columns.map(col => {
+    _columns.unshift({field: '$Index', label: '搴忓彿'})
+
+    let options = _columns.map(col => {
       return {
         value: col.field,
         label: col.label,
@@ -142,7 +146,7 @@
           {
             value: 'dynamic',
             label: '鍔ㄦ�佸��',
-            children: columns.map(cell => {
+            children: _columns.map(cell => {
               return {
                 value: cell.field,
                 label: cell.label
@@ -250,7 +254,7 @@
       }
     ]
 
-    if (type === 'line') {
+    if (type === 'line' || type === 'sequence') {
       signs.pop()
     } else if (type === 'slider') {
       markColumns = markColumns.filter(col => {
@@ -278,9 +282,13 @@
   }
 
   markSubmit = () => {
-    this.setState({
-      visible: false
-    })
+    let save = false
+    let input = document.getElementById('contrastValue')
+    let val = input && input.value ? input.value : ''
+
+    if (!val) {
+      save = true
+    }
 
     let marks = this.state.marks.map(item => {
       if (item.signType && item.signType[0] === 'background') {
@@ -295,10 +303,28 @@
           item.fontColor = ''
         }
       }
+      if (val && item.contrastValue === val) {
+        save = true
+      }
       return item
     })
 
-    this.props.onSubmit(marks)
+    if (save) {
+      this.setState({
+        visible: false
+      })
+      this.props.onSubmit(marks)
+    } else {
+      const _this = this
+      confirm({
+        title: '瀛樺湪鏈繚瀛樻爣璁帮紝纭畾蹇界暐鍚楋紵',
+        onOk() {
+          _this.setState({ visible: false })
+          _this.props.onSubmit(marks)
+        },
+        onCancel() {}
+      })
+    }
   }
 
   render() {

--
Gitblit v1.8.0