From 8a029b0dc49013c524792b76fb470265bfc89977 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 16 四月 2021 18:50:53 +0800 Subject: [PATCH] 2021-04-16 --- src/menu/components/share/markcomponent/index.jsx | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index af08d0c..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 = { @@ -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() { -- Gitblit v1.8.0