From 7b65909a89191830ceb45a54dbeac37561ffbe2f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 10 八月 2023 17:39:22 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/modalform/index.jsx | 2 src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 2 src/templates/zshare/editTable/index.jsx | 87 +++++++++++++++------ src/views/login/loginform.jsx | 8 +- src/menu/components/share/markcomponent/index.jsx | 47 +++++++++-- src/views/pcdesign/index.jsx | 3 src/views/login/logincloudform.jsx | 4 src/tabviews/zshare/actionList/printbutton/index.jsx | 2 src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss | 25 +++++ src/tabviews/zshare/mutilform/index.jsx | 2 src/views/tabledesign/index.jsx | 3 src/tabviews/zshare/actionList/normalbutton/index.jsx | 2 src/components/header/loginform.jsx | 4 src/views/mobdesign/index.jsx | 3 src/views/menudesign/index.jsx | 3 src/menu/components/share/markcomponent/markform/index.jsx | 3 src/utils/utils.js | 4 src/assets/css/main.scss | 12 +++ src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 2 19 files changed, 161 insertions(+), 57 deletions(-) diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index 4f694ca..25d2b93 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -16,6 +16,18 @@ outline: none; } } +::selection { + color: #ffffff; + background: var(--mk-sys-color); +} +::-moz-selection { + color: #ffffff; + background: var(--mk-sys-color); +} +::-webkit-selection { + color: #ffffff; + background: var(--mk-sys-color); +} .table-col-1, .table-col-2, .table-col-3, .table-col-4 { .ant-table colgroup > col.ant-table-selection-col { diff --git a/src/components/header/loginform.jsx b/src/components/header/loginform.jsx index 8639861..95e702f 100644 --- a/src/components/header/loginform.jsx +++ b/src/components/header/loginform.jsx @@ -59,8 +59,8 @@ values.password = oripassword } - values.username = values.username.replace(/\t*|\v*|\s*/g, '') - values.password = values.password.replace(/\t*|\v*|\s*/g, '') + values.username = values.username.replace(/\t+|\v+|\s+/g, '') + values.password = values.password.replace(/\t+|\v+|\s+/g, '') resolve(values) } else { diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index c188601..246f2ea 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Modal, Col } from 'antd' +import { Modal, Col, notification } from 'antd' import { AntDesignOutlined } from '@ant-design/icons' import Utils from '@/utils/utils.js' @@ -32,6 +32,20 @@ dataIndex: 'field', width: '16%', editable: true, + unique: true, + uniqueFunc: (data, item) => { + let index = data.findIndex(mark => mark.uuid !== item.uuid && mark.contrastValue === item.contrastValue && mark.match === item.match && mark.field.join('') === item.field.join('')) + + if (index > -1) { + notification.warning({ + top: 92, + message: '姝ゆ爣璁板凡瀛樺湪锛�', + duration: 5 + }) + return false + } + return true + }, inputType: 'cascader', options: [], rules: [{ @@ -118,18 +132,24 @@ markChange = (values) => { let _marks = fromJS(this.state.marks).toJS() - if (values.uuid) { - _marks = _marks.map(item => { - if (item.uuid === values.uuid) { - return values - } else { - return item - } + let has = false + _marks.forEach(mark => { + if (mark.contrastValue === values.contrastValue && mark.match === values.match && mark.field.join('') === values.field.join('')) { + has = true + } + }) + + if (has) { + notification.warning({ + top: 92, + message: '姝ゆ爣璁板凡瀛樺湪锛�', + duration: 5 }) - } else { - values.uuid = Utils.getuuid() - _marks.push(values) + return } + + values.uuid = Utils.getuuid() + _marks.push(values) this.setState({ marks: _marks @@ -319,6 +339,11 @@ item.fontColor = '' } } + + if (item.contrastValue) { + item.contrastValue = item.contrastValue.replace(/\t+|\v+|\s+/g, '') + } + if (val && item.contrastValue === val) { save = true } diff --git a/src/menu/components/share/markcomponent/markform/index.jsx b/src/menu/components/share/markcomponent/markform/index.jsx index 0603b31..0fb88dc 100644 --- a/src/menu/components/share/markcomponent/markform/index.jsx +++ b/src/menu/components/share/markcomponent/markform/index.jsx @@ -18,6 +18,9 @@ // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { + if (values.contrastValue) { + values.contrastValue = values.contrastValue.replace(/\t+|\v+|\s+/g, '') + } this.props.markChange(values) } }) diff --git a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss index c6186af..53361ec 100644 --- a/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss +++ b/src/tabviews/custom/components/chart/antv-X6/nodeupdate/index.scss @@ -167,12 +167,33 @@ width: 300px; margin-bottom: 10px; } - .ant-transfer-customize-list .ant-transfer-list { - min-height: 300px; + + .ant-tree-checkbox-checked .ant-tree-checkbox-inner { + background-color: var(--mk-sys-color); + border-color: var(--mk-sys-color); + } + .ant-tree-checkbox-checked::after { + border-color: var(--mk-sys-color); + } + .ant-tree-checkbox:hover .ant-tree-checkbox-inner { + border-color: var(--mk-sys-color); + } + .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover { + background-color: var(--mk-sys-color1); + } + .ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after { + border-color: var(--mk-sys-color4); + } + .ant-transfer-operation { + .ant-btn, .ant-btn:hover { + background-color: var(--mk-sys-color); + border-color: var(--mk-sys-color); + } } .ant-transfer-list-body { max-height: calc(100vh - 320px); + min-height: 300px; overflow-y: auto; } 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 5bdf293..0057c07 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -207,7 +207,7 @@ let xc = {label: { formatter: (val) => { - if (!val || /^\s*$/.test(val)) return val + if (!val || /^\s+$/.test(val)) return val let _val = `${val}` if (_val.length <= limit) return val return _val.substring(0, limit) + '...' diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 425cce5..7ab6d6e 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2866,7 +2866,7 @@ _item.fieldlen = item.decimal || 0 } else if (['text', 'textarea', 'linkMain'].includes(_item.type)) { _item.value = _item.value + '' - _item.value = _item.value.replace(/\t*|\v*/g, '') // 鍘婚櫎鍒惰〃绗� + _item.value = _item.value.replace(/\t+|\v+/g, '') // 鍘婚櫎鍒惰〃绗� if (item.interception !== 'false') { // 鍘婚櫎棣栧熬绌烘牸 _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 28aa16d..f89c377 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -2167,7 +2167,7 @@ _item.fieldlen = item.decimal || 0 } else if (['text', 'textarea', 'linkMain'].includes(_item.type)) { _item.value = _item.value + '' - _item.value = _item.value.replace(/\t*|\v*/g, '') // 鍘婚櫎鍒惰〃绗� + _item.value = _item.value.replace(/\t+|\v+/g, '') // 鍘婚櫎鍒惰〃绗� if (item.interception !== 'false') { // 鍘婚櫎棣栧熬绌烘牸 _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 337129f..0cc3dbd 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -1151,7 +1151,7 @@ _item.fieldlen = item.decimal || 0 } else if (['text', 'textarea', 'linkMain'].includes(item.type)) { _item.value = _item.value + '' - _item.value = _item.value.replace(/\t*|\v*/g, '') // 鍘婚櫎鍒惰〃绗� + _item.value = _item.value.replace(/\t+|\v+/g, '') // 鍘婚櫎鍒惰〃绗� if (item.interception !== 'false') { // 鍘婚櫎棣栧熬绌烘牸 _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 3d14095..34b71e8 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -756,7 +756,7 @@ ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { if (values[item]) { - values[item] = values[item].replace(/\s* | \t* | \v* | \r*/ig, '') + values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '') } }) diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index 205ece1..159a4c8 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -416,7 +416,9 @@ columns.forEach(col => { if (col.unique !== true || !unique) return - if (col.strict) { + if (col.uniqueFunc) { + unique = col.uniqueFunc(data, res.data) + } else if (col.strict) { let key = res.data[col.dataIndex].toLowerCase() let _index = data.findIndex(item => key === item[col.dataIndex].toLowerCase()) @@ -455,7 +457,9 @@ columns.forEach(col => { if (col.unique !== true || !unique) return - if (col.strict) { + if (col.uniqueFunc) { + unique = col.uniqueFunc(data, cell) + } else if (col.strict) { let _index = data.findIndex(item => cell[col.dataIndex].toLowerCase() === item[col.dataIndex].toLowerCase()) if (_index > -1) { @@ -518,15 +522,32 @@ columns.forEach(col => { if (col.unique !== true || !unique) return - let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex]) + if (col.uniqueFunc) { + unique = col.uniqueFunc(newData, record) + return + } else if (col.strict) { + let key = record[col.dataIndex].toLowerCase() + let _index = newData.findIndex(item => key === item[col.dataIndex].toLowerCase()) - if (_index > -1) { - notification.warning({ - top: 92, - message: col.title + '涓嶅彲閲嶅锛�', - duration: 5 - }) - unique = false + if (_index > -1) { + notification.warning({ + top: 92, + message: col.title + '涓嶅彲閲嶅锛�', + duration: 5 + }) + unique = false + } + } else { + let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex]) + + if (_index > -1) { + notification.warning({ + top: 92, + message: col.title + '涓嶅彲閲嶅锛�', + duration: 5 + }) + unique = false + } } }) @@ -557,31 +578,49 @@ } const newData = [...this.state.data] const index = newData.findIndex(item => uuid === item.uuid) + if (index > -1) { + row = {...newData[index], ...row} + } else { + row.uuid = uuid + } let unique = true columns.forEach(col => { if (col.unique !== true || !unique) return - let _index = newData.findIndex(item => uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex]) - - if (_index > -1) { - notification.warning({ - top: 92, - message: col.title + '涓嶅彲閲嶅锛�', - duration: 5 - }) - unique = false + if (col.uniqueFunc) { + unique = col.uniqueFunc(newData, row) + return + } else if (col.strict) { + let key = row[col.dataIndex].toLowerCase() + let _index = newData.findIndex(item => key === item[col.dataIndex].toLowerCase()) + + if (_index > -1) { + notification.warning({ + top: 92, + message: col.title + '涓嶅彲閲嶅锛�', + duration: 5 + }) + unique = false + } + } else { + let _index = newData.findIndex(item => row.uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex]) + + if (_index > -1) { + notification.warning({ + top: 92, + message: col.title + '涓嶅彲閲嶅锛�', + duration: 5 + }) + unique = false + } } }) if (!unique) return if (index > -1) { - const item = newData[index] - newData.splice(index, 1, { - ...item, - ...row, - }) + newData.splice(index, 1, row) this.setState({ data: newData, editingKey: '' }, () => { this.props.onChange(newData) }) diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 364f8a2..b49f28b 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -986,7 +986,7 @@ ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { if (values[item]) { - values[item] = values[item].replace(/\s*|\t*|\v*|\r*/ig, '') + values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '') } }) diff --git a/src/utils/utils.js b/src/utils/utils.js index 07320a8..bd64787 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -983,7 +983,7 @@ val = val.replace(/'/ig, '"') } - val = val.replace(/(^\s*$)|\t*|\v*/ig, '') + val = val.replace(/(^\s+$)|\t+|\v+/ig, '') if (!val && col.required === 'true') { // 蹇呭~鏍¢獙 errors.push(_position + '鍐呭涓嶅彲涓虹┖') @@ -1018,7 +1018,7 @@ val = moment('19000101', 'YYYYMMDD').add(Math.floor(val - 2), 'days').format('YYYY-MM-DD') } } else if (typeof(val) === 'string') { - val = val.replace(/(^\s*$)|\t*|\v*/ig, '') + val = val.replace(/(^\s+$)|\t+|\v+/ig, '') if (!val && col.required === 'true') { // 鏃堕棿蹇呭~鏍¢獙 errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙 diff --git a/src/views/login/logincloudform.jsx b/src/views/login/logincloudform.jsx index c87cf3f..374ef07 100644 --- a/src/views/login/logincloudform.jsx +++ b/src/views/login/logincloudform.jsx @@ -20,8 +20,8 @@ return new Promise((resolve, reject) => { this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - values.cloudusername = values.cloudusername.replace(/\t*|\v*|\s*/g, '') - values.cloudpassword = values.cloudpassword.replace(/\t*|\v*|\s*/g, '') + values.cloudusername = values.cloudusername.replace(/\t+|\v+|\s+/g, '') + values.cloudpassword = values.cloudpassword.replace(/\t+|\v+|\s+/g, '') resolve(values) } else { reject(err) diff --git a/src/views/login/loginform.jsx b/src/views/login/loginform.jsx index 1645257..a9b5143 100644 --- a/src/views/login/loginform.jsx +++ b/src/views/login/loginform.jsx @@ -161,11 +161,11 @@ this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { if (activeKey === 'uname_pwd') { - values.username = values.username.replace(/\t*|\v*|\s*/g, '') - values.password = values.password.replace(/\t*|\v*|\s*/g, '') + values.username = values.username.replace(/\t+|\v+|\s+/g, '') + values.password = values.password.replace(/\t+|\v+|\s+/g, '') } else if (activeKey === 'sms_vcode') { - values.phone = values.phone.replace(/\t*|\v*|\s*/g, '') - values.vercode = values.vercode.replace(/\t*|\v*|\s*/g, '') + values.phone = values.phone.replace(/\t+|\v+|\s+/g, '') + values.vercode = values.vercode.replace(/\t+|\v+|\s+/g, '') } resolve({type: activeKey, ...values}) } else { diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 1fb51dc..5976772 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -1045,7 +1045,6 @@ message: '淇濆瓨鎴愬姛', duration: 2 }) - MKEmitter.emit('completeSave') } else { notification.warning({ top: 92, @@ -1053,6 +1052,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } @@ -1069,6 +1069,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') } getRoleFields = () => { diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index b27f0a3..21bf77f 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1723,7 +1723,6 @@ message: '淇濆瓨鎴愬姛', duration: 2 }) - MKEmitter.emit('completeSave') } else { notification.warning({ top: 92, @@ -1731,6 +1730,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } @@ -1747,6 +1747,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') } getRoleFields = () => { diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 3e034d3..ff5b5b3 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1440,7 +1440,6 @@ message: '淇濆瓨鎴愬姛', duration: 2 }) - MKEmitter.emit('completeSave') } else { notification.warning({ top: 92, @@ -1448,6 +1447,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } @@ -1464,6 +1464,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') } getRoleFields = () => { diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index 1865fdf..936154b 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -692,7 +692,6 @@ message: '淇濆瓨鎴愬姛', duration: 2 }) - MKEmitter.emit('completeSave') } else { notification.warning({ top: 92, @@ -700,6 +699,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') }, this.netError) }, 300 + (+sessionStorage.getItem('mkDelay'))) } @@ -716,6 +716,7 @@ duration: 5 }) } + MKEmitter.emit('completeSave') } getRoleFields = () => { -- Gitblit v1.8.0