|
|
@ -12,13 +12,14 @@ |
|
|
|
<!-- <el-button type="primary" icon="el-icon-edit" @click="rmdirm">删除目录</el-button> |
|
|
|
<!-- <el-button type="primary" icon="el-icon-edit" @click="rmdirm">删除目录</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-edit">重命名</el-button> --> |
|
|
|
<el-button type="primary" icon="el-icon-edit">重命名</el-button> --> |
|
|
|
<el-button type="primary" @click="uploadDrawer = true">上传<i class="el-icon-upload el-icon--right"></i></el-button> |
|
|
|
<el-button type="primary" @click="uploadDrawer = true">上传<i class="el-icon-upload el-icon--right"></i></el-button> |
|
|
|
|
|
|
|
<el-button type="primary" @click="getFileData" icon="el-icon-refresh-right">刷新</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-on:click.stop="fileTableMClick"> |
|
|
|
<div v-on:click.stop="fileTableMClick"> |
|
|
|
<!-- 子目录数据列表 如果不需要显示空数据提示,可以用css隐藏--> |
|
|
|
<!-- 子目录数据列表 如果不需要显示空数据提示,可以用css隐藏--> |
|
|
|
<el-table |
|
|
|
<el-table |
|
|
|
:data="dirdata" |
|
|
|
:data="dirdata" |
|
|
|
empty-text="暂无文件夹数据" |
|
|
|
empty-text="无文件夹数据" |
|
|
|
:row-style="{'background-color':'#fffdfa'}" |
|
|
|
:row-style="{'background-color':'#fffdfa'}" |
|
|
|
style="width:100%;" class="filesmd"> |
|
|
|
style="width:100%;" class="filesmd"> |
|
|
|
<!-- <el-table-column |
|
|
|
<!-- <el-table-column |
|
|
@ -40,7 +41,8 @@ |
|
|
|
<div class="type_file_click"> |
|
|
|
<div class="type_file_click"> |
|
|
|
<a title="点击进入子文件夹" :href="'#/filemange/subfile?id='+scope.row.id"> |
|
|
|
<a title="点击进入子文件夹" :href="'#/filemange/subfile?id='+scope.row.id"> |
|
|
|
<!-- <el-button type="warning" icon="el-icon-notebook-1">{{scope.row.name}}</el-button> --> |
|
|
|
<!-- <el-button type="warning" icon="el-icon-notebook-1">{{scope.row.name}}</el-button> --> |
|
|
|
<img src="../../common/img/file.png" alt="图片"/> |
|
|
|
<!-- <img src="../../common/img/file.png" alt="图片"/> --> |
|
|
|
|
|
|
|
<svg class="fileicon" style="width: 5.15234375em;height: 5em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1180 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4701"><path d="M1099.433546 289.842983h-1.08787v-99.462424a128.679511 128.679511 0 0 0-93.246023-126.65918v-3.263611A60.454505 60.454505 0 0 0 944.023508 0.003264H729.246837A60.454505 60.454505 0 0 0 668.326102 59.836128H122.526051A126.65918 126.65918 0 0 0 0.062941 190.380559V890.502778a12.277393 12.277393 0 0 0 2.331151 6.216401v1.243281c0 72.110257 46.623011 126.03754 113.760147 126.03754H969.821575c67.603366 0 105.212595-68.225006 122.463109-130.544431L1174.652004 419.610365c18.182974-75.063048-7.459682-129.767381-75.218458-129.767382z m-897.337556 0a160.072339 160.072339 0 0 0-132.253942 78.637479v-124.32803a73.198128 73.198128 0 0 1 46.623011-54.859743H668.326102a60.609915 60.609915 0 0 1 60.454505-59.988274h215.242901a60.609915 60.609915 0 0 1 60.454505 60.609914v3.108201a126.50377 126.50377 0 0 1 90.604052 97.908324z" fill="#FFE680" p-id="4702"></path></svg> |
|
|
|
</a> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -67,7 +69,7 @@ |
|
|
|
<!-- 文件数据列表 --> |
|
|
|
<!-- 文件数据列表 --> |
|
|
|
<el-table |
|
|
|
<el-table |
|
|
|
:show-header="false" |
|
|
|
:show-header="false" |
|
|
|
empty-text="暂无文件数据" |
|
|
|
empty-text="无文件数据" |
|
|
|
:data="tableData" |
|
|
|
:data="tableData" |
|
|
|
style="width:100%;"> |
|
|
|
style="width:100%;"> |
|
|
|
|
|
|
|
|
|
|
@ -198,7 +200,7 @@ |
|
|
|
<div class="request_main"> |
|
|
|
<div class="request_main"> |
|
|
|
<el-button type="success" :loading="uploadLoad" @click="handleRequest()">开始上传<i class="el-icon-upload el-icon--right"></i></el-button> |
|
|
|
<el-button type="success" :loading="uploadLoad" @click="handleRequest()">开始上传<i class="el-icon-upload el-icon--right"></i></el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="el-upload__tip">目前只能上传{{supportedFileTypes}}文件,且不超过{{maxUploadFileSize/1024/1024}}MB</div> |
|
|
|
<div class="el-upload__tip">目前只能上传{{supportedFileTypes}}文件,且单个文件不超过{{maxUploadFileSize/1024/1024}}MB</div> |
|
|
|
<el-dialog :modal="false" :visible.sync="dialogVisible"> |
|
|
|
<el-dialog :modal="false" :visible.sync="dialogVisible"> |
|
|
|
<img width="100%" :src="dialogImageUrl" alt="图片"> |
|
|
|
<img width="100%" :src="dialogImageUrl" alt="图片"> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
@ -244,7 +246,8 @@ export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
// 环境变量 |
|
|
|
// 环境变量 |
|
|
|
imgurl:process.env.VUE_APP_IMG_URL, |
|
|
|
//imgurl:process.env.VUE_APP_IMG_URL, |
|
|
|
|
|
|
|
imgurl:'https://demo.jialuoma.com', |
|
|
|
|
|
|
|
|
|
|
|
loadingText: '文件获取中...', |
|
|
|
loadingText: '文件获取中...', |
|
|
|
|
|
|
|
|
|
|
@ -456,7 +459,8 @@ export default { |
|
|
|
let Progress = progressEvent => { |
|
|
|
let Progress = progressEvent => { |
|
|
|
//progressEvent.loaded:已上传文件大小 |
|
|
|
//progressEvent.loaded:已上传文件大小 |
|
|
|
//progressEvent.total:被上传文件的总大小 |
|
|
|
//progressEvent.total:被上传文件的总大小 |
|
|
|
let num = progressEvent.loaded / progressEvent.total * 100 | 0; //百分比 |
|
|
|
//let num = progressEvent.loaded / progressEvent.total * 100 | 0; //百分比 |
|
|
|
|
|
|
|
let num = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2)) |
|
|
|
//console.log(num); |
|
|
|
//console.log(num); |
|
|
|
files.onProgress({percent: num}) //进度条 |
|
|
|
files.onProgress({percent: num}) //进度条 |
|
|
|
} |
|
|
|
} |
|
|
@ -466,20 +470,23 @@ export default { |
|
|
|
let datamain = response.data; |
|
|
|
let datamain = response.data; |
|
|
|
if (datamain.code == 1) { |
|
|
|
if (datamain.code == 1) { |
|
|
|
//console.log(datamain); |
|
|
|
//console.log(datamain); |
|
|
|
this.$message({showClose: true,message: datamain.msg, type:'success'}); |
|
|
|
//this.$message({showClose: true,message: datamain.msg, type:'success'}); |
|
|
|
files.onSuccess(); //上传成功(打钩的小图标) |
|
|
|
files.onSuccess(); //上传成功(打钩的小图标) |
|
|
|
|
|
|
|
|
|
|
|
this.uploadCount++; //如果全部上传完成则刷新数据 |
|
|
|
this.uploadCount++; //如果全部上传完成则刷新数据 |
|
|
|
//console.log(this.uploadCount); |
|
|
|
console.log(this.uploadCount); |
|
|
|
if (this.uploadCount == this.uploadFilelist.length) { |
|
|
|
if (this.uploadCount == this.uploadFilelist.length) { |
|
|
|
this.uploadDrawer = false; |
|
|
|
this.uploadDrawer = false; |
|
|
|
this.uploadFilelist = []; |
|
|
|
this.uploadFilelist = []; |
|
|
|
this.uploadCount = 0; |
|
|
|
this.uploadCount = 0; |
|
|
|
this.getFileData(); |
|
|
|
this.getFileData(); |
|
|
|
|
|
|
|
this.loadingText = '新增上传文件中...' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.uploadLoad = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.uploadLoad = false; |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
requesterr(this, error); |
|
|
|
requesterr(this, error); |
|
|
|
this.uploadLoad = false; |
|
|
|
this.uploadLoad = false; |
|
|
@ -502,14 +509,17 @@ export default { |
|
|
|
can.id = menusindex.split('?id=')[1] |
|
|
|
can.id = menusindex.split('?id=')[1] |
|
|
|
} |
|
|
|
} |
|
|
|
let thiss = this; |
|
|
|
let thiss = this; |
|
|
|
this.subloading = true; |
|
|
|
|
|
|
|
|
|
|
|
this.dirdata = [] |
|
|
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
|
|
this.loadingText = '获取文件中...' |
|
|
|
|
|
|
|
this.subloading = true |
|
|
|
mirlist(can).then(response => { |
|
|
|
mirlist(can).then(response => { |
|
|
|
let datamain = response.data; |
|
|
|
let datamain = response.data; |
|
|
|
let maindata = datamain.data.dirTree; |
|
|
|
let maindata = datamain.data.dirTree; |
|
|
|
if (datamain.code == 1) { |
|
|
|
if (datamain.code == 1) { |
|
|
|
//console.log(maindata.directories.length); |
|
|
|
//console.log(maindata.directories.length); |
|
|
|
this.dirdata = [] |
|
|
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
|
|
if (maindata.directories) { |
|
|
|
if (maindata.directories) { |
|
|
|
this.dirdata = this.forObjectData(maindata.directories); |
|
|
|
this.dirdata = this.forObjectData(maindata.directories); |
|
|
|
} |
|
|
|
} |
|
|
@ -602,6 +612,7 @@ export default { |
|
|
|
rmdirm() { |
|
|
|
rmdirm() { |
|
|
|
let thiss = this; |
|
|
|
let thiss = this; |
|
|
|
this.subloading = true; |
|
|
|
this.subloading = true; |
|
|
|
|
|
|
|
this.loadingText = '删除文件夹中...' |
|
|
|
//console.log(this.rmdirform); |
|
|
|
//console.log(this.rmdirform); |
|
|
|
rmdirs(this.rmdirform).then(response => { |
|
|
|
rmdirs(this.rmdirform).then(response => { |
|
|
|
let datamain = response.data; |
|
|
|
let datamain = response.data; |
|
|
@ -609,7 +620,6 @@ export default { |
|
|
|
if (datamain.code == 1) { |
|
|
|
if (datamain.code == 1) { |
|
|
|
|
|
|
|
|
|
|
|
EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 |
|
|
|
EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 |
|
|
|
this.loadingText = '删除文件夹中...' |
|
|
|
|
|
|
|
this.getFileData(); |
|
|
|
this.getFileData(); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
//this.subloading = false; |
|
|
|
//this.subloading = false; |
|
|
@ -627,13 +637,13 @@ export default { |
|
|
|
// 删除文件 |
|
|
|
// 删除文件 |
|
|
|
rmfile() { |
|
|
|
rmfile() { |
|
|
|
let thiss = this; |
|
|
|
let thiss = this; |
|
|
|
|
|
|
|
this.loadingText = '文件删除中...' |
|
|
|
this.subloading = true; |
|
|
|
this.subloading = true; |
|
|
|
//console.log(this.rmfileform); |
|
|
|
//console.log(this.rmfileform); |
|
|
|
deletefile(this.rmfileform).then(response => { |
|
|
|
deletefile(this.rmfileform).then(response => { |
|
|
|
let datamain = response.data; |
|
|
|
let datamain = response.data; |
|
|
|
if (datamain.code == 1) { |
|
|
|
if (datamain.code == 1) { |
|
|
|
|
|
|
|
|
|
|
|
this.loadingText = '文件删除中...' |
|
|
|
|
|
|
|
this.getFileData(); |
|
|
|
this.getFileData(); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
//this.subloading = false; |
|
|
|
//this.subloading = false; |
|
|
@ -641,7 +651,7 @@ export default { |
|
|
|
thiss.$message({showClose: true,message: datamain.err,type: 'error'}); |
|
|
|
thiss.$message({showClose: true,message: datamain.err,type: 'error'}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.subloading = false; |
|
|
|
//this.subloading = false; |
|
|
|
|
|
|
|
|
|
|
|
//this.dirbox = false; |
|
|
|
//this.dirbox = false; |
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
@ -691,13 +701,13 @@ export default { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
let thiss = this; |
|
|
|
let thiss = this; |
|
|
|
|
|
|
|
this.loadingText = '文件移动中...' |
|
|
|
this.subloading = true; |
|
|
|
this.subloading = true; |
|
|
|
//console.log(this.rmfileform); |
|
|
|
//console.log(this.rmfileform); |
|
|
|
movefiledir(this.movefileform).then(response => { |
|
|
|
movefiledir(this.movefileform).then(response => { |
|
|
|
let datamain = response.data; |
|
|
|
let datamain = response.data; |
|
|
|
if (datamain.code == 1) { |
|
|
|
if (datamain.code == 1) { |
|
|
|
EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 |
|
|
|
EventBus.$emit('mkdirSuccess'); //触发菜单栏刷新 |
|
|
|
this.loadingText = '文件移动中...' |
|
|
|
|
|
|
|
this.getFileData(); |
|
|
|
this.getFileData(); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
thiss.$message({showClose: true,message: datamain.msg,type: 'success'}); |
|
|
|
//this.subloading = false; |
|
|
|
//this.subloading = false; |
|
|
|