| | |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <!-- <el-input size="default" placeholder="请输入角色名称" style="max-width: 180px"> </el-input>--> |
| | | <el-button size="default" type="primary" class="ml10" @click="handleSearch"> |
| | | <el-icon> |
| | | <ele-Search /> |
| | | </el-icon> |
| | | 查询 |
| | | </el-button> |
| | | <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> |
| | | <el-icon> |
| | | <ele-FolderAdd /> |
| | | </el-icon> |
| | | 新增角色 |
| | | </el-button> |
| | | <!-- <el-button size="default" type="primary" class="ml10" @click="handleSearch">--> |
| | | <!-- <el-icon>--> |
| | | <!-- <ele-Search />--> |
| | | <!-- </el-icon>--> |
| | | <!-- 查询--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')">--> |
| | | <!-- <el-icon>--> |
| | | <!-- <ele-FolderAdd />--> |
| | | <!-- </el-icon>--> |
| | | <!-- 新增角色--> |
| | | <!-- </el-button>--> |
| | | </div> |
| | | <el-table :data="tableData.data" style="width: 100%"> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="roleName" label="角色名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="roleCode" label="角色标识" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="roleInfo" label="角色描述" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="角色名称" show-overflow-tooltip align="center"></el-table-column> |
| | | <el-table-column label="操作" width="150"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="onOpenDialogRef('新增', '')">新增</el-button> |
| | | <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> |
| | | <el-button size="small" style="color: red" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | |
| | | // 初始化表格数据 |
| | | const initRoleTableData = async () => { |
| | | let res = await useRoleApi().getRoleList(); |
| | | if (res.data.code === '200') { |
| | | if (res.data.code === 100) { |
| | | state.tableData.data = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | |
| | | }) |
| | | .then(async () => { |
| | | let res = await useRoleApi().deleteRole({ roleId: row.roleId }); |
| | | if (res.data.code === '200') { |
| | | if (res.data.code === 100) { |
| | | ElMessage({ |
| | | type: 'success', |
| | | duration: 2000, |