初始化项目

This commit is contained in:
2026-03-23 22:28:20 +08:00
parent 4ff69624cd
commit 8c66e12320
84 changed files with 989 additions and 60 deletions

View File

@@ -3,11 +3,11 @@
<div class="card-item" v-for="(item, index) in cardList" :key="index">
<div class="card-left">
<div class="icon-box">
<img
:src="item.iconImg"
<Icon
:icon="item.iconImg"
class="icon-img"
:style="{ filter: item.iconFilter }"
>
/>
</div>
<div class="card-text">
<div class="module-name">{{ item.module }}</div>
@@ -22,17 +22,19 @@
</div>
</template>
<script setup>
<script lang="ts" setup>
import { ref, onMounted, watch } from 'vue'
// import { getIndexInfoList } from '@/api/bizApi'
const cardList = ref()
import { Icon } from '@jeesite/core/components/Icon';
import { MyPageIndex, myPageIndexListAll } from '@jeesite/biz/api/biz/myPageIndex';
const cardList = ref<MyPageIndex[]>()
async function getList() {
try {
const reqParams = {
indexCode: "werpIndex"
}
const res = await getIndexInfoList(reqParams)
const res = await myPageIndexListAll(reqParams)
cardList.value = res || []
} catch (error) {
console.error('获取数据失败:', error)
@@ -40,14 +42,6 @@ async function getList() {
}
}
const resizeHandler = () => {
const container = document.querySelector('.chart-top-container')
if (container) {
const height = container.parentElement.clientHeight
container.style.height = `${height}px`
}
}
onMounted(() => {
getList()
})
@@ -79,7 +73,7 @@ watch(
flex: 1;
min-width: 160px;
height: 85%;
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/item/03.png") no-repeat;
background: rgba(0, 0, 0, 0.1) url("@jeesite/assets/chart/item/03.png") no-repeat;
background-size: 100% 100%;
border: 1px solid rgba(26, 80, 139, 0.3);
border-radius: 8px;

View File

@@ -2,7 +2,7 @@
<div class="erp-layout-container">
<div class="erp-section erp-top-header">
<div class="erp-card full-card">
<!-- <ChartTop /> -->
<ChartTop />
</div>
</div>

View File

@@ -8,6 +8,7 @@ import { PageEnum } from '@jeesite/core/enums/pageEnum';
import { t } from '@jeesite/core/hooks/web/useI18n';
const modules = import.meta.glob('./modules/**/*.ts', { eager: true });
const bigScreenModules = import.meta.glob('../../layouts/screen/welcome/**/index.vue');
const routeModuleList: AppRouteModule[] = [];
@@ -47,60 +48,56 @@ const ModPwdRoute: AppRouteModule = {
},
};
function toPascalCase(value: string) {
return value
.split(/[-_/]+/)
.filter(Boolean)
.map((item) => item.charAt(0).toUpperCase() + item.slice(1))
.join('');
}
function createBigScreenChildren(): AppRouteRecordRaw[] {
return Object.entries(bigScreenModules)
.map(([filePath, component]) => {
const matched = filePath.match(/screen\/welcome(?:\/([^/]+))?\/index\.vue$/);
if (!matched) return null;
const segment = matched[1]?.toLowerCase() || 'welcome';
return {
path: segment,
name: `Screen${toPascalCase(segment)}`,
component,
meta: {
title: t('routes.screen.bigScreen'),
},
} as AppRouteRecordRaw;
})
.filter((route): route is AppRouteRecordRaw => !!route)
.sort((a, b) => {
if (a.path === 'welcome') return -1;
if (b.path === 'welcome') return 1;
return a.path.localeCompare(b.path);
});
}
const bigScreenChildren = createBigScreenChildren();
const BigScreenRoute: AppRouteRecordRaw = {
path: '/bigScreen',
name: 'BigScreen',
component: SCREEN_LAYOUT,
redirect: '/bigScreen/welcome',
redirect: `/bigScreen/${bigScreenChildren[0]?.path || 'welcome'}`,
meta: {
title: t('routes.screen.bigScreen'),
ignoreAuth: false,
},
children: [
{
path: 'welcome',
name: 'ScreenWelcome',
component: () => import('@jeesite/core/layouts/views/screen/welcome/index.vue'),
meta: {
title: t('routes.screen.bigScreen'),
},
},
{
path: 'home',
name: 'ScreenHome',
component: () => import('@jeesite/core/layouts/views/screen/welcome/Home/index.vue'),
meta: {
title: t('routes.screen.bigScreen'),
},
},
{
path: 'work',
name: 'ScreenWork',
component: () => import('@jeesite/core/layouts/views/screen/welcome/Work/index.vue'),
meta: {
title: t('routes.screen.bigScreen'),
},
},
{
path: 'erp',
name: 'ScreenErp',
component: () => import('@jeesite/core/layouts/views/screen/welcome/Erp/index.vue'),
meta: {
title: t('routes.screen.bigScreen'),
},
},
{
path: 'sys',
name: 'ScreenSys',
component: () => import('@jeesite/core/layouts/views/screen/welcome/Sys/index.vue'),
meta: {
title: t('routes.screen.bigScreen'),
},
},
...bigScreenChildren,
{
path: 'setting',
name: 'ScreenSetting',
component: () => import('@jeesite/core/layouts/views/screen/setting/index.vue'),
component: () => import('@jeesite/core/layouts/screen/setting/index.vue'),
meta: {
title: t('routes.screen.bigSetting'),
},
@@ -109,4 +106,12 @@ const BigScreenRoute: AppRouteRecordRaw = {
};
// Basic routing without permission
export const basicRoutes = [LoginRoute, ModPwdRoute, RootRoute, BigScreenRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE];
export const basicRoutes = [
LoginRoute,
ModPwdRoute,
RootRoute,
BigScreenRoute,
...mainOutRoutes,
REDIRECT_ROUTE,
PAGE_NOT_FOUND_ROUTE,
];