|
@@ -21,7 +21,9 @@
|
|
|
:label="item.name"
|
|
|
:key="item.actionid"
|
|
|
v-model="item.checked"
|
|
|
- :disabled="(radio1 == 1 ||scope.row.menu=='权限管理')? true : false"
|
|
|
+ :disabled="
|
|
|
+ radio1 == 1 || scope.row.menu == '权限管理' ? true : false
|
|
|
+ "
|
|
|
@change="handleCheckedChange"
|
|
|
></el-checkbox>
|
|
|
</template>
|
|
@@ -63,10 +65,10 @@ export default defineComponent({
|
|
|
function saveMenu() {
|
|
|
console.log('checkedArr')
|
|
|
console.log(checkedArr.value)
|
|
|
- if(checkedArr.value.length==0){
|
|
|
-
|
|
|
- ElMessage.warning('权限不能为空! 请至少选择一个权限按钮')
|
|
|
- return
|
|
|
+
|
|
|
+ if (checkedArr.value.length == 0) {
|
|
|
+ ElMessage.warning('菜单权限不能为空! 请至少选择一个菜单查询权限')
|
|
|
+ return
|
|
|
}
|
|
|
api
|
|
|
.saveMenu({
|
|
@@ -111,22 +113,27 @@ export default defineComponent({
|
|
|
props.menuData2.forEach(function (item) {
|
|
|
if (item.children) {
|
|
|
item.children.forEach(function (a) {
|
|
|
- a.authority.forEach(function (i) {
|
|
|
+ if (a.authority[0].checked) {
|
|
|
+ a.authority.forEach(function (i) {
|
|
|
+ if (i.checked) {
|
|
|
+ checkedArr.value.push(i.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 如果查询的id被选中,那么塞入数组
|
|
|
+ if (item.authority[0].checked) {
|
|
|
+ item.authority.forEach(function (i) {
|
|
|
if (i.checked) {
|
|
|
checkedArr.value.push(i.id)
|
|
|
}
|
|
|
})
|
|
|
- })
|
|
|
- } else {
|
|
|
- item.authority.forEach(function (i) {
|
|
|
- if (i.checked) {
|
|
|
- checkedArr.value.push(i.id)
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
- // console.log('checkedArr.value')
|
|
|
- // console.log(checkedArr.value)
|
|
|
+ console.log('checkedArr.value')
|
|
|
+ console.log(checkedArr.value)
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|