Commit 00ddc6aa authored by Kimber's avatar Kimber
parents 99d46dd4 2937edc9
import request from '@/utils/request' import request from '@/utils/request'
export default { export default {
/**
* 用户-文件夹 权限分配
*/
// 获取用户List
getDataList4User: (pageParam) => {
return request({
url: 'api/users',
method: 'get',
params: pageParam
})
},
saveFolderAuth: (data) => {
return request({
url: 'api/document-catalogue',
method: 'post',
data
})
},
/**
* 目录-文件 显示页面
* @param {*} pageParam
* @returns
*/
// 获取所有目录 // 获取所有目录
getDataList: (pageParam) => { getDataList: (pageParam) => {
return request({ return request({
...@@ -26,6 +53,7 @@ export default { ...@@ -26,6 +53,7 @@ export default {
}) })
}, },
// 修改文件夹名称: (iotNormalMachine) => { // 修改文件夹名称: (iotNormalMachine) => {
updateFolder: (data) => { updateFolder: (data) => {
return request({ return request({
url: 'api/document-catalogue', url: 'api/document-catalogue',
......
<template>
<div class="app-container">
<el-row :gutter="15">
<!-- 用户列表 -->
<el-col :span="10">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<el-input
v-model="query.blurry"
size="small"
clearable
placeholder="用户名/昵称"
style="width: 200px"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-button type="primary" size="mini">查询</el-button>
</div>
<el-table
ref="table"
style="width: 100%"
:data="dataList"
@current-change="handleCurrentChange4table"
>
<el-table-column prop="nickName" label="昵称" align="center" />
<el-table-column prop="username" label="用户名" align="center" />
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 30, 40]"
:page-size="size"
layout="total, sizes, prev, pager, next, jumper"
:total="totalElement"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card>
</el-col>
<!-- 文件夹授权 -->
<el-col :span="12" style="margin-bottom: 10px">
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<el-button
type="primary"
@click="saveFolderAuth"
:loading="menuLoading"
>保存</el-button
>
</div>
<el-tree
ref="menu"
:data="folders"
:props="defaultProps"
check-strictly
accordion
node-key="id"
default-expand-all
:expand-on-click-node="false"
>
<div class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
<el-button
:type="`${data.editWhether ? 'primary' : 'default'}`"
icon="el-icon-edit"
circle
size="mini"
style="margin-left: 40px"
@click="data.editWhether = true"
></el-button>
<el-button
:type="`${data.deleteWhether ? 'primary' : 'default'}`"
icon="el-icon-delete"
circle
size="mini"
@click="data.deleteWhether = true"
></el-button>
<el-button
:type="`${data.uploadWhether ? 'primary' : 'default'}`"
icon="el-icon-upload2"
circle
size="mini"
@click="data.uploadWhether = true"
></el-button>
<el-button
:type="`${data.downloadWhether ? 'primary' : 'default'}`"
icon="el-icon-download"
circle
size="mini"
@click="data.downloadWhether = true"
></el-button>
</div>
</el-tree>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import edocApi from "@/api/kd/edoc";
import DateRangePicker from "@/components/DateRangePicker";
export default {
name: "Folder",
components: {
DateRangePicker,
},
data() {
return {
query: {
blurry: "",
},
dataList: [],
totalElement: 0,
page: 0,
size: 10,
defaultProps: { children: "children", label: "name", isLeaf: "leaf" },
currentUserId: 0,
currentName: "",
menuLoading: false,
showButton: false,
folders: [],
menuIds: [],
};
},
computed: {},
mounted() {
this.getDataList4User(); // 获取所有文件夹
},
created() {},
methods: {
// 触发单选
handleCurrentChange4table(val, oldVal) {
if (val) {
const loading = this.$loading({
fullscreen: false,
text: "加载中...",
background: "transparent",
});
this.currentUserId = val.id
// this.dataList = [];
this.getFolderByUserId();
loading.close();
}
},
// 当前页的条数变化
handleSizeChange(val) {
this.size = val;
this.getDataList4User();
},
// 当前第几页
handleCurrentChange(val) {
this.page = val;
this.getFolderByUserId();
},
getDataList4User() {
edocApi
.getDataList4User({
page: this.page,
size: this.size,
fluzz: this.query.fluzz,
})
.then((res) => {
console.log("res", res);
this.dataList = res.content;
});
},
getFolderByUserId() {
edocApi.getDataList({
userId: this.currentUserId,
}).then((res) => {
this.folders = res.body;
});
// edocApi
// .getFolderByUserId({
// userId: this.currentUserId,
// })
// .then((res) => {
// this.folders = res.body;
// });
},
confirmFolder() {
if (!this.currentFolderId) {
this.$message.warning("请选择文件夹");
return;
}
this.$refs["folderForm"].validate((valid) => {
if (valid) {
edocApi
.addFolder({
...this.folderForm,
pid: this.currentFolderId,
})
.then((res) => {
this.$message.success("操作成功");
this.getDataList4User();
});
}
});
},
// 保存菜单
saveFolderAuth() {
if (!this.currentUserId) {
this.$message.warning("请选择用户");
return;
}
const loading = this.$loading({
fullscreen: false,
text: "处理中...",
background: "transparent",
});
edocApi
.saveFolderAuth({
data: this.folders,
})
.then(() => {
this.$message.success("操作成功");
this.menuLoading = false;
})
.catch((err) => {
this.menuLoading = false;
});
loading.close()
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
\ No newline at end of file
This diff is collapsed.
...@@ -135,28 +135,35 @@ ...@@ -135,28 +135,35 @@
v-model="employee.channel" v-model="employee.channel"
placeholder="通道(如:1.hd.live)" placeholder="通道(如:1.hd.live)"
type="text" type="text"
style="width: 200px" style="width: 150px"
:disabled="editState == 3" :disabled="editState == 3"
/> />
<el-input <el-input
v-model="employee.id" v-model="employee.id"
placeholder="萤石云ID(G67791073)" placeholder="萤石云ID(G67791073)"
type="text" type="text"
style="width: 200px" style="width: 150px"
:disabled="editState == 3" :disabled="editState == 3"
/> />
<el-input <el-input
v-model="employee.name" v-model="employee.name"
placeholder="名称" placeholder="名称"
type="text" type="text"
style="width: 200px" style="width: 150px"
:disabled="editState == 3"
/>
<el-input
v-model="employee.captcha"
placeholder="验证码"
type="text"
style="width: 150px"
:disabled="editState == 3" :disabled="editState == 3"
/> />
<el-input <el-input
v-model="employee.remark" v-model="employee.remark"
placeholder="备注" placeholder="备注"
type="text" type="text"
style="width: 200px" style="width: 150px"
:disabled="editState == 3" :disabled="editState == 3"
/> />
<el-button <el-button
...@@ -291,6 +298,7 @@ export default { ...@@ -291,6 +298,7 @@ export default {
id: "", id: "",
name: "", name: "",
remark: "", remark: "",
captcha: ''
}, },
], ],
}, },
...@@ -308,6 +316,7 @@ export default { ...@@ -308,6 +316,7 @@ export default {
id: "", id: "",
name: "", name: "",
remark: "", remark: "",
captcha: ''
}, },
], ],
}, // 上次正在新增时的内容,下次打开dialog1窗口时记录下来 }, // 上次正在新增时的内容,下次打开dialog1窗口时记录下来
...@@ -363,6 +372,7 @@ export default { ...@@ -363,6 +372,7 @@ export default {
id: "", id: "",
name: "", name: "",
remark: "", remark: "",
captcha: ''
}); });
}, },
deleteEmployee(index, eIndex) { deleteEmployee(index, eIndex) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment