Trim legacy dashboard runtime assets
This commit is contained in:
@@ -38,10 +38,6 @@ const widgetComponents: Record<
|
||||
'announcement-list': defineAsyncComponent(
|
||||
() => import('./widgets/AnnouncementList.vue'),
|
||||
),
|
||||
'approval-center': defineAsyncComponent(
|
||||
() => import('./widgets/ApprovalCenter.vue'),
|
||||
),
|
||||
'my-apps': defineAsyncComponent(() => import('./widgets/MyApps.vue')),
|
||||
'notice-list': defineAsyncComponent(() => import('./widgets/NoticeList.vue')),
|
||||
'quick-links': defineAsyncComponent(() => import('./widgets/QuickLinks.vue')),
|
||||
'server-monitor': defineAsyncComponent(
|
||||
|
||||
@@ -3,8 +3,6 @@ import type {
|
||||
FieldMapping,
|
||||
} from '../types';
|
||||
|
||||
import { $t } from '@vben/locales';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
@@ -200,115 +198,3 @@ export function createRefreshTimer(
|
||||
|
||||
return () => clearInterval(timer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组件支持的字段映射目标
|
||||
*/
|
||||
export function getWidgetFieldTargets(
|
||||
widgetType: string,
|
||||
): { key: string; label: string }[] {
|
||||
const commonFields = [
|
||||
{ key: 'title', label: $t('dashboard-design.attribute.fieldLabels.title') },
|
||||
];
|
||||
|
||||
const fieldMap: Record<string, { key: string; label: string }[]> = {
|
||||
'stat-card': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'value',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.value'),
|
||||
},
|
||||
{
|
||||
key: 'trend',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.trend'),
|
||||
},
|
||||
{
|
||||
key: 'trendLabel',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.trendLabel'),
|
||||
},
|
||||
{
|
||||
key: 'prefix',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.prefix'),
|
||||
},
|
||||
{
|
||||
key: 'suffix',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.suffix'),
|
||||
},
|
||||
],
|
||||
'progress-card': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'percentage',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.percentage'),
|
||||
},
|
||||
],
|
||||
'chart-line': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'xAxisData',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.xAxisData'),
|
||||
},
|
||||
{
|
||||
key: 'seriesData',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.seriesData'),
|
||||
},
|
||||
],
|
||||
'chart-bar': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'xAxisData',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.xAxisData'),
|
||||
},
|
||||
{
|
||||
key: 'seriesData',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.seriesData'),
|
||||
},
|
||||
],
|
||||
'chart-pie': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'seriesData',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.seriesData'),
|
||||
},
|
||||
],
|
||||
'chart-gauge': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'value',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.currentValue'),
|
||||
},
|
||||
{ key: 'min', label: $t('dashboard-design.attribute.fieldLabels.min') },
|
||||
{ key: 'max', label: $t('dashboard-design.attribute.fieldLabels.max') },
|
||||
],
|
||||
'todo-list': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'items',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.listData'),
|
||||
},
|
||||
],
|
||||
'notice-list': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'items',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.listData'),
|
||||
},
|
||||
],
|
||||
'ranking-list': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'items',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.listData'),
|
||||
},
|
||||
],
|
||||
'quick-links': [
|
||||
...commonFields,
|
||||
{
|
||||
key: 'links',
|
||||
label: $t('dashboard-design.attribute.fieldLabels.linkData'),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
return fieldMap[widgetType] || commonFields;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user