From f267d04e0561a0a20d1f2a9f558a273558ece90d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 24 五月 2021 17:50:19 +0800
Subject: [PATCH] 2021-05-24

---
 src/menu/components/share/markcomponent/index.jsx |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx
index 03dd41d..3608c2e 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 = {
@@ -22,7 +23,7 @@
   }
 
   state = {
-    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     marks: null,
     columns: null,
     visible: false,
@@ -278,9 +279,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 +300,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() {
@@ -313,7 +336,6 @@
           visible={visible}
           width={'75vw'}
           maskClosable={false}
-          style={{minWidth: '900px', maxWidth: '1200px'}}
           okText={dict['model.submit']}
           onOk={this.markSubmit}
           onCancel={() => { this.setState({ visible: false }) }}

--
Gitblit v1.8.0