Browse Source

feat: 基础功能添加

main
betaqi 2 months ago
parent
commit
d3794b99dd
  1. 2
      .env
  2. 3
      .env.cloud
  3. 3
      .env.local
  4. 18
      global.types/components.d.ts
  5. 4
      global.types/global.d.ts
  6. 2
      index.html
  7. 8
      package-lock.json
  8. 1
      package.json
  9. 40
      src/api/modkJs/engineering/index.ts
  10. 11
      src/api/module/engineering/index.d.ts
  11. 14
      src/api/module/engineering/index.ts
  12. BIN
      src/assets/images/device/bms.png
  13. BIN
      src/assets/images/device/cac.png
  14. BIN
      src/assets/images/device/dgs.png
  15. BIN
      src/assets/images/device/ecg.png
  16. BIN
      src/assets/images/device/ecu.png
  17. BIN
      src/assets/images/device/em.png
  18. BIN
      src/assets/images/device/ems.png
  19. BIN
      src/assets/images/device/ffs.png
  20. BIN
      src/assets/images/device/group.png
  21. BIN
      src/assets/images/device/mppt.png
  22. BIN
      src/assets/images/device/pcs.png
  23. BIN
      src/assets/images/device/ths.png
  24. BIN
      src/assets/images/device/tms.png
  25. BIN
      src/assets/images/device/unit.png
  26. BIN
      src/assets/images/device/wpp.png
  27. 25
      src/assets/styles/theme-variables.css
  28. 27
      src/router/index.ts
  29. 203
      src/views/engineering/index.vue
  30. 150
      src/views/layout/index.vue
  31. 5
      vite.config.ts

2
.env

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
VITE_BASE_API = '/remoteServer'
VITE_SHOW_ONLINE_DEVICE = true
VITE_APP_ENV = local

3
.env.cloud

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
VITE_APP_ENV = cloud
VITE_BASE_URL = 'http://192.168.1.3:8080'
VITE_ZMQ_BASE_URL = '192.168.1.99'

3
.env.local

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
VITE_APP_ENV = local
VITE_BASE_URL = 'http://192.168.1.210:8080'
VITE_ZMQ_BASE_URL = '192.168.1.210'

18
global.types/components.d.ts vendored

@ -10,6 +10,7 @@ declare module 'vue' { @@ -10,6 +10,7 @@ declare module 'vue' {
export interface GlobalComponents {
EdfsButton: typeof import('./../src/components/Edfs-button.vue')['default']
EdfsDialog: typeof import('./../src/components/Edfs-dialog.vue')['default']
EdfsException: typeof import('./../src/components/Edfs-exception.vue')['default']
EdfsInput: typeof import('./../src/components/Edfs-Input.vue')['default']
EdfsNumberInput: typeof import('./../src/components/Edfs-number-input.vue')['default']
EdfsTable: typeof import('./../src/components/Edfs-table/index.vue')['default']
@ -18,11 +19,28 @@ declare module 'vue' { @@ -18,11 +19,28 @@ declare module 'vue' {
ElButton: typeof import('element-plus/es')['ElButton']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
ElUpload: typeof import('element-plus/es')['ElUpload']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}

4
global.types/global.d.ts vendored

@ -43,8 +43,8 @@ declare global { @@ -43,8 +43,8 @@ declare global {
}
interface PageParam {
pageSize?: number
pageNo?: number
pageSize: number
pageNo: number
}
interface Tree {

2
index.html

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EMU</title>
<title>工程管理</title>
</head>
<body>

8
package-lock.json generated

@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
"devDependencies": {
"@iconify/json": "^2.2.310",
"@tsconfig/node22": "^22.0.0",
"@types/mockjs": "^1.0.10",
"@types/node": "^24.2.1",
"@unocss/preset-icons": "^66.0.0",
"@unocss/preset-rem-to-px": "^66.0.0",
@ -2421,6 +2422,13 @@ @@ -2421,6 +2422,13 @@
"@types/lodash": "*"
}
},
"node_modules/@types/mockjs": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/@types/mockjs/-/mockjs-1.0.10.tgz",
"integrity": "sha512-SXgrhajHG7boLv6oU93CcmdDm0HYRiceuz6b+7z+/2lCJPTWDv0V5YiwFHT2ejE4bQqgSXQiVPQYPWv7LGsK1g==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/node": {
"version": "24.10.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",

1
package.json

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
"devDependencies": {
"@iconify/json": "^2.2.310",
"@tsconfig/node22": "^22.0.0",
"@types/mockjs": "^1.0.10",
"@types/node": "^24.2.1",
"@unocss/preset-icons": "^66.0.0",
"@unocss/preset-rem-to-px": "^66.0.0",

40
src/api/modkJs/engineering/index.ts

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
import Mock from 'mockjs'
import type { IEngineeringOV, IEngineering } from '@/api/module/engineering/index.d'
// Cache the data to ensure consistency across calls
const cachedData = Mock.mock({
'list|20': [
{
'id|+1': 1,
name: '@ctitle(5, 10)',
versions: 'v@integer(1, 9).@integer(0, 9).@integer(0, 9)',
description: '@cparagraph(1, 3)',
},
],
total: 20,
})
export const getEngineeringListMock = () => {
return new Promise<{ list: IEngineering[]; total: number }>((resolve) => {
setTimeout(() => {
resolve({
list: cachedData.list.map((item: any) => ({
...item,
id: String(item.id),
})),
total: cachedData.total,
})
}, 500)
})
}
export const createEngineeringMock = (params: IEngineeringOV) => {
return new Promise<{ id: string }>((resolve) => {
setTimeout(() => {
resolve({
id: '1',
})
}, 500)
})
}

11
src/api/module/engineering/index.d.ts vendored

@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
export interface IEngineeringList {
id: string,
name: string,
description: string,
export interface IEngineering {
id: string
versions: string
name: string
description: string
}
export type IEngineeringOV = Omit<IEngineering, 'id' | 'versions'>

14
src/api/module/engineering/index.ts

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
import { globalServer } from '../index'
import { getEngineeringListMock, createEngineeringMock } from '@/api/modkJs/engineering'
import type { IEngineeringOV, IEngineering } from './index.d'
export const getEngineeringList = () => {
// Use mock data
return getEngineeringListMock()
}
export const createEngineering = (params: IEngineeringOV) => {
// Use mock data
return createEngineeringMock(params)
}

BIN
src/assets/images/device/bms.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
src/assets/images/device/cac.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/images/device/dgs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/images/device/ecg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 B

BIN
src/assets/images/device/ecu.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/images/device/em.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/assets/images/device/ems.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/images/device/ffs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/images/device/group.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 878 B

BIN
src/assets/images/device/mppt.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/assets/images/device/pcs.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

BIN
src/assets/images/device/ths.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
src/assets/images/device/tms.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/images/device/unit.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/assets/images/device/wpp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

25
src/assets/styles/theme-variables.css

@ -47,28 +47,3 @@ html[data-theme='light'] { @@ -47,28 +47,3 @@ html[data-theme='light'] {
--icon-color: #aaa;
--icon-hover-color: #606266;
}
html.dark {
--el-bg-color: #212327;
--el-border-color: rgba(255, 255, 255, 0.13);
--el-button-divide-border-color: rgba(255, 255, 255, 0.13);
--el-bg-color-overlay: #212327;
--el-text-color-regular: #c7c8cb;
--el-color-primary: #619925;
--el-color-primary-light-3: rgb(78.1, 141.8, 46.6);
--el-color-primary-light-5: rgb(61.5, 107, 39);
--el-color-primary-light-7: rgb(44.9, 72.2, 31.4);
--el-color-primary-light-8: rgb(36.6, 54.8, 27.6);
--el-color-primary-light-9: rgb(28.3, 37.4, 23.8);
--el-color-primary-dark-2: rgb(133.4, 206.2, 97.4);
}
html.light {
--el-color-primary: #619925;
--el-color-primary-light-3: rgb(148.6, 212.3, 117.1);
--el-color-primary-light-5: rgb(179, 224.5, 156.5);
--el-color-primary-light-7: rgb(209.4, 236.7, 195.9);
--el-color-primary-light-8: rgb(224.6, 242.8, 215.6);
--el-color-primary-light-9: rgb(239.8, 248.9, 235.3);
--el-color-primary-dark-2: rgb(82.4, 155.2, 46.4);
}

27
src/router/index.ts

@ -22,8 +22,35 @@ export const defaultRouter = [ @@ -22,8 +22,35 @@ export const defaultRouter = [
icon: 'i-icon-park-outline:data',
},
},
{
path: '/engineering-config/:type',
name: 'engineering-config',
component: () => import('@/views/engineering/config/index.vue'),
meta: {
title: '工程配置',
isShow: false,
icon: '',
},
beforeEnter: (to: any, from: any, next: any) => {
const { type } = to.params;
if (type === 'created' || type === 'edit') {
next();
} else {
next({ name: 'NoFound' });
}
},
}
],
},
{
path: '/404',
name: 'NoFound',
component: () => import('@/views/Error/404.vue'),
meta: {
hidden: true,
title: '404',
},
},
]
const router = createRouter({

203
src/views/engineering/index.vue

@ -1,19 +1,204 @@ @@ -1,19 +1,204 @@
<template>
<EdfsWrap class="wh-full" :title="'工程列表'">
<EdfsWrap class="wh-full" :title="'工程列表'" :use-scroll-bar="false">
<template #title-right>
<EdfsButton
inner-text="新增工程"
type="primary"
size="small"
plain
@click="addEngineering"
/>
<!-- <el-button type="primary" @click="addEngineering" :icon="Plus">新增工程</el-button> -->
</template>
<div class="engineering-list-container">
<div class="engineering-grid">
<!-- Add Engineering Card -->
<div class="engineering-card add-card" @click="addEngineering">
<div class="add-card-content">
<el-icon :size="48" class="add-icon">
<Plus />
</el-icon>
<span class="add-text">新增工程</span>
</div>
</div>
<!-- Engineering List -->
<div v-for="item in list" :key="item.id" class="engineering-card">
<div class="card-header">
<span class="card-title">{{ item.name }}</span>
<el-tag type="success">{{ item.versions }}</el-tag>
</div>
<div class="card-body">
<p class="card-desc">{{ item.description }}</p>
</div>
<div class="card-footer">
<el-button type="primary" text @click="enterEngineering(item)"
>进入工程</el-button
>
<el-button type="danger" text @click="deleteEngineering(item)"
>删除</el-button
>
</div>
</div>
</div>
<p v-if="loading" class="loading-text">加载中...</p>
<el-empty v-if="!loading && list.length === 0" description="暂无数据" />
</div>
</EdfsWrap>
<CreateEngineeringDlg ref="createEngineeringDlgRef" />
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import EdfsWrap from '@/components/Edfs-wrap.vue'
import { getEngineeringList } from '@/api/module/engineering'
import type { IEngineering } from '@/api/module/engineering/index.d'
import CreateEngineeringDlg from './components/create-engineering-dlg.vue'
import { Plus } from '@element-plus/icons-vue'
const router = useRouter()
const list = ref<IEngineering[]>([])
const loading = ref(false)
onMounted(() => {
fetchData()
})
const fetchData = async () => {
loading.value = true
try {
const res = await getEngineeringList()
list.value = res.list
} catch (error) {
console.error(error)
} finally {
loading.value = false
}
}
function addEngineering() {
createEngineeringDlgRef.value?.open()
}
function enterEngineering(item: IEngineering) {
router.push({
path: '/engineering-config/edit',
query: {
name: item.name,
version: item.versions,
},
})
}
function addEngineering() {}
function deleteEngineering(item: IEngineering) {}
const createEngineeringDlgRef = ref<typeof CreateEngineeringDlg | null>(null)
</script>
<style scoped lang="scss">
.engineering-list-container {
height: 100%;
overflow-y: auto;
padding: 16px;
.engineering-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 16px;
}
.engineering-card {
background: #fff;
border-radius: 4px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
padding: 16px;
display: flex;
flex-direction: column;
transition: all 0.3s;
&:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.15);
}
.card-header {
margin-bottom: 12px;
display: flex;
align-items: center;
justify-content: space-between;
.card-title {
font-size: 16px;
font-weight: bold;
color: #303133;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 8px;
}
}
.card-body {
flex: 1;
margin-bottom: 16px;
.card-desc {
font-size: 14px;
color: #606266;
line-height: 1.5;
overflow: hidden;
}
}
.card-footer {
display: flex;
justify-content: flex-end;
border-top: 1px solid #ebeef5;
padding-top: 12px;
}
}
.add-card {
border: 2px dashed #dcdfe6;
background: #fafafa;
cursor: pointer;
justify-content: center;
align-items: center;
min-height: 200px;
&:hover {
border-color: #409eff;
background: #f0f9ff;
.add-icon {
color: #409eff;
}
.add-text {
color: #409eff;
}
}
.add-card-content {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
.add-icon {
color: #909399;
transition: color 0.3s;
}
.add-text {
font-size: 16px;
color: #606266;
font-weight: 500;
transition: color 0.3s;
}
}
}
.loading-text,
.no-more-text {
text-align: center;
color: #909399;
padding: 16px 0;
font-size: 14px;
}
}
</style>

150
src/views/layout/index.vue

@ -2,36 +2,72 @@ @@ -2,36 +2,72 @@
<div class="common-layout">
<el-container>
<el-aside class="aside-wrap">
<RouterLink to="/" class="layout-logo" :class="{ 'layout-logo-collapse': isCollapse }">
<svg class="inline-block text-32px" width="1em" height="1em" viewBox="0 0 160 160"
xmlns="http://www.w3.org/2000/svg">
<RouterLink
to="/"
class="layout-logo"
:class="{ 'layout-logo-collapse': isCollapse }"
>
<svg
class="inline-block text-32px"
width="1em"
height="1em"
viewBox="0 0 160 160"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M81.28 55.9c-.1-11.67-2.93-22.55-9.37-32.38-1-1.5-2.14-2.86-2.5-4.71a8.1 8.1 0 014-8.61 7.89 7.89 0 019.3 1.23 35.999 35.999 0 015.9 8.83 75.18 75.18 0 018.44 28.58 83.211 83.211 0 01-5.23 36.74 102.983 102.983 0 01-3 7.28 1.2 1.2 0 000 1.41c9.58 13.3 21.76 23 37.85 27.24a54.37 54.37 0 0019.68 1.57 7.72 7.72 0 018.36 6.9 7.903 7.903 0 01-6.7 9 64.744 64.744 0 01-23-1.33 77.68 77.68 0 01-36.93-19.88 93.628 93.628 0 01-11.91-13.71 2.18 2.18 0 00-2.3-1.06 72.744 72.744 0 00-27.38 7.55c-11.6 6-20.67 14.58-26.4 26.45a10.134 10.134 0 01-3.7 4.7 8 8 0 01-9.19-.7 7.86 7.86 0 01-2.36-9.28 60.324 60.324 0 018.72-14.52c12.2-15.43 28.21-24.59 47.32-28.57A85.085 85.085 0 0173.07 87c.524.015 1-.307 1.18-.8a76.06 76.06 0 006.53-22.3c.351-2.652.518-5.325.5-8z"
fill="currentColor"></path>
fill="currentColor"
></path>
<path
d="M136.26 108.34a44.742 44.742 0 01-11.13-2.87 46.108 46.108 0 01-19.66-13.76 8 8 0 015.72-13.22 7.93 7.93 0 016.54 2.93 33.27 33.27 0 0018.87 10.75c1.546.155 3.058.553 4.48 1.18a8.08 8.08 0 013.84 9.21c-.92 3.52-4.13 5.81-8.66 5.78zm-80.6-75.02a7.61 7.61 0 016.64 5 49.139 49.139 0 013.64 17 46.33 46.33 0 01-2.46 17.28c-2 5.77-8.24 7.79-12.89 4.15a8.1 8.1 0 01-2.39-9 31.679 31.679 0 001.68-12.36 35.77 35.77 0 00-2.43-11c-2.1-5.45 1.75-11.07 8.21-11.07zm22.26 93.25a8 8 0 01-6.68 7.86 32.88 32.88 0 00-19.7 12.19 8.13 8.13 0 01-11.21 1.62 8 8 0 01-1.41-11.58A51.043 51.043 0 0154 123.81a45.842 45.842 0 0114-5.1c5.35-1.04 9.91 2.56 9.92 7.86z"
fill="currentColor"></path>
fill="currentColor"
></path>
</svg>
<h2 class="pl-8px text-16px font-bold" v-show="!isCollapse">
EPM-工程管理平台
</h2>
</RouterLink>
<el-menu class="layout-menu" :default-active="activeMenu" @select="menuSelect" router
:collapse="isCollapse">
<el-menu
class="layout-menu"
:default-active="activeMenu"
@select="menuSelect"
router
:collapse="isCollapse"
>
<template v-for="router in menuList">
<template v-if="router.meta?.isShow">
<el-sub-menu v-if="router?.children?.filter((item: any) => item.meta?.isShow).length"
<el-sub-menu
v-if="router?.children?.filter((item: any) => item.meta?.isShow).length"
:index="router.path"
:key="router.path">
:key="router.path"
>
<template #title>
<div :class="router.meta.icon" class="menu-icon"></div>
<span>{{ router.meta.title }}</span>
<div
:class="router.meta.icon"
class="menu-icon"
@click.stop="
router.path === '/engineering' ? menuSelect(router.path) : null
"
></div>
<span
@click.stop="
router.path === '/engineering' ? menuSelect(router.path) : null
"
>{{ router.meta.title }}</span
>
</template>
<template v-for="child in router?.children">
<el-menu-item v-if="child?.meta?.isShow" :key="child.path"
:index="`${router.path}/${child.path}`">
<el-menu-item
v-if="child?.meta?.isShow"
:key="child.path"
:index="
child.path.startsWith('/')
? child.path
: `${router.path}/${child.path}`
"
>
<div :class="child.meta.icon" class="menu-icon"></div>
<span>{{ child.meta.title }}</span>
<span class="truncate">{{ child.meta.title }}</span>
</el-menu-item>
</template>
</el-sub-menu>
@ -66,20 +102,50 @@ @@ -66,20 +102,50 @@
import { useTheme } from '@/composables/useTheme'
import { defaultRouter } from '@/router'
import dayjs from 'dayjs'
import { getEngineeringList } from '@/api/module/engineering'
import type { IEngineering } from '@/api/module/engineering/index.d'
const unfold = 'i-icon-park-outline:menu-unfold'
const fold = 'i-icon-park-outline:menu-fold'
const { theme } = useTheme()
const menuList = computed<any[]>(() => {
let data = defaultRouter[0].children
return data
const engineeringList = ref<IEngineering[]>([])
const menuList = computed(() => {
const routes = JSON.parse(JSON.stringify(defaultRouter[0].children))
const engRoute = routes.find((r: any) => r.path === '/engineering')
if (engRoute) {
// Initialize children array
engRoute.children = []
// Add "Overview" item
engRoute.children.push({
path: '/engineering',
meta: {
title: '工程总览',
isShow: true,
icon: 'i-icon-park-outline:all-application',
},
})
// Add engineering projects as children
const projectItems = engineeringList.value.map(item => ({
path: `/engineering-config/edit?name=${item.name}&version=${item.versions}`,
meta: {
title: item.name,
isShow: true,
icon: 'i-icon-park-outline:setting-two',
},
}))
engRoute.children.push(...projectItems)
}
)
return routes
})
const circleUrl = ref(
'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
)
const isCollapse = ref(false)
@ -89,8 +155,14 @@ const getIconClass = (icon: string) => { @@ -89,8 +155,14 @@ const getIconClass = (icon: string) => {
const { push, currentRoute } = useRouter()
const activeMenu = computed(() => {
const { meta, path } = unref(currentRoute)
const { meta, path, query } = unref(currentRoute)
if (path === '/engineering-config/edit' && query.name) {
return `/engineering-config/edit?name=${query.name}&version=${query.version}`
}
if (['/engineering-config/edit', '/engineering-config/created'].includes(path)) {
return '/engineering'
}
return path
})
@ -103,8 +175,19 @@ const updateTime = () => { @@ -103,8 +175,19 @@ const updateTime = () => {
currentTime.value = dayjs().format('YYYY-MM-DD HH:mm:ss')
requestAnimationFrame(updateTime)
}
const fetchEngineeringList = async () => {
try {
const res = await getEngineeringList()
engineeringList.value = res.list
} catch (error) {
console.error(error)
}
}
onMounted(() => {
updateTime()
fetchEngineeringList()
})
</script>
<style lang="scss" scoped>
@ -128,7 +211,32 @@ onMounted(() => { @@ -128,7 +211,32 @@ onMounted(() => {
}
:deep(.el-menu) {
@apply h-full;
@apply h-full px-1;
}
:deep(.el-menu-item.is-active) {
background-color: rgba(64, 158, 255, 0.1) !important;
border-radius: 8px;
}
:deep(.el-sub-menu .el-menu-item.is-active) {
background-color: rgba(64, 158, 255, 0.1) !important;
border-radius: 8px;
}
:deep(.el-menu-item:hover:not(.is-active)) {
background-color: transparent !important;
color: var(--el-color-primary);
}
:deep(.el-sub-menu .el-menu-item:hover:not(.is-active)) {
background-color: transparent !important;
color: var(--el-color-primary);
}
:deep(.el-sub-menu__title:hover) {
background-color: transparent !important;
color: var(--el-color-primary);
}
.aside-wrap {

5
vite.config.ts

@ -41,7 +41,6 @@ export default defineConfig(({ mode }) => { @@ -41,7 +41,6 @@ export default defineConfig(({ mode }) => {
},
build: {
outDir: env.VITE_APP_ENV === 'cloud' ? 'dist-cloud' : 'dist-local',
minify: 'terser',
terserOptions: {
compress: {
@ -58,7 +57,7 @@ export default defineConfig(({ mode }) => { @@ -58,7 +57,7 @@ export default defineConfig(({ mode }) => {
},
},
define: {
'process.env': {}
'process.env': {},
},
// 开发服务器配置
@ -76,7 +75,7 @@ export default defineConfig(({ mode }) => { @@ -76,7 +75,7 @@ export default defineConfig(({ mode }) => {
ws: true,
rewrite: path => path.replace(/^\/remoteServer/, ''),
},
}
},
},
}
})
Loading…
Cancel
Save