From c7a5064fbaf012d5ceeec11e90523b4d91ff7099 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Mon, 11 Apr 2022 09:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E8=99=9A=E6=8B=9F=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 2 +- jero-web/src/common/lang/zh-cn.js | 2 +- .../views/documentTools/virtualList/index.vue | 138 ++++++++++++------ 3 files changed, 99 insertions(+), 43 deletions(-) diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index a845c99a0..faeba1e69 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -638,5 +638,5 @@ module.exports = { China:'China', onlyOnefileUploaded:'only one file can be uploaded', typeCannotUploaded:'this type of file cannot be uploaded', - + confirmWithdraw:'confirm Withdraw', } \ 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 e0b705733..e825ebe70 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -642,6 +642,6 @@ module.exports = { China:'中国', onlyOnefileUploaded:'只能上传一个文件', typeCannotUploaded:'不支持上传该类型的文件', - + confirmWithdraw:'确认撤回?', } \ 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 ee2ec362d..6294354d4 100644 --- a/jero-web/src/views/documentTools/virtualList/index.vue +++ b/jero-web/src/views/documentTools/virtualList/index.vue @@ -95,10 +95,10 @@ * {{$t('VirtualListName')}} - + + v-model="formInline.name" + :placeholder="$t('PleaseEnter')+$t('VirtualListName')"/> @@ -110,7 +110,7 @@ + v-model="formInline.useExplain" :rows="4"/> @@ -136,7 +136,13 @@ loading: false, selectedRowKeys: [], formInline: {}, - rules: {}, + rules: { + name: [{ + required: true, + message: this.$t('VirtualListName') + this.$t('cannotEmpty'), + trigger: 'blur' + }] + }, visible: false, dataSource: [], confirmLoading: false, @@ -144,7 +150,8 @@ list: '/dummy/dummyInventoryBaseEO/page', add: '/dummy/dummyInventoryBaseEO/add', edit: '/dummy/dummyInventoryBaseEO/edit', - deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch' + deleteBatch: '/dummy/dummyInventoryBaseEO/deleteBatch', + urlWithdraw: ''//撤回 }, total: 0, pageSize: 10, @@ -160,7 +167,7 @@ { title: this.$t('listStatus'), align: 'center', - dataIndex: 'state' + dataIndex: 'state_dictText' }, { title: this.$t('creater'), @@ -171,7 +178,7 @@ title: this.$t('operation'), align: 'center', fixed: 'right', - width: 200, + width: 400, scopedSlots: { customRender: 'operation' } } ], @@ -204,6 +211,7 @@ if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) _this.selectedRowKeys = [] + _this.getList() } else { _this.$message.warning(_this.$t('operationFailed')) } @@ -217,20 +225,61 @@ //编辑 edit(item) { this.title = '编辑' - this.formInline = item + this.formInline = JSON.parse(JSON.stringify(item)) this.visible = true }, //撤回 - withdraw() { - + withdraw(item) { + let _this = this + this.$confirm({ + content: _this.$t('confirmWithdraw'), + onOk() { + getAction(_this.url.urlWithdraw, { id: item.id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(_this.$t('operationFailed')) + } + }) + } + }) }, //维护清单 - maintenanceList() { - + maintenanceList(item) { + let newUrl = this.$router.resolve({ + path: '/virtualListDetails', + query: { + name: item.name, + useExplain: item.useExplain, + id: item.id, + isTrue: false + } + }) + window.open(newUrl.href, '_blank') }, //订阅 - subscribe() { - + subscribe(val) { + let _this = this + this.$confirm({ + content: val.subscribeFlag == 0 || !val.subscribeFlag ? _this.$t('ConfirmSubscribe') : _this.$t('cancelConfirmSubscribe'), + onOk() { + let url = '' + if (val.subscribeFlag == 0 || !val.subscribeFlag) { + url = 'document/bussDocumentLibraryEO/addSubscribe' + } else { + url = 'document/bussDocumentLibraryEO/cancelSubscribe' + } + getAction(url, { id: val.id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(_this.$t('operationFailed')) + } + }) + } + }) }, //删除 deleteLib(val) { @@ -238,15 +287,13 @@ this.$confirm({ content: _this.$t('ConfirmDelete'), onOk() { - _this.verifyBind(val.id, () => { - getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { - if (res.success) { - _this.$message.success(_this.$t('OperationSuccessful')) - _this.getList() - } else { - _this.$message.warning(_this.$t('operationFailed')) - } - }) + getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(_this.$t('operationFailed')) + } }) } }) @@ -255,7 +302,12 @@ VirtualListNameClick(item) { let newUrl = this.$router.resolve({ path: '/virtualListDetails', - query: {} + query: { + name: item.name, + useExplain: item.useExplain, + id: item.id, + isTrue: true + } }) window.open(newUrl.href, '_blank') }, @@ -303,22 +355,26 @@ this.visible = false }, handleSubmit() { - let url = '' - if (this.queryParam.id) { - url = this.url.edit - } else { - url = this.url.add - } - this.confirmLoading = true - postAction(url, this.queryParam).then((res) => { - if (res.success) { - this.confirmLoading = false - this.$message.success(this.$t('OperationSuccessful')) - this.visible = false - this.getList() - } else { - this.$message.warning(this.$t('operationFailed')) - this.confirmLoading = false + this.$refs.ruleForm.validate(valid => { + if (valid) { + let url = '' + if (this.formInline.id) { + url = this.url.edit + } else { + url = this.url.add + } + this.confirmLoading = true + postAction(url, this.formInline).then((res) => { + if (res.success) { + this.confirmLoading = false + this.$message.success(this.$t('OperationSuccessful')) + this.visible = false + this.getList() + } else { + this.$message.warning(this.$t('operationFailed')) + this.confirmLoading = false + } + }) } }) }