From 23c19efebd9f59fb6e78beff64782b39b3795a5d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 24 八月 2022 12:01:42 +0800 Subject: [PATCH] 2022-08-24 --- src/components/tabview/index.jsx | 10 - src/tabviews/custom/components/card/cardcellList/index.jsx | 2 src/utils/utils-datamanage.js | 7 + src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 16 ++ src/menu/components/card/cardcellcomponent/elementform/index.jsx | 2 src/components/breadview/index.jsx | 2 src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 2 /dev/null | 47 ------- src/tabviews/zshare/mutilform/index.jsx | 6 src/views/basedesign/index.jsx | 3 src/menu/components/card/cardcellcomponent/formconfig.jsx | 3 src/menu/components/share/actioncomponent/actionform/index.jsx | 20 ++ src/tabviews/zshare/actionList/normalbutton/index.jsx | 102 +++++++++++++++- src/views/systemfunc/sidemenu/config.jsx | 120 ++++++++++---------- 14 files changed, 195 insertions(+), 147 deletions(-) diff --git a/src/components/breadview/index.jsx b/src/components/breadview/index.jsx index fe00251..bd3d3cd 100644 --- a/src/components/breadview/index.jsx +++ b/src/components/breadview/index.jsx @@ -93,7 +93,7 @@ // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠� if (view.type === 'Home') { return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'CommonTable' || view.type === 'ManageTable') { + } else if (view.type === 'CommonTable') { return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) // } else if (view.type === 'BaseTable') { // return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 1f95394..ad4fec5 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -21,8 +21,6 @@ // const BaseTable = asyncComponent(() => import('@/tabviews/basetable')) const CalendarPage = asyncComponent(() => import('@/tabviews/calendar')) const TreePage = asyncComponent(() => import('@/tabviews/treepage')) -const VerupTable = asyncComponent(() => import('@/tabviews/verupmanage')) -const ScriptTable = asyncComponent(() => import('@/tabviews/scriptmanage')) const TabManage = asyncComponent(() => import('@/tabviews/tabmanage')) const Iframe = asyncComponent(() => import('@/tabviews/iframe')) const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage')) @@ -200,7 +198,7 @@ // 鏍规嵁tab椤典腑鑿滃崟淇℃伅锛岄�夋嫨鎵�闇�鐨勭粍浠� if (view.type === 'Home') { return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'CommonTable' || view.type === 'ManageTable') { + } else if (view.type === 'CommonTable') { return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) // } else if (view.type === 'BaseTable') { // return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) @@ -210,15 +208,9 @@ return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) } else if (view.type === 'CalendarPage') { return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) - } else if (view.type === 'VerupTable') { - return (<VerupTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'ScriptTable') { - return (<ScriptTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) } else if (view.type === 'TabManage') { return (<TabManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) } else if (view.type === 'RolePermission') { - return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) - } else if (view.type === 'appRolePermission') { return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) } else if (view.type === 'FormTab') { return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index bc181b0..2f702d5 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -135,7 +135,7 @@ } else if (card.eleType === 'splitline') { let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth return ( - <div style={{paddingTop: '1px'}}> + <div style={{paddingTop: _borderWidth ? '1px' : '10px'}}> <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> </div> ) diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 2e2b905..3492ada 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -229,8 +229,6 @@ }, () => { if (value === 'slider') { this.props.form.setFieldsValue({width: 24, color: '#1890ff'}) - } else if (value === 'splitline') { - this.props.form.setFieldsValue({width: 24, color: '#e8e8e8'}) } else if (value === 'qrcode') { this.props.form.setFieldsValue({color: '#000000'}) } else if (value === 'text' || value === 'number') { diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index c54f2a0..5ea5621 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -414,7 +414,8 @@ min: 0, max: 50, label: '绾垮', - initVal: card.borderWidth || 1, + initVal: card.borderWidth === undefined ? 1 : card.borderWidth, + tooltip: '绾垮涓�0鏃讹紝涓烘柟渚垮湪寮�鍙戞椂閫変腑榛樿楂樺害涓�10px锛岃娉ㄦ剰璋冩暣鍐呭杈硅窛銆�', required: true }, { diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index a92b985..a071d66 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -178,7 +178,7 @@ reReadonly.interface = false reRequired.interface = true } else if (intertype === 'outer') { - shows.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType', 'output') + shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output') if (this.record.procMode === 'system') { shows.push('sql', 'sqlType') } else if (this.record.procMode === 'inner') { @@ -194,6 +194,8 @@ if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -241,7 +243,7 @@ reOptions.intertype = this.state.interTypeOptions.filter(item => item.value !== 'custom') if (intertype === 'outer') { - shows.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType') + shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType') if (this.record.procMode === 'system') { shows.push('sql', 'sqlType') } else if (this.record.procMode === 'inner') { @@ -257,6 +259,8 @@ if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -288,13 +292,15 @@ reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') reRequired.innerFunc = false reRequired.callbackFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -310,12 +316,14 @@ reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc') reRequired.innerFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -370,13 +378,15 @@ if (_funcType === 'print') { shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') reRequired.innerFunc = false reRequired.callbackFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 3f84bdc..ac0e2cc 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -573,7 +573,7 @@ } else if (card.eleType === 'splitline') { let _borderWidth = card.borderWidth === undefined ? 1 : card.borderWidth return ( - <Col key={card.uuid} span={card.width}> + <Col key={card.uuid} span={card.width} style={{minHeight: _borderWidth}}> <div style={card.style}> <div className="ant-mk-splitline" style={{borderColor: card.color, borderWidth: _borderWidth}}></div> </div> diff --git a/src/tabviews/scriptmanage/actionList/index.jsx b/src/tabviews/scriptmanage/actionList/index.jsx deleted file mode 100644 index 500aa55..0000000 --- a/src/tabviews/scriptmanage/actionList/index.jsx +++ /dev/null @@ -1,313 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import moment from 'moment' -import { Button, Modal, notification, message } from 'antd' - -import asyncSpinComponent from '@/utils/asyncSpinComponent' -import options from '@/store/options.js' -import Utils from '@/utils/utils.js' -import Api from '@/api' -import './index.scss' - -const { confirm } = Modal -const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform')) - -class MainAction extends Component { - static propTpyes = { - BID: PropTypes.string, // 涓昏〃ID - BData: PropTypes.any, // 涓昏〃鏁版嵁 - Tab: PropTypes.any, // 濡傛灉褰撳墠鍏冪礌涓烘爣绛炬椂锛宼ab涓烘爣绛句俊鎭� - MenuID: PropTypes.string, // 鑿滃崟ID - actions: PropTypes.array, // 鎸夐挳缁� - dict: PropTypes.object, // 瀛楀吀椤� - setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 - ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� - refreshdata: PropTypes.func, // 鎵ц瀹屾垚鍚庢暟鎹埛鏂� - selectedData: PropTypes.array // 琛ㄦ牸閫変腑鏁版嵁 - } - - state = { - visible: false, - formdata: null, - tabledata: null, - confirmLoading: false, - execAction: null, - configMap: {} - } - - /** - * @description 瑙﹀彂鎸夐挳鎿嶄綔 - */ - actionTrigger = (item, record) => { - const { setting, selectedData } = this.props - - let _this = this - let data = selectedData || [] - - if (record) { // 琛ㄦ牸涓Е鍙戞寜閽� - data = [record] - } - - if (item.Ot !== 'notRequired' && data.length === 0) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectline'], - duration: 5 - }) - return - } else if (item.Ot === 'requiredSgl' && data.length !== 1) { - // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁 - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectSingleLine'], - duration: 5 - }) - return - } else if (item.Ot !== 'notRequired' && !setting.primaryKey) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿� - notification.warning({ - top: 92, - message: '鏈缃富閿紒', - duration: 5 - }) - return - } - - if (item.OpenType === 'prompt') { - confirm({ - title: this.props.dict['main.action.confirm.tip'], - onOk() { - return new Promise(resolve => { - _this.execSubmit(item, data, resolve) - }) - }, - onCancel() {} - }) - } else if (item.OpenType === 'pop') { - this.setState({ - visible: true, - execAction: item, - tabledata: data - }) - } - } - - /** - * @description 鎸夐挳鎻愪氦鎵ц - */ - execSubmit = (btn, data, _resolve, formdata) => { - const { setting } = this.props - let primaryId = data[0] ? data[0][setting.primaryKey] : '' - - if (btn.sqlType === 'insert') { - primaryId = '' - } - - let values = {} - if (formdata) { - formdata.forEach(_data => { - values[_data.key] = _data.value - }) - } else { - values = data[0] - } - - let param = { // 鑷畾涔夎剼鏈坊鍔犱慨鏀瑰垹闄� - func: 's_custom_script_adduptdel', - ID: primaryId, - func_param: values.func, - Remark: values.Remark, - Sort: values.Sort, - LText: values.LongParam - } - - if (btn.sqlType === 'delete') { - param.LText = window.GLOB.appkey || '' - param.Remark = '' - param.Sort = 0 - param.func_param = '' - } - - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - if (options.cloudServiceApi) { - param.rduri = options.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } - - Api.genericInterface(param).then((res) => { - if (res.status) { - this.execSuccess(btn, res) - } else { - this.execError(res, btn) - } - _resolve() - }) - } - - /** - * @description 鎿嶄綔鎴愬姛鍚庡鐞� - * 1銆乪xcel瀵煎嚭锛屾垚鍔熷悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� - * 2銆佺姸鎬佺爜涓� S 鏃讹紝鏄剧ず鎴愬姛淇℃伅鍚庣郴缁熼粯璁や俊鎭� - * 3銆佺姸鎬佺爜涓� -1 鏃讹紝涓嶆樉绀轰换浣曚俊鎭� - * 4銆佹ā鎬佹鎵ц鎴愬姛鍚庢槸鍚﹀叧闂� - * 5銆侀�氱煡涓诲垪琛ㄥ埛鏂� - */ - execSuccess = (btn, res) => { - if (res && res.ErrCode === 'S') { // 鎵ц鎴愬姛 - notification.success({ - top: 92, - message: res.ErrMesg || this.props.dict['main.action.confirm.success'], - duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 - }) - } else if (res && res.ErrCode === 'Y') { // 鎵ц鎴愬姛 - Modal.success({ - title: res.ErrMesg || this.props.dict['main.action.confirm.success'] - }) - } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず - - } - - if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { - this.setState({ - visible: false - }) - } - - if (btn.execSuccess !== 'never') { - this.props.refreshdata() - } - } - - /** - * @description 鎿嶄綔澶辫触鍚庡鐞� - * 1銆佺姸鎬佺爜涓� E銆丯銆丗銆丯M 鏃讹紝鏄剧ず鐩稿簲鎻愮ず淇℃伅 - * 2銆乪xcel瀵煎嚭锛屽け璐ュ悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� - * 3銆侀�氱煡涓诲垪琛ㄥ埛鏂� - */ - execError = (res, btn) => { - if (res.ErrCode === 'E') { - Modal.error({ - title: res.message || res.ErrMesg, - }) - } else if (res.ErrCode === 'N') { - notification.error({ - top: 92, - message: res.message || res.ErrMesg, - duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 - }) - } else if (res.ErrCode === 'F') { - notification.error({ - className: 'notification-custom-error', - top: 92, - message: res.message || res.ErrMesg, - duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 - }) - } else if (res.ErrCode === 'NM') { - message.error(res.message || res.ErrMesg) - } - } - - - /** - * @description 妯℃�佹锛堣〃鍗曪級锛岀‘璁� - */ - handleOk = () => { - this.formRef.handleConfirm().then(res => { - this.setState({ - confirmLoading: true - }) - - this.execSubmit(this.state.execAction, this.state.tabledata, () => { - this.setState({ - confirmLoading: false - }) - }, res) - }, () => {}) - } - - /** - * @description 妯℃�佹锛堣〃鍗曪級锛屽彇娑� - */ - handleCancel = () => { - this.setState({ - visible: false - }) - } - - /** - * @description 鏄剧ず妯℃�佹 - */ - getModels = () => { - const { execAction } = this.state - - if (!execAction || !this.state.visible) return - - let title = '' - let width = '62vw' - let clickouter = false - let container = document.body - - if (execAction && execAction.setting) { - title = execAction.setting.title - width = execAction.setting.width + 'vw' - - if (execAction.setting.container === 'tab' && this.props.ContainerId) { - width = execAction.setting.width + '%' - container = () => document.getElementById(this.props.ContainerId) - } - - if (execAction.setting.clickouter === 'close') { - clickouter = true - } - } - - return ( - <Modal - title={title} - maskClosable={clickouter} - getContainer={container} - wrapClassName='action-modal' - visible={this.state.visible} - width={width} - onOk={this.handleOk} - confirmLoading={this.state.confirmLoading} - onCancel={this.handleCancel} - destroyOnClose - > - <MutilForm - dict={this.props.dict} - action={execAction} - inputSubmit={this.handleOk} - configMap={this.state.configMap} - data={this.state.tabledata[0]} - BData={this.props.BData} - wrappedComponentRef={(inst) => this.formRef = inst} - /> - </Modal> - ) - } - - render() { - return ( - <div className="script-button-list script-toolbar-button"> - {this.props.actions.map((item, index) => { - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - >{item.label}</Button> - ) - })} - {this.getModels()} - </div> - ) - } -} - -export default MainAction \ No newline at end of file diff --git a/src/tabviews/scriptmanage/actionList/index.scss b/src/tabviews/scriptmanage/actionList/index.scss deleted file mode 100644 index 8f7def9..0000000 --- a/src/tabviews/scriptmanage/actionList/index.scss +++ /dev/null @@ -1,17 +0,0 @@ -.script-button-list.script-toolbar-button { - position: relative; - padding: 15px 20px 5px; - background: #ffffff; - button { - min-width: 65px; - margin-right: 15px; - margin-bottom: 10px; - overflow: hidden; - } - .ant-spin { - position: fixed; - z-index: 1010; - left: calc(50vw - 22px); - top: calc(50vh - 70px); - } -} diff --git a/src/tabviews/scriptmanage/config.jsx b/src/tabviews/scriptmanage/config.jsx deleted file mode 100644 index ec8e807..0000000 --- a/src/tabviews/scriptmanage/config.jsx +++ /dev/null @@ -1,88 +0,0 @@ -// 鐗堟湰鍗囩骇椤甸潰閰嶇疆 -export const scriptMainTable = { - setting: { - "tableName":"s_custom_script", - "tableType":"radio", - "interType":"inner", - "innerFunc":"", - "dataresource":"Select s.* from聽 s_custom_script s inner join (select OpenID from sapp where ID=@Appkey@) p on s.openid=p.OpenID", - "queryType":"query", - "actionfixed":false, - "columnfixed":false, - "primaryKey":"ID", - "order":"ID desc", - "onload":"true" - }, - tables: [{"TbName":"s_custom_script","Remark":"鑷畾涔夎剼鏈�"}], - search: [ - {"label":"鎻忚堪","field":"Remark","type":"text","initval":"","oriInitval":"", "match":"like","required": false,"ratio":6,"blacklist":[],"uuid":"1587005744706mppigfhf206gciiivf9"} - ], - action:[ - {"label":"娣诲姞","OpenType":"pop","intertype":"inner","innerFunc":"s_custom_script_adduptdel","position":"toolbar","Ot":"notRequired","execSuccess":"grid","execError":"never","icon":"","class":"green","sql":"s_custom_script","sqlType":"insert","uuid":"1587006129803057fs8mb9q151ae6165"}, - {"label":"淇敼","OpenType":"pop","intertype":"inner","innerFunc":"s_custom_script_adduptdel","position":"toolbar","Ot":"requiredSgl","execSuccess":"grid","execError":"never","icon":"","class":"purple","sql":"s_custom_script","sqlType":"update","uuid":"1587007258155ut4nbggg4r66t9uhut2"}, - {"label":"鍒犻櫎","OpenType":"prompt","intertype":"inner","innerFunc":"s_custom_script_adduptdel","position":"toolbar","Ot":"requiredSgl","execSuccess":"grid","execError":"never","icon":"","class":"danger","sql":"s_custom_script","sqlType":"delete","uuid":"1587007300102g2i6nrhtml3fk9053o4"} - ], - columns: [ - {"label":"ID","field":"ID","type":"text","Align":"left","Hide":"true","IsSort":"true","Width":120,"prefix":"","postfix":"","matchVal":"","color":"","fieldlength":50,"blacklist":[],"linkmenu":[],"uuid":"158700581972776t63lf5ev320o0v3a7"}, - {"label":"鍑芥暟","field":"func","type":"text","Align":"left","Hide":"false","IsSort":"true","Width":120,"prefix":"","postfix":"","matchVal":"","color":"","fieldlength":50,"blacklist":[],"linkmenu":[],"uuid":"1587005972372rc3486g45kslpho2hfm"}, - {"label":"鎻忚堪","field":"Remark","type":"text","Align":"left","Hide":"false","IsSort":"true","Width":120,"prefix":"","postfix":"","matchVal":"","color":"","fieldlength":50,"blacklist":[],"linkmenu":[],"uuid":"15870058197274p6dte4omt4smcsrg4e"}, - {"label":"LongParam","field":"LongParam","type":"text","Align":"left","Hide":"true","IsSort":"true","Width":120,"prefix":"","postfix":"","matchVal":"","color":"","fieldlength":50,"blacklist":[],"linkmenu":[],"uuid":"158700581972767qdag1vc4l37olpbra"}, - {"uuid":"1587005819727akuibkaqkhsl1ntbh7a","Align":"left","label":"鎺掑簭","field":"Sort","Hide":"false","IsSort":"true","type":"number","Width":120}, - {"label":"鎿嶄綔鏃ユ湡","field":"ModifyDate","type":"text","Align":"left","Hide":"false","IsSort":"true","Width":120,"prefix":"","postfix":"","matchVal":"","color":"","fieldlength":50,"blacklist":[],"linkmenu":[],"uuid":"1587005860878ckccsiagipdfsfpdiib"} - ], - gridBtn: {"display":false,"Align":"center","IsSort":"false","uuid":"1587005721270gs3nb5u1gs4gsg7g77i","label":"鎿嶄綔","type":"action","style":"button","show":"horizontal","Width":120}, - tabs:[], - tabgroups: ["tabs"], - easyCode: "", - funcs: [ - {"type":"view","subtype":"view","uuid":"1587005717541lov40vg61q7l1rbveon","intertype":"inner","interface":"","tableName":"s_custom_script","innerFunc":"","outerFunc":""}, - {"type":"button","subtype":"btn","uuid":"1587006129803057fs8mb9q151ae6165","label":"娣诲姞","tableName":"s_custom_script","intertype":"inner","interface":"","innerFunc":"","outerFunc":"","callbackFunc":""}, - {"type":"button","subtype":"btn","uuid":"1587007258155ut4nbggg4r66t9uhut2","label":"淇敼","tableName":"s_custom_script","intertype":"inner","interface":"","innerFunc":"","outerFunc":"","callbackFunc":""}, - {"type":"button","subtype":"btn","uuid":"1587007300102g2i6nrhtml3fk9053o4","label":"鍒犻櫎","tableName":"s_custom_script","intertype":"inner","interface":"","innerFunc":"","outerFunc":"","callbackFunc":""} - ] -} - -export const buttonConfig = { - '1587006129803057fs8mb9q151ae6165': { - type: "Modal", - setting: { - "title":"娣诲姞", - "width": 80, - "focus":"func", - "cols":"2", - "finish":"close", - "clickouter":"unclose", - "container":"tab", - "display":"modal" - }, - tables:[ - {"TbName":"s_custom_script","Remark":"鑷畾涔夎剼鏈�"} - ], - fields:[ - {"label":"鍑芥暟",span:12,labelwidth: 33.3,"field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, - {"label":"鎺掑簭",span:12,labelwidth: 33.3,"field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"15870101796149403f2pqfpviuo415m2"}, - {"label":"鎻忚堪",span:24,labelwidth: 16.3,"field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"}, - {"label":"鑴氭湰",span:24,labelwidth: 16.3,"field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","encryption":"true","hidden":"false","readin":"true","fieldlength":12000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"} - ] - }, - '1587007258155ut4nbggg4r66t9uhut2': { - type: "Modal", - setting: { - "title":"淇敼", - "width": 80, - "focus":"func", - "cols":"2", - "finish":"close", - "clickouter":"unclose", - "container":"tab", - "display":"modal" - }, - tables: [{"TbName":"s_custom_script","Remark":"鑷畾涔夎剼鏈�"}], - fields: [ - {"label":"鍑芥暟",span:12,labelwidth: 33.3,"field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"}, - {"label":"鎺掑簭",span:12,labelwidth: 33.3,"field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"1587010196675i9m6ie3tv9kg2rhgfi0"}, - {"label":"鎻忚堪",span:24,labelwidth: 16.3,"field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"}, - {"label":"鑴氭湰",span:24,labelwidth: 16.3,"field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","encryption":"true","hidden":"false","readin":"true","fieldlength":12000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"} - ] - } -} diff --git a/src/tabviews/scriptmanage/index.jsx b/src/tabviews/scriptmanage/index.jsx deleted file mode 100644 index 15c1be5..0000000 --- a/src/tabviews/scriptmanage/index.jsx +++ /dev/null @@ -1,351 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { notification, Switch } from 'antd' -import moment from 'moment' - -import Api from '@/api' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' -import Utils from '@/utils/utils.js' -import options from '@/store/options.js' -import { scriptMainTable, buttonConfig } from './config' -import MKEmitter from '@/utils/events.js' - -import asyncComponent from '@/utils/asyncComponent' -import asyncSpinComponent from '@/utils/asyncSpinComponent' -import MainAction from './actionList' -import './index.scss' - -const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) -const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable')) - -class ScriptTable extends Component { - static propTpyes = { - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuName: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuID: PropTypes.string // 鑿滃崟Id - } - - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id - config: {}, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 - searchlist: [], // 鎼滅储鏉′欢 - actions: [], // 鎸夐挳闆� - columns: [], // 鏄剧ず鍒� - arr_field: '', // 鏌ヨ瀛楁闆� - setting: {}, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 - data: [], // 鍒楄〃鏁版嵁闆� - selectedData: [], // 宸查�夎〃鏍兼暟鎹� - total: 0, // 鎬绘暟 - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� - pageIndex: 1, // 椤电爜 - pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 - orderBy: '', // 鎺掑簭 - search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� - pickup: false, // 涓昏〃鏁版嵁闅愯棌鏄剧ず鍒囨崲 - visible: false // 寮规鏄剧ず闅愯棌鎺у埗 - } - - /** - * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 - */ - async loadconfig () { - let config = scriptMainTable - - let _arrField = [] // 瀛楁闆� - let _columns = [] // 鏄剧ず鍒� - let _hideCol = [] // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆� - let colMap = new Map() // 鐢ㄤ簬瀛楁杩囨护 - - // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid - config.columns.forEach(col => { - if (col.field) { - _arrField.push(col.field) - } - if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 - _hideCol = _hideCol.concat(col.sublist) - } - colMap.set(col.uuid, col) - }) - - // 鐢熸垚鏄剧ず鍒楋紝澶勭悊鍚堝苟鍒椾腑鐨勫瓧娈� - config.columns.forEach(col => { - if (_hideCol.includes(col.uuid)) return - - if (col.type === 'colspan') { - if (col.unfold !== 'true') { // 涓嶅睍寮�涓烘棫鐗堝悎骞跺垪 - col.type = 'old_colspan' - } - - let _col = fromJS(col).toJS() - let subcols = [] - _col.sublist && _col.sublist.forEach(sub => { - if (colMap.has(sub)) { - subcols.push(colMap.get(sub)) - } - }) - if (subcols.length > 0) { - _col.subcols = subcols - _columns.push(_col) - } - } else { - _columns.push(col) - } - }) - - this.setState({ - config: config, - setting: config.setting, - searchlist: config.search, - actions: config.action.map(item => { - if (buttonConfig[item.uuid]) { - item = {...buttonConfig[item.uuid], ...item} - } - return item - }), - columns: _columns, - arr_field: _arrField.join(','), - search: Utils.initMainSearch(config.search) - }, () => { - this.setState({ - loading: true - }) - this.loadmaindata() - }) - } - - /** - * @description 涓昏〃鏁版嵁鍔犺浇 - */ - async loadmaindata () { - const { setting } = this.state - let param = this.getDefaultParam() - - this.setState({ - pickup: false - }) - - if (options.cloudServiceApi) { - param.rduri = options.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } - - let result = await Api.genericInterface(param) - if (result.status) { - this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[setting.primaryKey] || '' - return item - }), - total: result.total, - loading: false - }) - } else { - this.setState({ - loading: false - }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) - } - } - - /** - * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼鐨勫弬鏁� - */ - getDefaultParam = () => { - const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state - - let _search = Utils.joinMainSearchkey(search) - - _search = _search ? 'where ' + _search : '' - - let param = { - func: 'sPC_Get_TableData', - obj_name: 'data', - arr_field: arr_field, - menuname: this.props.MenuName || '' - } - - let _orderBy = orderBy || setting.order - let _dataresource = setting.dataresource - - if (/\s/.test(_dataresource)) { - _dataresource = '(' + _dataresource + ') tb' - } - - let 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` - let DateCount = `select count(1) as total from ${_dataresource} ${_search}` - - param.LText = Utils.formatOptions(LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - param.DateCount = Utils.formatOptions(DateCount) - - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - - return param - } - - /** - * @description 鎼滅储鏉′欢鏀瑰彉鏃讹紝閲嶇疆琛ㄦ牸鏁版嵁 - * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� - */ - refreshbysearch = (searches) => { - MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 - this.setState({ - loading: true, - pageIndex: 1, - selectedData: [], - search: searches - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鏉′欢鏀瑰彉鏃堕噸缃暟鎹紙鍒嗛〉鎴栨帓搴忥級 - */ - refreshbytable = (pagination, filters, sorter) => { - if (sorter.order) { - let _chg = { - ascend: 'asc', - descend: 'desc' - } - sorter.order = _chg[sorter.order] - } - - this.setState({ - loading: true, - selectedData: [], - pageIndex: pagination.current, - pageSize: pagination.pageSize, - orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : '' - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鍒锋柊 - */ - reloadtable = () => { - MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 - this.setState({ - loading: true, - pageIndex: 1, - selectedData: [] - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 椤甸潰鍒锋柊锛岄噸鏂拌幏鍙栭厤缃� - */ - reloadview = () => { - this.setState({ config: {}, searchlist: [], actions: [], columns: [], arr_field: '', setting: {}, data: [], total: 0, - loading: false, pageIndex: 1, pageSize: 10, orderBy: '', search: '', pickup: false, selectedData: [] - }, () => { - this.loadconfig() - }) - } - - /** - * @description 琛ㄦ牸閫夋嫨椤瑰垏鎹� - */ - changeSelectedData = (selectedData) => { - this.setState({selectedData}) - } - - /** - * @description 鏁版嵁灞曞紑鍚堝苟鍒囨崲 - */ - pickupChange = () => { - const { pickup } = this.state - this.setState({ - pickup: !pickup - }) - } - - reloadMenuView = (menuId) => { - const { MenuID } = this.props - - if (MenuID !== menuId) return - - this.reloadview() - } - - UNSAFE_componentWillMount () { - // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁 - this.loadconfig() - } - - componentDidMount () { - MKEmitter.addListener('reloadMenuView', this.reloadMenuView) - } - - shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - MKEmitter.removeListener('reloadMenuView', this.reloadMenuView) - } - - render() { - const { searchlist, setting, actions, columns, pickup, selectedData } = this.state - - return ( - <div className="script-manage-table" id={this.state.ContainerId}> - <MainSearch searchlist={searchlist} refreshdata={this.refreshbysearch}/> - <MainAction - BID="" - type="main" - setting={setting} - actions={actions} - dict={this.state.dict} - MenuID={this.props.MenuID} - selectedData={selectedData} - ContainerId={this.state.ContainerId} - refreshdata={this.reloadtable} - /> - <div className="main-table-box"> - {this.state.data && this.state.data.length > 0 ? - <div className="pickchange"> - <Switch title="鏀惰捣" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> - </div> : null - } - <MainTable - tableId={this.props.MenuID} - pickup={pickup} - setting={setting} - columns={columns} - dict={this.state.dict} - data={this.state.data} - total={this.state.total} - MenuID={this.props.MenuID} - loading={this.state.loading} - refreshdata={this.refreshbytable} - buttonTrigger={() => {}} - chgSelectData={this.changeSelectedData} - /> - </div> - </div> - ) - } -} - -export default ScriptTable \ No newline at end of file diff --git a/src/tabviews/scriptmanage/index.scss b/src/tabviews/scriptmanage/index.scss deleted file mode 100644 index 7068f22..0000000 --- a/src/tabviews/scriptmanage/index.scss +++ /dev/null @@ -1,72 +0,0 @@ -.script-manage-table { - position: relative; - min-height: calc(100vh - 94px); - padding-top: 16px; - padding-bottom: 80px; - - .search-line { - padding: 0px 24px 0px; - border-bottom: 1px solid #efefef; - } - - .box404 { - padding-top: 30px; - } - .ant-modal-mask { - position: absolute; - } - .ant-modal-wrap { - position: absolute; - } - .action-modal .ant-modal { - top: 40px; - max-width: 95%; - .ant-modal-body { - max-height: calc(100vh - 265px); - } - } - > .ant-spin { - position: fixed; - left: calc(50vw - 22px); - top: calc(50vh - 70px); - } - > .ant-card { - margin: 0 20px 20px; - > .ant-card-head { - border: 0; - padding: 0; - min-height: 30px; - .ant-card-head-title { - padding: 10px 0 0; - span { - color: #1890ff; - display: inline-block; - padding: 0 10px; - font-size: 15px; - border-bottom: 1px solid #1890ff; - .anticon { - margin-right: 10px; - } - } - } - } - > .ant-card-body { - padding: 0; - } - } - .main-table-box { - position: relative; - padding: 0 20px; - .pickchange { - position: absolute; - right: 0px; - top: -25px; - .ant-switch { - z-index: 1; - float: right; - margin-right: 20px; - margin-bottom: 5px; - } - } - } -} diff --git a/src/tabviews/verupmanage/actionList/index.jsx b/src/tabviews/verupmanage/actionList/index.jsx deleted file mode 100644 index b9d18d3..0000000 --- a/src/tabviews/verupmanage/actionList/index.jsx +++ /dev/null @@ -1,827 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import moment from 'moment' -import { Button, Modal, notification, message } from 'antd' - -import asyncSpinComponent from '@/utils/asyncSpinComponent' -import Utils, { getSysDefaultSql } from '@/utils/utils.js' -import options from '@/store/options.js' -import { updateForm } from '@/utils/utils-update.js' -import Api from '@/api' -import './index.scss' - -const { confirm } = Modal -const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform')) - -class MainAction extends Component { - static propTpyes = { - BID: PropTypes.string, // 涓昏〃ID - BData: PropTypes.any, // 涓昏〃鏁版嵁 - Tab: PropTypes.any, // 濡傛灉褰撳墠鍏冪礌涓烘爣绛炬椂锛宼ab涓烘爣绛句俊鎭� - type: PropTypes.string, // 鍒ゆ柇褰撳墠涓轰富琛紙main锛夈�佸瓙琛紙sub锛夈�佸瓙琛ㄦ爣绛撅紙subtab锛� - MenuID: PropTypes.string, // 鑿滃崟ID - actions: PropTypes.array, // 鎸夐挳缁� - columns: PropTypes.array, // 鏄剧ず鍒� - dict: PropTypes.object, // 瀛楀吀椤� - setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 - ContainerId: PropTypes.any, // tab椤甸潰ID锛岀敤浜庡脊绐楁帶鍒� - refreshdata: PropTypes.func, // 鎵ц瀹屾垚鍚庢暟鎹埛鏂� - selectedData: PropTypes.array // 琛ㄦ牸閫変腑鏁版嵁 - } - - state = { - visible: false, - formdata: null, - tabledata: null, - confirmLoading: false, - execAction: null, - loadingUuid: '', - configMap: {}, - loadingNumber: '', - } - - refreshdata = (item, type) => { - this.props.refreshdata(item, type) - } - - /** - * @description 瑙﹀彂鎸夐挳鎿嶄綔 - */ - actionTrigger = (item, record) => { - const { setting, type, Tab, BID, selectedData } = this.props - - if (type === 'sub' && Tab && Tab.supMenu && !BID) { - notification.warning({ - top: 92, - message: '闇�瑕佷笂绾т富閿�硷紒', - duration: 5 - }) - return - } - - let _this = this - let data = selectedData || [] - - if (record) { // 琛ㄦ牸涓Е鍙戞寜閽� - data = [record] - } - - if (item.Ot !== 'notRequired' && data.length === 0) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectline'], - duration: 5 - }) - return - } else if (item.Ot === 'requiredSgl' && data.length !== 1) { - // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁 - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectSingleLine'], - duration: 10 - }) - return - } else if (item.Ot !== 'notRequired' && !setting.primaryKey) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿� - notification.warning({ - top: 92, - message: '鏈缃富閿紒', - duration: 5 - }) - return - } - - if (item.OpenType === 'prompt') { - confirm({ - title: this.props.dict['main.action.confirm.tip'], - onOk() { - _this.setState({ - loadingUuid: item.uuid - }) - - return new Promise(resolve => { - _this.execSubmit(item, data, resolve) - }) - }, - onCancel() {} - }) - } else if (item.OpenType === 'exec') { - this.setState({loadingUuid: item.uuid}) - this.execSubmit(item, data, () => { - this.setState({loadingUuid: ''}) - }) - } else if (item.OpenType === 'pop') { - item = updateForm(item) - if (item.setting.display === 'prompt') { // 濡傛灉琛ㄥ崟浠ユ槸鍚︽灞曠ず锛屼笉璇锋眰涓嬫媺鑿滃崟淇℃伅 - this.setState({ - execAction: item, - tabledata: data - }, () => { - this.modelconfirm() - }) - } else { - this.setState({ - visible: true, - execAction: item, - tabledata: data - }) - } - } else { - notification.warning({ - top: 92, - message: '灏氫笉鏀寔姝ゅ姛鑳姐�傘�傘��', - duration: 5 - }) - } - } - - /** - * @description 鎸夐挳鎻愪氦鎵ц - */ - execSubmit = (btn, data, _resolve, formdata) => { - const { setting, columns } = this.props - - if (btn.intertype === 'inner') { - // 鎵ц鏂瑰紡涓哄琛屾嫾鎺ワ紝涓旀墦寮�鏂瑰紡涓鸿〃鍗曟椂锛屼細杞负寰幆鍙戦�佽姹� - // 鎵撳紑鏂瑰紡涓烘ā鎬佹锛屼娇鐢ㄥ唴閮ㄥ嚱鏁版坊鍔�(鏈夋壒閲忔坊鍔犲満鏅紝宸插幓闄�) - if ( - btn.Ot === 'notRequired' || - btn.Ot === 'requiredSgl' || - (btn.Ot === 'requiredOnce' && btn.OpenType !== 'pop') - ) { - - let param = { // 绯荤粺瀛樺偍杩囩▼ - func: 'sPC_TableData_InUpDe', - BID: this.props.BID - } - let primaryId = setting.primaryKey && data[0] ? (data[0][setting.primaryKey] || '') : '' - - if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� - let ID = '' - if (btn.Ot === 'notRequired') { - - } else if (btn.Ot === 'requiredSgl') { - ID = data[0][setting.primaryKey] - } else if (btn.Ot === 'requiredOnce') { // id鍊兼嫾鎺� - let ids = data.map(d => { return d[setting.primaryKey]}) - ID = ids.join(',') - } - - if (btn.innerFunc) { // 浣跨敤鑷畾涔夊嚱鏁� - param.func = btn.innerFunc - if (setting.primaryKey) { // 涓婚敭瀛樺湪鏃讹紝璁剧疆涓婚敭鍙傛暟 - param[setting.primaryKey] = ID - } - } else if (btn.sql) { - param.ID = primaryId - param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } - } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 - if (btn.innerFunc) { - param.func = btn.innerFunc - - if (setting.primaryKey) { // 涓婚敭瀛樺湪鏃讹紝璁剧疆涓婚敭鍙傛暟 - param[setting.primaryKey] = primaryId - } - - formdata.forEach(_data => { - param[_data.key] = _data.value - }) - - } else if (btn.sql && btn.sqlType === 'insert') { // 绯荤粺鍑芥暟娣诲姞鏃讹紝鐢熸垚uuid - primaryId = '' - if (formdata && setting.primaryKey) { // 琛ㄥ崟涓瓨鍦ㄤ富閿瓧娈碉紝涓婚敭鍊间互琛ㄥ崟涓殑鍊间负鍑� - let _form = formdata.filter(_form => _form.key === setting.primaryKey)[0] - if (_form) { - primaryId = _form.value - } - } - param.ID = primaryId || Utils.getguid() - param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } else if (btn.sql) { - param.ID = primaryId - param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } - } - - if (param.timestamp) { // 浜戠楠岃瘉 - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) - } - - Api.genericInterface(param).then((res) => { - if (res.status) { - this.execSuccess(btn, res) - } else { - this.execError(res, btn) - } - _resolve() - }) - } else if (btn.Ot === 'required' || (btn.Ot === 'requiredOnce' && btn.OpenType === 'pop')) { - let _formPrimaryId = '' - if (formdata && setting.primaryKey) { // 琛ㄥ崟涓瓨鍦ㄤ富閿瓧娈碉紝涓婚敭鍊间互琛ㄥ崟涓殑鍊间负鍑� - let _form = formdata.filter(_form => _form.key === setting.primaryKey)[0] - if (_form) { - _formPrimaryId = _form.value - } - } - - let _params = data.map((cell, index) => { - let param = { - func: 'sPC_TableData_InUpDe', - BID: this.props.BID - } - let primaryId = setting.primaryKey ? cell[setting.primaryKey] : '' - - if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 鏄惁寮规鎴栫洿鎺ユ墽琛� - - if (btn.innerFunc) { - param.func = btn.innerFunc - if (setting.primaryKey) { - param[setting.primaryKey] = primaryId - } - } else if (btn.sql) { - param.ID = primaryId - param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } - } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 - if (btn.innerFunc) { - param.func = btn.innerFunc - - formdata.forEach(_data => { - if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) { - param[_data.key] = cell[_data.key] - } else { - param[_data.key] = _data.value - } - }) - - if (setting.primaryKey) { - param[setting.primaryKey] = primaryId - } - } else if (btn.sql && btn.sqlType === 'insert') { // 绯荤粺鍑芥暟娣诲姞鏃讹紝鐢熸垚uuid - param.ID = _formPrimaryId || Utils.getguid() - param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } else if (btn.sql) { - if (index !== 0) { - formdata = formdata.map(_data => { - if (_data.readin && cell.hasOwnProperty(_data.key)) { - _data.value = cell[_data.key] - } - return _data - }) - } - - param.ID = primaryId - param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 鏁版嵁婧� - - param.exec_type = 'y' // 鍚庡彴瑙g爜 - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) - param.LText = Utils.formatOptions(param.LText) - } - } - - if (param.timestamp) { // 浜戠楠岃瘉 - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) - } - - return param - }) - - if (_params.length <= 20) { - let deffers = _params.map(param => { - return new Promise(resolve => { - Api.genericInterface(param).then(res => { - resolve(res) - }) - }) - }) - Promise.all(deffers).then(result => { - let iserror = false - let errorMsg = '' - result.forEach(res => { - if (res.status) { - errorMsg = res - } else { - iserror = true - errorMsg = res - } - }) - if (!iserror) { - this.execSuccess(btn, errorMsg) - } else { - this.execError(errorMsg, btn) - } - _resolve() - }) - } else { // 瓒呭嚭20涓姹傛椂寰幆鎵ц - if (btn.progress === 'progressbar') { - this.setState({ - loadingTotal: _params.length - }) - } - this.innerLoopRequest(_params, btn, _resolve) - } - } - } else if (btn.intertype === 'outer') { - /** *********************璋冪敤澶栭儴鎺ュ彛************************* */ - - let _params = [] // 璇锋眰鍙傛暟鏁扮粍 - - if (btn.Ot === 'notRequired' || btn.Ot === 'requiredSgl' || btn.Ot === 'requiredOnce') { - let param = { - BID: this.props.BID - } - - if (btn.OpenType === 'pop' && formdata) { // 琛ㄥ崟 - formdata.forEach(_data => { - param[_data.key] = _data.value - }) - } - - // 鑾峰彇id - if (btn.Ot === 'notRequired') { - - } else if (btn.Ot === 'requiredSgl' && setting.primaryKey) { - param[setting.primaryKey] = data[0][setting.primaryKey] - } else if (btn.Ot === 'requiredOnce' && setting.primaryKey) { - let ids = data.map(d => { return d[setting.primaryKey]}) - param[setting.primaryKey] = ids.join(',') - } - - _params.push(param) - } else if (btn.Ot === 'required') { - // 閫夋嫨澶氳锛屽惊鐜皟鐢� - _params = data.map((cell, index) => { - let _cell = { - BID: this.props.BID, - } - - let _formparam = {} - if (btn.OpenType === 'pop' && formdata) { // 琛ㄥ崟 - formdata.forEach(_data => { - if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) { - _formparam[_data.key] = cell[_data.key] - } else { - _formparam[_data.key] = _data.value - } - }) - } - - if (setting.primaryKey) { - _cell[setting.primaryKey] = cell[setting.primaryKey] - } - - _cell = {..._formparam, ..._cell} - - return _cell - }) - } - - if (_params.length > 1 && btn.progress === 'progressbar') { - this.setState({ - loadingTotal: _params.length - }) - } - - // 寰幆璋冪敤澶栭儴鎺ュ彛锛堝寘鎷唴閮ㄥ強鍥炶皟鍑芥暟锛� - this.outerLoopRequest(_params, btn, _resolve) - } - } - - /** - * @description 鍐呴儴璇锋眰寰幆鎵ц - */ - innerLoopRequest = (params, btn, _resolve) => { - if (!params && params.length === 0) return - - let param = params.shift() - - this.setState({ - loadingNumber: params.length - }) - - Api.genericInterface(param).then(res => { - if (res.status) { - if (params.length === 0) { - this.execSuccess(btn, res) - _resolve() - } else { - this.innerLoopRequest(params, btn, _resolve) - } - } else { - this.execError(res, btn) - _resolve() - } - }) - } - - /** - * @description 澶栭儴璇锋眰寰幆鎵ц - */ - outerLoopRequest = (params, btn, _resolve) => { - if (!params && params.length === 0) return - - let param = params.shift() - let _outParam = null - let _localParam = null - let errRes = null - - this.setState({ - loadingNumber: params.length - }) - - new Promise(resolve => { - // 鍐呴儴璇锋眰 - if (btn.innerFunc) { - param.func = btn.innerFunc - // 瀛樺湪鍐呴儴鍑芥暟鏃讹紝鏁版嵁棰勫鐞� - Api.genericInterface(param).then(res => { - if (res.status) { - delete res.ErrCode - delete res.ErrMesg - delete res.message - delete res.status - - // 浣跨敤澶勭悊鍚庣殑鏁版嵁璋冪敤澶栭儴鎺ュ彛 - let keys = Object.keys(res) // 鎻愪氦澶栭儴鎺ュ彛鍓嶏紝娣诲姞BID - if (keys.filter(key => key.toLowerCase() === 'bid').length === 0) { - res.BID = this.props.BID - } - - resolve(res) - } else { - this.execError(res, btn) - resolve(false) - _resolve() - } - }) - } else { - resolve(param) - } - }).then(res => { - if (!res) return - // 澶栭儴璇锋眰 - _outParam = JSON.parse(JSON.stringify(res)) - - if (btn.outerFunc === 's_app_version_upt') { // 鏇存柊鐗堟湰鍙� - if (window.GLOB.mainSystemApi) { - res.rduri = window.GLOB.mainSystemApi - } - } else if (btn.sysInterface === 'true' && options.cloudServiceApi) { - res.rduri = options.cloudServiceApi - res.userid = sessionStorage.getItem('CloudUserID') || '' - res.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (btn.sysInterface !== 'true') { - res.rduri = btn.interface - } - - if (btn.outerFunc) { - res.func = btn.outerFunc - } - - return Api.genericInterface(res) - }).then(response => { - if (!response) return - // 鍥炶皟璇锋眰 - if (btn.callbackFunc) { - // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤 - delete response.message - delete response.status - - response.func = btn.callbackFunc - - if (response.UpType === 'SSO' && window.GLOB.mainSystemApi) { - _localParam = {..._outParam, ...response} - - response.rduri = window.GLOB.mainSystemApi - - if (_localParam.LTextOut) { - _localParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - _localParam.secretkey = Utils.encrypt(_localParam.LTextOut, _localParam.timestamp) - _localParam.open_key = Utils.encryptOpenKey(_localParam.secretkey, _localParam.timestamp) - } - } - delete response.UpType - - let _callbackparam = {..._outParam, ...response} - if (_callbackparam.LTextOut) { - _callbackparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - _callbackparam.secretkey = Utils.encrypt(_callbackparam.LTextOut, _callbackparam.timestamp) - _callbackparam.open_key = Utils.encryptOpenKey(_callbackparam.secretkey, _callbackparam.timestamp) - } - - return Api.genericInterface(_callbackparam) - } else { - if (response.status) { - // 涓�娆¤姹傛垚鍔燂紝杩涜涓嬩竴椤硅姹� - - if (params.length === 0) { - this.execSuccess(btn, response) - _resolve() - } else { - this.outerLoopRequest(params, btn, _resolve) - } - } else { - this.execError(response, btn) - _resolve() - } - } - }).then(res => { - if (!res) return - - if (_localParam) { - if (!res.status) { - errRes = res - } - return Api.genericInterface(_localParam) - } else if (res.status) { - if (params.length === 0) { - this.execSuccess(btn, res) - _resolve() - } else { - this.outerLoopRequest(params, btn, _resolve) - } - } else { - this.execError(res, btn) - _resolve() - } - }).then(res => { - if (!res) return - - if (res.status && !errRes) { - if (params.length === 0) { - this.execSuccess(btn, res) - _resolve() - } else { - this.outerLoopRequest(params, btn, _resolve) - } - } else { - this.execError(errRes || res, btn) - _resolve() - } - }) - } - - /** - * @description 鎿嶄綔鎴愬姛鍚庡鐞� - * 1銆乪xcel瀵煎嚭锛屾垚鍔熷悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� - * 2銆佺姸鎬佺爜涓� S 鏃讹紝鏄剧ず鎴愬姛淇℃伅鍚庣郴缁熼粯璁や俊鎭� - * 3銆佺姸鎬佺爜涓� -1 鏃讹紝涓嶆樉绀轰换浣曚俊鎭� - * 4銆佹ā鎬佹鎵ц鎴愬姛鍚庢槸鍚﹀叧闂� - * 5銆侀�氱煡涓诲垪琛ㄥ埛鏂� - */ - execSuccess = (btn, res) => { - if (res && res.ErrCode === 'S') { // 鎵ц鎴愬姛 - notification.success({ - top: 92, - message: res.ErrMesg || this.props.dict['main.action.confirm.success'], - duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 - }) - } else if (res && res.ErrCode === 'Y') { // 鎵ц鎴愬姛 - Modal.success({ - title: res.ErrMesg || this.props.dict['main.action.confirm.success'] - }) - } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず - - } - - if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { - this.setState({ - visible: false - }) - } - - this.setState({ - loadingUuid: '', - loadingNumber: '' - }) - - this.refreshdata(btn, 'success') - } - - /** - * @description 鎿嶄綔澶辫触鍚庡鐞� - * 1銆佺姸鎬佺爜涓� E銆丯銆丗銆丯M 鏃讹紝鏄剧ず鐩稿簲鎻愮ず淇℃伅 - * 2銆乪xcel瀵煎嚭锛屽け璐ュ悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� - * 3銆侀�氱煡涓诲垪琛ㄥ埛鏂� - */ - execError = (res, btn) => { - if (res.ErrCode === 'E') { - Modal.error({ - title: res.message || res.ErrMesg, - }) - } else if (res.ErrCode === 'N') { - notification.error({ - top: 92, - message: res.message || res.ErrMesg, - duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 - }) - } else if (res.ErrCode === 'F') { - notification.error({ - className: 'notification-custom-error', - top: 92, - message: res.message || res.ErrMesg, - duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 - }) - } else if (res.ErrCode === 'NM') { - message.error(res.message || res.ErrMesg) - } - - this.setState({ - loadingUuid: '', - loadingNumber: '' - }) - - this.refreshdata(btn, 'error') - } - - modelconfirm = () => { - const { BData } = this.props - const { execAction, tabledata } = this.state - let _this = this - - let result = [] - execAction.fields.forEach(item => { - if (!item.field) return - let _readin = item.readin !== 'false' - let _initval = item.initval - - if (item.type === 'linkMain' || item.type === 'funcvar') { - _readin = false - } - - if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { - _initval = BData[item.field] - } else if (_readin && tabledata[0] && tabledata[0].hasOwnProperty(item.field)) { - _initval = tabledata[0][item.field] - } - - let _fieldlen = item.fieldlength || 50 - if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { - _fieldlen = item.fieldlength || 512 - } else if (item.type === 'number') { - _fieldlen = item.decimal ? item.decimal : 0 - } - - result.push({ - key: item.field, - readonly: item.readonly === 'true', - readin: _readin, - fieldlen: _fieldlen, - type: item.type, - value: _initval - }) - }) - - confirm({ - title: this.props.dict['main.action.confirm.tip'], - onOk() { - _this.setState({ - loadingUuid: execAction.uuid - }) - - return new Promise(resolve => { - _this.execSubmit(execAction, tabledata, resolve, result) - }) - }, - onCancel() {} - }) - } - - /** - * @description 妯℃�佹锛堣〃鍗曪級锛岀‘璁� - */ - handleOk = () => { - this.formRef.handleConfirm().then(res => { - this.setState({ - confirmLoading: true - }) - - this.execSubmit(this.state.execAction, this.state.tabledata, () => { - this.setState({ - confirmLoading: false - }) - }, res) - }, () => {}) - } - - /** - * @description 妯℃�佹锛堣〃鍗曪級锛屽彇娑� - */ - handleCancel = () => { - this.setState({ - visible: false - }) - } - - /** - * @description 鏄剧ず妯℃�佹 - */ - getModels = () => { - const { execAction } = this.state - - if (!execAction || !this.state.visible) return - - let title = '' - let width = '62vw' - let clickouter = false - let container = document.body - - if (execAction && execAction.setting) { - title = execAction.setting.title - width = execAction.setting.width + 'vw' - - if (execAction.setting.container === 'tab' && this.props.ContainerId) { - width = execAction.setting.width + '%' - container = () => document.getElementById(this.props.ContainerId) - } - - if (execAction.setting.clickouter === 'close') { - clickouter = true - } - } - - if (this.props.type === 'subtab') { - container = document.body - } - - return ( - <Modal - title={title} - maskClosable={clickouter} - getContainer={container} - wrapClassName='action-modal' - visible={this.state.visible} - width={width} - onOk={this.handleOk} - confirmLoading={this.state.confirmLoading} - onCancel={this.handleCancel} - destroyOnClose - > - <MutilForm - dict={this.props.dict} - action={execAction} - inputSubmit={this.handleOk} - configMap={this.state.configMap} - data={this.state.tabledata[0]} - BData={this.props.BData} - wrappedComponentRef={(inst) => this.formRef = inst} - /> - </Modal> - ) - } - - render() { - const { loadingUuid, loadingNumber } = this.state - - return ( - <div className="verup-button-list verup-toolbar-button"> - {this.props.actions.map((item, index) => { - let label = item.label - if (loadingUuid === item.uuid && loadingNumber) { - label = label + '(' + loadingNumber + ')' - } - return ( - <Button - className={'mk-btn mk-' + item.class} - icon={item.icon} - key={'action' + index} - onClick={() => {this.actionTrigger(item)}} - loading={loadingUuid === item.uuid} - >{label}</Button> - ) - })} - {this.getModels()} - </div> - ) - } -} - -export default MainAction \ No newline at end of file diff --git a/src/tabviews/verupmanage/actionList/index.scss b/src/tabviews/verupmanage/actionList/index.scss deleted file mode 100644 index 9751b46..0000000 --- a/src/tabviews/verupmanage/actionList/index.scss +++ /dev/null @@ -1,17 +0,0 @@ -.verup-button-list.verup-toolbar-button { - position: relative; - padding: 10px 20px 5px; - background: #ffffff; - button { - min-width: 65px; - margin-right: 15px; - margin-bottom: 10px; - overflow: hidden; - } - .ant-spin { - position: fixed; - z-index: 1010; - left: calc(50vw - 22px); - top: calc(50vh - 70px); - } -} diff --git a/src/tabviews/verupmanage/config.jsx b/src/tabviews/verupmanage/config.jsx deleted file mode 100644 index 527dcec..0000000 --- a/src/tabviews/verupmanage/config.jsx +++ /dev/null @@ -1,159 +0,0 @@ -// 鐗堟湰鍗囩骇椤甸潰閰嶇疆 -export const verupMainTable = { - setting: { - tableName: 'sVersion', - tableType: 'radio', - interType: 'inner', - actionfixed: false, - columnfixed: false, - primaryKey: 'ID', - order: 'ID desc', - innerFunc: '', - dataresource: 'select * from sVersion_Local where deleted=0 and status=10 and appkey=@Appkey@', - queryType: 'query', - }, - search:[ - {label: '浼犺緭鍙�', field: 'VersionName', type: 'text', initval:'', oriInitval: '', required: false, match: 'like', uuid: '1581736007223d84ddmht4gdfb1850nh'} - ], - action:[ - {label:'娣诲姞',OpenType:'pop',intertype:'outer',innerFunc:'',sysInterface:'true',outerFunc:'s_get_sVersiondetail_Up',interface:'http://cloud.mk9h.cn/webapi/dostars',callbackFunc:'s_sVersion_Local_add',position:'toolbar',$toolbtn: true,Ot:'notRequired',execSuccess:'grid',execError:'never',icon:'',class:'green',uuid:'1583979660949vpssdb2p2lsqff9abkr'}, - {label:'鍏抽棴',OpenType:'prompt',intertype:'inner',innerFunc:'',position:'toolbar',$toolbtn: true,Ot:'requiredSgl',execSuccess:'grid',execError:'never',icon:'',class:'border-danger',sql:'sVersion',sqlType:'LogicDelete',uuid:'1583979660949msql0p8bgiiedlu4r82', - verify: { - default: 'false', - invalid: 'true', - uniques: [], - contrasts: [], - accountdate: 'false', - customverifys: [], - billcodes: [], - voucher: {enabled: false}, - scripts:[ - { - sql: 'declare @Vid nvarchar(50)\nset @Vid=\'\'\nselect top 1 @Vid=id from sVersionDetail_Local where BID=@ID@ and Status =10\n\nif @Vid=\'\'\nbegin\n delete sVersion_Local where id =@ID@\n delete sVersionDetail_Local where bid =@ID@\nend\nelse\nbegin\n update sVersion_Local set deleted=1,Modifydate=getdate(),ModifyUserID=@UserID@ where id =@ID@\nend', - uuid: '15839986098557o6ri091qo9flrc5c0a' - } - ] - } - }, - // {OpenType:"prompt",Ot:"notRequired",callbackFunc:"",position:"toolbar",sysInterface:"true",execSuccess:"grid",label:"鏇存柊鐗堟湰",intertype:"outer",execError:"never",class:"primary", - // icon:"",interface:"http://cloud.mk9h.cn/webapi/dostars",innerFunc:"",uuid:"15926364942911efnal5pv6r92if2vr2",outerFunc:"s_app_version_upt"} - ], - columns:[ - {label:'ID',field:'ID',type:'text',Align:'left',Hide:'true',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1581736658674f11dg01sqdneu8bbn2q'}, - {label:'浼犺緭鍙�',field:'VersionName',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'158173670848068ku8o5a7csuiepd4v8'}, - {label:'璇存槑',field:'ProgramName',type:'text',Align:'left',Hide:'false',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'15817367246420ubig4dkim4on7bv3kp'}, - {label:'鐘舵��',field:'StatusName',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1581736695990kvpkao3d14etkc88c12'}, - {label:'鍒涘缓鏃堕棿',field:'CreateDate',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1581736740656s2o0llughpc779l0qti'} - ], - gridBtn: {display: false}, - tabs:[ - {label:'鑴氭湰',type:'SubTable',linkTab:'15839835082267ac69e4gm0ig6ac00ob',icon:'',supMenu:'1583979633842550imkchl4qt4qppsiv'/* mainTable */,equalTab:[],uuid:'1583979660949hguu6ildhut1ig5mco1'}, - {label:'宸叉墽琛�',type:'SubTable',linkTab:'1583984646423lo60vt7snppb55lslbt',icon:'',supMenu:'1583979633842550imkchl4qt4qppsiv'/* mainTable */,equalTab:[],uuid:'1583984632864kedhlvu7l31us7pkmbq'} - ] -} - -export const buttonConfig = { - '1583979660949vpssdb2p2lsqff9abkr': { - type: 'Modal', - version: '1.0', - setting:{title: '娣诲姞',width:45,focus:'VersionName',finish:'close',clickouter:'unclose',container:'tab',display:'modal'}, - tables:[], - fields:[ - {label:'浼犺緭鍙�',field:'VersionName',span:24,labelwidth: 33.3,type:'text',initval:'',regular:'letter&number',readonly:'false',required:'true',hidden:'false',fieldlength:20,readin:'true',uuid:'1581738428097qgoe876i5u0866373uu'} - ] - }, - '1583983849299g1qfd28g3c9n9e0e57a': { - type:'Modal', - setting:{ - title:'鎵ц', - width:60, - focus:'SrcID', - cols:'2', - finish:'close', - clickouter:'unclose', - container:'tab', - display:'prompt' - }, - groups: [], - fields: [ - {'label':'SrcID','field':'SrcID','type':'text','initval':'','regular':'','readonly':'false','required':'true','hidden':'false','fieldlength':50,'readin':'true','supField':'','uuid':'1584001255960ns626a3pkfkhk04hn7u'} - ] - } -} - -export const tabConfig = { - '15839835082267ac69e4gm0ig6ac00ob': { - tabName:'鑴氭湰', - tabNo:'sVersionDetail_LocalM', - Remark:'', - uuid:'15839835082267ac69e4gm0ig6ac00ob', - setting:{ - tableName:'sVersionDetail_Local', - tableType:'checkbox', - interType:'inner', - innerFunc:'', - dataresource:'select * from sVersionDetail_Local where BID=@BID@ and deleted=0 and status=0', - queryType:'query', - primaryKey:'ID', - order:'Sort', - onload:'true' - }, - search:[ - {label:'缁煎悎鏌ヨ',field:'Remark,KeyWords,TypeName',type:'text',initval:'', oriInitval: '', required: false,match:'like','ratio':6,uuid:'1583983588787acl55md59fu9kpb52db'} - ], - action:[ - {label:'鎵ц',OpenType:'pop',intertype:'outer',innerFunc:'',sysInterface:'true',outerFunc:'s_get_sVersionDetail_Ltext',interface:'http://cloud.mk9h.cn/webapi/dostars',callbackFunc:'s_sDataDictb_TBBack',position:'toolbar',$toolbtn: true,execSuccess:'grid',execError:'never',icon:'',class:'primary',Ot:'required',progress: 'progressbar',uuid:'1583983849299g1qfd28g3c9n9e0e57a',verify:null}, - {label:'鍏抽棴',OpenType:'prompt',intertype:'inner',innerFunc:'',position:'toolbar',$toolbtn: true,Ot:'required',progress: 'progressbar',execSuccess:'grid',execError:'never',icon:'',class:'border-danger',sql:'sVersionDetail_Local',sqlType:'LogicDelete',uuid:'1583984089282i4i140hacimbki9s5gh', - verify:{ - default: 'true', - invalid: 'true', - uniques: [], - contrasts: [], - accountdate: 'false', - customverifys: [], - billcodes: [], - voucher: {enabled: false}, - scripts: [] - } - } - ], - columns:[ - {label:'ID',field:'ID',type:'text',Align:'left',Hide:'true',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583983669503v35f3e7f52iosklnomg'}, - {label:'鍏抽敭瀛�',field:'KeyWords',type:'text',Align:'left',Hide:'false',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'15839836784475gl5v26qgual768ab8u'}, - {label:'鎻忚堪',field:'Remark',type:'text',Align:'left',Hide:'false',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'15839837044624m3k41m7omhs6q8f9fo'}, - {label:'绫诲瀷',field:'TypeName',type:'text',Align:'left',Hide:'false',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583983717421ts67iu14hmmeqivel5e'}, - {label:'鎺掑簭',field:'Sort',type:'text',Align:'left',Hide:'false',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583983728654ks05hor8mgiqbp61ivl'}, - {label:'SrcID',field:'SrcID',type:'text',Align:'left',Hide:'true',IsSort:'false',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1584001165784gu23d35b43i860n0a19'} - ], - gridBtn: {display: false} - }, - '1583984646423lo60vt7snppb55lslbt': { - tabName:'宸叉墽琛�', - tabNo:'sVersionDetail_Local_ReadyM', - Remark:'', - uuid:'1583984646423lo60vt7snppb55lslbt', - setting:{ - tableName:'sVersionDetail_Local', - tableType:'checkbox', - interType:'inner', - innerFunc:'', - dataresource:'select * from sVersionDetail_Local where BID=@BID@ and deleted=0 and status=10', - queryType:'query', - primaryKey:'ID', - order:'Sort', - onload:'true' - }, - search:[ - {label:'缁煎悎鏌ヨ',field:'Remark,KeyWords,TypeName',type:'text',initval:'', oriInitval: '', required: false,match:'like',uuid:'15839847143720ggaaukqtfhp3mirsuc'} - ], - action:[], - columns:[ - {label:'ID',field:'ID',type:'text',Align:'left',Hide:'true',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583984775854fkg1kriv6un6v6r21mu'}, - {label:'鍏抽敭瀛�',field:'KeyWords',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583984782136vspicmogvs44o5c0u8n'}, - {label:'鎻忚堪',field:'Remark',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583984799089vi8v268uur6mhqmi71o'}, - {label:'绫诲瀷',field:'TypeName',type:'text',Align:'left',Hide:'false',IsSort:'true',Width:120,prefix:'',postfix:'',matchVal:'',color:'',fieldlength:50,uuid:'1583984810593u53835abq83e7h63vce'}, - {label:'鎺掑簭',field:'Sort',type:'number',Align:'left',Hide:'false',IsSort:'true',Width:120,'decimal':0,'format':'',prefix:'',postfix:'',match:'',matchVal:'',color:'',uuid:'1583984826744bttg6mt4oqskckpoasl'} - ], - gridBtn: {display: false} - } -} diff --git a/src/tabviews/verupmanage/index.jsx b/src/tabviews/verupmanage/index.jsx deleted file mode 100644 index 23908ba..0000000 --- a/src/tabviews/verupmanage/index.jsx +++ /dev/null @@ -1,525 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { notification, Tabs, Switch } from 'antd' -import moment from 'moment' - -import Api from '@/api' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' -import Utils from '@/utils/utils.js' -import options from '@/store/options.js' -import asyncComponent from '@/utils/asyncComponent' -import asyncSpinComponent from '@/utils/asyncSpinComponent' -import { verupMainTable, buttonConfig } from './config' -import MkIcon from '@/components/mk-icon' -import MKEmitter from '@/utils/events.js' -import MainAction from './actionList' -import './index.scss' - -const SubTable = asyncSpinComponent(() => import('./subtabtable')) -const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) -const MainTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable')) - -const { TabPane } = Tabs - -class VerupTable extends Component { - static propTpyes = { - MenuNo: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuName: PropTypes.string, // 鑿滃崟鍙傛暟 - MenuID: PropTypes.string // 鑿滃崟Id - } - - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id - config: {}, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 - searchlist: [], // 鎼滅储鏉′欢 - actions: [], // 鎸夐挳闆� - columns: [], // 鏄剧ず鍒� - arr_field: '', // 鏌ヨ瀛楁闆� - setting: {}, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 - data: [], // 鍒楄〃鏁版嵁闆� - selectedData: [], // 宸查�夎〃鏍兼暟鎹� - total: 0, // 鎬绘暟 - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� - pageIndex: 1, // 椤电爜 - pageSize: 10, // 姣忛〉鏁版嵁鏉℃暟 - orderBy: '', // 鎺掑簭 - search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� - BIDs: {}, // 涓婄骇琛╥d - pickup: false, // 涓昏〃鏁版嵁闅愯棌鏄剧ず鍒囨崲 - visible: false, // 寮规鏄剧ず闅愯棌鎺у埗 - refreshtabs: null // 闇�瑕佸埛鏂扮殑鏍囩闆� - } - - /** - * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 - */ - async loadconfig () { - let config = verupMainTable - - let _arrField = [] // 瀛楁闆� - let _columns = [] // 鏄剧ず鍒� - let _hideCol = [] // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆� - let colMap = new Map() // 鐢ㄤ簬瀛楁杩囨护 - - // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid - config.columns.forEach(col => { - if (col.field) { - _arrField.push(col.field) - } - if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 - _hideCol = _hideCol.concat(col.sublist) - } - colMap.set(col.uuid, col) - }) - - // 鐢熸垚鏄剧ず鍒楋紝澶勭悊鍚堝苟鍒椾腑鐨勫瓧娈� - config.columns.forEach(col => { - if (_hideCol.includes(col.uuid)) return - - if (col.type === 'colspan') { - if (col.unfold !== 'true') { // 涓嶅睍寮�涓烘棫鐗堝悎骞跺垪 - col.type = 'old_colspan' - } - - let _col = fromJS(col).toJS() - let subcols = [] - _col.sublist && _col.sublist.forEach(sub => { - if (colMap.has(sub)) { - subcols.push(colMap.get(sub)) - } - }) - if (subcols.length > 0) { - _col.subcols = subcols - _columns.push(_col) - } - } else { - _columns.push(col) - } - }) - - this.setState({ - config: config, - setting: config.setting, - searchlist: config.search, - actions: config.action.map(item => { - item.$menuId = this.props.MenuID - - if (buttonConfig[item.uuid]) { - item = {...buttonConfig[item.uuid], ...item} - } - item.$toolbtn = true - - return item - }), - columns: _columns, - arr_field: _arrField.join(','), - search: Utils.initMainSearch(config.search) - }, () => { - this.setState({ - loading: true - }) - this.loadmaindata() - }) - } - - /** - * @description 涓昏〃鏁版嵁鍔犺浇 - */ - async loadmaindata () { - const { setting, ContainerId } = this.state - let param = '' - - if (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc)) { - param = this.getCustomParam() - } else { - param = this.getDefaultParam() - } - - this.setState({ - selectedData: [], - pickup: false - }) - - MKEmitter.emit('changeTableLine', ContainerId, this.props.MenuID, '', '') - - if (!param) { // 鏈幏鍙栧弬鏁版椂锛屼笉鍙戣姹� - return - } - - let result = await Api.genericInterface(param) - if (result.status) { - this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[setting.primaryKey] || '' - return item - }), - total: result.total, - loading: false, - BIDs: {[this.props.MenuID] : ''} - }) - } else { - this.setState({ - loading: false - }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) - } - } - - /** - * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙� - */ - getCustomParam = () => { - const { pageIndex, pageSize, orderBy, search, setting } = this.state - - let _search = Utils.formatCustomMainSearch(search) - - let param = { - PageIndex: pageIndex, - PageSize: pageSize, - OrderCol: orderBy || setting.order, - ..._search - } - - if (setting.interType === 'inner') { - param.func = setting.innerFunc - } else { - if (setting.sysInterface === 'true' && options.cloudServiceApi) { - param.rduri = options.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (setting.sysInterface !== 'true') { - param.rduri = setting.interface - } - - if (setting.outerFunc) { - param.func = setting.outerFunc - } - } - - return param - } - - /** - * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼鐨勫弬鏁� - */ - getDefaultParam = () => { - const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state - - if (!arr_field) { - notification.warning({ - top: 92, - message: '鏈缃樉绀哄垪锛�', - duration: 5 - }) - return null - } - - let _search = Utils.joinMainSearchkey(search) - - _search = _search ? 'where ' + _search : '' - - let param = { - func: 'sPC_Get_TableData', - obj_name: 'data', - arr_field: arr_field, - menuname: this.props.MenuName || '' - } - - let _orderBy = orderBy || setting.order - let _dataresource = setting.dataresource - - if (/\s/.test(_dataresource)) { - _dataresource = '(' + _dataresource + ') tb' - } - - if (setting.queryType === 'statistics') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲 - let fieldmap = new Map() - let options = search.map(item => { - let _field = item.key - - if (fieldmap.has(_field)) { - _field = _field + '1' - } - - fieldmap.set(item.key, true) - - return { - reg: new RegExp('@' + _field, 'ig'), - value: item.value - } - }) - - options.reverse() - - options.forEach(item => { - _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) - }) - - _search = '' - } - - let 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 ` - let DateCount = `select count(1) as total from ${_dataresource} ${_search}` - - param.LText = Utils.formatOptions(LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - param.DateCount = Utils.formatOptions(DateCount) - - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - - return param - } - - /** - * @description 鎼滅储鏉′欢鏀瑰彉鏃讹紝閲嶇疆琛ㄦ牸鏁版嵁 - * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� - */ - refreshbysearch = (searches) => { - MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 - this.setState({ - loading: true, - pageIndex: 1, - search: searches - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鏉′欢鏀瑰彉鏃堕噸缃暟鎹紙鍒嗛〉鎴栨帓搴忥級 - */ - refreshbytable = (pagination, filters, sorter) => { - if (sorter.order) { - let _chg = { - ascend: 'asc', - descend: 'desc' - } - sorter.order = _chg[sorter.order] - } - - this.setState({ - loading: true, - pageIndex: pagination.current, - pageSize: pagination.pageSize, - orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : '' - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鍒锋柊 - */ - reloadtable = () => { - MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 - this.setState({ - pageIndex: 1, - loading: true - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 椤甸潰鍒锋柊锛岄噸鏂拌幏鍙栭厤缃� - */ - reloadview = () => { - MKEmitter.emit('resetTable', this.props.MenuID) // 鍒楄〃閲嶇疆 - this.setState({ - config: {}, - searchlist: [], - actions: [], - columns: [], - arr_field: '', - setting: {}, - data: [], - total: 0, - loading: false, - pageIndex: 1, - pageSize: 10, - orderBy: '', - search: '', - BIDs: {}, - pickup: false - }, () => { - this.loadconfig() - }) - } - - /** - * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤� - */ - refreshbyaction = (btn, type) => { - if (btn.execSuccess === 'grid' && type === 'success') { - this.reloadtable() - } else if (btn.execError === 'grid' && type === 'error') { - this.reloadtable() - } else if (btn.execSuccess === 'view' && type === 'success') { - this.reloadview() - } else if (btn.execError === 'view' && type === 'error') { - this.reloadview() - } - } - - /** - * @description 瀛愯〃鎿嶄綔瀹屾垚鍚庡埛鏂颁富琛� - */ - handleMainTable = (type, tab) => { - if (type === 'maingrid' && tab.supMenu === 'mainTable') { - this.reloadtable() - } else if (type === 'maingrid' && tab.supMenu) { - this.setState({ - refreshtabs: [tab.supMenu] - }, () => { - this.setState({ - refreshtabs: null - }) - }) - } else if (type === 'equaltab' && tab.equalTab && tab.equalTab.length > 0) { - this.setState({ - refreshtabs: tab.equalTab - }, () => { - this.setState({ - refreshtabs: null - }) - }) - } - } - - /** - * @description 琛ㄦ牸閫夋嫨椤瑰垏鎹� - */ - changeSelectedData = (selectedData) => { - this.setState({selectedData}) - } - - /** - * @description 鏁版嵁灞曞紑鍚堝苟鍒囨崲 - */ - pickupChange = () => { - const { pickup } = this.state - this.setState({ - pickup: !pickup - }) - } - - reloadMenuView = (menuId) => { - const { MenuID } = this.props - - if (MenuID !== menuId) return - - this.reloadview() - } - - changeTableLine = (ContainerId, tableId, id, data) => { - if (this.state.ContainerId !== ContainerId) return - - this.setState({ - BIDs: {...this.state.BIDs, [tableId]: id, [tableId + 'data']: data} - }) - } - - UNSAFE_componentWillMount () { - // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁 - this.loadconfig() - } - - shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) - } - - componentDidMount () { - MKEmitter.addListener('reloadMenuView', this.reloadMenuView) - MKEmitter.addListener('changeTableLine', this.changeTableLine) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - MKEmitter.removeListener('reloadMenuView', this.reloadMenuView) - MKEmitter.removeListener('changeTableLine', this.changeTableLine) - } - - render() { - const { searchlist, setting, actions, columns, pickup, config, selectedData, pageSize } = this.state - - return ( - <div className="veruptable" id={this.state.ContainerId}> - <MainSearch searchlist={searchlist} refreshdata={this.refreshbysearch}/> - <MainAction - BID="" - type="main" - setting={setting} - actions={actions} - columns={columns} - dict={this.state.dict} - MenuID={this.props.MenuID} - selectedData={selectedData} - ContainerId={this.state.ContainerId} - refreshdata={this.refreshbyaction} - /> - <div className="main-table-box"> - {this.state.data && this.state.data.length > 0 ? - <div className="pickchange"> - <Switch title="鏀惰捣" checkedChildren="寮�" unCheckedChildren="鍏�" checked={pickup} onChange={this.pickupChange} /> - </div> : null - } - <MainTable - tableId={this.props.MenuID} - pickup={pickup} - setting={setting} - columns={columns} - pageSize={pageSize} - dict={this.state.dict} - data={this.state.data} - total={this.state.total} - MenuID={this.props.MenuID} - loading={this.state.loading} - refreshdata={this.refreshbytable} - buttonTrigger={() => {}} - ContainerId={this.state.ContainerId} - chgSelectData={this.changeSelectedData} - /> - </div> - {config.tabs ? <Tabs defaultActiveKey="0"> - {config.tabs.map((_tab, index) => { - return ( - <TabPane tab={ - <span> - {_tab.icon ? <MkIcon type={_tab.icon} /> : null} - {_tab.label} - </span> - } key={`${index}`}> - <SubTable - Tab={_tab} - MenuID={_tab.linkTab} - SupMenuID={this.props.MenuID} - refreshtabs={this.state.refreshtabs} - ContainerId={this.state.ContainerId} - BID={this.state.BIDs[_tab.supMenu] || ''} - BData={this.state.BIDs[_tab.supMenu + 'data'] || ''} - handleMainTable={(type) => this.handleMainTable(type, _tab)} - /> - </TabPane> - ) - })} - </Tabs> : null} - </div> - ) - } -} - -export default VerupTable \ No newline at end of file diff --git a/src/tabviews/verupmanage/index.scss b/src/tabviews/verupmanage/index.scss deleted file mode 100644 index 68df191..0000000 --- a/src/tabviews/verupmanage/index.scss +++ /dev/null @@ -1,79 +0,0 @@ -.veruptable { - position: relative; - min-height: calc(100vh - 94px); - padding-top: 16px; - padding-bottom: 80px; - - .search-line { - padding: 0px 24px 0px; - border-bottom: 1px solid #efefef; - } - - .box404 { - padding-top: 30px; - } - .ant-modal-mask { - position: absolute; - } - .ant-modal-wrap { - position: absolute; - } - .action-modal .ant-modal { - top: 40px; - max-width: 95%; - .ant-modal-body { - max-height: calc(100vh - 265px); - } - } - > .ant-spin { - position: fixed; - left: calc(50vw - 22px); - top: calc(50vh - 70px); - } - > .ant-card { - margin: 0 20px 20px; - > .ant-card-head { - border: 0; - padding: 0; - min-height: 30px; - .ant-card-head-title { - padding: 10px 0 0; - span { - color: #1890ff; - display: inline-block; - padding: 0 10px; - font-size: 15px; - border-bottom: 1px solid #1890ff; - .anticon { - margin-right: 10px; - } - } - } - } - > .ant-card-body { - padding: 0; - } - } - .main-table-box { - position: relative; - padding: 0 20px; - .pickchange { - position: absolute; - right: 0px; - top: -25px; - .ant-switch { - z-index: 1; - float: right; - margin-right: 20px; - margin-bottom: 5px; - } - } - } - > .ant-tabs { - padding: 0px 20px; - margin-bottom: 20px; - .ant-tabs-tab:not(.ant-tabs-tab-active) { - cursor: pointer; - } - } -} diff --git a/src/tabviews/verupmanage/subtabtable/index.jsx b/src/tabviews/verupmanage/subtabtable/index.jsx deleted file mode 100644 index f7cb699..0000000 --- a/src/tabviews/verupmanage/subtabtable/index.jsx +++ /dev/null @@ -1,471 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { notification, Switch} from 'antd' -import moment from 'moment' - -import Api from '@/api' -import zhCN from '@/locales/zh-CN/main.js' -import enUS from '@/locales/en-US/main.js' -import Utils from '@/utils/utils.js' -import options from '@/store/options.js' -import { buttonConfig, tabConfig } from '../config' -import MKEmitter from '@/utils/events.js' - -import asyncComponent from '@/utils/asyncComponent' -import asyncSpinComponent from '@/utils/asyncSpinComponent' -import SubAction from '../actionList' - -import './index.scss' - -const MainSearch = asyncComponent(() => import('@/tabviews/zshare/topSearch')) -const SubTable = asyncSpinComponent(() => import('@/tabviews/zshare/normalTable')) - -class VerupSubTabViewTable extends Component { - static propTpyes = { - Tab: PropTypes.object, // 鏍囩淇℃伅 - BID: PropTypes.string, // 涓婄骇鏁版嵁ID - BData: PropTypes.any, // 涓婄骇鏁版嵁 - MenuID: PropTypes.string, // 鑿滃崟Id - SupMenuID: PropTypes.string, // 涓婄骇鑿滃崟Id - ContainerId: PropTypes.any, // 涓夌骇鑿滃崟Container(html) ID - handleMainTable: PropTypes.func, // 鍒锋柊涓昏〃 - refreshtabs:PropTypes.any - } - - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, - config: null, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷寜閽�佹悳绱€�佹樉绀哄垪銆佹爣绛剧瓑 - searchlist: null, // 鎼滅储鏉′欢 - actions: null, // 鎸夐挳闆� - columns: null, // 鏄剧ず鍒� - arr_field: '', // 鏌ヨ瀛楁闆� - setting: null, // 椤甸潰鍏ㄥ眬璁剧疆锛氭暟鎹簮銆佹寜閽強鏄剧ず鍒楀浐瀹氥�佷富閿瓑 - data: null, // 鍒楄〃鏁版嵁闆� - selectedData: [], // 宸查�夎〃鏍兼暟鎹� - total: 0, // 鎬绘暟 - loading: false, // 鍒楄〃鏁版嵁鍔犺浇涓� - pageIndex: 1, // 椤电爜 - pageSize: 100, // 姣忛〉鏁版嵁鏉℃暟 - orderBy: '', // 鎺掑簭 - search: '', // 鎼滅储鏉′欢鏁扮粍锛屼娇鐢ㄦ椂闇�鍒嗗満鏅鐞� - popAction: false, // 寮规椤甸潰锛屾寜閽俊鎭� - popData: false, // 寮规椤甸潰锛屾墍閫夌殑琛ㄦ牸鏁版嵁 - visible: false, // 寮规鏄剧ず闅愯棌鎺у埗 - pickup: false, // 瀛愯〃鏁版嵁闅愯棌鏄剧ず鍒囨崲 - BID: '', - BData: '' - } - - /** - * @description 涓婄骇鑿滃崟id鍙樺寲鏃讹紝鍒锋柊鏁版嵁 - */ - UNSAFE_componentWillReceiveProps(nextProps) { - if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { - this.reloadtable() - } - } - - /** - * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 - */ - async loadconfig () { - const { Tab, BID, BData } = this.props - - let config = tabConfig[this.props.MenuID] - - let _arrField = [] // 瀛楁闆� - let _columns = [] // 鏄剧ず鍒� - let _hideCol = [] // 闅愯棌鍙婂悎骞跺垪涓瓧娈电殑uuid闆� - let colMap = new Map() - - // 1銆佺瓫閫夊瓧娈甸泦锛�2銆佽繃婊ら殣钘忓垪鍙婂悎骞跺垪涓殑瀛楁uuid - config.columns.forEach(col => { - if (col.field) { - _arrField.push(col.field) - } - if (col.type === 'colspan' && col.sublist) { // 绛涢�夐殣钘忓垪 - _hideCol = _hideCol.concat(col.sublist) - } - colMap.set(col.uuid, col) - }) - - // 鐢熸垚鏄剧ず鍒楋紝澶勭悊鍚堝苟鍒椾腑鐨勫瓧娈� - config.columns.forEach(col => { - if (_hideCol.includes(col.uuid)) return - - if (col.type === 'colspan') { - if (col.unfold !== 'true') { // 涓嶅睍寮�涓烘棫鐗堝悎骞跺垪 - col.type = 'old_colspan' - } - let _col = fromJS(col).toJS() - let subcols = [] - _col.sublist && _col.sublist.forEach(sub => { - if (colMap.has(sub)) { - subcols.push(colMap.get(sub)) - } - }) - if (subcols.length > 0) { - _col.subcols = subcols - _columns.push(_col) - } - } else { - _columns.push(col) - } - }) - - if (config.setting.interType === 'inner' && !config.setting.innerFunc) { - config.setting.interType = 'system' - } - - this.setState({ - BID: BID || '', - BData: BData || '', - config: config, - setting: config.setting, - searchlist: config.search, - actions: config.action.map(item => { - if (buttonConfig[item.uuid]) { - item = {...buttonConfig[item.uuid], ...item} - } - item.$toolbtn = true - return item - }), - columns: _columns, - arr_field: _arrField.join(','), - search: Utils.initMainSearch(config.search) // 鎼滅储鏉′欢鍒濆鍖栵紙鍚湁鏃堕棿鏍煎紡锛岄渶瑕佽浆鍖栵級 - }, () => { - if (config.setting.onload !== 'false' && (!Tab.supMenu || BID)) { // 鍒濆鍖栧彲鍔犺浇 - this.setState({ - loading: true - }) - this.loadmaindata() - } - }) - } - - /** - * @description 瀛愯〃鏁版嵁鍔犺浇 - */ - async loadmaindata (type) { - const { setting, BID } = this.state - let param = '' - - if (type === 'refresh') { - if (!BID) { // 涓昏〃ID涓嶅瓨鍦ㄦ椂锛屼笉鏌ヨ瀛愯〃 - this.setState({ - data: [], - total: 0, - loading: false - }) - - return - } - } - - if (setting.interType === 'system') { - param = this.getDefaultParam(BID) - } else { - param = this.getCustomParam(BID) - } - - let result = await Api.genericInterface(param) - if (result.status) { - this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.$$uuid = item[setting.primaryKey] || '' - item.$$BID = BID || '' - return item - }), - total: result.total, - pickup: false, - loading: false - }) - } else { - this.setState({ - loading: false - }) - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) - } - } - - /** - * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙� - */ - getCustomParam = (BID) => { - const { pageIndex, pageSize, orderBy, search, setting } = this.state - - let _search = Utils.formatCustomMainSearch(search) - - let param = { - PageIndex: pageIndex, - PageSize: pageSize, - OrderCol: orderBy || setting.order, - BID: BID, - ..._search - } - - if (setting.interType === 'inner') { - param.func = setting.innerFunc - } else { - if (setting.sysInterface === 'true' && options.cloudServiceApi) { - param.rduri = options.cloudServiceApi - param.userid = sessionStorage.getItem('CloudUserID') || '' - param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' - } else if (setting.sysInterface !== 'true') { - param.rduri = setting.interface - } - - if (setting.outerFunc) { - param.func = setting.outerFunc - } - } - - return param - } - - /** - * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼鐨勫弬鏁� - */ - getDefaultParam = (BID) => { - const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state - - let _search = Utils.joinMainSearchkey(search) - _search = _search ? 'where ' + _search : '' - - let param = { - func: 'sPC_Get_TableData', - obj_name: 'data', - arr_field: arr_field, - BID: BID, - menuname: this.props.Tab.label || '' - } - - let _orderBy = orderBy || setting.order - let _dataresource = setting.dataresource - - if (/\s/.test(_dataresource)) { - _dataresource = '(' + _dataresource + ') tb' - } - - if (setting.queryType === 'statistics') { // 缁熻鏁版嵁婧愶紝鍐呭鏇挎崲 - let fieldmap = new Map() - let options = search.map(item => { - let _field = item.key - - if (fieldmap.has(_field)) { - _field = _field + '1' - } - - fieldmap.set(item.key, true) - - return { - reg: new RegExp('@' + _field, 'ig'), - value: item.value - } - }) - - options.reverse() - - options.forEach(item => { - _dataresource = _dataresource.replace(item.reg, `'${item.value}'`) - }) - - _search = '' - } - - let 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 ` - let DateCount = `select count(1) as total from ${_dataresource} ${_search}` - - param.LText = Utils.formatOptions(LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - param.DateCount = Utils.formatOptions(DateCount) - - param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - - return param - } - - /** - * @description 鎼滅储鏉′欢鏀瑰彉鏃讹紝閲嶇疆琛ㄦ牸鏁版嵁 - * 鍚湁鍒濆涓嶅姞杞界殑椤甸潰锛屼慨鏀硅缃� - */ - refreshbysearch = (searches) => { - MKEmitter.emit('resetTable', this.props.Tab.uuid) // 鍒楄〃閲嶇疆 - this.setState({ - loading: true, - pageIndex: 1, - selectedData: [], - search: searches - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鏉′欢鏀瑰彉鏃堕噸缃暟鎹紙鍒嗛〉鎴栨帓搴忥級 - */ - refreshbytable = (pagination, filters, sorter) => { - if (sorter.order) { - let _chg = { - ascend: 'asc', - descend: 'desc' - } - sorter.order = _chg[sorter.order] - } - - this.setState({ - loading: true, - selectedData: [], - pageIndex: pagination.current, - pageSize: pagination.pageSize, - orderBy: (sorter.field && sorter.order) ? `${sorter.field} ${sorter.order}` : '' - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸鍒锋柊 - */ - reloadtable = () => { - MKEmitter.emit('resetTable', this.props.Tab.uuid) // 鍒楄〃閲嶇疆 - this.setState({ - loading: true, - pageIndex: 1, - selectedData: [] - }, () => { - this.loadmaindata() - }) - } - - /** - * @description 琛ㄦ牸閫夋嫨椤瑰垏鎹� - */ - changeSelectedData = (selectedData) => { - this.setState({selectedData}) - } - - /** - * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤� - */ - refreshbyaction = (btn, type) => { - if (btn.execSuccess === 'grid' && type === 'success') { - this.reloadtable() - } else if (btn.execError === 'grid' && type === 'error') { - this.reloadtable() - } - } - - /** - * @description 鏁版嵁灞曞紑鍚堝苟鍒囨崲 - */ - pickupChange = () => { - const { pickup } = this.state - - this.setState({ - pickup: !pickup - }) - } - - changeTableLine = (ContainerId, tableId, id, data) => { - const { Tab } = this.props - - if (tableId !== Tab.supMenu) return - - this.setState({BData: data, BID: id}) - - if (id !== this.state.BID) { - MKEmitter.emit('resetTable', this.props.Tab.uuid) // 鍒楄〃閲嶇疆 - this.setState({ - pageIndex: 1, - selectedData: [] - }, () => { - this.loadmaindata('refresh') - }) - } - } - - UNSAFE_componentWillMount() { - // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁 - this.loadconfig() - } - - componentDidMount () { - MKEmitter.addListener('changeTableLine', this.changeTableLine) - } - - shouldComponentUpdate (nextProps, nextState) { // handleMainTable 鍑芥暟鍒ゆ柇鏃朵笉鐩哥瓑 - return !is(fromJS(this.state), fromJS(nextState)) - } - - /** - * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 - */ - componentWillUnmount () { - this.setState = () => { - return - } - MKEmitter.removeListener('changeTableLine', this.changeTableLine) - } - - render() { - const { BID, BData, setting, searchlist, actions, columns, pickup, selectedData, pageSize } = this.state - - return ( - <div className="verup-subtable" id={'subtable' + this.props.MenuID}> - {searchlist && searchlist.length ? - <MainSearch searchlist={searchlist} refreshdata={this.refreshbysearch}/> : null - } - {actions ? - <div className="sub-action"> - <SubAction - type="sub" - BID={BID} - BData={BData} - setting={setting} - actions={actions} - columns={columns} - Tab={this.props.Tab} - dict={this.state.dict} - selectedData={selectedData} - MenuID={this.props.SupMenuID} - refreshdata={this.refreshbyaction} - ContainerId={this.props.ContainerId} - /> - </div> : null - } - {columns ? - <div className="subtable-box"> - {this.state.data && this.state.data.length > 0 ? - <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null - } - <SubTable - tableId={this.props.Tab.uuid} - pickup={pickup} - setting={setting} - columns={columns} - pageSize={pageSize} - dict={this.state.dict} - data={this.state.data} - total={this.state.total} - MenuID={this.props.MenuID} - loading={this.state.loading} - refreshdata={this.refreshbytable} - buttonTrigger={() => {}} - chgSelectData={this.changeSelectedData} - /> - </div> : null - } - </div> - ) - } -} - -export default VerupSubTabViewTable \ No newline at end of file diff --git a/src/tabviews/verupmanage/subtabtable/index.scss b/src/tabviews/verupmanage/subtabtable/index.scss deleted file mode 100644 index e2964c1..0000000 --- a/src/tabviews/verupmanage/subtabtable/index.scss +++ /dev/null @@ -1,47 +0,0 @@ -.verup-subtable { - position: relative; - min-height: 200px; - - > .top-search { - padding: 0 0px 20px; - } - >.sub-action { - min-height: 25px; - .verup-button-list { - padding: 10px 0px 5px; - } - } - .normal-data-table { - padding: 0px; - } - .box404 { - padding-top: 30px; - } - .ant-modal-mask { - position: absolute; - } - .ant-modal-wrap { - position: absolute; - } - .action-modal .ant-modal { - top: 40px; - max-width: 95%; - .ant-modal-body { - max-height: calc(100vh - 265px); - } - } - > .ant-spin { - position: absolute; - left: calc(50% - 22px); - top: 100px; - } - .subtable-box { - position: relative; - .subtable-pickup { - position: absolute; - right: 5px; - top: -22px; - z-index: 1; - } - } -} diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 4f27208..3a308ee 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -710,7 +710,7 @@ }) } - if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 + if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) @@ -755,7 +755,7 @@ param[setting.primaryKey] = primaryId } - if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 + if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) @@ -1582,7 +1582,11 @@ result.func = btn.outerFunc } if (window.GLOB.mkHS) { - if (btn.sysInterface === 'true' && options.cloudServiceApi) { + if (btn.outerFunc === 's_app_version_upt') { // special 鏇存柊鐗堟湰鍙锋椂璁块棶sso + if (window.GLOB.mainSystemApi) { + result.rduri = window.GLOB.mainSystemApi + } + } else if (btn.sysInterface === 'true' && options.cloudServiceApi) { result.rduri = options.cloudServiceApi result.userid = sessionStorage.getItem('CloudUserID') || '' result.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' @@ -1594,7 +1598,7 @@ } } - // 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 + // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 if (result.func === 's_sDataDictb_TBBack' && result.LTextOut) { result.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') result.secretkey = Utils.encrypt(result.LTextOut, result.timestamp) @@ -1631,7 +1635,16 @@ result.mk_api_key = record.mk_api_key } - if (btn.callbackType === 'script' || btn.callbackType === 'default') { + // special 鐗堟湰鍗囩骇鍥炶皟澶勭悊 + if (window.GLOB.mkHS && btn.outerFunc === 's_get_sVersionDetail_Ltext' && btn.callbackFunc) { + if (result.status) { + this.verupRequest(params, result, outParam, _resolve) + } else { + this.execError(result) + _resolve() + } + return + } else if (btn.callbackType === 'script' || btn.callbackType === 'default') { param = this.getCallBackSql(result, record) } else if (btn.callbackType === 'func' || btn.callbackFunc) { delete result.message @@ -1643,7 +1656,7 @@ func: btn.callbackFunc } - // 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 + // special 鍑芥暟 s_sDataDictb_TBBack 浜戠楠岃瘉 if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) @@ -1679,6 +1692,71 @@ _resolve() } }) + } + + verupRequest = (params, result, outParam, _resolve) => { + const { btn } = this.props + + delete result.message + delete result.status + + result.func = btn.callbackFunc + + let ssoParam = null + let callParam = {...outParam, ...result} + + if (callParam.LTextOut) { + callParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + callParam.secretkey = Utils.encrypt(callParam.LTextOut, callParam.timestamp) + callParam.open_key = Utils.encryptOpenKey(callParam.secretkey, callParam.timestamp) + } + + if (callParam.UpType === 'SSO' && window.GLOB.mainSystemApi) { + ssoParam = fromJS(callParam).toJS() + + ssoParam.rduri = window.GLOB.mainSystemApi + + delete ssoParam.UpType + } else { + delete callParam.UpType + } + + if (ssoParam) { + Api.genericInterface(ssoParam).then(res => { + if (!res.status) { + this.execError(res) + _resolve() + } else { + Api.genericInterface(callParam).then(re => { + if (!re.status) { + this.execError(re) + _resolve() + } else { + if (params.length === 0) { + this.execSuccess(res) + _resolve() + } else { + this.outerLoopRequest(params, _resolve) + } + } + }) + } + }) + } else { + Api.genericInterface(callParam).then(re => { + if (!re.status) { + this.execError(re) + _resolve() + } else { + if (params.length === 0) { + this.execSuccess(re) + _resolve() + } else { + this.outerLoopRequest(params, _resolve) + } + } + }) + } } /** @@ -2240,7 +2318,7 @@ } modelconfirm = () => { - const { btn } = this.props + const { btn, BID } = this.props const { btnconfig, selines } = this.state let _this = this @@ -2282,15 +2360,17 @@ _initval = moment().subtract(_initval, 'days').format('YYYY-MM-DD HH:mm:ss') } + if (_initval === undefined) { + _initval = '' + } + let _fieldlen = item.fieldlength || 50 if (item.type === 'textarea' || item.type === 'fileupload' || item.type === 'multiselect') { _fieldlen = item.fieldlength || 512 } else if (item.type === 'number') { _fieldlen = item.decimal ? item.decimal : 0 - } - - if (_initval === undefined) { - _initval = '' + } else if (item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_initval)) { // 鐗规畩瀛楁鏇挎崲 + _initval = _initval.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) } let _type = item.type diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 7db34c1..181d25f 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -979,10 +979,8 @@ if (item.interception === 'true') { // 鍘婚櫎棣栧熬绌烘牸 _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') } - if (item.type === 'text') { // 鐗规畩瀛楁鏇挎崲 - _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey) - _item.value = _item.value.replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')) - _item.value = _item.value.replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) + if (item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲 + _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) } } else if (item.type.indexOf('date') > -1) { if (item.declareType === 'nvarchar(50)') { diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 0a94c8d..4c0320f 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -164,7 +164,7 @@ reReadonly.interface = false reRequired.interface = true } else if (intertype === 'outer') { - shows.push('procMode', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackType', 'output') + shows.push('procMode', 'sysInterface', 'interface', 'outerFunc', 'callbackType', 'output') // reRequired.innerFunc = false if (this.record.procMode === 'system') { shows.push('sql', 'sqlType') @@ -181,6 +181,8 @@ if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -212,13 +214,15 @@ reOptions.Ot = requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') reRequired.innerFunc = false reRequired.callbackFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -231,12 +235,14 @@ reOptions.intertype = this.state.interTypeOptions.filter(op => op.value !== 'custom') if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc') reRequired.innerFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false @@ -275,13 +281,15 @@ if (_funcType === 'print') { shows.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'resetPageIndex') if (this.record.intertype === 'outer') { - shows.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') + shows.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') reRequired.innerFunc = false reRequired.callbackFunc = false if (this.record.sysInterface === 'false') { reReadonly.interface = false reRequired.interface = true + + shows.push('proInterface') } else { reReadonly.interface = true reRequired.interface = false diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js index 06fc8f6..5163438 100644 --- a/src/utils/utils-datamanage.js +++ b/src/utils/utils-datamanage.js @@ -263,6 +263,13 @@ if (window.GLOB.mkHS) { // 浜戠鏁版嵁楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) + + // special HS鑷畾涔夊嚱鏁版煡璇� + if (setting.tableName === 's_custom_script' && options.cloudServiceApi) { + param.rduri = options.cloudServiceApi + param.userid = sessionStorage.getItem('CloudUserID') || '' + param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' + } } return param diff --git a/src/views/basedesign/index.jsx b/src/views/basedesign/index.jsx index 41172b4..61a6e9b 100644 --- a/src/views/basedesign/index.jsx +++ b/src/views/basedesign/index.jsx @@ -71,7 +71,8 @@ let param = { func: 'sPC_Get_LongParam', - MenuID: editMenu.MenuID + // MenuID: editMenu.MenuID + MenuID: '1587005717541lov40vg61q7l1rbveon' } this.setState({ diff --git a/src/views/systemfunc/sidemenu/config.jsx b/src/views/systemfunc/sidemenu/config.jsx index 40e4bf2..f98e20f 100644 --- a/src/views/systemfunc/sidemenu/config.jsx +++ b/src/views/systemfunc/sidemenu/config.jsx @@ -5,30 +5,30 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1581067625930haged11ieaivpavv77k', MenuNo: 'sDatasM', MenuName: '鏁版嵁瀛楀吀', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1581734956310scks442ul2d955g9tu5', MenuNo: 'sVersionM', MenuName: '浼犺緭鍙风鐞�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1583991994144ndddg0bhh0is6shi0v1', MenuNo: 'sVersionQueryM', MenuName: '浼犺緭鍙锋煡璇�', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'VerupTable'}, - type: 'VerupTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1583979633842550imkchl4qt4qppsiv', MenuNo: 'sVersionMUpgrade', MenuName: '鐗堟湰鍗囩骇', @@ -41,67 +41,67 @@ MenuName: '鏍囩椤电鐞�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1578900109100np8aqd0a77q3na46oas', MenuNo: 'sPrintTemplateM', MenuName: '鏍囩鎵撳嵃妯℃澘', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '16044812935562g807p3p12huk8kokmb', MenuNo: 'sPrintTemplate_webM', MenuName: '鍗曟嵁鎵撳嵃妯℃澘', }, { src: '', systems: ['SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1585192949946f3et2ts8tn82krmumdf', MenuNo: 'MyAppManage', MenuName: '绯荤粺UI', }, { src: '', systems: ['SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '15855615451212m12ip23vpcm79kloro', MenuNo: 'sUsersAppM', MenuName: '绯荤粺鐢ㄦ埛绠$悊', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ScriptTable'}, - type: 'ScriptTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1587005717541lov40vg61q7l1rbveon', MenuNo: 's_custom_scriptM', MenuName: '鑷畾涔夊嚱鏁�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1590458676585agbbr63t6ihighg2i1g', MenuNo: 'LdropdownmenuNewM', MenuName: '閫氱敤涓嬫媺鑿滃崟', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1602315375262ikd33ii0nii34pt861o', MenuNo: 's_worksflow_roleM', MenuName: '鍏抽敭瑙掕壊绠$悊', // }, { // src: '', - // PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - // type: 'ManageTable', + // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + // type: 'CommonTable', // MenuID: '1606794243739c5ihs58lucpskp3r4s2', // MenuNo: 's_custom_componentsM', // MenuName: '鑷畾涔夌粍浠�', }, { src: '', systems: ['production', 'local'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '15827879285193g85m3i2uprektpgmpf', MenuNo: 'bd_mes_techM', MenuName: '宸ヨ壓涓绘暟鎹�', @@ -112,50 +112,50 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1582771068837vsv54a089lgp45migbg', MenuNo: 'KUNTitleM', MenuName: '鎺ュ彛涓绘暟鎹�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1582777675954ifu05upurs465omoth7', MenuNo: 'KUNMainM', MenuName: '鏌ヨ鎺ュ彛', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '158294809668898cklbv6c5bou8e1fpu', MenuNo: 'KUNMainMOut_advanced', MenuName: '楂橀樁鏌ヨ', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1584676379094iktph45fb8imhg96bql', MenuNo: 'KUNMainM_Out_usual', MenuName: '閫氱敤鏌ヨ鎺ュ彛', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1584695125339vo5g7iqgfn01qmrd6s2', MenuNo: 'KUNMainM_In_usual', MenuName: '閫氱敤鍐欏叆鎺ュ彛', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1584699661372vhmpp9dn9foo0eob722', MenuNo: 'KUNMainM_In', MenuName: '鍐欏叆鎺ュ彛', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '15848421131551gg04ie8sitsd3f7467', MenuNo: 'KUNOsMainM', MenuName: '澶栭儴鎺ュ彛', @@ -166,29 +166,29 @@ PageParam: {Icon: 'folder'}, children: [{ src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1589782279158ngr675kk3oksin35sul', MenuNo: 'bd_msn_emailM', MenuName: '閭欢鏈嶅姟鍣�', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1589788042787ffdt9hle4s45k9r1nvs', MenuNo: 'bd_msn_email_tempM', MenuName: '閭欢妯℃澘', // }, { // src: '', - // PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - // type: 'ManageTable', + // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + // type: 'CommonTable', // MenuID: '15900310928174dro07ihfckghpb5h13', // MenuNo: 'bd_msn_sms_tempM', // MenuName: '澶т簬鐭俊妯℃澘', // }, { // src: '', - // PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - // type: 'ManageTable', + // PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + // type: 'CommonTable', // MenuID: '1599613340050c8nu6rbst9d4emnnbsq', // MenuNo: 's_sms_qxM', // MenuName: '濂囦簯鐭俊妯℃澘', @@ -200,8 +200,8 @@ children: [{ src: '', systems: ['local', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1594095599055qicg2eb642v5qglhnuo', MenuNo: 's_weixin_pay_bdM', MenuName: '寰俊鏀粯', @@ -213,38 +213,38 @@ children: [{ src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1577972969199lei1g0qkvlh4tkc908m', MenuNo: 'sModularM', MenuName: '绯荤粺妯″潡', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1578479100252lfbp29v1kafk4s4q4ig', MenuNo: 'BDLanguagePacksM', MenuName: '璇█鍖�', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1577971621421tg4v0i1ur8873k7e0ob', MenuNo: 'sSystemParametersM', MenuName: '鎺ュ彛鍦板潃', }, { src: '', systems: ['production', 'local', 'SSO', 'cloud'], - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1577929944419lgc5h3hepum765e2k7u', MenuNo: 'sProcExcepM', MenuName: '鎶ラ敊鏃ュ織', }, { src: '', - PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, - type: 'ManageTable', + PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, + type: 'CommonTable', MenuID: '1588493493409k9guqp067d31lu7blsv', MenuNo: 's_job_stepM', MenuName: '璁″垝浠诲姟', -- Gitblit v1.8.0