完成文件管理3.0系统 文件上传功能 还差属性及删除功能 还有权限分配
This commit is contained in:
parent
b9323bc1ad
commit
74c55a05d9
|
@ -23,9 +23,9 @@
|
|||
<!-- </div>-->
|
||||
<el-button icon="el-icon-arrow-up" @click="back2Up" style="margin-right: 10px" plain ></el-button>
|
||||
|
||||
<el-input :placeholder=path style="height: 40px" disabled></el-input>
|
||||
<el-input :placeholder=path style="height: 40px;width: 600px" disabled></el-input>
|
||||
<!-- 输入框 双向绑定数据 自带清空 -->
|
||||
<el-button style="margin-left: 10px" type="primary" @click="dialogVisible = true">上传文件</el-button>
|
||||
<el-button style="margin-left: 10px" key=1 type="primary" @click="dialogVisible = true" :disabled="!(fileLevel>1)">上传文件</el-button>
|
||||
<!-- <el-button style="margin-left: 10px" type="primary" @click="typeDialogVisible = true" plain>添加分类</el-button>-->
|
||||
|
||||
<!-- <span style="margin-left: 10px">当前文件分类:{{ activeFileType }}</span>-->
|
||||
|
@ -37,32 +37,15 @@
|
|||
description="局域网暂不支持在线访问,请下载查看"
|
||||
style="margin-bottom: 10px;font-size: 20px">
|
||||
</el-alert>
|
||||
|
||||
<!--上传文件-->
|
||||
<el-dialog
|
||||
title="上传文件"
|
||||
:visible.sync="dialogVisible"
|
||||
width="50%"
|
||||
custom-class="mkdirDialog"
|
||||
:before-close="handleClose">
|
||||
<el-form label-position="top" label-width="80px" :model="filesInfo" :rules="rules" style="text-align: left">
|
||||
<el-form-item label="文件名" prop="name">
|
||||
<el-input placeholder="请填写文件名" v-model="filesInfo.name"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="文件分类" prop="fileTypeId">
|
||||
<el-select v-model="filesInfo.filesTypeId" placeholder="请选择文件分类">
|
||||
<el-option v-for="item in filesTypeList"
|
||||
:key="item.filesTypeId"
|
||||
:label="item.name"
|
||||
:value="String(item.filesTypeId)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="文件状态" prop="status">
|
||||
<el-select v-model="filesInfo.status" placeholder="请选择文件状态">
|
||||
<el-option label="待更新" value="待更新"></el-option>
|
||||
<el-option label="已更新" value="已更新"></el-option>
|
||||
<el-option label="已废弃" value="已废弃"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
@ -72,7 +55,10 @@
|
|||
drag
|
||||
ref="fileUpload"
|
||||
:headers="headers"
|
||||
action="/api/file/uploadFile"
|
||||
:data="data={
|
||||
'path':path
|
||||
}"
|
||||
action="/api/file/uploadFileV2"
|
||||
:on-success="uploadSuccess"
|
||||
:limit="1">
|
||||
|
||||
|
@ -231,6 +217,7 @@ export default {
|
|||
loading:true,
|
||||
// 文件目录
|
||||
path:'/',
|
||||
|
||||
// 文件层级
|
||||
fileLevel:0,
|
||||
//文件列表
|
||||
|
@ -238,6 +225,9 @@ export default {
|
|||
],
|
||||
//新建文件夹名称
|
||||
mkdirName:'新建文件夹',
|
||||
|
||||
|
||||
|
||||
//判断是否已经有showInfo
|
||||
showInfoStatus:false,
|
||||
|
||||
|
@ -420,13 +410,16 @@ export default {
|
|||
this.$refs[formName].resetFields();
|
||||
},
|
||||
|
||||
//上传文件本身成功调用,信息未上传
|
||||
//上传已生效
|
||||
uploadSuccess(response, file, fileList){
|
||||
if (response.status == 0) {
|
||||
Message.success("上传成功")
|
||||
//此时会有一个返回的生成随机ID 暂不需要 如之后做成果库可以升级
|
||||
this.filesInfo.location = response.url
|
||||
this.filesInfo.name = file.name
|
||||
|
||||
// this.filesInfo.location = response.url
|
||||
// this.filesInfo.name = file.name
|
||||
this.dialogVisible = false
|
||||
this.$refs.fileUpload.clearFiles()
|
||||
this.getFilesDirMeta()
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue