From 0bbaa727cdfc65622e33e91c4bf694c83f184535 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 04 二月 2024 23:12:14 +0800 Subject: [PATCH] 2024-02-04 --- src/templates/sharecomponent/actioncomponent/index.jsx | 721 +++++++++--------------------------------------------- 1 files changed, 127 insertions(+), 594 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index 72ff755..96961c4 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -1,26 +1,24 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Icon, Tooltip, Modal, notification, Button } from 'antd' +import { Modal, notification, Button } from 'antd' import moment from 'moment' import Api from '@/api' -import Utils, { FuncUtils } from '@/utils/utils.js' -import zhCN from '@/locales/zh-CN/model.js' -import enUS from '@/locales/en-US/model.js' -import { getActionForm } from '@/templates/zshare/formconfig' +import Utils from '@/utils/utils.js' +import { getActionForm } from './formconfig' import asyncSpinComponent from '@/utils/asyncSpinComponent' import ActionForm from './actionform' -import CreateFunc from '@/templates/zshare/createfunc' -import CreateInterface from '@/templates/zshare/createinterface' import DragElement from './dragaction' +import MKEmitter from '@/utils/events.js' import './index.scss' const { confirm } = Modal const VerifyCard = asyncSpinComponent(() => import('@/templates/zshare/verifycard')) const VerifyPrint = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyprint')) const VerifyExcelIn = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelin')) +const VerifyMegvii = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifymegvii')) const VerifyExcelOut = asyncSpinComponent(() => import('@/templates/sharecomponent/actioncomponent/verifyexcelout')) class ActionComponent extends Component { @@ -34,14 +32,14 @@ } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 actionlist: null, // 鎸夐挳缁� copying: false, // 鎸夐挳澶嶅埗涓� visible: false, // 妯℃�佹鎺у埗 printTemps: [], // 鍗曟嵁鎵撳嵃妯℃澘 - profVisible: false // 楠岃瘉淇℃伅妯℃�佹 + profVisible: false, // 楠岃瘉淇℃伅妯℃�佹 + record: null } /** @@ -53,24 +51,29 @@ }) } - /** - * @description 鐩戝惉鍒版寜閽鍒舵椂锛岃Е鍙戞寜閽紪杈� - */ - UNSAFE_componentWillReceiveProps (nextProps) { - const { actionlist } = this.state - - if (!is(fromJS(nextProps.config.action), fromJS(this.props.config.action)) && !is(fromJS(nextProps.config.action), fromJS(actionlist))) { - let len = nextProps.config.action.length - let item = nextProps.config.action[len - 1] - if (item && item.focus) { - this.handleAction(item) - } - this.setState({actionlist: fromJS(nextProps.config.action).toJS()}) - } - } - componentDidMount () { this.getBillPrintTemp() + // MKEmitter.addListener('revert', this.revert) + MKEmitter.addListener('pasteButton', this.pasteButton) + } + + // revert = () => { + // this.setState({ + // actionlist: fromJS(this.props.config.action).toJS() + // }) + // } + + pasteButton = (MenuId, btn) => { + const { config } = this.props + const { actionlist } = this.state + + if (MenuId !== config.uuid) return + + this.setState({ + actionlist: [...actionlist, btn], + }, () => { + this.handleAction(btn) + }) } getBillPrintTemp = () => { @@ -85,17 +88,17 @@ let param = { func: 'sPC_Get_SelectedList', - LText: Utils.formatOptions(_sql), + LText: Utils.formatOptions(_sql, 'x'), obj_name: 'data', - arr_field: 'PN,ID,Images' + arr_field: 'PN,ID,Images', + exec_type: 'x' } param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - + param.secretkey = Utils.encrypt('', param.timestamp) param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 浜戠鏁版嵁楠岃瘉 - Api.getSystemConfig(param).then(res => { + Api.getCloudConfig(param).then(res => { if (res.status) { let temps = res.data.map(temp => { return { @@ -143,23 +146,17 @@ if (usefulFields) { try { usefulFields = JSON.parse(usefulFields) - } catch { + } catch (e) { usefulFields = [] } } else { usefulFields = [] } - let ableField = usefulFields.join(', ') - let functip = <div> - <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> - </div> - let menulist = [] if (menu.fstMenuList) { let trees = fromJS(menu.fstMenuList).toJS() - menulist = trees.map(fst => { fst.value = fst.MenuID fst.label = fst.MenuName @@ -183,7 +180,7 @@ this.setState({ visible: true, card: card, - formlist: getActionForm(card, functip, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps) + formlist: getActionForm(card, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps, this.props.tabs) }) } @@ -219,8 +216,7 @@ * 4銆佷笅鎷夎彍鍗曟暟鎹簮璇硶楠岃瘉 */ handleSubmit = () => { - const { config, menu } = this.props - const { card } = this.state + const { config } = this.props let _actionlist = fromJS(this.state.actionlist).toJS() this.actionFormRef.handleConfirm().then(btn => { @@ -248,371 +244,34 @@ return } - this.setState({ - copying: true - }) - let copyActionId = '' // 鎸夐挳涓哄鍒舵椂锛岃褰曞綋鍓嶆寜閽殑Id锛岃彍鍗曞彇娑堜繚瀛樻椂锛屽垹闄ゅ鍒舵寜閽厤缃俊鎭� - /** - * @description 鎸夐挳淇濆瓨鏍¢獙 - * 1銆佹鏌ユ寜閽槸鍚︿负琛ㄥ崟鎴栬〃鍗曟爣绛鹃〉锛屽鍓嶅悗涓�鑷达紝鍒欏鍒跺叾鍐呭 - * 2銆佹鏌ユ寜閽槸鍚︿负鏍囩椤碉紝濡傚墠鍚庝竴鑷达紝鍒欏鍒舵爣绛鹃〉 - */ - new Promise(resolve => { - if ( - !card.originCard || - (btn.OpenType === 'pop' && card.originCard.OpenType !== 'pop') || - (['tab', 'blank'].includes(btn.OpenType) && !['tab', 'blank'].includes(card.originCard.OpenType)) || - (btn.OpenType === 'popview' && (!btn.createTab || card.originCard.OpenType !== 'popview' || !card.originCard.linkTab)) - ) { // 鎸夐挳涓嶆槸澶嶅埗锛屾垨鎸夐挳鍓嶅悗绫诲瀷涓嶄竴鑷存椂锛岀洿鎺ヤ繚瀛� - resolve('save') - } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.OpenType === 'blank') { - resolve('subconf') - } else if (btn.OpenType === 'popview') { - resolve('subtab') - } else { - resolve('save') - } - }).then(result => { // 鏌ヨ鍘熸寜閽厤缃俊鎭� - if (result === 'save' || result === 'subtab') return result + // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒� + let _hasGridbtn = _actionlist.filter(act => act.position === 'grid').length > 0 + let _gridBtn = config.gridBtn ? fromJS(config.gridBtn).toJS() : null - return Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: card.originCard.uuid - }) - }).then(result => { // 澶嶅埗鎸夐挳閰嶇疆淇℃伅锛屼繚瀛樿嚦鏂版坊鍔犳寜閽� - if (result === 'save' || result === 'subtab') return result - - if (result.status && result.LongParam) { - let _LongParam = '' - - // 瑙f瀽閰嶇疆 - if (result.LongParam) { - try { - _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) - } catch (e) { - console.warn('Parse Failure') - _LongParam = '' - } - } - - let _temp = '' // 閰嶇疆淇℃伅绫诲瀷 - - // 淇敼妯℃�佹鏍囬鍚嶇О - if (btn.OpenType === 'pop' && _LongParam && _LongParam.type === 'Modal') { - try { - _LongParam.setting.title = btn.label - _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) - _temp = 'Modal' - } catch { - console.warn('Stringify Failure') - _LongParam = '' - _temp = '' - } - } else if (['tab', 'blank'].includes(btn.OpenType) && _LongParam && _LongParam.type === 'FormTab') { - try { - _LongParam.action = _LongParam.action.map(_btn => { - _btn.uuid = Utils.getuuid() - - return _btn - }) - _LongParam.tabgroups.forEach(_groupId => { - _LongParam[_groupId] = _LongParam[_groupId].map(_tab => { - _tab.uuid = Utils.getuuid() - - return _tab - }) - }) - _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) - _temp = 'FormTab' - } catch { - console.warn('Stringify Failure') - _LongParam = '' - _temp = '' - } - } - - if (!_temp) return 'save' - - let param = { - func: 'sPC_ButtonParam_AddUpt', - ParentID: menu.MenuID, - MenuID: btn.uuid, - MenuNo: menu.MenuNo, - Template: _temp, - MenuName: btn.label, - PageParam: JSON.stringify({Template: _temp}), - LongParam: _LongParam - } - - return Api.getSystemConfig(param) - } else { - if (!result.status) { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } - return 'save' - } - }).then(result => { - if (result === 'save' || result === 'subtab') return result - - if (!result.status) { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } else { - copyActionId = btn.uuid - } - - return 'save' - }).then(result => { // 鏌ヨ鍘熸寜閽叧鑱旀爣绛句俊鎭� - if (result === 'save') return result - - return Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: card.originCard.linkTab - }) - }).then(result => { // 鏍囩澶嶅埗 - if (result === 'save') return result - - let _LongParam = '' // 鏍囩閰嶇疆淇℃伅 - - if (!result.status) { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } else if (result.LongParam) { - // 瑙f瀽鏍囩閰嶇疆 - try { - _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) - } catch (e) { - console.warn('Parse Failure') - _LongParam = '' - } - } - - if (!_LongParam) { - return 'save' - } else { - copyActionId = btn.linkTab - - return new Promise(resolve => { - this.copytab(btn, _LongParam, resolve) - }) - } - }).then(() => { - // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒� - let _hasGridbtn = _actionlist.filter(act => act.position === 'grid').length > 0 - let _gridBtn = config.gridBtn ? fromJS(config.gridBtn).toJS() : null - - if (_gridBtn) { - _gridBtn.display = _hasGridbtn - } else { - _gridBtn = { - display: _hasGridbtn, - Align: 'center', - IsSort: 'false', - uuid: Utils.getuuid(), - label: this.state.dict['model.operation'], - type: 'action', - style: 'button', - show: 'horizontal', - Width: 120 - } - } - - this.setState({ - actionlist: _actionlist, - copying: false, - visible: false - }, () => { - this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId) - }) - }) - }) - } - - /** - * @description 鏍囩澶嶅埗 - * 1銆佷繚瀛樻寜閽叧鑱旂殑鏂版爣绛� - * 2銆佷繚瀛樻爣绛炬寜閽俊鎭� - * 3銆佷繚瀛樻柊鏍囩涓寜閽殑瀛愰厤缃俊鎭� - */ - copytab = (btn, _tab, _resolve) => { - let _LongParam = '' - - _tab.uuid = btn.linkTab - _tab.tabName = _tab.tabName + moment().format('YYYY-MM-DD HH:mm:ss') - _tab.tabNo = _tab.tabNo + moment().format('YYYY-MM-DD HH:mm:ss') - - let param = { - func: 'sPC_Tab_AddUpt', - MenuID: _tab.uuid, - MenuNo: _tab.tabNo, - Template: _tab.Template, - MenuName: _tab.tabName, - Remark: _tab.Remark, - PageParam: JSON.stringify({Template: _tab.Template}), - Sort: 0 - } - - let _oriActions = [] - - let btnParam = { - func: 'sPC_Button_AddUpt', - Type: 40, - ParentID: _tab.uuid, - MenuNo: _tab.tabNo, - Template: _tab.Template, - PageParam: '', - LongParam: '', - LText: '' - } - - try { - let _linkchange = {} - btnParam.LText = [] - - _tab.action = _tab.action.map((item, index) => { - let uuid = Utils.getuuid() - - if (item.OpenType === 'pop') { - _oriActions.push({ - prebtn: JSON.parse(JSON.stringify(item)), - curuuid: uuid, - Template: 'Modal' - }) - } else if (item.OpenType === 'popview') { - _linkchange[item.linkTab] = Utils.getuuid() - - item.linkTab = _linkchange[item.linkTab] - } - - item.uuid = uuid - - btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`) - - return item - }) - - if (_tab.funcs && _tab.funcs.length > 0) { - _tab.funcs = _tab.funcs.map(item => { - if (item.type === 'tab') { - item.linkTab = _linkchange[item.linkTab] - item.menuNo = '' - item.subfuncs = [] - } - - return item - }) - } - - btnParam.LText = btnParam.LText.join(' union all ') - btnParam.LText = Utils.formatOptions(btnParam.LText) - btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) - - _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_tab))) - } catch { - console.warn('Stringify Failure') - _LongParam = '' - _resolve('save') - return - } - - param.LongParam = _LongParam - - new Promise(resolve => { - Api.getSystemConfig(param).then(response => { - if (response.status) { - resolve(true) - } else { - notification.warning({ - top: 92, - message: response.message, - duration: 5 - }) - resolve(false) - } - }) - }).then(result => { - if (!result) return result - if (!btnParam.LText) return true - - return Api.getSystemConfig(btnParam) - }).then(result => { - if (result === false || result === true) return result - - if (result.status) { - return true + if (_gridBtn) { + _gridBtn.display = _hasGridbtn } else { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - return false + _gridBtn = { + display: _hasGridbtn, + Align: 'center', + IsSort: 'false', + uuid: Utils.getuuid(), + label: '鎿嶄綔', + type: 'action', + style: 'button', + show: 'horizontal', + Width: 120 + } } - }).then(result => { - if (!result) return result - if (_oriActions.length === 0) return true - let deffers = _oriActions.map(item => { - return new Promise(resolve => { - Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: item.prebtn.uuid - }).then(response => { - if (!response.status || !response.LongParam) { - resolve(response) - } else { - let _param = { - func: 'sPC_ButtonParam_AddUpt', - ParentID: _tab.uuid, - MenuID: item.curuuid, - MenuNo: _tab.tabNo, - Template: item.Template, - MenuName: item.prebtn.label, - PageParam: JSON.stringify({Template: item.Template}), - LongParam: response.LongParam - } - Api.getSystemConfig(_param).then(resp => { - resolve(resp) - }) - } - }) - }) + this.setState({ + actionlist: _actionlist, + visible: false + }, () => { + this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId) }) - - return Promise.all(deffers) - }).then(result => { - let error = '' - - if (typeof(result) === 'object') { - result.forEach(resul => { - if (!resul.status && !error) { - error = resul - } - }) - } - - if (error) { - notification.warning({ - top: 92, - message: error.message, - duration: 5 - }) - } - - _resolve('save') }) } @@ -621,11 +280,10 @@ */ deleteElement = (card) => { const { config } = this.props - const { dict } = this.state let _this = this confirm({ - content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, + content: `纭畾鍒犻櫎 - ${card.label} 锛焋, onOk() { let _actionlist = fromJS(_this.state.actionlist).toJS() @@ -642,7 +300,7 @@ Align: 'center', IsSort: 'false', uuid: Utils.getuuid(), - label: this.state.dict['model.operation'], + label: '鎿嶄綔', type: 'action', style: 'button', show: 'horizontal', @@ -704,153 +362,19 @@ } /** - * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ - */ - creatFunc = () => { - const { menu } = this.props - let _config = fromJS(this.props.config).toJS() - - this.actionFormRef.handleConfirm().then(res => { - let btn = res // 鎸夐挳淇℃伅 - let newLText = '' // 鍒涘缓瀛樺偍杩囩▼sql - let DelText = '' // 鍒犻櫎瀛樺偍杩囩▼sql - - // 鍒涘缓瀛樺偍杩囩▼锛屽繀椤诲~鍐欏唴閮ㄥ嚱鏁板悕 - if (btn.intertype !== 'inner') { - notification.warning({ - top: 92, - message: '浣跨敤鍐呴儴鍑芥暟鏃讹紝鎵嶅彲浠ュ垱寤哄瓨鍌ㄨ繃绋嬶紒', - duration: 5 - }) - return - } - - new Promise(resolve => { - // 寮圭獥锛堣〃鍗曪級绫绘寜閽紝鍏堣幏鍙栨寜閽厤缃俊鎭紝濡傛灉灏氭湭閰嶇疆鎸夐挳鍒欎細鎶ラ敊骞剁粓姝€�� - // 鑾峰彇淇℃伅鍚庣敓鎴愬垹闄ゅ拰鍒涘缓瀛樺偍杩囩▼鐨勮鍙� - if (btn.OpenType === 'pop') { - Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: btn.uuid - }).then(res => { - let _LongParam = '' - if (res.status && res.LongParam) { - try { - _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) - } catch (e) { - console.warn('Parse Failure') - _LongParam = '' - } - } - - if (_LongParam) { - let fields = [] - if (_LongParam.groups.length > 0) { - _LongParam.groups.forEach(group => { - fields = [...fields, ...group.sublist] - }) - } else { - fields = _LongParam.fields - } - - let _param = { - funcName: btn.innerFunc, - name: _config.setting.tableName || '', - fields: fields, - menuNo: menu.MenuNo - } - newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) - DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) - resolve(true) - } else { - notification.warning({ - top: 92, - message: '寮圭獥锛堣〃鍗曪級鎸夐挳锛岃鍏堥厤缃〃鍗曚俊鎭紒', - duration: 5 - }) - resolve(false) - } - }) - } else if (btn.OpenType === 'excelIn') { - if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) { - let _param = { - funcName: btn.innerFunc, - menuNo: menu.MenuNo - } - newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu)) - DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) - resolve(true) - } else { - notification.warning({ - top: 92, - message: '璇峰畬鍠勫鍏xcel楠岃瘉淇℃伅锛�', - duration: 5 - }) - resolve(false) - } - } else if (btn.OpenType === 'excelOut') { - let _param = { - innerFunc: btn.innerFunc - } - - newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql - DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) - - resolve(true) - } else { - let _param = { - funcName: btn.innerFunc, - name: _config.setting.tableName || '', - fields: '', - menuNo: menu.MenuNo - } - newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) - DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) - resolve(true) - } - }).then(res => { - if (!res) return - - this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText) - }) - }) - } - - /** - * @description 鍒涘缓鎸夐挳鎺ュ彛锛堝啓鍏ワ級 - */ - btnCreatInterface = () => { - const { config, type, menu } = this.props - - this.actionFormRef.handleConfirm().then(result => { - let _menu = { - type: type, - MenuID: menu.MenuID, - menuName: menu.MenuName, - menuNo: menu.MenuNo - } - - this.refs.btnCreatInterface.triggerInInterface(result, config, _menu) - }) - } - - /** * @description 鎸夐挳鍙屽嚮瑙﹀彂瀛愰厤缃� */ - btnDoubleClick = (element) => { - if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || (element.OpenType === 'tab' && element.tabTemplate === 'FormTab'))) { - this.props.setSubConfig(element) + btnDoubleClick = (el) => { + // execMode === 'pop' 涓� OpenType === 'funcbutton' + if (!el.origin && (el.OpenType === 'pop' || el.execMode === 'pop' || el.OpenType === 'popview' || (el.OpenType === 'tab' && el.tabTemplate === 'FormTab'))) { + this.props.setSubConfig(el) } else { - notification.warning({ - top: 92, - message: '姝ゆ寜閽棤瀛愰厤缃」锛�', - duration: 5 - }) + this.handleAction(el) } } shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) + return !is(fromJS(this.state), fromJS(nextState)) } /** @@ -860,17 +384,56 @@ this.setState = () => { return } + // MKEmitter.removeListener('revert', this.revert) + MKEmitter.removeListener('pasteButton', this.pasteButton) + } + + getVerify = (card) => { + const { config } = this.props + + if (!card) return null + + if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { + return <VerifyCard + card={card} + config={config} + columns={config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + } else if (card.OpenType === 'excelIn') { + return <VerifyExcelIn + card={card} + columns={config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + } else if (card.OpenType === 'excelOut') { + return <VerifyExcelOut + card={card} + config={config} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { + return <VerifyPrint + card={card} + columns={[]} + // columns={config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + } else if (card.OpenType === 'funcbutton' && card.funcType === 'megvii') { + return <VerifyMegvii + card={card} + columns={config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + } } render() { const { config } = this.props - const { actionlist, visible, card, dict, copying, profVisible } = this.state + const { actionlist, visible, card, copying, profVisible } = this.state return ( - <div className="model-table-action-list" style={config.charts.length > 1 ? {paddingTop: 25} : null}> - <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.action.guide']}> - <Icon type="question-circle" /> - </Tooltip> + <div className="model-table-action-list" style={config.charts && config.charts.length > 1 ? {paddingTop: 25} : null}> <DragElement list={actionlist} setting={this.props.config.setting} @@ -879,80 +442,50 @@ deleteMenu={this.deleteElement} profileMenu={this.profileAction} doubleClickCard={this.btnDoubleClick} - placeholder={dict['header.form.action.placeholder']} /> {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */} <Modal - title={dict['model.action'] + '-' + (card && card.copyType === 'action' ? dict['model.copy'] : dict['model.edit'])} + title={'鎸夐挳-' + (card && card.copyType === 'action' ? '澶嶅埗' : '缂栬緫')} wrapClassName="model-table-action-edit-modal" visible={visible} - width={850} + width={920} maskClosable={false} onCancel={this.editModalCancel} footer={[ - <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/>, - <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/>, - <Button key="cancel" onClick={this.editModalCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>{dict['model.confirm']}</Button> + <Button key="cancel" onClick={this.editModalCancel}>鍙栨秷</Button>, + <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>纭畾</Button> ]} destroyOnClose > <ActionForm - dict={dict} card={card} - tabs={this.props.tabs} formlist={this.state.formlist} inputSubmit={this.handleSubmit} setting={config.setting} + updRecord={(record) => this.setState({record: fromJS(record).toJS()})} wrappedComponentRef={(inst) => this.actionFormRef = inst} /> </Modal> {/* 鎸夐挳浣跨敤绯荤粺瀛樺偍杩囩▼鏃讹紝楠岃瘉淇℃伅妯℃�佹 */} <Modal - wrapClassName="model-table-action-verify-modal" - title={'楠岃瘉淇℃伅'} + wrapClassName="mk-pop-modal" visible={profVisible} - width={'75vw'} + width={'90vw'} maskClosable={false} - style={{minWidth: '900px', maxWidth: '1200px'}} - okText={dict['model.submit']} + okText="鎻愪氦" onOk={this.verifySubmit} - onCancel={() => { this.setState({ profVisible: false }) }} + onCancel={() => { + if (this.verifyRef.handleCancel) { + this.verifyRef.handleCancel().then(() => { + this.setState({ profVisible: false }) + }) + } else { + this.setState({ profVisible: false }) + } + }} destroyOnClose > - {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? - <VerifyCard - card={card} - dict={dict} - config={config} - columns={config.columns} - wrappedComponentRef={(inst) => this.verifyRef = inst} - /> : null - } - {card && card.execMode ? - <VerifyPrint - card={card} - dict={dict} - columns={config.columns} - wrappedComponentRef={(inst) => this.verifyRef = inst} - /> : null - } - {card && card.OpenType === 'excelIn' ? - <VerifyExcelIn - card={card} - dict={dict} - columns={config.columns} - wrappedComponentRef={(inst) => this.verifyRef = inst} - /> : null - } - {card && card.OpenType === 'excelOut' ? - <VerifyExcelOut - card={card} - dict={dict} - config={config} - wrappedComponentRef={(inst) => this.verifyRef = inst} - /> : null - } + {this.getVerify(card)} </Modal> </div> ) -- Gitblit v1.8.0