fix: 调整首页等问题
This commit is contained in:
@@ -18,6 +18,10 @@ export namespace CommentApi {
|
||||
content?: string; // 评论内容
|
||||
children?: Comment[]; // 子评论
|
||||
projectName?: string; // 项目名称
|
||||
status?: string;
|
||||
serialNo?: string;
|
||||
businessOwner?: string;
|
||||
technicalOwnerA?: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ export namespace CustomerApi {
|
||||
projectCount: number;
|
||||
licenseCount: number;
|
||||
userCount: number;
|
||||
contractCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"name": "Project Name",
|
||||
"envInfoFile": "Environment Info Attachment",
|
||||
"list": "Project List",
|
||||
"progress": "Progress",
|
||||
"progress": "Comment",
|
||||
"updateTime": "Last Modified Time",
|
||||
"commentNum": "Comment Count"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"project": "项目",
|
||||
"operation": "操作",
|
||||
"creationTime": "创建时间",
|
||||
"remarks": "备注",
|
||||
"remarks": "软件版本信息",
|
||||
"envInfo": "环境信息",
|
||||
"status": "项目状态",
|
||||
"endTime": "项目结束时间",
|
||||
@@ -20,7 +20,7 @@
|
||||
"name": "项目名称",
|
||||
"envInfoFile": "环境信息附件",
|
||||
"list": "项目列表",
|
||||
"progress": "进展",
|
||||
"progress": "评论",
|
||||
"updateTime": "最后修改时间",
|
||||
"commentNum": "评论数"
|
||||
}
|
||||
|
||||
@@ -4,12 +4,6 @@ import type { AnalysisOverviewItem, WorkbenchTrendItem } from '@vben/common-ui';
|
||||
import { onMounted, shallowRef } from 'vue';
|
||||
|
||||
import { AnalysisOverview, WorkbenchTrends } from '@vben/common-ui';
|
||||
import {
|
||||
SvgBellIcon,
|
||||
SvgCakeIcon,
|
||||
SvgCardIcon,
|
||||
SvgDownloadIcon,
|
||||
} from '@vben/icons';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
@@ -17,6 +11,8 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { getLatestCommentList } from '#/api/license/comment';
|
||||
import { dashboard } from '#/api/license/customer';
|
||||
import { getLicenseExpiry } from '#/api/license/license';
|
||||
// import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE, getDictObj } from '#/utils';
|
||||
|
||||
const overviewItems = shallowRef<AnalysisOverviewItem[]>([]);
|
||||
const trendItems = shallowRef<WorkbenchTrendItem[]>([]);
|
||||
@@ -28,28 +24,35 @@ onMounted(async () => {
|
||||
|
||||
overviewItems.value = [
|
||||
{
|
||||
icon: SvgCardIcon,
|
||||
icon: 'icon-[streamline-plump-color--user-pin-flat] size-8 flex-shrink-0',
|
||||
title: '用户量',
|
||||
totalTitle: '总用户量',
|
||||
totalValue: data.userCount || 0,
|
||||
value: data.userCount || 0,
|
||||
},
|
||||
{
|
||||
icon: SvgCakeIcon,
|
||||
icon: 'icon-[streamline-color--information-desk-customer] size-8 flex-shrink-0',
|
||||
title: '客户量',
|
||||
totalTitle: '总客户量',
|
||||
totalValue: data?.customerCount || 0,
|
||||
value: data?.customerCount || 0,
|
||||
},
|
||||
{
|
||||
icon: SvgBellIcon,
|
||||
icon: 'icon-[streamline-sharp-color--laptop-project-screen-flat] size-8 flex-shrink-0',
|
||||
title: '项目量',
|
||||
totalTitle: '总项目量',
|
||||
totalValue: data?.projectCount || 0,
|
||||
value: data?.projectCount || 0,
|
||||
},
|
||||
{
|
||||
icon: SvgDownloadIcon,
|
||||
icon: 'icon-[material-icon-theme--folder-contract-open] size-8 flex-shrink-0',
|
||||
title: '合同量',
|
||||
totalTitle: '总合同量',
|
||||
totalValue: data?.contractCount || 0,
|
||||
value: data?.contractCount || 0,
|
||||
},
|
||||
{
|
||||
icon: 'icon-[streamline-color--key-flat] size-8 flex-shrink-0',
|
||||
title: 'License量',
|
||||
totalTitle: '总License量',
|
||||
totalValue: data?.licenseCount || 0,
|
||||
@@ -64,16 +67,35 @@ onMounted(async () => {
|
||||
content: `客户【<b>${item.customerName}</b>】项目【<b>${item.projectName}</b>】的License即将在 <b>${dayjs(item.expiryDate).fromNow(true)}</b> 后到期`,
|
||||
date: dayjs(item.expiryDate).format('YYYY-MM-DD HH:mm:ss') || '',
|
||||
title: item.serialNo || '',
|
||||
status: '',
|
||||
info: '',
|
||||
};
|
||||
});
|
||||
|
||||
const comments = await getLatestCommentList();
|
||||
|
||||
projectProgressItems.value = comments.map((item) => {
|
||||
// 获取字典对象
|
||||
const dict = getDictObj(DICT_TYPE.LIC_PROJECT_STATUS, String(item.status));
|
||||
|
||||
let dataContent = item.content || '';
|
||||
if (dataContent) {
|
||||
const position = dataContent.indexOf('>') + 1;
|
||||
const originalString = dataContent;
|
||||
const stringToInsert = `<span style="font-size: 12px; color: #32363973">${item.author}:</span>`;
|
||||
dataContent =
|
||||
originalString.slice(0, position) +
|
||||
stringToInsert +
|
||||
originalString.slice(position);
|
||||
}
|
||||
|
||||
return {
|
||||
avatar: '',
|
||||
content: item.content || '',
|
||||
content: dataContent,
|
||||
date: dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss') || '',
|
||||
title: item.projectName || '',
|
||||
title: `${item.projectName ?? ''} `,
|
||||
status: dict,
|
||||
info: `${item.serialNo ?? ''} ${item.businessOwner ?? ''} ${item.technicalOwnerA ?? ''}`,
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
@@ -94,7 +94,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle" class="w-[800px]">
|
||||
<Modal :title="getTitle" class="w-1/2">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
@@ -83,8 +83,8 @@ const formatContent = computed(() => {
|
||||
</a-avatar>
|
||||
</template>
|
||||
<template #datetime>
|
||||
<a-tooltip :title="dayjs(data.updateTime).format('YYYY-MM-DD HH:mm:ss')">
|
||||
<span>{{ dayjs(data.updateTime).fromNow() }}</span>
|
||||
<a-tooltip :title="dayjs(data.updateTime)">
|
||||
<span>{{ dayjs(data.updateTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #content>
|
||||
|
||||
@@ -102,6 +102,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: $t('project.contractCode'),
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
help: '没有合同的项目请填0',
|
||||
},
|
||||
{
|
||||
fieldName: 'businessStatus',
|
||||
@@ -183,6 +184,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
fieldName: 'remark',
|
||||
label: $t('project.remarks'),
|
||||
component: 'Textarea',
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -31,7 +31,7 @@ const [Form, formApi] = useVbenForm({
|
||||
class: 'w-full',
|
||||
},
|
||||
// formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
@@ -90,7 +90,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle" class="w-[800px]">
|
||||
<Modal :title="getTitle" class="w-1/2">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user