角色权限功能新增、新增用户级别、学历、职务下拉修改。

This commit is contained in:
hyt 2024-04-07 10:31:09 +08:00
parent 6594e53ec5
commit 216989412f
12 changed files with 661 additions and 676 deletions

View File

@ -71,10 +71,10 @@ const formRow = [{
tag: 'elRadio', tag: 'elRadio',
options: [{ options: [{
label: '是', label: '是',
value: "1" value: "0"
},{ },{
label: '否', label: '否',
value: "0", value: "1",
} }
] ]
}, },

View File

@ -13,24 +13,20 @@ const fucDataJson = [{
// 表头配置 // 表头配置
const tableColumnJson = [ const tableColumnJson = [
{ {
label: '角色编码', label: '角色编号',
prop: 'r_RoleCode', prop: 'roleCode',
tooltip: true, tooltip: true,
// sortable:true sortable: true,
}, },
{ {
label: '角色名称', label: '角色名称',
prop: 'r_RoleName', prop: 'roleName',
tooltip: true,
},
{
label: '顺序',
prop: 'r_Sort',
tooltip: true, tooltip: true,
sortable: true,
}, },
{ {
label: '角色描述 ', label: '角色描述 ',
prop: 'r_Description', prop: 'description',
tooltip: true, tooltip: true,
}, },
] ]

View File

@ -89,6 +89,7 @@ export default {
}) })
}, },
async init() { async init() {
return
let data = []; let data = [];
const res = await GetAllBilldata({}); const res = await GetAllBilldata({});
if (res.code == 1) { if (res.code == 1) {

View File

@ -59,6 +59,7 @@ import {
GetAllBilldata, GetAllBilldata,
PopedomSaveData, PopedomSaveData,
} from "@/api/apis/jurisdiction"; } from "@/api/apis/jurisdiction";
import { authApi } from '@/api/apis/auth'
export default { export default {
name: "review", name: "review",
components: { components: {
@ -95,8 +96,8 @@ export default {
}, },
], ],
pageModel: { pageModel: {
page: 1, pageNum: 1,
limit: 20, pageSize: 20,
departmentID: "", departmentID: "",
Sequence: "", Sequence: "",
SequenceName: "", SequenceName: "",
@ -139,7 +140,7 @@ export default {
onShow() { }, onShow() { },
mounted() { mounted() {
this.initPage(); this.initPage();
this.getMenuData(); // this.getMenuData();
}, },
filters: {}, filters: {},
methods: { methods: {
@ -183,16 +184,17 @@ export default {
// //
initPage() { initPage() {
this.getTableList(); this.getTableList();
this.getOrganList(); // this.getOrganList();
this.$refs.userCustomtable.clearRadioIndex(); this.$refs.userCustomtable.clearRadioIndex();
}, },
// //
async getMenuData() { async getMenuData() {
let res = await GetMenuButton({}); // let res = await GetMenuButton({});
if (res.code == 1) { let res = await authApi('sysMenuConfigService', '', 'queryEntityTree', '', { state: 0 })
let arr = JSON.parse(res.data[0]); if (res.status == 200) {
this.menuData = JSON.parse(res.data[0]); let arr = res.attribute
this.changeMenu(this.menuData, 0); this.menuData = res.attribute
this.changeMenu(this.menuData, 0)
// this.getButtonArray(this.menuData) // this.getButtonArray(this.menuData)
} }
}, },
@ -216,13 +218,14 @@ export default {
let params = { let params = {
...this.pageModel, ...this.pageModel,
}; };
let res = await RoleGetBillList(params); const res = await authApi("sysRoleService","","queryEntityPage","",params)
if (res.code === 1) { if (res.status == 200) {
this.tableData = res.data[1]; console.log(res,'res')
this.tableData = res.attribute.list;
this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.customtable.clearRadioIndex() // this.$refs.customtable.clearRadioIndex()
this.$refs.userLayout.setPageTotal(res.data[0]); this.$refs.userLayout.setPageTotal(res.attribute.total);
}); });
this.tabLoading = false; this.tabLoading = false;
} }
@ -244,7 +247,7 @@ export default {
// //
userRadioChange(val) { userRadioChange(val) {
this.radioIndex = val.index; this.radioIndex = val.index;
this.userRadioId = val.r_RoleID; this.userRadioId = val.id;
}, },
// //
async getOrganList() { async getOrganList() {
@ -266,7 +269,7 @@ export default {
}, },
resetTable() { resetTable() {
this.pageModel.page = 1; this.pageModel.pageNum = 1;
this.userRadioId = false; this.userRadioId = false;
this.radioIndex = false; this.radioIndex = false;
this.$nextTick(() => { this.$nextTick(() => {
@ -283,35 +286,23 @@ export default {
} }
this[btnEven.btnFunciton](); this[btnEven.btnFunciton]();
}, },
//
async setting() { async setting() {
this.getMenuData(); this.getMenuData()
this.permissionPopup = true
this.permissionPopup = true; this.$nextTick(async() => {
this.$nextTick(() => { this.$refs.rightDialog.drawer = true
this.$refs.rightDialog.drawer = true; this.$refs.rightDialog.buttonLoading = true
this.$refs.rightDialog.buttonLoading = true;
let params = { let params = {
objectID: this.userRadioId, id: this.userRadioId,
kindid: 2, kindId: 2
};
GetPppedomSet(params).then((res) => {
if (res.code == 1) {
const data = res.data;
let menuIDs =
data[0].length > 0 ? data[0][0].fp_MenuIdList.split(",") : [];
let echo = data[1].length > 0 ? data[1] : [];
this.$refs.rightDialog.exhibitList(menuIDs, echo, this.userRadioId);
let dataPermissions = data[2].length > 0 ? data[2] : [];
this.$refs.rightDialog.$refs.dataPermissions.selectedList =
dataPermissions;
this.$refs.rightDialog.$refs.layOutPermissions.selectedList = res
.data[3][0]
? res.data[3][0].widgetList
: "";
// this.menuData = this.addToButtonList(this.menuData,echo)
} }
}); const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
}); if (res.status == 200) {
const data = res.attribute
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
}
})
}, },
// setting() { // setting() {
// if (this.radioIndex === false) { // if (this.radioIndex === false) {
@ -325,7 +316,7 @@ export default {
async GetPppedomData() { async GetPppedomData() {
let params = { let params = {
objectID: this.userRadioId, objectID: this.userRadioId,
kindid: 2, kindId: 2,
}; };
let res = await GetPppedomSet(params); let res = await GetPppedomSet(params);
if (res.code == 1) { if (res.code == 1) {
@ -360,8 +351,8 @@ export default {
return array; return array;
}, },
pageChange(model) { pageChange(model) {
this.pageModel.page = model.page; this.pageModel.pageNum = model.page;
this.pageModel.limit = model.limit; this.pageModel.pageSize = model.limit;
this.getTableList(); this.getTableList();
}, },
settingConfirmClick() { settingConfirmClick() {

View File

@ -18,11 +18,8 @@
font-size: 25px; font-size: 25px;
margin-right: 7px; margin-right: 7px;
" "
v-show=" v-show="btnShowHandle(homeList,true)"
scope.row.dataList.length != 0 && @click="cancellation(homeList)"
scope.row.dataList.length == scope.row.buttonList.length
"
@click="cancellation(scope.row)"
></i> ></i>
<i <i
class="el-icon-star-on" class="el-icon-star-on"
@ -33,20 +30,10 @@
margin-right: 7px; margin-right: 7px;
color: #808080; color: #808080;
" "
v-show=" v-show="btnShowHandle(homeList,false)"
scope.row.dataList.length != 0 && @click="selectAllButton(homeList)"
scope.row.dataList.length != scope.row.buttonList.length
"
@click="selectAllButton(scope.row)"
></i> ></i>
<el-checkbox-group v-model="scope.row.buttonList" size="small"> <el-checkbox v-model="item.check" v-for="item in homeList">{{ item.name }}</el-checkbox>
<el-checkbox
v-for="item in scope.row.dataList"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -54,63 +41,81 @@
</template> </template>
<script> <script>
import config from "@/views/doraChunk/config/indexChunkConfig.js"; import config from '@/views/doraChunk/config/indexChunkConfig.js'
import { mapMutations } from "vuex"; import { mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
tableData: [ tableData: [
{ {
billName: "首页拖拽模块", billName: '首页拖拽模块',
dataList: config.config.map((item) => { dataList: config.config.map((item) => {
let obj = { let obj = {
id: item.componentName, id: item.componentName,
name: item.name, name: item.name
}; }
return obj; return obj
}), }),
buttonList: [], buttonList: []
},
}
], ],
selectedList: "", selectedList: '',
}; homeList: []
}
}, },
created() {}, created() {
},
components: {}, components: {},
computed: {}, computed: {},
mounted() {}, mounted() {
},
beforeUpdate() { beforeUpdate() {
this.handleTabClick(); this.handleTabClick()
}, },
methods: { methods: {
//
btnShowHandle(list, flag = false) {
if (!list.length) return false
let flagResult = list.every(item => {
return item.check
})
if (flag) {
return flagResult
} else {
return !flagResult
}
},
selectAllButton(item) { selectAllButton(item) {
let data = []; console.log(item)
item.dataList.forEach((el) => { item.forEach(item => {
data.push(el.id); item.check = true
}); })
item.buttonList = data;
}, },
cancellation(item) { cancellation(item) {
item.buttonList = []; item.forEach(item => {
item.check = false
})
}, },
handleTabClick() { handleTabClick() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout(); this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
}); })
}, }
}, },
watch: { watch: {
selectedList(newV, oldV) { selectedList(newV, oldV) {
let tempArr = newV.split(","); let tempArr = newV.split(',')
this.tableData[0].buttonList = tempArr; this.tableData[0].buttonList = tempArr
}, }
}, }
}; }
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@ -38,6 +38,7 @@
></el-table-column> ></el-table-column>
<el-table-column prop="buttonSelection" label="按钮"> <el-table-column prop="buttonSelection" label="按钮">
<template slot-scope="scope"> <template slot-scope="scope">
<div style="display: flex;align-items: center">
<i <i
class="el-icon-star-on" class="el-icon-star-on"
style=" style="
@ -45,12 +46,10 @@
line-height: 30px; line-height: 30px;
font-size: 25px; font-size: 25px;
margin-right: 7px; margin-right: 7px;
cursor: pointer;
" "
v-show=" v-show="btnShowHandle(scope.row.buttonList,true)"
scope.row.buttons.length != 0 && @click="cancellation(scope.row.buttonList)"
scope.row.buttons.length == scope.row.buttonList.length
"
@click="cancellation(scope.row)"
></i> ></i>
<i <i
class="el-icon-star-on" class="el-icon-star-on"
@ -60,24 +59,19 @@
font-size: 25px; font-size: 25px;
margin-right: 7px; margin-right: 7px;
color: #808080; color: #808080;
cursor: pointer;
" "
v-show=" @click="selectAllButton(scope.row.buttonList)"
scope.row.buttons.length != 0 && v-show="btnShowHandle(scope.row.buttonList,false)"
scope.row.buttons.length != scope.row.buttonList.length
"
@click="selectAllButton(scope.row)"
></i> ></i>
<el-checkbox-group v-model="scope.row.buttonList" size="small"> <el-checkbox v-model="item.check" v-for="item in scope.row.buttonList">{{ item.nameCh }}</el-checkbox>
<el-checkbox </div>
v-for="item in scope.row.buttons"
:label="item.id"
:key="item.id"
>{{ item.NameCN }}</el-checkbox
>
</el-checkbox-group>
</template> </template>
</el-table-column> </el-table-column>
</el-table></el-tab-pane </el-table>
</el-tab-pane
> >
<el-tab-pane label="数据权限" name="second"> <el-tab-pane label="数据权限" name="second">
<data-permissions ref="dataPermissions"></data-permissions> <data-permissions ref="dataPermissions"></data-permissions>
@ -91,11 +85,13 @@
</template> </template>
<script> <script>
import baseRightDialog from "@/components/base/baseRightDialog"; import baseRightDialog from '@/components/base/baseRightDialog'
import { PopedomSaveData, GetAllBilldata } from "@/api/apis/jurisdiction"; import { PopedomSaveData, GetAllBilldata } from '@/api/apis/jurisdiction'
import dataPermissions from "./dataPermissions.vue"; import dataPermissions from './dataPermissions.vue'
import layOutPermissions from "./layOutPermissions.vue"; import layOutPermissions from './layOutPermissions.vue'
import loginVue from "../../../login.vue"; import loginVue from '../../../login.vue'
import { authApi } from '@/api/apis/auth'
export default { export default {
data() { data() {
return { return {
@ -105,186 +101,146 @@ export default {
isAllSelect: false, isAllSelect: false,
selected: false, selected: false,
childNode: false, childNode: false,
build: "", build: '',
activeName: "first", activeName: 'first',
dataPermissions: [], dataPermissions: [],
buttonLoading: false, buttonLoading: false,
}; menuDatas: []
}
}, },
props: { props: {
menuData: { menuData: {
type: Array, type: Array,
default: () => { default: () => {
return []; return []
}, }
}, }
}, },
components: { components: {
baseRightDialog, baseRightDialog,
dataPermissions, dataPermissions,
layOutPermissions, layOutPermissions
}, },
beforeUpdate() { beforeUpdate() {
this.handleTabClick(); this.handleTabClick()
}, },
computed: { computed: {
menuDatas: { // menuDatas: {
// // return JSON.parse(JSON.stringify(this.menuData));
// get: function () {
// return JSON.parse(JSON.stringify(this.menuData)); // return JSON.parse(JSON.stringify(this.menuData));
get: function () { // },
return JSON.parse(JSON.stringify(this.menuData)); // set: function (item) {
}, // return JSON.parse(JSON.stringify(item));
set: function (item) { // },
return JSON.parse(JSON.stringify(item)); // },
},
},
}, },
methods: { methods: {
//
btnShowHandle(list, flag = false) {
if (!list.length) return false
let flagResult = list.every(item => {
return item.check
})
if (flag) {
return flagResult
} else {
return !flagResult
}
},
// tab // tab
handleTabClick() { handleTabClick() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout(); this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
}); })
}, },
selectAllButton(item) { selectAllButton(item) {
let data = []; item.forEach(item => {
item.buttons.forEach((el) => { item.check = true
data.push(el.id); })
});
item.buttonList = data;
}, },
cancellation(item) { cancellation(item) {
item.buttonList = [];
item.forEach(item => {
item.check = false
})
}, },
// / // /
selectAll() { selectAll() {
let data = this.treeToArray(this.menuDatas); let data = this.treeToArray(this.menuDatas)
this.selected = !this.selected; this.selected = !this.selected
data.forEach((el, index) => { data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, this.selected); el.check = this.selected
}); this.$refs.multipleTable.toggleRowSelection(el, this.selected)
})
}, },
handleSelectionChange(val, row) { handleSelectionChange(val, row) {
this.multipleSelection = val; row.check = !row.check
let data = this.treeToArray([row]);
this.childNode = !this.childNode;
if (data.length > 1) {
data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, this.childNode);
});
let ids = data[0].id;
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
"id"
);
arr = arr.splice(0, arr.length - 1);
let dataList = [];
let allList = this.treeToArray(this.menuDatas);
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el);
}
});
dataList.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, true);
});
} else {
let ids = data[0].id;
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
"id"
);
arr = arr.splice(0, arr.length - 1);
let dataList = [];
let allList = this.treeToArray(this.menuDatas);
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el);
}
});
dataList.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, true);
});
}
}, },
// //
exhibitList(id, echo, build) { exhibitList(menu, homeList, id) {
let data = this.treeToArray(this.menuDatas); this.$refs.layOutPermissions.homeList = homeList
this.build = build; console.log(menu, 'menu')
data.forEach((el, index) => { // let data = this.treeToArray(this.menuDatas);
if (id.includes(el.id)) { this.build = id
this.$refs.multipleTable.toggleRowSelection(el, true); // data.forEach((el, index) => {
// if (id.includes(el.id)) {
// this.$refs.multipleTable.toggleRowSelection(el, true);
// }
// });
this.menuCheckHandle(menu)
this.menuDatas = menu
console.log(this.menuDatas, 'this.menuDatas')
this.buttonLoading = false
},
//
menuCheckHandle(arr) {
arr.forEach(item => {
if (item.check) {
this.$refs.multipleTable.toggleRowSelection(item, true)
} }
}); if (item.children.length) {
this.menuDatas = this.addToButtonList(this.menuDatas, echo); this.menuCheckHandle(item.children)
this.buttonLoading = false; }
})
}, },
// //
treeToArray(items) { treeToArray(items) {
let children = []; let children = []
items.forEach((item) => { items.forEach((item) => {
children.push(item); children.push(item)
if (item.children) { if (item.children) {
children = children.concat(this.treeToArray(item.children)); children = children.concat(this.treeToArray(item.children))
} }
}); })
return children; return children
}, },
handleDialogClose() { handleDialogClose() {
let data = this.treeToArray(this.menuDatas); let data = this.treeToArray(this.menuDatas)
data.forEach((el, index) => { data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, false); this.$refs.multipleTable.toggleRowSelection(el, false)
}); })
this.changeMenu(this.menuDatas, 0); this.changeMenu(this.menuDatas, 0)
this.drawer = false; this.drawer = false
this.$parent.permissionPopup = false; this.$parent.permissionPopup = false
}, },
async handleConfirmClick() { async handleConfirmClick() {
let data = { let params = {
objectID: this.build, id: this.build,
kindid: 2, kindId: 2,
menuPopedom: "", sysPopedomHomeEntities: [],
buttonPopedom: [], sysPopedomMenuEntities: [],
dataPopedom: [], sysPopedomOperateEntities: []
widgetPopedom: "",
};
this.$refs.multipleTable.selection.forEach((el, index) => {
let dataLength = this.$refs.multipleTable.selection.length;
if (index == dataLength - 1) {
data.menuPopedom = data.menuPopedom.concat(`${el.id}`);
} else {
data.menuPopedom = data.menuPopedom.concat(`${el.id},`);
} }
if (el.buttonList.length != 0) { this.homeListHandle(params.sysPopedomHomeEntities)
data.buttonPopedom.push({ this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
op_MenuID: el.id, const res = await authApi("sysUserService","","saveJurisdiction","",params)
op_OperateKindList: el.buttonList + [], if(res.status == '200'){
});
}
});
let dataPopedom = [];
this.$refs.dataPermissions.tableData.forEach((el) => {
dataPopedom.push({
dp_billKindID: el.billKindID,
dp_popeList: el.buttonList.length > 0 ? el.buttonList + [] : "",
});
});
let tempStr = "";
this.$refs.layOutPermissions.tableData.forEach((item) => {
item.buttonList.forEach((ele) => {
tempStr += ele + ",";
});
});
data.widgetPopedom = tempStr.length ? tempStr.slice(0, -1) : "none";
data.dataPopedom = dataPopedom;
const res = await PopedomSaveData(data);
if (res.success == "true") {
this.handleDialogClose(); this.handleDialogClose();
this.$message({ this.$message({
message: "保存成功", message: "保存成功",
@ -292,6 +248,42 @@ export default {
}); });
} }
}, },
//
homeListHandle(arr) {
this.$refs.layOutPermissions.homeList.forEach(item => {
if (item.check) {
arr.push({ homeId: item.id })
}
})
},
//
menuListHandle(list, result, btnResult) {
list.forEach(item => {
if (item.check) {
result.push({
menuId: item.id
})
}
if (item.children.length) {
this.menuListHandle(item.children, result,btnResult)
}
if (item.buttonList.length) {
this.btnListHandle(item.buttonList, btnResult, item.id)
}
})
},
//
btnListHandle(list, btnResult, menuId) {
list.forEach(item => {
if (item.check) {
console.log(btnResult,'btnResult')
btnResult.push({
menuId,
operate: item.id
})
}
})
},
// //
addToButtonList(arr, newArr) { addToButtonList(arr, newArr) {
newArr.forEach((newItem) => { newArr.forEach((newItem) => {
@ -299,97 +291,101 @@ export default {
arr, arr,
newItem.op_MenuID, newItem.op_MenuID,
newItem.op_OperateKindList newItem.op_OperateKindList
); )
}); })
return arr; return arr
}, },
addToButtonListRecursive(arr, targetId, operateKindList) { addToButtonListRecursive(arr, targetId, operateKindList) {
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
const item = arr[i]; const item = arr[i]
if (item.id == targetId) { if (item.id == targetId) {
let lists = operateKindList.split(","); let lists = operateKindList.split(',')
lists.forEach((el) => { lists.forEach((el) => {
item.buttonList.push(parseInt(el)); item.buttonList.push(parseInt(el))
}); })
return item; return item
} }
if (item.children && item.children.length > 0) { if (item.children && item.children.length > 0) {
this.addToButtonListRecursive( this.addToButtonListRecursive(
item.children, item.children,
targetId, targetId,
operateKindList operateKindList
); )
} }
} }
}, },
changeMenu(data, num) { changeMenu(data, num) {
let level = num; let level = num
level = level + 1; level = level + 1
data.forEach((el) => { data.forEach((el) => {
el.buttonList = []; el.buttonList = []
el.type = false; el.type = false
if (el.children != null && el.children && el.children.length) { if (el.children != null && el.children && el.children.length) {
this.changeMenu(el.children, level); this.changeMenu(el.children, level)
} }
}); })
}, },
toFlatArray(tree, parentId) { toFlatArray(tree, parentId) {
return tree.reduce((t, _) => { return tree.reduce((t, _) => {
const child = _[children]; const child = _[children]
return [ return [
...t, ...t,
parentId ? { ..._, parentId } : _, parentId ? { ..._, parentId } : _,
...(child && child.length ? toFlatArray(child, _[id]) : []), ...(child && child.length ? toFlatArray(child, _[id]) : [])
]; ]
}, []); }, [])
}, },
getIds(flatArray) { getIds(flatArray) {
let ids = [nodeId]; let ids = [nodeId]
let child = flatArray.find((_) => _[id] === nodeId); let child = flatArray.find((_) => _[id] === nodeId)
while (child && child.parentId) { while (child && child.parentId) {
ids = [child.parentId, ...ids]; ids = [child.parentId, ...ids]
child = flatArray.find((_) => _[id] === child.parentId); child = flatArray.find((_) => _[id] === child.parentId)
} }
return ids; return ids
}, },
treeFindPath(tree, func, field = "", path = []) { treeFindPath(tree, func, field = '', path = []) {
if (!tree) return []; if (!tree) return []
for (const data of tree) { for (const data of tree) {
field === "" ? path.push(data) : path.push(data[field]); field === '' ? path.push(data) : path.push(data[field])
if (func(data)) return path; if (func(data)) return path
if (data.children) { if (data.children) {
const findChildren = this.treeFindPath( const findChildren = this.treeFindPath(
data.children, data.children,
func, func,
field, field,
path path
); )
if (findChildren.length) return findChildren; if (findChildren.length) return findChildren
}
path.pop()
}
return []
}
} }
path.pop();
} }
return [];
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.rightDialog { .rightDialog {
height: 100%; height: 100%;
padding: 0 16px; padding: 0 16px;
} }
::v-deep .cell { ::v-deep .cell {
display: flex; display: flex;
} }
::v-deep .el-checkbox-group { ::v-deep .el-checkbox-group {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
::v-deep .el-checkbox { ::v-deep .el-checkbox {
margin-right: 15px; margin-right: 15px;
} }
::v-deep .el-tabs__nav { ::v-deep .el-tabs__nav {
transform: translateX(22px) !important; transform: translateX(22px) !important;
} }

View File

@ -94,6 +94,7 @@ export default {
}); });
}, },
async init() { async init() {
return
let data = []; let data = [];
const res = await GetAllBilldata({}); const res = await GetAllBilldata({});
if (res.code == 1) { if (res.code == 1) {

View File

@ -335,19 +335,7 @@ export default {
} }
const res = await authApi('sysUserService', '', 'jurisdiction', '',params) const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
if (res.status == 200) { if (res.status == 200) {
console.log(res,'进来了')
const data = res.attribute const data = res.attribute
// let menuIDs =
// data[0].length > 0 ? data[0][0].fp_MenuIdList.split(',') : []
// let echo = data[1].length > 0 ? data[1] : []
// let dataPermissions = data[2].length > 0 ? data[2] : []
// this.$refs.rightDialog.$refs.dataPermissions.selectedList =
// dataPermissions
// this.$refs.rightDialog.$refs.layOutPermissions.selectedList = res
// .data[3][0]
// ? res.data[3][0].widgetList
// : ''
// this.$refs.rightDialog.exhibitList(menuIDs, echo, this.userRadioId)
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId) this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
} }
}) })

View File

@ -7,25 +7,31 @@
<div> <div>
<!-- 人员弹窗 --> <!-- 人员弹窗 -->
<base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="addDialog" <base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="addDialog"
@handleClose="handleClose" class="userDialog" title="新增人员" width="700px" top="10vh"> @handleClose="handleClose" class="userDialog" title="新增人员" width="700px" top="10vh"
>
<base-form ref="customForm" :formRow="formRow" :isFunBtn="isFunBtn" @elDialogClick="organClick" <base-form ref="customForm" :formRow="formRow" :isFunBtn="isFunBtn" @elDialogClick="organClick"
:rules="userRules" @onSubmit="getSubmit"> :rules="userRules" @onSubmit="getSubmit"
>
</base-form> </base-form>
</base-dialog> </base-dialog>
<div flex style="height: 100%;"> <div flex style="height: 100%;">
<base-layout title="组织机构" style="width:260px;" :defaultButtonSwitch="false" :isPage="false" <base-layout title="组织机构" style="width:260px;" :defaultButtonSwitch="false" :isPage="false"
:mainColor="mainColor" :operateButtonSwitch="false" v-loading="treeLoading"> :mainColor="mainColor" :operateButtonSwitch="false" v-loading="treeLoading"
>
<div slot="main" style="height: 100%;border-right: 1px solid #dfe6ec;overflow-y: auto;"> <div slot="main" style="height: 100%;border-right: 1px solid #dfe6ec;overflow-y: auto;">
<base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" :showCheckbox="false" <base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" :showCheckbox="false"
:menuData="menuData" @handleNodeClick="treeClick"></base-tree> :menuData="menuData" @handleNodeClick="treeClick"
></base-tree>
</div> </div>
</base-layout> </base-layout>
<base-layout title="人员信息" ref="personLayout" @pageChange="pageChange" :buttonList="buttonList" <base-layout title="人员信息" ref="personLayout" @pageChange="pageChange" :buttonList="buttonList"
@onFuncBtn="getFuncBtn" :isPage="true" style="flex:1;"> @onFuncBtn="getFuncBtn" :isPage="true" style="flex:1;"
>
<div slot="main" slot-scope="{ tableHeight }" style="height: 100%;"> <div slot="main" slot-scope="{ tableHeight }" style="height: 100%;">
<base-table ref="personCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading" <base-table ref="personCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading"
@radioChange="radioChange" :tableHeight="tableHeight" :tableData="tableData" @radioChange="radioChange" :tableHeight="tableHeight" :tableData="tableData"
:tableColumn="tableColumn" :slotrow="true"> :tableColumn="tableColumn" :slotrow="true"
>
<!-- 入职时间 --> <!-- 入职时间 -->
<template v-slot:p_EntryTime="{ row }"> <template v-slot:p_EntryTime="{ row }">
<span>{{ row.row.p_EntryTime | timeDate }}</span> <span>{{ row.row.p_EntryTime | timeDate }}</span>
@ -41,7 +47,8 @@
<!-- 部门+对外签订弹窗 --> <!-- 部门+对外签订弹窗 -->
<base-organization ref="baseOrganization" :menuData="menuData" <base-organization ref="baseOrganization" :menuData="menuData"
@handleConfirmClick="organizationHandleConfirm"></base-organization> @handleConfirmClick="organizationHandleConfirm"
></base-organization>
<!-- <base-dialog :closeEscape="true" :showClose="true" :closeModal="false" <!-- <base-dialog :closeEscape="true" :showClose="true" :closeModal="false"
@handleConfirmClick="organizationHandleConfirm" :dialogVisible.sync="organizationDialog" class="userDialog" @handleConfirmClick="organizationHandleConfirm" :dialogVisible.sync="organizationDialog" class="userDialog"
title="选择组织机构" width="700px" top="10vh" :footerShow="true"> title="选择组织机构" width="700px" top="10vh" :footerShow="true">
@ -68,13 +75,13 @@
</template> </template>
<script> <script>
import baseLayout from "@/components/base/baseLayout"; import baseLayout from '@/components/base/baseLayout'
import baseTable from "@/components/base/baseTable"; import baseTable from '@/components/base/baseTable'
// import baseDialog from "@/components/base/BaseNewDialog"; // import baseDialog from "@/components/base/BaseNewDialog";
import baseDialog from "@/components/base/BaseNewDialog/index.vue"; import baseDialog from '@/components/base/BaseNewDialog/index.vue'
import baseForm from "@/components/base/baseNewForm/index.vue"; import baseForm from '@/components/base/baseNewForm/index.vue'
import baseTree from "@/components/base/BaseMenuTree/index.vue"; import baseTree from '@/components/base/BaseMenuTree/index.vue'
import baseOrganization from "@/components/base/baseOrganization/index.vue"; import baseOrganization from '@/components/base/baseOrganization/index.vue'
import { getCompanyId } from '@/utils/auth' import { getCompanyId } from '@/utils/auth'
import { import {
PersonList, PersonList,
@ -90,11 +97,11 @@ import {
import { import {
dataDictionaryGetBillList dataDictionaryGetBillList
} from '@/api/apis/dataDictionary' } from '@/api/apis/dataDictionary'
import configData from "./configData"; import configData from './configData'
import { authApi } from '@/api/apis/auth' import { authApi } from '@/api/apis/auth'
export default { export default {
name: "review", name: 'review',
components: { components: {
baseLayout, baseLayout,
baseTable, baseTable,
@ -116,13 +123,13 @@ export default {
buttonList: [ buttonList: [
{ {
icon: 'button_reset', icon: 'button_reset',
menuName: '启用', menuName: '启用'
}, },
{ {
icon: 'button_reset', icon: 'button_reset',
menuName: '停用', menuName: '停用',
type: 'danger' type: 'danger'
}, }
], ],
tabLoading: false, tabLoading: false,
tableData: [], tableData: [],
@ -135,7 +142,7 @@ export default {
roleName: null, // roleName: null, //
roleNumber: null, // roleNumber: null, //
order: null, // order: null, //
describe: null, // describe: null //
}, },
roleOptions: configData.roleOptions, roleOptions: configData.roleOptions,
formRow: configData.formRow, formRow: configData.formRow,
@ -156,7 +163,7 @@ export default {
// //
tableColumn() { tableColumn() {
return configData.tableColumnJson return configData.tableColumnJson
}, }
}, },
watch: { watch: {
@ -173,8 +180,10 @@ export default {
} }
} }
}, },
created() { }, created() {
onShow() { }, },
onShow() {
},
mounted() { mounted() {
this.initPage() this.initPage()
@ -213,10 +222,10 @@ export default {
this.treeLoading = false this.treeLoading = false
}, 180000) }, 180000)
let params = { let params = {
state: 0, state: 0
// CompanyID: this.$store.state.user.companyID?this.$store.state.user.companyID:getCompanyId() // CompanyID: this.$store.state.user.companyID?this.$store.state.user.companyID:getCompanyId()
} }
let res = await authApi("sysOrganService","","queryEntityTree","",{}) let res = await authApi('sysOrganService', '', 'queryEntityTree', '', {})
if (res.status == 200) { if (res.status == 200) {
this.menuData = res.attribute this.menuData = res.attribute
this.treeLoading = false this.treeLoading = false
@ -241,7 +250,7 @@ export default {
let params = { let params = {
id: id id: id
} }
let res = await authApi('sysPersonService',"","getEntity","",params) let res = await authApi('sysPersonService', '', 'getEntity', '', params)
console.log(res, 'res') console.log(res, 'res')
// res.data[0].o_OrganName = res.data[0].orgainName // res.data[0].o_OrganName = res.data[0].orgainName
this.addDialog = true this.addDialog = true
@ -252,72 +261,70 @@ export default {
// //
async getEducationList() { async getEducationList() {
let params = { let params = {
KindId: 3, 'usedSts': '1',//1 使2 使
page: 1, tabName: 'sys_person',
limit: 999, columnName: 'degree_id'
Sequence: '',
SequenceName: ''
} }
let res = await dataDictionaryGetBillList(params) let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.code == 1) { if (res.status == 200) {
console.log(res.attribute,'res')
let arrList = [] let arrList = []
if (res.data[0] > 0) { if (res.attribute.length) {
res.data[1].forEach(el => { res.attribute.forEach(el => {
let arr = { let arr = {
label: el.ddd_DicDetailsName, label: el.columnContent,
value: el.ddd_DicDetailsID value: el.id
} }
arrList.push(arr) arrList.push(arr)
}) })
} }
console.log(arrList,'arrList')
configData.formRow[2].elCol[1].options = arrList configData.formRow[2].elCol[1].options = arrList
} }
}, },
// //
async getPostList() { async getPostList() {
let params = { let params = {
KindId: 1, 'usedSts': '1',//1 使2 使
page: 1, tabName: 'sys_person',
limit: 999, columnName: 'post_id'
Sequence: '',
SequenceName: ''
} }
let res = await dataDictionaryGetBillList(params) let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.code == 1) { if (res.status == 200) {
let arrList = [] let arrList = []
if (res.data[0] > 0) { if (res.attribute.length) {
res.data[1].forEach(el => { res.attribute.forEach(el => {
let arr = { let arr = {
label: el.ddd_DicDetailsName, label: el.columnContent,
value: el.ddd_DicDetailsID value: el.id
} }
arrList.push(arr) arrList.push(arr)
}) })
} }
console.log(arrList,'arrList222')
configData.formRow[3].elCol[0].options = arrList configData.formRow[3].elCol[0].options = arrList
} }
}, },
// //
async getLevelnList() { async getLevelnList() {
let params = { let params = {
KindId: 2, 'usedSts': '1',//1 使2 使
page: 1, tabName: 'sys_person',
limit: 999, columnName: 'level_id'
Sequence: '',
SequenceName: ''
} }
let res = await dataDictionaryGetBillList(params) let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.code == 1) { if (res.status == 200) {
let arrList = [] let arrList = []
if (res.data[0] > 0) { if (res.attribute.length) {
res.data[1].forEach(el => { res.attribute.forEach(el => {
let arr = { let arr = {
label: el.ddd_DicDetailsName, label: el.columnContent,
value: el.ddd_DicDetailsID value: el.id
} }
arrList.push(arr) arrList.push(arr)
}) })
} }
console.log(arrList,'arrList222')
configData.formRow[3].elCol[1].options = arrList configData.formRow[3].elCol[1].options = arrList
} }
}, },
@ -329,10 +336,10 @@ export default {
let params = { let params = {
...this.pageModel ...this.pageModel
} }
let res = await authApi("sysPersonService","","queryEntityPage","",params) let res = await authApi('sysPersonService', '', 'queryEntityPage', '', params)
if (res.status == 200) { if (res.status == 200) {
console.log(res.attribute, 'res.attribute', res) console.log(res.attribute, 'res.attribute', res)
this.tableData = res.attribute.list; this.tableData = res.attribute.list
this.$refs.personCustomtable.clearRadioIndex() this.$refs.personCustomtable.clearRadioIndex()
this.$refs.personLayout.setPageTotal(res.attribute.total) this.$refs.personLayout.setPageTotal(res.attribute.total)
@ -344,9 +351,9 @@ export default {
async closeDelData(id) { async closeDelData(id) {
let params = { let params = {
id: id, id: id,
"state": "1" 'state': '1'
} }
let res = await authApi("sysPersonService","","enableDisableEntity","",params) let res = await authApi('sysPersonService', '', 'enableDisableEntity', '', params)
if (res.status == 200) { if (res.status == 200) {
this.$vmNews('已停用', 'success') this.$vmNews('已停用', 'success')
this.resetTable() this.resetTable()
@ -356,9 +363,9 @@ export default {
async openDelData(id) { async openDelData(id) {
let params = { let params = {
id: id, id: id,
"state": "0" 'state': '0'
} }
let res = await authApi("sysPersonService","","enableDisableEntity","",params) let res = await authApi('sysPersonService', '', 'enableDisableEntity', '', params)
if (res.status == 200) { if (res.status == 200) {
this.$vmNews('已启用', 'success') this.$vmNews('已启用', 'success')
this.resetTable() this.resetTable()
@ -398,8 +405,8 @@ export default {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); })
}); })
} }
if (btnEven.menuName === '停用') { // if (btnEven.menuName === '停用') { //
// if (!this.judgeCheckbox()) { // if (!this.judgeCheckbox()) {
@ -415,8 +422,8 @@ export default {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); })
}); })
} }
if (btnEven.menuName === '启用') { // if (btnEven.menuName === '启用') { //
@ -433,8 +440,8 @@ export default {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); })
}); })
} }
}, },
judgeCheckbox() { judgeCheckbox() {
@ -454,14 +461,14 @@ export default {
async getSubmit(data) { async getSubmit(data) {
let params = { let params = {
...data, ...data
} }
let res let res
console.log(params, 'params') console.log(params, 'params')
if (params.id) { if (params.id) {
res = await authApi("sysPersonService","","updateEntity","",params) res = await authApi('sysPersonService', '', 'updateEntity', '', params)
} else { } else {
res = await authApi("sysPersonService","","saveEntity","",params) res = await authApi('sysPersonService', '', 'saveEntity', '', params)
} }
if (res.status == 200) { if (res.status == 200) {
@ -475,7 +482,7 @@ export default {
this.radioIndex = false this.radioIndex = false
this.radioId = false this.radioId = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.personCustomtable.clearSelect(); this.$refs.personCustomtable.clearSelect()
this.$refs.personLayout.pageClear() this.$refs.personLayout.pageClear()
}) })
this.getTableList() this.getTableList()
@ -504,13 +511,13 @@ export default {
this.organizationForm = { this.organizationForm = {
code: data.code, code: data.code,
O_OrganID: data.id, O_OrganID: data.id,
ParentOrganName: data.label, ParentOrganName: data.label
}
} }
} }
},
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
/* .userDialog { /* .userDialog {
margin-top: 10vh; margin-top: 10vh;
width: 700px; width: 700px;