feat: use new desc comp

This commit is contained in:
xingyu4j
2025-10-21 11:40:42 +08:00
parent 284c47b721
commit de4ca0a5a4
50 changed files with 421 additions and 586 deletions

View File

@@ -179,21 +179,21 @@ export function useDetailFormSchema(): DescriptionItemSchema[] {
{
label: '请假类型',
field: 'type',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.BPM_OA_LEAVE_TYPE,
value: data?.type,
value: val,
}),
},
{
label: '开始时间',
field: 'startTime',
content: (data) => formatDateTime(data?.startTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
label: '结束时间',
field: 'endTime',
content: (data) => formatDateTime(data?.endTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
label: '原因',

View File

@@ -21,7 +21,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '商机金额(元)',
content: (data) => erpPriceInputFormatter(data.totalPrice),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'statusTypeName',
@@ -34,7 +34,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}
@@ -53,17 +53,17 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '商机金额(元)',
content: (data) => erpPriceInputFormatter(data.totalPrice),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'dealTime',
label: '预计成交日期',
content: (data) => formatDateTime(data?.dealTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'contactNextTime',
label: '下次联系时间',
content: (data) => formatDateTime(data?.contactNextTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'statusTypeName',

View File

@@ -23,9 +23,9 @@ import { PermissionList, TransferForm } from '#/views/crm/permission';
import { ProductDetailsList } from '#/views/crm/product/components';
import Form from '../modules/form.vue';
import UpStatusForm from './modules/status-form.vue';
import { useDetailSchema } from './data';
import BusinessDetailsInfo from './modules/info.vue';
import UpStatusForm from './modules/status-form.vue';
const route = useRoute();
const router = useRouter();
@@ -38,11 +38,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]);
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -12,31 +12,27 @@ defineProps<{
business: CrmBusinessApi.Business; // 商机信息
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
const [BaseDescription] = useDescription({
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
const [SystemDescription] = useDescription({
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useFollowUpDetailSchema(),
});
</script>
<template>
<div class="p-4">
<BaseDescriptions :data="business" />
<BaseDescription :data="business" />
<Divider />
<SystemDescriptions :data="business" />
<SystemDescription :data="business" />
</div>
</template>

View File

@@ -13,10 +13,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'source',
label: '线索来源',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_SOURCE,
value: data?.source,
value: val,
}),
},
{
@@ -30,7 +30,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}
@@ -45,10 +45,10 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'source',
label: '客户来源',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_SOURCE,
value: data?.source,
value: val,
}),
},
{
@@ -66,8 +66,8 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'areaName',
label: '地址',
content: (data) => {
const areaName = data.areaName ?? '';
render: (val, data) => {
const areaName = val ?? '';
const detailAddress = data?.detailAddress ?? '';
return [areaName, detailAddress].filter((item) => !!item).join(' ');
},
@@ -83,25 +83,25 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'industryId',
label: '客户行业',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY,
value: data?.industryId,
value: val,
}),
},
{
field: 'level',
label: '客户级别',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_LEVEL,
value: data?.level,
value: val,
}),
},
{
field: 'contactNextTime',
label: '下次联系时间',
content: (data) => formatDateTime(data?.contactNextTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'remark',

View File

@@ -34,11 +34,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -13,22 +13,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useFollowUpDetailSchema(),
});
</script>

View File

@@ -25,7 +25,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}
@@ -64,10 +64,10 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'areaName',
label: '地址',
content: (data) => {
const areaName = data?.areaName ?? '';
render: (val, data) => {
const areaName = val ?? '';
const detailAddress = data?.detailAddress ?? '';
return [areaName, detailAddress].filter(Boolean).join(' ');
return [areaName, detailAddress].filter((item) => !!item).join(' ');
},
},
{
@@ -81,22 +81,22 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'master',
label: '关键决策人',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.INFRA_BOOLEAN_STRING,
value: data?.master,
value: val,
}),
},
{
field: 'sex',
label: '性别',
content: (data) =>
h(DictTag, { type: DICT_TYPE.SYSTEM_USER_SEX, value: data?.sex }),
render: (val) =>
h(DictTag, { type: DICT_TYPE.SYSTEM_USER_SEX, value: val }),
},
{
field: 'contactNextTime',
label: '下次联系时间',
content: (data) => formatDateTime(data?.contactNextTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'remark',

View File

@@ -36,11 +36,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -13,22 +13,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useFollowUpDetailSchema(),
});
</script>

View File

@@ -17,18 +17,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '合同金额(元)',
content: (data) => erpPriceInputFormatter(data?.totalPrice) as string,
render: (val) => erpPriceInputFormatter(val) as string,
},
{
field: 'orderDate',
label: '下单时间',
content: (data) => formatDateTime(data?.orderDate) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'totalReceivablePrice',
label: '回款金额(元)',
content: (data) =>
erpPriceInputFormatter(data?.totalReceivablePrice) as string,
render: (val) => erpPriceInputFormatter(val) as string,
},
{
field: 'ownerUserName',
@@ -59,22 +58,22 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '合同金额(元)',
content: (data) => erpPriceInputFormatter(data?.totalPrice) as string,
render: (val) => erpPriceInputFormatter(val) as string,
},
{
field: 'orderDate',
label: '下单时间',
content: (data) => formatDateTime(data?.orderDate) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'startTime',
label: '合同开始时间',
content: (data) => formatDateTime(data?.startTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'endTime',
label: '合同结束时间',
content: (data) => formatDateTime(data?.endTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'signContactName',
@@ -91,10 +90,10 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'auditStatus',
label: '合同状态',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_AUDIT_STATUS,
value: data?.auditStatus,
value: val,
}),
},
];

View File

@@ -40,11 +40,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -13,22 +13,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useFollowUpDetailSchema(),
});
</script>

View File

@@ -43,13 +43,13 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'level',
label: '客户级别',
content: (data) =>
h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: data?.level }),
render: (val) =>
h(DictTag, { type: DICT_TYPE.CRM_CUSTOMER_LEVEL, value: val }),
},
{
field: 'dealStatus',
label: '成交状态',
content: (data) => (data.dealStatus ? '已成交' : '未成交'),
render: (val) => (val ? '已成交' : '未成交'),
},
{
field: 'ownerUserName',
@@ -58,7 +58,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}
@@ -73,10 +73,10 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'source',
label: '客户来源',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_SOURCE,
value: data?.source,
value: val,
}),
},
{
@@ -94,8 +94,8 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'areaName',
label: '地址',
content: (data) => {
const areaName = data?.areaName ?? '';
render: (val, data) => {
const areaName = val ?? '';
const detailAddress = data?.detailAddress ?? '';
return [areaName, detailAddress].filter(Boolean).join(' ');
},
@@ -111,16 +111,16 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'industryId',
label: '客户行业',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY,
value: data?.industryId,
value: val,
}),
},
{
field: 'contactNextTime',
label: '下次联系时间',
content: (data) => formatDateTime(data?.contactNextTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'remark',

View File

@@ -47,11 +47,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -13,22 +13,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useFollowUpDetailSchema(),
});
</script>

View File

@@ -173,7 +173,7 @@ export function useFollowUpDetailSchema(): DescriptionItemSchema[] {
{
field: 'contactLastTime',
label: '最后跟进时间',
content: (data) => formatDateTime(data?.contactLastTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'creatorName',
@@ -182,12 +182,12 @@ export function useFollowUpDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data) => formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -17,13 +17,13 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'unit',
label: '产品单位',
content: (data) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }),
render: (val) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: val }),
},
{
field: 'price',
label: '产品价格(元)',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'no',
@@ -46,7 +46,7 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'price',
label: '价格(元)',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'description',
@@ -59,14 +59,14 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '是否上下架',
content: (data) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_STATUS, value: data?.status }),
render: (val) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_STATUS, value: val }),
},
{
field: 'unit',
label: '产品单位',
content: (data) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: data?.unit }),
render: (val) =>
h(DictTag, { type: DICT_TYPE.CRM_PRODUCT_UNIT, value: val }),
},
];
}

View File

@@ -29,11 +29,9 @@ const product = ref<CrmProductApi.Product>({} as CrmProductApi.Product); // 产
const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -10,12 +10,10 @@ defineProps<{
}>();
const [ProductDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
</script>

View File

@@ -17,18 +17,18 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '合同金额(元)',
content: (data) =>
erpPriceInputFormatter(data?.contract?.totalPrice ?? data.totalPrice),
render: (val, data) =>
erpPriceInputFormatter(val ?? data?.contract?.totalPrice ?? 0),
},
{
field: 'returnTime',
label: '回款日期',
content: (data) => formatDateTime(data?.returnTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'price',
label: '回款金额(元)',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'ownerUserName',
@@ -51,25 +51,26 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'contract',
label: '合同编号',
content: (data) => data?.contract?.no,
render: (val, data) =>
val && data?.contract?.no ? data?.contract?.no : '',
},
{
field: 'returnTime',
label: '回款日期',
content: (data) => formatDateTime(data?.returnTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'price',
label: '回款金额',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'returnType',
label: '回款方式',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE,
value: data?.returnType,
value: val,
}),
},
{
@@ -93,12 +94,12 @@ export function useDetailSystemSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data) => formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -38,11 +38,9 @@ const logList = ref<SystemOperateLogApi.OperateLog[]>([]); // 操作日志
const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队成员列表 Ref
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -12,22 +12,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useDetailSystemSchema(),
});
</script>

View File

@@ -21,17 +21,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'price',
label: '计划回款金额',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'returnTime',
label: '计划回款日期',
content: (data) => formatDateTime(data?.returnTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'receivable',
label: '实际回款金额',
content: (data) => erpPriceInputFormatter(data?.receivable?.price ?? 0),
render: (val) => erpPriceInputFormatter(val?.price ?? 0),
},
];
}
@@ -54,20 +54,20 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'returnTime',
label: '计划回款日期',
content: (data) => formatDateTime(data?.returnTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'price',
label: '计划回款金额',
content: (data) => erpPriceInputFormatter(data.price),
render: (val) => erpPriceInputFormatter(val),
},
{
field: 'returnType',
label: '计划回款方式',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE,
value: data?.returnType,
value: val,
}),
},
{
@@ -77,20 +77,20 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] {
{
field: 'receivable',
label: '实际回款金额',
content: (data) => erpPriceInputFormatter(data?.receivable?.price ?? 0),
render: (val) => erpPriceInputFormatter(val ?? 0),
},
{
field: 'receivableRemain',
label: '未回款金额',
content: (data) => {
render: (val, data) => {
const paid = data?.receivable?.price ?? 0;
return erpPriceInputFormatter(Math.max(data.price - paid, 0));
return erpPriceInputFormatter(Math.max(val - paid, 0));
},
},
{
field: 'receivable.returnTime',
label: '实际回款日期',
content: (data) => formatDateTime(data?.receivable?.returnTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'remark',
@@ -113,12 +113,12 @@ export function useDetailSystemSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data) => formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data) => formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -39,11 +39,9 @@ const permissionListRef = ref<InstanceType<typeof PermissionList>>(); // 团队
const validateWrite = () => permissionListRef.value?.validateWrite;
const [Descriptions] = useDescription({
componentProps: {
bordered: false,
column: 4,
class: 'mx-4',
},
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -12,22 +12,18 @@ defineProps<{
}>();
const [BaseDescriptions] = useDescription({
componentProps: {
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
},
title: '基本信息',
bordered: false,
column: 4,
class: 'mx-4',
schema: useDetailBaseSchema(),
});
const [SystemDescriptions] = useDescription({
componentProps: {
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
},
title: '系统信息',
bordered: false,
column: 3,
class: 'mx-4',
schema: useDetailSystemSchema(),
});
</script>

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { InfraApiAccessLogApi } from '#/api/infra/api-access-log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -181,10 +180,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'userType',
label: '用户类型',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.USER_TYPE,
value: data.userType,
value: val,
});
},
},
@@ -198,9 +197,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
},
{
label: '请求信息',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
if (data?.requestMethod && data?.requestUrl) {
return `${data.requestMethod} ${data.requestUrl}`;
field: 'requestMethod',
render: (val, data) => {
if (val && data?.requestUrl) {
return `${val} ${data.requestUrl}`;
}
return '';
},
@@ -208,10 +208,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'requestParams',
label: '请求参数',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
if (data.requestParams) {
render: (val) => {
if (val) {
return h(JsonViewer, {
value: JSON.parse(data.requestParams),
value: JSON.parse(val),
previewMode: true,
});
}
@@ -224,26 +224,29 @@ export function useDetailSchema(): DescriptionItemSchema[] {
},
{
label: '请求时间',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
if (data?.beginTime && data?.endTime) {
return `${formatDateTime(data.beginTime)} ~ ${formatDateTime(data.endTime)}`;
field: 'beginTime',
render: (val, data) => {
if (val && data?.endTime) {
return `${formatDateTime(val)} ~ ${formatDateTime(data.endTime)}`;
}
return '';
},
},
{
label: '请求耗时',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
return data?.duration ? `${data.duration} ms` : '';
field: 'duration',
render: (val) => {
return val ? `${val} ms` : '';
},
},
{
label: '操作结果',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
if (data?.resultCode === 0) {
field: 'resultCode',
render: (val, data) => {
if (val === 0) {
return '正常';
} else if (data && data.resultCode > 0) {
return `失败 | ${data.resultCode} | ${data.resultMsg}`;
} else if (val > 0 && data?.resultMsg) {
return `失败 | ${val} | ${data.resultMsg}`;
}
return '';
},
@@ -259,10 +262,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'operateType',
label: '操作类型',
content: (data: InfraApiAccessLogApi.ApiAccessLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_OPERATE_TYPE,
value: data?.operateType,
value: val,
});
},
},

View File

@@ -12,11 +12,9 @@ import { useDetailSchema } from '../data';
const formData = ref<InfraApiAccessLogApi.ApiAccessLog>();
const [Descriptions] = useDescription({
componentProps: {
bordered: true,
column: 1,
class: 'mx-4',
},
bordered: true,
column: 1,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { InfraApiErrorLogApi } from '#/api/infra/api-error-log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -158,10 +157,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'userType',
label: '用户类型',
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.USER_TYPE,
value: data.userType,
value: val,
});
},
},
@@ -176,9 +175,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'requestMethod',
label: '请求信息',
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
render: (val, data) => {
if (data?.requestMethod && data?.requestUrl) {
return `${data.requestMethod} ${data.requestUrl}`;
return `${val.requestMethod} ${val.requestUrl}`;
}
return '';
},
@@ -186,10 +185,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'requestParams',
label: '请求参数',
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
if (data.requestParams) {
render: (val) => {
if (val) {
return h(JsonViewer, {
value: JSON.parse(data.requestParams),
value: JSON.parse(val),
previewMode: true,
});
}
@@ -199,8 +198,8 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'exceptionTime',
label: '异常时间',
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
return formatDateTime(data?.exceptionTime || '') as string;
render: (val) => {
return formatDateTime(val) as string;
},
},
{
@@ -210,12 +209,11 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'exceptionStackTrace',
label: '异常堆栈',
hidden: (data: InfraApiErrorLogApi.ApiErrorLog) =>
!data?.exceptionStackTrace,
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
if (data?.exceptionStackTrace) {
show: (val) => !val,
render: (val) => {
if (val) {
return h('textarea', {
value: data.exceptionStackTrace,
value: val,
style:
'width: 100%; min-height: 200px; max-height: 400px; resize: vertical;',
readonly: true,
@@ -227,24 +225,24 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'processStatus',
label: '处理状态',
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
value: data?.processStatus,
value: val,
});
},
},
{
field: 'processUserId',
label: '处理人',
hidden: (data: InfraApiErrorLogApi.ApiErrorLog) => !data?.processUserId,
show: (val) => !val,
},
{
field: 'processTime',
label: '处理时间',
hidden: (data: InfraApiErrorLogApi.ApiErrorLog) => !data?.processTime,
content: (data: InfraApiErrorLogApi.ApiErrorLog) => {
return formatDateTime(data?.processTime || '') as string;
show: (val) => !val,
render: (val) => {
return formatDateTime(val) as string;
},
},
];

View File

@@ -12,11 +12,9 @@ import { useDetailSchema } from '../data';
const formData = ref<InfraApiErrorLogApi.ApiErrorLog>();
const [Descriptions] = useDescription({
componentProps: {
bordered: true,
column: 1,
class: 'mx-4',
},
bordered: true,
column: 1,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { InfraJobApi } from '#/api/infra/job';
import type { DescriptionItemSchema } from '#/components/description';
import { h, markRaw } from 'vue';
@@ -191,10 +190,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '任务状态',
content: (data: InfraJobApi.Job) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_JOB_STATUS,
value: data?.status,
value: val,
});
},
},
@@ -216,27 +215,27 @@ export function useDetailSchema(): DescriptionItemSchema[] {
},
{
label: '重试间隔',
content: (data: InfraJobApi.Job) => {
return data?.retryInterval ? `${data.retryInterval} 毫秒` : '无间隔';
field: 'retryInterval',
render: (val) => {
return val ? `${val} 毫秒` : '无间隔';
},
},
{
label: '监控超时时间',
content: (data: InfraJobApi.Job) => {
return data?.monitorTimeout && data.monitorTimeout > 0
? `${data.monitorTimeout} 毫秒`
: '未开启';
field: 'monitorTimeout',
render: (val) => {
return val && val > 0 ? `${val} 毫秒` : '未开启';
},
},
{
field: 'nextTimes',
label: '后续执行时间',
content: (data: InfraJobApi.Job) => {
if (!data?.nextTimes || data.nextTimes.length === 0) {
render: (val) => {
if (!val || val.length === 0) {
return '无后续执行时间';
}
return h(Timeline, {}, () =>
data.nextTimes?.map((time: Date) =>
val?.map((time: Date) =>
h(Timeline.Item, {}, () => formatDateTime(time)),
),
);

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { InfraJobLogApi } from '#/api/infra/job-log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -154,9 +153,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'beginTime',
label: '执行时间',
content: (data: InfraJobLogApi.JobLog) => {
if (data?.beginTime && data?.endTime) {
return `${formatDateTime(data.beginTime)} ~ ${formatDateTime(data.endTime)}`;
render: (val, data) => {
if (val && data?.endTime) {
return `${formatDateTime(val)} ~ ${formatDateTime(data.endTime)}`;
}
return '';
},
@@ -164,17 +163,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'duration',
label: '执行时长',
content: (data: InfraJobLogApi.JobLog) => {
return data?.duration ? `${data.duration} 毫秒` : '';
render: (val) => {
return val ? `${val} 毫秒` : '';
},
},
{
field: 'status',
label: '任务状态',
content: (data: InfraJobLogApi.JobLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_JOB_LOG_STATUS,
value: data?.status,
value: val,
});
},
},

View File

@@ -13,11 +13,9 @@ import { useDetailSchema } from '../data';
const formData = ref<InfraJobLogApi.JobLog>();
const [Descriptions] = useDescription({
componentProps: {
bordered: true,
column: 1,
class: 'mx-4',
},
bordered: true,
column: 1,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -14,11 +14,9 @@ const formData = ref<InfraJobApi.Job>(); // 任务详情
const nextTimes = ref<Date[]>([]); // 下一次执行时间
const [Descriptions] = useDescription({
componentProps: {
bordered: true,
column: 1,
class: 'mx-4',
},
bordered: true,
column: 1,
class: 'mx-4',
schema: useDetailSchema(),
});

View File

@@ -1,4 +1,3 @@
import type { MallAfterSaleApi } from '#/api/mall/trade/afterSale';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -20,19 +19,19 @@ export function useOrderInfoSchema(): DescriptionItemSchema[] {
{
field: 'order.deliveryType',
label: '配送方式',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_DELIVERY_TYPE,
value: data?.order?.deliveryType,
value: val,
}),
},
{
field: 'order.type',
label: '订单类型',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_ORDER_TYPE,
value: data?.order?.type,
value: val,
}),
},
{
@@ -46,10 +45,10 @@ export function useOrderInfoSchema(): DescriptionItemSchema[] {
{
field: 'order.terminal',
label: '订单来源',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TERMINAL,
value: data?.order?.terminal,
value: val,
}),
},
{
@@ -67,10 +66,10 @@ export function useOrderInfoSchema(): DescriptionItemSchema[] {
{
field: 'order.payChannelCode',
label: '付款方式',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.order?.payChannelCode,
value: val,
}),
},
{
@@ -90,32 +89,30 @@ export function useAfterSaleInfoSchema(): DescriptionItemSchema[] {
{
field: 'auditTime',
label: '申请时间',
content: (data: MallAfterSaleApi.AfterSale) =>
formatDate(data?.auditTime) as string,
render: (val) => formatDate(val) as string,
},
{
field: 'type',
label: '售后类型',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_AFTER_SALE_TYPE,
value: data?.type,
value: val,
}),
},
{
field: 'way',
label: '售后方式',
content: (data: MallAfterSaleApi.AfterSale) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_AFTER_SALE_WAY,
value: data?.way,
value: val,
}),
},
{
field: 'refundPrice',
label: '退款金额',
content: (data: MallAfterSaleApi.AfterSale) =>
fenToYuan(data?.refundPrice ?? 0),
render: (val) => fenToYuan(val ?? 0),
},
{
field: 'applyReason',
@@ -128,8 +125,8 @@ export function useAfterSaleInfoSchema(): DescriptionItemSchema[] {
{
field: 'applyPicUrls',
label: '凭证图片',
content: (data) => {
const images = data?.applyPicUrls || [];
render: (val) => {
const images = val || [];
return h(
'div',
{ class: 'flex gap-10px' },
@@ -153,16 +150,16 @@ export function useRefundStatusSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '退款状态',
content: (data) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_AFTER_SALE_STATUS,
value: data?.status,
value: val,
}),
},
{
field: 'reminder',
label: '提醒',
content: () =>
render: () =>
h('div', { class: 'text-red-500 mb-10px' }, [
h('div', '如果未发货,请点击同意退款给买家。'),
h('div', '如果实际已发货,请主动与买家联系。'),

View File

@@ -49,29 +49,23 @@ const afterSale = ref<MallAfterSaleApi.AfterSale>({
});
const [OrderDescriptions] = useDescription({
componentProps: {
title: '订单信息',
bordered: false,
column: 3,
},
title: '订单信息',
bordered: false,
column: 3,
schema: useOrderInfoSchema(),
});
const [AfterSaleDescriptions] = useDescription({
componentProps: {
title: '售后信息',
bordered: false,
column: 3,
},
title: '售后信息',
bordered: false,
column: 3,
schema: useAfterSaleInfoSchema(),
});
const [RefundStatusDescriptions] = useDescription({
componentProps: {
title: '退款状态',
bordered: false,
column: 1,
},
title: '退款状态',
bordered: false,
column: 1,
schema: useRefundStatusSchema(),
});

View File

@@ -1,5 +1,4 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MallOrderApi } from '#/api/mall/trade/order';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -23,19 +22,19 @@ export function useOrderInfoSchema(): DescriptionItemSchema[] {
{
field: 'type',
label: '订单类型',
content: (data: MallOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_ORDER_TYPE,
value: data?.type,
value: val,
}),
},
{
field: 'terminal',
label: '订单来源',
content: (data: MallOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TERMINAL,
value: data?.terminal,
value: val,
}),
},
{
@@ -53,10 +52,10 @@ export function useOrderInfoSchema(): DescriptionItemSchema[] {
{
field: 'payChannelCode',
label: '付款方式',
content: (data: MallOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.payChannelCode,
value: val,
}),
},
{
@@ -72,16 +71,16 @@ export function useOrderStatusSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '订单状态',
content: (data: MallOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_ORDER_STATUS,
value: data?.status,
value: val,
}),
},
{
field: 'reminder',
label: '提醒',
content: () =>
render: () =>
h('div', { class: 'space-y-1' }, [
h('div', '买家付款成功后,货款将直接进入您的商户号(微信、支付宝)'),
h('div', '请及时关注你发出的包裹状态,确保可以配送至买家手中'),
@@ -100,66 +99,46 @@ export function useOrderPriceSchema(): DescriptionItemSchema[] {
{
field: 'totalPrice',
label: '商品总额',
content: (data: MallOrderApi.Order) =>
`${fenToYuan(data?.totalPrice ?? 0)}`,
render: (val) => `${fenToYuan(val ?? 0)}`,
},
{
field: 'deliveryPrice',
label: '运费金额',
content: (data: MallOrderApi.Order) =>
`${fenToYuan(data?.deliveryPrice ?? 0)}`,
render: (val) => `${fenToYuan(val ?? 0)}`,
},
{
field: 'adjustPrice',
label: '订单调价',
content: (data: MallOrderApi.Order) =>
`${fenToYuan(data?.adjustPrice ?? 0)}`,
render: (val) => `${fenToYuan(val ?? 0)}`,
},
{
field: 'couponPrice',
label: '优惠劵优惠',
content: (data: MallOrderApi.Order) =>
h(
'span',
{ class: 'text-red-500' },
`${fenToYuan(data?.couponPrice ?? 0)}`,
),
render: (val) =>
h('span', { class: 'text-red-500' }, `${fenToYuan(val ?? 0)}`),
},
{
field: 'vipPrice',
label: 'VIP 优惠',
content: (data: MallOrderApi.Order) =>
h(
'span',
{ class: 'text-red-500' },
`${fenToYuan(data?.vipPrice ?? 0)}`,
),
render: (val) =>
h('span', { class: 'text-red-500' }, `${fenToYuan(val ?? 0)}`),
},
{
field: 'discountPrice',
label: '活动优惠',
content: (data: MallOrderApi.Order) =>
h(
'span',
{ class: 'text-red-500' },
`${fenToYuan(data?.discountPrice ?? 0)}`,
),
render: (val) =>
h('span', { class: 'text-red-500' }, `${fenToYuan(val ?? 0)}`),
},
{
field: 'pointPrice',
label: '积分抵扣',
content: (data: MallOrderApi.Order) =>
h(
'span',
{ class: 'text-red-500' },
`${fenToYuan(data?.pointPrice ?? 0)}`,
),
render: (val) =>
h('span', { class: 'text-red-500' }, `${fenToYuan(val ?? 0)}`),
},
{
field: 'payPrice',
label: '应付金额',
content: (data: MallOrderApi.Order) =>
`${fenToYuan(data?.payPrice ?? 0)}`,
render: (val) => `${fenToYuan(val ?? 0)}`,
},
];
}
@@ -170,10 +149,10 @@ export function useDeliveryInfoSchema(): DescriptionItemSchema[] {
{
field: 'deliveryType',
label: '配送方式',
content: (data: MallOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.TRADE_DELIVERY_TYPE,
value: data?.deliveryType,
value: val,
}),
},
{
@@ -187,14 +166,12 @@ export function useDeliveryInfoSchema(): DescriptionItemSchema[] {
{
field: 'receiverAddress',
label: '收货地址',
content: (data: MallOrderApi.Order) =>
`${data?.receiverAreaName} ${data?.receiverDetailAddress}`.trim(),
render: (val, data) => `${data?.receiverAreaName} ${val}`.trim(),
},
{
field: 'deliveryTime',
label: '发货时间',
content: (data: MallOrderApi.Order) =>
formatDateTime(data?.deliveryTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -57,38 +57,30 @@ const expressTrackList = ref<any[]>([]);
const pickUpStore = ref<MallDeliveryPickUpStoreApi.PickUpStore | undefined>();
const [OrderInfoDescriptions] = useDescription({
componentProps: {
title: '订单信息',
bordered: false,
column: 3,
},
title: '订单信息',
bordered: false,
column: 3,
schema: useOrderInfoSchema(),
});
const [OrderStatusDescriptions] = useDescription({
componentProps: {
title: '订单状态',
bordered: false,
column: 1,
},
title: '订单状态',
bordered: false,
column: 1,
schema: useOrderStatusSchema(),
});
const [OrderPriceDescriptions] = useDescription({
componentProps: {
title: '费用信息',
bordered: false,
column: 4,
},
title: '费用信息',
bordered: false,
column: 4,
schema: useOrderPriceSchema(),
});
const [DeliveryInfoDescriptions] = useDescription({
componentProps: {
title: '收货信息',
bordered: false,
column: 3,
},
title: '收货信息',
bordered: false,
column: 3,
schema: useDeliveryInfoSchema(),
});

View File

@@ -24,37 +24,37 @@ const [Descriptions] = useDescription({
{
field: 'levelName',
label: '等级',
content: (data) => data.levelName || '-',
render: (val) => val || '-',
},
{
field: 'experience',
label: '成长值',
content: (data) => data.experience || 0,
render: (val) => val || 0,
},
{
field: 'point',
label: '当前积分',
content: (data) => data.point || 0,
render: (val) => val || 0,
},
{
field: 'totalPoint',
label: '总积分',
content: (data) => data.totalPoint || 0,
render: (val) => val || 0,
},
{
field: 'balance',
label: '当前余额',
content: (data) => fenToYuan(data.balance || 0),
render: (val) => fenToYuan(val || 0),
},
{
field: 'totalExpense',
label: '支出金额',
content: (data) => fenToYuan(data.totalExpense || 0),
render: (val) => fenToYuan(val || 0),
},
{
field: 'totalRecharge',
label: '充值金额',
content: (data) => fenToYuan(data.totalRecharge || 0),
render: (val) => fenToYuan(val || 0),
},
],
});

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayNotifyApi } from '#/api/pay/notify';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -182,10 +181,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'type',
label: '通知类型',
content: (data: PayNotifyApi.NotifyTask) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_NOTIFY_TYPE,
value: data?.type,
value: val,
}),
},
{
@@ -195,10 +194,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '通知状态',
content: (data: PayNotifyApi.NotifyTask) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_NOTIFY_STATUS,
value: data?.status,
value: val,
}),
},
{
@@ -208,14 +207,12 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'lastExecuteTime',
label: '最后通知时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.lastExecuteTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'nextNotifyTime',
label: '下次通知时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.nextNotifyTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'notifyTimes',
@@ -228,14 +225,12 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data: PayNotifyApi.NotifyTask) =>
formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayOrderApi } from '#/api/pay/order';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -184,53 +183,46 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '支付状态',
content: (data: any) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_ORDER_STATUS,
value: data?.status,
value: val,
}),
},
{
field: 'price',
label: '支付金额',
content: (data: PayOrderApi.Order) =>
`${erpPriceInputFormatter(data?.price)}`,
render: (val) => `${erpPriceInputFormatter(val)}`,
},
{
field: 'channelFeePrice',
label: '手续费',
content: (data: PayOrderApi.Order) =>
`${erpPriceInputFormatter(data?.channelFeePrice)}`,
render: (val) => `${erpPriceInputFormatter(val)}`,
},
{
field: 'channelFeeRate',
label: '手续费比例',
content: (data: PayOrderApi.Order) =>
`${erpPriceInputFormatter(data?.channelFeeRate)}%`,
render: (val) => `${erpPriceInputFormatter(val)}%`,
},
{
field: 'successTime',
label: '支付时间',
content: (data: PayOrderApi.Order) =>
formatDateTime(data?.successTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'expireTime',
label: '失效时间',
content: (data: PayOrderApi.Order) =>
formatDateTime(data?.expireTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'createTime',
label: '创建时间',
content: (data: PayOrderApi.Order) =>
formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data: PayOrderApi.Order) =>
formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'subject',
@@ -243,10 +235,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'channelCode',
label: '支付渠道',
content: (data: PayOrderApi.Order) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.channelCode,
value: val,
}),
},
{
@@ -256,10 +248,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'channelOrderNo',
label: '渠道单号',
content: (data: PayOrderApi.Order) =>
data?.channelOrderNo
? h(Tag, { color: 'green' }, () => data.channelOrderNo)
: '',
render: (val) => (val ? h(Tag, { color: 'green' }, () => val) : ''),
},
{
field: 'channelUserId',
@@ -268,8 +257,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'refundPrice',
label: '退款金额',
content: (data: PayOrderApi.Order) =>
`${erpPriceInputFormatter(data?.refundPrice)}`,
render: (val) => `${erpPriceInputFormatter(val)}`,
},
{
field: 'notifyUrl',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayRefundApi } from '#/api/pay/refund';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -173,26 +172,22 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'merchantRefundId',
label: '商户退款单号',
content: (data: PayRefundApi.Refund) =>
h(Tag, {}, () => data?.merchantRefundId || '-'),
render: (val) => h(Tag, {}, () => val || '-'),
},
{
field: 'channelRefundNo',
label: '渠道退款单号',
content: (data: PayRefundApi.Refund) =>
h(Tag, { color: 'success' }, () => data?.channelRefundNo || '-'),
render: (val) => h(Tag, { color: 'success' }, () => val || '-'),
},
{
field: 'merchantOrderId',
label: '商户支付单号',
content: (data: PayRefundApi.Refund) =>
h(Tag, {}, () => data?.merchantOrderId || '-'),
render: (val) => h(Tag, {}, () => val || '-'),
},
{
field: 'channelOrderNo',
label: '渠道支付单号',
content: (data: PayRefundApi.Refund) =>
h(Tag, { color: 'success' }, () => data?.channelOrderNo || '-'),
render: (val) => h(Tag, { color: 'success' }, () => val || '-'),
},
{
field: 'appId',
@@ -205,58 +200,55 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'payPrice',
label: '支付金额',
content: (data: PayRefundApi.Refund) =>
render: (val) =>
h(
Tag,
{ color: 'success' },
() => `${erpPriceInputFormatter(data?.payPrice || 0)}`,
() => `${erpPriceInputFormatter(val || 0)}`,
),
},
{
field: 'refundPrice',
label: '退款金额',
content: (data: PayRefundApi.Refund) =>
render: (val) =>
h(
Tag,
{ color: 'danger' },
() => `${erpPriceInputFormatter(data?.refundPrice || 0)}`,
() => `${erpPriceInputFormatter(val || 0)}`,
),
},
{
field: 'status',
label: '退款状态',
content: (data: any) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_REFUND_STATUS,
value: data?.status,
value: val,
}),
},
{
field: 'successTime',
label: '退款时间',
content: (data: PayRefundApi.Refund) =>
formatDateTime(data?.successTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'createTime',
label: '创建时间',
content: (data: PayRefundApi.Refund) =>
formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'updateTime',
label: '更新时间',
content: (data: PayRefundApi.Refund) =>
formatDateTime(data?.updateTime) as string,
render: (val) => formatDateTime(val) as string,
},
// 渠道信息部分
{
field: 'channelCode',
label: '退款渠道',
content: (data: PayRefundApi.Refund) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.channelCode,
value: val,
}),
},
{

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { PayTransferApi } from '#/api/pay/transfer';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -191,14 +190,12 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'merchantTransferId',
label: '商户单号',
content: (data: PayTransferApi.Transfer) =>
h(Tag, {}, () => data?.merchantTransferId),
render: (val) => h(Tag, {}, () => val),
},
{
field: 'no',
label: '转账单号',
content: (data: PayTransferApi.Transfer) =>
h(Tag, { color: 'orange' }, () => data?.no),
render: (val) => h(Tag, { color: 'orange' }, () => val),
},
{
field: 'appId',
@@ -207,33 +204,31 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'status',
label: '转账状态',
content: (data: any) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_TRANSFER_STATUS,
value: data?.status,
value: val,
}),
},
{
field: 'price',
label: '转账金额',
content: (data: PayTransferApi.Transfer) =>
render: (val) =>
h(
Tag,
{ color: 'success' },
() => `${erpPriceInputFormatter(data?.price || 0)}`,
() => `${erpPriceInputFormatter(val || 0)}`,
),
},
{
field: 'successTime',
label: '转账时间',
content: (data: PayTransferApi.Transfer) =>
formatDateTime(data?.successTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'createTime',
label: '创建时间',
content: (data: PayTransferApi.Transfer) =>
formatDateTime(data?.createTime) as string,
render: (val) => formatDateTime(val) as string,
},
{
field: 'userName',
@@ -246,10 +241,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'channelCode',
label: '支付渠道',
content: (data: PayTransferApi.Transfer) =>
render: (val) =>
h(DictTag, {
type: DICT_TYPE.PAY_CHANNEL_CODE,
value: data?.channelCode,
value: val,
}),
},
{
@@ -259,10 +254,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'channelTransferNo',
label: '渠道单号',
content: (data: PayTransferApi.Transfer) =>
data?.channelTransferNo
? h(Tag, { color: 'success' }, () => data.channelTransferNo)
: '',
render: (val) => (val ? h(Tag, { color: 'success' }, () => val) : ''),
},
{
field: 'notifyUrl',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemLoginLogApi } from '#/api/system/login-log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -110,10 +109,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'logType',
label: '操作类型',
content: (data: SystemLoginLogApi.LoginLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_LOGIN_TYPE,
value: data?.logType,
value: val,
});
},
},
@@ -132,19 +131,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'result',
label: '登录结果',
content: (data: SystemLoginLogApi.LoginLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_LOGIN_RESULT,
value: data?.result,
value: val,
});
},
},
{
field: 'createTime',
label: '登录日期',
content: (data: SystemLoginLogApi.LoginLog) => {
return formatDateTime(data?.createTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemMailLogApi } from '#/api/system/mail/log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -164,8 +163,8 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data: SystemMailLogApi.MailLog) => {
return formatDateTime(data?.createTime || '') as string;
render: (val) => {
return formatDateTime(val) as string;
},
},
{
@@ -175,14 +174,14 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'userId',
label: '接收用户',
content: (data: SystemMailLogApi.MailLog) => {
if (data?.userType && data?.userId) {
render: (val, data) => {
if (data?.userType && val) {
return h('div', [
h(DictTag, {
type: DICT_TYPE.USER_TYPE,
value: data.userType,
}),
` (${data.userId})`,
` (${val})`,
]);
}
return '无';
@@ -191,10 +190,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'toMails',
label: '接收信息',
content: (data: SystemMailLogApi.MailLog) => {
render: (val, data) => {
const lines: string[] = [];
if (data?.toMails && data.toMails.length > 0) {
lines.push(`收件:${data.toMails.join('、')}`);
if (val && val.length > 0) {
lines.push(`收件:${val.join('、')}`);
}
if (data?.ccMails && data.ccMails.length > 0) {
lines.push(`抄送:${data.ccMails.join('、')}`);
@@ -227,28 +226,26 @@ export function useDetailSchema(): DescriptionItemSchema[] {
field: 'templateContent',
label: '邮件内容',
span: 2,
content: (data: SystemMailLogApi.MailLog) => {
render: (val) => {
return h('div', {
innerHTML: data?.templateContent || '',
innerHTML: val || '',
});
},
},
{
field: 'sendStatus',
label: '发送状态',
content: (data: SystemMailLogApi.MailLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_MAIL_SEND_STATUS,
value: data?.sendStatus,
value: val,
});
},
},
{
field: 'sendTime',
label: '发送时间',
content: (data: SystemMailLogApi.MailLog) => {
return formatDateTime(data?.sendTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'sendMessageId',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemNotifyMessageApi } from '#/api/system/notify/message';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -166,10 +165,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'userType',
label: '用户类型',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.USER_TYPE,
value: data?.userType,
value: val,
});
},
},
@@ -196,9 +195,9 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'templateParams',
label: '模版参数',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
try {
return JSON.stringify(data?.templateParams);
return JSON.stringify(val);
} catch {
return '';
}
@@ -207,36 +206,32 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'templateType',
label: '模版类型',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE,
value: data?.templateType,
value: val,
});
},
},
{
field: 'readStatus',
label: '是否已读',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_BOOLEAN_STRING,
value: data?.readStatus,
value: val,
});
},
},
{
field: 'readTime',
label: '阅读时间',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
return formatDateTime(data?.readTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'createTime',
label: '创建时间',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
return formatDateTime(data?.createTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
];
}

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemNotifyMessageApi } from '#/api/system/notify/message';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -103,36 +102,32 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '发送时间',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
return formatDateTime(data?.createTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'templateType',
label: '消息类型',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE,
value: data?.templateType,
value: val,
});
},
},
{
field: 'readStatus',
label: '是否已读',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.INFRA_BOOLEAN_STRING,
value: data?.readStatus,
value: val,
});
},
},
{
field: 'readTime',
label: '阅读时间',
content: (data: SystemNotifyMessageApi.NotifyMessage) => {
return formatDateTime(data?.readTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'templateContent',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemOperateLogApi } from '#/api/system/operate-log';
import type { DescriptionItemSchema } from '#/components/description';
import { formatDateTime } from '@vben/utils';
@@ -134,7 +133,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'traceId',
label: '链路追踪',
hidden: (data: SystemOperateLogApi.OperateLog) => !data?.traceId,
show: (data) => !data?.traceId,
},
{
field: 'userId',
@@ -167,13 +166,14 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'extra',
label: '操作拓展参数',
hidden: (data: SystemOperateLogApi.OperateLog) => !data?.extra,
show: (data) => !data?.extra,
},
{
field: 'requestUrl',
label: '请求 URL',
content: (data: SystemOperateLogApi.OperateLog) => {
if (data?.requestMethod && data?.requestUrl) {
return `${data.requestMethod} ${data.requestUrl}`;
render: (val, data) => {
if (data?.requestMethod && val) {
return `${data.requestMethod} ${val}`;
}
return '';
},
@@ -181,9 +181,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '操作时间',
content: (data: SystemOperateLogApi.OperateLog) => {
return formatDateTime(data?.createTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'bizId',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSmsLogApi } from '#/api/system/sms/log';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -179,9 +178,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'createTime',
label: '创建时间',
content: (data: SystemSmsLogApi.SmsLog) => {
return formatDateTime(data?.createTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'mobile',
@@ -198,10 +195,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'templateType',
label: '模板类型',
content: (data: SystemSmsLogApi.SmsLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
value: data?.templateType,
value: val,
});
},
},
@@ -212,19 +209,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'sendStatus',
label: '发送状态',
content: (data: SystemSmsLogApi.SmsLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
value: data?.sendStatus,
value: val,
});
},
},
{
field: 'sendTime',
label: '发送时间',
content: (data: SystemSmsLogApi.SmsLog) => {
return formatDateTime(data?.sendTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'apiSendCode',
@@ -237,19 +232,17 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'receiveStatus',
label: '接收状态',
content: (data: SystemSmsLogApi.SmsLog) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
value: data?.receiveStatus,
value: val,
});
},
},
{
field: 'receiveTime',
label: '接收时间',
content: (data: SystemSmsLogApi.SmsLog) => {
return formatDateTime(data?.receiveTime || '') as string;
},
render: (val) => formatDateTime(val) as string,
},
{
field: 'apiReceiveCode',

View File

@@ -1,6 +1,5 @@
import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { SystemSocialUserApi } from '#/api/system/social/user';
import type { DescriptionItemSchema } from '#/components/description';
import { h } from 'vue';
@@ -8,6 +7,8 @@ import { h } from 'vue';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Image } from 'ant-design-vue';
import { DictTag } from '#/components/dict-tag';
import { getRangePickerDefaultProps } from '#/utils';
@@ -111,10 +112,10 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'type',
label: '社交平台',
content: (data: SystemSocialUserApi.SocialUser) => {
render: (val) => {
return h(DictTag, {
type: DICT_TYPE.SYSTEM_SOCIAL_TYPE,
value: data?.type,
value: val,
});
},
},
@@ -125,20 +126,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
{
field: 'avatar',
label: '用户头像',
// TODO @芋艿:使用 antd 的 Image 组件
content: (data: SystemSocialUserApi.SocialUser) => {
if (data?.avatar) {
return h('img', {
src: data.avatar,
style: 'width: 30px; height: 30px; cursor: pointer;',
onClick: () => {
// 可以添加图片预览功能
window.open(data.avatar, '_blank');
},
});
}
return '无';
},
render: (val) => (val ? h(Image, { src: val }) : '无'),
},
{
field: 'token',