| | |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="角色名称"> |
| | | <el-input v-model="roleForm.name" placeholder="请输入角色名称" clearable></el-input> |
| | | <el-input v-model="roleForm.roleName" placeholder="请输入角色名称" clearable></el-input> |
| | | </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 v-model="roleForm.code" placeholder="请输入角色标识" clearable></el-input> |
| | | <el-input v-model="roleForm.roleCode" placeholder="请输入角色标识" clearable></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="角色描述"> |
| | | <el-input v-model="roleForm.info" type="textarea" placeholder="请输入角色描述" maxlength="150"></el-input> |
| | | <el-input v-model="roleForm.roleInfo" type="textarea" placeholder="请输入角色描述" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <script lang="ts"> |
| | | import { ElMessage } from 'element-plus'; |
| | | import { reactive, toRefs, defineComponent } from 'vue'; |
| | | import {departmentApi} from "/@/api/department"; |
| | | import {useRoleApi} from "/@/api/role"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | |
| | | buttonName:string, |
| | | isShowRoleDialog: boolean; |
| | | roleForm: { |
| | | name: string; |
| | | code: string; |
| | | info: string; |
| | | roleName: string; |
| | | roleCode: string; |
| | | roleInfo: string; |
| | | }; |
| | | menuData: Array<MenuDataTree>; |
| | | menuProps: { |
| | |
| | | title:'', |
| | | buttonName:'', |
| | | roleForm: { |
| | | name: '', // 角色名称 |
| | | code: '', // 角色标识 |
| | | info: '', // 排序 |
| | | roleName: '', // 角色名称 |
| | | roleCode: '', // 角色标识 |
| | | roleInfo: '', // 排序 |
| | | }, |
| | | menuData: [], |
| | | menuProps: { |
| | |
| | | state.title = '新增角色' |
| | | state.buttonName = '新增' |
| | | state.roleForm = { |
| | | name:'', |
| | | code:'', |
| | | info:'', |
| | | roleName:'', |
| | | roleCode:'', |
| | | roleInfo:'', |
| | | } |
| | | }else{ |
| | | state.title = '修改角色' |