From 86aab033b5129b00651b716ee70ce871cf670008 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 31 三月 2020 20:12:30 +0800 Subject: [PATCH] 2020-03-31 --- src/templates/comtableconfig/index.jsx | 82 +++++++++++++++++++++++------------------ 1 files changed, 46 insertions(+), 36 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 1b241b7..14c3833 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -1063,20 +1063,6 @@ return } - if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) { - let param = { - func: 's_DataSrc_Save', - LText: setting.dataresource, - MenuID: menu.MenuID - } - - param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - Api.getLocalConfig(param) - } - let _config = {...config, setting: setting} let newLText = Utils.formatOptions(Utils.getTableFunc(setting, menu, _config)) // 鍒涘缓瀛樺偍杩囩▼sql let DelText = Utils.formatOptions(Utils.dropfunc(setting.innerFunc)) // 鍒犻櫎瀛樺偍杩囩▼sql @@ -1092,7 +1078,28 @@ } /** - * @description 鍒涘缓琛ㄦ牸鎺ュ彛 + * @description 鍒涘缓鎸夐挳鎺ュ彛锛堝啓鍏ワ級 + */ + btnCreatInterface = () => { + const { menu } = this.props + const { config } = this.state + + this.menuformRef.handleConfirm().then(res => { + this.actionFormRef.handleConfirm().then(result => { + let _menu = { + type: 'main', + MenuID: menu.MenuID, + menuName: res.menuName, + menuNo: res.menuNo + } + + this.refs.btnCreatInterface.triggerInInterface(result, config, _menu) + }) + }) + } + + /** + * @description 鍒涘缓琛ㄦ牸鎺ュ彛锛堣鍑猴級 */ tableCreatInterface = () => { const { menu } = this.props @@ -1100,20 +1107,6 @@ this.menuformRef.handleConfirm().then(res => { this.settingRef.handleConfirm().then(setting => { - if (/[^\s]+\s+[^\s]+/ig.test(setting.dataresource) && config.setting.dataresource !== setting.dataresource) { - let param = { - func: 's_DataSrc_Save', - LText: setting.dataresource, - MenuID: menu.MenuID - } - - param.LText = Utils.formatOptions(param.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' - param.secretkey = Utils.encrypt(param.LText, param.timestamp) - - Api.getLocalConfig(param) - } - if (setting.interType !== 'inner' || setting.innerFunc) { notification.warning({ top: 92, @@ -1131,13 +1124,7 @@ menuNo: res.menuNo } - this.refs.tableCreatInterface.exec(_menu, _config).then(result => { - if (result === 'success') { - this.setState({ - config: _config - }) - } - }) + this.refs.tableCreatInterface.triggerOutInterface(_menu, _config) }) }) } @@ -1203,6 +1190,21 @@ profileVisible: true, card: element }) + } + + /** + * @description 鎸夐挳鍙屽嚮瑙﹀彂瀛愰厤缃� + */ + btnDoubleClick = (element) => { + if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || element.OpenType === 'tab')) { + this.setSubConfig(element, 'button') + } else { + notification.warning({ + top: 92, + message: '姝ゆ寜閽棤瀛愰厤缃」锛�', + duration: 10 + }) + } } /** @@ -2686,6 +2688,11 @@ configTabs.push(...this.state.config[group]) }) + let hasbtncrtinter = false + if (modaltype === 'actionEdit' && this.state.config.setting.interType === 'inner' && !this.state.config.setting.innerFunc && this.state.config.setting.dataresource) { + hasbtncrtinter = true + } + return ( <div className="common-table-board"> <DndProvider backend={HTML5Backend}> @@ -2863,6 +2870,7 @@ copyElement={(val) => this.handleAction(val, 'copy')} deleteMenu={this.deleteElement} profileMenu={this.profileAction} + doubleClickCard={this.btnDoubleClick} placeholder={this.state.dict['header.form.action.placeholder']} /> </div> @@ -2905,6 +2913,7 @@ handleList={this.handleList} handleMenu={this.handleTab} deleteMenu={this.deleteElement} + doubleClickCard={(tab) => this.setSubConfig(tab, 'tab')} placeholder={this.state.dict['header.form.tab.placeholder']} /> </div>) @@ -2939,6 +2948,7 @@ maskClosable={false} onCancel={this.editModalCancel} footer={[ + hasbtncrtinter ? <CreateInterface key="interface" dict={this.state.dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, modaltype === 'actionEdit' ? <CreateFunc key="create" dict={this.state.dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['header.cancel']}</Button>, <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button> -- Gitblit v1.8.0