update AttachmentDialog
This commit is contained in:
джерело
e12d6d161b
коміт
c193a18252
@ -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) {},
|
||||
|
Завантаження…
Посилання в новій задачі
Block a user