diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 23869551a..fa166a0a9 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1708,6 +1708,6 @@ module.exports = { vehicleshavenotcompletedonlineupgrade:'The reason why some vehicles have not completed online upgrade', cause:'cause', implementationrecords:'Fault handling measures and emergency response implementation records', - + onlyDataWithListStatusDraftCanBeDeleted:'Only data with a list status of Draft can be deleted', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index ff7ca4844..fd9000355 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1808,4 +1808,5 @@ module.exports = { vehicleshavenotcompletedonlineupgrade:'部分车辆未完在线升级的原因', cause:'原因', implementationrecords:'故障处置措施和应急响应实施记录', + onlyDataWithListStatusDraftCanBeDeleted:'只能删除清单状态为草稿的数据', } \ No newline at end of file diff --git a/jero-web/src/views/documentTools/virtualList/index.vue b/jero-web/src/views/documentTools/virtualList/index.vue index c2ebf8edc..cad27a2b7 100644 --- a/jero-web/src/views/documentTools/virtualList/index.vue +++ b/jero-web/src/views/documentTools/virtualList/index.vue @@ -55,7 +55,7 @@ :loading="loading" :pagination="false" :scroll="{x: '100%'}" - rowKey="id" + :rowKey="(record)=>JSON.stringify(record)" :data-source="dataSource" @change="tableOnChange" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" @@ -69,13 +69,13 @@ {{$t('edit')}} - + {{record.state == 2 ? $t('release') : $t('withdraw')}} - + {{$t('maintenanceList')}} @@ -84,7 +84,7 @@ :disabled="record.state == 2?true:false" @click="subscribe(record)"> {{!record.readFlag || record.readFlag == 0 ? $t('subscribe') :$t('CancelSubscribe')}} - + {{$t('deleteLib')}} @@ -248,7 +248,7 @@ } ], queryParam: {}, - administrators:false, + administrators: false, orderBy: '1', orderByField: '' } @@ -282,7 +282,12 @@ setCreatorClick() { if (this.selectedRowKeys.length > 0) { let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) - this.$refs.setCreatorRef.getPush(selectedRowKeys.join(',')) + let idList = [] + for (let i = 0; i < selectedRowKeys.length; i++) { + selectedRowKeys[i] = JSON.parse(selectedRowKeys[i]) + idList.push(selectedRowKeys[i].id) + } + this.$refs.setCreatorRef.getPush(idList.join(',')) } else { this.$message.warning(this.$t('PleaseSelectData')) } @@ -300,21 +305,37 @@ handleDel() { if (this.selectedRowKeys.length > 0) { let _this = this - this.$confirm({ - content: _this.$t('ConfirmBatchDeletion'), - onOk() { - let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys)) - getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => { - if (res.success) { - _this.$message.success(_this.$t('OperationSuccessful')) - _this.selectedRowKeys = [] - _this.getList() - } else { - _this.$message.warning(res.message) - } - }) + let idList = [] + let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) + let isTrue + for (let i = 0; i < selectedRowKeys.length; i++) { + selectedRowKeys[i] = JSON.parse(selectedRowKeys[i]) + if (selectedRowKeys[i].state == 1) { + isTrue = false + break + } else { + isTrue = true + idList.push(selectedRowKeys[i].id) } - }) + } + if (isTrue) { + this.$confirm({ + content: _this.$t('ConfirmBatchDeletion'), + onOk() { + getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.selectedRowKeys = [] + _this.getList() + } else { + _this.$message.warning(res.message) + } + }) + } + }) + } else { + this.$message.warning(this.$t('onlyDataWithListStatusDraftCanBeDeleted')) + } } else { this.$message.warning(this.$t('selectLeastOne')) } diff --git a/jero-web/src/views/virtualAuthenticationList/index.vue b/jero-web/src/views/virtualAuthenticationList/index.vue index 4765a055d..44e465822 100644 --- a/jero-web/src/views/virtualAuthenticationList/index.vue +++ b/jero-web/src/views/virtualAuthenticationList/index.vue @@ -280,6 +280,7 @@ let _this = this let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys)) let isTrue + let idList = [] for (let i = 0; i < selectedRowKeys.length; i++) { selectedRowKeys[i] = JSON.parse(selectedRowKeys[i]) if (selectedRowKeys[i].state == 1) { @@ -287,13 +288,13 @@ break } else { isTrue = true + idList.push(selectedRowKeys[i].id) } } if (isTrue){ this.$confirm({ content: _this.$t('ConfirmBatchDeletion'), onOk() { - let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys)) deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) @@ -306,7 +307,7 @@ } }) }else{ - this.$message.warning(this.$t('')) + this.$message.warning(this.$t('onlyDataWithListStatusDraftCanBeDeleted')) } } else { this.$message.warning(this.$t('selectLeastOne')) diff --git a/jero-web/src/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance.vue b/jero-web/src/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance.vue index 95301d8a7..5b4fc7b9e 100644 --- a/jero-web/src/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance.vue +++ b/jero-web/src/views/virtualAuthenticationList/virtualAuthenticationListDesign/certificationListMaintenance.vue @@ -103,6 +103,7 @@