feat(c0): 长护服务菜单组 + 目录 seed 骨架
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b5eb94d3ae
commit
198517bde4
17
prisma/seed-catalog.ts
Normal file
17
prisma/seed-catalog.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
|
||||||
|
export async function seedCatalog(prisma: PrismaClient): Promise<void> {
|
||||||
|
// loc_config 骨架(昆明 + 占位州市)
|
||||||
|
await prisma.locConfig.upsert({
|
||||||
|
where: { locCode: '530100' },
|
||||||
|
update: { locName: '昆明市', svcSource: 'local' },
|
||||||
|
create: { locCode: '530100', locName: '昆明市', svcSource: 'local' },
|
||||||
|
});
|
||||||
|
// L1/L2/L3 目录项:C0 先落结构 + 少量样例(如「协助翻身叩背排痰」),
|
||||||
|
// 全量 36/45 项数据在 C1 上线前由运营导入(字段结构已就绪)。
|
||||||
|
await prisma.svcNational.upsert({
|
||||||
|
where: { natCode: 'L0000106010010000' },
|
||||||
|
update: {},
|
||||||
|
create: { natCode: 'L0000106010010000', natName: '协助翻身叩背排痰', natCategory: 'life', isMedical: false },
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import { PLATFORM_ROLE_CODE, PLATFORM_TENANT_CODE } from '../src/common/constants.js';
|
import { PLATFORM_ROLE_CODE, PLATFORM_TENANT_CODE } from '../src/common/constants.js';
|
||||||
import { initTenant } from '../src/common/tenant-template.js';
|
import { initTenant } from '../src/common/tenant-template.js';
|
||||||
|
import { seedCatalog } from './seed-catalog.js';
|
||||||
|
|
||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
@ -29,6 +30,9 @@ async function main(): Promise<void> {
|
|||||||
includePlatformPerms: true,
|
includePlatformPerms: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 3. 全局目录 seed(loc_config 骨架 + 国家基准库样例)
|
||||||
|
await seedCatalog(prisma);
|
||||||
|
|
||||||
console.log(`seed 完成:平台租户 ${TENANT}、用户 ${ADMIN_USERNAME}、角色 ${SUPER_ROLE}。`);
|
console.log(`seed 完成:平台租户 ${TENANT}、用户 ${ADMIN_USERNAME}、角色 ${SUPER_ROLE}。`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,17 @@ export const MENUS = [
|
|||||||
{ code: 'audit', name: '操作日志', parent: 'monitor', path: '/monitor/audit', component: 'monitor/audit/index', icon: 'mdi:clipboard-text', sort: 1 },
|
{ code: 'audit', name: '操作日志', parent: 'monitor', path: '/monitor/audit', component: 'monitor/audit/index', icon: 'mdi:clipboard-text', sort: 1 },
|
||||||
{ code: 'login-log', name: '登录日志', parent: 'monitor', path: '/monitor/login-log', component: 'monitor/login-log/index', icon: 'mdi:login', sort: 2 },
|
{ code: 'login-log', name: '登录日志', parent: 'monitor', path: '/monitor/login-log', component: 'monitor/login-log/index', icon: 'mdi:login', sort: 2 },
|
||||||
{ code: 'session', name: '在线会话', parent: 'monitor', path: '/monitor/session', component: 'monitor/session/index', icon: 'mdi:account-multiple-check', sort: 3 },
|
{ code: 'session', name: '在线会话', parent: 'monitor', path: '/monitor/session', component: 'monitor/session/index', icon: 'mdi:account-multiple-check', sort: 3 },
|
||||||
|
{ code: 'ltc', name: '长护服务', parent: null, path: '/ltc', component: 'Layout', icon: 'mdi:home-heart', sort: 5 },
|
||||||
|
{ code: 'elder', name: '服务对象', parent: 'ltc', path: '/ltc/elder', component: 'ltc/elder/index', icon: 'mdi:account-heart', sort: 1 },
|
||||||
|
{ code: 'schedule', name: '排班派单', parent: 'ltc', path: '/ltc/schedule', component: 'ltc/schedule/index', icon: 'mdi:calendar-clock', sort: 2 },
|
||||||
|
{ code: 'record', name: '工单留痕', parent: 'ltc', path: '/ltc/record', component: 'ltc/record/index', icon: 'mdi:clipboard-check', sort: 3 },
|
||||||
|
{ code: 'qc', name: '质控中心', parent: 'ltc', path: '/ltc/qc', component: 'ltc/qc/index', icon: 'mdi:shield-check', sort: 4 },
|
||||||
|
{ code: 'document', name: '文书档案', parent: 'ltc', path: '/ltc/document', component: 'ltc/document/index', icon: 'mdi:file-document', sort: 5 },
|
||||||
|
{ code: 'svc-config', name: '服务机构设置', parent: 'ltc', path: '/ltc/config', component: 'Layout', icon: 'mdi:cog', sort: 6 },
|
||||||
|
{ code: 'svc-config-info', name: '机构信息', parent: 'svc-config', path: '/ltc/config/info', component: 'ltc/config/info/index', icon: 'mdi:office-building', sort: 1 },
|
||||||
|
{ code: 'svc-config-catalog', name: '服务项目与配价', parent: 'svc-config', path: '/ltc/config/catalog', component: 'ltc/config/catalog/index', icon: 'mdi:format-list-bulleted', sort: 2 },
|
||||||
|
{ code: 'svc-config-photo', name: '拍照分档配置', parent: 'svc-config', path: '/ltc/config/photo', component: 'ltc/config/photo/index', icon: 'mdi:camera', sort: 3 },
|
||||||
|
{ code: 'svc-config-qc', name: '质控提醒配置', parent: 'svc-config', path: '/ltc/config/qc', component: 'ltc/config/qc/index', icon: 'mdi:bell-alert', sort: 4 },
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 接口资源(每个受控接口一个,code = 权限码)。 */
|
/** 接口资源(每个受控接口一个,code = 权限码)。 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user