From b48528b1a1a88e289fc0b7ad52f2da213a3f9dfe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 23 四月 2025 16:34:38 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/datasource/verifycard/utils.jsx | 17 ++ src/menu/lowerText/index.scss | 33 +++++ src/utils/utils-custom.js | 74 ++++++++--- src/tabviews/zshare/settingcomponent/index.jsx | 16 +- src/tabviews/zshare/actionList/printbutton/index.jsx | 9 + src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 16 + src/tabviews/custom/popview/index.jsx | 16 +- src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx | 10 + src/views/tabledesign/index.jsx | 2 src/tabviews/basetable/index.jsx | 14 + src/tabviews/custom/components/module/invoice/index.jsx | 14 + src/tabviews/custom/index.jsx | 29 +++- src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx | 11 + src/menu/lowerText/index.jsx | 71 +++++++++++ src/menu/debug/index.jsx | 10 + src/tabviews/zshare/settingcomponent/editTable/index.jsx | 12 +- src/views/menudesign/index.jsx | 2 17 files changed, 280 insertions(+), 76 deletions(-) diff --git a/src/menu/datasource/verifycard/utils.jsx b/src/menu/datasource/verifycard/utils.jsx index cb79b71..c679a71 100644 --- a/src/menu/datasource/verifycard/utils.jsx +++ b/src/menu/datasource/verifycard/utils.jsx @@ -37,10 +37,6 @@ if (setting.interType === 'system' && setting.execute !== 'false') { _dataresource = setting.dataresource || '' } - - if (/\s/.test(_dataresource)) { - _dataresource = '(' + _dataresource + ') tb' - } // if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { // window.GLOB.funcs.forEach(item => { @@ -110,8 +106,19 @@ }) } + let custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript)) { + custompage = true + } + + if (/\s/.test(_dataresource)) { + _dataresource = '(' + _dataresource + ') tb' + } + // 姝e垯鏇挎崲 - let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) let _regoptions = getSearchRegs(searches) let _search = joinMainSearchkey(searches) diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index ac2ec2e..dfd426f 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -2513,14 +2513,20 @@ _search = '' } + let custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript)) { + custompage = true + } + if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } item.setting.dataresource = _dataresource item.setting.customScript = _customScript - - let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) if (_dataresource) { if (custompage) { diff --git a/src/menu/lowerText/index.jsx b/src/menu/lowerText/index.jsx new file mode 100644 index 0000000..cad57b3 --- /dev/null +++ b/src/menu/lowerText/index.jsx @@ -0,0 +1,71 @@ +import React, { Component } from 'react' +import { Modal, Button, Input, message } from 'antd' +import { CopyOutlined } from '@ant-design/icons' + +import './index.scss' + +const { TextArea } = Input + +class LowerText extends Component { + state = { + visible: false, + content: '' + } + + trigger = () => { + this.setState({ + visible: true, + content: '' + }) + } + + changeValue = (e) => { + this.setState({content: e.target.value.toLowerCase()}) + } + + copy = () => { + const { content } = this.state + + if (navigator.clipboard) { + navigator.clipboard.writeText(content) + } else { + let oInput = document.createElement('input') + oInput.value = content + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + } + + message.success('澶嶅埗鎴愬姛銆�') + } + + render() { + const { visible, content } = this.state + + return ( + <> + <Button className="mk-border-yellow" onClick={this.trigger}>鏂囨湰杞皬鍐�</Button> + <Modal + title="鏂囨湰杞皬鍐�" + wrapClassName="lower-text-modal" + visible={visible} + width={700} + maskClosable={false} + centered={true} + onCancel={() => { this.setState({ visible: false })}} + footer={[ + <Button key="cancel" onClick={() => { this.setState({ visible: false })}}>鍏抽棴</Button> + ]} + destroyOnClose + > + <TextArea defaultValue="" autoFocus rows={7} onChange={this.changeValue}/> + <CopyOutlined onClick={this.copy}/> + <div className="lower-value">{content}</div> + </Modal> + </> + ) + } +} + +export default LowerText \ No newline at end of file diff --git a/src/menu/lowerText/index.scss b/src/menu/lowerText/index.scss new file mode 100644 index 0000000..d8ce425 --- /dev/null +++ b/src/menu/lowerText/index.scss @@ -0,0 +1,33 @@ +.lower-text-modal { + .ant-modal-body { + min-height: 150px; + + .anticon-copy { + float: right; + color: #52c41a; + position: relative; + top: 20px; + } + .lower-value { + border: 1px solid #91d5ff; + height: 200px; + margin-top: 40px; + padding: 5px; + overflow-y: auto; + } + .lower-value::-webkit-scrollbar { + width: 8px; + } + .lower-value::-webkit-scrollbar-thumb { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); + background: rgba(0, 0, 0, 0.13); + border-radius: 5px; + } + .lower-value::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + border-radius: 3px; + } + } +} \ No newline at end of file diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 17ca612..05e30ac 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -692,9 +692,6 @@ if (!component.setting.execute) { component.setting.dataresource = '' } - if (/\s/.test(component.setting.dataresource)) { - component.setting.dataresource = '(' + component.setting.dataresource + ') tb' - } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') @@ -714,8 +711,17 @@ component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 component.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� + component.setting.custompage = false - component.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript) + if (/order\s+by\s+sort_id\s*$/i.test(component.setting.dataresource)) { + component.setting.custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript)) { + component.setting.custompage = true + } + + if (/\s/.test(component.setting.dataresource)) { + component.setting.dataresource = '(' + component.setting.dataresource + ') tb' + } if (!component.setting.execute || component.setting.custompage) { component.forbidLine = true diff --git a/src/tabviews/custom/components/module/invoice/index.jsx b/src/tabviews/custom/components/module/invoice/index.jsx index dfb257f..079f4b7 100644 --- a/src/tabviews/custom/components/module/invoice/index.jsx +++ b/src/tabviews/custom/components/module/invoice/index.jsx @@ -216,9 +216,6 @@ if (!item.setting.execute) { item.setting.dataresource = '' } - if (/\s/.test(item.setting.dataresource)) { - item.setting.dataresource = '(' + item.setting.dataresource + ') tb' - } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 item.setting.dataresource = item.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') @@ -238,8 +235,17 @@ item.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 item.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� + item.setting.custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(item.setting.dataresource)) { + item.setting.custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript)) { + item.setting.custompage = true + } - item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) + if (/\s/.test(item.setting.dataresource)) { + item.setting.dataresource = '(' + item.setting.dataresource + ') tb' + } return item } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 746f9c8..8234d4a 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -923,12 +923,9 @@ delete item.scripts item.setting.$name = item.$menuname || '' item.setting.execute = item.setting.execute !== 'false' // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡 - + if (!item.setting.execute) { item.setting.dataresource = '' - } - if (/\s/.test(item.setting.dataresource)) { - item.setting.dataresource = '(' + item.setting.dataresource + ') tb' } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 @@ -950,10 +947,16 @@ item.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 item.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� - item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) + item.setting.custompage = false - if (item.setting.$tree) { + if (/order\s+by\s+sort_id\s*$/i.test(item.setting.dataresource)) { item.setting.custompage = true + } else if (item.setting.$tree || /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript)) { + item.setting.custompage = true + } + + if (/\s/.test(item.setting.dataresource)) { + item.setting.dataresource = '(' + item.setting.dataresource + ') tb' } if (!item.setting.execute || item.setting.custompage) { @@ -1387,9 +1390,6 @@ if (!inter.setting.execute) { inter.setting.dataresource = '' } - if (/\s/.test(inter.setting.dataresource)) { - inter.setting.dataresource = '(' + inter.setting.dataresource + ') tb' - } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 inter.setting.dataresource = inter.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') @@ -1409,8 +1409,17 @@ inter.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 inter.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� + inter.setting.custompage = false - inter.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(inter.setting.dataresource + inter.setting.customScript) + if (/order\s+by\s+sort_id\s*$/i.test(inter.setting.dataresource)) { + inter.setting.custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(inter.setting.dataresource + inter.setting.customScript)) { + inter.setting.custompage = true + } + + if (/\s/.test(inter.setting.dataresource)) { + inter.setting.dataresource = '(' + inter.setting.dataresource + ') tb' + } return inter }) diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 261269a..57a2d3f 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -602,12 +602,9 @@ delete item.scripts item.setting.$name = item.$menuname || '' item.setting.execute = item.setting.execute !== 'false' // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡 - + if (!item.setting.execute) { item.setting.dataresource = '' - } - if (/\s/.test(item.setting.dataresource)) { - item.setting.dataresource = '(' + item.setting.dataresource + ') tb' } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 @@ -628,11 +625,16 @@ item.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 item.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� + item.setting.custompage = false - item.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript) - - if (item.setting.$tree) { + if (/order\s+by\s+sort_id\s*$/i.test(item.setting.dataresource)) { item.setting.custompage = true + } else if (item.setting.$tree || /@pageSize@|@orderBy@|@mk_total/i.test(item.setting.dataresource + item.setting.customScript)) { + item.setting.custompage = true + } + + if (/\s/.test(item.setting.dataresource)) { + item.setting.dataresource = '(' + item.setting.dataresource + ') tb' } if (!item.setting.execute || item.setting.custompage) { diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index ac49651..36aa1b9 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -882,10 +882,6 @@ _setting.dataresource = '' } - if (/\s/.test(_setting.dataresource)) { - _setting.dataresource = '(' + _setting.dataresource + ') tb' - } - let _customScript = '' let _tailScript = '' btn.verify.scripts && btn.verify.scripts.forEach(script => { @@ -922,7 +918,17 @@ _setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� _setting.laypage = pagination - _setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_setting.dataresource + _setting.customScript) + _setting.custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_setting.dataresource)) { + _setting.custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_setting.dataresource + _setting.customScript)) { + _setting.custompage = true + } + + if (/\s/.test(_setting.dataresource)) { + _setting.dataresource = '(' + _setting.dataresource + ') tb' + } _setting.queryType = btn.verify.queryType _setting.$name = btn.logLabel diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 547bf77..5b331b5 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1098,8 +1098,15 @@ _dataresource = '' } + let custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript + _tailScript)) { + custompage = true + } + let isDataM = sessionStorage.getItem('dataM') === 'true' - let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript + _tailScript) let regoptions = [ { reg: /@orderBy@/ig, value: btn.verify.setting.order }, { reg: /@pageSize@/ig, value: '9999' }, diff --git a/src/tabviews/zshare/settingcomponent/editTable/index.jsx b/src/tabviews/zshare/settingcomponent/editTable/index.jsx index 4596721..b0a64e2 100644 --- a/src/tabviews/zshare/settingcomponent/editTable/index.jsx +++ b/src/tabviews/zshare/settingcomponent/editTable/index.jsx @@ -67,11 +67,11 @@ editingKey: '', visible: false, columns: [{ - title: '鍚嶇О', + title: window.GLOB.dict['name'] || '鍚嶇О', dataIndex: 'label', width: '25%' }, { - title: '蹇嵎閿�', + title: window.GLOB.dict['shortcut'] || '蹇嵎閿�', dataIndex: 'shortcut', inputType: 'cascader', editable: true, @@ -82,14 +82,14 @@ return text[0] + '+' + shortkeycode[text[1]] } }, { - title: '鎵撳嵃鏈�', + title: window.GLOB.dict['printer'] || '鎵撳嵃鏈�', dataIndex: 'printer', inputType: 'select', editable: true, options: [], width: '25%' }, { - title: '鎿嶄綔', + title: window.GLOB.dict['operation'] || '鎿嶄綔', dataIndex: 'operation', width: '140px', render: (text, record) => { @@ -120,14 +120,14 @@ width: '26.1%' }, { - title: '鎵撳嵃鏈�', + title: window.GLOB.dict['printer'] || '鎵撳嵃鏈�', dataIndex: 'printer', inputType: 'select', editable: true, options: [], }, { - title: '鎿嶄綔', + title: window.GLOB.dict['operation'] || '鎿嶄綔', dataIndex: 'operation', width: '153px', render: (text, record) => { diff --git a/src/tabviews/zshare/settingcomponent/index.jsx b/src/tabviews/zshare/settingcomponent/index.jsx index dd87d2c..f2e08de 100644 --- a/src/tabviews/zshare/settingcomponent/index.jsx +++ b/src/tabviews/zshare/settingcomponent/index.jsx @@ -22,6 +22,8 @@ components: null, // 缁勪欢闆嗗悎 revertLoading: false, // 鎭㈠榛樿璁剧疆 confirmLoading: false, // 鑷畾涔夎缃ā鎬佹鍔犺浇涓� + dict: window.GLOB.dict, + lang: sessionStorage.getItem('lang') } shouldComponentUpdate (nextProps, nextState) { @@ -531,30 +533,30 @@ } render() { - const { components, visible } = this.state + const { components, visible, dict, lang } = this.state if (window.GLOB.mkHS || window.GLOB.sysType !== 'local') return null return ( <div className="tool-wrap"> - <Tooltip placement="left" title="鑷畾涔夎缃�"> + <Tooltip placement="left" title={dict['custom_settings'] || '鑷畾涔夎缃�'}> <Button icon="setting" shape="circle" onClick={this.trigger}/> </Tooltip> <Modal wrapClassName="custom-setting-modal" - title="鑷畾涔夎缃�" + title={dict['custom_settings'] || '鑷畾涔夎缃�'} maskClosable={false} width={950} visible={visible} onCancel={() => { this.setState({ visible: false }) }} footer={[ - <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>鎭㈠榛樿璁剧疆</Button>, - <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>鍙栨秷</Button>, - <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>鎻愪氦</Button> + <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{dict['restore_default'] || '鎭㈠榛樿璁剧疆'}</Button>, + <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{dict['cancel'] || '鍙栨秷'}</Button>, + <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{dict['submit'] || '鎻愪氦'}</Button> ]} destroyOnClose > - <div className="tip">娉細琛岀骇鎸夐挳蹇嵎閿缃棤鏁堛��</div> + {lang !== 'en-US' ? <div className="tip">娉細琛岀骇鎸夐挳蹇嵎閿缃棤鏁堛��</div> : null} {components && components.length > 0 ? components.map(item => ( <div key={item.uuid}> <p className="component-title">{item.title}</p> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx index 4949841..c64b0ef 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx @@ -46,11 +46,17 @@ _dataresource = '' } + let custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript)) { + custompage = true + } + if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } - - let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) // 姝e垯鏇挎崲 regoptions.push({ diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx index 719ba0e..7409df3 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx @@ -30,11 +30,18 @@ if (setting.defaultSql === 'false') { _dataresource = '' } + + let custompage = false + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript)) { + custompage = true + } + if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } - - let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) // 姝e垯鏇挎崲 let regoptions = [{ diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index d51b230..62635f2 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -2528,6 +2528,10 @@ } else if (item.type === 'group') { traversal(item.components) } else { + if (item.wrap && item.wrap.title) { + sql.push(item.wrap.title) + } + if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { if (item.setting.interType === 'system') { filterSql(item.setting.dataresource) @@ -2744,6 +2748,8 @@ text = text.filter(Boolean) menu = menu.filter(Boolean) + sql = sql.map(n => n.replace(/(:|锛�)$/g, '')) + sql = Array.from(new Set(sql)) btn = Array.from(new Set(btn)) ops = Array.from(new Set(ops)) @@ -2779,16 +2785,31 @@ export function setLangTrans (config, btnDict, titDict, lisDict, menuDict, regs, tail) { let filterElement = (card) => { if (card.datatype === 'static' && card.eleType === 'text' && !/@.+@/g.test(card.value)) { - if (card.value && titDict[card.value]) { - card.value = titDict[card.value] + if (card.value) { + card.value = replaceTitle(card.value) } } - if (card.prefix && titDict[card.prefix]) { - card.prefix = titDict[card.prefix] + if (card.prefix) { + card.prefix = replaceTitle(card.prefix) } - if (card.postfix && titDict[card.postfix]) { - card.postfix = titDict[card.postfix] + if (card.postfix) { + card.postfix = replaceTitle(card.postfix) } + } + + let replaceTitle = (val)聽=> { + if聽(/(:|锛�)$/g.test(val)) { + let _val = val.replace(/(:|锛�)$/g,聽'') + if聽(titDict[_val]) { + val = titDict[_val] + val.substr(-1) + }聽else if (titDict[val]) { + val = titDict[val] + } + }聽else if (titDict[val]) { + val = titDict[val] + } + + return val } let getuuid = () => { @@ -2900,8 +2921,8 @@ } let filterForm = (n) => { - if (n.label && titDict[n.label]) { - n.label = titDict[n.label] + if (n.label) { + n.label = replaceTitle(n.label) } if (n.resourceType === '1') { n.dataSource = filterSql(n.dataSource) @@ -2962,14 +2983,17 @@ components.forEach(item => { if (item.type === 'tabs') { item.subtabs.forEach(tab => { - if (tab.label && titDict[tab.label]) { - tab.label = titDict[tab.label] + if (tab.label) { + tab.label = replaceTitle(tab.label) } traversal(tab.components) }) } else if (item.type === 'group') { traversal(item.components) } else { + if (item.wrap && item.wrap.title) { + item.wrap.title = replaceTitle(item.wrap.title) + } if (item.wrap && (item.wrap.click === 'menu' || item.wrap.click === 'menus')) { if (item.wrap.click === 'menu') { resetMenu(item.wrap) @@ -2994,8 +3018,8 @@ if (item.columns) { item.columns.forEach(cell => { - if (cell.label && titDict[cell.label]) { - cell.label = titDict[cell.label] + if (cell.label) { + cell.label = replaceTitle(cell.label) } }) } @@ -3114,14 +3138,14 @@ } else if (item.type === 'table') { let loopCol = (cols) => { cols.forEach(col => { - if (col.label && titDict[col.label]) { - col.label = titDict[col.label] + if (col.label) { + col.label = replaceTitle(col.label) } - if (col.prefix && titDict[col.prefix]) { - col.prefix = titDict[col.prefix] + if (col.prefix) { + col.prefix = replaceTitle(col.prefix) } - if (col.postfix && titDict[col.postfix]) { - col.postfix = titDict[col.postfix] + if (col.postfix) { + col.postfix = replaceTitle(col.postfix) } if (col.type === 'colspan') { loopCol(col.subcols) @@ -5021,6 +5045,7 @@ // } let _search = '' + if (item.setting.execute !== 'false') { _dataresource = item.setting.dataresource || '' _search = '@mk_search@' @@ -5030,14 +5055,21 @@ _search = '' } + let custompage = false + let testSql = _dataresource + _customScript + _tailScript + + if (/order\s+by\s+sort_id\s*$/i.test(_dataresource)) { + custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql)) { + custompage = true + } + if (/\s/.test(_dataresource) && !/\)\s+tb$/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } item.setting.dataresource = _dataresource item.setting.customScript = _customScript - - let testSql = _dataresource + _customScript + _tailScript let decSql = [`@ErrorCode nvarchar(50),@retmsg nvarchar(4000)`] let secSql = [`@ErrorCode='S',@retmsg =''`] @@ -5091,7 +5123,7 @@ let DateCount = '' if (_dataresource) { /*system_query*/ - if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql) || (item.wrap && item.wrap.tree === 'true')) { + if (custompage || (item.wrap && item.wrap.tree === 'true')) { LText = `select ${arr_field} from ${_dataresource} ${_search} ` } else if (item.setting.laypage === 'true' && item.setting.order) { LText = `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 ` diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 81247eb..d7d9dc1 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -37,6 +37,7 @@ const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) const DelExtraDb = asyncComponent(() => import('@/menu/delExtraDb')) const LowerField = asyncComponent(() => import('@/menu/lowerField')) +const LowerText = asyncComponent(() => import('@/menu/lowerText')) const Debug = asyncComponent(() => import('@/menu/debug')) const NormalCss = asyncComponent(() => import('@/menu/normalCss')) const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) @@ -1369,6 +1370,7 @@ <ReplaceField config={config} updateConfig={this.resetConfig}/> <LowerField config={config} updateConfig={this.resetConfig}/> <DelExtraDb config={config} updateConfig={this.resetConfig}/> + <LowerText /> <PictureController/> <Button onClick={() => window.open('#/ai')}>DeepSeek</Button> </div>} trigger={['hover']}> diff --git a/src/views/tabledesign/index.jsx b/src/views/tabledesign/index.jsx index f662bfa..235d3e2 100644 --- a/src/views/tabledesign/index.jsx +++ b/src/views/tabledesign/index.jsx @@ -35,6 +35,7 @@ const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) const DelExtraDb = asyncComponent(() => import('@/menu/delExtraDb')) const LowerField = asyncComponent(() => import('@/menu/lowerField')) +const LowerText = asyncComponent(() => import('@/menu/lowerText')) const Debug = asyncComponent(() => import('@/menu/debug')) const Versions = asyncComponent(() => import('@/menu/versions')) const Transfer = asyncComponent(() => import('@/menu/transfer')) @@ -1097,6 +1098,7 @@ <ReplaceField config={config} updateConfig={this.resetConfig}/> <LowerField config={config} updateConfig={this.resetConfig}/> <DelExtraDb config={config} updateConfig={this.resetConfig}/> + <LowerText /> <Button onClick={() => window.open('#/ai')}>DeepSeek</Button> </div>} trigger={['hover']}> <div className="mk-button-more">鏇村<DownOutlined/></div> -- Gitblit v1.8.0