| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="项目名"> |
| | | <el-select v-model="ruleForm.projectId" controls-position="right" placeholder="请输入排序" class="w100"> |
| | | <el-option |
| | | v-for="item in projectList" |
| | | :key="item.key" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="菜单排序"> |
| | | <el-input-number v-model="ruleForm.priority" controls-position="right" placeholder="请输入排序" class="w100"/> |
| | | </el-form-item> |
| | |
| | | btnPower: '', // 菜单类型为按钮时,权限标识 |
| | | }, |
| | | menuData: [], // 上级菜单数据 |
| | | projectList:[ |
| | | {id:'1',name:'基础数据权限管理系统',key:0}, |
| | | {id:'2',name:'系统1',key:1}, |
| | | {id:'3',name:'系统2',key:2}, |
| | | {id:'4',name:'系统3',key:3}, |
| | | {id:'5',name:'系统4',key:4}, |
| | | {id:'6',name:'应急管理系统',key:5}, |
| | | {id:'7',name:'目标责任管理系统',key:6}, |
| | | {id:'8',name:'事故管理系统',key:7}, |
| | | {id:'9',name:'设备综合管控系统',key:8}, |
| | | ], |
| | | }); |
| | | // 获取 vuex 中的路由 |
| | | const getMenuList = (routes: any) => { |
| | |
| | | // 打开弹窗 |
| | | const openDialog = (type:string,value:any) => { |
| | | state.isShowDialog = true; |
| | | if(type === '新增'){ |
| | | if(type === '新增菜单'){ |
| | | state.buttonName = '新增' |
| | | state.title = '新增菜单' |
| | | state.ruleForm = { |
| | | projectId:Session.get('projectId'), |
| | | projectId:'', |
| | | parentId:0, |
| | | menuSuperior: [], |
| | | menuType: 'menu', |
| | |
| | | let menuId = JSON.parse(JSON.stringify(state.ruleForm.menuSuperior)) |
| | | state.ruleForm.parentId = menuId[menuId.length - 1] |
| | | } |
| | | if(state.title === '新增'){ |
| | | if(state.title === '新增菜单'){ |
| | | let res = await useMenuApi().addMenu(state.ruleForm) |
| | | if(res.data.code === '200'){ |
| | | ElMessage({ |