Selaa lähdekoodia

update AttachmentDialog

docs_0727
lb 1 vuosi sitten
vanhempi
commit
c193a18252
1 muutettua tiedostoa jossa 24 lisäystä ja 3 poistoa
  1. +24
    -3
      src/components/attachmentDialog.vue

+ 24
- 3
src/components/attachmentDialog.vue Näytä tiedosto

@@ -7,6 +7,9 @@
:visible.sync="visible">
<!-- upload -->
<div class="upload">
<!-- actionUrl() {
return window.SITE_CONFIG["apiURL"] + this.urls.importUrl;
}, -->
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
@@ -16,14 +19,14 @@
:on-success="handleSuccess"
multiple
:show-file-list="false">
<el-button size="small" type="primary" class='btn-upload'>上传</el-button>
<el-button size="small" type="primary" class="btn-upload">上传</el-button>
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
</el-upload>

<!-- filelist -->
<div class="filelist">
<el-row :gutter="20">
<el-col :span="6" v-for="file in fileList" :key="file.name">
<el-col :span="6" v-for="file in fileList" :key="file.name + Math.random()">
<div class="fileListItem">
<div class="filename">{{ file.name }}</div>
<div class="file-actions">
@@ -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) {},


Ladataan…
Peruuta
Tallenna