|
@@ -12,7 +12,7 @@
|
|
|
<el-button type="primary" class="btn2" >查询</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-button type="primary" class="btn" size="mini">上传文件</el-button>
|
|
|
+ <el-button type="primary" class="btn" @click="selectFile" size="mini">上传文件</el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="projectBlock">
|
|
@@ -54,7 +54,7 @@
|
|
|
<template #default="scope">
|
|
|
<div class="operations">
|
|
|
<el-button type="primary" class="bt1" size="mini" >查看信息</el-button>
|
|
|
- <el-button type="primary" class="bt1" size="mini" @click="edit(scope,scope)" >删除</el-button>
|
|
|
+ <el-button type="primary" class="bt1" size="mini" @click="edit(scope.row)" >删除</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -76,7 +76,7 @@
|
|
|
options4:[],
|
|
|
tableData:[{
|
|
|
projectName:'创业孵化基地企业情况信息表',
|
|
|
- date:'2022年11月12日',
|
|
|
+ date:'2022年11月13日',
|
|
|
size:'50k'
|
|
|
},
|
|
|
{
|
|
@@ -95,9 +95,26 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- edit(){
|
|
|
-
|
|
|
+ edit(data){
|
|
|
+ this.tableData = this.tableData.filter(item=>item.date!=data.date);
|
|
|
},
|
|
|
+ selectFile(){
|
|
|
+ let input = document.createElement('input');
|
|
|
+ input.type='file';
|
|
|
+ input.accept='.doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.png, .jpg, .jpeg'
|
|
|
+ input.click();
|
|
|
+ input.addEventListener("change",()=>{
|
|
|
+ const fileLiu = input.files[0];
|
|
|
+ const NowDate = new Date();
|
|
|
+ let data = {
|
|
|
+ projectName:fileLiu.name,
|
|
|
+ size:Math.floor(fileLiu.size/1024/1024)+"MB",
|
|
|
+ date:`${NowDate.getFullYear()}年${NowDate.getMonth()+1}月${NowDate.getDate()}日`,
|
|
|
+ }
|
|
|
+ this.tableData.push(data);
|
|
|
+ input.remove();
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|