feat: 修复部分功能(健康信息、VIP、医生端健康信息导入)

This commit is contained in:
李琦
2026-08-08 10:33:49 +08:00
parent 7a504433da
commit 396a6e5b8b
15 changed files with 1150 additions and 79 deletions

View File

@@ -1,20 +1,30 @@
<script lang="ts" setup>
/**
* VIP 权限显隐口子组件
* 用法:<VipGate code="xxx" :min-level="'V5'">内容</VipGate>
* 后续业务权益接入时直接包一层即可;当前从 userInfo.vip 判断
* VIP 权限显隐全局组件
* 用法:
* <VipGate code="medical_record">有权限才渲染</VipGate>
* <VipGate :code="VIP_FEATURE.AI_PRESCRIPTION" :vip="receptionVip">...</VipGate>
* 接诊/复诊务必传 :vip="履约诊所vip",不要只靠登录态
*/
import { computed } from 'vue';
import { hasVipPermission, levelAtLeast } from '#/utils/vip';
import {
hasVipPermission,
levelAtLeast,
type StoreVipInfo,
} from '#/utils/vip';
const props = withDefaults(
defineProps<{
/** 权限码(与等级 permissions 对齐) */
/** 权限码(与 xk_vip_feature.code / 等级 permissions 对齐) */
code?: string;
/** 最低等级编码 */
minLevel?: string;
/** 无权限时是否渲染占位(默认不渲染) */
/**
* 指定 VIP 来源(挂号履约诊所);不传则用登录态 userInfo.vip
*/
vip?: StoreVipInfo | string[] | null;
/** 无权限时是否渲染 fallback 插槽(默认不渲染) */
fallback?: boolean;
}>(),
{
@@ -26,15 +36,20 @@ const props = withDefaults(
const allowed = computed(() => {
if (props.code) {
// 传了 :vip 则按履约诊所判;未传则回落登录态
if (props.vip !== undefined) {
return hasVipPermission(props.code, props.vip);
}
return hasVipPermission(props.code);
}
if (props.minLevel) {
return levelAtLeast(props.minLevel);
const vipObj = Array.isArray(props.vip) ? null : (props.vip ?? null);
return levelAtLeast(props.minLevel, vipObj);
}
// 未指定条件时默认展示,方便后续逐步接入
return true;
});
</script>
<template>
<slot v-if="allowed" />
<slot v-else-if="fallback" name="fallback" />

View File

@@ -336,6 +336,14 @@ const orderColumns = [
bordered
size="small"
>
<Descriptions.Item label="现病史">
{{
historyText(
profile.health_inquiry.present_status,
profile.health_inquiry.present_history,
)
}}
</Descriptions.Item>
<Descriptions.Item label="既往史">
{{
historyText(