11
This commit is contained in:
@@ -3,8 +3,8 @@ ENV = 'development'
|
||||
|
||||
# EBTS/开发环境
|
||||
#VUE_APP_BASE_API = '/dev-api'
|
||||
#VUE_APP_BASE_API = 'http://localhost:8096/dev-api'
|
||||
VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'
|
||||
VUE_APP_BASE_API = 'http://localhost:8096/dev-api'
|
||||
#VUE_APP_BASE_API = 'http://sistapi.hchyun.cn/dev-api'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -72,3 +72,12 @@ export function getFolder(){
|
||||
})
|
||||
}
|
||||
|
||||
// 获取文件夹列表
|
||||
export function downLoadNav(data){
|
||||
return request({
|
||||
url:'/sist/file/downloadnav',
|
||||
method:'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="网站类型" prop="sitetype">
|
||||
<el-select v-model="queryParams.sitetype" placeholder="请选择文件类型" @change="siteTypeInit" size="small">
|
||||
<el-option
|
||||
v-for="dict in sitetypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> <el-form-item label="网站类型" prop="sitetype">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择文件类型" size="small">
|
||||
<el-option
|
||||
v-for="dict in initNavList"
|
||||
:key="dict.id"
|
||||
:label="dict.title"
|
||||
:value="dict.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input
|
||||
v-model="queryParams.fileName"
|
||||
@@ -10,15 +29,15 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" prop="fileAddr">
|
||||
<el-input
|
||||
v-model="queryParams.fileAddr"
|
||||
placeholder="请输入文件路径"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="文件路径" prop="fileAddr">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.fileAddr"-->
|
||||
<!-- placeholder="请输入文件路径"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item label="文件类型" prop="fileType">
|
||||
<el-select v-model="queryParams.fileType" placeholder="请选择文件类型" clearable size="small">
|
||||
<el-option
|
||||
@@ -29,16 +48,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否公开" prop="isPublic">
|
||||
<el-select v-model="queryParams.isPublic" placeholder="请选择是否公开" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in isPublicOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="是否公开" prop="isPublic">-->
|
||||
<!-- <el-select v-model="queryParams.isPublic" placeholder="请选择是否公开" clearable size="small">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in isPublicOptions"-->
|
||||
<!-- :key="dict.dictValue"-->
|
||||
<!-- :label="dict.dictLabel"-->
|
||||
<!-- :value="dict.dictValue"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!--</el-form-item>-->
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
@@ -123,7 +142,7 @@
|
||||
<el-table-column label="文件路径" align="center" prop="fileAddr"/>
|
||||
<el-table-column label="文件类型" align="center" prop="fileType"/>
|
||||
<el-table-column label="文件大小(MB)" align="center" prop="fileSize"/>
|
||||
<!--<el-table-column label="是否公开" align="center" prop="isPublic" :formatter="isPublicFormat"/>-->
|
||||
<el-table-column label="所属位置" align="center" prop="type" :formatter="isNavLabelFormat"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
||||
@@ -172,10 +191,35 @@
|
||||
/>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-dialog :title="addFile.title" :visible.sync="addFile.open" width="500px" append-to-body>
|
||||
<el-form ref="uploadFrom" :model="form" label-width="80px">
|
||||
|
||||
<el-form-item label="站点类型" prop="sitetype">
|
||||
<el-select v-model="form.sitetype" placeholder="请选择站点类型" @change="siteTypeChang(form.sitetype)" clearable
|
||||
size="small">
|
||||
<el-option
|
||||
v-for="dict in sitetypeOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级" prop="pid">
|
||||
<el-select
|
||||
v-model="form.type"
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择文章标签">
|
||||
<el-option
|
||||
v-for="item in navList"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件上传">
|
||||
<FileUpload v-model="addFile.url" @changeAddress="changeAddress"/>
|
||||
</el-form-item>
|
||||
@@ -187,7 +231,6 @@
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<el-dialog :title="fileForm.title" :visible.sync="fileForm.open" width="500px" append-to-body>
|
||||
<el-form ref="uploadFrom" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item v-show="isAdd" label="是否公开">
|
||||
@@ -234,7 +277,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listFile, getFile, delFile, addFile, updateFile, exportFile, getRoleAll, getFolder} from "@/api/sist/file";
|
||||
import {
|
||||
listFile,
|
||||
getFile,
|
||||
delFile,
|
||||
addFile,
|
||||
updateFile,
|
||||
exportFile,
|
||||
getRoleAll,
|
||||
getFolder,
|
||||
downLoadNav
|
||||
} from "@/api/sist/file";
|
||||
import {downloadFile} from '@/utils/fileUtils'
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
@@ -269,6 +322,8 @@ export default {
|
||||
url: "",
|
||||
open: false,
|
||||
},
|
||||
navList: [],
|
||||
initNavList:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -288,6 +343,8 @@ export default {
|
||||
title: "",
|
||||
isAdd: true,
|
||||
folderOptions: [],
|
||||
// 站点类型 1: sist 2: lab 3: 双边都发字典
|
||||
sitetypeOptions: [],
|
||||
// 文件类型(文件夹:folder,文件:file)字典
|
||||
fileTypeOptions: [],
|
||||
// 是否公开字典
|
||||
@@ -304,6 +361,7 @@ export default {
|
||||
fileAddr: null,
|
||||
fileType: null,
|
||||
isPublic: null,
|
||||
sitetype:"1",
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -316,18 +374,58 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.siteTypeInit(this.queryParams.sitetype)
|
||||
this.getList();
|
||||
this.getDicts("sys_fIle_type").then(response => {
|
||||
this.fileTypeOptions = response.data;
|
||||
});
|
||||
this.getDicts("article_site_type").then(response => {
|
||||
this.sitetypeOptions = response.data;
|
||||
});
|
||||
this.getDicts("sys_file_public").then(response => {
|
||||
this.isPublicOptions = response.data;
|
||||
});
|
||||
getFolder().then(res => {
|
||||
this.folderOptions = res.data
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
siteTypeInit(siteType) {
|
||||
let data = null
|
||||
if (siteType == 1) {
|
||||
data = {
|
||||
id: 72,
|
||||
sitetype: 1
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
id: 80,
|
||||
sitetype: 2
|
||||
}
|
||||
}
|
||||
downLoadNav(data).then(res => {
|
||||
this.initNavList = res.data
|
||||
})
|
||||
},
|
||||
|
||||
siteTypeChang(siteType) {
|
||||
let data = null
|
||||
if (siteType == 1) {
|
||||
data = {
|
||||
id: 72,
|
||||
sitetype: 1
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
id: 80,
|
||||
sitetype: 2
|
||||
}
|
||||
}
|
||||
downLoadNav(data).then(res => {
|
||||
this.navList = res.data
|
||||
})
|
||||
},
|
||||
/** 查询文件信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@@ -345,6 +443,17 @@ export default {
|
||||
this.form.fileAddr = ""
|
||||
this.fileForm.url = ""
|
||||
},
|
||||
/** 转换层级结构数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.name,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/**
|
||||
*是否公开值改变
|
||||
*/
|
||||
@@ -365,7 +474,6 @@ export default {
|
||||
this.addFile.title = "文件上传"
|
||||
this.addFile.open = true
|
||||
this.addFile.url = null
|
||||
|
||||
this.form = {
|
||||
fileId: null,
|
||||
pId: null,
|
||||
@@ -375,6 +483,7 @@ export default {
|
||||
fileAddr: null,
|
||||
fileType: null,
|
||||
isPublic: "1",
|
||||
sisetype: '1',
|
||||
};
|
||||
},
|
||||
// 文件类型字典翻译
|
||||
@@ -385,6 +494,28 @@ export default {
|
||||
isPublicFormat(row, column) {
|
||||
return this.selectDictLabel(this.isPublicOptions, row.isPublic);
|
||||
},
|
||||
// 是否公开字典翻译
|
||||
isNavLabelFormat(row, column) {
|
||||
return this.selectNavLabel(this.initNavList, row.type);
|
||||
},
|
||||
selectNavLabel(datas, value){
|
||||
console.log(datas,value)
|
||||
try {
|
||||
var actions = [];
|
||||
Object.keys(datas).some((key) => {
|
||||
if (datas[key].id == ('' + value)) {
|
||||
actions.push(datas[key].title);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
return actions.join('');
|
||||
}catch (e) {
|
||||
console.log(e)
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
addCancel() {
|
||||
this.addFile.open = false;
|
||||
},
|
||||
@@ -446,15 +577,15 @@ export default {
|
||||
this.open = true;
|
||||
this.title = "添加文件信息";
|
||||
},
|
||||
//changeArray() {
|
||||
changeArray() {
|
||||
// let roleIds = this.form.roleIds.split(",")
|
||||
// this.form.roleIds = []
|
||||
// for (let i = 0; i < roleIds.length; i++) {
|
||||
// this.form.roleIds[i] = parseInt(roleIds[i])
|
||||
// }
|
||||
//},
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
//handleUpdate(row) {
|
||||
handleUpdate(row) {
|
||||
// this.reset();
|
||||
// this.isAdd = false
|
||||
// this.isPublicShow = true
|
||||
@@ -465,18 +596,18 @@ export default {
|
||||
// this.fileForm.open = true;
|
||||
// this.fileForm.title = "修改文件信息";
|
||||
// });
|
||||
//},
|
||||
},
|
||||
|
||||
submitAddFile(){addFile(this.form).then(response => {
|
||||
submitAddFile() {
|
||||
addFile(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.addFile.open = false;
|
||||
//this.changeArray()
|
||||
this.getList();
|
||||
});
|
||||
|
||||
},
|
||||
/** 提交按钮 */
|
||||
//submitForm() {
|
||||
submitForm() {
|
||||
// this.$refs["uploadFrom"].validate(valid => {
|
||||
// if (valid) {
|
||||
// let roleIds = ""
|
||||
@@ -506,7 +637,7 @@ export default {
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//},
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const fileIds = row.fileId || this.ids;
|
||||
|
||||
Reference in New Issue
Block a user