Commit ae19d4e585b775358fbd7845044fe51054f0afb4
1 parent
5b5b0650
1.plc参数映射列表增加导入文本功能
Showing
2 changed files
with
56 additions
and
2 deletions
src/components/Common/ToolBar/ToolBarNew.js
| @@ -2541,7 +2541,7 @@ class ToolBarComponent extends Component { | @@ -2541,7 +2541,7 @@ class ToolBarComponent extends Component { | ||
| 2541 | boxVisible: true, | 2541 | boxVisible: true, |
| 2542 | makeUpPDFRecord, | 2542 | makeUpPDFRecord, |
| 2543 | title: config.showName, | 2543 | title: config.showName, |
| 2544 | - | 2544 | + |
| 2545 | onCancel: () => { | 2545 | onCancel: () => { |
| 2546 | this.setState({ BtnBoxData: null, makeUpPDFRecord: undefined }); | 2546 | this.setState({ BtnBoxData: null, makeUpPDFRecord: undefined }); |
| 2547 | this.props.onSaveState({ | 2547 | this.props.onSaveState({ |
| @@ -2580,7 +2580,7 @@ class ToolBarComponent extends Component { | @@ -2580,7 +2580,7 @@ class ToolBarComponent extends Component { | ||
| 2580 | }); | 2580 | }); |
| 2581 | } else if (this.props.onButtonClick !== undefined) { | 2581 | } else if (this.props.onButtonClick !== undefined) { |
| 2582 | this.props.onButtonClick(key); | 2582 | this.props.onButtonClick(key); |
| 2583 | - } | 2583 | + } |
| 2584 | }; | 2584 | }; |
| 2585 | 2585 | ||
| 2586 | // 删除当前pane | 2586 | // 删除当前pane |
| @@ -3891,6 +3891,34 @@ class ToolBarComponent extends Component { | @@ -3891,6 +3891,34 @@ class ToolBarComponent extends Component { | ||
| 3891 | } | 3891 | } |
| 3892 | }; | 3892 | }; |
| 3893 | 3893 | ||
| 3894 | + | ||
| 3895 | + /* 通用上传各种文件 */ | ||
| 3896 | + handleUploadFilesChange = info => { | ||
| 3897 | + const { file,} = info; | ||
| 3898 | + if (file.response && file.response.code === 1) { | ||
| 3899 | + /* 刷新列表 */ | ||
| 3900 | + message.open({ | ||
| 3901 | + type: 'success', | ||
| 3902 | + content: '文件上传成功', | ||
| 3903 | + duration: 1 | ||
| 3904 | + }); | ||
| 3905 | + this.handleRefresh(); | ||
| 3906 | + }else if (file.response && file.response.code === -8) { | ||
| 3907 | + Modal.info({ | ||
| 3908 | + title: '温馨提示:', | ||
| 3909 | + content: ( | ||
| 3910 | + <div> | ||
| 3911 | + {this.handleGetMsg(file.response.msg)} | ||
| 3912 | + </div> | ||
| 3913 | + ), | ||
| 3914 | + okText: '确认', | ||
| 3915 | + onOk() {}, | ||
| 3916 | + }); | ||
| 3917 | + } else if (file.response && file.response.code === -1) { | ||
| 3918 | + message.error(file.response.msg); | ||
| 3919 | + } | ||
| 3920 | + }; | ||
| 3921 | + | ||
| 3894 | customRequest = option => { | 3922 | customRequest = option => { |
| 3895 | const { onSuccess, onError, file, action, data = {} } = option; | 3923 | const { onSuccess, onError, file, action, data = {} } = option; |
| 3896 | // 添加额外的参数 | 3924 | // 添加额外的参数 |
| @@ -4255,6 +4283,18 @@ class ToolBarComponent extends Component { | @@ -4255,6 +4283,18 @@ class ToolBarComponent extends Component { | ||
| 4255 | disabled: !this.props.enabled, | 4283 | disabled: !this.props.enabled, |
| 4256 | // beforeUpload: this.handleBeforeUpload, | 4284 | // beforeUpload: this.handleBeforeUpload, |
| 4257 | }; | 4285 | }; |
| 4286 | + const sBrandsId = userinfo?.sBrandsId; | ||
| 4287 | + const sSubsidiaryId = userinfo?.sSubsidiaryId; | ||
| 4288 | + /* 上传文件 */ | ||
| 4289 | + const uploadFilesProps = { | ||
| 4290 | + action: `${commonConfig.file_host}file/uploadMachinePlc?sModelsId=${sModelsId}&&sBrandsId=${sBrandsId}&sSubsidiaryId=${sSubsidiaryId}&token=${app.token}`, | ||
| 4291 | + onChange: this.handleUploadFilesChange, | ||
| 4292 | + accept: '*/*', | ||
| 4293 | + showUploadList: false, | ||
| 4294 | + disabled: false, | ||
| 4295 | + multiple:true, | ||
| 4296 | + // beforeUpload: this.handleBeforeUpload, | ||
| 4297 | + }; | ||
| 4258 | 4298 | ||
| 4259 | /* 发票上传 */ | 4299 | /* 发票上传 */ |
| 4260 | let invoiceBody = {}; | 4300 | let invoiceBody = {}; |
| @@ -4524,6 +4564,14 @@ class ToolBarComponent extends Component { | @@ -4524,6 +4564,14 @@ class ToolBarComponent extends Component { | ||
| 4524 | <span style={{ color: this.props.enabled ? "#fff" : "#a2a2a2" }}>{showNameNew}</span> | 4564 | <span style={{ color: this.props.enabled ? "#fff" : "#a2a2a2" }}>{showNameNew}</span> |
| 4525 | </Upload> | 4565 | </Upload> |
| 4526 | </div> | 4566 | </div> |
| 4567 | + ): commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.indexOf("BtnImportFile") > -1 ? ( | ||
| 4568 | + <div> | ||
| 4569 | + <Upload {...uploadFilesProps}> | ||
| 4570 | + <a className={styles.uploadlink} style={{ color: "#ffffff"}}> | ||
| 4571 | + <UploadOutlined fill="#fff"/> {showNameNew} | ||
| 4572 | + </a> | ||
| 4573 | + </Upload> | ||
| 4574 | + </div> | ||
| 4527 | ) : commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.indexOf("BtnDlPbOrder") > -1 ? ( | 4575 | ) : commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.indexOf("BtnDlPbOrder") > -1 ? ( |
| 4528 | <div className={styles.toolBarUpload}> | 4576 | <div className={styles.toolBarUpload}> |
| 4529 | <a {...this.getDisabledProps("BtnDlPbOrder")} onClick={() => this.handleBtnDownload()}> | 4577 | <a {...this.getDisabledProps("BtnDlPbOrder")} onClick={() => this.handleBtnDownload()}> |
src/components/Common/ToolBar/index.less
| @@ -45,6 +45,12 @@ | @@ -45,6 +45,12 @@ | ||
| 45 | fill: @disable_color!important; | 45 | fill: @disable_color!important; |
| 46 | stroke: @disable_color!important; | 46 | stroke: @disable_color!important; |
| 47 | } | 47 | } |
| 48 | + .uploadlink{ | ||
| 49 | + color: #ffffff; | ||
| 50 | + } | ||
| 51 | + .uploadlink:hover{ | ||
| 52 | + color:#1890FF!important; | ||
| 53 | + } | ||
| 48 | } | 54 | } |
| 49 | 55 | ||
| 50 | .xlyProcess { | 56 | .xlyProcess { |