1.路径逻辑修改2.文件上传修改

This commit is contained in:
zhujiyan
2024-09-02 20:22:27 +08:00
parent 4b38b96c3f
commit 573244aac2

View File

@@ -27,21 +27,49 @@
></el-input> ></el-input>
<el-button type="primary" @click="handleSearch">搜索</el-button> <el-button type="primary" @click="handleSearch">搜索</el-button>
<el-button @click="handleRefresh">重置</el-button> <el-button @click="handleRefresh">重置</el-button>
<el-upload
action=""
:auto-upload="false"
:show-file-list="false"
:on-change="
(file:any, fileList:any) => {
handleUpload(file, fileList, activePath)
}
"
>
<el-button>
文件上传<el-icon class="el-icon--right"><Upload /></el-icon>
</el-button>
</el-upload>
</div> </div>
<div class="list" v-if="dirList.length != 0 && !loading"> <div class="list" v-if="dirList.length != 0 && !loading">
<!-- <div class="list_upload">
<el-upload
action=""
:auto-upload="false"
:on-change="
(file:any, fileList:any) => {
handleUpload(file, fileList, activePath)
}
"
>
<el-button>
文件上传<el-icon class="el-icon--right"><Upload /></el-icon>
</el-button>
</el-upload>
</div> -->
<div class="list_item" v-for="(item, index) in dirList" :key="index"> <div class="list_item" v-for="(item, index) in dirList" :key="index">
<div class="item_download"> <div class="item_download">
<el-button v-if="item?.type == 'file'" size="small" @click="handleDownLoad(item)" circle> <el-button v-if="item?.type == 'file'" size="small" @click="handleDownLoad(item)" circle>
<el-icon><Download /></el-icon> <el-icon><Download /></el-icon>
</el-button> </el-button>
</div> </div>
<div class="item_upload"> <!-- <div class="item_upload">
<el-upload <el-upload
v-if="item?.type == 'dir'" v-if="item?.type == 'dir'"
style="display: inline-block" style="display: inline-block"
action="" action=""
class="upload-demo" class="upload-demo"
:show-file-list="true"
:auto-upload="false" :auto-upload="false"
:on-change=" :on-change="
(file:any, fileList:any) => { (file:any, fileList:any) => {
@@ -53,7 +81,7 @@
<el-icon><Upload /></el-icon> <el-icon><Upload /></el-icon>
</el-button> </el-button>
</el-upload> </el-upload>
</div> </div> -->
<img v-if="item?.type == 'dir'" @click="handleIntoDir(item)" src="@/assets/img/wenjianjia.svg" /> <img v-if="item?.type == 'dir'" @click="handleIntoDir(item)" src="@/assets/img/wenjianjia.svg" />
<img <img
class="img_file" class="img_file"
@@ -221,7 +249,7 @@ const handleUpload = (e: any, fileList: any, row: any) => {
const obj = { const obj = {
id: nDid.value, id: nDid.value,
file: e.raw, file: e.raw,
filePath: row.prjDataPath filePath: row|| row.prjDataPath
} }
uploadDeviceFile(obj).then(res => { uploadDeviceFile(obj).then(res => {
console.log(res, '上传文件毁掉') console.log(res, '上传文件毁掉')
@@ -297,6 +325,14 @@ watch(
height: 100%; height: 100%;
padding-bottom: 200px; padding-bottom: 200px;
z-index: 100; z-index: 100;
position: relative;
.list_upload {
position: absolute;
width: 100px;
height: 40px;
right: 20px;
top: 10px;
}
.list_item { .list_item {
flex: none; flex: none;
width: 23.3%; width: 23.3%;