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) {},