Browse Source

主任管理

master
luobinjie 3 months ago
parent
commit
b70291bd8b
  1. 579
      src/components/menuPage/directorManaMenuEdit.vue
  2. 251
      src/components/menuPage/directorManaMenuSet.vue
  3. 114
      src/components/menuPage/directorManaMenuTree.vue
  4. 6
      src/router/index.js
  5. 8
      src/store/index.js
  6. 91
      src/views/menuPage/directorManaMenu.vue
  7. 34
      src/views/user-list/Role.vue

579
src/components/menuPage/directorManaMenuEdit.vue

@ -0,0 +1,579 @@
<template>
<div
:style="
'display: flex;height:' +
(window.pageHeight < 600 ? 480 : window.pageHeight - 100) +
'px;'
"
>
<div
:style="
'width:' +
(window.pageWidth - 200 - 110 - 50 - 14) +
'px;background-color: #fff; border-radius: 8px;padding: 15px;'
"
>
<!--overflow-y: scroll;height:200px;-->
<el-form
ref="form"
:model="form"
label-width="85px"
:rules="rules"
size="medium"
>
<el-row>
<el-col :span="8">
<el-form-item label="上级节点" prop="parentId">
<el-cascader
v-model="form.parentId"
:options="dataTransOpts.tableM.directorManaMenu_info"
:props="{
checkStrictly: true,
expandTrigger: 'hover',
...customerOrg.treeprops,
}"
:show-all-levels="false"
clearable
filterable
disabled
:style="
'width:' + Math.floor((window.pageWidth - 620) / 3) + 'px;'
"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="节点名称" prop="displayName">
<el-input
class="enterToTab"
v-model="form.displayName"
placeholder="请输入节点名称"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="菜单图标" prop="iconName">
<el-input
class="enterToTab"
v-model="form.iconName"
placeholder="请输入菜单图标"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="样式名称" prop="styleName">
<el-input
class="enterToTab"
v-model="form.styleName"
placeholder="请输入样式名称"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="排序" prop="displayOrder">
<el-input
type="number"
class="enterToTab"
v-model="form.displayOrder"
placeholder="请输入排序值"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="启用" prop="isActive">
<!--
<el-radio v-model="form.isActive" label="Y">启用</el-radio>
<el-radio v-model="form.isActive" label="N">停用</el-radio>
-->
<el-checkbox
v-model="form.isActiveBox"
@change="changeBox('isActive')"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="路由地址" prop="routeUrl">
<el-input
class="enterToTab"
v-model="form.routeUrl"
placeholder="请输入路由地址"
maxlength="100"
show-word-limit
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="5">
<el-form-item label="创建人员">
<el-input v-model="form.creatorName" size="small" disabled />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="创建时间">
<el-date-picker
v-model="form.creationTime"
type="datetime"
size="small"
style="width: 100%"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="修改人员">
<el-input v-model="form.lastModifierName" size="small" disabled />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="修改时间">
<el-date-picker
v-model="form.lastModificationTime"
type="datetime"
size="small"
style="width: 100%"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 按钮区域 -->
<div style="margin-left: 10px; position: absolute; top: 0; right: 0">
<div class="btnList" v-show="checkPagePriv(pagePriv.privs, '新增节点')">
<el-button
type="primary"
@click="btnAdd('form', '')"
class="commonbutton"
>新增节点</el-button
>
</div>
<div class="btnList" v-show="checkPagePriv(pagePriv.privs, '新增子节点')">
<el-button
type="primary"
@click="btnAdd('form', 'child')"
class="commonbutton"
>新增子节点</el-button
>
</div>
<div class="btnList" v-show="checkPagePriv(pagePriv.privs, '保存')">
<el-button
type="success"
@click="btnSubmit('form')"
class="commonbutton"
>保存</el-button
>
</div>
<div class="btnList" v-show="checkPagePriv(pagePriv.privs, '删除')">
<el-button type="danger" @click="btnDel('form')" class="deleteButton"
>删除</el-button
>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import {
getPagePriv,
checkPagePriv,
tcdate,
objCopy,
deepCopy,
arrayExistObj,
} from "../../utlis/proFunc";
import { getTreeNode, getTreePids } from "../../utlis/tree";
export default {
components: {},
props: ["id"],
data() {
return {
pagePriv: {
routeUrlorPageName: "menuPage", //
privs: [], //
},
isActiveBox: false,
customerOrgEditStyle: "height:400px;",
form: {
displayName: "",
routeUrl: "",
iconName: "",
parentId: "",
styleName: "",
creatorName: "",
lastModifierName: "",
lastModificationTime: "",
lastModifierId: "",
creationTime: "",
creatorId: "",
id: "",
isActive: "Y",
displayOrder: "",
isActiveBox: true,
}, //
formInit: {},
rules: {
displayName: [
{ required: true, message: "请输入节点名称", trigger: "blur" },
],
},
isshow: false,
};
},
created() {
//
let userPriv = window.sessionStorage.getItem("userPriv");
if (userPriv)
this.pagePriv.privs = deepCopy(
getPagePriv(this.pagePriv.routeUrlorPageName)
);
//
this.formInit = deepCopy(this.form);
console.log("this.formInit", this.formInit);
},
//
mounted() {
// tab
this.enterToTab();
},
computed: {
...mapState(["window", "dict", "dataTransOpts", "customerOrg"]),
editWidth() {
return (
this.window.pageWidth - this.window.pageMarginWidth - 200 - 120 - 20
);
},
},
methods: {
...mapMutations(["setData"]),
checkPagePriv,
changeBox(type) {
//
if (this.form[type + "Box"]) {
this.form[type] = "Y";
} else {
this.form[type] = "N";
}
},
//
initFormData(id) {
if (!id) {
this.form = deepCopy(this.formInit);
return;
}
postapi("/api/app/DirectorMenuInfo/GetDirectorMenuInfo", {
directorMenuInfoId: id,
}).then((res) => {
if (res.code != -1) {
// this.form = res.data;
objCopy(res.data, this.form);
if (res.data.isActive == "Y") {
this.form.isActiveBox = true;
} else {
this.form.isActiveBox = false;
}
console.log("deepCopy(this.form)", deepCopy(this.form));
console.log("this.form", this.form, res.data);
}
});
},
// ()
getCustomerOrgTree(oprType, body) {
// getapi("/api/app/customerorg/getbycodeall").then((res) => {
// //customerOrgTree = res.data;
// console.log("res.data", res.data);
// this.setData({ key: "customerOrg.customerOrgTree", value: res.data });
// tcdate(this.dataTransOpts.tableM.directorManaMenu_info);
// });
switch (oprType) {
case "insert":
let node = {
id: body.id,
displayName: body.displayName,
parentId: body.parentId,
};
if (body.parentId) {
let pNode = getTreeNode(
this.dataTransOpts.tableM.directorManaMenu_info,
"treeChildren",
"id",
body.parentId
);
if (!pNode.treeChildren) this.$set(pNode, "treeChildren", []);
//pNode.treeChildren = []
pNode.treeChildren.push(node);
} else {
this.dataTransOpts.tableM.directorManaMenu_info.push(node);
}
this.customerOrg.directorDefaultExpandedKeys = [];
if (body.parentId) {
this.customerOrg.directorDefaultExpandedKeys.push(body.parentId);
}
this.customerOrg.directorDefaultExpandedKeys.push(body.id);
this.customerOrg.directorTreeCurrentNodekey = body.id;
//console.log("this.customerOrg.directorTreeCurrentNodekey",this.customerOrg.directorTreeCurrentNodekey);
break;
// "id": "3a0c5101-a6a6-e48a-36ec-33e7567a99e6",
// "displayName": "",
// "parentId": null,
// "code": "00001",
// "treeChildren": [
case "update":
let node2 = getTreeNode(
this.dataTransOpts.tableM.directorManaMenu_info,
"treeChildren",
"id",
body.id
);
node2.displayName = body.displayName;
break;
case "delete":
let lfind = -1;
let pids = getTreePids(
this.dataTransOpts.tableM.directorManaMenu_info,
"treeChildren",
"parentId",
"id",
body
);
//tree, childNodeName, pidName, idName, idVal getTreeNode(this.dataTransOpts.tableM.directorManaMenu_info, "treeChildren", "id", body);
console.log("pids", pids, body);
if (!pids || pids.length < 2) {
lfind = arrayExistObj(
this.dataTransOpts.tableM.directorManaMenu_info,
"id",
body
);
if (lfind > -1)
this.dataTransOpts.tableM.directorManaMenu_info.splice(lfind, 1);
} else {
let node3 = getTreeNode(
this.dataTransOpts.tableM.directorManaMenu_info,
"treeChildren",
"id",
pids[0]
);
//console.log('node3',node3)
lfind = arrayExistObj(node3.treeChildren, "id", body);
if (lfind > -1) node3.treeChildren.splice(lfind, 1);
}
break;
default:
break;
}
},
//
btnSubmit(formName) {
let body = {};
// console.log("vuex data", this.customerOrg.customerOrgRd);
this.$refs[formName].validate((valid, fields) => {
if (!valid) {
this.$message.warning({
showClose: true,
message: fields[Object.keys(fields)[0]][0].message,
});
return false;
}
body = deepCopy(this.form);
delete body.creatorId;
delete body.lastModifierId;
delete body.creatorName;
delete body.creationTime;
delete body.lastModifierName;
delete body.lastModificationTime;
if (typeof body.parentId === "string") {
if (!body.parentId || body.parentId.length < 1) {
body.parentId = null;
}
} else {
if (body.parentId && body.parentId.length > 0) {
body.parentId = body.parentId[body.parentId.length - 1];
} else {
body.parentId = null;
}
}
// console.log("body", body, "this.form", this.form);
if (!this.form.id) {
//id
postapi(
`/api/app/DirectorMenuInfo/CreatetDirectorMenuInfo`,
body
).then((res) => {
if (res.code == 1) {
console.log("创健 操作成功");
//this.setData({ key: "customerOrg.customerOrgRd", value: res });
objCopy(res.data, this.form);
this.getCustomerOrgTree("insert", res.data);
// //this.$message.success('')
}
});
} else {
body.directorMenuInfoId = body.id;
delete body.parentId;
delete body.id;
//id
postapi(
`/api/app/DirectorMenuInfo/UpdateDirectorMenuInfo`,
body
).then((res) => {
if (res.code == 1) {
console.log("更新 操作成功");
this.getCustomerOrgTree("update", this.form);
// //this.$message.success('')
}
});
}
});
},
//
async btnAdd(formName, isChild) {
if (isChild) {
if (!this.form.id) {
this.$message.warning({
showClose: true,
message: "请先选择上级节点",
});
return;
}
let parentForm = deepCopy(this.form);
console.log("parentForm", parentForm);
this.form = Object.assign({}, this.formInit, {
parentId: parentForm.id,
routeUrl: parentForm.routeUrl,
});
console.log("this.form", this.form);
} else {
this.form = Object.assign({}, this.formInit);
}
await this.$refs[formName].resetFields();
},
//
btnDel(formName) {
if (!this.form.id) {
this.$message.warning({
showClose: true,
message: "请先选中要删除的节点",
});
return;
}
//
//let node = deepCopy(getTreeNode(this.dataTransOpts.tableM.directorManaMenu_info,"treeChildren","id",this.customerOrg.customerOrgRd.id));
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
//console.log('{patientRegisterIds}',{patientRegisterIds})
return postapi(`/api/app/DirectorMenuInfo/DeleteDirectorMenuInfo`, {
directorMenuInfoId: this.form.id,
});
})
.then((res) => {
if (res.code != -1) {
console.log("删除 操作成功");
this.getCustomerOrgTree("delete", this.form.id);
this.dataTransOpts.tableS.directorManaMenu_info.id = "";
setTimeout(() => {
this.dataTransOpts.refresh.directorManaMenu_info.S++;
}, 20);
this.$refs[formName].resetFields();
// //this.$message.success('')
}
})
.catch((err) => {
if (err == "cancel") {
console.log("已取消删除");
} else {
this.$message.error({
showClose: true,
message: "操作失败,原因:" + err,
});
}
});
},
// tab
enterToTab() {
this.$nextTick(() => {
let inputs = document.querySelectorAll("form input"); // //.inline-input
//console.log('inputs',inputs);
//
inputs.forEach((input, i) => {
input.addEventListener("keydown", (event) => {
//
// console.log('data-ismultiline',input.getAttribute('data-ismultiline'));
if (event.keyCode === 13) {
//
event.preventDefault();
//
for (let j = i + 1; j < inputs.length; j++) {
if (inputs[j].getAttribute("disabled") != "disabled") {
inputs[j].focus();
break;
}
}
}
});
});
});
},
},
watch: {
//ID
"dataTransOpts.refresh.directorManaMenu_info.S": {
// immediate: true, // created 使
handler(newVal, oldVal) {
console.log(
`watch 菜单与页面 newVal:${newVal} oldVal:${oldVal} menuInfoId: ${this.dataTransOpts.tableS.directorManaMenu_info.id}`
);
this.initFormData(this.dataTransOpts.tableS.directorManaMenu_info.id);
},
},
},
};
</script>
<style scoped>
@import "../../assets/css/global_form.css";
.btnList {
margin-bottom: 10px;
}
.btnClass {
width: 110px;
}
</style>

251
src/components/menuPage/directorManaMenuSet.vue

@ -0,0 +1,251 @@
<template>
<div>
<div style="margin:2px 2px 5px 2px;display: flex;justify-content:space-between;">
<div>
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
</div>
<div v-show="isRole && checkPagePriv(pagePriv.privs,'提交')">
<el-button @click="btnSubmit" class="commonbutton" style="width:60px">提交</el-button>
</div>
</div>
<div style="overflow: scroll;height:450px;">
<el-tree :data="menuInfoView" :props="customerOrg.treeprops"
node-key="id" :filter-node-method="filterNode" show-checkbox
default-expand-all
:default-expanded-keys="customerOrg.directorDefaultExpandedKeys"
@check-change="handleCheckChange" highlight-current ref="customerOrgTree" size="small"/>
</div>
</div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { getPagePriv,checkPagePriv, deepCopy,tcdate,arrayExistObj } from "../../utlis/proFunc";
import { getTreeNode, getTreeAllChildIdsByNode, getTreeAllChildIdsById, getTreePids } from "../../utlis/tree";
export default {
components: {},
props:["params"], // params = { opra: role/user /, idVal: roleId/userId}
data() {
return {
pagePriv:{
routeUrlorPageName:'MenuInfoSet', //
privs:[] //
},
menuInfoView:[], //
menuInfoSet:[], //
checkedKeys:[], //ID
filterText:''
};
},
computed: {
...mapState(["window", "dialogWin", "dataTransOpts", "customerOrg" ]),
//
isRole(){
let ret = true
if(this.params && this.params.opra == "user"){
ret = false
}
return ret
},
},
//
created() {
//
let userPriv = window.sessionStorage.getItem('userPriv')
if(userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
},
//
mounted() {
},
methods: {
...mapMutations(["setData"]),checkPagePriv,
//
initData(roleOrUser_Id) {
postapi("/api/app/DirectorMenuInfo/getmenuinfotreelist").then((res) => {
if(res.code != -1){
this.menuInfoView = res.data
tcdate(this.menuInfoView);
//
if(!this.isRole){
this.setTreeDisabled(this.menuInfoView,"treeChildren")
}
if(this.isRole){
return postapi(`/api/app/RoleDirectorMenuInfo/GetRoleDirectorMenuInfoList`,{
roleId:roleOrUser_Id
}) //
}else{
return getapi(`/api/app/menuinfo/getmymenuinfolistinuser?UserId=${roleOrUser_Id}`)
}
}
}).then(res =>{
if(res && res.code != -1){
//
this.menuInfoSet = res.data
this.setCheckedKeys()
}
}).catch(err =>{
console.log(err)
});
},
//
setTreeDisabled(tree,childrenNodeName){
tree.forEach(e => {
e.disabled = true
if(e[childrenNodeName]) this.setTreeDisabled(e[childrenNodeName],childrenNodeName)
});
},
//
setCheckedKeys(){
this.checkedKeys = []
if(!this.isRole){
this.menuInfoSet.forEach(e => {
e.directorMenuInfoId = e.id
});
}
this.menuInfoSet.forEach(e => {
//
let node = getTreeNode(this.menuInfoView, "treeChildren", "id", e.directorMenuInfoId)
if(node.treeChildren){
//
let menuInfoIds = getTreeAllChildIdsByNode(node, "treeChildren", "id")
let count = 0
menuInfoIds.forEach(item => {
let lfind = arrayExistObj(this.menuInfoSet,"directorMenuInfoId",item)
if(lfind > -1) count++
});
if(menuInfoIds.length == count) this.checkedKeys.push(e.directorMenuInfoId)
}else{
this.checkedKeys.push(e.directorMenuInfoId)
}
});
this.$refs["customerOrgTree"].setCheckedKeys(this.checkedKeys);
},
//
btnSubmit(){
let body = {
roleId:this.dataTransOpts.tableS.adp_roles.id,
directorMenuInfoIds:[]
}
this.menuInfoSet.forEach(e => {
if(e.menuInfoId) body.directorMenuInfoIds.push(e.menuInfoId)
});
postapi('/api/app/RoleDirectorMenuInfo/SetRoleDirectorMenuInfo',body).then(res =>{
if(res.code != -1){
console.log('操作成功!')
this.dialogWin.directorMenuPageSet = false
}
})
},
//
handleCheckChange(data, checked, indeterminate) {
console.log('data, checked, indeterminate,this.menuInfoSet',data, checked, indeterminate,this.menuInfoSet);
let lfind = 0,count = 0
if(checked){
//
let pids = getTreePids(this.menuInfoView, "treeChildren", "parentId", "id", data.id)
pids.push(data.id) //
pids.forEach(e => {
if(e){
lfind = arrayExistObj(this.menuInfoSet,'menuInfoId',e)
if(lfind == -1) this.menuInfoSet.push({ menuInfoId:e })
}
});
}else if(!indeterminate){
//
lfind = arrayExistObj(this.menuInfoSet,'menuInfoId',data.id)
if(lfind > -1) this.menuInfoSet.splice(lfind,1)
//
// let node = getTreeNode(this.menuInfoView, "treeChildren", "id", data.id)
// if(node.treeChildren){
// let childs = getTreeAllChildIdsByNode(node, "treeChildren", "id")
// childs.forEach(id => {
// lfind = arrayExistObj(this.menuInfoSet,'menuInfoId',id)
// if(lfind > -1) this.menuInfoSet.splice(lfind,1)
// });
// }
//
let parentIds = getTreePids(this.menuInfoView, "treeChildren", "parentId", "id", data.id)
parentIds.forEach(e => {
if(e){
let pNode = getTreeNode(this.menuInfoView, "treeChildren", "id", e)
count = pNode["treeChildren"].length
pNode["treeChildren"].forEach(item => {
lfind = arrayExistObj(this.menuInfoSet,'menuInfoId',item.id)
if(lfind == -1) count--
});
if(count == 0){
lfind = arrayExistObj(this.menuInfoSet,'menuInfoId',e)
if(lfind > -1) this.menuInfoSet.splice(lfind,1)
}
}
});
}
console.log('this.menuInfoSet',this.menuInfoSet)
},
//
filterNode(value, data) {
//console.log(value,data)
if (!value) return true;
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
}
},
watch: {
//
"dataTransOpts.refresh.role_director_menu_info.M":{
immediate:true,
handler(newVal, oldVal) {
let roleOrUser_Id
if(this.isRole){
roleOrUser_Id = this.dataTransOpts.tableS.adp_roles.id
}else{
roleOrUser_Id = this.dataTransOpts.tableS.adp_users.id
}
console.log(`watch ${this.isRole ? '角色':'用户'} 权限 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${roleOrUser_Id}`);
this.initData(roleOrUser_Id)
}
},
"customerOrg.directorDefaultExpandedKeys"(newVal,oldVal){
//console.log('watch:customerOrg.treeCurrentNodekey',newVal,oldVal)
if(newVal && newVal != oldVal){
this.$nextTick(() => {
this.$refs['customerOrgTree'].setCurrentKey(newVal);
})
}
},
"filterText"(newVal,oldVal){ //
this.$refs['customerOrgTree'].filter(newVal);
}
},
};
</script>
<style scoped>
@import "../../assets/css/global.css";
@import "../../assets/css/global_table.css";
@import "../../assets/css/global_tree.css";
@import "../../assets/css/global_button.css";
</style>

114
src/components/menuPage/directorManaMenuTree.vue

@ -0,0 +1,114 @@
<template>
<div>
<!-- <div style="margin:2px 2px 2px 2px;">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
</div> -->
<div
:style="'overflow: scroll;height:' + (window.pageHeight < 600 ? 480 : window.pageHeight - 110) + 'px;background-color: #fff;margin-top: 10px;'">
<el-tree :data="dataTransOpts.tableM.directorManaMenu_info" :props="customerOrg.treeprops" node-key="id" :filter-node-method="filterNode"
:default-expanded-keys="customerOrg.directorDefaultExpandedKeys" @node-click="treeclick" highlight-current
ref="customerOrgTree">
<span class="custom-tree-node" slot-scope="{ node, data }">
<div>
<span class="treeicons">
<!-- <i
class="el-icon-document-remove"
v-if="data.parentId == null"
></i> -->
<img style="width:20px;height:20px;vertical-align: sub;" src="@/assets/images/order.png"
v-if="!data.parentId" />
</span>
<span :class="!data.parentId ? 'maxtitle' : 'mintitle'">{{ node.label }}</span>
</div>
</span>
</el-tree>
</div>
</div>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate } from "../../utlis/proFunc";
export default {
components: {},
data() {
return {
filterText: '',
};
},
//<el-tree :data="$store.state.customerOrg.customerOrgTree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
computed: {
...mapState(["window", "dataTransOpts", "customerOrg"]),
treeHeight() {
let temp = this.window.pageHeaderHeight + this.window.pageMarginHeight + this.window.cardHeaderHeight + 32 + 20
return this.window.pageHeight < 600 ? (600 - temp) : (this.window.pageHeight - temp)
}
},
//
created() {
},
//
mounted() {
//
this.getMenuInfoTree();
},
methods: {
...mapMutations(["setData"]),
//
getMenuInfoTree() {
postapi("/api/app/DirectorMenuInfo/getmenuinfotreelist").then((res) => {
if (res.code != -1) {
this.dataTransOpts.tableM.directorManaMenu_info = res.data
tcdate(this.dataTransOpts.tableM.directorManaMenu_info);
}
});
},
//
treeclick(data) {
this.dataTransOpts.tableS.directorManaMenu_info.id = data.id;
setTimeout(() => {
this.dataTransOpts.refresh.directorManaMenu_info.S++
}, 20);
},
//
filterNode(value, data) {
//console.log(value,data)
if (!value) return true;
return data['displayName'].indexOf(value) !== -1 || data['simpleCode'].indexOf(value.toUpperCase()) !== -1;
}
},
watch: {
"customerOrg.directorTreeCurrentNodekey"(newVal, oldVal) {
//console.log('watch:customerOrg.directorTreeCurrentNodekey',newVal,oldVal)
if (newVal && newVal != oldVal) {
this.$nextTick(() => {
this.$refs['customerOrgTree'].setCurrentKey(newVal);
})
}
},
"filterText"(newVal, oldVal) { //
this.$refs['customerOrgTree'].filter(newVal);
}
},
};
</script>
<style scoped>
@import "../../assets/css/global.css";
@import "../../assets/css/global_tree.css";
:deep .el-tree-node>.el-tree-node__children {
overflow: visible;
}
</style>

6
src/router/index.js

@ -56,6 +56,12 @@ const routes = [{
component: () =>
import ("../views/menuPage/menuPage.vue"),
},
{
path: "/directorManaMenu",
name: "主任管理菜单",
component: () =>
import ("../views/menuPage/directorManaMenu.vue"),
},
// 权限管理 ------------------------------- end -------------------------------
{
path: "/guide-type",

8
src/store/index.js

@ -117,6 +117,8 @@ export default new Vuex.Store({
id: "id",
children: "treeChildren",
}, //树形组件的数据结构
directorDefaultExpandedKeys: [], //主任管理当前选中树的节点
directorTreeCurrentNodekey: '', //主任管理当前选中树的节点
customerOrgId: "", //当前单位ID(可根据此值是否为空,判断是新增还是编辑)
customerOrgRd: { id: "", isLock: "N", isActive: "Y", isLockBox: false, isActiveBox: true, }, //单个体检单位记录值
customerOrgRegisterList: [{ id: 'uuid' }], //单位体检次数登记列表
@ -416,7 +418,6 @@ export default new Vuex.Store({
Photo: "base64编码字符串"
}, //读取身份证信息
},
// 多层数据传递时使用(统一归结在此,便于管理)
dataTransOpts: {
// 强制刷新(如触发数据刷新的ID值没有变化时,但也想强制刷新数据:
@ -434,12 +435,14 @@ export default new Vuex.Store({
customer_org_group_detail: { S: 0, M: 0 }, // 单位分组包含的组合项目明细
charge: { S: 0, M: 0 }, // 收费
menu_info: { S: 0, M: 0 }, // 菜单与页面
directorManaMenu_info: { S: 0, M: 0 }, // 主任管理菜单与页面
lis_request: { S: 0, M: 0 }, // 检验申请(条码)
patient_register: { S: 0, M: 0 }, // 体检人员记录
register_check_asbitem: { S: 0, M: 0, D: 0, OnlyRefreshAsbitem: 0 }, // 体检人员登记的项目(合并前)
register_check: { S: 0, M: 0 }, // 体检人员登记的项目(合并后)
register_check_item: { S: 0, M: 0 }, // 体检人员登记的明细项目
role_menu_info: { S: 0, M: 0 }, // 角色对应的菜单
role_director_menu_info: { S: 0, M: 0 }, // 角色对应的主任管理菜单
sum_diagnosis: { S: 0, M: 0 }, // 总检诊断
sumDoctor: { S: 0, M: 0 }, // 总检--综述 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
@ -466,6 +469,7 @@ export default new Vuex.Store({
customer_org_group_detail: { id: '' }, // 单位分组包含的组合项目明细
charge: { id: '' }, // 收费
menu_info: { id: '' }, // 菜单与页面
directorManaMenu_info: { id: '' }, // 主任管理菜单与页面
lis_request: { id: '' }, // 检验申请(条码)
patient_register: { id: '', patientRegisterNo: '', summaryDoctorId:'',summaryDate:'',auditDoctorId:'',auditDate:'' }, // 体检人员记录
register_check_asbitem: { id: '' }, // 体检人员登记的项目(合并前)
@ -508,6 +512,7 @@ export default new Vuex.Store({
customer_org_group_detail: [], // 单位分组包含的组合项目明细
charge: [], // 收费
menu_info: [], // 菜单与页面
directorManaMenu_info: [], // 主任管理菜单与页面
lis_request: [], // 检验申请(条码)
patient_register: [], // 体检人员记录
register_check_asbitem: [], // 体检人员登记的项目(合并前)
@ -571,6 +576,7 @@ export default new Vuex.Store({
PatientRegisterEditPersonnelTypeBatch:false, // 刷新批量调整人员类别窗口
PatientRegisterEditRemarkBatch:false, // 刷新批量调整备注窗口
MenuPageSet: false, // 设置角色菜单权限
directorMenuPageSet: false, // 设置角色主任管理菜单权限
LocalConfig: false, // 设置窗口
AsbChargeRequest: false, // 收费申请
OccDisease: false, // 职业病

91
src/views/menuPage/directorManaMenu.vue

@ -0,0 +1,91 @@
<template>
<div class="box">
<div>
<div class="middlebox">
<div class="contenttitle">
权限管理 /
<span class="contenttitleBold"
>菜单与页面</span
>
</div>
</div>
<div style="display: flex;margin-top: 7px;">
<!-- 菜单树组件 -->
<div :style="'width: 208px; height:' +(window.pageHeight < 600 ? 480 : window.pageHeight - 110) +'px;background-color: #fff; border-radius: 8px'">
<MenuPageTree />
</div>
<div style="flex: 1;">
<!-- 单位详情 录入与编辑 -->
<div :style="'height:' +(window.pageHeight < 600 ? 480 : window.pageHeight - 100) +'px;margin-left: 15px;position: relative;'">
<MenuPageEdit />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import MenuPageEdit from "../../components/menuPage/directorManaMenuEdit.vue";
import MenuPageTree from "../../components/menuPage/directorManaMenuTree.vue";
export default {
components: {
MenuPageTree,
MenuPageEdit,
},
data() {
return {
tabChoosed: "1",
};
},
created() { },
//
mounted() { },
computed: {
...mapState(["customerOrg", "window"]),
},
methods: {},
};
</script>
<style scoped>
@import "../../assets/css/global_button.css";
@import "../../assets/css/global_dialog.css";
@import "../../assets/css/global_table.css";
@import "../../assets/css/global_form.css";
@import "../../assets/css/global_input.css";
@import "../../assets/css/global.css";
.box {
display: flex;
flex-direction: column;
}
:deep .el-form-item {
margin-bottom: 14px;
}
/* el-dialog的头部样式 */
:deep .el-dialog__header {
padding: 11px 20px 11px;
}
/* el-dialog的主体样式 */
:deep .el-dialog__body {
padding: 0px 20px 0px;
}
/* el-divider样式 */
:deep .el-divider--horizontal {
margin: 0px 0 12px;
}
/* el-dialog的底部样式 */
:deep .el-dialog__footer {
padding: 0px 20px 14px;
}
.seachinput {
width: 250px;
margin-right: 110px;
}
:deep .seachinput .el-select {
width: 100%;
}
</style>

34
src/views/user-list/Role.vue

@ -20,8 +20,8 @@
highlight-current-row
ref="tableData"
>
<el-table-column prop="id" label="编号" width="320" />
<el-table-column prop="name" label="角色名称" width="180">
<el-table-column prop="id" label="编号" align="center" />
<el-table-column prop="name" label="角色名称" align="center">
</el-table-column>
<!--
<el-table-column prop="concurrencyStamp" label="标记">
@ -69,6 +69,11 @@
>菜单权限</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="btnDirectorMenuPageSet" class="commonbutton"
>主任管理菜单</el-button
>
</div>
<div style="margin-top: 10px">
<el-button type="" @click="deletrole" class="deleteButton"
>删除</el-button
@ -195,6 +200,14 @@
>
<MenuPageSet />
</el-dialog>
<el-dialog
title="设置角色主任管理菜单权限"
:visible.sync="dialogWin.directorMenuPageSet"
width="300px"
:close-on-click-modal="false"
>
<directorManaMenuSet />
</el-dialog>
</div>
</template>
@ -212,10 +225,12 @@ import { getapi } from "@/api/api";
import { mapState } from "vuex";
import MenuPageSet from "../../components/menuPage/MenuPageSet.vue";
import directorManaMenuSet from "../../components/menuPage/directorManaMenuSet.vue";
export default {
components: {
MenuPageSet,
directorManaMenuSet
},
data() {
return {
@ -529,6 +544,18 @@ export default {
}, 20);
}
},
btnDirectorMenuPageSet(){
this.form = { ...this.curRow };
if (this.form.id == undefined) {
this.$message.warning("请点击选择操作的数据");
} else {
this.dataTransOpts.tableS.adp_roles.id = this.form.id
this.dialogWin.directorMenuPageSet = true
setTimeout(() => {
this.dataTransOpts.refresh.role_director_menu_info.M++
}, 20);
}
},
},
};
</script>
@ -578,4 +605,7 @@ export default {
overflow: auto;
}
}
:deep .el-table__body{
width: 100%!important;
}
</style>
Loading…
Cancel
Save