Commit 7d71ecfe authored by xinzhedeai's avatar xinzhedeai

电子档案馆权限分配

parent 96d073d2
...@@ -15,14 +15,14 @@ export default { ...@@ -15,14 +15,14 @@ export default {
saveFolderAuth: (data) => { saveFolderAuth: (data) => {
return request({ return request({
url: 'api/document-catalogue', url: 'api/document-catalogue/distributionCatalogue',
method: 'post', method: 'post',
data data
}) })
}, },
/** /**
* 目录-文件 显示页面 * 目录-文件 显示页面
* @param {*} pageParam * @param {*} pageParam
...@@ -30,8 +30,23 @@ export default { ...@@ -30,8 +30,23 @@ export default {
*/ */
// 获取所有目录 // 获取所有目录
getDataList: (pageParam) => { getDataList: (pageParam) => {
return request({
// url: 'api/document-catalogue/all',
url: 'api/document-catalogue/tree',
method: 'get',
params: pageParam
})
},
/**
* 目录-文件 显示页面
* @param {*} pageParam
* @returns
*/
// 获取所有目录
getAllDocList: (pageParam) => {
return request({ return request({
url: 'api/document-catalogue/all', url: 'api/document-catalogue/all',
// url: 'api/document-catalogue/tree',
method: 'get', method: 'get',
params: pageParam params: pageParam
}) })
......
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
placeholder="用户名/昵称" placeholder="用户名/昵称"
style="width: 200px" style="width: 200px"
class="filter-item" class="filter-item"
@keyup.enter.native="crud.toQuery"
/> />
<el-button type="primary" size="mini">查询</el-button> <el-button type="primary" size="mini" @click="search">查询</el-button>
</div> </div>
<el-table <el-table
highlight-current-row highlight-current-row
...@@ -46,7 +45,7 @@ ...@@ -46,7 +45,7 @@
type="primary" type="primary"
size="mini" size="mini"
@click="saveFolderAuth" @click="saveFolderAuth"
:loading="menuLoading" :loading="saveAuthLoading"
>保存</el-button >保存</el-button
> >
</div> </div>
...@@ -69,35 +68,35 @@ ...@@ -69,35 +68,35 @@
circle circle
size="small" size="small"
style="margin-left: 40px" style="margin-left: 40px"
@click="data.editWhether = true" @click="changeAuth(data, 'viewWhether')"
></el-button> ></el-button>
<el-button <el-button
:type="`${data.editWhether ? 'primary' : 'default'}`" :type="`${data.editWhether ? 'primary' : 'default'}`"
icon="el-icon-edit" icon="el-icon-edit"
circle circle
size="small" size="small"
@click="data.editWhether = true" @click="changeAuth(data, 'editWhether')"
></el-button> ></el-button>
<el-button <el-button
:type="`${data.deleteWhether ? 'primary' : 'default'}`" :type="`${data.deleteWhether ? 'primary' : 'default'}`"
icon="el-icon-delete" icon="el-icon-delete"
circle circle
size="small" size="small"
@click="data.deleteWhether = true" @click="changeAuth(data, 'deleteWhether')"
></el-button> ></el-button>
<el-button <el-button
:type="`${data.uploadWhether ? 'primary' : 'default'}`" :type="`${data.uploadWhether ? 'primary' : 'default'}`"
icon="el-icon-upload2" icon="el-icon-upload2"
circle circle
size="small" size="small"
@click="data.uploadWhether = true" @click="changeAuth(data, 'uploadWhether')"
></el-button> ></el-button>
<el-button <el-button
:type="`${data.downloadWhether ? 'primary' : 'default'}`" :type="`${data.downloadWhether ? 'primary' : 'default'}`"
icon="el-icon-download" icon="el-icon-download"
circle circle
size="small" size="small"
@click="data.downloadWhether = true" @click="changeAuth(data, 'downloadWhether')"
></el-button> ></el-button>
</div> </div>
</div> </div>
...@@ -129,10 +128,11 @@ export default { ...@@ -129,10 +128,11 @@ export default {
defaultProps: { children: "children", label: "name", isLeaf: "leaf" }, defaultProps: { children: "children", label: "name", isLeaf: "leaf" },
currentUserId: 0, currentUserId: 0,
currentName: "", currentName: "",
menuLoading: false, saveAuthLoading: false,
showButton: false, showButton: false,
folders: [], folders: [],
menuIds: [], menuIds: [],
// tempAuthObj: {} // 操作权限数据集合
}; };
}, },
computed: {}, computed: {},
...@@ -141,6 +141,16 @@ export default { ...@@ -141,6 +141,16 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
search(){
this.getDataList4User()
},
changeAuth(data, attr) {
data[attr] = !data[attr];
// console.log('*****', data)
// deelete
// this.tempAuthObj[data.id] =
},
// 触发单选 // 触发单选
handleCurrentChange4table(val, oldVal) { handleCurrentChange4table(val, oldVal) {
if (val) { if (val) {
...@@ -163,24 +173,25 @@ export default { ...@@ -163,24 +173,25 @@ export default {
// 当前第几页 // 当前第几页
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;
this.getFolderByUserId(); this.getDataList4User();
}, },
getDataList4User() { getDataList4User() {
edocApi edocApi
.getDataList4User({ .getDataList4User({
page: this.page, page: this.page > 0 ? this.page - 1 : this.page,
size: this.size, size: this.size,
fluzz: this.query.fluzz, blurry: this.query.blurry,
}) })
.then((res) => { .then((res) => {
console.log("res", res); console.log("res", res);
this.dataList = res.content; this.dataList = res.content;
this.totalElement = res.totalElements;
}); });
}, },
getFolderByUserId() { getFolderByUserId() {
edocApi edocApi
.getDataList({ .getAllDocList({
userId: this.currentUserId, userId: this.currentUserId,
}) })
.then((res) => { .then((res) => {
...@@ -227,14 +238,17 @@ export default { ...@@ -227,14 +238,17 @@ export default {
}); });
edocApi edocApi
.saveFolderAuth({ .saveFolderAuth({
data: this.folders, userId: this.currentUserId,
// data: JSON.stringify(this.folders),
documentCatalogueVos: this.folders
}) })
.then(() => { .then(() => {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.menuLoading = false; this.saveAuthLoading = false;
}) })
.catch((err) => { .catch((err) => {
this.menuLoading = false; this.saveAuthLoading = false;
}); });
loading.close(); loading.close();
}, },
...@@ -255,4 +269,5 @@ export default { ...@@ -255,4 +269,5 @@ export default {
height: 36px; height: 36px;
} }
</style> </style>
de9l9l9l9l9l ;;;;;;;;;;;;;;;;;O
\ No newline at end of file <((O9l9l9l9l))
\ No newline at end of file
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