Commit 70707947 authored by 黄奎's avatar 黄奎

页面修改

parent e2a711e6
...@@ -142,7 +142,8 @@ module.exports = function(ctx) { ...@@ -142,7 +142,8 @@ module.exports = function(ctx) {
'QTr', 'QTr',
'QTd', 'QTd',
'QCard', 'QCard',
'QCheckbox' 'QCheckbox',
'QTree',
], ],
// directives: [], // directives: [],
......
...@@ -11,11 +11,16 @@ ...@@ -11,11 +11,16 @@
class="col-6 q-pr-lg q-pb-lg" label="角色名称" :rules="[val => !!val || '请填写角色名称']" /> class="col-6 q-pr-lg q-pb-lg" label="角色名称" :rules="[val => !!val || '请填写角色名称']" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.RoleIntro" ref="RoleIntro" <q-input filled stack-label maxlength="100" :dense="false" v-model="objOption.RoleIntro" ref="RoleIntro"
class="col-6 q-pr-lg q-pb-lg" label="角色介绍" /> class="col-6 q-pr-lg q-pb-lg" label="角色介绍" />
<div class="col-6 q-pr-lg q-pb-lg q-pt-lg"> <div class="col-12 q-pr-lg q-pb-lg q-pt-lg">
<q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0" <q-toggle size="md" label="状态" color="primary" :false-value="1" :true-value="0"
v-model="objOption.Status" /> v-model="objOption.Status" />
<div class="text-grey-6 text-caption">注意:关闭后,角色将无法正常使用.</div> <div class="text-grey-6 text-caption">注意:关闭后,角色将无法正常使用.</div>
</div> </div>
<div class="q-pa-md q-gutter-sm">
<q-tree :nodes="TreeMenuList" node-key="MenuId" label-key="MenuName" children-key="SubList"
tick-strategy="leaf-filtered" default-expand-all :ticked.sync="checkMenuArray" no-connectors>
</q-tree>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
...@@ -53,8 +58,10 @@ ...@@ -53,8 +58,10 @@
}, },
optionTitle: "", optionTitle: "",
//菜单列表 //菜单列表
MenuList: [], TreeMenuList: [],
saveLoading: false, saveLoading: false,
//选中的节点
checkMenuArray: [],
} }
}, },
mounted() { mounted() {
...@@ -62,17 +69,15 @@ ...@@ -62,17 +69,15 @@
this.initObj() this.initObj()
}, },
methods: { methods: {
//获取菜单列表 //获取菜单列表
queryMenuList() { queryMenuList() {
this.MenuList = []; this.TreeMenuList = [];
var qMsg = { var qMsg = {}
}
queryTreeMenu(qMsg).then(res => { queryTreeMenu(qMsg).then(res => {
console.log("res", res); this.TreeMenuList = res.Data;
}) })
}, },
//初始化表单 //初始化表单
initObj() { initObj() {
if (this.saveObj && this.saveObj.RoleId > 0) { if (this.saveObj && this.saveObj.RoleId > 0) {
...@@ -84,6 +89,7 @@ ...@@ -84,6 +89,7 @@
this.objOption.RoleIntro = res.Data.RoleIntro; this.objOption.RoleIntro = res.Data.RoleIntro;
this.objOption.RoleAuth = res.Data.RoleAuth; this.objOption.RoleAuth = res.Data.RoleAuth;
this.objOption.Status = res.Data.Status; this.objOption.Status = res.Data.Status;
this.checkMenuArray=res.Data.CheckMenuList;
}) })
this.optionTitle = "修改角色信息" this.optionTitle = "修改角色信息"
} else { } else {
...@@ -102,6 +108,16 @@ ...@@ -102,6 +108,16 @@
}, },
//保存菜单 //保存菜单
saveRole() { saveRole() {
var tempKeys = "";
if (this.checkMenuArray && this.checkMenuArray.length > 0) {
this.checkMenuArray.forEach(item => {
tempKeys += "," + item;
})
}
if (tempKeys && tempKeys != '') {
tempKeys = tempKeys.substring(1, tempKeys.length);
}
this.objOption.RoleAuth = tempKeys;
this.saveLoading = true this.saveLoading = true
saveRoleInfo(this.objOption).then(res => { saveRoleInfo(this.objOption).then(res => {
this.saveLoading = false this.saveLoading = false
......
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