From 326aa6b3effaccc71cfe0775d47b0f29eb3695a6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 25 八月 2024 00:36:40 +0800 Subject: [PATCH] 2024-08-25 --- src/utils/utils-datamanage.js | 66 +++ src/menu/picturecontroller/index.jsx | 8 src/mob/searchconfig/index.jsx | 18 src/templates/zshare/editTable/index.jsx | 6 src/menu/components/card/table-card/index.jsx | 4 src/menu/components/share/markcomponent/index.jsx | 6 src/mob/components/tabs/antv-tabs/index.jsx | 6 src/views/basedesign/updateFormTab/index.jsx | 4 src/menu/components/share/searchcomponent/index.jsx | 8 src/utils/utils-custom.js | 354 +++++++++++++++- src/templates/comtableconfig/updatetable/index.jsx | 8 src/tabviews/zshare/settingcomponent/index.jsx | 49 + src/views/design/header/editfirstmenu/index.jsx | 4 src/tabviews/zshare/actionList/excelInbutton/index.jsx | 8 src/templates/treepageconfig/index.jsx | 4 public/options.json | 2 src/tabviews/custom/popview/index.jsx | 7 src/mob/components/navbar/normal-navbar/menus/index.jsx | 12 src/tabviews/basetable/index.jsx | 20 src/templates/modalconfig/index.jsx | 18 src/views/billprint/index.jsx | 6 src/mob/modalconfig/index.jsx | 14 src/tabviews/zshare/actionList/normalbutton/index.jsx | 32 public/README.txt | 4 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 6 src/tabviews/zshare/actionList/changeuserbutton/index.jsx | 8 src/views/interface/history/index.jsx | 4 src/views/menudesign/index.jsx | 10 src/utils/sqlFormatter.js | 46 +- src/menu/replaceField/settingform/index.jsx | 4 src/tabviews/custom/components/module/voucher/index.jsx | 4 src/menu/components/card/cardcellcomponent/index.jsx | 6 src/menu/components/form/tab-form/index.jsx | 24 src/mob/components/menubar/normal-menubar/index.jsx | 6 src/menu/components/carousel/prop-card/index.jsx | 4 src/menu/components/card/double-data-card/index.jsx | 4 src/menu/components/search/main-search/dragsearch/card.jsx | 9 src/templates/subtableconfig/index.jsx | 4 src/menu/components/card/data-card/index.jsx | 4 src/tabviews/custom/index.jsx | 6 src/menu/components/table/base-table/columns/index.jsx | 4 src/views/appmanage/index.jsx | 26 src/menu/components/card/prop-card/index.jsx | 4 src/menu/debug/index.jsx | 5 src/menu/components/table/normal-table/columns/index.jsx | 16 src/menu/components/tabs/antv-tabs/index.jsx | 6 src/menu/components/group/normal-group/index.jsx | 6 src/menu/components/table/edit-table/columns/index.jsx | 16 src/tabviews/zshare/actionList/index.scss | 3 src/views/design/header/index.jsx | 4 src/views/printTemplate/index.jsx | 6 src/components/header/index.jsx | 4 src/templates/comtableconfig/index.jsx | 4 src/menu/transfer/index.jsx | 6 src/menu/components/tabs/table-tabs/index.jsx | 6 src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx | 36 src/templates/sharecomponent/searchcomponent/index.jsx | 8 src/views/rolemanage/index.jsx | 18 src/menu/components/form/simple-form/index.jsx | 12 src/templates/sharecomponent/fieldscomponent/index.jsx | 24 src/views/tabledesign/index.jsx | 10 src/templates/sharecomponent/columncomponent/index.jsx | 8 src/templates/sharecomponent/cardcomponent/index.jsx | 10 src/pc/components/navbar/normal-navbar/linksetting/linktable/index.jsx | 4 src/menu/components/search/main-search/index.scss | 4 src/templates/sharecomponent/tabscomponent/index.jsx | 18 src/menu/components/carousel/data-card/index.jsx | 4 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 4 src/index.js | 39 - src/menu/components/form/step-form/index.jsx | 24 src/templates/treepageconfig/updatetable/index.jsx | 8 src/menu/components/share/actioncomponent/index.jsx | 8 src/menu/urlfieldcomponent/index.jsx | 4 src/tabviews/zshare/actionList/printbutton/index.jsx | 12 src/menu/components/search/main-search/index.jsx | 6 src/templates/sharecomponent/actioncomponent/index.jsx | 8 src/menu/modalconfig/index.jsx | 18 src/menu/components/share/colsControl/index.jsx | 12 src/templates/sharecomponent/chartgroupcomponent/index.jsx | 10 79 files changed, 836 insertions(+), 406 deletions(-) diff --git a/public/README.txt b/public/README.txt index c277902..d1ff2b5 100644 --- a/public/README.txt +++ b/public/README.txt @@ -14,8 +14,8 @@ WXMerchID -- 浣跨敤寰俊鏀粯鏃讹紝缁戝畾鐨勫晢鎴稩D WXNotice -- 鏄惁寮�鍚槑绉戜簯鍏紬鍙锋秷鎭彁閱掞紝鍊间负 true 鏃跺紑鍚紝鍙�氳繃鏄庣浜戝彂閫佹ā鏉挎秷鎭� WXApps -- 瀛樺湪澶氫釜鍏紬鍙枫�佸皬绋嬪簭鎴栧晢鎴锋椂鍙娇鐢ㄥ井淇PP鍒楄〃锛屾敞鎰忓~鍐欓粯璁ゅ叕浼楀彿銆佸皬绋嬪簭涓庡晢鎴峰彿锛屾牸寮� [{"appId": "", "appName": "", "appType": "public/miniProgram/merchant"}] -debugger -- 鍊间负 true 鏃跺紑鍚皟璇曟ā寮忥紝寮�鍚悗绉诲姩绔瓙搴旂敤涓細鏈夋帶鍒跺彴 -devTools -- 鍊间负 false 鏃朵笉鍏佽浣跨敤璋冭瘯妯″紡 +debugger -- 鍊间负 true 鏃跺紑鍚皟璇曟ā寮忥紝寮�鍚悗绉诲姩绔瓙搴旂敤涓細鏈夋帶鍒跺彴锛屽�间负 forbid 鏃讹紝绂佹绯荤粺鎵撳嵃鑴氭湰 +systemRun -- 绯荤粺鎺ュ彛鐨勬墽琛屾柟寮忥紝鍊间负 backend 鏃讹紝鍦ㄥ悗绔繍琛� licenseKey -- 璁稿彲瀵嗛挜锛屽湪鍐呴儴缃戠粶涓娇鐢ㄧ郴缁熸椂锛屼細璺宠繃epc楠岃瘉 storeKey -- 鐢靛瓙妗f鏈湴鎺堟潈鐮侊紝浣跨敤鏈湴璁稿彲瀵嗛挜鏃舵湁鏁� probation -- 璇曠敤鏈燂紙YYYY-MM-DD锛夛紝鍦ㄦ寮忕郴缁熶腑锛岃瘯鐢ㄦ湡鍐呰皟鐢ㄧ郴缁熸帴鍙g殑鑴氭湰浼氳褰曚笅鏉� diff --git a/public/options.json b/public/options.json index 0c187d0..18f6550 100644 --- a/public/options.json +++ b/public/options.json @@ -13,7 +13,7 @@ "WXMerchID": "", "WXNotice": "true", "debugger": false, - "devTools": true, + "systemRun": "backend", "licenseKey": "", "storeKey": "", "probation": "", diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 8cf0ff8..c8b66d5 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -117,7 +117,7 @@ logout = () => { const { dict } = this.state // 閫�鍑虹櫥褰� - let _this = this + let that = this confirm({ title: dict['logout_query'] || '鎮ㄧ‘瀹氳閫�鍑哄悧锛�', content: '', @@ -125,7 +125,7 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { sessionStorage.clear() - _this.props.history.replace('/login') + that.props.history.replace('/login') window.location.reload() }, onCancel() {} diff --git a/src/index.js b/src/index.js index 3aea357..8c25e14 100644 --- a/src/index.js +++ b/src/index.js @@ -345,36 +345,21 @@ GLOB.memberLevel = 0 } - if (config.devTools === false) { + if (config.systemRun === 'backend') { + Object.defineProperty(window, 'backend', { + writable: false, + value: true + }) + } + if (config.debugger === 'forbid') { sessionStorage.removeItem('breakpoint') GLOB.debugger = false - let getVal = () => { - let _i = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight - let _h = window.outerHeight - _i - 200 - let _w = window.outerWidth - window.innerWidth - 100 - - return Math.max(_h, _w) - } - - if (getVal() > 0) { - document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">鏈郴缁熺姝娇鐢ㄦ帶鍒跺彴锛岃鍏抽棴鎺у埗鍙伴噸鏂板埛鏂帮紒</div>' - return - } else { - let timer = null - window.addEventListener('resize', () => { - timer && clearTimeout(timer) - - if (getVal() > 0) { - timer = setTimeout(() => { - document.body.innerHTML = '<div style="text-align: center; font-size: 30px; padding-top: 40vh;">鏈郴缁熺姝娇鐢ㄦ帶鍒跺彴锛岃鍏抽棴鎺у埗鍙伴噸鏂板埛鏂帮紒</div>' - }, 100) - } - }) - } - } - - if (GLOB.sysType === 'cloud') { + Object.defineProperty(GLOB, 'debugger', { + writable: false, + value: GLOB.debugger + }) + } else if (GLOB.sysType === 'cloud') { Object.defineProperty(GLOB, 'debugger', { writable: false, value: GLOB.debugger diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 5f36a3a..d6fa1a5 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -566,17 +566,17 @@ */ deleteElement = (card) => { const { elements } = this.state - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍏冪礌鍚楋紵', onOk() { let _elements = elements.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ elements: _elements }, () => { - _this.props.updateElement(_elements) + that.props.updateElement(_elements) }) }, onCancel() {} diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx index 7bb0284..6e8d9fd 100644 --- a/src/menu/components/card/data-card/index.jsx +++ b/src/menu/components/card/data-card/index.jsx @@ -182,14 +182,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/card/double-data-card/index.jsx b/src/menu/components/card/double-data-card/index.jsx index cedcc93..62a639f 100644 --- a/src/menu/components/card/double-data-card/index.jsx +++ b/src/menu/components/card/double-data-card/index.jsx @@ -176,14 +176,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/card/prop-card/index.jsx b/src/menu/components/card/prop-card/index.jsx index 9f17c5f..85ce70f 100644 --- a/src/menu/components/card/prop-card/index.jsx +++ b/src/menu/components/card/prop-card/index.jsx @@ -161,14 +161,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/card/table-card/index.jsx b/src/menu/components/card/table-card/index.jsx index 5672f99..0f61b77 100644 --- a/src/menu/components/card/table-card/index.jsx +++ b/src/menu/components/card/table-card/index.jsx @@ -164,14 +164,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/carousel/data-card/index.jsx b/src/menu/components/carousel/data-card/index.jsx index 2d4401d..27bd2fd 100644 --- a/src/menu/components/carousel/data-card/index.jsx +++ b/src/menu/components/carousel/data-card/index.jsx @@ -141,14 +141,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/carousel/prop-card/index.jsx b/src/menu/components/carousel/prop-card/index.jsx index b1719c7..194fc41 100644 --- a/src/menu/components/carousel/prop-card/index.jsx +++ b/src/menu/components/carousel/prop-card/index.jsx @@ -140,14 +140,14 @@ */ deleteCard = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎鍗$墖鍚楋紵', onOk() { card.subcards = card.subcards.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/form/simple-form/index.jsx b/src/menu/components/form/simple-form/index.jsx index a159f9b..60e1f9f 100644 --- a/src/menu/components/form/simple-form/index.jsx +++ b/src/menu/components/form/simple-form/index.jsx @@ -241,7 +241,7 @@ changecols = (type) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this card.subcards[0].fields = card.subcards[0].fields.map(item => { item.labelwidth = 33.3 @@ -267,7 +267,7 @@ confirm({ content: `纭畾鍒囨崲涓�${type}鍒楀悧锛焋, onOk() { - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) @@ -288,14 +288,14 @@ closeForm = (cell) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this card.subcards[0].fields = card.subcards[0].fields.filter(item => item.uuid !== cell.uuid) confirm({ content: `纭畾鍒犻櫎<<${cell.label}>>鍚楋紵`, onOk() { - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) @@ -503,14 +503,14 @@ clearGroup = () => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this card.subcards[0].fields = [] confirm({ content: `纭畾娓呯┖琛ㄥ崟鍚楋紵`, onOk() { - _this.updateComponent(card) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx index 4395d59..dd5790b 100644 --- a/src/menu/components/form/step-form/index.jsx +++ b/src/menu/components/form/step-form/index.jsx @@ -273,7 +273,7 @@ closeGroup = (cell) => { const { group } = this.state let card = fromJS(this.state.card).toJS() - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鍒嗙粍鍚楋紵', @@ -285,8 +285,8 @@ _group = card.subcards[0] || null } - _this.setState({group: _group}) - _this.updateComponent(card) + that.setState({group: _group}) + that.updateComponent(card) }, onCancel() {} }) @@ -317,7 +317,7 @@ changecols = (type) => { let card = fromJS(this.state.card).toJS() let config = fromJS(this.state.group).toJS() - let _this = this + let that = this config.fields = config.fields.map(item => { item.labelwidth = 33.3 @@ -349,8 +349,8 @@ } return item }) - _this.setState({group: config}) - _this.updateComponent(card) + that.setState({group: config}) + that.updateComponent(card) }, onCancel() {} }) @@ -380,7 +380,7 @@ closeForm = (cell) => { let group = fromJS(this.state.group).toJS() let card = fromJS(this.state.card).toJS() - let _this = this + let that = this group.fields = group.fields.filter(item => item.uuid !== cell.uuid) @@ -394,8 +394,8 @@ confirm({ content: `纭畾鍒犻櫎<<${cell.label}>>鍚楋紵`, onOk() { - _this.setState({group}) - _this.updateComponent(card) + that.setState({group}) + that.updateComponent(card) }, onCancel() {} }) @@ -571,7 +571,7 @@ clearGroup = () => { let group = fromJS(this.state.group).toJS() let card = fromJS(this.state.card).toJS() - let _this = this + let that = this group.fields = [] @@ -585,8 +585,8 @@ confirm({ content: `纭畾娓呯┖琛ㄥ崟鍚楋紵`, onOk() { - _this.setState({group}) - _this.updateComponent(card) + that.setState({group}) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/form/tab-form/index.jsx b/src/menu/components/form/tab-form/index.jsx index c895e37..1758d75 100644 --- a/src/menu/components/form/tab-form/index.jsx +++ b/src/menu/components/form/tab-form/index.jsx @@ -279,7 +279,7 @@ closeGroup = (cell) => { const { group } = this.state let card = fromJS(this.state.card).toJS() - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鍒嗙粍鍚楋紵', @@ -291,8 +291,8 @@ _group = card.subcards[0] || null } - _this.setState({group: _group}) - _this.updateComponent(card) + that.setState({group: _group}) + that.updateComponent(card) }, onCancel() {} }) @@ -323,7 +323,7 @@ changecols = (type) => { let card = fromJS(this.state.card).toJS() let config = fromJS(this.state.group).toJS() - let _this = this + let that = this config.fields = config.fields.map(item => { item.labelwidth = 33.3 @@ -355,8 +355,8 @@ } return item }) - _this.setState({group: config}) - _this.updateComponent(card) + that.setState({group: config}) + that.updateComponent(card) }, onCancel() {} }) @@ -386,7 +386,7 @@ closeForm = (cell) => { let group = fromJS(this.state.group).toJS() let card = fromJS(this.state.card).toJS() - let _this = this + let that = this group.fields = group.fields.filter(item => item.uuid !== cell.uuid) @@ -400,8 +400,8 @@ confirm({ content: `纭畾鍒犻櫎<<${cell.label}>>鍚楋紵`, onOk() { - _this.setState({group}) - _this.updateComponent(card) + that.setState({group}) + that.updateComponent(card) }, onCancel() {} }) @@ -573,7 +573,7 @@ clearGroup = () => { let group = fromJS(this.state.group).toJS() let card = fromJS(this.state.card).toJS() - let _this = this + let that = this group.fields = [] @@ -587,8 +587,8 @@ confirm({ content: `纭畾娓呯┖琛ㄥ崟鍚楋紵`, onOk() { - _this.setState({group}) - _this.updateComponent(card) + that.setState({group}) + that.updateComponent(card) }, onCancel() {} }) diff --git a/src/menu/components/group/normal-group/index.jsx b/src/menu/components/group/normal-group/index.jsx index e26fb57..aa41f27 100644 --- a/src/menu/components/group/normal-group/index.jsx +++ b/src/menu/components/group/normal-group/index.jsx @@ -136,15 +136,15 @@ if (group.components.length === 0) return - const _this = this + const that = this confirm({ title: '纭畾閲婃斁鍒嗙粍鍏冪礌鍚楋紵', content: '', onOk() { - _this.props.unGroup(group.uuid) + that.props.unGroup(group.uuid) setTimeout(() => { - _this.updataGroup() + that.updataGroup() }, 10) }, onCancel() {} diff --git a/src/menu/components/search/main-search/dragsearch/card.jsx b/src/menu/components/search/main-search/dragsearch/card.jsx index 6e153b6..72462e7 100644 --- a/src/menu/components/search/main-search/dragsearch/card.jsx +++ b/src/menu/components/search/main-search/dragsearch/card.jsx @@ -132,6 +132,11 @@ </>) } + let labelwidth = card.labelwidth || 33.3 + if (card.labelShow === 'false') { + labelwidth = 0 + } + return ( <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> @@ -143,8 +148,8 @@ <div className={'page-card ' + (card.labelShow === 'false' ? 'label-hide ' : '') + card.type + (card.advanced === 'true' ? ' advanced' : '') + (card.query === 'false' ? ' no-query' : '')} style={{ opacity: opacity}}> <div ref={node => drag(drop(node))}> <Form.Item - labelCol={{xs: { span: 24 }, sm: { span: 8 }}} - wrapperCol = {{xs: { span: 24 }, sm: { span: 16 }}} + labelCol={{style: {width: labelwidth + '%'}}} + wrapperCol={{style: {width: (100 - labelwidth) + '%'}}} label={card.labelShow !== 'false' ? card.label : ''} required={card.required === 'true'} help={card.field + (card.datefield ? ', ' + card.datefield : '') + (card.advanced === 'true' ? '锛堥珮绾ф悳绱級' : '')} diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index ef3e3c1..33814cc 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -289,15 +289,15 @@ * @description 鎼滅储鏉′欢鍒犻櫎 */ deleteElement = (cell) => { - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${cell.label} 锛焋, onOk() { - let _card = fromJS(_this.state.card).toJS() + let _card = fromJS(that.state.card).toJS() _card.search = _card.search.filter(item => item.uuid !== cell.uuid) - _this.updateComponent(_card) + that.updateComponent(_card) }, onCancel() {} }) diff --git a/src/menu/components/search/main-search/index.scss b/src/menu/components/search/main-search/index.scss index 87b0e05..b5a03a5 100644 --- a/src/menu/components/search/main-search/index.scss +++ b/src/menu/components/search/main-search/index.scss @@ -44,7 +44,11 @@ .ant-form-item { position: relative; margin-bottom: 0px; + .ant-form-item-label { + float: left; + } .ant-form-item-control-wrapper { + float: left; .ant-select { width: 100%; margin-top: 4px; diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index 77d657a..c30f245 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -490,19 +490,19 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _actionlist = fromJS(_this.state.actionlist).toJS() + let _actionlist = fromJS(that.state.actionlist).toJS() _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ actionlist: _actionlist }, () => { - _this.props.updateaction({...config, action: _actionlist}) + that.props.updateaction({...config, action: _actionlist}) }) }, onCancel() {} diff --git a/src/menu/components/share/colsControl/index.jsx b/src/menu/components/share/colsControl/index.jsx index 882c037..29a113c 100644 --- a/src/menu/components/share/colsControl/index.jsx +++ b/src/menu/components/share/colsControl/index.jsx @@ -245,7 +245,7 @@ _config.colsCtrls = colsCtrls if (this.customForm && this.customForm.state.editItem) { - const _this = this + const that = this let title = '瀛樺湪鏈繚瀛橀」锛岀‘瀹氬拷鐣ュ悧锛�' if (s.length > 0) { title = `瀛樺湪鏈繚瀛橀」锛屼笖绗� ${s.join('銆�')} 琛屼腑瀛楁鍦ㄦ悳绱㈡潯浠朵腑涓嶅瓨鍦紝纭畾蹇界暐鍚楋紵` @@ -253,18 +253,18 @@ confirm({ title: title, onOk() { - _this.setState({ visible: false }) - _this.props.onSubmit(_config) + that.setState({ visible: false }) + that.props.onSubmit(_config) }, onCancel() {} }) } else if (s.length > 0) { - const _this = this + const that = this confirm({ title: `绗� ${s.join('銆�')} 琛屼腑瀛楁鍦ㄦ悳绱㈡潯浠朵腑涓嶅瓨鍦紝纭畾蹇界暐鍚楋紵`, onOk() { - _this.setState({ visible: false }) - _this.props.onSubmit(_config) + that.setState({ visible: false }) + that.props.onSubmit(_config) }, onCancel() {} }) diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 7185bea..160c1dd 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -399,12 +399,12 @@ }) this.props.onSubmit(marks) } else { - const _this = this + const that = this confirm({ title: '瀛樺湪鏈繚瀛樻爣璁帮紝纭畾蹇界暐鍚楋紵', onOk() { - _this.setState({ visible: false }) - _this.props.onSubmit(marks) + that.setState({ visible: false }) + that.props.onSubmit(marks) }, onCancel() {} }) diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index 62f1391..6eca698 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -247,19 +247,19 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _searchlist = fromJS(_this.state.searchlist).toJS() + let _searchlist = fromJS(that.state.searchlist).toJS() _searchlist = _searchlist.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ searchlist: _searchlist }, () => { - _this.props.updatesearch({...config, search: _searchlist}) + that.props.updatesearch({...config, search: _searchlist}) }) }, onCancel() {} diff --git a/src/menu/components/table/base-table/columns/index.jsx b/src/menu/components/table/base-table/columns/index.jsx index 63cf2fa..96d01c3 100644 --- a/src/menu/components/table/base-table/columns/index.jsx +++ b/src/menu/components/table/base-table/columns/index.jsx @@ -21,12 +21,12 @@ class HeaderCol extends Component { deleteCol = () => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�', onOk() { - _this.props.deleteCol(_this.props.column) + that.props.deleteCol(that.props.column) }, onCancel() {} }) diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 9deae06..fcf33b1 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -22,12 +22,12 @@ class HeaderCol extends Component { deleteCol = () => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�', onOk() { - _this.props.deleteCol(_this.props.column) + that.props.deleteCol(that.props.column) }, onCancel() {} }) @@ -597,13 +597,13 @@ columns.push(cell) }) - const _this = this + const that = this confirm({ content: '纭畾鍚屾瀛楁闆嗗悧锛�', onOk() { - _this.setState({columns}, () => { - _this.props.updatecolumn({..._this.props.config, cols: columns}) + that.setState({columns}, () => { + that.props.updatecolumn({...that.props.config, cols: columns}) }) }, onCancel() {} @@ -611,13 +611,13 @@ } clear = () => { - const _this = this + const that = this confirm({ content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�', onOk() { - _this.setState({columns: []}, () => { - _this.props.updatecolumn({..._this.props.config, cols: []}) + that.setState({columns: []}, () => { + that.props.updatecolumn({...that.props.config, cols: []}) }) }, onCancel() {} diff --git a/src/menu/components/table/normal-table/columns/index.jsx b/src/menu/components/table/normal-table/columns/index.jsx index de7593e..e6af839 100644 --- a/src/menu/components/table/normal-table/columns/index.jsx +++ b/src/menu/components/table/normal-table/columns/index.jsx @@ -22,12 +22,12 @@ class HeaderCol extends Component { deleteCol = () => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎鏄剧ず鍒楀悧锛�', onOk() { - _this.props.deleteCol(_this.props.column) + that.props.deleteCol(that.props.column) }, onCancel() {} }) @@ -595,13 +595,13 @@ columns.push(cell) }) - const _this = this + const that = this confirm({ content: '纭畾鍚屾瀛楁闆嗗悧锛�', onOk() { - _this.setState({columns}, () => { - _this.props.updatecolumn({..._this.props.config, cols: columns}) + that.setState({columns}, () => { + that.props.updatecolumn({...that.props.config, cols: columns}) }) }, onCancel() {} @@ -609,13 +609,13 @@ } clear = () => { - const _this = this + const that = this confirm({ content: '纭畾娓呯┖鏄剧ず鍒楀悧锛�', onOk() { - _this.setState({columns: []}, () => { - _this.props.updatecolumn({..._this.props.config, cols: []}) + that.setState({columns: []}, () => { + that.props.updatecolumn({...that.props.config, cols: []}) }) }, onCancel() {} diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index 1aa31f6..145bcdc 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -147,7 +147,7 @@ delTab = (tab) => { let tabs = fromJS(this.state.tabs).toJS() - const _this = this + const that = this tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) @@ -155,8 +155,8 @@ title: '纭畾鍒犻櫎鏍囩锛�', content: '', onOk() { - _this.setState({tabs}) - _this.props.updateConfig(tabs) + that.setState({tabs}) + that.props.updateConfig(tabs) }, onCancel() {} }) diff --git a/src/menu/components/tabs/table-tabs/index.jsx b/src/menu/components/tabs/table-tabs/index.jsx index 293312c..8dc040e 100644 --- a/src/menu/components/tabs/table-tabs/index.jsx +++ b/src/menu/components/tabs/table-tabs/index.jsx @@ -72,7 +72,7 @@ delTab = (tab) => { let tabs = fromJS(this.state.tabs).toJS() - const _this = this + const that = this tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) @@ -80,8 +80,8 @@ title: '纭畾鍒犻櫎鏍囩锛�', content: '', onOk() { - _this.setState({tabs}) - _this.props.updateConfig(tabs) + that.setState({tabs}) + that.props.updateConfig(tabs) }, onCancel() {} }) diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index 6e995a0..ab9eafd 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -716,6 +716,11 @@ verify.invalid = 'false' } } + if (verify.uniques && verify.uniques.length > 0 && btn.Ot === 'requiredOnce') { + if (component.wrap && (component.wrap.datatype === 'static' || component.wrap.datatype === 'public')) { + verify.uniques = [] + } + } if (verify.default !== 'false') { // 鍒ゆ柇鏄惁浣跨敤榛樿sql _actionType = btn.sqlType diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx index f7f3a42..e76889a 100644 --- a/src/menu/modalconfig/index.jsx +++ b/src/menu/modalconfig/index.jsx @@ -165,15 +165,15 @@ * @description 琛ㄥ崟鍒犻櫎骞跺埛鏂� */ closeForm = (card) => { - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎${card.label ? `<<${card.label}>>` : ''}鍚楋紵`, onOk() { - let _config = fromJS(_this.state.config).toJS() + let _config = fromJS(that.state.config).toJS() _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) - _this.setState({ + that.setState({ config: _config, }) }, @@ -193,13 +193,13 @@ } clearConfig = () => { - const _this = this + const that = this let _config = {...this.state.config, fields: []} confirm({ content: '纭畾娓呯┖琛ㄥ崟鍚楋紵', onOk() { - _this.setState({ config: _config }) + that.setState({ config: _config }) }, onCancel() {} }) @@ -213,11 +213,11 @@ const { config, originConfig } = this.state if (!is(fromJS(config), fromJS(originConfig))) { - let _this = this + let that = this confirm({ content: '閰嶇疆淇℃伅鏈繚瀛橈紝纭畾杩斿洖鍚楋紵', onOk() { - _this.props.handleBack() + that.props.handleBack() }, onCancel() {} }) @@ -279,7 +279,7 @@ changecols = (type) => { let config = fromJS(this.state.config).toJS() - let _this = this + let that = this config.fields = config.fields.map(item => { item.labelwidth = 33.3 @@ -305,7 +305,7 @@ confirm({ content: `纭畾鍒囨崲涓�${type}鍒楀悧锛焋, onOk() { - _this.setState({config}) + that.setState({config}) }, onCancel() {} }) diff --git a/src/menu/picturecontroller/index.jsx b/src/menu/picturecontroller/index.jsx index 34ffe8a..a8633f1 100644 --- a/src/menu/picturecontroller/index.jsx +++ b/src/menu/picturecontroller/index.jsx @@ -161,7 +161,7 @@ } deleteSource = (item) => { - const _this = this + const that = this confirm({ title: '纭畾鍒犻櫎鍚楋紵', @@ -181,14 +181,14 @@ if (res.status) { if (item.typecharone === 'image') { window.GLOB.app_pictures = res.data || [] - _this.resetPicture(res.data || []) + that.resetPicture(res.data || []) } else if (item.typecharone === 'video') { window.GLOB.app_videos = res.data || [] - _this.resetVideo(res.data || []) + that.resetVideo(res.data || []) } else if (item.typecharone === 'color') { window.GLOB.app_colors = res.data || [] sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) - _this.resetColor(res.data || []) + that.resetColor(res.data || []) } } else { notification.warning({ diff --git a/src/menu/replaceField/settingform/index.jsx b/src/menu/replaceField/settingform/index.jsx index 941c3f3..91d3236 100644 --- a/src/menu/replaceField/settingform/index.jsx +++ b/src/menu/replaceField/settingform/index.jsx @@ -76,13 +76,13 @@ } clear = () => { - let _this = this + let that = this confirm({ title: '纭畾娓呴櫎鍘嗗彶璁板綍鍚楋紵', content: '', onOk() { localStorage.removeItem('replaceRecord') - _this.setState({fields: [], labels: []}) + that.setState({fields: [], labels: []}) }, onCancel() {} }) diff --git a/src/menu/transfer/index.jsx b/src/menu/transfer/index.jsx index 5e9c7d8..cdb834a 100644 --- a/src/menu/transfer/index.jsx +++ b/src/menu/transfer/index.jsx @@ -26,7 +26,7 @@ trigger = () => { const { config } = this.props - const _this = this + const that = this if (!config.enabled) { let tb = config.components[0] @@ -36,7 +36,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.execUpdate(resolve, true) + that.execUpdate(resolve, true) }) }, onCancel() {} @@ -58,7 +58,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.execUpdate(resolve) + that.execUpdate(resolve) }) }, onCancel() {} diff --git a/src/menu/urlfieldcomponent/index.jsx b/src/menu/urlfieldcomponent/index.jsx index a25488e..a6ff171 100644 --- a/src/menu/urlfieldcomponent/index.jsx +++ b/src/menu/urlfieldcomponent/index.jsx @@ -61,14 +61,14 @@ deleteField = (field) => { let config = JSON.stringify(this.props.config) - const _this = this + const that = this if (new RegExp('@' + field + '@', 'ig').test(config)) { confirm({ title: `閰嶇疆涓瓨鍦ˊ${field}@锛岀‘瀹氬垹闄ゅ悧锛焋, content: '', onOk() { - _this.execDelete(field) + that.execDelete(field) }, onCancel() {} }) diff --git a/src/mob/components/menubar/normal-menubar/index.jsx b/src/mob/components/menubar/normal-menubar/index.jsx index 016fd2f..596f800 100644 --- a/src/mob/components/menubar/normal-menubar/index.jsx +++ b/src/mob/components/menubar/normal-menubar/index.jsx @@ -123,7 +123,7 @@ */ deleteCard = (cell, type) => { let card = fromJS(this.state.card).toJS() - let _this = this + let that = this if (type !== 'direct') { confirm({ @@ -131,8 +131,8 @@ onOk() { card.subMenus = card.subMenus.filter(item => item.uuid !== cell.uuid) - _this.setState({card}) - _this.props.updateConfig(card) + that.setState({card}) + that.props.updateConfig(card) }, onCancel() {} }) diff --git a/src/mob/components/navbar/normal-navbar/menus/index.jsx b/src/mob/components/navbar/normal-navbar/menus/index.jsx index 43e0e28..7ade24d 100644 --- a/src/mob/components/navbar/normal-navbar/menus/index.jsx +++ b/src/mob/components/navbar/normal-navbar/menus/index.jsx @@ -114,7 +114,7 @@ } if (editMenu.MenuID && editMenu.property === 'menu' && res.property !== 'menu') { - const _this = this + const that = this confirm({ content: '鑿滃崟灏嗚閲嶇疆锛岀‘瀹氫慨鏀瑰悧锛�', onOk() { @@ -124,8 +124,8 @@ } return item }) - _this.setState({menus: _menus, editMenu: null, visible: false}, () => { - _this.props.updateConfig(_menus) + that.setState({menus: _menus, editMenu: null, visible: false}, () => { + that.props.updateConfig(_menus) }) }, onCancel() {} @@ -143,17 +143,17 @@ */ deleteElement = (card) => { const { menus } = this.state - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎銆�${card.name}銆嬪悧锛焋, onOk() { let _menus = menus.filter(item => item.MenuID !== card.MenuID) - _this.setState({ + that.setState({ menus: _menus }, () => { - _this.props.updateConfig(_menus) + that.props.updateConfig(_menus) }) }, onCancel() {} diff --git a/src/mob/components/tabs/antv-tabs/index.jsx b/src/mob/components/tabs/antv-tabs/index.jsx index 9653b81..4bb2be3 100644 --- a/src/mob/components/tabs/antv-tabs/index.jsx +++ b/src/mob/components/tabs/antv-tabs/index.jsx @@ -169,7 +169,7 @@ delTab = (tab) => { let tabs = fromJS(this.state.tabs).toJS() - const _this = this + const that = this tabs.subtabs = tabs.subtabs.filter(t => t.uuid !== tab.uuid) @@ -177,8 +177,8 @@ title: '纭畾鍒犻櫎鏍囩锛�', content: '', onOk() { - _this.setState({tabs}) - _this.props.updateConfig(tabs) + that.setState({tabs}) + that.props.updateConfig(tabs) }, onCancel() {} }) diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx index 8ef83d0..0f75a32 100644 --- a/src/mob/modalconfig/index.jsx +++ b/src/mob/modalconfig/index.jsx @@ -170,15 +170,15 @@ * @description 琛ㄥ崟鍒犻櫎骞跺埛鏂� */ closeForm = (card) => { - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎${card.label ? `<<${card.label}>>` : ''}鍚楋紵`, onOk() { - let _config = fromJS(_this.state.config).toJS() + let _config = fromJS(that.state.config).toJS() _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) - _this.setState({ + that.setState({ config: _config, }) }, @@ -201,11 +201,11 @@ const { config, originConfig } = this.state if (!is(fromJS(config), fromJS(originConfig))) { - let _this = this + let that = this confirm({ content: '閰嶇疆淇℃伅鏈繚瀛橈紝纭畾杩斿洖鍚楋紵', onOk() { - _this.props.handleBack() + that.props.handleBack() }, onCancel() {} }) @@ -316,13 +316,13 @@ } clearConfig = () => { - const _this = this + const that = this let _config = {...this.state.config, fields: []} confirm({ content: '纭畾娓呯┖琛ㄥ崟鍚楋紵', onOk() { - _this.setState({ config: _config }) + that.setState({ config: _config }) }, onCancel() {} }) diff --git a/src/mob/searchconfig/index.jsx b/src/mob/searchconfig/index.jsx index ae16cb1..fbfc001 100644 --- a/src/mob/searchconfig/index.jsx +++ b/src/mob/searchconfig/index.jsx @@ -264,18 +264,18 @@ * @description 琛ㄥ崟鍒犻櫎骞跺埛鏂� */ closeForm = (card) => { - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎${card.label ? `<<${card.label}>>` : ''}鍚楋紵`, onOk() { - let _group = fromJS(_this.state.group).toJS() + let _group = fromJS(that.state.group).toJS() _group.fields = _group.fields.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ group: _group, }) - _this.resetConfig(_group) + that.resetConfig(_group) }, onCancel() {} }) @@ -296,11 +296,11 @@ const { config, originConfig } = this.state if (!is(fromJS(config), fromJS(originConfig))) { - let _this = this + let that = this confirm({ content: '閰嶇疆淇℃伅鏈繚瀛橈紝纭畾杩斿洖鍚楋紵', onOk() { - _this.props.handleBack() + that.props.handleBack() }, onCancel() {} }) @@ -446,15 +446,15 @@ } closeGroup = (g) => { - const _this = this + const that = this let _group = fromJS(this.state.group).toJS() _group.groups = _group.groups.filter(item => item.uuid !== g.uuid) confirm({ content: `纭畾鍒犻櫎鍒嗙粍銆�${g.wrap.name}銆嬪悧锛焋, onOk() { - _this.setState({ group: _group }) - _this.resetConfig(_group) + that.setState({ group: _group }) + that.resetConfig(_group) }, onCancel() {} }) diff --git a/src/pc/components/navbar/normal-navbar/linksetting/linktable/index.jsx b/src/pc/components/navbar/normal-navbar/linksetting/linktable/index.jsx index 6a2d85a..e6aa8f7 100644 --- a/src/pc/components/navbar/normal-navbar/linksetting/linktable/index.jsx +++ b/src/pc/components/navbar/normal-navbar/linksetting/linktable/index.jsx @@ -78,13 +78,13 @@ delMenu = (record) => { const { data } = this.state - const _this = this + const that = this confirm({ title: '纭畾鍒犻櫎鍚楋紵', content: '', onOk() { - _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) + that.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) }, onCancel() {} }) diff --git a/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx b/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx index 3ee2c9c..e0a85cf 100644 --- a/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx +++ b/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx @@ -88,15 +88,15 @@ delMenu = (record) => { const { menu } = this.props - const _this = this + const that = this confirm({ title: '纭畾鍒犻櫎鍚楋紵', content: '', onOk() { - let _data = _this.state.data.filter(item => item.MenuID !== record.MenuID) - _this.setState({data: _data}) - _this.props.menuUpdate({...menu, sublist: _data}) + let _data = that.state.data.filter(item => item.MenuID !== record.MenuID) + that.setState({data: _data}) + that.props.menuUpdate({...menu, sublist: _data}) }, onCancel() {} }) @@ -137,7 +137,7 @@ }) } if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { - const _this = this + const that = this confirm({ content: '鑿滃崟灏嗚閲嶇疆锛岀‘瀹氫慨鏀瑰悧锛�', onOk() { @@ -147,8 +147,8 @@ } return item }) - _this.setState({data: _data, editMenu: null, visible: false}) - _this.props.menuUpdate({...menu, sublist: _data}) + that.setState({data: _data, editMenu: null, visible: false}) + that.props.menuUpdate({...menu, sublist: _data}) }, onCancel() {} }) @@ -271,15 +271,15 @@ delMenu = (record) => { const { menu } = this.props - const _this = this + const that = this confirm({ title: (record.property === 'classify' && record.sublist.length > 0 ? '鑿滃崟涓嬪惈鏈夊瓙鑿滃崟锛�' : '') + '纭畾鍒犻櫎鍚楋紵', content: '', onOk() { - let _data = _this.state.data.filter(item => item.MenuID !== record.MenuID) - _this.setState({data: _data}) - _this.props.menuUpdate({...menu, sublist: _data}) + let _data = that.state.data.filter(item => item.MenuID !== record.MenuID) + that.setState({data: _data}) + that.props.menuUpdate({...menu, sublist: _data}) }, onCancel() {} }) @@ -320,7 +320,7 @@ }) } if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { - const _this = this + const that = this confirm({ content: '鑿滃崟灏嗚閲嶇疆锛岀‘瀹氫慨鏀瑰悧锛�', onOk() { @@ -330,8 +330,8 @@ } return item }) - _this.setState({data: _data, editMenu: null, visible: false}) - _this.props.menuUpdate({...menu, sublist: _data}) + that.setState({data: _data, editMenu: null, visible: false}) + that.props.menuUpdate({...menu, sublist: _data}) }, onCancel() {} }) @@ -466,13 +466,13 @@ delMenu = (record) => { const { data } = this.state - const _this = this + const that = this confirm({ title: (record.property === 'classify' && record.sublist.length > 0 ? '鑿滃崟涓嬪惈鏈夊瓙鑿滃崟锛�' : '') + '纭畾鍒犻櫎鍚楋紵', content: '', onOk() { - _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) + that.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) }, onCancel() {} }) @@ -513,7 +513,7 @@ } if (editMenu.MenuID && editMenu.property === 'menu' && _menu.property !== 'menu') { - const _this = this + const that = this confirm({ content: '鑿滃崟灏嗚閲嶇疆锛岀‘瀹氫慨鏀瑰悧锛�', onOk() { @@ -523,7 +523,7 @@ } return item }) - _this.setState({data: _data, editMenu: null, visible: false}) + that.setState({data: _data, editMenu: null, visible: false}) }, onCancel() {} }) diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 49e94b0..3ef6c7c 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -174,6 +174,20 @@ window.GLOB.CacheData.set(MenuID, urlparam) + // if (window.backend && config.allSqls) { + // let keys = Object.keys(urlparam) + // config.allSqls.forEach(item => { + // if (item.type === 'datasource') { + // item.urlkeys = keys + // item.urlparam = urlparam + // if (config.flow_code) { + // item.works_flow_code = config.flow_code + // } + // } + // window.GLOB.CacheData.set('sql_' + item.uuid, item) + // }) + // } + let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' @@ -510,9 +524,7 @@ if (cell.verify) { if (cell.verify.invalid === 'true') { - if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { - cell.verify.invalid = 'false' - } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { + if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { cell.verify.invalid = 'false' } else if (cell.intertype !== 'system' && cell.procMode !== 'system') { cell.verify.invalid = 'false' @@ -628,6 +640,8 @@ return component } + component.setting.uuid = component.uuid + let _customScript = '' let _tailScript = '' component.scripts && component.scripts.forEach(script => { diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx index 89c8085..6e9f250 100644 --- a/src/tabviews/custom/components/module/voucher/index.jsx +++ b/src/tabviews/custom/components/module/voucher/index.jsx @@ -492,11 +492,11 @@ } if (tip) { - const _this = this + const that = this confirm({ content: tip + '纭瑕佷繚瀛樺悧锛�', onOk() { - _this.voucherSave(list, t) + that.voucherSave(list, t) }, onCancel() {} }) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index b16ea86..23526d4 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -965,8 +965,9 @@ } if (cell.verify) { + let isStatic = item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public') if (cell.verify.invalid === 'true') { - if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { + if (isStatic) { cell.verify.invalid = 'false' } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { cell.verify.invalid = 'false' @@ -978,6 +979,9 @@ cell.verify.invalid = 'false' } } + if (cell.verify.uniques && cell.verify.uniques.length > 0 && cell.Ot === 'requiredOnce' && isStatic) { + cell.verify.uniques = [] + } if (cell.verify.linkEnable === 'true' && /@/.test(cell.verify.linkUrl)) { cell.returnValue = 'true' diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 9fbcb3a..338eb38 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -672,8 +672,9 @@ } if (cell.verify) { + let isStatic = item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public') if (cell.verify.invalid === 'true') { - if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { + if (isStatic) { cell.verify.invalid = 'false' } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { cell.verify.invalid = 'false' @@ -686,6 +687,10 @@ } } + if (cell.verify.uniques && cell.verify.uniques.length > 0 && cell.Ot === 'requiredOnce' && isStatic) { + cell.verify.uniques = [] + } + if (cell.verify.linkEnable === 'true' && /@/.test(cell.verify.linkUrl)) { cell.returnValue = 'true' } diff --git a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx index 90fd522..509bce4 100644 --- a/src/tabviews/zshare/actionList/changeuserbutton/index.jsx +++ b/src/tabviews/zshare/actionList/changeuserbutton/index.jsx @@ -142,7 +142,7 @@ */ changeUser = (primaryId) => { const { setting, btn } = this.props - let _this = this + let that = this let param = { func: 'webapi_ChangeUser', @@ -203,16 +203,16 @@ message: res.message || '鎵ц澶辫触锛�', duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 }) - _this.setState({loading: false}) + that.setState({loading: false}) } }, () => { resolve() - _this.setState({loading: false}) + that.setState({loading: false}) }) }) }, onCancel() { - _this.setState({loading: false}) + that.setState({loading: false}) } }) } diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index 9310404..c8d24bc 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -404,7 +404,7 @@ if (res.status) { this.execSuccess(res) } else if (res.ErrCode === 'C') { - const _this = this + const that = this confirm({ title: window.GLOB.dict['exec_sure'] || '璇风‘璁�', content: res.message, @@ -414,16 +414,16 @@ return new Promise(resolve => { Api.genericInterface(unCheckParam).then(result => { if (result.status) { - _this.execSuccess(result) + that.execSuccess(result) } else { - _this.execError(result) + that.execError(result) } resolve() }) }) }, onCancel() { - _this.execError(res) + that.execError(res) } }) } else { diff --git a/src/tabviews/zshare/actionList/index.scss b/src/tabviews/zshare/actionList/index.scss index 700f589..3419db2 100644 --- a/src/tabviews/zshare/actionList/index.scss +++ b/src/tabviews/zshare/actionList/index.scss @@ -16,6 +16,9 @@ width: auto; padding: 0 15px; } + .ant-btn.ant-btn-link { + border-color: #d9d9d9; + } .ant-btn.mk-btn-hover-bg:not([disabled]):hover { opacity: 1!important; diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 9b32ef3..47e76c9 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -224,7 +224,7 @@ this.setState({autoMatic: type === 'autoMatic'}) - let _this = this + let that = this let data = record || selectedData || [] let valid = this.checkBtnData(data) @@ -247,11 +247,11 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(data, resolve) + that.execSubmit(data, resolve) }) }, onCancel() { - _this.setState({loading: false}) + that.setState({loading: false}) } }) } else if (btn.OpenType === 'exec') { @@ -331,7 +331,7 @@ return } - let _this = this + let that = this let data = selectedData || [] let valid = this.checkBtnData(data) @@ -359,12 +359,12 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(data, resolve) + that.execSubmit(data, resolve) }) }, onCancel() { callback() - _this.setState({loading: false}) + that.setState({loading: false}) } }) } else if (btn.OpenType === 'exec') { @@ -1789,7 +1789,7 @@ msg = msg.replace(/\n|\r/ig, '<br/>') msg = <span dangerouslySetInnerHTML={{__html: msg}}></span> } - const _this = this + const that = this confirm({ title: window.GLOB.dict['exec_sure'] || '璇风‘璁�', content: msg, @@ -1799,16 +1799,16 @@ return new Promise(resolve => { Api.genericInterface(unCheckParam).then(result => { if (result.status) { - _this.triggerNote(result, param.ID) // 娑堟伅 + that.triggerNote(result, param.ID) // 娑堟伅 if (params.length === 0) { - _this.execSuccess(result) + that.execSuccess(result) _resolve() } else { - _this.checkLoopRequest(params, _resolve) + that.checkLoopRequest(params, _resolve) } } else { - _this.execError(result) + that.execError(result) _resolve() } resolve() @@ -1816,7 +1816,7 @@ }) }, onCancel() { - _this.execError(res) + that.execError(res) _resolve() } }) @@ -3257,7 +3257,7 @@ modelconfirm = () => { const { BID } = this.props const { btnconfig, selines, dict } = this.state - let _this = this + let that = this let result = [] let _data = {} @@ -3405,12 +3405,12 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(selines, resolve, result) + that.execSubmit(selines, resolve, result) }) }, onCancel() { - _this.preCallback && _this.preCallback() - _this.setState({ loading: false }) + that.preCallback && that.preCallback() + that.setState({ loading: false }) } }) } diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 34e1669..e106de1 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -150,7 +150,7 @@ this.setState({autoMatic: type === 'autoMatic'}) - let _this = this + let that = this let data = record || selectedData || [] if (btn.Ot !== 'notRequired' && data.length === 0) { @@ -194,10 +194,10 @@ okText: dict['ok'] || '纭畾', cancelText: dict['cancel'] || '鍙栨秷', onOk() { - _this.triggerPrint(data) + that.triggerPrint(data) }, onCancel() { - _this.setState({ loading: false }) + that.setState({ loading: false }) } }) } else { @@ -2113,7 +2113,7 @@ modelconfirm = () => { const { btnconfig, selines, dict } = this.state - let _this = this + let that = this let result = [] let _data = {} let BData = {} @@ -2259,10 +2259,10 @@ okText: dict['ok'] || '纭畾', cancelText: dict['cancel'] || '鍙栨秷', onOk() { - _this.triggerPrint(selines, result) + that.triggerPrint(selines, result) }, onCancel() { - _this.setState({ loading: false }) + that.setState({ loading: false }) } }) } diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx index 77e2230..dd87d2c 100644 --- a/src/tabviews/zshare/settingcomponent/index.jsx +++ b/src/tabviews/zshare/settingcomponent/index.jsx @@ -316,9 +316,14 @@ }) } else if (!links.includes(item.verify.linkUrl)) { links.push(item.verify.linkUrl) + } + }) - let socket = null - socket = new WebSocket('ws://' + item.verify.linkUrl) + if (links.length === 0) return + + let defers = links.map(link => { + return new Promise((resolve) => { + let socket = new WebSocket('ws://' + link) // 鎵撳紑Socket socket.onopen = () =>{ let request = { @@ -360,29 +365,39 @@ }) } - window.GLOB.UserCacheMap.set(item.verify.linkUrl, _printers) - } else if (data && data.cmd === 'getPrinters') { - notification.warning({ - top: 92, - message: data.message, - duration: 5 - }) + resolve({status: true, printers: _printers}) + } else if (data && data.cmd === 'getPrinters' && data.message) { + resolve({status: false, printers: null, message: data.message}) } } socket.onerror = () => { - let tool = item.verify.linkUrl - if (item.verify.linkUrl === '127.0.0.1:13529') { + let tool = link + + if (link === '127.0.0.1:13529') { tool = '鏄庣閫氳缁勪欢' - } else if (item.verify.linkUrl === '127.0.0.1:13528') { + } else if (link === '127.0.0.1:13528') { tool = 'CAINIAO鎵撳嵃缁勪欢' } - notification.warning({ - top: 92, - message: '鏃犳硶杩炴帴鍒�: ' + tool, - duration: 5 - }) + + resolve({status: false, printers: null, message: '鏃犳硶杩炴帴鍒�: ' + tool}) + } + }) + }) + + Promise.all(defers).then(results => { + let res = results.filter(item => item.status)[0] + if (res) { + links.forEach(link => { + window.GLOB.UserCacheMap.set(link, res.printers) + }) + } else { + notification.warning({ + top: 92, + message: results[0].message, + duration: 5 + }) } }) } diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index fc3b441..4768e78 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -689,13 +689,13 @@ cancelConfig = () => { // const { config, originMenu } = this.state - // let _this = this + // let that = this // if (config.isAdd) { // confirm({ // content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', // onOk() { - // _this.props.handleView() + // that.props.handleView() // }, // onCancel() {} // }) diff --git a/src/templates/comtableconfig/updatetable/index.jsx b/src/templates/comtableconfig/updatetable/index.jsx index c1a3d21..f61593a 100644 --- a/src/templates/comtableconfig/updatetable/index.jsx +++ b/src/templates/comtableconfig/updatetable/index.jsx @@ -29,7 +29,7 @@ trigger = () => { const { config } = this.props - const _this = this + const that = this if (!config.enabled) { notification.warning({ @@ -45,7 +45,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.execUpdate(resolve) + that.execUpdate(resolve) }) }, onCancel() {} @@ -611,7 +611,7 @@ saveConfig = (_resolve, _config, errors) => { let err = errors.join('锛�') - let _this = this + let that = this if (err) { _resolve() @@ -620,7 +620,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.saveNewMenu(resolve, _config) + that.saveNewMenu(resolve, _config) }) }, onCancel() {} diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index cabfc7d..bbe3611 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -280,15 +280,15 @@ * @description 琛ㄥ崟鍒犻櫎骞跺埛鏂� */ closeForm = (card) => { - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎${card.label ? `<<${card.label}>>` : ''}鍚楋紵`, onOk() { - let _config = fromJS(_this.state.config).toJS() + let _config = fromJS(that.state.config).toJS() _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) - _this.setState({ + that.setState({ config: _config, }) }, @@ -379,14 +379,14 @@ cancelConfig = () => { // const { config, originConfig } = this.state - // let _this = this + // let that = this // let isOrigin = config.fields.filter(item => item.origin).length > 0 // if (isOrigin) { // confirm({ // content: '灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', // onOk() { - // _this.handleViewBack() + // that.handleViewBack() // }, // onCancel() {} // }) @@ -455,7 +455,7 @@ changecols = (type) => { let config = fromJS(this.state.config).toJS() - let _this = this + let that = this config.fields = config.fields.map(item => { item.labelwidth = 33.3 @@ -481,7 +481,7 @@ confirm({ content: `纭畾鍒囨崲涓�${type}鍒楀悧锛焋, onOk() { - _this.setState({config}) + that.setState({config}) }, onCancel() {} }) @@ -557,13 +557,13 @@ } clearConfig = () => { - const _this = this + const that = this let _config = {...this.state.config, fields: []} confirm({ content: '纭畾娓呯┖琛ㄥ崟鍚楋紵', onOk() { - _this.setState({ config: _config }) + that.setState({ config: _config }) }, onCancel() {} }) diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index 96961c4..62be8b1 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -280,12 +280,12 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _actionlist = fromJS(_this.state.actionlist).toJS() + let _actionlist = fromJS(that.state.actionlist).toJS() _actionlist = _actionlist.filter(item => item.uuid !== card.uuid) @@ -313,10 +313,10 @@ card: card } - _this.setState({ + that.setState({ actionlist: _actionlist }, () => { - _this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard) + that.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, '', delcard) }) }, onCancel() {} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index be7041f..f22a3ef 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -596,18 +596,18 @@ clearField = () => { const { verify } = this.state - const _this = this + const that = this confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, onOk() { - _this.setState({ + that.setState({ verify: { ...verify, columns: [] } }, () => { - _this.resetUniqueColumns() + that.resetUniqueColumns() }) }, onCancel() {} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 7b23dda..502137b 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -810,12 +810,12 @@ clearField = () => { const { verify } = this.state - const _this = this + const that = this confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, onOk() { - _this.setState({ + that.setState({ verify: { ...verify, columns: [] diff --git a/src/templates/sharecomponent/cardcomponent/index.jsx b/src/templates/sharecomponent/cardcomponent/index.jsx index 795eb4c..aab7e55 100644 --- a/src/templates/sharecomponent/cardcomponent/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/index.jsx @@ -270,7 +270,7 @@ deletedetail = (cell) => { const { card } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${cell.content} 锛焋, @@ -279,22 +279,22 @@ _details = _details.filter(item => item.uuid !== cell.uuid) - _this.plotChange({details: _details}) + that.plotChange({details: _details}) }, onCancel() {} }) } deleteElem = (type) => { - let _this = this + let that = this confirm({ content: '纭畾鍒犻櫎锛�', onOk() { - let _subelement = fromJS(_this.props.card.subelement).toJS() + let _subelement = fromJS(that.props.card.subelement).toJS() _subelement = _subelement.filter(_type => _type !== type) - _this.plotChange({subelement: _subelement}) + that.plotChange({subelement: _subelement}) }, onCancel() {} }) diff --git a/src/templates/sharecomponent/chartgroupcomponent/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/index.jsx index 4c90686..2c18248 100644 --- a/src/templates/sharecomponent/chartgroupcomponent/index.jsx +++ b/src/templates/sharecomponent/chartgroupcomponent/index.jsx @@ -203,13 +203,13 @@ */ deletechart = (plot) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 ${plot.title} 锛焋, onOk() { - let _chartlist = fromJS(_this.state.chartlist).toJS() - let _chartview = _this.state.chartview + let _chartlist = fromJS(that.state.chartlist).toJS() + let _chartview = that.state.chartview _chartlist = _chartlist.filter(item => item.uuid !== plot.uuid) @@ -217,11 +217,11 @@ _chartview = _chartlist[0].uuid } - _this.setState({ + that.setState({ chartlist: _chartlist, chartview: _chartview }) - _this.props.updatechartgroup({...config, charts: _chartlist}, _chartview) + that.props.updatechartgroup({...config, charts: _chartlist}, _chartview) }, onCancel() {} }) diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index f390b59..e488a3d 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -280,12 +280,12 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _columnlist = fromJS(_this.state.columnlist).toJS() + let _columnlist = fromJS(that.state.columnlist).toJS() _columnlist = _columnlist.filter(item => item.uuid !== card.uuid) @@ -351,10 +351,10 @@ } } - _this.setState({ + that.setState({ columnlist: _columnlist }, ()=> { - _this.props.updatecolumn({...config, columns: _columnlist}) + that.props.updatecolumn({...config, columns: _columnlist}) }) }, onCancel() {} diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index 52d7eb1..550b5f6 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -146,9 +146,20 @@ if (type === 'search') { // 娣诲姞鎼滅储鏉′欢锛屽瓧娈甸泦涓瓨鍦ㄦ悳绱㈡潯浠跺瓧娈碉紝浣跨敤鎼滅储鏉′欢瀵硅薄鏇挎崲瀛楁闆嗭紝璁剧疆鏁版嵁绫诲瀷 config.search.forEach(item => { - if (item.field && columns.has(item.field.toLowerCase())) { - let _datatype = columns.get(item.field.toLowerCase()).datatype - columns.set(item.field.toLowerCase(), {...item, origin: true, datatype: _datatype}) + if (item.field) { + if (/,/.test(item.field)) { + item.field.split(',').forEach(n => { + if (columns.has(n.toLowerCase())) { + let _datatype = columns.get(n.toLowerCase()).datatype + columns.set(n.toLowerCase(), {...item, field: n, origin: true, datatype: _datatype}) + } + }) + } else { + if (columns.has(item.field.toLowerCase())) { + let _datatype = columns.get(item.field.toLowerCase()).datatype + columns.set(item.field.toLowerCase(), {...item, origin: true, datatype: _datatype}) + } + } } }) } else if (type === 'columns') { @@ -192,13 +203,6 @@ } let config = fromJS(this.props.config).toJS() - - // 鑾峰彇宸查�夊瓧娈甸泦鍚� - let cards = selectCards - let columnsMap = new Map() - cards.forEach(card => { - columnsMap.set(card.field.toLowerCase(), card) - }) let items = [] let keys = [] diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 37498c6..c861729 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -247,19 +247,19 @@ */ deleteElement = (card) => { const { config } = this.props - let _this = this + let that = this confirm({ content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { - let _searchlist = fromJS(_this.state.searchlist).toJS() + let _searchlist = fromJS(that.state.searchlist).toJS() _searchlist = _searchlist.filter(item => item.uuid !== card.uuid) - _this.setState({ + that.setState({ searchlist: _searchlist }, () => { - _this.props.updatesearch({...config, search: _searchlist}) + that.props.updatesearch({...config, search: _searchlist}) }) }, onCancel() {} diff --git a/src/templates/sharecomponent/tabscomponent/index.jsx b/src/templates/sharecomponent/tabscomponent/index.jsx index a95725d..73c4dba 100644 --- a/src/templates/sharecomponent/tabscomponent/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/index.jsx @@ -219,7 +219,7 @@ */ deleteElement = (card, group) => { const { config } = this.props - let _this = this + let that = this let tabgroups = fromJS(this.state.tabgroups).toJS() confirm({ @@ -243,10 +243,10 @@ return _group }) - _this.setState({ + that.setState({ tabgroups: tabgroups }, () => { - _this.props.updatetabs({...config, tabgroups: tabgroups}) + that.props.updatetabs({...config, tabgroups: tabgroups}) }) }, onCancel() {} @@ -258,7 +258,7 @@ */ addTabGroup = () => { const { config } = this.props - let _this = this + let that = this let _tabgroups = fromJS(this.state.tabgroups).toJS() confirm({ @@ -275,10 +275,10 @@ sublist:[] }) - _this.setState({ + that.setState({ tabgroups: _tabgroups }, () => { - _this.props.updatetabs({...config, tabgroups: _tabgroups}) + that.props.updatetabs({...config, tabgroups: _tabgroups}) }) }, onCancel() {} @@ -290,7 +290,7 @@ */ delTabGroup = (group) => { const { config } = this.props - let _this = this + let that = this let _tabgroups = fromJS(this.state.tabgroups).toJS() confirm({ @@ -298,10 +298,10 @@ onOk() { _tabgroups = _tabgroups.filter(_group => _group.uuid !== group.uuid) - _this.setState({ + that.setState({ tabgroups: _tabgroups }, () => { - _this.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist) + that.props.updatetabs({...config, tabgroups: _tabgroups}, group.sublist) }) }, onCancel() {} diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 8e48352..ceb6a74 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -588,13 +588,13 @@ cancelConfig = () => { // const { config, originConfig } = this.state - // let _this = this + // let that = this // if (originConfig.isAdd) { // confirm({ // content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', // onOk() { - // _this.handleViewBack() + // that.handleViewBack() // }, // onCancel() {} // }) diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx index af0d67b..f6df00d 100644 --- a/src/templates/treepageconfig/index.jsx +++ b/src/templates/treepageconfig/index.jsx @@ -444,13 +444,13 @@ */ cancelConfig = () => { // const { config, originMenu } = this.state - // let _this = this + // let that = this // if (config.isAdd) { // confirm({ // content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', // onOk() { - // _this.props.handleView() + // that.props.handleView() // }, // onCancel() {} // }) diff --git a/src/templates/treepageconfig/updatetable/index.jsx b/src/templates/treepageconfig/updatetable/index.jsx index 8de0cea..35b911b 100644 --- a/src/templates/treepageconfig/updatetable/index.jsx +++ b/src/templates/treepageconfig/updatetable/index.jsx @@ -29,7 +29,7 @@ trigger = () => { const { config } = this.props - const _this = this + const that = this if (!config.enabled) { notification.warning({ @@ -45,7 +45,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.execUpdate(resolve) + that.execUpdate(resolve) }) }, onCancel() {} @@ -637,7 +637,7 @@ saveConfig = (_resolve, _config, errors) => { let err = errors.join('锛�') - let _this = this + let that = this if (err) { _resolve() @@ -646,7 +646,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.saveNewMenu(resolve, _config) + that.saveNewMenu(resolve, _config) }) }, onCancel() {} diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index b14d57a..777fb99 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -385,14 +385,14 @@ } clear = () => { - const _this = this + const that = this confirm({ title: '纭畾娓呯┖鍒楄〃鍚楋紵', content: '', onOk() { - _this.setState({ data: [], editingKey: '' }, () => { - _this.props.onChange([]) + that.setState({ data: [], editingKey: '' }, () => { + that.props.onChange([]) }) }, onCancel() {} diff --git a/src/utils/sqlFormatter.js b/src/utils/sqlFormatter.js index 0dd99e8..e14e46b 100644 --- a/src/utils/sqlFormatter.js +++ b/src/utils/sqlFormatter.js @@ -247,43 +247,43 @@ }; Formatter.prototype.getFormattedQueryFromTokens = function getFormattedQueryFromTokens() { - var _this = this; + var that = this; var formattedQuery = ""; this.tokens.forEach(function (token, index) { - _this.index = index; + that.index = index; if (token.type === _tokenTypes2["default"].WHITESPACE) { // ignore (we do our own whitespace formatting) } else if (token.type === _tokenTypes2["default"].LINE_COMMENT) { - formattedQuery = _this.formatLineComment(token, formattedQuery); + formattedQuery = that.formatLineComment(token, formattedQuery); } else if (token.type === _tokenTypes2["default"].BLOCK_COMMENT) { - formattedQuery = _this.formatBlockComment(token, formattedQuery); + formattedQuery = that.formatBlockComment(token, formattedQuery); } else if (token.type === _tokenTypes2["default"].RESERVED_TOPLEVEL) { - formattedQuery = _this.formatToplevelReservedWord(token, formattedQuery); - _this.previousReservedWord = token; + formattedQuery = that.formatToplevelReservedWord(token, formattedQuery); + that.previousReservedWord = token; } else if (token.type === _tokenTypes2["default"].RESERVED_NEWLINE) { - formattedQuery = _this.formatNewlineReservedWord(token, formattedQuery); - _this.previousReservedWord = token; + formattedQuery = that.formatNewlineReservedWord(token, formattedQuery); + that.previousReservedWord = token; }else if (token.type === _tokenTypes2["default"].RESERVED) { - formattedQuery = _this.formatWithSpaces(token, formattedQuery); - _this.previousReservedWord = token; + formattedQuery = that.formatWithSpaces(token, formattedQuery); + that.previousReservedWord = token; } else if (token.type === _tokenTypes2["default"].OPEN_PAREN) { - formattedQuery = _this.formatOpeningParentheses(token, formattedQuery); + formattedQuery = that.formatOpeningParentheses(token, formattedQuery); } else if (token.type === _tokenTypes2["default"].CLOSE_PAREN) { - formattedQuery = _this.formatClosingParentheses(token, formattedQuery); + formattedQuery = that.formatClosingParentheses(token, formattedQuery); } else if (token.type === _tokenTypes2["default"].PLACEHOLDER) { - formattedQuery = _this.formatPlaceholder(token, formattedQuery); + formattedQuery = that.formatPlaceholder(token, formattedQuery); } else if (token.value === '$') { - formattedQuery = _this.formatNewWithSpaces(token, formattedQuery); + formattedQuery = that.formatNewWithSpaces(token, formattedQuery); } else if (token.value === ",") { - formattedQuery = _this.formatComma(token, formattedQuery); + formattedQuery = that.formatComma(token, formattedQuery); } else if (token.value === ":") { - formattedQuery = _this.formatWithSpaceAfter(token, formattedQuery); + formattedQuery = that.formatWithSpaceAfter(token, formattedQuery); } else if (token.value === ".") { - formattedQuery = _this.formatWithoutSpaces(token, formattedQuery); + formattedQuery = that.formatWithoutSpaces(token, formattedQuery); } else if (token.value === ";") { - formattedQuery = _this.formatQuerySeparator(token, formattedQuery); + formattedQuery = that.formatQuerySeparator(token, formattedQuery); } else { - formattedQuery = _this.formatWithSpaces(token, formattedQuery); + formattedQuery = that.formatWithSpaces(token, formattedQuery); } }); return formattedQuery; @@ -545,10 +545,10 @@ }; Tokenizer.prototype.createParenRegex = function createParenRegex(parens) { - var _this = this; + var that = this; return new RegExp("^(" + parens.map(function (p) { - return _this.escapeParen(p); + return that.escapeParen(p); }).join("|") + ")", "i"); }; @@ -669,13 +669,13 @@ }; Tokenizer.prototype.getStringNamedPlaceholderToken = function getStringNamedPlaceholderToken(input) { - var _this2 = this; + var that2 = this; return this.getPlaceholderTokenWithKey({ input: input, regex: this.STRING_NAMED_PLACEHOLDER_REGEX, parseKey: function parseKey(v) { - return _this2.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) }); + return that2.getEscapedPlaceholderKey({ key: v.slice(2, -1), quoteChar: v.slice(-1) }); } }); }; diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 01210e4..6556d9f 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -2855,11 +2855,17 @@ /** * @description 鑾峰彇鎵ц鑴氭湰 */ -export function getAllSqls (config) { +export function getAllSqls (conf) { + let config = fromJS(conf).toJS() + let sqls = [] let urlFields = config.urlFields let appType = sessionStorage.getItem('appType') let process = config.process === 'true' + + if (urlFields) { + urlFields = urlFields.map(n => n.toLowerCase()) + } let filterComponent = (components, mainSearch) => { components.forEach(item => { @@ -2888,6 +2894,15 @@ if (appType === 'mob' && item.type !== 'search' && item.type !== 'topbar' && item.search && item.search.length > 0) { item.search = [] } + if (appType !== 'mob' && item.search && item.search.length > 0) { + item.search.forEach(cell => { + if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { + let msg = getFormSql(cell) + + sqls.push({uuid: cell.uuid, type: 'sForm', ...msg}) + } + }) + } if (item.subtype === 'tablecard') { // 鍏煎 item.type = 'card' @@ -2901,7 +2916,7 @@ let msg = getDataSource(item, mainSearch) - sqls.push({uuid: item.uuid, ...msg}) + sqls.push({uuid: item.uuid, type: 'datasource', ...msg}) } else if (item.setting && item.setting.useMSearch === 'true') { let searches = item.search || [] if (mainSearch.length > 0) { @@ -2930,6 +2945,24 @@ resetButton(item, cell) }) + } else if (item.subtype === 'editable' && col.editable === 'true') { + if (col.editType === 'select' && col.resourceType === '1') { + let msg = getFormSql(col) + + sqls.push({uuid: col.uuid, type: 'tbForm', ...msg}) + } else if (col.editType === 'popSelect') { + if (col.pops) { + col.pops.forEach(n => { + let msg = getPopSelectSql(n) + + sqls.push({uuid: n.uuid, type: 'popSource', ...msg}) + }) + } else { + let msg = getPopSelectSql(col) + + sqls.push({uuid: col.uuid, type: 'popSource', ...msg}) + } + } } }) } @@ -2939,7 +2972,7 @@ if (item.subtype === 'editable' && item.submit.intertype === 'system') { let msg = getEditTableSql(item.submit, item.cols, item.columns) - sqls.push({uuid: 'submit_' + item.uuid, ...msg}) + sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', ...msg}) } } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { item.subcards && item.subcards.forEach(card => { @@ -2991,11 +3024,11 @@ let msg = getSysDefaultSql(cell, _item) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'button', ...msg}) } else { let msg = getSysDefaultSql(cell, item) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'button', ...msg}) } } if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) { @@ -3005,42 +3038,70 @@ let msg = getSysBackSql(cell, _item) - sqls.push({uuid: 'back_' + cell.uuid, ...msg}) + sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', ...msg}) } else { let msg = getSysBackSql(cell, item) - sqls.push({uuid: 'back_' + cell.uuid, ...msg}) + sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', ...msg}) } + } + if (['pop', 'formSubmit'].includes(cell.OpenType) && cell.modal && cell.modal.fields) { + cell.modal.fields.forEach(form => { + // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { + let msg = getFormSql(form) + + sqls.push({uuid: form.uuid, type: 'form', ...msg}) + } else if (form.type === 'popSelect') { + let msg = getPopSelectSql(form) + + sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) + } + }) } } else if (cell.OpenType === 'excelIn') { if (cell.intertype === 'system') { let msg = getExcelInSql(cell) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'excelIn', ...msg}) } } else if (cell.OpenType === 'excelOut') { if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { let msg = getExcelOutSql(cell, item) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'excelOut', ...msg}) } } else if (cell.OpenType === 'funcbutton') { if (cell.funcType === 'print') { if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { let msg = getPrintSql(cell) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'print', ...msg}) + } + if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) { + cell.modal.fields.forEach(form => { + // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { + let msg = getFormSql(form) + + sqls.push({uuid: form.uuid, type: 'form', ...msg}) + } else if (form.type === 'popSelect') { + let msg = getPopSelectSql(form) + + sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) + } + }) } } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') { let msg = getPaySql(cell, item) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'pay', ...msg}) } } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { if (cell.pageTemplate === 'pay' && cell.payMode === 'system') { let msg = getPaySql(cell, item) - sqls.push({uuid: cell.uuid, ...msg}) + sqls.push({uuid: cell.uuid, type: 'pay', ...msg}) } } else if (cell.OpenType === 'popview') { if (cell.config && cell.config.components) { @@ -3148,6 +3209,11 @@ verify.invalid = 'false' } else if (btn.Ot === 'notRequired') { verify.invalid = 'false' + } + } + if (verify.uniques && verify.uniques.length > 0 && btn.Ot === 'requiredOnce') { + if (component.wrap && (component.wrap.datatype === 'static' || component.wrap.datatype === 'public')) { + verify.uniques = [] } } @@ -4011,6 +4077,9 @@ _sql = _sql.replace(/\$check@/ig, '@mk_check_begin@').replace(/@check\$/ig, '@mk_check_end@') reps.push('mk_check_begin', 'mk_check_end') } + if (/@db@/ig.test(_sql)) { + reps.push('db') + } reps = Array.from(new Set([...reps, ...colreps])) @@ -4261,6 +4330,9 @@ _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') reps.push('datam_begin', 'datam_end') } + if (/@db@/ig.test(_sql)) { + reps.push('db') + } reps = Array.from(new Set([...reps, ...colreps])) @@ -4270,7 +4342,6 @@ let getDataSource = (item, mainSearch = []) => { if (!item.setting || item.setting.interType !== 'system') return - item.setting.primaryKey = item.setting.primaryKey || 'ID' let searches = item.search || [] if (item.setting.useMSearch === 'true' && mainSearch.length > 0) { searches = [...searches, ...mainSearch] @@ -4348,7 +4419,7 @@ select ${secSql.join(',')}` // 涓嶉渶瑕佸崟寮曞彿锛歰rderBy銆乸ageSize銆乸ageIndex銆乨b - let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'typename', 'datam', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'typename'] + let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'datam', 'typename'] if (item.hasExtend) { regs.push('mk_time') @@ -4378,10 +4449,10 @@ if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql)) { LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} ` } else if (item.setting.laypage === 'true' && item.setting.order) { - LText = `/*system_query*/select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @mk_rows_begin@ order by tmptable.rows ` - reps.push('pageSize', 'orderBy', 'mk_rows_begin') + LText = `/*system_query*/select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` + reps.push('pageSize', 'orderBy', 'pageIndex') if (item.subtype === 'dualdatacard') { - DateCount = `/*system_query*/select count(1) as total from (select distinct ${item.setting.primaryKey} from ${_dataresource} ${_search})a` + DateCount = `/*system_query*/select count(1) as total from (select distinct ${item.setting.primaryKey || 'ID'} from ${_dataresource} ${_search})a` } else { DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}` } @@ -4452,15 +4523,15 @@ reps = Array.from(new Set(reps)) - LText = LText.replace(/\n\s{6,8}/g, '\n') - DateCount = DateCount.replace(/\n\s{6,8}/g, '\n') - _customScript = _customScript.replace(/\n\s{6,8}/g, '\n') - LText = LText.replace(/\n\s+\/\*/g, `\n/*`) - DateCount = DateCount.replace(/\n\s+\/\*/g, `\n/*`) - _customScript = _customScript.replace(/\n\s+\/\*/g, `\n/*`) + // LText = LText.replace(/\n\s{6,8}/g, '\n') + // DateCount = DateCount.replace(/\n\s{6,8}/g, '\n') + // _customScript = _customScript.replace(/\n\s{6,8}/g, '\n') + // LText = LText.replace(/\n\s+\/\*/g, `\n/*`) + // DateCount = DateCount.replace(/\n\s+\/\*/g, `\n/*`) + // _customScript = _customScript.replace(/\n\s+\/\*/g, `\n/*`) reps.forEach(n => { - if (['orderBy', 'pageSize', 'pageIndex', 'mk_rows_begin'].includes(n)) return + if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return LText = LText.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) DateCount = DateCount.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) @@ -4472,6 +4543,35 @@ _customScript = _customScript.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') reps.push('datam_begin', 'datam_end') } + if (/@db@/ig.test(testSql)) { + reps.push('db') + } + + // let sql = '' + // let sub_name = '' + // let tabid = '' + // let parid = '' + // let sub_field = '' + + // if (item.subtype === 'dualdatacard') { + // arr_field = item.columns.map(col => col.field).join(',') + // sub_name = item.setting.subdata + // tabid = item.setting.primaryKey || '' + // parid = item.setting.subBID || '' + // sub_field = item.subColumns.map(col => col.field).join(',') + // } + + // sql += ` + // SELECT obj_name='data',prm_field='',str_field='', + // arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' + // ` + + // if (DateCount) { + // sql += `UNION ALL + // SELECT obj_name='DateCount',prm_field='total',str_field='', + // arr_field='',tabid='',parid='',sub_name='',sub_field='' + // ` + // } return {LText, DateCount, customScript: _customScript, reps} } @@ -4727,6 +4827,9 @@ sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') reps.push('datam_begin', 'datam_end') } + if (/@db@/ig.test(sql)) { + reps.push('db') + } return {LText: sql, reps} } @@ -4958,6 +5061,9 @@ sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') reps.push('datam_begin', 'datam_end') } + if (/@db@/ig.test(sql)) { + reps.push('db') + } return {LText: sql, reps} } @@ -4979,7 +5085,6 @@ item.setting.interType = 'system' item.setting.execute = btn.verify.defaultSql || 'true' item.setting.dataresource = btn.verify.dataresource || '' - item.setting.primaryKey = btn.verify.primaryKey || '' item.setting.queryType = btn.verify.queryType item.setting.laypage = btn.pagination item.setting.order = btn.verify.order || '' @@ -5001,7 +5106,6 @@ item.setting.interType = 'system' item.setting.execute = btn.verify.setting.defaultSql || 'true' item.setting.dataresource = btn.verify.setting.dataresource || '' - item.setting.primaryKey = '' item.setting.queryType = btn.verify.setting.queryType item.setting.laypage = 'false' item.setting.order = btn.verify.setting.order || '' @@ -5100,8 +5204,194 @@ _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') reps.push('datam_begin', 'datam_end') } + if (/@db@/ig.test(_sql)) { + reps.push('db') + } return {LText: _sql, reps} + } + + let getFormSql = (item) => { + let arrfield = [item.valueField, item.valueText] + + if (item.type === 'checkcard') { + arrfield = item.fields ? item.fields.map(f => f.field) : [] + arrfield.push(item.cardValField) + if (item.urlField) { + arrfield.push(item.urlField) + } else if (item.colorField) { + arrfield.push(item.colorField) + } else if (item.parentField) { + arrfield.push(item.parentField) + } + } + + if (item.linkField) { + arrfield.push(item.linkField) + } + if (['select', 'radio', 'link', 'checkcard'].includes(item.type) && item.linkSubField && item.linkSubField.length > 0) { + arrfield.push(...item.linkSubField) + } else if (item.type === 'text' && item.editType === 'select' && item.linkSubField && item.linkSubField.length > 0) { // 鍙紪杈戣〃 + arrfield.push(...item.linkSubField) + } + if (item.disableField) { + arrfield.push(item.disableField) + } + + arrfield = Array.from(new Set(arrfield)) + + let _datasource = item.dataSource + let sql = '' + + if (/\s/.test(_datasource)) { // 鎷兼帴鍒悕 + _datasource = '(' + _datasource + ') tb' + } + + arrfield = arrfield.join(',') + + if (item.orderBy) { + sql = `select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} order by orderfield ${item.orderType}` + } else { + sql = `select distinct ${arrfield} from ${_datasource}` + } + + let reps = [] + + let decSql = [] + let secSql = [] + + let syses = ['mk_departmentcode', 'mk_organization', 'mk_user_type'] + syses.forEach(s => { + if (new RegExp('@' + s + '[^0-9a-z_]', 'ig').test(sql)) { + if (['mk_departmentcode', 'mk_organization'].includes(s)) { + decSql.push(`@${s} nvarchar(512)`) + } else { + decSql.push(`@${s} nvarchar(20)`) + } + secSql.push(`@${s}=@${s}@`) + reps.push(s) + } + }) + + decSql = decSql.join(',') + secSql = secSql.join(',') + + if (decSql) { + sql = `Declare ${decSql} select ${secSql} + ${sql} + ` + } + + let regs = ['ID', 'BID', 'datam', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang'] + + regs.forEach(s => { + if (new RegExp('@' + s + '@', 'ig').test(sql)) { + reps.push(s) + } + }) + + reps.forEach(n => { + sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) + }) + + if (/\$@/ig.test(sql)) { + sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') + reps.push('datam_begin', 'datam_end') + } + if (/@db@/ig.test(sql)) { + reps.push('db') + } + + return {LText: sql, reps} + } + + let getPopSelectSql = (item) => { + let arrfield = item.columns.map(f => f.field) + + if (item.linkSubField && item.linkSubField.length > 0) { + item.linkSubField.forEach(n => { + if (!arrfield.includes(n)) { + arrfield.push(n) + } + }) + } + + arrfield = arrfield.join(',') + if (/\s/.test(item.dataSource)) { // 鎷兼帴鍒悕 + item.dataSource = '(' + item.dataSource + ') tb' + } + + let sql = '' + let DateCount = '' + let _search = '' + let reps = [] + let sFields = [] + + if (item.searchKey) { + _search = '@search@' + sFields = item.searchKey.split(',') + } + + // 涓嶉渶瑕佸崟寮曞彿锛歰rderBy銆乸ageSize銆乸ageIndex銆乨b + let regs = [...sFields, 'orderBy', 'pageSize', 'pageIndex', 'ID', 'BID', 'time_id', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'lang', 'datam'] + + regs.forEach(s => { + if (new RegExp('@' + s + '@', 'ig').test(item.dataSource)) { + reps.push(s) + } + }) + + if (item.laypage === 'true') { + sql = `/*system_query*/select top @pageSize@ ${arrfield} from (select ${arrfield} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${item.dataSource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` + DateCount = `/*system_query*/select count(1) as total from ${item.dataSource} ${_search}` + + reps.push('pageSize', 'orderBy', 'pageIndex') + } else { + sql = `/*system_query*/select ${arrfield} from ${item.dataSource} ${_search} order by @orderBy@ ` + reps.push('orderBy') + } + + let decSql = [] + let secSql = [] + + let syses = ['mk_departmentcode', 'mk_organization', 'mk_user_type'] + syses.forEach(s => { + if (new RegExp('@' + s + '[^0-9a-z_]', 'ig').test(sql)) { + if (['mk_departmentcode', 'mk_organization'].includes(s)) { + decSql.push(`@${s} nvarchar(512)`) + } else { + decSql.push(`@${s} nvarchar(20)`) + } + secSql.push(`@${s}=@${s}@`) + reps.push(s) + } + }) + + decSql = decSql.join(',') + secSql = secSql.join(',') + + if (decSql) { + sql = `Declare ${decSql} select ${secSql} + ${sql} + ` + } + + reps.forEach(n => { + if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return + + sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) + DateCount = DateCount.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) + }) + if (/\$@/ig.test(sql)) { + sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') + DateCount = DateCount.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') + reps.push('datam_begin', 'datam_end') + } + if (/@db@/ig.test(sql)) { + reps.push('db') + } + + return {LText: sql, DateCount, reps} } let _mainSearch = [] @@ -5138,6 +5428,16 @@ } search.push(...group.fields) }) + + if (search.length > 0) { + search.forEach(cell => { + if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { + let msg = getFormSql(cell) + + sqls.push({uuid: cell.uuid, type: 'sForm', ...msg}) + } + }) + } } if (search.length > 0) { @@ -5160,7 +5460,7 @@ let msg = getDataSource(m, _mainSearch) - sqls.push({uuid: m.uuid, ...msg}) + sqls.push({uuid: m.uuid, type: 'interface', ...msg}) }) } diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 961119b..4e96051 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -289,6 +289,72 @@ param.menuname = setting.$name } + // if (window.backend && window.GLOB.CacheData.has('sql_' + setting.uuid)) { + // let item = window.GLOB.CacheData.get('sql_' + setting.uuid) + + // let values = { + // userid: sessionStorage.getItem('UserID') || '', + // time_id: Utils.getguid(), + // username: userName, + // fullname: fullName, + // roleid: RoleID, + // mk_departmentcode: departmentcode, + // mk_organization: organization, + // mk_user_type: mk_user_type, + // mk_nation: nation, + // mk_province: province, + // mk_city: city, + // mk_district: district, + // mk_address: address, + // orderby: orderBy, + // pagesize: setting.laypage ? pageSize : '9999', + // pageindex: pageIndex, + // id: id || '', + // bid: BID || '', + // loginuid: sessionStorage.getItem('LoginUID') || '', + // sessionuid: localStorage.getItem('SessionUid') || '', + // appkey: window.GLOB.appkey || '', + // lang: sessionStorage.getItem('lang'), + // typename: 'admin', + // datam: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '', + // datam_begin: sessionStorage.getItem('dataM') === 'true' ? '/*' : '', + // datam_end: sessionStorage.getItem('dataM') === 'true' ? '*/' : '', + // } + + // if (setting.hasExtend) { + // values.mk_time = setting.extendTime + // } + // if (setting.$re_year) { + // values.mk_year = year + // } + // if (window.GLOB.externalDatabase !== null) { + // values.db = window.GLOB.externalDatabase + // } + // if (item.works_flow_code) { + // values.works_flow_code = item.works_flow_code + // } + // item.urlkeys.forEach(key => { + // values[key] = item.urlparam[key] + // }) + + // let Ltext = item.LText + // let DateCount = item.DateCount + // let customScript = item.customScript + + // item.reps.forEach(n => { + // let key = n.toLowerCase() + // if (values.hasOwnProperty(key)) { + // Ltext = Ltext.replace(new RegExp('@' + key + '@', 'ig'), values[key]) + // DateCount = DateCount.replace(new RegExp('@' + key + '@', 'ig'), values[key]) + // customScript = customScript.replace(new RegExp('@' + key + '@', 'ig'), values[key]) + // } + // }) + + // if (search.length) { + + // } + // } + param.custom_script = Utils.formatOptions(_customScript, param.exec_type) param.LText = Utils.formatOptions(LText, param.exec_type) param.DateCount = Utils.formatOptions(DateCount, param.exec_type) diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 92426bc..c352ad1 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -377,7 +377,7 @@ } deleteTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_del', @@ -395,7 +395,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { notification.warning({ top: 92, @@ -414,7 +414,7 @@ } enableTran = (record) => { - const _this = this + const that = this let param = { func: 's_sVersion_sub', @@ -432,7 +432,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getTransList() + that.getTransList() } else { Modal.error({ title: result.message, @@ -601,7 +601,7 @@ } deleteApp = (record) => { - const _this = this + const that = this confirm({ content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�', @@ -621,12 +621,12 @@ duration: 5 }) - _this.setState({ + that.setState({ selectApp: null, selectSubApp: null, loading: true }) - _this.getAppList() + that.getAppList() } else { if (result.message.indexOf('kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�') > -1) { result.message = 'kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�' @@ -649,7 +649,7 @@ deleteSubApp = (record) => { const { selectApp } = this.state - const _this = this + const that = this let param = { func: 's_kei_addupt', @@ -696,11 +696,11 @@ duration: 5 }) - _this.setState({ + that.setState({ selectSubApp: null, loading: true }) - _this.getAppList() + that.getAppList() } else { notification.warning({ top: 92, @@ -821,7 +821,7 @@ } }) - const _this = this + const that = this confirm({ content: '纭畾瑕佹墽琛屽悧锛�', @@ -857,10 +857,10 @@ message: '鎵ц鎴愬姛銆�', duration: 3 }) - _this.setState({ + that.setState({ scriptIndex: 1 }, () => { - _this.getScriptList() + that.getScriptList() }) } resolve() diff --git a/src/views/basedesign/updateFormTab/index.jsx b/src/views/basedesign/updateFormTab/index.jsx index d17db4b..a70d45b 100644 --- a/src/views/basedesign/updateFormTab/index.jsx +++ b/src/views/basedesign/updateFormTab/index.jsx @@ -28,7 +28,7 @@ trigger = () => { const { config, menu, btnTab } = this.props - const _this = this + const that = this if (!config || !menu || !menu.LongParam) { notification.warning({ @@ -78,7 +78,7 @@ content: '', onOk() { return new Promise(resolve => { - _this.execUpdate(resolve, _config) + that.execUpdate(resolve, _config) }) }, onCancel() {} diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 1969680..112e0b5 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -90,7 +90,7 @@ } componentDidMount() { - const _this = this + const that = this if (window.GLOB.sysType !== 'cloud') { Object.defineProperty(window, 'debugger', { @@ -118,7 +118,7 @@ window.GLOB.breakpoint = value + '' sessionStorage.setItem('breakpoint', value) } - _this.debugChange() + that.debugChange() } }) } @@ -144,7 +144,7 @@ window.GLOB.breakpoint = false sessionStorage.removeItem('breakpoint') - _this.debugChange() + that.debugChange() } } } diff --git a/src/views/design/header/editfirstmenu/index.jsx b/src/views/design/header/editfirstmenu/index.jsx index 4d1b286..add92a2 100644 --- a/src/views/design/header/editfirstmenu/index.jsx +++ b/src/views/design/header/editfirstmenu/index.jsx @@ -92,7 +92,7 @@ return } - let _this = this + let that = this confirm({ title: `纭畾鍒犻櫎鑿滃崟銆�${item.MenuName}銆嬪悧锛焋, content: '', @@ -103,7 +103,7 @@ } return Api.getCloudConfig(param).then(res => { if (res.status) { - _this.props.reload() + that.props.reload() } else { notification.warning({ top: 92, diff --git a/src/views/design/header/index.jsx b/src/views/design/header/index.jsx index edbf8e8..5687095 100644 --- a/src/views/design/header/index.jsx +++ b/src/views/design/header/index.jsx @@ -33,13 +33,13 @@ logout = () => { // 閫�鍑虹櫥褰� - let _this = this + let that = this confirm({ title: '鎮ㄧ‘瀹氳閫�鍑哄悧?', content: '', onOk() { sessionStorage.clear() - _this.props.history.replace('/login') + that.props.history.replace('/login') window.location.reload() }, onCancel() {} diff --git a/src/views/interface/history/index.jsx b/src/views/interface/history/index.jsx index 2b3bdb6..4d313e6 100644 --- a/src/views/interface/history/index.jsx +++ b/src/views/interface/history/index.jsx @@ -43,13 +43,13 @@ } clear = () => { - const _this = this + const that = this confirm({ content: 'Are you sure you want to clear all your history requests?', onOk() { Api.clearInterfaces() - _this.setState({list: [], historys: []}) + that.setState({list: [], historys: []}) }, onCancel() {} }) diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 4b8f4d2..494b40e 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -780,6 +780,8 @@ } else if (this.checklog()) { if (sessionStorage.getItem('langList') && !config.trans) { + // } else if (window.backend && config.enabled && !config.allSqls) { + } else { notification.success({ top: 92, @@ -806,6 +808,14 @@ delete config.force } + // let sqls = [] + // delete config.allSqls + // if (window.backend && config.enabled) { + // sqls = getAllSqls(config) + + // config.allSqls = sqls + // } + if (config.cacheUseful !== 'true') { config.components = this.resetSyncQuery(config.components) } diff --git a/src/views/printTemplate/index.jsx b/src/views/printTemplate/index.jsx index 75783b8..8374dff 100644 --- a/src/views/printTemplate/index.jsx +++ b/src/views/printTemplate/index.jsx @@ -767,7 +767,7 @@ } deleteItem = () => { - const _this = this + const that = this const { editItemId, config } = this.state confirm({ @@ -777,13 +777,13 @@ onOk() { config.elements = config.elements.filter(item => item.uuid !== editItemId) - _this.setState({ + that.setState({ config: config, editItemId: config.uuid, editItemType: config.type, formlist: getpageform(config) }, () => { - _this.resetview() + that.resetview() }) }, onCancel() {} diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx index 83168c8..3697b06 100644 --- a/src/views/rolemanage/index.jsx +++ b/src/views/rolemanage/index.jsx @@ -409,7 +409,7 @@ deleteMenu = (record) => { const { app, appViewList } = this.state - const _this = this + const that = this let param = { func: 'sPC_MainMenu_Del', @@ -450,7 +450,7 @@ message: '鎿嶄綔鎴愬姛锛�', duration: 3 }) - _this.getMenuList(true) + that.getMenuList(true) if (_param) { Api.getCloudConfig(_param).then(res => { @@ -461,7 +461,7 @@ duration: 5 }) } else { - _this.setState({appViewList: _appViewList}) + that.setState({appViewList: _appViewList}) } }) } @@ -682,12 +682,12 @@ } initTree = () => { - const _this = this + const that = this confirm({ content: '鏉冮檺鏍戜細閲嶆柊鐢熸垚锛岀‘瀹氭墽琛屽悧锛�', onOk() { return new Promise(resolve => { - _this.getMenuList(true, resolve) + that.getMenuList(true, resolve) }) }, onCancel() {} @@ -695,13 +695,13 @@ } syncTree = () => { - const _this = this + const that = this confirm({ content: '鍚屾浼氭牴鎹彍鍗曞垹闄ゆ垨鏂板鑺傜偣锛岀‘瀹氭墽琛屽悧锛�', onOk() { return new Promise(resolve => { - _this.syncMenutree(resolve) + that.syncMenutree(resolve) }) }, onCancel() {} @@ -710,7 +710,7 @@ saveTree = () => { // const { trees } = this.state - const _this = this + const that = this // if (!trees || trees.length === 0) { // notification.warning({ @@ -725,7 +725,7 @@ content: '纭畾鎵ц鍚楋紵', onOk() { return new Promise(resolve => { - _this.execSave(resolve) + that.execSave(resolve) }) }, onCancel() {} diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index 61f2b2d..8b998c2 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -540,6 +540,8 @@ } else if (this.checklog()) { if (sessionStorage.getItem('langList') && !config.trans) { + // } else if (window.backend && config.enabled && !config.allSqls) { + } else { notification.success({ top: 92, @@ -566,6 +568,14 @@ delete config.force } + // let sqls = [] + // delete config.allSqls + // if (window.backend && config.enabled) { + // sqls = getAllSqls(config) + + // config.allSqls = sqls + // } + let tbs = [] let btns = this.getMenuMessage(tbs) let arr = [] -- Gitblit v1.8.0