From c193a18252a1b8726bcc9178126ffae1f8c6453c Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 10 Jul 2023 11:25:03 +0800 Subject: [PATCH] update AttachmentDialog --- src/components/attachmentDialog.vue | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/components/attachmentDialog.vue b/src/components/attachmentDialog.vue index 02dd60b..f2bce10 100644 --- a/src/components/attachmentDialog.vue +++ b/src/components/attachmentDialog.vue @@ -7,6 +7,9 @@ :visible.sync="visible">
+ - 上传 + 上传
- +
{{ file.name }}
@@ -47,16 +50,34 @@ export default { return { visible: false, fileList: [], + shapeId: null, + shapeInfo: null }; }, + inject: ["urls"], mounted() {}, methods: { - init() { + init(shapeId) { + this.shapeId = shapeId; + this.getFileList(); this.visible = true; }, close() { this.visible = false; }, + // requests + async getFileList() { + // get shape info + try { + this.shapeInfo = await this.$http.get(this.urls.base + `/${this.shapeId}`); + // extract filelist and save filelist seperately + this.fileList = this.shapeInfo.files; + // TODO.... + } catch (error) { + this.$message.error(error.msg); + } + }, + // operations handlePreview(file) {}, handleDownload(file) {},