refactor platform menus and entity statuses
This commit is contained in:
@@ -439,8 +439,8 @@ function openStatus(row: Row) {
|
||||
type: 'select',
|
||||
required: true,
|
||||
options: [
|
||||
{ label: '启用', value: 'enabled' },
|
||||
{ label: '停用', value: 'disabled' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
{ label: '归档', value: 'archived' },
|
||||
],
|
||||
},
|
||||
@@ -606,7 +606,7 @@ onMounted(async () => {
|
||||
if (props.definition.fields.some((field) => field.key === 'platform_role_code')) {
|
||||
const result = await platformApi.listRole();
|
||||
roleOptions.value = result.list.filter(
|
||||
(role) => !role.is_system && role.status === 'enabled',
|
||||
(role) => !role.is_system && role.status === 1,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<a-space>
|
||||
{{ node.title }}
|
||||
<a-button v-if="canEdit" size="mini" @click.stop="openEdit(node)">编辑</a-button>
|
||||
<a-button v-if="canChangeStatus" size="mini" @click.stop="confirmStatus(node)">{{ node.status === 'enabled' ? '停用' : '启用' }}</a-button>
|
||||
<a-button v-if="canChangeStatus" size="mini" @click.stop="confirmStatus(node)">{{ node.status === 1 ? '停用' : '启用' }}</a-button>
|
||||
<a-button v-if="canArchive" size="mini" status="danger" @click.stop="confirmArchive(node)">归档</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -89,10 +89,10 @@ function reset(data?: Node) {
|
||||
}
|
||||
|
||||
function confirmStatus(node: Node) {
|
||||
const status = node.status === 'enabled' ? 'disabled' : 'enabled';
|
||||
const status = node.status === 1 ? 2 : 1;
|
||||
Modal.warning({
|
||||
title: status === 'enabled' ? '确认启用' : '确认停用',
|
||||
content: `确定要${status === 'enabled' ? '启用' : '停用'}“${String(node.name ?? node.identity)}”吗?`,
|
||||
title: status === 1 ? '确认启用' : '确认停用',
|
||||
content: `确定要${status === 1 ? '启用' : '停用'}“${String(node.name ?? node.identity)}”吗?`,
|
||||
onOk: async () => {
|
||||
try {
|
||||
await resourceApi.updateStatus(
|
||||
|
||||
Reference in New Issue
Block a user