From 6ee201b2f734c9e704fb989aca0dabd09890c724 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 二月 2024 18:07:18 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/templates/zshare/modalform/index.jsx | 8 src/menu/datasource/verifycard/utils.jsx | 61 +++-- src/mob/searchconfig/index.jsx | 2 src/templates/zshare/verifycard/callbackcustomscript/index.jsx | 2 src/menu/components/share/searchcomponent/index.jsx | 2 src/templates/zshare/verifycard/customscript/index.jsx | 30 ++- src/tabviews/zshare/actionList/excelInbutton/index.jsx | 40 --- src/templates/sharecomponent/searchcomponent/index.jsx | 2 src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx | 108 +++++----- src/tabviews/zshare/actionList/exceloutbutton/index.jsx | 18 src/tabviews/custom/popview/index.jsx | 4 src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx | 23 - src/templates/zshare/verifycard/customform/index.jsx | 1 src/views/systemfunc/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 2 src/api/index.js | 11 src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx | 30 +- src/views/billprint/index.jsx | 3 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 8 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 90 ++++++-- src/tabviews/custom/components/share/tabtransfer/index.jsx | 4 src/templates/zshare/verifycard/index.jsx | 2 src/menu/components/search/main-search/index.jsx | 2 src/menu/components/share/actioncomponent/actionform/index.jsx | 2 src/tabviews/custom/index.jsx | 4 src/views/menudesign/index.scss | 2 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | 2 src/menu/debug/index.jsx | 76 ------- src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx | 2 29 files changed, 269 insertions(+), 274 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 27ac4ad..e173cbb 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1146,8 +1146,15 @@ appkey: window.GLOB.appkey || '' } - let id = Utils.getuuid() - sql = sql.replace(/@time_id@/ig, `'${id}'`) + sql = sql.replace(/@time_id@/ig, `'${Utils.getuuid()}'`) + sql = sql.replace(/@ID@/ig, `'${Utils.getuuid()}'`) + sql = sql.replace(/@BID@/ig, `'${Utils.getuuid()}'`) + sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID')}'`) + sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid')}'`) + sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID')}'`) + sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey}'`) + // sql = sql.replace(/@datam@/ig, `''`) + if (window.GLOB.externalDatabase !== null) { sql = sql.replace(/@db@/ig, window.GLOB.externalDatabase) } diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index 90368da..cd9612d 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -256,7 +256,7 @@ }) let sql = res.dataSource - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && res.database === 'sso') { diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 7885890..72c1ce9 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -23,7 +23,7 @@ tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width', 'hidden', 'openTab'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'hidden'], - form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'refreshTab', 'title', 'hidden'] + form: ['label', 'OpenType', 'formType', 'intertype', 'Ot', 'execSuccess', 'execError', 'syncComponent', 'width', 'openmenu', 'refreshTab', 'title', 'hidden'] } class ActionForm extends Component { diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index 01ecd13..6752638 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -203,7 +203,7 @@ }) let sql = res.dataSource - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && res.database === 'sso') { diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 4b74dca..038dee7 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -555,7 +555,7 @@ ${_option.sql}` // LoginUID|SessionUid|UserID|Appkey 宸叉浛鎹� - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && values.database === 'sso') { @@ -612,11 +612,7 @@ sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) ${sql}` - sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') - sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) - sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) - sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) - sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) Api.sDebug(sql).then(result => { if (result.status || result.ErrCode === '-2') { diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx index 25cc2b8..0e64f59 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx @@ -151,7 +151,7 @@ let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') if (skip) { this.setState({ diff --git a/src/menu/datasource/verifycard/utils.jsx b/src/menu/datasource/verifycard/utils.jsx index 724e9ca..b443500 100644 --- a/src/menu/datasource/verifycard/utils.jsx +++ b/src/menu/datasource/verifycard/utils.jsx @@ -49,43 +49,56 @@ }) } - _dataresource = _dataresource.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`) - _customScript = _customScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`) - _tailScript = _tailScript.replace(/@(BID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid|typename)@/ig, `'1949-10-01 15:00:00'`) + let getuuid = () => { + let uuid = [] + let timestamp = new Date().getTime() + let _options = '0123456789abcdefghigklmnopqrstuv' + for (let i = 0; i < 19; i++) { + uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) + } + uuid = timestamp + uuid.join('') + return uuid + } - _dataresource = _dataresource.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@\$|\$@/ig, '') - _tailScript = _tailScript.replace(/@\$|\$@/ig, '') + let regs = [ + {reg: /@time_id@/ig, value: `'${getuuid()}'`}, + {reg: /@BID@/ig, value: `'${getuuid()}'`}, + {reg: /@upid@/ig, value: `'${getuuid()}'`}, + {reg: /@typename@/ig, value: `'debug'`}, + {reg: /@datam@/ig, value: `''`}, + {reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID')}'`}, + {reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid')}'`}, + {reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID')}'`}, + {reg: /@Appkey@/ig, value: `'${window.GLOB.appkey}'`}, + {reg: /@\$|\$@/ig, value: ''}, + {reg: /@select\$|\$select@/ig, value: ''}, + {reg: /@sum\$|\$sum@/ig, value: ''}, + ] if (window.GLOB.process) { - _dataresource = _dataresource.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`) - _customScript = _customScript.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`) - _tailScript = _tailScript.replace(/@works_flow_code@/ig, `'1949-10-01 15:00:00'`) + regs.push({reg: /@works_flow_code@/ig, value: `'${getuuid()}'`}) } - - _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '') - _customScript = _customScript.replace(/@select\$|\$select@/ig, '') - _customScript = _customScript.replace(/@sum\$|\$sum@/ig, '') - _dataresource = _dataresource.replace(/\$sum@/ig, '/*') - _dataresource = _dataresource.replace(/@sum\$/ig, '*/') if (type === 'calendar') { - _dataresource = _dataresource.replace(/@mk_year@/ig, '') - _customScript = _customScript.replace(/@mk_year@/ig, '') + regs.push({reg: /@mk_year@/ig, value: '2024'}) } + + // 澶栬仈鏁版嵁搴撴浛鎹� + if (window.GLOB.externalDatabase !== null) { + regs.push({reg: /@db@/ig, value: window.GLOB.externalDatabase}) + } + + regs.forEach(item => { + _dataresource = _dataresource.replace(item.reg, item.value) + _customScript = _customScript.replace(item.reg, item.value) + _tailScript = _tailScript.replace(item.reg, item.value) + }) if (_customScript) { _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='',@UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' ${_customScript} ` - } - - // 澶栬仈鏁版嵁搴撴浛鎹� - if (window.GLOB.externalDatabase !== null) { - _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase) - _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) - _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase) } if (window.GLOB.urlFields) { diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index adc227a..9b48dde 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -74,13 +74,7 @@ { reg: /@\$/ig, value: '' }, { reg: /@datam@/ig, value: `''` }, ] - - if (window.GLOB.externalDatabase !== null) { - regs.push({ - reg: /@db@/ig, - value: window.GLOB.externalDatabase - }) - } + if (config.urlFields) { config.urlFields.forEach(field => { regs.push({ @@ -423,12 +417,6 @@ aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` } - backSql = backSql.replace(/@ID@/ig, `'id'`) - backSql = backSql.replace(/@BID@/ig, `'bid'`) - backSql = backSql.replace(/@LoginUID@/ig, `'LoginUID'`) - backSql = backSql.replace(/@SessionUid@/ig, `'SessionUid'`) - backSql = backSql.replace(/@UserID@/ig, `'UserID'`) - backSql = backSql.replace(/@Appkey@/ig, `'appkey'`) backSql = backSql.replace(/@typename@/ig, `'typename'`) backSql = backSql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) } @@ -462,13 +450,6 @@ { reg: /@\$/ig, value: '' }, { reg: /@datam@/ig, value: `''` }, ] - - if (window.GLOB.externalDatabase !== null) { - regs.push({ - reg: /@db@/ig, - value: window.GLOB.externalDatabase - }) - } if (process) { regs.push({ reg: /@works_flow_code@/ig, value: `'1949-10-01 15:00:00'` }) @@ -566,8 +547,8 @@ } getSysDefaultSql = (btn, component, process, group, retmsg) => { - let primaryId = 'id' - let BID = 'bid' + let primaryId = Utils.getuuid() + let BID = Utils.getuuid() let verify = btn.verify || {} let _actionType = null let setting = component.setting @@ -1344,10 +1325,6 @@ _sql = _sql.replace(/@ID@/ig, `'${primaryId || ''}'`) _sql = _sql.replace(/@BID@/ig, `'${BID}'`) - _sql = _sql.replace(/@LoginUID@/ig, `'LoginUID'`) - _sql = _sql.replace(/@SessionUid@/ig, `'SessionUid'`) - _sql = _sql.replace(/@UserID@/ig, `'UserID'`) - _sql = _sql.replace(/@Appkey@/ig, `'appkey'`) _sql = _sql.replace(/@typename@/ig, `'typename'`) _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) @@ -1377,19 +1354,8 @@ let sheet = _sheet.replace(/(.*)\.(.*)\./ig, '') database = database ? (database[0] || '') : '' - - let getuuid = () => { - let uuid = [] - let timestamp = new Date().getTime() - let _options = '0123456789abcdefghigklmnopqrstuv' - for (let i = 0; i < 19; i++) { - uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) - } - uuid = timestamp + uuid.join('') - return uuid - } - let upId = getuuid() + let upId = Utils.getuuid() let vals = [] btn.columns.forEach(col => { @@ -1433,21 +1399,11 @@ {reg: new RegExp('(^|\\s)@' + sheet + '(\\s|$)', 'ig'), value: ` #${sheet} `}, {reg: new RegExp('(^|\\s)@' + sheet + '\\(', 'ig'), value: ` #${sheet}(`}, {reg: new RegExp('(^|\\s)@' + sheet + '\\)', 'ig'), value: ` #${sheet})`}, - {reg: /@ID@/ig, value: `'id'`}, - {reg: /@BID@/ig, value: `'bid'`}, - {reg: /@LoginUID@/ig, value: `'LoginUID'`}, - {reg: /@SessionUid@/ig, value: `'SessionUid'`}, - {reg: /@UserID@/ig, value: `'UserID'`}, - {reg: /@Appkey@/ig, value: `'appkey'`}, {reg: /@typename@/ig, value: `'admin'`}, {reg: /\$@/ig, value: ''}, {reg: /@\$/ig, value: ''}, {reg: /@datam@/ig, value: `''`}, ] - - if (window.GLOB.externalDatabase !== null) { - regs.push({reg: /@db@/ig, value: window.GLOB.externalDatabase}) - } btn.scripts && btn.scripts.forEach(script => { if (script.status === 'false') return @@ -1635,20 +1591,11 @@ {reg: new RegExp('(^|\\s)@' + sheet + '(\\s|$)', 'ig'), value: ` #${sheet} `}, {reg: new RegExp('(^|\\s)@' + sheet + '\\(', 'ig'), value: ` #${sheet}(`}, {reg: new RegExp('(^|\\s)@' + sheet + '\\)', 'ig'), value: ` #${sheet})`}, - {reg: /@BID@/ig, value: `'${BID}'`}, - {reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`}, - {reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`}, - {reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`}, - {reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`}, {reg: /@typename@/ig, value: `'admin'`}, {reg: /\$@/ig, value: isDM ? '/*' : ''}, {reg: /@\$/ig, value: isDM ? '*/' : ''}, {reg: /@datam@/ig, value: isDM ? `'Y'` : `''`}, ] - - if (window.GLOB.externalDatabase !== null) { - regs.push({reg: /@db@/ig, value: window.GLOB.externalDatabase}) - } btn.scripts && btn.scripts.forEach(script => { if (script.status === 'false') return @@ -1792,13 +1739,6 @@ { reg: /@\$/ig, value: '' }, { reg: /@datam@/ig, value: `''` }, ] - - if (window.GLOB.externalDatabase !== null) { - regs.push({ - reg: /@db@/ig, - value: window.GLOB.externalDatabase - }) - } let sql = this.formatDataSource(item, regs) @@ -1914,17 +1854,11 @@ { reg: /@orderBy@/ig, value: item.setting.order || '' }, { reg: /@pageSize@/ig, value: 9999 }, { reg: /@pageIndex@/ig, value: 1}, - { reg: /@ID@/ig, value: `''`}, - { reg: /@BID@/ig, value: `''`}, - { reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`}, - { reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`}, - { reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`}, - { reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`}, { reg: /@typename@/ig, value: `'admin'`}, ) if (item.type === 'calendar') { - regoptions.push({ reg: /@mk_year@/ig, value: '2023' }) + regoptions.push({ reg: /@mk_year@/ig, value: '2024' }) } regoptions.forEach(cell => { diff --git a/src/mob/searchconfig/index.jsx b/src/mob/searchconfig/index.jsx index 15d5fd2..716433e 100644 --- a/src/mob/searchconfig/index.jsx +++ b/src/mob/searchconfig/index.jsx @@ -229,7 +229,7 @@ }) let sql = res.dataSource - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && res.database === 'sso') { diff --git a/src/tabviews/custom/components/share/tabtransfer/index.jsx b/src/tabviews/custom/components/share/tabtransfer/index.jsx index a4f5005..2523935 100644 --- a/src/tabviews/custom/components/share/tabtransfer/index.jsx +++ b/src/tabviews/custom/components/share/tabtransfer/index.jsx @@ -168,6 +168,10 @@ MKEmitter.emit('transferSyncData', tabId) if (!result.message) return + + if (/灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(result.message)) { + result.message = result.message + '璇锋鏌ュ瓧娈甸泦' + } if (result.ErrCode === 'N') { Modal.error({ title: result.message, diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index aa98810..d41d649 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -1338,6 +1338,10 @@ MKEmitter.emit('transferSyncData', MenuID) if (!result.message) return + + if (/灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(result.message)) { + result.message = result.message + '璇锋鏌ュ瓧娈甸泦' + } if (result.ErrCode === 'N') { Modal.error({ title: result.message, diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 403cace..2e3bdff 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -920,6 +920,10 @@ MKEmitter.emit('transferSyncData', Tab.uuid) if (!result.message) return + + if (/灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(result.message)) { + result.message = result.message + '璇锋鏌ュ瓧娈甸泦' + } if (result.ErrCode === 'N') { Modal.error({ title: result.message, diff --git a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx index ee748ae..80e3562 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx @@ -1,6 +1,5 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import { notification } from 'antd' import * as XLSX from 'sheetjs-style' import Utils from '@/utils/utils.js' import './index.scss' @@ -27,10 +26,6 @@ onImportExcel = file => { const { btn } = this.props - let btnColumns = btn.verify.columns.filter(option => option.import !== 'init') - let columns = btnColumns.map(option => option.Column) - let range = btn.verify.range || 0 - // excel鏁版嵁澶勭悊 const { files } = file.target const fileReader = new FileReader() @@ -42,50 +37,64 @@ // 浠ヤ簩杩涘埗娴佹柟寮忚鍙栧緱鍒版暣浠絜xcel琛ㄦ牸瀵硅薄 const workbook = XLSX.read(result, { type: 'binary' }) - let errors = null - let sheetName = btn.verify.sheet - let errDetail = '' - - if (sheetName === 'Sheet1' && Object.keys(workbook.Sheets).length === 1) { - sheetName = Object.keys(workbook.Sheets)[0] - } - - if (!workbook.Sheets.hasOwnProperty(sheetName)) { - errors = 'notexit' - } else if (range === 1) { - let header = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {header: columns})[0] - - if (!header) { - errors = 'empty' - } else { - let iserror = false - btnColumns.forEach(op => { - if (iserror) return - - let _name = typeof(header[op.Column]) === 'string' ? header[op.Column].replace(/(^\s*|\s*$)/g, '') : header[op.Column] - let _text = op.Text ? op.Text.replace(/(^\s*|\s*$)/g, '') : op.Text - - if (!_name) { - iserror = true - errors = 'headerError' - errDetail = `Excel涓笉瀛樺湪锛�${_text}锛夊垪锛乣 - } else if (_name !== _text) { - iserror = true - errors = 'headerError' - errDetail = `Excel涓紙${_name}锛変笌鎸夐挳鍒椾俊鎭紙${_text}锛変笉涓�鑷达紒` - } - }) + if (btn.verify.excelHandle === 'true') { + // eslint-disable-next-line + let func = new Function('XLSX', 'workbook', 'btn', 'callback', btn.verify.excel_func) + func(XLSX, workbook, btn.verify, (data, error) => { + if (!error && (!data || data.length === 0)) { + error = '鏈幏鍙栧埌Excel鏁版嵁锛�' + } + this.props.returndata(data, error) + }) + } else { + let btnColumns = btn.verify.columns.filter(option => option.import !== 'init') + let columns = btnColumns.map(option => option.Column) + let range = btn.verify.range || 0 + + let error = null + let sheetName = btn.verify.sheet + + if (sheetName === 'Sheet1' && Object.keys(workbook.Sheets).length === 1) { + sheetName = Object.keys(workbook.Sheets)[0] } + + if (!workbook.Sheets.hasOwnProperty(sheetName)) { + error = '宸ヤ綔琛ㄣ��' + sheetName + '銆嬩笉瀛樺湪锛�' + } else if (range === 1) { + let header = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {header: columns})[0] + + if (!header) { + error = '宸ヤ綔琛ㄣ��' + sheetName + '銆嬩负绌猴紒' + } else { + btnColumns.forEach(op => { + if (error) return + + let _name = typeof(header[op.Column]) === 'string' ? header[op.Column].replace(/(^\s*|\s*$)/g, '') : header[op.Column] + let _text = op.Text ? op.Text.replace(/(^\s*|\s*$)/g, '') : op.Text + + if (!_name) { + error = `宸ヤ綔琛ㄣ��${sheetName}銆嬭〃澶撮敊璇紝Excel涓笉瀛樺湪锛�${_text}锛夊垪锛乣 + } else if (_name !== _text) { + error = `宸ヤ綔琛ㄣ��${sheetName}銆嬭〃澶撮敊璇紝Excel涓紙${_name}锛変笌鎸夐挳鍒椾俊鎭紙${_text}锛変笉涓�鑷达紒` + } + }) + } + } + + let data = [] + + if (!error) { + data = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {header: columns, range: (range)}) + + if (!data || data.length === 0) { + error = '鏈幏鍙栧埌宸ヤ綔琛ㄣ��' + sheetName + '銆嬫暟鎹紒' + } + } + + // 鏈�缁堣幏鍙栧埌骞朵笖鏍煎紡鍖栧悗鐨� json 鏁版嵁 + this.props.returndata(data, error) } - let data = [] - - if (!errors) { - data = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName], {header: columns, range: (range)}) - } - - // 鏈�缁堣幏鍙栧埌骞朵笖鏍煎紡鍖栧悗鐨� json 鏁版嵁 - this.props.returndata(data, errors, sheetName, errDetail) this.setState({ excelId: '', }, () => { @@ -101,13 +110,8 @@ excelId: Utils.getuuid() }) }) - notification.warning({ - top: 92, - message: '鏂囦欢瑙f瀽閿欒锛�', - duration: 5 - }) // 閿欒浼犻�� - this.props.returndata([], 'other') + this.props.returndata([], '鏂囦欢瑙f瀽閿欒锛�') } } diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index b4ac4ee..bfc7d78 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -276,43 +276,21 @@ /** * @description Excel 瀵煎叆 */ - getexceldata = (data, errors, sheetName, errDetail) => { + getexceldata = (data, error) => { const { btn, BID } = this.props - if (errors) { - if (errors === 'notexit') { - notification.warning({ - top: 92, - message: '宸ヤ綔琛ㄣ��' + sheetName + '銆嬩笉瀛樺湪锛�', - duration: 5 - }) - } else if (errors === 'empty') { - notification.warning({ - top: 92, - message: '宸ヤ綔琛ㄣ��' + sheetName + '銆嬩负绌猴紒', - duration: 5 - }) - } else if (errors === 'headerError') { - notification.warning({ - top: 92, - message: `宸ヤ綔琛ㄣ��${sheetName}銆嬭〃澶撮敊璇紝${errDetail}`, - duration: 5 - }) - } + if (error) { + notification.warning({ + top: 92, + message: error, + duration: 5 + }) this.setState({ loading: false }) return } - - if (!data || data.length === 0) { - notification.warning({ - top: 92, - message: '鏈幏鍙栧埌宸ヤ綔琛ㄣ��' + sheetName + '銆嬫暟鎹紒', - duration: 5 - }) - this.setState({ loading: false }) - return - } else if (data.length * btn.verify.columns.length > 30000) { + + if (data.length * btn.verify.columns.length > 30000) { notification.warning({ top: 92, message: '褰撳墠瀵煎叆鏁版嵁閲忚繃澶э紝濡傞亣閿欒鎻愮ず锛岃鍒嗘壒瀵煎叆锛�', diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx index af9100d..59c62e1 100644 --- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx +++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx @@ -168,7 +168,7 @@ Api.genericInterface(param).then(result => { if (result.status) { - this.exportExcel(result.data, result.ErrCode, result.message) + this.exportExcel(result.data, result.ErrCode, result.message, viewParam.search) } else { this.execError(result) } @@ -187,7 +187,7 @@ Api.genericInterface(param).then(result => { if (result.status) { - this.exportExcel(result.data, result.ErrCode, result.message) + this.exportExcel(result.data, result.ErrCode, result.message, viewParam.search) } else { this.execError(result) } @@ -226,7 +226,7 @@ Api.genericInterface(param).then(result => { if (result.status) { - this.exportExcel(result.data, result.ErrCode, result.message) + this.exportExcel(result.data, result.ErrCode, result.message, viewParam.search) } else { this.execError(result) } @@ -273,7 +273,7 @@ Api.genericInterface(res).then(result => { if (result.status) { - this.exportExcel(result.data, result.ErrCode, result.message) + this.exportExcel(result.data, result.ErrCode, result.message, viewParam.search) } else { this.execError(result) } @@ -353,7 +353,7 @@ this.getExcelOutDoubleData(viewParam, pageIndex, pageSize, data) } else { data = data.concat(result.data) - this.exportExcel(data, result.ErrCode, result.message) + this.exportExcel(data, result.ErrCode, result.message, viewParam.search) } } else { this.execError(result) @@ -429,7 +429,7 @@ this.getExcelOutData(viewParam, pageIndex, pageSize, data) } else { data = data.concat(result.data) - this.exportExcel(data, result.ErrCode, result.message) + this.exportExcel(data, result.ErrCode, result.message, viewParam.search) } } else { this.execError(result) @@ -443,7 +443,7 @@ /** * @description Excel 鐢熸垚 */ - exportExcel = (data, ErrCode, msg) => { + exportExcel = (data, ErrCode, msg, search) => { const { btn } = this.props let imgCol = false @@ -486,8 +486,8 @@ try { if (btn.verify.excelHandle === 'true') { // eslint-disable-next-line - let func = new Function('XLSX', 'data', 'columns', 'callback', btn.verify.excel_func) - func(XLSX, data, columns, (res) => { + let func = new Function('XLSX', 'data', 'columns', 'searches', 'callback', btn.verify.excel_func) + func(XLSX, data, columns, search, (res) => { res = res || {ErrCode: ErrCode || 'S', message: msg || '瀵煎嚭鎴愬姛锛�'} this.execSuccess(res) }) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 5a9c2c4..85b9d3f 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -167,7 +167,7 @@ } let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail - sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@datam@/ig, `''`).replace(/@typename@/ig, `'debug'`) if (skip) { this.setState({ diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 5dd577b..a8733e8 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -19,7 +19,9 @@ const { confirm } = Modal const { Search } = Input const { Paragraph } = Typography + const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) +const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts')) class VerifyCard extends Component { @@ -307,17 +309,17 @@ _verify.range = 1 } + _verify.excelHandle = _verify.excelHandle || 'false' + _verify.default = _verify.default || 'true' + _verify.sheet = _verify.sheet || 'Sheet1' + _verify.range = _verify.range || 0 + _verify.columns = _columns + _verify.scripts = _verify.scripts || [] + _verify.uniques = _verify.uniques || [] + this.setState({ searchKey: '', - verify: { - ..._verify, - default: _verify.default || 'true', - sheet: _verify.sheet || 'Sheet1', - range: _verify.range || 0, - columns: _columns, - scripts: _verify.scripts || [], - uniques: _verify.uniques || [] - } + verify: _verify }, () => { this.resetUniqueColumns() }) @@ -712,6 +714,10 @@ if (!err) { let _verify = {...verify, ...values} + if (_verify.excelHandle !== 'true') { + delete _verify.excel_func + } + let cols = _verify.columns.map(col => col.Column.toLowerCase()) cols = Array.from(new Set(cols)) @@ -771,22 +777,27 @@ resolve(_verify) } } else { - notification.warning({ - top: 92, - message: '璇疯缃瓻xcel琛ㄥ悕!', - duration: 5 - }) + this.setState({activeKey: 'basemsg'}) } }) }) } - onOptionChange = (e, key) => { + onOptionChange = (e) => { const { verify } = this.state let value = e.target.value this.setState({ verify: {...verify, default: value} + }) + } + + onHandleChange = (e) => { + const { verify } = this.state + let value = e.target.value + + this.setState({ + verify: {...verify, excelHandle: value} }) } @@ -867,7 +878,44 @@ <TabPane tab="鍩虹楠岃瘉" key="basemsg"> <Form {...formItemLayout}> <Row gutter={24}> + {card.intertype === 'system' ? <Col span={8}> + <Form.Item label={'榛樿sql'}> + <Radio.Group value={verify.default} onChange={this.onOptionChange}> + <Radio value="true">鎵ц</Radio> + <Radio value="false">涓嶆墽琛�</Radio> + </Radio.Group> + </Form.Item> + </Col> : null} <Col span={8}> + <Form.Item label={ + <Tooltip placement="topRight" title="鑷畾涔夐獙璇丒xcel鏍煎紡锛屽彲鐢ㄥ弬鏁颁负 XLSX銆亀orkbook銆乥tn銆乧allback銆�"> + <QuestionCircleOutlined className="mk-form-tip" /> + 瀵煎叆鏍煎紡 + </Tooltip> + }> + {getFieldDecorator('excelHandle', { + initialValue: verify.excelHandle + })( + <Radio.Group onChange={this.onHandleChange}> + <Radio value="false">榛樿</Radio> + <Radio value="true">鑷畾涔�</Radio> + </Radio.Group>)} + </Form.Item> + </Col> + {verify.excelHandle === 'true' ? <Col span={24} style={{paddingLeft: '30px'}}> + <Form.Item wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} } label=""> + {getFieldDecorator('excel_func', { + initialValue: verify.excel_func || '', + rules: [ + { + required: true, + message: '璇峰~鍐欒嚜瀹氫箟閫昏緫!' + } + ] + })(<CodeMirror mode="text/javascript" theme="cobalt" />)} + </Form.Item> + </Col> : null} + {verify.excelHandle !== 'true' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title="瀵煎叆鏃跺伐浣滆〃鍚嶄笌excel涓繀椤讳竴鑷达紝娉細宸ヤ綔琛ㄥ悕涓篠heet1涓攅xcel涓粎鏈変竴涓伐浣滆〃鏃朵笉杩涜琛ㄥ悕楠岃瘉銆�"> <QuestionCircleOutlined className="mk-form-tip" /> @@ -884,8 +932,8 @@ ] })(<Input placeholder="" autoComplete="off" />)} </Form.Item> - </Col> - <Col span={8}> + </Col> : null} + {verify.excelHandle !== 'true' ? <Col span={8}> <Form.Item label={ <Tooltip placement="bottomLeft" title="蹇界暐棣栬鏃讹紝浼氭牎楠宔xcel涓〃澶村悕绉颁笌excel鍒楄缃槸鍚︿竴鑷淬��"> <QuestionCircleOutlined className="mk-form-tip" /> @@ -895,14 +943,6 @@ {getFieldDecorator('range', { initialValue: verify.range || 0 })(<InputNumber min={0} max={100} precision={0} />)} - </Form.Item> - </Col> - {card.intertype === 'system' ? <Col span={8}> - <Form.Item label={'榛樿sql'}> - <Radio.Group value={verify.default} onChange={this.onOptionChange}> - <Radio value="true">鎵ц</Radio> - <Radio value="false">涓嶆墽琛�</Radio> - </Radio.Group> </Form.Item> </Col> : null} </Row> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx index 3460133..1e04573 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/datasource/index.jsx @@ -219,7 +219,7 @@ </Col> : null} {btnType !== 'print' ? <Col span={8}> <Form.Item label={ - <Tooltip placement="topRight" title="鑷畾涔夌敓鎴怑xcel锛屽彲鐢ㄥ弬鏁颁负 XLSX銆乨ata銆乧olumns銆乧allback銆�"> + <Tooltip placement="topRight" title="鑷畾涔夌敓鎴怑xcel锛屽彲鐢ㄥ弬鏁颁负 XLSX銆乨ata銆乧olumns銆乻earches銆乧allback銆�"> <QuestionCircleOutlined className="mk-form-tip" /> 瀵煎嚭鏍煎紡 </Tooltip> diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx index 73f4f11..7df803d 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/utils.jsx @@ -49,20 +49,6 @@ if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } - - _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _dataresource = _dataresource.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@\$|\$@/ig, '') - _tailScript = _tailScript.replace(/@\$|\$@/ig, '') - - // 澶栬仈鏁版嵁搴撴浛鎹� - if (window.GLOB.externalDatabase !== null) { - _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase) - _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) - _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase) - } let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) @@ -76,6 +62,15 @@ }, { reg: new RegExp('@pageIndex@', 'ig'), value: 1 + }, { + reg: /@datam@/ig, + value: `''` + }, { + reg: /@typename@/ig, + value: `'debug'` + }, { + reg: /@\$|\$@/ig, + value: '' }) regoptions.forEach(item => { diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx index c414f14..60a1241 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/utils.jsx @@ -33,20 +33,24 @@ if (/\s/.test(_dataresource)) { _dataresource = '(' + _dataresource + ') tb' } - - _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _tailScript = _tailScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) - _dataresource = _dataresource.replace(/@\$|\$@/ig, '') - _customScript = _customScript.replace(/@\$|\$@/ig, '') - _tailScript = _tailScript.replace(/@\$|\$@/ig, '') - // 澶栬仈鏁版嵁搴撴浛鎹� - if (window.GLOB.externalDatabase !== null) { - _dataresource = _dataresource.replace(/@db@/ig, window.GLOB.externalDatabase) - _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) - _tailScript = _tailScript.replace(/@db@/ig, window.GLOB.externalDatabase) - } + // 姝e垯鏇挎崲 + let regoptions = [{ + reg: /@datam@/ig, + value: `''` + }, { + reg: /@typename@/ig, + value: `'debug'` + }, { + reg: /@\$|\$@/ig, + value: '' + }] + + regoptions.forEach(item => { + _dataresource = _dataresource.replace(item.reg, item.value) + _customScript = _customScript.replace(item.reg, item.value) + _tailScript = _tailScript.replace(item.reg, item.value) + }) let arr_field = columns.map(col => col.field) arr_field = arr_field.join(',') diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 4d077d4..9d4b8f3 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -210,7 +210,7 @@ }) let sql = res.dataSource - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && res.database === 'sso') { diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 82d6117..6f21e10 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -1096,7 +1096,7 @@ ${_option.sql}` // LoginUID|SessionUid|UserID|Appkey 宸叉浛鎹� - sql = sql.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|time_id)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@\$|\$@/ig, '') let rduri = '' if (window.GLOB.mainSystemApi && values.database === 'sso') { @@ -1153,11 +1153,7 @@ sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) ${sql}` - sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') - sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) - sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) - sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) - sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) + sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) resolve({values, loading: true, promise: () => new Promise((resolve, reject) => { Api.sDebug(sql).then(result => { diff --git a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx index 327d1c5..bad06ba 100644 --- a/src/templates/zshare/verifycard/callbackcustomscript/index.jsx +++ b/src/templates/zshare/verifycard/callbackcustomscript/index.jsx @@ -115,7 +115,7 @@ // 鏁版嵁鏉冮檺 sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '') - sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|typename)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@typename@/ig, `'debug'`) if (skip) { this.setState({ diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index c9c2116..ee29cbe 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -84,7 +84,6 @@ // 鏁版嵁鏉冮檺 sql = sql.replace(/@\$|\$@/ig, '') - sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'1949-10-01 15:00:00'`) this.setState({loading: true}) Api.sDebug(sql).then(res => { diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx index f619fc4..b0e413a 100644 --- a/src/templates/zshare/verifycard/customscript/index.jsx +++ b/src/templates/zshare/verifycard/customscript/index.jsx @@ -11,13 +11,14 @@ class CustomForm extends Component { static propTpyes = { type: PropTypes.any, - btn: PropTypes.object, // 鎸夐挳淇℃伅 - usefulfields: PropTypes.string, // 鍙敤瀛楁 - initsql: PropTypes.string, // sql鍓嶇紑 - defaultsql: PropTypes.array, // 榛樿sql - systemScripts: PropTypes.array, // 绯荤粺鑴氭湰 - customScripts: PropTypes.array, // 鑷畾涔夎剼鏈� - scriptsChange: PropTypes.func // 琛ㄥ崟 + btn: PropTypes.object, + usefulfields: PropTypes.string, + initsql: PropTypes.string, + defaultsql: PropTypes.string, + useDefaultSql: PropTypes.any, + systemScripts: PropTypes.array, + customScripts: PropTypes.array, + scriptsChange: PropTypes.func } state = { @@ -44,7 +45,7 @@ } handleConfirm = () => { - const { type, workFlow, flowType } = this.props + const { type, workFlow, flowType, useDefaultSql, defaultsql } = this.props const { editItem, skip } = this.state // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { @@ -126,7 +127,15 @@ } } - let sql = this.props.initsql + _initCustomScript + _prevCustomScript + _backCustomScript + tail + let sql = this.props.initsql + _initCustomScript + _prevCustomScript + + if (useDefaultSql) { + sql += `\n/* 榛樿sql */ + ${defaultsql} + ` + } + + sql += _backCustomScript + tail if (window.GLOB.funcs && window.GLOB.funcs.length > 0) { window.GLOB.funcs.forEach(item => { @@ -137,7 +146,8 @@ // 鏁版嵁鏉冮檺 sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '') - sql = sql.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|typename)@/ig, `'1949-10-01 15:00:00'`) + sql = sql.replace(/@datam@/ig, `''`) + sql = sql.replace(/@typename@/ig, `'debug'`) if (window.GLOB.process && workFlow === 'true') { sql = sql.replace(/@works_flow_code@/ig, `'works_flow_code'`) diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 8cedee1..1b7d9be 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -1776,6 +1776,7 @@ btn={this.props.card} initsql={this.state.initsql} customScripts={verify.scripts} + useDefaultSql={verify.default !== 'false'} defaultsql={this.state.defaultsql} usefulfields={this.state.usefulfields} systemScripts={this.state.systemScripts} @@ -1789,6 +1790,7 @@ workFlow={verify.workFlow} flowType={verify.flowType} customScripts={verify.scripts} + useDefaultSql={verify.default !== 'false'} defaultsql={this.state.defaultsql} usefulfields={this.state.usefulfields} systemScripts={this.state.systemScripts} diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 453d8a0..85f4b7e 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -909,6 +909,9 @@ return new Promise(resolve => { Api.genericInterface(item).then(res => { if (!res.status) { + if (item.func === 'sPC_Get_structured_data' && /灏嗘埅鏂瓧绗︿覆鎴栦簩杩涘埗鏁版嵁/ig.test(res.message)) { + res.message = res.message + '璇锋鏌ュ瓧娈甸泦' + } notification.warning({ top: 92, message: res.message, diff --git a/src/views/menudesign/index.scss b/src/views/menudesign/index.scss index 3c97cf2..74d1cf2 100644 --- a/src/views/menudesign/index.scss +++ b/src/views/menudesign/index.scss @@ -237,7 +237,7 @@ table { border-radius: 0!important; .ant-table-column-sorter { - display: none!important; + opacity: 0!important; } } .ant-table-thead > tr > th { diff --git a/src/views/systemfunc/index.jsx b/src/views/systemfunc/index.jsx index 63bee5f..9c33163 100644 --- a/src/views/systemfunc/index.jsx +++ b/src/views/systemfunc/index.jsx @@ -11,6 +11,7 @@ // import './index.scss' const Tabview = asyncComponent(() => import('@/components/tabview')) +const ImgScale = asyncComponent(() => import('@/components/imgScale')) class MkHS extends Component { UNSAFE_componentWillMount() { @@ -63,6 +64,7 @@ <Tabview key="tabview"/> <Header key="header"/> </ConfigProvider> + <ImgScale /> </div> ) } -- Gitblit v1.8.0