From 2cfde1e1235f9e0eed9a33c8f9af9b6c5e67e912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Mon, 24 Feb 2025 13:10:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=B7=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assetsManagement/officialAccount.vue | 119 +++++++++++++++++- 1 file changed, 116 insertions(+), 3 deletions(-) diff --git a/src/views/auditPages/assetsManagement/officialAccount.vue b/src/views/auditPages/assetsManagement/officialAccount.vue index 5127757..414c502 100644 --- a/src/views/auditPages/assetsManagement/officialAccount.vue +++ b/src/views/auditPages/assetsManagement/officialAccount.vue @@ -14,11 +14,21 @@ /> @@ -147,6 +162,46 @@ :limit.sync="formInline.size" @pagination="getList" /> + + + + +
将文件拖到此处,或点击上传
+
+ + 仅允许导入xls、xlsx格式文件。 + 下载模板 +
+
+ +
@@ -204,6 +259,30 @@ export default { this.getDeptTree(); }, methods: { + // 删除 + handleDel(id) { + this.$modal + .confirm('是否确认删除用户编号为"' + id + '"的数据项?') + .then(function () { + return deleteAssetOfficialAccount(id); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("删除成功"); + }) + .catch(() => {}); + }, + + // 导出 + handleExport() { + this.download( + "/tc/assetOfficialAccount/export", + { + ...this.formInline, + }, + `公众号资产${new Date().getTime()}.xlsx` + ); + }, // 修改table背景色 tableRowClassName({ row, rowIndex }) { if (rowIndex % 2 !== 0) { @@ -265,6 +344,40 @@ export default { this.tableData = res.data.records; }); }, + // 导入 + handleImport() { + this.upload.open = true; + }, + /** 下载模板操作 */ + importTemplate() { + this.download( + "/tc/assetOfficialAccount/importTemplate", + {}, + `公众号资产导入模板${new Date().getTime()}.xlsx` + ); + }, + // 文件上传中处理 + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 文件上传成功处理 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert( + "
" + + response.msg + + "
", + "导入结果", + { dangerouslyUseHTMLString: true } + ); + this.getList(); + }, + // 提交上传文件 + submitFileForm() { + this.$refs.upload.submit(); + }, }, };