|
@@ -74,7 +74,9 @@ const handleCheckAllChange = (checkAll, index, item, subIndex) => {
|
|
|
subIndex
|
|
|
].checkList.findIndex(findItem => findItem === String(element.id));
|
|
|
if (checkAll && findindex == -1) {
|
|
|
- menuactionList.value[index].child[subIndex].checkList.push(String(element.id));
|
|
|
+ menuactionList.value[index].child[subIndex].checkList.push(
|
|
|
+ String(element.id)
|
|
|
+ );
|
|
|
} else if (!checkAll && findindex > -1) {
|
|
|
menuactionList.value[index].child[subIndex].checkList.splice(
|
|
|
findindex,
|
|
@@ -92,7 +94,9 @@ const handleFieldAllChange = (fieldAll, index, item, subIndex) => {
|
|
|
subIndex
|
|
|
].fieldList.findIndex(findItem => findItem === String(element.id));
|
|
|
if (fieldAll && findindex == -1) {
|
|
|
- menuactionList.value[index].child[subIndex].fieldList.push(String(element.id));
|
|
|
+ menuactionList.value[index].child[subIndex].fieldList.push(
|
|
|
+ String(element.id)
|
|
|
+ );
|
|
|
} else if (!fieldAll && findindex > -1) {
|
|
|
menuactionList.value[index].child[subIndex].fieldList.splice(
|
|
|
findindex,
|
|
@@ -448,21 +452,51 @@ let indeterminateField = computed(() => {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <el-dialog :close-on-press-escape="false" v-model="showModelThis" append-to-body center :top="'5vh'" :width="'900px'"
|
|
|
- :title="titleType" v-loading="loading" @close="closeDialog">
|
|
|
- <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="90px" class="role-addedit" :size="formSize"
|
|
|
- status-icon>
|
|
|
+ <el-dialog
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-model="showModelThis"
|
|
|
+ append-to-body
|
|
|
+ center
|
|
|
+ :top="'5vh'"
|
|
|
+ :width="'900px'"
|
|
|
+ :title="titleType"
|
|
|
+ v-loading="loading"
|
|
|
+ @close="closeDialog"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="ruleFormRef"
|
|
|
+ :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ label-width="90px"
|
|
|
+ class="role-addedit"
|
|
|
+ :size="formSize"
|
|
|
+ status-icon
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="角色名称" prop="role_name">
|
|
|
- <el-input v-model="ruleForm.role_name" :disabled="editType == 'view'" placeholder="角色名称" />
|
|
|
- </el-form-item></el-col>
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.role_name"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ placeholder="角色名称"
|
|
|
+ /> </el-form-item
|
|
|
+ ></el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="角色等级" prop="level">
|
|
|
- <el-select v-model="ruleForm.level" style="width: 100%" :disabled="editType == 'view'" placeholder="菜单类型">
|
|
|
- <el-option v-for="(si, sii) in levelList" :key="'type' + si.value + sii" :label="si.label"
|
|
|
- :value="si.value" />
|
|
|
- </el-select> </el-form-item></el-col>
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.level"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ placeholder="菜单类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(si, sii) in levelList"
|
|
|
+ :key="'type' + si.value + sii"
|
|
|
+ :label="si.label"
|
|
|
+ :value="si.value"
|
|
|
+ />
|
|
|
+ </el-select> </el-form-item
|
|
|
+ ></el-col>
|
|
|
<el-col :span="24">
|
|
|
<div class="quanxian-main">
|
|
|
<div class="quanxian-title">
|
|
@@ -474,58 +508,98 @@ let indeterminateField = computed(() => {
|
|
|
</div>
|
|
|
<div class="rule-view">
|
|
|
<div class="rule-list">
|
|
|
- <el-row v-for="(item, index) in menuactionList" :key="'menu' + item.id + index">
|
|
|
- <el-col v-if="item.child && item.child.length > 0" class="ffff" :span="24">
|
|
|
+ <el-row
|
|
|
+ v-for="(item, index) in menuactionList"
|
|
|
+ :key="'menu' + item.id + index"
|
|
|
+ >
|
|
|
+ <el-col
|
|
|
+ v-if="item.child && item.child.length > 0"
|
|
|
+ class="ffff"
|
|
|
+ :span="24"
|
|
|
+ >
|
|
|
<div class="ftitle">
|
|
|
- <div v-for="(si, sii) in item.menu_name" :key="'title' + sii + si">
|
|
|
+ <div
|
|
|
+ v-for="(si, sii) in item.menu_name"
|
|
|
+ :key="'title' + sii + si"
|
|
|
+ >
|
|
|
{{ si }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fbody">
|
|
|
- <div class="fbody-item" v-for="(subItem, subIndex) in item.child"
|
|
|
- :key="'yemian' + subItem.id + subIndex">
|
|
|
- <template v-if="
|
|
|
- !(
|
|
|
- subItem.action &&
|
|
|
- subItem.action.length == 0 &&
|
|
|
- subItem.action_data &&
|
|
|
- subItem.action_data.length == 0
|
|
|
- )
|
|
|
- ">
|
|
|
+ <div
|
|
|
+ class="fbody-item"
|
|
|
+ v-for="(subItem, subIndex) in item.child"
|
|
|
+ :key="'yemian' + subItem.id + subIndex"
|
|
|
+ >
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ !(
|
|
|
+ subItem.action &&
|
|
|
+ subItem.action.length == 0 &&
|
|
|
+ subItem.action_data &&
|
|
|
+ subItem.action_data.length == 0
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
<div class="stitle">
|
|
|
<span class="_h2">{{ subItem.menu_name }}</span>
|
|
|
- <el-radio-group style="margin: 0 0 0 20px" :size="'mini'" v-if="
|
|
|
- subItem &&
|
|
|
- subItem.private &&
|
|
|
- subItem.private.length == 2
|
|
|
- " v-model="subItem.is_private_change">
|
|
|
- <el-radio-button v-for="(radioN, ri) in subItem.private" :key="radioN.label + ri"
|
|
|
- :label="String(radioN.id)">{{ radioN.label }}</el-radio-button>
|
|
|
+ <el-radio-group
|
|
|
+ style="margin: 0 0 0 20px"
|
|
|
+ :size="'mini'"
|
|
|
+ v-if="
|
|
|
+ subItem &&
|
|
|
+ subItem.private &&
|
|
|
+ subItem.private.length == 2
|
|
|
+ "
|
|
|
+ v-model="subItem.is_private_change"
|
|
|
+ >
|
|
|
+ <el-radio-button
|
|
|
+ v-for="(radioN, ri) in subItem.private"
|
|
|
+ :key="radioN.label + ri"
|
|
|
+ :label="String(radioN.id)"
|
|
|
+ >{{ radioN.label }}</el-radio-button
|
|
|
+ >
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
- <div class="scheck" v-if="subItem.action && subItem.action.length > 0">
|
|
|
+ <div
|
|
|
+ class="scheck"
|
|
|
+ v-if="subItem.action && subItem.action.length > 0"
|
|
|
+ >
|
|
|
<div class="checkAll">
|
|
|
- <el-checkbox v-model="subItem.checkAll" :disabled="editType == 'view'"
|
|
|
- :indeterminate="indeterminateCheck(subItem)" @change="
|
|
|
+ <el-checkbox
|
|
|
+ v-model="subItem.checkAll"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ :indeterminate="indeterminateCheck(subItem)"
|
|
|
+ @change="
|
|
|
handleCheckAllChange(
|
|
|
$event,
|
|
|
index,
|
|
|
item,
|
|
|
subIndex
|
|
|
)
|
|
|
- ">功能全选</el-checkbox>
|
|
|
+ "
|
|
|
+ >功能全选</el-checkbox
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="checkItem">
|
|
|
- <el-checkbox-group v-model="subItem.checkList" :disabled="editType == 'view'" @change="
|
|
|
- handleCheckedGroupChange(
|
|
|
- $event,
|
|
|
- index,
|
|
|
- item,
|
|
|
- subIndex
|
|
|
- )
|
|
|
- ">
|
|
|
- <el-checkbox :disabled="editType == 'view'" v-for="children in subItem.action"
|
|
|
- :key="'checkItem' + children.id" :label="String(children.id)" @change="
|
|
|
+ <el-checkbox-group
|
|
|
+ v-model="subItem.checkList"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ @change="
|
|
|
+ handleCheckedGroupChange(
|
|
|
+ $event,
|
|
|
+ index,
|
|
|
+ item,
|
|
|
+ subIndex
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ v-for="children in subItem.action"
|
|
|
+ :key="'checkItem' + children.id"
|
|
|
+ :label="String(children.id)"
|
|
|
+ @change="
|
|
|
handleCheckedChange(
|
|
|
$event,
|
|
|
String(children.id),
|
|
@@ -533,36 +607,54 @@ let indeterminateField = computed(() => {
|
|
|
subIndex,
|
|
|
item
|
|
|
)
|
|
|
- ">{{ children.action_name }}</el-checkbox>
|
|
|
+ "
|
|
|
+ >{{ children.action_name }}</el-checkbox
|
|
|
+ >
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="sfield" v-if="
|
|
|
- subItem.action_data &&
|
|
|
- subItem.action_data.length > 0
|
|
|
- ">
|
|
|
+ <div
|
|
|
+ class="sfield"
|
|
|
+ v-if="
|
|
|
+ subItem.action_data &&
|
|
|
+ subItem.action_data.length > 0
|
|
|
+ "
|
|
|
+ >
|
|
|
<div class="checkAll">
|
|
|
- <el-checkbox v-model="subItem.fieldAll" :disabled="editType == 'view'"
|
|
|
- :indeterminate="indeterminateField(subItem)" @change="
|
|
|
+ <el-checkbox
|
|
|
+ v-model="subItem.fieldAll"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ :indeterminate="indeterminateField(subItem)"
|
|
|
+ @change="
|
|
|
handleFieldAllChange(
|
|
|
$event,
|
|
|
index,
|
|
|
item,
|
|
|
subIndex
|
|
|
)
|
|
|
- ">字段全选</el-checkbox>
|
|
|
+ "
|
|
|
+ >字段全选</el-checkbox
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="checkItem">
|
|
|
- <el-checkbox-group v-model="subItem.fieldList" :disabled="editType == 'view'" @change="
|
|
|
- handleFieldGroupChange(
|
|
|
- $event,
|
|
|
- index,
|
|
|
- item,
|
|
|
- subIndex
|
|
|
- )
|
|
|
- ">
|
|
|
- <el-checkbox v-for="children in subItem.action_data" :key="'FieldItem' + children.id"
|
|
|
- :label="String(children.id)" :disabled="editType == 'view'" @change="
|
|
|
+ <el-checkbox-group
|
|
|
+ v-model="subItem.fieldList"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ @change="
|
|
|
+ handleFieldGroupChange(
|
|
|
+ $event,
|
|
|
+ index,
|
|
|
+ item,
|
|
|
+ subIndex
|
|
|
+ )
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-checkbox
|
|
|
+ v-for="children in subItem.action_data"
|
|
|
+ :key="'FieldItem' + children.id"
|
|
|
+ :label="String(children.id)"
|
|
|
+ :disabled="editType == 'view'"
|
|
|
+ @change="
|
|
|
handleFieldChange(
|
|
|
$event,
|
|
|
String(children.id),
|
|
@@ -570,7 +662,9 @@ let indeterminateField = computed(() => {
|
|
|
subIndex,
|
|
|
item
|
|
|
)
|
|
|
- ">{{ children.field_name }}</el-checkbox>
|
|
|
+ "
|
|
|
+ >{{ children.field_name }}</el-checkbox
|
|
|
+ >
|
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -585,9 +679,17 @@ let indeterminateField = computed(() => {
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-col :span="24" class="clear">
|
|
|
- <el-button v-if="editType == 'add' || editType == 'edit'" type="primary" class="fr" style="margin: 0 0 0 16px"
|
|
|
- @click="submitForm(ruleFormRef)">保存</el-button>
|
|
|
- <el-button class="fr" style="margin: 0 0 0 16px" @click="closeDialog">关闭</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="editType == 'add' || editType == 'edit'"
|
|
|
+ type="primary"
|
|
|
+ class="fr"
|
|
|
+ style="margin: 0 0 0 16px"
|
|
|
+ @click="submitForm(ruleFormRef)"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button class="fr" style="margin: 0 0 0 16px" @click="closeDialog"
|
|
|
+ >关闭</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-dialog>
|