|
@@ -5,7 +5,7 @@
|
|
|
<el-button type="primary" @click="saveMenu()">保存</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <el-table :data="menuData" border stripe :cell-style="cellStyle">
|
|
|
+ <el-table :data="menuData" border stripe>
|
|
|
<el-table-column prop="label" label="菜单" width="180"></el-table-column>
|
|
|
<el-table-column prop="authority2" label="权限" class="roleLeft">
|
|
|
<template #default="scope">
|
|
@@ -13,8 +13,8 @@
|
|
|
v-model="scope.row.authority2"
|
|
|
@change="listTabsChange(scope.row)"
|
|
|
>
|
|
|
- <el-radio label="1">是</el-radio>
|
|
|
- <el-radio label="0">否</el-radio>
|
|
|
+ <el-radio label="1" :disabled="radio1==1? true: false">是</el-radio>
|
|
|
+ <el-radio label="0" :disabled="radio1==1? true: false">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -23,17 +23,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { defineComponent, ref, onMounted } from 'vue'
|
|
|
+import { defineComponent, ref, onMounted, watch } from 'vue'
|
|
|
import * as api from '@/api/systemManage/rolePermission.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'RoleInfoCom',
|
|
|
- props: {
|
|
|
- menuData: Object,
|
|
|
- objItem: Object,
|
|
|
- radio1: Number,
|
|
|
- },
|
|
|
+ props: ['menuData', 'objItem', 'radio1'],
|
|
|
+
|
|
|
+ // props: {
|
|
|
+ // menuData: Object,
|
|
|
+ // objItem: Object,
|
|
|
+ // radio1: String,
|
|
|
+ // },
|
|
|
|
|
|
setup(props) {
|
|
|
const aa = ref([])
|
|
@@ -56,12 +58,10 @@ export default defineComponent({
|
|
|
})
|
|
|
.then((requset) => {
|
|
|
if (requset.status === 'SUCCESS') {
|
|
|
-
|
|
|
ElMessage.success({
|
|
|
- message: '权限修改成功',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
-
|
|
|
+ message: '权限修改成功',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
@@ -84,19 +84,47 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- props.menuData.forEach(function (item) {
|
|
|
- if (item.authority2 == '1') {
|
|
|
- saveArr.value.push(item.id)
|
|
|
- }
|
|
|
- })
|
|
|
+ // if (props.radio1 == 1) {
|
|
|
+ // alert(1)
|
|
|
+ // props.menuData.forEach(function (item) {
|
|
|
+ // item.authority2 = '1'
|
|
|
+ // saveArr.value.push(item.id)
|
|
|
+ // })
|
|
|
+ // console.log(' props.menuData')
|
|
|
+ // console.log(props.menuData)
|
|
|
+ // } else {
|
|
|
+ // props.menuData.forEach(function (item) {
|
|
|
+ // if (item.authority2 == '1') {
|
|
|
+ // saveArr.value.push(item.id)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
})
|
|
|
+ //监听变化
|
|
|
+ watch(
|
|
|
+ () => props.radio1,
|
|
|
+ (newVal) => {
|
|
|
+ newVal
|
|
|
+
|
|
|
+ // console.log('newVal')
|
|
|
+ // console.log(newVal)
|
|
|
+ // if (newVal == '1') {
|
|
|
+ // alert(1)
|
|
|
+ // props.menuData.forEach(function (item) {
|
|
|
+ // item.authority2 = '1'
|
|
|
+ // saveArr.value.push(item.id)
|
|
|
+ // })
|
|
|
+ // console.log(' 22props.menuData')
|
|
|
+ // console.log(props.menuData)
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
return {
|
|
|
saveMenu,
|
|
|
aa,
|
|
|
listTabsChange,
|
|
|
saveArr,
|
|
|
- // cellStyle
|
|
|
}
|
|
|
},
|
|
|
})
|