功能变化: 优化-角色权限点击子级半勾选父级

pull/57/MERGE
猿小天 2022-05-16 20:28:59 +08:00
parent be5b443d01
commit ada11dc244
2 changed files with 8 additions and 7 deletions

View File

@ -35,8 +35,8 @@ from dvadmin.system.views.system_config import InitSettingsViewSet
from dvadmin.utils.swagger import CustomOpenAPISchemaGenerator
# =========== 初始化系统配置 =================
dispatch.init_system_config()
dispatch.init_dictionary()
# dispatch.init_system_config()
# dispatch.init_dictionary()
# =========== 初始化系统配置 =================
schema_view = get_schema_view(

View File

@ -93,7 +93,7 @@
:default-checked-keys="menuCheckedKeys"
:check-on-click-node="false"
empty-text="请先选择角色"
:check-strictly="true"
:check-strictly="false"
@check-change="handleCheckClick"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
@ -104,8 +104,7 @@
v-for="(item, index) in data.menuPermission"
:key="index"
v-model="item.checked"
>{{ item.name }}</el-checkbox
>
>{{ item.name }}</el-checkbox>
</div>
</div>
</span>
@ -288,14 +287,16 @@ export default {
* @param data
*/
handleCheckClick (data, checked) {
console.log(data,checked)
const {
menuPermission,
children
children,
parent
} = data
for (const item of menuPermission) {
this.$set(item, 'checked', checked)
}
if (children) {
if (children && parent) {
for (const item of children) {
this.$refs.menuTree.setChecked(item.id, checked)
}