From 407c0f1765c7d085218a91ad8842784977383d05 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 十月 2020 00:18:13 +0800 Subject: [PATCH] 2020-10-23 --- src/templates/sharecomponent/actioncomponent/index.jsx | 76 ++------------------------------------ 1 files changed, 4 insertions(+), 72 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index 6ef56de..1c9d9bc 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -686,39 +686,13 @@ * @description 鍒涘缓鎸夐挳瀛樺偍杩囩▼ */ creatFunc = () => { - const { config, menu } = this.props + 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 - - let _actionlist = fromJS(this.state.actionlist).toJS() - - _actionlist = _actionlist.filter(item => !item.origin || item.uuid === btn.uuid) - - let labelrepet = false - _actionlist = _actionlist.map(item => { - if (item.uuid !== btn.uuid && item.label === btn.label) { - labelrepet = true - } - - if (item.uuid === btn.uuid) { - return btn - } else { - return item - } - }) - - if (labelrepet) { - notification.warning({ - top: 92, - message: this.state.dict['model.name.exist'] + ' !', - duration: 5 - }) - return - } // 鍒涘缓瀛樺偍杩囩▼锛屽繀椤诲~鍐欏唴閮ㄥ嚱鏁板悕 if (btn.intertype !== 'inner') { @@ -816,35 +790,7 @@ }).then(res => { if (!res) return - this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText).then(result => { - if (result !== 'success') return - - // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒� - 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.form.column.action'], - type: 'action', - style: 'button', - show: 'horizontal', - Width: 120 - } - } - - this.setState({ - actionlist: _actionlist - }, () => { - this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}) - }) - }) + this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText) }) }) } @@ -856,14 +802,6 @@ const { config, type, menu } = this.props this.actionFormRef.handleConfirm().then(result => { - if (result.Ot === 'requiredOnce') { - notification.warning({ - top: 92, - message: '澶氳鎷兼帴鏃讹紝涓嶅彲鍒涘缓鎺ュ彛锛�', - duration: 5 - }) - return - } let _menu = { type: type, MenuID: menu.MenuID, @@ -907,11 +845,6 @@ const { config } = this.props const { actionlist, visible, card, dict, copying, profVisible } = this.state - let hasbtncrtinter = false - if (card && !card.copyType && config.setting.interType === 'system' && config.setting.dataresource) { - hasbtncrtinter = true - } - 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']}> @@ -935,8 +868,8 @@ maskClosable={false} onCancel={this.editModalCancel} footer={[ - hasbtncrtinter ? <CreateInterface key="interface" dict={dict} ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, - card && !card.copyType ? <CreateFunc key="create" dict={dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, + <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> ]} @@ -967,7 +900,6 @@ > {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? <VerifyCard - floor={this.props.type} card={card} dict={dict} config={config} -- Gitblit v1.8.0