|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: ql
|
|
|
* @Date: 2022-01-11 14:46:04
|
|
|
- * @LastEditTime: 2022-01-24 19:30:09
|
|
|
+ * @LastEditTime: 2022-01-25 12:08:13
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @FilePath: \adm-frontend\src\components\cadDrawingManage\index.vue
|
|
|
-->
|
|
@@ -36,7 +36,7 @@
|
|
|
:http-request='uploadHandle'
|
|
|
:before-upload="beforeUpload"
|
|
|
:show-file-list="false">
|
|
|
- <Button style="max-width: 220px" slot="trigger" type="primary" icon="el-icon-download">上传.dwg CAD文件</Button>
|
|
|
+ <Button style="max-width: 220px" slot="trigger" type="primary" icon="el-icon-download" @click="resetUpload">上传.dwg CAD文件</Button>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
|
|
@@ -135,7 +135,7 @@ export default {
|
|
|
floorId: '', //当前楼层
|
|
|
buildingId: '', //当前建筑
|
|
|
tableLoading: false,
|
|
|
- fileList: [], //已选择文件
|
|
|
+ // fileList: [], //已选择文件
|
|
|
// 基础表格表头列表
|
|
|
headList: [
|
|
|
{
|
|
@@ -158,7 +158,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState('uploadFile', ['successList', 'uploadVisible', 'errorList'])
|
|
|
+ ...mapState('uploadFile', ['successList', 'uploadVisible', 'errorList', 'fileList'])
|
|
|
},
|
|
|
filters: {
|
|
|
timeFormat(timestr) {
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations('uploadFile', ['updata']),
|
|
|
+ ...mapMutations('uploadFile', ['updata', 'resetData']),
|
|
|
// 获取楼层信息
|
|
|
async getCascader() {
|
|
|
let param = {
|
|
@@ -204,7 +204,8 @@ export default {
|
|
|
this.tableLoading = false
|
|
|
},
|
|
|
async uploadHandle(option) {
|
|
|
- const isHas = this.fileList.find(item => option.file.name === item.name);
|
|
|
+ // console.log({option})
|
|
|
+ // const isHas = this.fileList.find(item => option.file.name === item.name);
|
|
|
// if(isHas) {
|
|
|
// this.$message.closeAll();
|
|
|
// this.$message({ type: 'error', message: '当前文件已存在,请重新选择' });
|
|
@@ -214,17 +215,23 @@ export default {
|
|
|
fileName: option.file.name,
|
|
|
file: option.file
|
|
|
}
|
|
|
- this.fileList.push(file);
|
|
|
- this.updata({uploadVisible: true, fileList: this.fileList})
|
|
|
+
|
|
|
+ // this.fileList.push(file);
|
|
|
+ const fileList = [...this.fileList, file]
|
|
|
+ this.updata({uploadVisible: true, fileList})
|
|
|
|
|
|
|
|
|
},
|
|
|
beforeUpload(file) {
|
|
|
- if(this.uploadVisible) {
|
|
|
- return false
|
|
|
- }
|
|
|
+ // if(this.uploadVisible) {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
+ // 重置弹框
|
|
|
+ resetUpload() {
|
|
|
+ this.resetData()
|
|
|
+ },
|
|
|
|
|
|
delHandle(row) {
|
|
|
const id = row.id
|