|
@@ -18,7 +18,24 @@
|
|
|
<div class="icon-grid">
|
|
<div class="icon-grid">
|
|
|
<div class="icon-item" v-for="page in app.appPages" :key="page.pageId" @click="handleClick(page)">
|
|
<div class="icon-item" v-for="page in app.appPages" :key="page.pageId" @click="handleClick(page)">
|
|
|
<div class="icon-wrapper">
|
|
<div class="icon-wrapper">
|
|
|
- <img :src="getIconPath(page.appName)" :alt="page.appName" />
|
|
|
|
|
|
|
+ <img :src="getIconPath(page.pageIcon || page.appName)" :alt="page.appName" />
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
<span class="icon-label">{{ page.appName }}</span>
|
|
<span class="icon-label">{{ page.appName }}</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -40,32 +57,19 @@ interface AppPage {
|
|
|
interface AppInfo {
|
|
interface AppInfo {
|
|
|
appId: number;
|
|
appId: number;
|
|
|
appName: string;
|
|
appName: string;
|
|
|
|
|
+ pageIcon?: string;
|
|
|
appPages: AppPage[];
|
|
appPages: AppPage[];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const appList = ref<AppInfo[]>([]);
|
|
const appList = ref<AppInfo[]>([]);
|
|
|
|
|
|
|
|
-// Icon Mapping
|
|
|
|
|
-const iconMap: Record<string, string> = {
|
|
|
|
|
- '立项': 'project_initiation.png',
|
|
|
|
|
- '项目变更': 'project_change.png',
|
|
|
|
|
- '进出场单': 'entry_exit_form.png',
|
|
|
|
|
- '文档': 'document.png',
|
|
|
|
|
- '申购': 'purchase_request.png',
|
|
|
|
|
- 'BOM变更': 'bom_change.png',
|
|
|
|
|
- '兑换': 'redeem.png',
|
|
|
|
|
- '兑换付款': 'redeem_payment.png',
|
|
|
|
|
- '配置品审批': 'configuration_approval.png',
|
|
|
|
|
- '投标入场': 'entry_approval.png',
|
|
|
|
|
- '配置付款': 'configuration_payment.png',
|
|
|
|
|
- '项目汇总': 'project_summary.png',
|
|
|
|
|
- '工单生成': 'work_order_service.png',
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
// Helper to get icon path
|
|
// Helper to get icon path
|
|
|
-const getIconPath = (name: string) => {
|
|
|
|
|
- const filename = iconMap[name] || 'document.png'; // Default icon
|
|
|
|
|
- return new URL(`/src/assets/images/home/${filename}`, import.meta.url).href;
|
|
|
|
|
|
|
+const getIconPath = (name: string | undefined) => {
|
|
|
|
|
+ if (!name) {
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('name', name);
|
|
|
|
|
+ return new URL(`/src/assets/homeIcon/${name}@2x.png`, import.meta.url).href;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleClick = async (item: AppPage) => {
|
|
const handleClick = async (item: AppPage) => {
|