feat: 公账周期账单与合并明细优化,退款弹窗与开方成功页按钮换行
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
周期账单生成与变动记录抽屉;查看合并按账单日 Tabs;退款原因必填;开方成功页操作按钮自动换行。
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeGridListeners } from '#/adapter/vxe-table';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
resetPassword,
|
||||
updateAdmin,
|
||||
} from '#/views/system/admin/api';
|
||||
import { getRoleInfo } from '#/views/system/role/api';
|
||||
|
||||
import { normalizeAdminPayload } from './admin-payload';
|
||||
import { createAdminModalFormProps } from './form-schemas';
|
||||
@@ -49,6 +50,20 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const meta = computed(() => getRoleMeta(props.roleId));
|
||||
/** 优先展示接口返回的角色昵称(自定义角色尤为重要) */
|
||||
const roleTitle = ref('');
|
||||
const pageTitle = computed(() => roleTitle.value || meta.value.title);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const info = await getRoleInfo(props.roleId);
|
||||
if (info?.name) {
|
||||
roleTitle.value = String(info.name);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
|
||||
const hasTopTableDropDownActions = ref(false);
|
||||
const isUpdate = ref(false);
|
||||
@@ -217,9 +232,9 @@ const copyToClipboard = async (text: string) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height :title="meta.title">
|
||||
<Page auto-content-height :title="pageTitle">
|
||||
<Modal
|
||||
:title="`${isUpdate ? '编辑' : '新增'}${meta.title}`"
|
||||
:title="`${isUpdate ? '编辑' : '新增'}${pageTitle}`"
|
||||
class="w-[60%]"
|
||||
>
|
||||
<Form />
|
||||
|
||||
@@ -38,8 +38,14 @@ export const ROLE_SALESPERSON = 6;
|
||||
|
||||
export function getRoleMeta(roleId: number): AdminRoleMeta {
|
||||
const meta = ADMIN_ROLE_LIST.find((r) => r.id === roleId);
|
||||
if (!meta) {
|
||||
throw new Error(`Unknown admin role id: ${roleId}`);
|
||||
if (meta) {
|
||||
return meta;
|
||||
}
|
||||
return meta;
|
||||
// 自定义角色:无静态页元数据时回落为通用 basic 表单,避免抛错
|
||||
return {
|
||||
id: roleId,
|
||||
title: `角色${roleId}`,
|
||||
slug: `role-${roleId}`,
|
||||
formType: 'basic',
|
||||
};
|
||||
}
|
||||
|
||||
25
apps/web-antd/src/views/system/admin/dynamic/index.vue
Normal file
25
apps/web-antd/src/views/system/admin/dynamic/index.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* 自定义角色通用管理员页:从路由 path 解析 roleId,复用 AdminPage
|
||||
* 菜单 path 约定:/system/admin/role/{roleId}
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import AdminPage from '../_shared/admin-page.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
/** 从 path 提取角色 ID,解析失败返回 0 */
|
||||
const roleId = computed(() => {
|
||||
const match = String(route.path).match(/\/system\/admin\/role\/(\d+)/);
|
||||
return match ? Number(match[1]) : 0;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AdminPage v-if="roleId > 0" :role-id="roleId" />
|
||||
<div v-else class="p-6 text-[hsl(var(--muted-foreground))]">
|
||||
无法识别角色 ID,请检查菜单路径是否为 /system/admin/role/{角色ID}
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user