|
|
@ -4,7 +4,7 @@ |
|
|
<template #bodyCell="{ column, record }"> |
|
|
<template #bodyCell="{ column, record }"> |
|
|
<template v-if="column.key === 'isDefault'"> |
|
|
<template v-if="column.key === 'isDefault'"> |
|
|
<Tag :color="record.isDefault ? 'red' : 'green'"> |
|
|
<Tag :color="record.isDefault ? 'red' : 'green'"> |
|
|
{{ record.isDefault ? "是" : "否" }} |
|
|
{{ record.isDefault ? '是' : '否' }} |
|
|
</Tag> |
|
|
</Tag> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
@ -15,7 +15,7 @@ |
|
|
@click="openCreateAbpRoleModal" |
|
|
@click="openCreateAbpRoleModal" |
|
|
v-auth="'AbpIdentity.Roles.Create'" |
|
|
v-auth="'AbpIdentity.Roles.Create'" |
|
|
> |
|
|
> |
|
|
{{ t("common.createText") }} |
|
|
{{ t('common.createText') }} |
|
|
</a-button> |
|
|
</a-button> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -66,27 +66,32 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { defineComponent } from "vue"; |
|
|
import { defineComponent } from 'vue'; |
|
|
import { BasicTable, useTable, TableAction } from "/@/components/Table"; |
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
import { tableColumns, searchFormSchema, getTableListAsync, deleteRoleAsync } from "/@/views/admin/roles/AbpRole"; |
|
|
import { |
|
|
import { useModal } from "/@/components/Modal"; |
|
|
tableColumns, |
|
|
import CreateAbpRole from "./CreateAbpRole.vue"; |
|
|
searchFormSchema, |
|
|
import PermissionAbpRole from "./PermissionAbpRole.vue"; |
|
|
getTableListAsync, |
|
|
import EditAbpRole from "./EditAbpRole.vue"; |
|
|
deleteRoleAsync, |
|
|
import { useMessage } from "/@/hooks/web/useMessage"; |
|
|
} from '/@/views/admin/roles/AbpRole'; |
|
|
import { useDrawer } from "/@/components/Drawer"; |
|
|
import { useModal } from '/@/components/Modal'; |
|
|
import { useI18n } from "/@/hooks/web/useI18n"; |
|
|
import CreateAbpRole from './CreateAbpRole.vue'; |
|
|
import { Tag } from "ant-design-vue"; |
|
|
import PermissionAbpRole from './PermissionAbpRole.vue'; |
|
|
|
|
|
import EditAbpRole from './EditAbpRole.vue'; |
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
|
import { useDrawer } from '/@/components/Drawer'; |
|
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
|
|
import { Tag } from 'ant-design-vue'; |
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
export default defineComponent({ |
|
|
name: "AbpRole", |
|
|
name: 'AbpRole', |
|
|
components: { |
|
|
components: { |
|
|
BasicTable, |
|
|
BasicTable, |
|
|
TableAction, |
|
|
TableAction, |
|
|
CreateAbpRole, |
|
|
CreateAbpRole, |
|
|
PermissionAbpRole, |
|
|
PermissionAbpRole, |
|
|
EditAbpRole, |
|
|
EditAbpRole, |
|
|
Tag |
|
|
Tag, |
|
|
}, |
|
|
}, |
|
|
setup() { |
|
|
setup() { |
|
|
const { createConfirm } = useMessage(); |
|
|
const { createConfirm } = useMessage(); |
|
|
@ -103,7 +108,7 @@ export default defineComponent({ |
|
|
columns: tableColumns, |
|
|
columns: tableColumns, |
|
|
formConfig: { |
|
|
formConfig: { |
|
|
labelWidth: 70, |
|
|
labelWidth: 70, |
|
|
schemas: searchFormSchema |
|
|
schemas: searchFormSchema, |
|
|
}, |
|
|
}, |
|
|
api: getTableListAsync, |
|
|
api: getTableListAsync, |
|
|
showTableSetting: true, |
|
|
showTableSetting: true, |
|
|
@ -113,39 +118,39 @@ export default defineComponent({ |
|
|
showIndexColumn: true, |
|
|
showIndexColumn: true, |
|
|
actionColumn: { |
|
|
actionColumn: { |
|
|
width: 200, |
|
|
width: 200, |
|
|
title: t("common.action"), |
|
|
title: t('common.action'), |
|
|
dataIndex: "action", |
|
|
dataIndex: 'action', |
|
|
slots: { |
|
|
slots: { |
|
|
customRender: "action" |
|
|
customRender: 'action', |
|
|
|
|
|
}, |
|
|
|
|
|
fixed: 'right', |
|
|
}, |
|
|
}, |
|
|
fixed: "right" |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 角色编辑 |
|
|
// 角色编辑 |
|
|
const handleEdit = (record: Recordable) => { |
|
|
const handleEdit = (record: Recordable) => { |
|
|
openEditAbpRoleModal(true, { |
|
|
openEditAbpRoleModal(true, { |
|
|
record: record |
|
|
record: record, |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 角色授权 |
|
|
// 角色授权 |
|
|
const handlePermission = (record: Recordable) => { |
|
|
const handlePermission = (record: Recordable) => { |
|
|
openPermissionAbpRoleDrawer(true, { |
|
|
openPermissionAbpRoleDrawer(true, { |
|
|
record: record |
|
|
record: record, |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 删除角色 |
|
|
// 删除角色 |
|
|
const handleDelete = async (record: Recordable) => { |
|
|
const handleDelete = async (record: Recordable) => { |
|
|
let msg = t("common.askDelete"); |
|
|
let msg = t('common.askDelete'); |
|
|
createConfirm({ |
|
|
createConfirm({ |
|
|
iconType: "warning", |
|
|
iconType: 'warning', |
|
|
title: t("common.tip"), |
|
|
title: t('common.tip'), |
|
|
content: msg, |
|
|
content: msg, |
|
|
onOk: async () => { |
|
|
onOk: async () => { |
|
|
await deleteRoleAsync({ roleId: record.id, reload }); |
|
|
await deleteRoleAsync({ roleId: record.id, reload }); |
|
|
} |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -160,8 +165,8 @@ export default defineComponent({ |
|
|
openCreateAbpRoleModal, |
|
|
openCreateAbpRoleModal, |
|
|
registerPermissionAbpRoleModal, |
|
|
registerPermissionAbpRoleModal, |
|
|
registerEditAbpRoleModal, |
|
|
registerEditAbpRoleModal, |
|
|
reload |
|
|
reload, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|