From f734aef979d27b2fabcb19426ef4576907e416b5 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Mon, 11 Apr 2022 11:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=99=9A=E6=8B=9F=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E7=BB=86=E8=8A=82=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../virtualList/components/batSetting.vue | 198 ++++++++++++++++++ .../components/virtualListDetails.vue | 112 +++++++++- 2 files changed, 302 insertions(+), 8 deletions(-) create mode 100644 jero-web/src/views/documentTools/virtualList/components/batSetting.vue diff --git a/jero-web/src/views/documentTools/virtualList/components/batSetting.vue b/jero-web/src/views/documentTools/virtualList/components/batSetting.vue new file mode 100644 index 000000000..a40d203ff --- /dev/null +++ b/jero-web/src/views/documentTools/virtualList/components/batSetting.vue @@ -0,0 +1,198 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue index 7e95f3371..36415e40b 100644 --- a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue +++ b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue @@ -3,7 +3,7 @@
- + {{this.title}} @@ -124,12 +124,24 @@
+
+ +
+ @@ -138,6 +150,8 @@ import addModel from './addModel' import editModel from './editModel' import UpdateLog from '@/components/UpdateLog/index' + import batSetting from './batSetting' + import { getAction, postAction, downloadFile } from '@/api/manage' export default { name: 'virtualListDetails', @@ -145,7 +159,8 @@ ImportFile, addModel, editModel, - UpdateLog + UpdateLog, + batSetting }, data() { return { @@ -307,7 +322,10 @@ } ], selectedRowKeys: [], - isTrue: false + isTrue: false, + total: 0, + pageSize: 10, + pageNo: 1 } }, mounted() { @@ -344,26 +362,99 @@ handleExport() { }, + //复制 copyClick() { + }, + pageOnChange(page, pageSize) { + this.pageNo = page + this.getList() + }, + SizeChange(page, pageSize) { + this.pageNo = 1 + this.pageSize = pageSize + this.getList() + }, + getList() { + let query = { + pageNo: this.pageNo, + pageSize: this.pageSize, + ...this.queryParam + } + this.loading = true + getAction(this.url.list, query).then((res) => { + if (res.success) { + if (res.result.current > 1 && res.result.records.length == 0) { + this.pageNo = res.result.current - 1 + this.getList() + return + } + this.dataSource = res.result.records || [] + this.total = res.result.total + this.loading = false + } else { + this.loading = false + } + }) }, batSettingClick() { - + if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { + this.$refs.batSettingRef.edit(JSON.parse(JSON.stringify(this.selectedRowKeys))) + } else { + this.$message.warning(this.$t('selectLeastOne')) + } }, handleAdd() { this.$refs.addModelRef.addModel() }, handleDel() { - this.$refs.editModelRef.editModel() + 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(_this.$t('operationFailed')) + } + }) + } + }) + } else { + this.$message.warning(this.$t('selectLeastOne')) + } }, onSelectChange(value) { this.selectedRowKeys = value }, - edit() { - + edit(item) { + this.$refs.editModelRef.editModel(JSON.parse(JSON.stringify(item))) }, deleteLib() { - + let _this = this + this.$confirm({ + content: _this.$t('ConfirmDelete'), + onOk() { + 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')) + } + }) + } + }) + }, + iconClick() { + this.$router.push({ + path: '/virtualList' + }) } } } @@ -497,6 +588,11 @@ white-space: nowrap; overflow: hidden; } + + .page { + text-align: right; + margin-top: 20px; + }