| | |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="权限字符" prop="roleKey"> |
| | | <el-form-item label="角色编号" prop="roleKey"> |
| | | <el-input |
| | | v-model="queryParams.roleKey" |
| | | placeholder="请输入权限字符" |
| | | placeholder="请输入角色编号" |
| | | clearable |
| | | size="small" |
| | | style="width: 240px" |
| | |
| | | |
| | | <el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="角色编号" prop="roleId" width="120" /> |
| | | <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="显示顺序" prop="roleSort" width="100" /> |
| | | <el-table-column label="状态" align="center" width="100"> |
| | | <el-table-column label="序号" width="150"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" min-width="150" /> |
| | | <el-table-column label="角色编号" prop="roleKey" :show-overflow-tooltip="true" min-width="150" /> |
| | | <el-table-column label="显示顺序" prop="roleSort" width="150" /> |
| | | <el-table-column label="状态" align="center" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | class="del-btn" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:role:remove']" |
| | | >删除</el-button> |
| | |
| | | /> |
| | | |
| | | <!-- 添加或修改角色配置对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <Dialog :title="title" :visible.sync="open" width="500px" :append-to-body="true" :close-on-click-modal="false"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-form-item label="角色名称" prop="roleName"> |
| | | <el-input v-model="form.roleName" placeholder="请输入角色名称" /> |
| | | </el-form-item> |
| | | <el-form-item prop="roleKey"> |
| | | <span slot="label"> |
| | | <el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> |
| | | <el-tooltip content="控制器中定义的角色编号,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top"> |
| | | <i class="el-icon-question"></i> |
| | | </el-tooltip> |
| | | 权限字符 |
| | | 角色编号 |
| | | </span> |
| | | <el-input v-model="form.roleKey" placeholder="请输入权限字符" /> |
| | | <el-input v-model="form.roleKey" placeholder="请输入角色编号" /> |
| | | </el-form-item> |
| | | <el-form-item label="角色顺序" prop="roleSort"> |
| | | <el-input-number v-model="form.roleSort" controls-position="right" :min="0" /> |
| | |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </Dialog> |
| | | |
| | | <!-- 分配角色数据权限对话框 --> |
| | | <el-dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body> |
| | | <Dialog :title="title" :visible.sync="openDataScope" width="500px" append-to-body> |
| | | <el-form :model="form" label-width="80px"> |
| | | <el-form-item label="角色名称"> |
| | | <el-input v-model="form.roleName" :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="权限字符"> |
| | | <el-form-item label="角色编号"> |
| | | <el-input v-model="form.roleKey" :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="权限范围"> |
| | |
| | | <el-button type="primary" @click="submitDataScope">确 定</el-button> |
| | | <el-button @click="cancelDataScope">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </Dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | { required: true, message: "角色名称不能为空", trigger: "blur" } |
| | | ], |
| | | roleKey: [ |
| | | { required: true, message: "权限字符不能为空", trigger: "blur" } |
| | | { required: true, message: "角色编号不能为空", trigger: "blur" } |
| | | ], |
| | | roleSort: [ |
| | | { required: true, message: "角色顺序不能为空", trigger: "blur" } |
| | |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const roleIds = row.roleId || this.ids; |
| | | this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() { |
| | | this.$modal.confirm('是否确认删除?').then(function() { |
| | | return delRole(roleIds); |
| | | }).then(() => { |
| | | this.getList(); |