|
@@ -27,6 +27,13 @@
|
|
|
@click="toEdit(scope.row)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ v-if="!scope.row.defaultRole"
|
|
|
+ class="btn-danger"
|
|
|
+ type="text"
|
|
|
+ @click="toDelete(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -43,6 +50,7 @@
|
|
|
<script>
|
|
|
import { ABLE_TYPE } from "@/constants/enumerate";
|
|
|
import { userRoleListPage } from "../api";
|
|
|
+import { deleteRole } from "../../base/api";
|
|
|
import ModifySystemRole from "../components/ModifySystemRole";
|
|
|
|
|
|
export default {
|
|
@@ -78,6 +86,17 @@ export default {
|
|
|
toAdd() {
|
|
|
this.curRole = {};
|
|
|
this.$refs.ModifySystemRole.open();
|
|
|
+ },
|
|
|
+ toDelete(row) {
|
|
|
+ this.$confirm(`确定要删除角色【${row.name}】吗?`, "提示", {
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ await deleteRole([row.id]);
|
|
|
+ this.$message.success("删除成功!");
|
|
|
+ this.deletePageLastItem();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
}
|
|
|
}
|
|
|
};
|