From ab949bb71eadda3ec1736ccdcfaa1b12b04cce6a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 05 十一月 2023 10:35:56 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/modalform/index.jsx | 12 src/assets/css/viewstyle.scss | 2 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx | 69 -- src/components/header/index.jsx | 3 src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 72 -- src/menu/datasource/verifycard/customscript/index.jsx | 70 -- src/utils/utils-custom.js | 147 ++++++ src/templates/zshare/verifycard/customscript/index.jsx | 70 -- src/views/menudesign/menuform/index.jsx | 14 src/tabviews/custom/popview/index.jsx | 18 src/views/tabledesign/index.jsx | 2 src/views/tabledesign/menuform/index.jsx | 14 src/menu/components/table/edit-table/options.jsx | 52 +- src/tabviews/basetable/index.jsx | 2 src/templates/zshare/verifycard/customform/index.jsx | 70 -- src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 70 -- src/views/billprint/index.jsx | 1 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 14 src/menu/components/table/edit-table/index.jsx | 2 src/views/menudesign/index.jsx | 2 src/views/tabledesign/menuform/index.scss | 16 src/utils/utils.js | 40 - src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 16 src/index.js | 1 src/views/sso/index.jsx | 4 src/views/menudesign/menuform/index.scss | 17 src/tabviews/custom/components/card/cardcellList/index.jsx | 7 src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 2 src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx | 14 src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx | 53 -- src/menu/datasource/verifycard/settingform/index.jsx | 60 -- src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx | 53 -- src/menu/components/share/actioncomponent/index.jsx | 2 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 20 src/tabviews/zshare/actionList/printbutton/index.jsx | 98 ++- src/tabviews/custom/components/table/edit-table/normalTable/index.scss | 1 src/menu/components/table/edit-table/columns/index.scss | 2 src/tabviews/custom/index.jsx | 2 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | 70 -- src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 53 -- src/templates/zshare/customscript/index.jsx | 73 -- src/menu/components/table/edit-table/columns/index.jsx | 6 src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 12 src/views/login/index.jsx | 4 44 files changed, 399 insertions(+), 933 deletions(-) diff --git a/src/assets/css/viewstyle.scss b/src/assets/css/viewstyle.scss index 94f61a3..14d73b8 100644 --- a/src/assets/css/viewstyle.scss +++ b/src/assets/css/viewstyle.scss @@ -219,7 +219,7 @@ } .ant-pagination-options { > div:not(:first-child) { - z-index: 1; + z-index: 3; } } } diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 9269928..fc4d28c 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -328,6 +328,7 @@ trdItem.type = PageParam.Template || 'CommonTable' trdItem.OpenType = PageParam.OpenType || 'newtab' trdItem.hidden = PageParam.hidden || 'false' + trdItem.menuColor = PageParam.menuColor || '' if (trdItem.type === 'NewPage') { trdItem.OpenType = 'newpage' @@ -706,7 +707,7 @@ <div className="title" onClick={e => e.stopPropagation()}>{cell.MenuName}</div> <div className="menu-detail"> {cell.children && cell.children.map(m => ( - <div key={m.MenuID} title={m.MenuName} onClick={() => {this.changeVerMenu(m)}}> + <div key={m.MenuID} title={m.MenuName} style={m.menuColor ? {color: m.menuColor} : null} onClick={() => {this.changeVerMenu(m)}}> {m.MenuName} </div> ))} diff --git a/src/index.js b/src/index.js index 2e62f85..b0c1060 100644 --- a/src/index.js +++ b/src/index.js @@ -175,6 +175,7 @@ GLOB.showline = _systemMsg.showline || '' GLOB.navBar = _systemMsg.navBar || 'shutter' GLOB.appVersion = _systemMsg.app_version || '' + sessionStorage.setItem('appname', _systemMsg.appname || '') let levels = [30, 10, 20, 40, 50, 60, 70, 80, 90, 100] diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index a66f2fa..e33d65e 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -136,7 +136,7 @@ changeBtnStyle = (element) => { let _style = element.style ? fromJS(element.style).toJS() : {} - let options = ['font', 'border', 'background', 'margin', 'padding'] + let options = ['font', 'border', 'background', 'margin', 'padding', 'minHeight'] this.setState({ card: element diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index 9e795e5..0c32473 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -600,6 +600,14 @@ options: fields }, { + type: 'text', + key: 'ctrlValue', + label: '绂佹鍊�', + initVal: card.ctrlValue || '', + tooltip: '澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', + required: false + }, + { type: 'select', key: 'clearField', label: '娓呯┖瀛楁', @@ -608,14 +616,6 @@ allowClear: true, required: false, options: fields - }, - { - type: 'text', - key: 'ctrlValue', - label: '绂佹鍊�', - initVal: card.ctrlValue || '', - tooltip: '澶氫釜鍊肩敤閫楀彿鍒嗛殧銆�', - required: false }, { type: 'number', diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index ccd72fa..1077a06 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -6,6 +6,7 @@ import Api from '@/api' import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import { getColumnForm } from './formconfig' import asyncComponent from '@/utils/asyncComponent' import { formRule } from '@/utils/option.js' @@ -521,16 +522,9 @@ } if (values.dataSource) { - let error = Utils.verifySql(values.dataSource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) - return - } + let pass = checkSQL(values.dataSource) + + if (!pass) return } if (values.editType === 'select' && values.resourceType === '1' && values.dataSource) { diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index e6e92ee..a141757 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -190,8 +190,9 @@ class NormalTableColumns extends Component { static propTpyes = { - config: PropTypes.object, // 閰嶇疆淇℃伅 - updatecolumn: PropTypes.func // 鏁版嵁鍙樺寲 + config: PropTypes.object, + updatecolumn: PropTypes.func, + addColumns: PropTypes.func } state = { @@ -691,6 +692,7 @@ } trigger="hover"> <Button className="submit-btn" style={config.submit.style} onDoubleClick={() => this.setState({visible: true})} type="primary">鎻愪氦</Button> </Popover> + <PlusOutlined title="娣诲姞鍒�" onClick={this.props.addColumns}/> <CopyOutlined title="澶嶅埗鏄剧ず鍒�" onClick={this.copycolumn} /> <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> <ColsControl config={config} onSubmit={this.props.updatecolumn}/> diff --git a/src/menu/components/table/edit-table/columns/index.scss b/src/menu/components/table/edit-table/columns/index.scss index 613cfb2..ec4172d 100644 --- a/src/menu/components/table/edit-table/columns/index.scss +++ b/src/menu/components/table/edit-table/columns/index.scss @@ -109,7 +109,7 @@ margin-right: 10px; cursor: pointer; } - >.anticon-copy { + >.anticon-copy, >.anticon-plus { color: #26C281; margin-left: 5px; } diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx index 78760b7..ed62fd1 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx @@ -3,8 +3,8 @@ import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -95,73 +95,9 @@ values.status = editItem.status || 'true' } - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') let tail = ` diff --git a/src/menu/components/table/edit-table/index.jsx b/src/menu/components/table/edit-table/index.jsx index 2595c3d..7c38a7a 100644 --- a/src/menu/components/table/edit-table/index.jsx +++ b/src/menu/components/table/edit-table/index.jsx @@ -371,7 +371,7 @@ </Popover> <SearchComponent config={card} updatesearch={this.updateComponent}/> <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/> - <ColumnComponent config={card} updatecolumn={this.updatecolumn}/> + <ColumnComponent config={card} updatecolumn={this.updatecolumn} addColumns={this.addColumns}/> <div className="component-name"> <div className="center"> <div className="title" onDoubleClick={() => { diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx index 33616a8..2c88ad3 100644 --- a/src/menu/components/table/edit-table/options.jsx +++ b/src/menu/components/table/edit-table/options.jsx @@ -78,18 +78,18 @@ {value: 'multi', label: '鏁翠綋'}, ] }, - { - type: 'radio', - field: 'cache', - label: '缂撳瓨', - initval: wrap.cache || 'true', - tooltip: '瀵逛簬浣跨敤鏁版嵁婧愮殑涓嬫媺鑿滃崟锛屼笅鎷夐�夐」鏄惁缂撳瓨鍒版湰鍦般��', - required: false, - options: [ - {value: 'true', label: '浣跨敤'}, - {value: 'false', label: '涓嶄娇鐢�'}, - ] - }, + // { + // type: 'radio', + // field: 'cache', + // label: '缂撳瓨', + // initval: wrap.cache || 'true', + // tooltip: '瀵逛簬浣跨敤鏁版嵁婧愮殑涓嬫媺鑿滃崟锛屼笅鎷夐�夐」鏄惁缂撳瓨鍒版湰鍦般��', + // required: false, + // options: [ + // {value: 'true', label: '浣跨敤'}, + // {value: 'false', label: '涓嶄娇鐢�'}, + // ] + // }, { type: 'radio', field: 'tableType', @@ -100,6 +100,20 @@ {value: '', label: '涓嶅彲閫�'}, {value: 'radio', label: '鍗曢��'}, {value: 'checkbox', label: '澶氶��'}, + ] + }, + { + type: 'radio', + field: 'size', + label: '琛ㄦ牸澶у皬', + initval: wrap.size || 'middle', + tooltip: '琛ㄦ牸鐨勫唴杈硅窛锛屼粠澶у埌灏忎緷娆¢�掑噺銆�', + required: false, + options: [ + {value: 'default', label: '澶�'}, + {value: 'middle', label: '涓�'}, + {value: 'small', label: '灏�'}, + {value: 'mini', label: '杩蜂綘'}, ] }, { @@ -122,20 +136,6 @@ options: [ {value: 'show', label: '鏄剧ず'}, {value: 'hidden', label: '闅愯棌'}, - ] - }, - { - type: 'radio', - field: 'size', - label: '琛ㄦ牸澶у皬', - initval: wrap.size || 'middle', - tooltip: '琛ㄦ牸鐨勫唴杈硅窛锛屼粠澶у埌灏忎緷娆¢�掑噺銆�', - required: false, - options: [ - {value: 'default', label: '澶�'}, - {value: 'middle', label: '涓�'}, - {value: 'small', label: '灏�'}, - {value: 'mini', label: '杩蜂綘'}, ] }, { diff --git a/src/menu/datasource/verifycard/customscript/index.jsx b/src/menu/datasource/verifycard/customscript/index.jsx index 8f28de4..e1f4766 100644 --- a/src/menu/datasource/verifycard/customscript/index.jsx +++ b/src/menu/datasource/verifycard/customscript/index.jsx @@ -6,7 +6,7 @@ import Toast from 'antd-mobile/es/components/toast' import Dialog from 'antd-mobile/es/components/dialog' -import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import MKEmitter from '@/utils/events.js' import './index.scss' @@ -107,73 +107,9 @@ values.uuid = this.state.editItem ? this.state.editItem.uuid : '' - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return if (skip) { this.setState({ diff --git a/src/menu/datasource/verifycard/settingform/index.jsx b/src/menu/datasource/verifycard/settingform/index.jsx index a97fa31..5f5d523 100644 --- a/src/menu/datasource/verifycard/settingform/index.jsx +++ b/src/menu/datasource/verifycard/settingform/index.jsx @@ -5,8 +5,8 @@ import { QuestionCircleOutlined, PlusOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import Utils from '@/utils/utils.js' import MenuUtils from '@/utils/utils-custom.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import KeyInterface from '@/components/keyInterface' import './index.scss' @@ -108,56 +108,9 @@ // 鏁版嵁婧愬墠绔獙璇� if (values.interType === 'system' && values.execute !== 'false' && values.dataresource) { - let _quot = values.dataresource.match(/'{1}/g) - let _lparen = values.dataresource.match(/\({1}/g) - let _rparen = values.dataresource.match(/\){1}/g) + let pass = checkSQL(values.dataresource) - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (/--/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - reject() - return - } else if (/,,/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', - duration: 5 - }) - reject() - return - } - - let error = Utils.verifySql(values.dataresource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) + if (!pass) { reject() return } @@ -521,12 +474,7 @@ </Form.Item> </Col> : null} {config.pageable && setting.laypage !== 'false' ? <Col span={8}> - <Form.Item label={ - <Tooltip placement="topLeft" title="閫夋嫨鍒嗛〉鏃舵湁鏁堛��"> - <QuestionCircleOutlined className="mk-form-tip" /> - 姣忛〉鏁伴噺 - </Tooltip> - }> + <Form.Item label="姣忛〉鏁伴噺"> {getFieldDecorator('pageSize', { initialValue: setting.pageSize || 10, rules: [ diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 6e2c374..565fea4 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -516,6 +516,8 @@ getPrinter = (item, parentId) => { let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid) + item.verify.logLabel = item.logLabel + if (_item) { item.printer = _item.printer || '' item.verify.defaultPrinter = _item.printer || '' diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 5ca4716..9e1377f 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -294,12 +294,13 @@ if (card.datatype === 'static') { val = card.value || '' - if (/@username@|@fullName@|@mk_city@|@bid@/ig.test(val)) { + if (/@username@|@fullName@|@mk_city@|@appname@|@bid@/ig.test(val)) { let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' let city = sessionStorage.getItem('city') || '' + let appname = sessionStorage.getItem('appname') || '' let bid = data.$$BID || '' - val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) + val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@appname@/ig, appname).replace(/@bid@/ig, bid) } else if (/@month@/ig.test(val)) { val = val.replace(/@month@/ig, new Date().toLocaleString('en-US', { month: 'long' })) } else if (/@week@/ig.test(val)) { @@ -813,7 +814,7 @@ val += _val }) - } else if (data && data.$$empty) { + } else if (data && data.$$empty && /@.*@/.test(card.formula)) { val = '' } else if (data) { let _val = card.formula diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index ed634a0..4c039a7 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -1389,7 +1389,7 @@ if (item.resourceType === '1') { let _option = Utils.getSelectQueryOptions(item) - if (/@BID@/ig.test(_option.sql)) { + if (/@BID@/ig.test(_option.sql) && setting.supModule) { hasBid = true } @@ -1490,14 +1490,11 @@ pageOptions, columns: _columns, tableId: setting.tableId, - orderfields + orderfields, + deForms: hasBid ? deForms : null }, () => { - if (deForms.length > 0) { - if (hasBid && setting.supModule && !BID) { - this.setState({ deForms }) - } else { - this.improveActionForm(deForms, BID) - } + if (deForms.length > 0 && (!hasBid || BID)) { + this.improveActionForm(deForms, BID) } }) } @@ -1793,12 +1790,9 @@ } improveActionForm = (deForms, BID) => { - const { setting } = this.props - let deffers = [] let mainItems = [] // 浜戠鎴栧崟鐐规暟鎹� let localItems = [] // 鏈湴鏁版嵁 - let cache = setting.cache !== 'false' let debug = window.GLOB.debugger === true let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` let _sso = _sql @@ -1850,7 +1844,7 @@ deffers.push( new Promise(resolve => { - Api.getSystemCacheConfig(param, cache).then(res => { + Api.getSystemCacheConfig(param, false).then(res => { if (!res.status) { notification.warning({ top: 92, @@ -1885,7 +1879,7 @@ deffers.push( new Promise(resolve => { - Api.getSystemCacheConfig(mainparam, cache).then(res => { + Api.getSystemCacheConfig(mainparam, false).then(res => { if (!res.status) { notification.warning({ top: 92, diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss index be948ed..0953cbe 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.scss +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.scss @@ -186,6 +186,7 @@ right: 0px; bottom: 0px; border: 1px solid var(--mk-sys-color); + background: #ffffff; } } .ant-calendar-picker { diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx index e99578c..47eb46b 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/mkPopSelect/index.jsx @@ -284,7 +284,7 @@ this.props.onChange(values, record.$$uuid) - this.setState({visible: false}) + this.setState({visible: false, value: record.$$uuid}) if (config.$ctrl) { MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) @@ -294,11 +294,13 @@ if (config.enter === '$noAct') return - if (/\$next/.test(config.enter)) { - MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) - } else { - MKEmitter.emit('setFocus' + config.tableId, lineId, config.enter) - } + setTimeout(() => { + if (/\$next/.test(config.enter)) { + MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) + } else { + MKEmitter.emit('setFocus' + config.tableId, lineId, config.enter) + } + }, 10) } trigger = (e) => { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 7fea2ad..373d6df 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -990,6 +990,8 @@ getPrinter = (item, parentId) => { let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid) + item.verify.logLabel = item.logLabel + if (_item) { item.printer = _item.printer || '' item.verify.defaultPrinter = _item.printer || '' diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index b2a01d8..f7e15a4 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -699,24 +699,6 @@ return cell } - getPrinter = (item, parentId) => { - let _item = window.GLOB.UserCacheMap.get(parentId + item.uuid) - - if (_item) { - item.printer = _item.printer || '' - item.verify.defaultPrinter = _item.printer || '' - if (item.verify.printerTypeList && _item.printerList) { - item.verify.printerTypeList = item.verify.printerTypeList.map(cell => { - cell.printer = _item.printerList[cell.Value] || '' - - return cell - }) - } - } - - return item - } - // 鏍煎紡鍖栭粯璁よ缃� formatSetting = (components, params, regs, balMap) => { let delay = 20 diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index b55792d..a6a037c 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -270,6 +270,9 @@ Object.keys(cell).forEach(key => { let _key = key.toLowerCase() + + if (/^\$/.test(_key)) return + _cell[_key] = cell[key] }) @@ -564,16 +567,28 @@ execCustomPrint = (printlist, formdata) => { const { btn } = this.props - this.execSuccess({ - ErrCode: '-1', - message: '', - status: true - }) + let callback = null + + if (/callback\(\)/.test(btn.verify.printFunc)) { + callback = () => { + this.execSuccess({ + ErrCode: '-1', + message: '', + status: true + }) + } + } else { + this.execSuccess({ + ErrCode: '-1', + message: '', + status: true + }) + } try { // eslint-disable-next-line - let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', btn.verify.printFunc) - func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType) + let func = new Function('data', 'form', 'printer', 'notification', 'Api', 'systemType', 'callback', btn.verify.printFunc) + func(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType, callback) // 鑷畾涔夋墦鍗扮ず渚� // let defaultPrinter = printer.defaultPrinter || 'lackprinter' @@ -769,18 +784,11 @@ } catch (e) { console.warn(e) - try { - // eslint-disable-next-line - let evalfunc = eval('(true && function (data, form, printer, notification, Api, systemType) {' + btn.verify.printFunc + '})') - evalfunc(printlist, formdata, btn.verify, notification, Api, window.GLOB.systemType) - } catch (error) { - console.warn(error) - notification.warning({ - top: 92, - message: '鑷畾涔夊嚱鏁版墽琛岄敊璇紒', - duration: 5 - }) - } + notification.warning({ + top: 92, + message: '鑷畾涔夊嚱鏁版墽琛岄敊璇紒', + duration: 5 + }) } } @@ -1761,26 +1769,35 @@ return } + if (printerList.length === 0) { + this.execSuccess({ + ErrCode: '-1', + message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�', + status: true + }) + return + } + if (!socket || socket.readyState !== 1 || socket.url !== 'ws://' + btn.verify.linkUrl) { socket = new WebSocket('ws://' + btn.verify.linkUrl) } else { - this.syncMessageSend(printerList) - - this.execSuccess({ - ErrCode: 'S', - message: '鎵撳嵃璇锋眰宸插彂鍑恒��', - status: true + this.syncMessageSend(printerList, () => { + this.execSuccess({ + ErrCode: 'S', + message: '鎵撳嵃璇锋眰宸插彂鍑恒��', + status: true + }) }) } // 鎵撳紑Socket socket.onopen = () =>{ - this.syncMessageSend(printerList) - - this.execSuccess({ - ErrCode: 'S', - message: '鎵撳嵃璇锋眰宸插彂鍑恒��', - status: true + this.syncMessageSend(printerList, () => { + this.execSuccess({ + ErrCode: 'S', + message: '鎵撳嵃璇锋眰宸插彂鍑恒��', + status: true + }) }) } // 鐩戝惉娑堟伅 @@ -1835,17 +1852,26 @@ } } - syncMessageSend = (list) => { + syncMessageSend = (list, callback) => { let param = list.shift() - if (socket && param) { - socket.send(JSON.stringify(param)) + if (socket) { + try { + socket.send(JSON.stringify(param)) + } catch(e) { + console.warn('鎵撳嵃璇锋眰鍙戦�佸け璐ワ紒') + } } - if (list && list.length > 0) { - setTimeout(() => {this.syncMessageSend(list)}, 3000) + if (list.length > 0) { + setTimeout(() => { + this.syncMessageSend(list, callback) + }, 3000) + } else { + callback() } } + /** * @description 鎿嶄綔鎴愬姛鍚庡鐞� * 1銆乪xcel瀵煎嚭锛屾垚鍔熷悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 73b091b..ab0f6ad 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -4,8 +4,8 @@ import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -112,73 +112,9 @@ values.status = editItem.status || 'true' } - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') let tail = ` diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx index 365fd36..2ac2c12 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx @@ -7,6 +7,7 @@ import Api from '@/api' import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -147,73 +148,9 @@ values.uuid = this.state.editItem ? this.state.editItem.uuid : '' - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return this.setState({ loading: true diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index 6d1b718..1bbd830 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -3,7 +3,7 @@ import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -44,56 +44,9 @@ reject() return } else if (values.defaultSql === 'true' && values.dataresource) { - let _quot = values.dataresource.match(/'{1}/g) - let _lparen = values.dataresource.match(/\({1}/g) - let _rparen = values.dataresource.match(/\){1}/g) + let pass = checkSQL(values.dataresource) - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (/--/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - reject() - return - } else if (/,,/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', - duration: 5 - }) - reject() - return - } - - let error = Utils.verifySql(values.dataresource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) + if (!pass) { reject() return } diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index 494b38b..2d94432 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -270,7 +270,7 @@ dataType: _verify.dataType || 'line', linkType: _verify.linkType, printMode: _verify.printMode, - printFunc: _verify.printFunc || '// Function(data, form, printer, notification) data-鎵撳嵃鏁版嵁鍒楄〃锛宖orm-琛ㄥ崟淇℃伅锛堜笉瀛樺湪鏃朵负{}锛夛紝printer-鎵撳嵃璁剧疆锛宯otification-淇℃伅鎻愮ず鎺т欢' + printFunc: _verify.printFunc || '// Function(data, form, printer, notification) data-鎵撳嵃鏁版嵁鍒楄〃锛宖orm-琛ㄥ崟淇℃伅锛堜笉瀛樺湪鏃朵负{}锛夛紝printer-鎵撳嵃璁剧疆锛宯otification-淇℃伅鎻愮ず鎺т欢锛宑allback-閲婃斁鎸夐挳鐨勫洖璋�' }) } diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index efd4a13..5dbb18b 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -6,6 +6,7 @@ import { dateOptions, matchReg, formRule } from '@/utils/option.js' import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -828,16 +829,9 @@ } }) - let error = Utils.verifySql(values.dataSource) + let pass = checkSQL(values.dataSource) - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) - return - } + if (!pass) return resolve(values) } else { diff --git a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx index 30cbbed..404d13d 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/datasource/index.jsx @@ -4,7 +4,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' // import './index.scss' @@ -84,56 +84,9 @@ reject() return } else if (values.interType === 'system' && values.default !== 'false' && values.dataresource) { - let _quot = values.dataresource.match(/'{1}/g) - let _lparen = values.dataresource.match(/\({1}/g) - let _rparen = values.dataresource.match(/\){1}/g) + let pass = checkSQL(values.dataresource) - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (/--/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - reject() - return - } else if (/,,/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', - duration: 5 - }) - reject() - return - } - - let error = Utils.verifySql(values.dataresource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) + if (!pass) { reject() return } diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx index 6ac9645..064c117 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/datasource/index.jsx @@ -4,7 +4,7 @@ import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' -import Utils from '@/utils/utils.js' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' // import './index.scss' @@ -73,56 +73,9 @@ reject() return } else if (values.interType === 'system' && values.default !== 'false' && values.dataresource) { - let _quot = values.dataresource.match(/'{1}/g) - let _lparen = values.dataresource.match(/\({1}/g) - let _rparen = values.dataresource.match(/\){1}/g) + let pass = checkSQL(values.dataresource) - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑\'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - reject() - return - } else if (/--/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - reject() - return - } else if (/,,/ig.test(values.dataresource)) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿锛�,,锛�', - duration: 5 - }) - reject() - return - } - - let error = Utils.verifySql(values.dataresource) - - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) + if (!pass) { reject() return } diff --git a/src/templates/zshare/customscript/index.jsx b/src/templates/zshare/customscript/index.jsx index 80db92a..b3a0de2 100644 --- a/src/templates/zshare/customscript/index.jsx +++ b/src/templates/zshare/customscript/index.jsx @@ -7,6 +7,7 @@ import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import asyncComponent from '@/utils/asyncComponent' import MKEmitter from '@/utils/events.js' @@ -202,77 +203,13 @@ return } + let pass = checkSQL(_sql, 'customscript') + + if (!pass) return + let values = { uuid: editItem && editItem.uuid ? editItem.uuid : Utils.getuuid(), sql: _sql - } - - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) - - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return } let _scripts = fromJS(scripts).toJS() diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 310bdb6..7ae6d40 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -9,6 +9,7 @@ import { dateOptions } from '@/utils/option.js' import Utils from '@/utils/utils.js' import EditTable from './modaleditable' +import { checkSQL } from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -1075,16 +1076,9 @@ } }) - let error = Utils.verifySql(values.dataSource) + let pass = checkSQL(values.dataSource) - if (error) { - notification.warning({ - top: 92, - message: '鏁版嵁婧愪腑涓嶅彲浣跨敤' + error, - duration: 5 - }) - return - } + if (!pass) return window.GLOB.formId = card.uuid diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index 002b1da..347e92c 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx @@ -1,10 +1,10 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' +import { Form, Row, Col, Button, Modal, Tooltip, Radio, Select, Switch } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -42,73 +42,9 @@ if (!err) { values.uuid = editItem ? editItem.uuid : '' - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return let tail = ` aaa: diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index 5b9ec40..c149f84 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -2,8 +2,8 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Input, Select, Button, notification, Modal, Tooltip } from 'antd' -import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' // import './index.scss' @@ -60,73 +60,9 @@ values.uuid = this.state.editItem ? this.state.editItem.uuid : '' values.resultName = values.result === 'false' ? '涓嶅瓨鍦�' : '瀛樺湪' - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql) - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return let sql = `${this.props.initsql} /* 鑷畾涔夐獙璇� */ diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index 42c568b..5e204ba 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -3,8 +3,8 @@ import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' -import Utils from '@/utils/utils.js' import Api from '@/api' +import { checkSQL } from '@/utils/utils-custom.js' import CodeMirror from '@/templates/zshare/codemirror' import './index.scss' @@ -72,73 +72,9 @@ values.status = editItem.status || 'true' } - let _quot = values.sql.match(/'{1}/g) - let _lparen = values.sql.match(/\({1}/g) - let _rparen = values.sql.match(/\){1}/g) + let pass = checkSQL(values.sql, 'customscript') - _quot = _quot ? _quot.length : 0 - _lparen = _lparen ? _lparen.length : 0 - _rparen = _rparen ? _rparen.length : 0 - - if (_quot % 2 !== 0) { - notification.warning({ - top: 92, - message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (_lparen !== _rparen) { - notification.warning({ - top: 92, - message: 'sql涓�()蹇呴』鎴愬鍑虹幇', - duration: 5 - }) - return - } else if (/--/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇瀛楃 -- 锛屾敞閲婅鐢� /*鍐呭*/', - duration: 5 - }) - return - } else if (/,,/ig.test(values.sql)) { - notification.warning({ - top: 92, - message: '鑷畾涔塻ql璇彞涓紝涓嶅彲鍑虹幇杩炵画鐨勮嫳鏂囬�楀彿锛�,,锛�', - duration: 5 - }) - return - } else if (/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(values.sql)) { - let list = values.sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) - let errors = [] - list.forEach(str => { - str = str.replace(/^\s/, '') - let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) - if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { - errors.push(str) - } - }) - - if (errors.length > 0) { - notification.warning({ - top: 92, - message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), - duration: 5 - }) - return - } - } - - let error = Utils.verifySql(values.sql, 'customscript') - - if (error) { - notification.warning({ - top: 92, - message: 'sql涓笉鍙娇鐢�' + error, - duration: 5 - }) - return - } + if (!pass) return let tail = ` aaa: diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 6e80931..350ccc7 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -1,4 +1,5 @@ import md5 from 'md5' +import { notification } from 'antd' export default class MenuUtils { /** @@ -1702,4 +1703,150 @@ } return errors +} + +/** + * @description 妫�娴媠ql + */ +export function checkSQL(sql, type) { + if (!sql) return true + + let label = '鏁版嵁婧愪腑' + if (type === 'customscript') { + label = '鑷畾涔塻ql璇彞涓�' + } + + let _quot = sql.match(/'{1}/g) + let _lparen = sql.match(/\({1}/g) + let _rparen = sql.match(/\){1}/g) + + _quot = _quot ? _quot.length : 0 + _lparen = _lparen ? _lparen.length : 0 + _rparen = _rparen ? _rparen.length : 0 + + if (_quot % 2 !== 0) { + notification.warning({ + top: 92, + message: 'sql涓璡'蹇呴』鎴愬鍑虹幇', + duration: 5 + }) + return false + } else if (_lparen !== _rparen) { + notification.warning({ + top: 92, + message: 'sql涓�()蹇呴』鎴愬鍑虹幇', + duration: 5 + }) + return false + } else if (/--/ig.test(sql)) { + let lines = [] + sql.split(/\n/).forEach((s, i) => { + if (/--/ig.test(s)) { + lines.push(i + 1) + } + }) + + lines = lines.join('銆�') + lines = lines ? '(绗�' + lines + '琛�)' : '' + + notification.warning({ + top: 92, + message: label + `${lines}锛屼笉鍙嚭鐜板瓧绗� -- 锛屾敞閲婅鐢� /*鍐呭*/`, + duration: 5 + }) + return false + } else if (/,,/ig.test(sql)) { + let lines = [] + sql.split(/\n/).forEach((s, i) => { + if (/,,/ig.test(s)) { + lines.push(i + 1) + } + }) + + lines = lines.join('銆�') + lines = lines ? '(绗�' + lines + '琛�)' : '' + + notification.warning({ + top: 92, + message: label + `${lines}锛屼笉鍙嚭鐜拌繛缁殑鑻辨枃閫楀彿,,`, + duration: 5 + }) + return false + } else if (/鈥榺鈥�/ig.test(sql)) { + let lines = [] + sql.split(/\n/).forEach((s, i) => { + if (/鈥榺鈥�/ig.test(s)) { + lines.push(i + 1) + } + }) + + lines = lines.join('銆�') + lines = lines ? '(绗�' + lines + '琛�)' : '' + + notification.warning({ + top: 92, + message: label + `${lines}锛屼笉鍙嚭鐜颁腑鏂囧崟寮曞彿`, + duration: 5 + }) + return false + } else if (type === 'customscript' && /\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig.test(sql)) { + let list = sql.match(/\son\s+[a-z0-9_]+\.[a-z0-9_]+\s*=\s*[a-z0-9_]+\.[a-z0-9_]+/ig) + let errors = [] + list.forEach(str => { + str = str.replace(/^\s/, '') + let strs = str.match(/(\s|=)[a-z0-9_]+\./ig) + if (strs.length === 2 && (strs[0].replace(/\s|\./g, '') === strs[1].replace(/\s|\./g, ''))) { + errors.push(str) + } + }) + + if (errors.length > 0) { + notification.warning({ + top: 92, + message: '涓嶅彲浣跨敤鍚屼竴涓〃瀛楁杩涜鍏宠仈锛�' + errors.join('銆�'), + duration: 5 + }) + return false + } + } + + let error = '' + let chars = [ + {key: 'create', reg: /(^|\s|\(|\))create\s/ig}, + {key: 'insert', reg: /(^|\s|\(|\))insert\s/ig}, + {key: 'delete', reg: /(^|\s|\(|\))delete\s/ig}, + {key: 'update', reg: /(^|\s|\(|\))update\s/ig}, + {key: 'set', reg: /(^|\s|\(|\))set\s/ig}, + {key: 'drop', reg: /(^|\s|\(|\))drop\s/ig}, + {key: 'alter', reg: /(^|\s|\(|\))alter\s/ig}, + {key: 'truncate', reg: /(^|\s|\(|\))truncate\s/ig}, + {key: 'if', reg: /(^|\s|\(|\))if\s/ig}, + {key: 'exec', reg: /(^|\s|\(|\))exec(\s|\()/ig}, + {key: 'OBJECT', reg: /(^|\s|\(|\))object(\s|\()/ig}, + {key: 'sys.', reg: /(^|\s|\(|\))sys\./ig}, + {key: 'kill', reg: /(^|\s|\(|\))kill\s/ig} + ] + + if (type === 'customscript') { + chars = chars.filter(char => !['create', 'insert', 'delete', 'update', 'set', 'drop', 'if', 'exec'].includes(char.key)) + } + + sql = sql.replace(/sys\.fn_/ig, '') // 璺宠繃sys.fn_楠岃瘉 + + chars.forEach(char => { + if (!error && char.reg.test(sql)) { + error = char.key + } + }) + + if (error) { + notification.warning({ + top: 92, + message: 'sql涓笉鍙娇鐢�' + error, + duration: 5 + }) + return false + } + + return true } \ No newline at end of file diff --git a/src/utils/utils.js b/src/utils/utils.js index 3c4adea..74db930 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -116,46 +116,6 @@ } /** - * @description sql璇硶楠岃瘉 - * @return {String} sql sql璇彞 - * @return {String} type 楠岃瘉绫诲瀷 - */ - static verifySql (sql, type) { - if (!sql) return '' - let chars = [ - {key: 'create', reg: /(^|\s|\(|\))create\s/ig}, - {key: 'insert', reg: /(^|\s|\(|\))insert\s/ig}, - {key: 'delete', reg: /(^|\s|\(|\))delete\s/ig}, - {key: 'update', reg: /(^|\s|\(|\))update\s/ig}, - {key: 'set', reg: /(^|\s|\(|\))set\s/ig}, - {key: 'drop', reg: /(^|\s|\(|\))drop\s/ig}, - {key: 'alter', reg: /(^|\s|\(|\))alter\s/ig}, - {key: 'truncate', reg: /(^|\s|\(|\))truncate\s/ig}, - {key: 'if', reg: /(^|\s|\(|\))if\s/ig}, - {key: 'exec', reg: /(^|\s|\(|\))exec(\s|\()/ig}, - {key: 'OBJECT', reg: /(^|\s|\(|\))object(\s|\()/ig}, - {key: 'sys.', reg: /(^|\s|\(|\))sys\./ig}, - {key: 'kill', reg: /(^|\s|\(|\))kill\s/ig} - ] - - if (type === 'customscript') { - chars = chars.filter(char => !['create', 'insert', 'delete', 'update', 'set', 'drop', 'if', 'exec'].includes(char.key)) - } - - let error = '' - - sql = sql.replace(/sys\.fn_/ig, '') // 璺宠繃sys.fn_楠岃瘉 - - chars.forEach(char => { - if (!error && char.reg.test(sql)) { - error = char.key - } - }) - - return error - } - - /** * @description sql鍔犲瘑 * @return {String} value */ diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 8012bf6..4ef6821 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -184,6 +184,7 @@ if (res.status) { window.GLOB.style = res.CSS document.title = res.titleName + sessionStorage.setItem('appname', res.appname || '') if (window.GLOB.style && styles[window.GLOB.style]) { document.body.className = styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '') diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index a256e8a..2920480 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -614,7 +614,8 @@ webSite: res.WebSite || '', navBar: res.menu_type, // shutter 鐧惧彾绐椼�乴inkage_navigation 鑱斿姩鑿滃崟銆乴inkage 鑱斿姩鑿滃崟_鏃犲鑸爮銆乵enu_board 鑿滃崟闈㈡澘銆乵enu_board_navigation 鑿滃崟闈㈡澘_鏍囩椤� app_version: res.app_version, - Member_Level: 0 + Member_Level: 0, + appname: res.appname || '' } if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { @@ -701,6 +702,7 @@ window.GLOB.style = systemMsg.style window.GLOB.navBar = systemMsg.navBar window.GLOB.appVersion = systemMsg.app_version + sessionStorage.setItem('appname', res.appname || '') if (window.GLOB.style && styles[window.GLOB.style]) { document.body.className = styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '') diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 455baa1..506ac21 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -791,7 +791,7 @@ EasyCode: config.easyCode || '', Template: 'CustomPage', MenuName: config.MenuName || '', - PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', interfaces}), + PageParam: JSON.stringify({Template: 'CustomPage', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces}), open_edition: config.open_edition, LText: '', LTexttb: '', diff --git a/src/views/menudesign/menuform/index.jsx b/src/views/menudesign/menuform/index.jsx index 235f6b1..737270b 100644 --- a/src/views/menudesign/menuform/index.jsx +++ b/src/views/menudesign/menuform/index.jsx @@ -4,9 +4,13 @@ import { QuestionCircleOutlined } from '@ant-design/icons' import Api from '@/api' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { TextArea } = Input + +const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) +const SysColorSketch = asyncComponent(() => import('@/menu/stylecontroller/syscolorsketch')) class CustomMenuForm extends Component { static propTpyes = { @@ -475,6 +479,16 @@ })(<TextArea rows={2} placeholder={''} onChange={(e) => {this.selectChange('Remark', e.target.value)}}/>)} </Form.Item> </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="鑿滃崟棰滆壊"> + <ColorSketch allowClear={true} value={config.menuColor || ''} onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="绯荤粺鑹�"> + <SysColorSketch onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> </Row> </Form> ) diff --git a/src/views/menudesign/menuform/index.scss b/src/views/menudesign/menuform/index.scss index 39343af..7023782 100644 --- a/src/views/menudesign/menuform/index.scss +++ b/src/views/menudesign/menuform/index.scss @@ -13,4 +13,21 @@ color: red; } } + .color-sketch-block { + position: relative; + top: 7px; + .color-sketch-block-box { + width: 40px; + } + .color-sketch-value { + width: 130px; + + .anticon-close-circle { + right: 10px; + } + } + } + .sys-color-sketch-block { + white-space: nowrap; + } } \ No newline at end of file diff --git a/src/views/sso/index.jsx b/src/views/sso/index.jsx index 48b2474..5b11539 100644 --- a/src/views/sso/index.jsx +++ b/src/views/sso/index.jsx @@ -83,7 +83,8 @@ webSite: res.WebSite || '', navBar: res.menu_type, app_version: res.app_version, - Member_Level: 0 + Member_Level: 0, + appname: res.appname || '' } if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { @@ -131,6 +132,7 @@ window.GLOB.style = systemMsg.style window.GLOB.navBar = systemMsg.navBar window.GLOB.appVersion = systemMsg.app_version + sessionStorage.setItem('appname', res.appname || '') if (window.GLOB.style && styles[window.GLOB.style]) { document.body.className = styles[window.GLOB.style] + ' ' + (res.split_line_show === 'false' ? 'hidden-split-line' : '') diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index cb48eb5..a3a5952 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -592,7 +592,7 @@ EasyCode: config.easyCode || '', Template: 'BaseTable', MenuName: config.MenuName || '', - PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', interfaces}), + PageParam: JSON.stringify({Template: 'BaseTable', OpenType: config.OpenType || 'newtab', hidden: config.hidden || 'false', menuColor: config.menuColor || '', interfaces}), open_edition: config.open_edition, LText: '', LTexttb: '', diff --git a/src/views/tabledesign/menuform/index.jsx b/src/views/tabledesign/menuform/index.jsx index 84553b2..e1a70b1 100644 --- a/src/views/tabledesign/menuform/index.jsx +++ b/src/views/tabledesign/menuform/index.jsx @@ -3,9 +3,13 @@ import { Form, Row, Col, Input, Select, notification, Switch, Radio } from 'antd' import Api from '@/api' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' const { TextArea } = Input + +const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) +const SysColorSketch = asyncComponent(() => import('@/menu/stylecontroller/syscolorsketch')) class CustomMenuForm extends Component { static propTpyes = { @@ -374,6 +378,16 @@ })(<TextArea rows={2} placeholder={''} onChange={this.changeRemark} />)} </Form.Item> </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="鑿滃崟棰滆壊"> + <ColorSketch allowClear={true} value={config.menuColor || ''} onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> + <Col span={24}> + <Form.Item style={{marginBottom: '0px'}} label="绯荤粺鑹�"> + <SysColorSketch onChange={(val) => {this.selectChange('menuColor', val)}} /> + </Form.Item> + </Col> </Row> </Form> ) diff --git a/src/views/tabledesign/menuform/index.scss b/src/views/tabledesign/menuform/index.scss index 39343af..c4c5f98 100644 --- a/src/views/tabledesign/menuform/index.scss +++ b/src/views/tabledesign/menuform/index.scss @@ -13,4 +13,20 @@ color: red; } } + .color-sketch-block { + position: relative; + top: 7px; + .color-sketch-block-box { + width: 40px; + } + .color-sketch-value { + width: 130px; + .anticon-close-circle { + right: 10px; + } + } + } + .sys-color-sketch-block { + white-space: nowrap; + } } \ No newline at end of file -- Gitblit v1.8.0