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' } // 正则替换 let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript) let _regoptions = getSearchRegs(searches) let _search = joinMainSearchkey(searches) 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) { src/menu/lowerText/index.jsx
New file @@ -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 src/menu/lowerText/index.scss
New file @@ -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; } } } 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 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 } 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是否执行,转为boolean 统一格式 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 }) 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是否执行,转为boolean 统一格式 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) { 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 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' }, 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) => { 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> 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) // 正则替换 regoptions.push({ 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) // 正则替换 let regoptions = [{ 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 ` 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']}> 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>