From 5237d75a9c44b033c72120d41382a3906fd5cd1c Mon Sep 17 00:00:00 2001
From: lzhe <lzhe@example.com>
Date: 星期四, 02 五月 2024 22:24:46 +0800
Subject: [PATCH] 1
---
src/views/console/system/data-scope-manager.vue | 109 +++++++++++++++++++++---------------------------------
1 files changed, 43 insertions(+), 66 deletions(-)
diff --git a/src/views/console/system/data-scope-manager.vue b/src/views/console/system/data-scope-manager.vue
index 37ac3d9..7d49217 100644
--- a/src/views/console/system/data-scope-manager.vue
+++ b/src/views/console/system/data-scope-manager.vue
@@ -2,7 +2,7 @@
* @Author: lzhe lzhe@example.com
* @Date: 2024-03-26 10:28:33
* @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-04-17 18:02:12
+ * @LastEditTime: 2024-05-02 22:20:47
* @FilePath: /smart-web/src/views/master/person/main/index.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -10,10 +10,10 @@
<div class="dict-main">
<el-form :inline="true" :model="searchData" abel-width="120px">
<el-form-item label="鏉冮檺鍚嶇О">
- <el-input v-model="searchData.name" placeholder="鏉冮檺鍚嶇О" clearable />
+ <el-input v-model="searchData.deptName" placeholder="鏉冮檺鍚嶇О" clearable />
</el-form-item>
<el-form-item label="鏉冮檺鎻忚堪">
- <el-input v-model="searchData.code" placeholder="鏉冮檺鎻忚堪" clearable></el-input>
+ <el-input v-model="searchData.deptName" placeholder="鏉冮檺鎻忚堪" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchclick">鎼滅储</el-button>
@@ -22,26 +22,29 @@
</el-form>
<div>
<div style="margin-bottom: 12px;">
- <el-button type="primary">娣诲姞</el-button>
+ <el-button type="primary" @click="addData">娣诲姞</el-button>
<el-button type="danger" @click="delData">鍒犻櫎</el-button>
<el-button type="primary" @click="addAuthority">鏉冮檺璁剧疆</el-button>
</div>
<div class="dict-table">
<el-table ref="multipleTableRef" :data="tableData" border row-key="id" style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'has' }">
<el-table-column type="selection" width="55" />
- <el-table-column prop="test" label="鏉冮檺鍚嶇О"></el-table-column>
- <el-table-column prop="test" label="鏉冮檺鎻忚堪"></el-table-column>
- <el-table-column prop="test" label="鏉冮檺绫诲瀷"></el-table-column>
- <el-table-column prop="test" label="鎺掑簭"></el-table-column>
- <el-table-column fixed="right" label="鎿嶄綔">
+ <el-table-column prop="deptName" label="鏉冮檺鍚嶇О"></el-table-column>
+ <el-table-column prop="fullName" label="鏉冮檺鎻忚堪"></el-table-column>
+ <el-table-column prop="deptCategoryName" label="鏉冮檺绫诲瀷"></el-table-column>
+ <el-table-column prop="sort" label="鎺掑簭"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔" width="280">
<template #default="scope">
- <el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">鏉冮檺閰嶇疆</el-button>
+ <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">鏌ョ湅</el-button>
+ <el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">缂栬緫</el-button>
+ <el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">鍒犻櫎</el-button>
+ <el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">鏂板瀛愰」</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
- <save-dialog v-if="dialog.save" ref="saveDialog" :scopeTypeNameList="scopeTypeNameList" :tableRow="tableRow" @success="addDatascopeSuccess" @closed="dialog.save=false"></save-dialog>
+ <save-dialog v-if="dialog.save" ref="saveDialog" :deptCategoryList="deptCategoryList" :parentIdList ="parentIdList" @success="addDatascopeSuccess" @closed="dialog.save=false"></save-dialog>
</div>
</template>
<script>
@@ -77,46 +80,55 @@
size: 10
},
searchData: {
- name: "",
- code: "",
- belongApplication: "",
- parentId: ""
+ deptName: "",
+ fullName: "",
+ parentId: "0"
},
dialog: {
save: false,
allocation: false
},
tableData: [],
- drawerTableData: [],
rowId: "",
- tableRow: {}
+ tableRow: {},
+ parentIdList: [],
+ deptCategoryList: []
}
},
created(){
},
mounted(){
- this.getscopeTypeNameList();//瑙勫垯鍒嗙被鏋氫妇
this.searchBtn();
+ this.getDictionary();
+ this.getParentIdList();
},
components: {
...ElementPlusIconsVue,saveDialog
},
methods: {
- getscopeTypeNameList() { //瑙勫垯鍒嗙被鏋氫妇
- this.$HTTP.get("/api/blade-system/dict/dictionary?code=data_scope_type").then(res=> {
+ getParentIdList() {
+ this.$HTTP.get("/api/blade-system/data-scope-manager/tree").then(res=> {
if(res.code == 200) {
- this.scopeTypeNameList = res.data;
+ this.parentIdList = res.data;
+ }
+ })
+ },
+ getDictionary() {
+ this.$HTTP.get("/api/blade-system/dict/dictionary?code=data_scope_category").then(res=> {
+ if(res.code == 200) {
+ this.deptCategoryList = res.data;
}
})
},
addDatascopeSuccess() {
- this.drawerSearchclick();
+ this.searchclick();
},
+ //娣诲姞
addData(){
- this.dialog.save = true
+ this.dialog.save = true;
this.$nextTick(() => {
- this.$refs.saveDialog.open()
+ this.$refs.saveDialog.open();
})
},
addAuthority() {
@@ -143,7 +155,6 @@
this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+selStr).then(res=> {
if(res.code == 200) {
that.$message.success("鎿嶄綔鎴愬姛");
- that.drawerSearchclick();
}
})
},
@@ -173,17 +184,12 @@
this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+row.id).then(res=> {
if(res.code == 200) {
that.$message.success("鎿嶄綔鎴愬姛");
- that.drawerSearchclick();
}
})
}).catch(() => {
})
},
- handleClose(done) {
- this.drawerTableData = [];
- done();
- },
exportFile(row,index){
window.open(row.link);
},
@@ -192,9 +198,8 @@
},
searchClearBtn() {
this.searchData = {
- name: "",
- code: "",
- belongApplication: "",
+ deptName: "",
+ fullName: "",
parentId: ""
}
this.searchBtn();
@@ -202,33 +207,7 @@
showDrawer(row){
this.rowId = row.id;
this.tableRow = row; //鍚庨潰缁勪欢浼氱敤鍒�
- this.drawerSearchclick();
this.drawer = true;
- },
- drawerSearchclick() {
- var obj = {};
- for(var key in this.drawerSearchData) {
- if(this.drawerSearchData[key]) {
- obj[key] = this.drawerSearchData[key];
- }
- }
- obj.menuId = this.rowId;
- this.$HTTP.get("/api/blade-system/data-scope/list?"+this.$TOOL.qsStringify(obj)).then(res=> {
- if(res.code == 200) {
- this.drawerTableData = res.data.records;
- this.drawerTotal = res.data.total;
- }
- })
- },
- drawerSearchClearBtn() {
- this.drawerSearchData = {
- scopeName: "",
- resourceCode: "",
- menuId: this.rowId,
- current: 1,
- size: 10
- }
- this.drawerSearchclick();
},
searchclick() {
this.searchBtn();
@@ -240,11 +219,11 @@
obj[key] = this.searchData[key];
}
}
- // this.$HTTP.get("/api/blade-system/menu/lazy-menu-list",obj).then(res=> {
- // if(res.code == 200) {
- // this.tableData = res.data;
- // }
- // })
+ this.$HTTP.get("/api/blade-system/data-scope-manager/lazy-list?" + this.$TOOL.qsStringify(obj)).then(res=> {
+ if(res.code == 200) {
+ this.tableData = res.data;
+ }
+ })
},
handleSelectionChange(selection) {
this.selection = selection;
@@ -259,12 +238,10 @@
console.log(`姣忛〉 ${val} 鏉);
this.drawerSearchData.current = "1";
this.drawerSearchData.size = val;
- this.drawerSearchclick();
},
handleCurrentChange(val) {
console.log(`褰撳墠椤�: ${val}`);
this.drawerSearchData.current = val;
- this.drawerSearchclick();
}
}
}
--
Gitblit v1.9.3