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/templates/comtableconfig/index.jsx | 69 +++++++++++++++++++++++++++++++++- 1 files changed, 66 insertions(+), 3 deletions(-) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index ad2b0f7..d50cd94 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -23,6 +23,7 @@ import GridBtnForm from '@/templates/tableshare/gridbtnform' import EditCard from '@/templates/tableshare/editcard' import VerifyCard from '@/templates/tableshare/verifycard' +import VerifyCardExcelIn from '@/templates/tableshare/verifycardexcelin' import MenuForm from '@/templates/tableshare/menuform' import TabDragElement from '@/templates/tableshare/tabdragelement' import SourceElement from '@/templates/tableshare/dragelement/source' @@ -185,7 +186,8 @@ componentDidMount () { let param = { func: 'sPC_Get_SelectedList', - LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0', + // LText: 'select TbName ,Remark from sDataDictionary where IsKey!=\'\' and Deleted =0', + LText: 'select TbName,Remark from (select TbName,Remark from sDataDictb where appkey= @appkey@ and Deleted=0 union select a.TbName,Remark from (select TbName,Remark from sDataDictb where appkey= \'\' and Deleted=0 ) a left join (select TbName from sDataDictb where appkey= @appkey@ and Deleted=0 ) b on a.TbName=b.TbName where b.TbName is null ) t', obj_name: 'data', arr_field: 'TbName,Remark' } @@ -1282,6 +1284,53 @@ const { card } = this.state let config = JSON.parse(JSON.stringify(this.state.config)) let _verify = this.verifyRef.state.verify + + if (card.OpenType !== 'excelIn') { + if (_verify.default === 'false' && _verify.scripts.length === 0) { + notification.warning({ + top: 92, + message: '涓嶆墽琛岄粯璁ql鏃讹紝蹇呴』璁剧疆鑷畾涔夎剼鏈紒', + duration: 10 + }) + return + } + } else if (card.OpenType === 'excelIn') { + let cols = _verify.columns.map(col => col.Column) + cols = Array.from(new Set(cols)) + + if (!_verify.sheet) { + notification.warning({ + top: 92, + message: '璇疯缃鍏ヨ〃鍚�!', + duration: 10 + }) + return + } else if (_verify.columns.length === 0) { + notification.warning({ + top: 92, + message: '璇疯缃瓻xcel鍒楀瓧娈�!', + duration: 10 + }) + return + } else if (_verify.columns.length > cols.length) { + notification.warning({ + top: 92, + message: 'Excel鍒楀瓧娈靛悕锛屼笉鍙噸澶�!', + duration: 10 + }) + return + } else if (_verify.range === 1) { + let tEmptys = _verify.columns.filter(op => !op.Text) + if (tEmptys.length > 0) { + notification.warning({ + top: 92, + message: '蹇界暐棣栬鏃讹紝浼氫娇鐢═ext鍊兼牎楠孍xcel棣栬鍐呭锛孴ext鍊间笌Excel琛ㄩ琛屽唴瀹圭浉鍚岋紝涓斿潎涓嶅彲涓虹┖锛�', + duration: 10 + }) + return + } + } + } config.action = config.action.map(item => { if (item.uuid === card.uuid) { @@ -2495,7 +2544,7 @@ <Modal title={modaltype === 'actionEdit' ? this.state.dict['header.modal.action.edit'] : this.state.dict['header.modal.action.copy']} visible={modaltype === 'actionEdit' || modaltype === 'actionCopy'} - width={700} + width={800} onCancel={this.editModalCancel} footer={[ modaltype === 'actionEdit' ? <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.funcLoading}>{this.state.dict['header.menu.func.create']}</Button> : null, @@ -2612,7 +2661,21 @@ onCancel={() => { this.setState({ profileVisible: false }) }} destroyOnClose > - <VerifyCard card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} /> + {this.state.card && this.state.card.OpenType !== 'excelIn' ? + <VerifyCard + card={this.state.card} + dict={this.state.dict} + columns={this.state.config.columns} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> : null + } + {this.state.card && this.state.card.OpenType === 'excelIn' ? + <VerifyCardExcelIn + card={this.state.card} + dict={this.state.dict} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> : null + } </Modal> {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */} <Modal -- Gitblit v1.8.0