From 8904592cf12f091aece5d6fc564fd8478fc8988b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 13 二月 2020 20:04:56 +0800 Subject: [PATCH] 2020-02-13 --- src/tabviews/formtab/actionList/index.jsx | 77 ++++---------------------------------- 1 files changed, 9 insertions(+), 68 deletions(-) diff --git a/src/tabviews/formtab/actionList/index.jsx b/src/tabviews/formtab/actionList/index.jsx index fcf6651..f6a51ac 100644 --- a/src/tabviews/formtab/actionList/index.jsx +++ b/src/tabviews/formtab/actionList/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import moment from 'moment' -import { Button, Modal, notification, Spin, message } from 'antd' +import { Button, Modal, notification, message } from 'antd' import Utils from '@/utils/utils.js' import Api from '@/api' import './index.scss' @@ -10,59 +10,28 @@ class MainAction extends Component { static propTpyes = { - BData: PropTypes.any, // 涓昏〃鏁版嵁 - type: PropTypes.string, // 鍒ゆ柇褰撳墠涓轰富琛紙main锛夈�佸瓙琛紙sub锛夈�佸瓙琛ㄦ爣绛撅紙subtab锛� MenuID: PropTypes.string, // 鑿滃崟ID actions: PropTypes.array, // 鎸夐挳缁� - logcolumns: PropTypes.array, // 鏃ュ織涓樉绀哄垪 + logcolumns: PropTypes.array, // 鏄剧ず鍒� dict: PropTypes.object, // 瀛楀吀椤� + data: PropTypes.any, // 鏁版嵁 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 - triggerPopview: PropTypes.func // 寮圭獥鏍囩椤佃Е鍙� + refreshdata: PropTypes.func, // 鎵ц瀹屾垚鍚庢暟鎹埛鏂� } state = { - visible: false, formdata: null, tabledata: null, - confirmLoading: false, - loadingUuid: '', - btnloading: false + loadingUuid: '' } /** * @description 瑙﹀彂鎸夐挳鎿嶄綔 */ - actionTrigger = (item, record) => { - const { setting } = this.props + actionTrigger = (item) => { + const { data } = this.props let _this = this - let data = this.props.gettableselected() || [] - - if (item.Ot !== 'notRequired' && data.length === 0) { - // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹� - notification.warning({ - top: 92, - message: this.props.dict['main.action.confirm.selectline'], - duration: 10 - }) - 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: 10 - }) - return - } if (item.OpenType === 'prompt') { confirm({ @@ -78,17 +47,6 @@ this.setState({loadingUuid: item.uuid}) this.execSubmit(item, data, () => { this.setState({loadingUuid: ''}) - }) - } else if (item.OpenType === 'pop') { - this.setState({ - tabledata: data, - btnloading: true - }) - } else { - notification.warning({ - top: 92, - message: '瀹屽杽涓�傘�傘��', - duration: 10 }) } } @@ -474,12 +432,6 @@ } else if (res && res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず } - - if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') { - this.setState({ - visible: false - }) - } this.props.refreshdata(btn, 'success') } @@ -528,10 +480,10 @@ render() { - const { loadingUuid, btnloading } = this.state + const { loadingUuid } = this.state return ( - <div className="button-list toolbar-button"> + <div className="button-list formtab-button"> {this.props.actions.map((item, index) => { if (loadingUuid === item.uuid) { return ( @@ -554,17 +506,6 @@ ) } })} - <Button - className={'mk-btn'} - // icon={item.icon} - onClick={() => {this.actionTrigger()}} - >纭畾</Button> - <Button - className={'mk-btn'} - // icon={item.icon} - onClick={() => {this.actionTrigger()}} - >杩斿洖</Button> - {btnloading && <Spin size="large" />} </div> ) } -- Gitblit v1.8.0