40 Commits

Author SHA1 Message Date
shi
119af564ba 1 2025-11-15 19:31:22 +08:00
shi
06f4b7a0e7 1 2025-11-15 19:26:27 +08:00
shi
e208fd7ffc Merge branch 'lx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-15 18:34:08 +08:00
shi
880509a99b Merge branch 'lx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-15 18:33:57 +08:00
shi
040aaab246 1 2025-11-15 18:33:27 +08:00
b26483a99c 修改圆球层级 2025-11-15 16:46:29 +08:00
shi
f45470185f 1 2025-11-15 16:41:52 +08:00
shi
fb96226b49 Merge branch 'lx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-15 16:41:12 +08:00
shi
8701a06f34 完善ue 2025-11-15 16:40:35 +08:00
9fd348318e 修改背景颜色 2025-11-15 15:48:05 +08:00
shi
40376baa79 Merge branch 'lx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-15 14:22:13 +08:00
shi
bcf74e463c 1 2025-11-15 14:21:50 +08:00
f1f820cd80 feat(ueScreen): 更新界面样式并添加操作统计数据
- 替换背景图片并调整样式
- 添加发电效率和工单统计进度条组件
- 重构发电量数据显示为循环渲染
- 更新字体配置和样式细节
- 删除无用图片资源
2025-11-15 14:16:44 +08:00
shi
3af08a5d0f 1 2025-11-15 10:37:54 +08:00
59308dd898 Merge branch 'szq' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into lx 2025-11-15 10:10:58 +08:00
shi
12bd03da73 1 2025-11-15 10:08:05 +08:00
bd6496443e 增加标题文字阴影样式 2025-11-15 10:03:15 +08:00
shi
087535587c Merge branch 'lx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-15 09:58:58 +08:00
shi
88ca02ea23 1 2025-11-15 09:58:15 +08:00
d06f5679b3 修改 2025-11-15 09:57:54 +08:00
ee119fb534 Merge branch 'ljx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into lx 2025-11-14 19:21:02 +08:00
3a02236862 feat(光伏电站): 添加左侧面板组件及资源文件
添加左侧面板组件leftPage.vue,包含光伏电站总览和主规模设备展示
新增smalltitle.vue组件用于标题展示
添加相关图片资源和字体文件
更新字体配置文件fonts.scss
2025-11-14 19:20:32 +08:00
shi
6b49de76e4 Merge branch 'ljx' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system into szq 2025-11-14 19:01:45 +08:00
shi
d54897807f 1 2025-11-14 19:01:12 +08:00
ljx
79d77d16c6 提交 2025-11-14 18:59:59 +08:00
ljx
20afedd3d1 提交 2025-11-14 16:46:34 +08:00
ljx
13a1b32d6d Merge branch 'master' of http://xny.yj-3d.com:3000/taoge_xiaodi/maintenance_system into ljx 2025-11-14 16:39:25 +08:00
ljx
d5a7397744 提交 2025-11-14 16:38:51 +08:00
ljx
07e43a1611 提交 2025-11-14 16:34:39 +08:00
cc3cf9dae5 优化 2025-11-03 19:36:51 +08:00
56f6be1998 优化 2025-11-03 19:35:45 +08:00
d34212f82a 1 2025-11-03 19:35:23 +08:00
ljx
7b4cdd2b3c 提交 2025-11-03 18:56:57 +08:00
Teo
2c3ed5612a Merge branch 'master' of http://192.168.110.2:3000/taoge_xiaodi/maintenance_system 2025-11-03 17:34:50 +08:00
Teo
57784ab74d 1 2025-11-03 17:34:47 +08:00
12960892ac 1 2025-11-01 10:42:30 +08:00
febbcb3241 fix: 修复样式和组件问题并增强数据图表功能
修复多个组件中的::v-deep语法错误和el-row的gutter属性绑定
将el-button的type="text"更新为link类型
在AppMain.vue中添加div包裹keep-alive以解决过渡问题
增强DataAnalysis组件的数据处理能力,添加计算属性和默认值
添加fetchChuRuKuCountBarData调用以完善库存管理功能
2025-10-09 20:22:04 +08:00
94cd3f867d feat(物资管理): 新增备件出入库总览功能并优化采购计划单
添加备件出入库总览API接口及前端展示
在采购计划单中增加设备类型字段及相关展示逻辑
优化文件上传组件处理逻辑
修复采购计划单表单验证及数据统计问题
移除备件管理页面多余操作按钮
2025-09-30 17:40:31 +08:00
6ee935ccb6 feat(采购管理): 新增供应商名称字段并优化表单校验
refactor(出入库管理): 添加产品ID字段并调整默认单据类型

fix(备品配件): 修正库存数量输入类型为数字并移除调试日志

feat(文件上传): 支持后端文件格式转换并暴露清空方法

style(库存管理): 调整单据类型默认值及表单字段顺序

perf(采购计划): 优化供应商选择及文件上传处理逻辑
2025-09-29 20:09:20 +08:00
321c3fce49 feat: 更新采购计划和出入库管理功能
添加清除所有草稿功能
扩展采购计划和出入库接口类型定义
新增出入库统计和产品列表接口
重写计划详情页面数据展示逻辑
改进数据分析组件支持动态数据
优化库存管理页面查询和展示逻辑
完善详情信息组件展示和文件预览功能
2025-09-28 20:04:30 +08:00
61 changed files with 3655 additions and 833 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 新能源场站智慧运维平台
VITE_APP_ENV = 'development'
# 开发环境
VITE_APP_BASE_API = 'http://192.168.110.210:18899'
VITE_APP_BASE_API = 'http://192.168.110.149:18899'
# 应用访问路径 例如使用前缀 /admin/
VITE_APP_CONTEXT_PATH = '/'

View File

@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
# 生产环境
VITE_APP_BASE_API = '/prod-api'
VITE_APP_BASE_API = 'http://xny.yj-3d.com:18899'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip

View File

@ -5,10 +5,6 @@
"ComputedRef": true,
"DirectiveBinding": true,
"EffectScope": true,
"ElLoading": true,
"ElMessage": true,
"ElMessageBox": true,
"ElNotification": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
@ -318,6 +314,10 @@
"watchThrottled": true,
"watchTriggerable": true,
"watchWithFilter": true,
"whenever": true
"whenever": true,
"ElMessage": true,
"ElLoading": true,
"ElMessageBox": true,
"ElNotification": true
}
}

View File

@ -212,5 +212,28 @@
<script src="/webrtc/jquery-1.12.2.min.js"></script>
<script src="/sdk/YJEarth.min.js"></script>
<script type="module" src="/src/main.ts"></script>
<script>
// 调用ue必要的设置需要一起复制
'object' != typeof ue || 'object' != typeof ue.interface
? ('object' != typeof ue && (ue = {}),
(ue.interface = {}),
(ue.interface.broadcast = function (e, t) {
if ('string' == typeof e) {
var o = [e, ''];
void 0 !== t && (o[1] = t);
var n = encodeURIComponent(JSON.stringify(o));
'object' == typeof history && 'function' == typeof history.pushState
? (history.pushState({}, '', '#' + n), history.pushState({}, '', '#' + encodeURIComponent('[]')))
: ((document.location.hash = n), (document.location.hash = encodeURIComponent('[]')));
}
}))
: (function (e) {
(ue.interface = {}),
(ue.interface.broadcast = function (t, o) {
'string' == typeof t && (void 0 !== o ? e.broadcast(t, JSON.stringify(o)) : e.broadcast(t, ''));
});
})(ue.interface),
(ue5 = ue.interface.broadcast);
</script>
</body>
</html>

BIN
public/assets/ue1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/assets/ue2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
public/assets/ue3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
public/assets/ue4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
public/assets/ue5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -61,3 +61,16 @@ export const delBeipinBeijian = (id: string | number | Array<string | number>) =
method: 'delete'
});
};
/**
* 运维-物资-备件-查询总览
* @param query
* @returns {*}
*/
export const chuRuKuTotal = (data:any): AxiosPromise<any> => {
return request({
url: '/ops/beipinBeijian/getCount',
method: 'get',
params: data
});
};

View File

@ -54,3 +54,45 @@ export const caigouPlanDetail = (id: string | number): AxiosPromise<CaigouPlanVO
method: 'get'
});
};
/**
* 更新运维-物资-采购计划单
* @param data
* @returns {*}
*/
export const updateCaigouPlan = (data: CaigouPlanForm): AxiosPromise<CaigouPlanVO> => {
return request({
url: '/ops/caigouPlan',
method: 'put',
data: data
});
};
// /**
// * 查询运维-物资-采购计划单年度金额
// * @param query
// * @returns {*}
// */
// export const getJinE = (query?: CaigouPlanQuery): AxiosPromise<any> => {
// return request({
// url: '/ops/caigouPlan/getJinE',
// method: 'get',
// params: query
// });
// };
/**
* 查询运维-物资-采购计划单年度金额
* @param id
* @returns {*}
*/
export const getCount = (id: string | number): AxiosPromise<CaigouPlanVO> => {
return request({
url: '/ops/caigouPlan/getJinE',
method: 'get',
params: {
projectId: id
}
});
};

View File

@ -178,6 +178,18 @@ export interface CaigouPlanVO {
* 采购申请计划文件 查询
*/
opsCaigouPlanFilesVos?: Array<any>;
/**
* 申请原因
*/
reason?: string;
/**
* 供应商名称
*/
gonyingshangName?: string;
/**
* 设备类型
*/
shebeiType?: string;
}
@ -360,8 +372,18 @@ export interface CaigouPlanForm extends BaseEntity {
* 出货时间
*/
chouhuoTime?: string;
/**
* 申请原因
*/
reason?: string;
/**
* 供应商名称
*/
gonyingshangName?: string;
/**
* 设备类型
*/
shebeiType?: string;
}
export interface CaigouPlanQuery extends PageQuery {
@ -545,6 +567,18 @@ export interface CaigouPlanQuery extends PageQuery {
* 出货时间
*/
chouhuoTime?: string;
/**
* 申请原因
*/
reason?: string;
/**
* 供应商名称
*/
gonyingshangName?: string;
/**
* 设备类型
*/
shebeiType?: string;
}

View File

@ -62,15 +62,43 @@ export const delChurukudan = (id: string | number | Array<string | number>) => {
});
};
/**
* 运维-物资-出入库单折现图
* @param query
* @returns {*}
*/
export const getChuRuKuCountLine = (data:any): AxiosPromise<any> => {
return request({
url: '/ops/churukudan/getChuRuKuDayCount',
method: 'get',
params: data
});
};
/**
* 运维-物资-出入库单柱状图
* @param query
* @returns {*}
*/
export const getChuRuKuCountBar = (data:any): AxiosPromise<any> => {
export const getChuRuKuDayCountBar = (data:any): AxiosPromise<any> => {
return request({
url: '/ops/churukudan/getChuRuKuCount',
method: 'get',
params: data
});
};
/**
* 运维-物资-出入库单-查询产品名称列表
* @param query
* @returns {*}
*/
export const getChanpinLists = (data:any): AxiosPromise<any> => {
return request({
url: '/ops/caigouPlan/getChanpinList',
method: 'get',
params: data
});
};

View File

@ -47,6 +47,18 @@ export interface ChurukudanVO {
*/
danjvType: string;
/**
* 审核状态
*/
auditStatus?: string;
/**
* 产品名称
*/
chanpinName?: string;
/**
* 产品id
*/
chanpinId?: string | number;
}
export interface ChurukudanForm extends BaseEntity {
@ -102,6 +114,14 @@ export interface ChurukudanForm extends BaseEntity {
* 审核状态
*/
auditStatus?: string;
/**
* 产品名称
*/
chanpinName?: string;
/**
* 产品id
*/
chanpinId?: string | number;
}
@ -139,11 +159,18 @@ export interface ChurukudanQuery extends PageQuery {
* 开始日期
*/
startDate?: string;
/**
* 产品名称
*/
chanpinName?: string;
/**
* 结束日期
*/
endDate?: string;
/**
* 产品id
*/
chanpinId?: string | number;
/**
* 日期范围参数
*/

Binary file not shown.

View File

@ -11,14 +11,20 @@
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'ue_title'; //UE标题体
src: url('./PangMenZhengDaoBiaoTiTiMianFeiBan-2.ttf');
font-weight: normal;
font-weight: normal;
font-style: normal;
}
// 思源字体
// @font-face {
// font-family: 'SourceHanSansCN-Bold';
// src: url('./ReflectTi/SourceHanSansCN-Bold_0.otf'); //暂时没用
// font-weight: normal;
// font-style: normal;
// }
@font-face {
font-family: 'SourceHanSansCN-Bold';
src: url('./ReflectTi/SourceHanSansCN-Bold_0.otf'); //思源加粗
font-weight: normal;
font-style: normal;
}
// @font-face {
// font-family: 'SourceHanSansCN-ExtraLight';
// src: url('./ReflectTi/SourceHanSansCN-ExtraLight.otf');//暂时没用
@ -44,16 +50,16 @@
// font-style: normal;
// }
// @font-face {
// font-family: 'SourceHanSansCN-Normal';
// src: url('./ReflectTi/SourceHanSansCN-Normal.otf');//暂时没用
// font-weight: normal;
// font-style: normal;
// }
@font-face {
font-family: 'SourceHanSansCN-Normal';
src: url('./ReflectTi/SourceHanSansCN-Normal.otf');//思源正常
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'SourceHanSansCN-Regular';
src: url('./ReflectTi/SourceHanSansCN-Regular.otf');
src: url('./ReflectTi/SourceHanSansCN-Regular.otf');//思源常规
font-weight: normal;
font-style: normal;
}
@ -154,7 +160,13 @@
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'LCDFont'; //光伏电量字体
src: url('./LCD2 Bold.ttf');
font-weight: normal;
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'D-Din';
src: url('./D-Din//D-DIN.ttf');

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -62,7 +62,7 @@
.el-date-picker {
/* --el-datepicker-text-color: var(--el-text-color-regular); */
--el-datepicker-off-text-color: var(--el-text-color-placeholder);
--el-datepicker-off-text-color: #fff !important;
--el-datepicker-header-text-color: #fff !important;
--el-datepicker-icon-color: #fff !important;
/* --el-datepicker-border-color: var(--el-disabled-border-color); */
@ -71,6 +71,7 @@
/* --el-datepicker-inrange-hover-bg-color: var(--el-border-color-extra-light); */
/* --el-datepicker-active-color: var(--el-color-primary); */
--el-datepicker-hover-text-color: #fff !important;
--el-datepicker-placeholder-text-color: #fff !important;
}
.el-date-picker__header-label {

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
src/assets/ueimg/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
src/assets/ueimg/bg1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/assets/ueimg/bj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

BIN
src/assets/ueimg/center.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/assets/ueimg/icon-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

BIN
src/assets/ueimg/icon-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/assets/ueimg/item.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/assets/ueimg/tip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

BIN
src/assets/ueimg/title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,5 +1,16 @@
<template>
<div class="upload-file">
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-button type="danger" v-if="!disabled" link @click="handleDelete(index)">删除</el-button>
</div>
</li>
</transition-group>
<el-upload
ref="fileUploadRef"
multiple
@ -37,17 +48,6 @@
</template>
的文件
</div>
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-button type="danger" v-if="!disabled" link @click="handleDelete(index)">删除</el-button>
</div>
</li>
</transition-group>
</div>
</template>
@ -55,7 +55,7 @@
import { propTypes } from '@/utils/propTypes';
import { delOss, listByIds } from '@/api/system/oss';
import { globalHeaders } from '@/utils/request';
import { ref } from 'vue';
const props = defineProps({
modelValue: {
type: [String, Object, Array],
@ -89,7 +89,6 @@ const showTip = computed(() => props.isShowTip && (props.fileType || props.fileS
const fileUploadRef = ref<ElUploadInstance>();
// 监听 fileType 变化,更新 fileAccept
const fileAccept = computed(() => props.fileType.map((type) => `.${type}`).join(','));
@ -200,7 +199,6 @@ const uploadedSuccessfully = () => {
uploadList.value = [];
number.value = 0;
emit('update:modelValue', listToString(fileList.value));
emit('update:fileList', fileList.value);
proxy?.$modal.closeLoading();
}
};

View File

@ -2,9 +2,11 @@
<section class="app-main">
<router-view v-slot="{ Component, route }">
<transition :enter-active-class="animate" mode="out-in">
<keep-alive :include="tagsViewStore.cachedViews">
<div>
<keep-alive :include="tagsViewStore.cachedViews">
<component :is="Component" v-if="!route.meta.link" :key="route.path" />
</keep-alive>
</div>
</transition>
</router-view>
<iframe-toggle />

View File

@ -22,6 +22,11 @@ const isWhiteList = (path: string) => {
router.beforeEach(async (to, from) => {
NProgress.start();
// 特殊页面放行
if (['/ueScreen'].includes(to.path)) {
return true;
}
// 已登录
if (getToken()) {
if (to.meta.title) useSettingsStore().setTitle(to.meta.title);

View File

@ -67,6 +67,11 @@ export const constantRoutes: RouteRecordRaw[] = [
component: () => import('@/views/largeScreen/index.vue'),
hidden: true
},
{
path: '/ueScreen',
component: () => import('@/views/ueScreen/index.vue'),
hidden: true
},
{
path: '',
component: Layout,

View File

@ -70,11 +70,18 @@ export const useProcurementDraftStore = defineStore('procurementDraft', () => {
return false;
};
// 清除所有草稿
const clearAllDrafts = (): void => {
draftList.value = [];
saveDraftsToStorage(draftList.value);
};
return {
draftList,
saveDraft,
getDraftList,
getDraft,
deleteDraft
deleteDraft,
clearAllDrafts
};
});

View File

@ -14,6 +14,10 @@ import router from '@/router';
const encryptHeader = 'encrypt-key';
let downloadLoadingInstance: LoadingInstance;
let silentLoginPromise: Promise<boolean> | null = null;
let retryQueue: Array<() => void> = []; // 等待重试的请求队列
// 是否显示重新登录
export const isRelogin = { show: false };
export const globalHeaders = () => {
@ -105,7 +109,7 @@ service.interceptors.request.use(
// 响应拦截器
service.interceptors.response.use(
(res: AxiosResponse) => {
async (res: AxiosResponse) => {
if (import.meta.env.VITE_APP_ENCRYPT === 'true') {
// 加密后的 AES 秘钥
const keyStr = res.headers[encryptHeader];
@ -131,6 +135,65 @@ service.interceptors.response.use(
return res.data;
}
if (code === 401) {
// 处理ueScreen未登录
const isInExternalPage = window.self !== window.top || window.location.pathname.includes('/ueScreen');
if (isInExternalPage) {
console.log('[外链页] 检测到 401');
// 统一处理并发401
if (silentLoginPromise) {
// 登录正在进行时,等待完成
console.log('[外链页] 等待静默登录完成');
return new Promise((resolve) => {
retryQueue.push(() => {
const newToken = getToken();
if (newToken) {
res.config.headers.Authorization = 'Bearer ' + newToken;
}
resolve(axios.request(res.config));
});
});
}
// 启动新的静默登录
if (typeof window['silentLogin'] === 'function') {
silentLoginPromise = window
.silentLogin(true)
.catch(() => false)
.finally(() => {
silentLoginPromise = null;
});
const ok = await silentLoginPromise;
const newToken = getToken();
if (ok && newToken) {
axios.defaults.headers.common['Authorization'] = 'Bearer ' + newToken;
// ✅ 每个请求返回自己的 Promise
return new Promise((resolve) => {
retryQueue.push((config) => {
axios.request(config).then((newRes) => {
console.log('🚀 ~ config:', newRes.data);
resolve(newRes.data); // 保持统一结构
});
});
// 如果登录刚好完成,就立即执行回调
retryQueue.forEach((cb) => cb(res.config));
retryQueue = [];
});
} else {
retryQueue = [];
console.warn('[外链页] 静默登录失败');
return Promise.reject('静默登录失败');
}
}
return Promise.reject('外链页未配置静默登录');
}
// prettier-ignore
if (!isRelogin.show) {
isRelogin.show = true;
@ -184,31 +247,31 @@ export function download(url: string, params: any, fileName: string) {
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
// prettier-ignore
return service.post(url, params, {
transformRequest: [
(params: any) => {
return tansParams(params);
}
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (resp: any) => {
const isLogin = blobValidate(resp);
if (isLogin) {
const blob = new Blob([resp]);
FileSaver.saveAs(blob, fileName);
} else {
const blob = new Blob([resp]);
const resText = await blob.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
ElMessage.error(errMsg);
transformRequest: [
(params: any) => {
return tansParams(params);
}
downloadLoadingInstance.close();
}).catch((r: any) => {
console.error(r);
ElMessage.error('下载文件出现错误,请联系管理员!');
downloadLoadingInstance.close();
});
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (resp: any) => {
const isLogin = blobValidate(resp);
if (isLogin) {
const blob = new Blob([resp]);
FileSaver.saveAs(blob, fileName);
} else {
const blob = new Blob([resp]);
const resText = await blob.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'];
ElMessage.error(errMsg);
}
downloadLoadingInstance.close();
}).catch((r: any) => {
console.error(r);
ElMessage.error('下载文件出现错误,请联系管理员!');
downloadLoadingInstance.close();
});
}
// 导出 axios 实例
export default service;

View File

@ -2,7 +2,7 @@
<div class="manage-form-container">
<!-- 搜索和筛选区域 -->
<div class="search-filter-section">
<el-row gutter="12" align="middle">
<el-row :gutter="12" align="middle">
<el-col :span="2">
<el-select v-model="searchForm.deviceType" placeholder="设备类型" clearable>
<el-option label="全部类型" value="" />

View File

@ -56,7 +56,7 @@ export const getOption = (xData: any, yData: any) => {
{
// show: true,
start: 0,
end: 30,
end: 100,
bottom: 2, // 下滑块距离x轴底部的距离
height: 23
},
@ -177,7 +177,7 @@ export const getOption2 = (data: any) => {
// show: true,
start: 0,
end: 30,
end: 100,
bottom: 2, // 下滑块距离x轴底部的距离
height: 23
},
@ -322,7 +322,7 @@ export const getLineOption = (lineData: any) => {
{
// show: true,
start: 0,
end: 30,
end: 100,
bottom: 2, // 下滑块距离x轴底部的距离
height: 23
},
@ -674,7 +674,7 @@ export const getBarOptions = (data: any) => {
{
// show: true,
start: 0,
end: 30,
end: 100,
bottom: 2, // 下滑块距离x轴底部的距离
height: 23
},

View File

@ -5,28 +5,38 @@
<div class="header">
<img src="@/assets/large/right1.png" style="width: 17px; height: 18px" alt="" />
<span class="title">告警信息中心</span>
<!-- <el-badge :value="unhandledCount" class="unhandled-badge" type="danger"> {{ unhandledCount }}条未处理 </el-badge> -->
<span class="jgao">{{ alarmData.length }}条信息未处理</span>
</div>
<!-- 告警卡片列表可循环渲染这里演示单条 -->
<!-- 告警卡片列表 -->
<div class="alarm_list">
<el-card class="alarm-card" shadow="hover" v-for="(item, index) in alarmData" :key="index">
<div class="alarm-card" v-for="(item, index) in alarmData" :key="index">
<div class="card-header">
<img src="@/assets/large/right2.png" style="width: 15px; height: 15px" alt="" />
<span class="card-title">{{ item.alarmMsg }}</span>
<span class="time">{{ formatDate(item.alarmBeginTime) }}</span>
</div>
<div class="card-content">
{{ item.advice }}
</div>
<div class="card-footer">
<el-tag type="danger" size="small">紧急</el-tag>
<el-tag type="danger" size="small">处理</el-tag>
</div>
</el-card>
<div class="card-content">
<!-- 文本容器控制3行溢出 -->
<div class="text-container">
{{ item.advice }}
</div>
<!-- 查看更多按钮右侧显示 -->
<div class="read-more" @click="open(item)">查看更多</div>
</div>
</div>
</div>
</div>
<div class="detailBox" :class="{ 'show': newDetail }">
<div class="boxContent" v-html="newDetail?.advice"></div>
<!-- 假设 item content 字段根据实际调整 -->
<div class="close" @click="newDetail = null">
<CircleClose style="width: 1.2em; height: 1.2em" />
</div>
</div>
<div class="overview">
<div class="left_title">
<div style="display: flex; align-items: center">
@ -73,7 +83,7 @@
<span
class="progress-percent"
:class="{
green1: item.rate >= 99, // 可根据需求调整颜色规则
green1: item.rate >= 99,
orange1: item.rate < 99 && item.rate >= 90
}"
>{{ item.rate }}%</span
@ -84,7 +94,7 @@
class="progress-fg"
:style="{ width: item.rate + '%' }"
:class="{
green: item.rate >= 99, // 可根据需求调整颜色规则
green: item.rate >= 99,
orange: item.rate < 99 && item.rate >= 90
}"
></div>
@ -93,7 +103,6 @@
</div>
<div class="container_item_two">
<div>正常{{ item.normal }}</div>
<div>异常{{ item.abnormal }}</div>
</div>
</div>
@ -103,15 +112,15 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ref, nextTick, onUnmounted } from 'vue';
import { getAlarmListOverview } from '@/api/large';
import { formatDate } from '@/utils/index';
const alarmData: any = ref({});
const alarmData = ref<any[]>([]);
const deviceStats = ref([
{
name: '光伏组件',
icon: '../../../assets/large/right5.png', // 示例图标
icon: '../../../assets/large/right5.png',
total: '25,680',
unit: '块',
rate: 99.2,
@ -155,13 +164,85 @@ const deviceStats = ref([
abnormal: 12
}
]);
// 存储所有绑定的事件处理函数,用于卸载时解绑
const eventHandlers: Array<() => void> = [];
// 处理“查看更多/收起”逻辑
const handleReadMore = async () => {
await nextTick();
const textContainers: any = document.querySelectorAll('.alarm-card .text-container');
const readMoreBtns: any = document.querySelectorAll('.alarm-card .read-more');
// 清空之前的事件绑定(避免重复绑定)
eventHandlers.forEach((handler) => handler());
eventHandlers.length = 0;
textContainers.forEach((textContainer, index) => {
const btn = readMoreBtns[index] as HTMLDivElement;
if (!btn) return;
// 关键修改判断文本是否超过3行scrollHeight > clientHeight 表示溢出)
const isOverflow = textContainer.scrollHeight > textContainer.clientHeight;
btn.style.display = isOverflow ? 'inline-block' : 'none';
// 定义点击事件处理函数
// const toggleExpand = () => {
// const isExpanded = textContainer.style.webkitLineClamp === 'none';
// if (isExpanded) {
// // 收起恢复3行限制
// textContainer.style.webkitLineClamp = '3';
// btn.textContent = '查看更多';
// } else {
// // 展开:取消行数限制
// textContainer.style.webkitLineClamp = 'none';
// btn.textContent = '收起';
// }
// };
// 绑定点击事件并存储,用于后续解绑
// btn.addEventListener('click', toggleExpand);
// eventHandlers.push(() => {
// btn.removeEventListener('click', toggleExpand);
// });
});
};
// 接口请求:获取告警数据后执行处理逻辑
const getAlarm = () => {
getAlarmListOverview().then((res) => {
console.log(res);
alarmData.value = res.data;
handleReadMore(); // 数据渲染后执行文本溢出处理
});
};
// 初始化调用接口
getAlarm();
// 定义 item 类型(替换 any提升类型安全性
interface ItemType {
id: string | number;
advice: string; // 存储富文本内容的字段,根据实际数据结构调整
// 其他字段...
}
const newDetail = ref(null);
// 假设 item 是当前列表项(实际可能来自 v-for 循环)
const item = ref<ItemType>({
id: 1,
advice: '<p>这是要显示的详情内容...</p>' // 示例富文本内容
});
// 切换展开/隐藏逻辑
const open = (targetItem: ItemType) => {
// 如果当前展开的就是目标项 → 隐藏;否则 → 展开目标项
newDetail.value = newDetail.value === targetItem ? null : targetItem;
console.log(newDetail.value);
};
// 组件卸载时解绑所有事件(避免内存泄漏)
onUnmounted(() => {
eventHandlers.forEach((handler) => handler());
});
</script>
<style scoped lang="scss">
@ -171,10 +252,9 @@ getAlarm();
}
.alarm-container {
border: 1px solid #1e2b3d; /* 深色背景模拟,可替换成项目背景 */
border: 1px solid #1e2b3d;
border-radius: 8px;
color: #fff;
// box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
padding: 10px;
}
@ -203,8 +283,8 @@ getAlarm();
.alarm_list {
width: 100%;
padding: 5px 0;
height: 14vh;
overflow-y: auto; /* 垂直方向超出时显示滚动条 */
height: 17vh;
// overflow-y: auto; /* 垂直方向超出时显示滚动条 */
}
// 滚动条优化
.alarm_list::-webkit-scrollbar {
@ -220,18 +300,19 @@ getAlarm();
}
/* 告警卡片 */
.alarm-card {
height: 100%;
background: rgba(12, 30, 53, 0.3);
color: #fff;
border: none;
border-radius: 8px;
border: 1px solid #f56c6c;
margin-top: 10px;
padding: 5px;
margin-bottom: 8px; /* 增加卡片间距,避免重叠 */
}
.card-header {
display: flex;
align-items: center;
// justify-content: space-between;
margin-bottom: 12px;
margin-bottom: 8px;
}
.card-title {
font-size: 16px;
@ -244,16 +325,49 @@ getAlarm();
color: #909399;
margin-left: auto; /* 右对齐 */
}
/* 关键修改:卡片内容容器(承载文本和按钮) */
.card-content {
font-size: 13px;
color: #dcdfe6;
margin-bottom: 12px;
// margin-bottom: 12px;
line-height: 1.6;
position: relative;
width: 100%;
line-height: 1.5;
// padding-right: 70px; /* 给右侧按钮预留空间,避免超出卡片 */
min-height: 4.5em; /* 3行文本高度1.5line-height * 3确保按钮位置稳定 */
}
/* 关键修改文本容器限制3行 */
.text-container {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 限制显示3行 */
overflow: hidden;
word-break: break-all;
padding-bottom: 2px; /* 避免文本底部被按钮遮挡 */
}
/* 关键修改:查看更多按钮(右侧显示+深色适配) */
.read-more {
display: none;
position: absolute;
right: 0;
bottom: -20px;
/* 渐变遮罩改为卡片背景色,避免白色块 */
background: linear-gradient(to right, transparent, rgba(12, 30, 53, 0.3) 60%);
padding-left: 15px; /* 增加遮罩宽度,避免文字与按钮重叠 */
color: #1677ff;
cursor: pointer;
z-index: 1; /* 确保按钮在文本上方 */
white-space: nowrap; /* 按钮文字不换行 */
font-size: 13px; /* 与文本字号一致 */
}
.card-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 5px;
}
.left_title {
width: 100%;
@ -290,7 +404,7 @@ img {
}
.overview {
width: 100%;
height: 28vh;
height: 25vh;
padding: 10px;
border-radius: 10px;
border: 1px solid #1e2b3d;
@ -301,7 +415,7 @@ img {
width: 100%;
font-size: 14px;
line-height: 30px;
overflow-y: auto; /* 垂直方向超出时显示滚动条 */
overflow-y: auto;
}
// 滚动条优化
.overview_content::-webkit-scrollbar {
@ -325,15 +439,14 @@ img {
border-radius: 10px;
.stats-container {
width: 100%; /* 可根据实际场景调整宽度 */
width: 100%;
height: 87%;
padding: 10px;
border-radius: 8px;
box-sizing: border-box;
overflow-y: auto; /* 垂直方向超出时显示滚动条 */
overflow-y: auto;
.container_item {
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
@ -359,13 +472,10 @@ img {
flex-direction: column;
justify-content: space-between;
padding-left: 10px;
// align-items: center;
}
}
/* 右侧区域:进度条 + 数据 */
.card-right {
display: flex;
margin-left: 10px;
justify-content: space-between;
align-items: center;
@ -381,7 +491,7 @@ img {
font-weight: bold;
}
.abnormal {
color: #ff9900; /* 异常数据颜色 */
color: #ff9900;
}
.progress-bg {
height: 6px;
@ -397,7 +507,6 @@ img {
width: 100px;
transition: width 0.3s;
}
/* 进度条颜色区分(可扩展更多规则) */
.green {
background-color: #28a745;
}
@ -429,14 +538,59 @@ img {
width: 5px;
height: 5px;
}
.stats-container::-webkit-scrollbar-thumb {
background-color: #0ff;
border-radius: 5px;
}
.stats-container::-webkit-scrollbar-track {
background-color: rgba(0, 255, 255, 0.2);
}
}
.detailBox {
display: flex;
position: absolute;
right: 0;
top: 10vh;
width: 300px;
padding: 20px 15px;
box-sizing: border-box;
/* background: rgba(138, 157, 161, 0.5); */
background: #040c1c;
// border: 2px dashed rgba(29, 214, 255, 0.3);
border-right: none;
border-radius: 4px;
transition: all 0.3s ease;
opacity: 0;
z-index: -1;
& > .boxContent {
flex: 1;
height: 300px;
max-height: 500px;
overflow-y: auto;
&::-webkit-scrollbar-track {
background: rgba(204, 204, 204, 0.1);
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: rgba(29, 214, 255, 0.78);
border-radius: 10px;
}
}
&.show {
right: 25vw;
opacity: 1;
z-index: 1;
}
.close {
position: absolute;
top: 3px;
right: 7px;
cursor: pointer;
}
}
</style>

View File

@ -19,9 +19,29 @@
</template>
<script setup>
import { ref, onMounted, onUnmounted } from 'vue';
import { ref, onMounted, onUnmounted, watch, computed } from 'vue';
import * as echarts from 'echarts';
// 定义props
const props = defineProps({
lineData: {
type: Object,
default: () => ({
days: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
rukuCounnts: [5, 40, 20, 75, 60, 80, 40, 55, 30, 65, 5, 80],
chukuCounnts: [30, 40, 30, 30, 30, 15, 55, 50, 40, 60, 25, 90]
})
},
barData: {
type: Object,
default: () => ({
shebeiTypes: ['光伏组件', '逆变器', '汇流箱', '支架', '电缆'],
rukuCount: [5, 40, 20, 75, 60],
chukuCount: [30, 40, 30, 30, 30]
})
}
});
// 图表容器引用
const lineChartRef = ref(null);
const barChartRef = ref(null);
@ -30,6 +50,53 @@ const barChartRef = ref(null);
let lineChart = null;
let barChart = null;
// 计算属性处理传入的lineData确保数据有效
const processedLineData = computed(() => {
// 检查传入的数据是否有效
if (!props.lineData ||
!props.lineData.days ||
props.lineData.days.length === 0 ||
!Array.isArray(props.lineData.rukuCounnts) ||
!Array.isArray(props.lineData.chukuCounnts)) {
return {
days: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
rukuCounnts: [5, 40, 20, 75, 60, 80, 40, 55, 30, 65, 5, 80],
chukuCounnts: [30, 40, 30, 30, 30, 15, 55, 50, 40, 60, 25, 90]
};
}
// 检查rukuCounnts和chukuCounnts是否全为0
const isRukuAllZero = props.lineData.rukuCounnts.every(item => item === 0);
const isChukuAllZero = props.lineData.chukuCounnts.every(item => item === 0);
if (isRukuAllZero && isChukuAllZero) {
return {
days: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
rukuCounnts: [5, 40, 20, 75, 60, 80, 40, 55, 30, 65, 5, 80],
chukuCounnts: [30, 40, 30, 30, 30, 15, 55, 50, 40, 60, 25, 90]
};
}
return props.lineData;
});
// 计算属性处理传入的barData确保数据有效
const processedBarData = computed(() => {
// 检查传入的数据是否有效
if (!props.barData ||
!props.barData.shebeiTypes ||
props.barData.shebeiTypes.length === 0 ||
!Array.isArray(props.barData.rukuCount) ||
!Array.isArray(props.barData.chukuCount)) {
return {
shebeiTypes: ['光伏组件', '逆变器', '汇流箱', '支架', '电缆'],
rukuCount: [5, 40, 20, 75, 60],
chukuCount: [30, 40, 30, 30, 30]
};
}
return props.barData;
});
onMounted(() => {
// 初始化折线图
initLineChart();
@ -77,7 +144,7 @@ const initLineChart = () => {
},
xAxis: {
type: 'category',
data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
data: processedLineData.value.days
},
yAxis: {
type: 'value'
@ -86,7 +153,7 @@ const initLineChart = () => {
{
name: '入库数量',
type: 'line',
data: [5, 40, 20, 75, 60, 80, 40, 55, 30, 65, 5, 80],
data: processedLineData.value.rukuCounnts,
symbol: 'none',
smooth: true,
lineStyle: {
@ -105,7 +172,7 @@ const initLineChart = () => {
{
name: '出库数量',
type: 'line',
data: [30, 40, 30, 30, 30, 15, 55, 50, 40, 60, 25, 90],
data: processedLineData.value.chukuCounnts,
symbol: 'none',
smooth: true,
lineStyle: {
@ -155,7 +222,7 @@ const initBarChart = () => {
},
xAxis: {
type: 'category',
data: ['电器部件', '机械部件', '电子元件', '控制模块', '结构部件', '其他'],
data: processedBarData.value.shebeiTypes,
axisLabel: {
interval: 0, // 强制显示所有标签
rotate: 30, // 标签旋转30度
@ -171,7 +238,7 @@ const initBarChart = () => {
{
name: '入库数量',
type: 'bar',
data: [650, 480, 510, 280, 650, 220],
data: processedBarData.value.rukuCount,
itemStyle: {
color: 'rgba(22, 93, 255, 1)' // 入库数量颜色
},
@ -182,7 +249,7 @@ const initBarChart = () => {
{
name: '出库数量',
type: 'bar',
data: [850, 400, 770, 590, 540, 310],
data: processedBarData.value.chukuCount,
itemStyle: {
color: 'rgba(15, 198, 194, 1)' // 出库数量颜色
},
@ -205,6 +272,12 @@ const handleResize = () => {
barChart.resize();
}
};
// 监听数据变化,更新图表
watch([() => props.lineData, () => props.barData], () => {
initLineChart();
initBarChart();
}, { deep: true });
</script>
<style scoped>

View File

@ -1,84 +1,37 @@
<template>
<div class="approval-form">
<!-- 基础信息 -->
<el-card class="card" shadow="hover">
<template #header>
<h3>基础信息</h3>
</template>
<el-form :model="detailInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="采购单号">
<el-input v-model="detailInfo.id" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间">
<el-input v-model="detailInfo.createTime" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经办人">
<el-input v-model="detailInfo.jingbanrenName" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属部门">
<el-select v-model="detailInfo.caigouDanweiName" placeholder="请选择">
<el-option label="运维部" value="运维部" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购类型">
<el-select v-model="detailInfo.caigouType" placeholder="请选择">
<el-option label="项目业务" value="项目业务" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请原因">
<el-input v-model="basicInfo.applyReason" type="textarea" :rows="2" placeholder="请输入申请原因" />
</el-form-item>
</el-form>
<el-card class="card" shadow="hover" style="margin-top: 20px">
<el-descriptions title="基础信息" direction="vertical" :column="3" border size="large" class="infoClass">
<el-descriptions-item label="采购单编号">{{ props.detailInfo.id }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ props.detailInfo.createTime }}</el-descriptions-item>
<el-descriptions-item label="经办人">{{ props.detailInfo.jingbanrenName }}</el-descriptions-item>
<el-descriptions-item label="所属部门">{{ props.detailInfo.caigouDanweiName }}</el-descriptions-item>
<el-descriptions-item label="采购类型">{{ getTagLabel(wz_purchase_type, props.detailInfo.caigouType)
}}</el-descriptions-item>
<el-descriptions-item label="申请原因">{{ props.detailInfo.reason }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 供应商信息 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>供应商信息</h3>
</template>
<el-form :model="detailInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商单位">
<el-select v-model="detailInfo.gonyingshangId" placeholder="请选择">
<el-option label="AAAA精密仪器制造有限公司" value="AAAA精密仪器制造有限公司" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出货时间">
<el-select v-model="detailInfo.chouhuoTime" placeholder="请选择">
<el-option label="2年零4个月" value="2年零4个月" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-descriptions title="供应商信息" direction="vertical" :column="2" border size="large">
<el-descriptions-item label="供应商单位">{{ props.detailInfo.gonyingshangName }}</el-descriptions-item>
<el-descriptions-item label="出货时间">{{ props.detailInfo.chuhuoTime }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 产品信息 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>产品信息</h3>
</template>
<el-table :data="detailInfo.opsCaigouPlanChanpinVos" border style="width: 100%">
<div slot="header" class="infoTitle">产品信息</div>
<el-table :data="props.detailInfo.opsCaigouPlanChanpinVos || []" border style="width: 100%">
<el-table-column prop="chanpinName" label="产品名称" />
<el-table-column prop="chanpinType" label="产品型号" />
<el-table-column prop="chanpinMonovalent" label="产品单价" align="center" :cell-style="{ background: 'pink' }" />
<el-table-column prop="shebeiType" label="设备类型">
<template #default="scope">
{{ getTagLabel(wz_device_type, scope.row.shebeiType) }}
</template>
</el-table-column>
<el-table-column prop="chanpinMonovalent" label="产品单价" align="center"
:cell-style="{ background: 'pink' }" />
<el-table-column prop="goumaiNumber" label="购买数量" align="center" :cell-style="{ background: 'pink' }" />
<el-table-column prop="yontu" label="用途" />
<el-table-column prop="totalPrice" label="合计" />
@ -87,163 +40,89 @@
<!-- 合同条款 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>合同条款</h3>
</template>
<el-form :model="contractInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="付款条件">
<el-select v-model="detailInfo.fukuantiaojian" placeholder="请选择">
<el-option label="银行卡" value="银行卡" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发票开具方式">
<el-select v-model="detailInfo.fapiaoKjfs" placeholder="请选择">
<el-option label="请选择" value="请选择" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-descriptions title="合同条款" direction="vertical" :column="3" border size="large">
<el-descriptions-item label="付款条件">{{ getTagLabel(wz_payment_terms, props.detailInfo.fukuantiaojian)
}}</el-descriptions-item>
<el-descriptions-item label="发票开具方式">{{ getTagLabel(wz_invoicing_way, props.detailInfo.fapiaoKjfs)
}}</el-descriptions-item>
<el-descriptions-item label="合同类型">{{
getTagLabel(wz_contract_type, props.detailInfo.hetonType) }}</el-descriptions-item>
</el-descriptions>
</el-card>
<!-- 附件 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>附件</h3>
</template>
<el-upload class="upload-demo" action="#" :file-list="fileList" :auto-upload="false"
:on-preview="handlePreview">
<el-table :data="fileList" border style="width: 100%">
<el-table-column prop="name" label="文件名" width="300" />
<el-table-column prop="size" label="大小" width="100" />
<el-table-column label="操作" width="100">
<template #default="scope">
<!-- <el-link type="primary" @click="handlePreview(scope.row)"> -->
<el-link type="primary">
预览
</el-link>
</template>
</el-table-column>
</el-table>
</el-upload>
<div slot="header" class="infoTitle">附件</div>
<el-table :data="props.detailInfo.opsCaigouPlanFilesVos || []" border>
<el-table-column prop="fileName" label="文件名" width="300" />
<el-table-column label="文件类型" width="200">
<template #default="scope">
{{ getFileType(scope.row.fileName) }}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template #default="scope">
<el-link type="primary" @click="handlePreview(scope.row)">
预览
</el-link>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, getCurrentInstance, toRefs } from 'vue';
import { useRoute } from 'vue-router';
import { ref, computed, onMounted, getCurrentInstance, toRefs } from 'vue';
import { defineProps } from 'vue';
import type { ComponentInternalInstance } from 'vue';
const route = useRoute();
import type { CaigouPlanVO } from '@/api/wuziguanli/caigouPlan/types';
// 定义props
const props = defineProps<{
detailInfo: CaigouPlanVO
}>();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wz_invoicing_way, wz_payment_terms, wz_purchase_type, wz_contract_type, wz_caigou_examine } = toRefs<any>(proxy?.useDict('wz_invoicing_way', 'wz_payment_terms', 'wz_purchase_type', 'wz_contract_type', 'wz_caigou_examine'));
const { wz_invoicing_way, wz_payment_terms, wz_purchase_type, wz_contract_type, wz_device_type } = toRefs<any>(proxy?.useDict('wz_device_type','wz_invoicing_way', 'wz_payment_terms', 'wz_purchase_type', 'wz_contract_type', 'wz_caigou_examine', 'wz_device_type'));
import { caigouPlanDetail } from '@/api/wuziguanli/caigouPlan';
import { CaigouPlanVO, CaigouPlanQuery, CaigouPlanForm } from '@/api/wuziguanli/caigouPlan/types';
// 存储计划详情数据
const detailInfo = ref<CaigouPlanVO>({} as CaigouPlanVO);
// 存储计划编号
const id = ref('');
const getDetailInfo = async () => {
const res = await caigouPlanDetail(id.value);
if (res.code === 200) {
detailInfo.value = res.data;
console.log(detailInfo.value);
}
// 根据字典数组和值获取标签文本
const getTagLabel = (dictArray: any[], value: any): string => {
if (!dictArray || !value) return '';
const item = dictArray.find(item => item.value === value);
return item?.label || value;
}
onMounted(() => {
// 接收路由参数
id.value = route.query.id as string;
getDetailInfo();
});
// 基础信息数据
const basicInfo = ref({
orderNo: '0035455',
createTime: '2023-11-02 16:32',
handler: '李四',
dept: '运维部',
purchaseType: '项目业务',
applyReason:
'随着业务拓展光伏电站业务负责增加现有设备已运行5年部分出现效率下降情况。为保证电站正常运行计划采购一批新的逆变器替换老旧设备并补充备件库存。',
});
// 供应商信息数据
const supplierInfo = ref({
supplierName: 'AAAA精密仪器制造有限公司',
deliveryTime: '2年零4个月',
remark: '',
});
// 产品信息数据
const productInfo = ref({
tableData: [
{
productName: 'AAABBBCCC',
productModel: '15-42',
productPrice: 500,
buyQuantity: 10,
usage: '组件',
total: 5000,
},
],
remark: '',
});
// 合同条款数据
const contractInfo = ref({
paymentCondition: '银行卡',
invoiceWay: '请选择',
remark: '',
});
// 附件数据
const fileList = ref([
{
name: 'MWwwwww.jpg',
size: '30kb',
url: '',
},
{
name: '231234124w.zip',
size: '50kb',
url: '',
},
{
name: '12451asdas.doc',
size: '80kb',
url: '',
},
{
name: '21seasda.xls',
size: '29kb',
url: '',
},
{
name: '12kjaklskw.png',
size: '16kb',
url: '',
},
]);
// 获取文件类型(后缀名)
const getFileType = (fileName: string): string => {
if (!fileName) return '';
const lastDotIndex = fileName.lastIndexOf('.');
if (lastDotIndex === -1) return '';
return fileName.substring(lastDotIndex + 1).toLowerCase();
};
// 预览文件
const handlePreview = (file) => {
console.log('预览文件:', file);
// 实际场景可在这里处理文件预览逻辑,如打开新窗口等
window.open(file.fileUrl, '_blank');
};
</script>
<style scoped>
.infoTitle {
font-size: 16px;
font-weight: bold;
margin-bottom: 20px;
}
.approval-form {
padding: 20px;
}
@ -258,7 +137,7 @@ const handlePreview = (file) => {
margin-top: 5px;
}
::v-deep(.el-input__inner) {
:v-deep(.el-input__inner) {
color: red;
}
</style>

View File

@ -1,261 +0,0 @@
<template>
<div class="approval-form">
<!-- 基础信息 -->
<el-card class="card" shadow="hover">
<template #header>
<h3>基础信息</h3>
</template>
<el-form :model="basicInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="订单编号">
<el-input v-model="basicInfo.orderNo" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间">
<el-input v-model="basicInfo.createTime" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经办人">
<el-input v-model="basicInfo.handler" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属部门">
<el-select v-model="basicInfo.dept" placeholder="请选择">
<el-option label="运维部" value="运维部" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购类型">
<el-select v-model="basicInfo.purchaseType" placeholder="请选择">
<el-option label="项目业务" value="项目业务" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="申请原因">
<el-input v-model="basicInfo.applyReason" type="textarea" :rows="2" placeholder="请输入申请原因" />
</el-form-item>
</el-form>
</el-card>
<!-- 供应商信息 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>供应商信息</h3>
</template>
<el-form :model="supplierInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="供应商单位">
<el-select v-model="supplierInfo.supplierName" placeholder="请选择">
<el-option label="AAAA精密仪器制造有限公司" value="AAAA精密仪器制造有限公司" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出货时间">
<el-select v-model="supplierInfo.deliveryTime" placeholder="请选择">
<el-option label="2年零4个月" value="2年零4个月" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<!-- 产品信息 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>产品信息</h3>
</template>
<el-table :data="productInfo.tableData" border style="width: 100%">
<el-table-column prop="productName" label="产品名称" />
<el-table-column prop="productModel" label="产品型号" />
<el-table-column prop="productPrice" label="产品单价" align="center" :cell-style="{ background: 'pink' }" />
<el-table-column prop="buyQuantity" label="购买数量" align="center" :cell-style="{ background: 'pink' }" />
<el-table-column prop="usage" label="用途" />
<el-table-column prop="total" label="合计" />
</el-table>
</el-card>
<!-- 合同条款 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>合同条款</h3>
</template>
<el-form :model="contractInfo" label-width="120px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="付款条件">
<el-select v-model="contractInfo.paymentCondition" placeholder="请选择">
<el-option label="银行卡" value="银行卡" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发票开具方式">
<el-select v-model="contractInfo.invoiceWay" placeholder="请选择">
<el-option label="请选择" value="请选择" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<!-- 附件 -->
<el-card class="card" shadow="hover" style="margin-top: 20px">
<template #header>
<h3>附件</h3>
</template>
<el-upload class="upload-demo" action="#" :file-list="fileList" :auto-upload="false"
:on-preview="handlePreview">
<el-table :data="fileList" border style="width: 100%">
<el-table-column prop="name" label="文件名" width="300" />
<el-table-column prop="size" label="大小" width="100" />
<el-table-column label="操作" width="100">
<template #default="scope">
<!-- <el-link type="primary" @click="handlePreview(scope.row)"> -->
<el-link type="primary">
预览
</el-link>
</template>
</el-table-column>
</el-table>
</el-upload>
</el-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, getCurrentInstance, toRefs } from 'vue';
import { useRoute } from 'vue-router';
import type { ComponentInternalInstance } from 'vue';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wz_invoicing_way, wz_payment_terms, wz_purchase_type, wz_contract_type, wz_caigou_examine } = toRefs<any>(proxy?.useDict('wz_invoicing_way', 'wz_payment_terms', 'wz_purchase_type', 'wz_contract_type', 'wz_caigou_examine'));
import { caigouPlanDetail } from '@/api/wuziguanli/caigouPlan';
import { CaigouPlanVO, CaigouPlanQuery, CaigouPlanForm } from '@/api/wuziguanli/caigouPlan/types';
// 存储计划编号
const id = ref('');
const getDetailInfo = async () => {
const res = await caigouPlanDetail(id.value);
if (res.code === 200) {
console.log(res);
}
}
onMounted(() => {
// 接收路由参数
id.value = route.query.id as string;
getDetailInfo();
});
// 基础信息数据
const basicInfo = ref({
orderNo: '0035455',
createTime: '2023-11-02 16:32',
handler: '李四',
dept: '运维部',
purchaseType: '项目业务',
applyReason:
'随着业务拓展光伏电站业务负责增加现有设备已运行5年部分出现效率下降情况。为保证电站正常运行计划采购一批新的逆变器替换老旧设备并补充备件库存。',
});
// 供应商信息数据
const supplierInfo = ref({
supplierName: 'AAAA精密仪器制造有限公司',
deliveryTime: '2年零4个月',
remark: '',
});
// 产品信息数据
const productInfo = ref({
tableData: [
{
productName: 'AAABBBCCC',
productModel: '15-42',
productPrice: 500,
buyQuantity: 10,
usage: '组件',
total: 5000,
},
],
remark: '',
});
// 合同条款数据
const contractInfo = ref({
paymentCondition: '银行卡',
invoiceWay: '请选择',
remark: '',
});
// 附件数据
const fileList = ref([
{
name: 'MWwwwww.jpg',
size: '30kb',
url: '',
},
{
name: '231234124w.zip',
size: '50kb',
url: '',
},
{
name: '12451asdas.doc',
size: '80kb',
url: '',
},
{
name: '21seasda.xls',
size: '29kb',
url: '',
},
{
name: '12kjaklskw.png',
size: '16kb',
url: '',
},
]);
// 预览文件
const handlePreview = (file) => {
console.log('预览文件:', file);
// 实际场景可在这里处理文件预览逻辑,如打开新窗口等
};
</script>
<style scoped>
.approval-form {
padding: 20px;
}
.card {
border-radius: 8px;
}
.error-tip {
color: red;
font-size: 12px;
margin-top: 5px;
}
::v-deep(.el-input__inner) {
color: red;
}
</style>

View File

@ -0,0 +1,278 @@
<template>
<div class="upload-file">
<!-- 文件列表 -->
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
<li v-for="(file, index) in fileList" :key="file.uid" class="el-upload-list__item ele-upload-list__item-content">
<el-link :href="`${file.url}`" :underline="false" target="_blank">
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
</el-link>
<div class="ele-upload-list__item-content-action">
<el-button type="danger" v-if="!disabled" link @click="handleDelete(index)">删除</el-button>
</div>
</li>
</transition-group>
<el-upload
ref="fileUploadRef"
multiple
:drag="isDrag"
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
:limit="limit"
:accept="fileAccept"
:on-error="handleUploadError"
:on-exceed="handleExceed"
:on-success="handleUploadSuccess"
:show-file-list="false"
:headers="headers"
class="upload-file-uploader"
v-if="!disabled"
>
<!-- 上传按钮 -->
<el-button type="primary" v-if="!isDrag">选取文件</el-button>
<div v-else>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
拖拽文件到此处 <em>点击上传</em>
</div>
</div>
</el-upload>
<!-- 上传提示 -->
<div v-if="showTip && !disabled" class="el-upload__tip">
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join('/') }}</b>
</template>
的文件
</div>
</div>
</template>
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
import { delOss, listByIds } from '@/api/system/oss';
import { globalHeaders } from '@/utils/request';
import { ref } from 'vue';
const props = defineProps({
modelValue: {
type: [String, Object, Array],
default: () => []
},
// 数量限制
limit: propTypes.number.def(5),
// 大小限制(MB)
fileSize: propTypes.number.def(5),
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: propTypes.array.def(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']),
// 是否显示提示
isShowTip: propTypes.bool.def(true),
// 禁用组件(仅查看文件)
disabled: propTypes.bool.def(false),
// 是否开启拖拽上传
isDrag: propTypes.bool.def(false)
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const emit = defineEmits(['update:modelValue', 'update:fileList']);
const number = ref(0);
const uploadList = ref<any[]>([]);
const baseUrl = import.meta.env.VITE_APP_BASE_API;
const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
const headers = ref(globalHeaders());
const fileList = ref<any[]>([]);
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize));
const fileUploadRef = ref<ElUploadInstance>();
// 暴露方法给父组件
defineExpose({
// 清空所有文件
clearAllFiles: () => {
fileList.value = [];
emit('update:modelValue', '');
emit('update:fileList', []);
}
});
// 监听 fileType 变化,更新 fileAccept
const fileAccept = computed(() => props.fileType.map((type) => `.${type}`).join(','));
watch(
() => props.modelValue,
async (val) => {
if (val) {
let temp = 1;
// 首先将值转为数组
let list: any[] = [];
if (Array.isArray(val)) {
// 如果是数组,检查第一个元素的格式
if (val.length > 0 && val[0].fileName && val[0].fileId && val[0].fileUrl) {
// 处理后端返回的格式 [{fileName,fileId,fileUrl}]
list = val.map(item => ({
name: item.fileName,
url: item.fileUrl,
ossId: item.fileId
}));
} else {
// 处理组件内部格式 [{name,url,ossId}]
list = val;
}
} else {
// 处理字符串格式逗号分隔的ossId
const res = await listByIds(val);
list = res.data.map((oss) => {
return { name: oss.originalName, url: oss.url, ossId: oss.ossId };
});
}
// 然后将数组转为对象数组
fileList.value = list.map((item) => {
item = { name: item.name, url: item.url, ossId: item.ossId };
item.uid = item.uid || new Date().getTime() + temp++;
return item;
});
} else {
fileList.value = [];
return [];
}
},
{ deep: true, immediate: true }
);
// 上传前校检格式和大小
const handleBeforeUpload = (file: any) => {
// 校检文件类型
if (props.fileType.length) {
const fileName = file.name.split('.');
const fileExt = fileName[fileName.length - 1];
const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
return false;
}
}
// 校检文件名是否包含特殊字符
if (file.name.includes(',')) {
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
return false;
}
// 校检文件大小
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
proxy?.$modal.loading('正在上传文件,请稍候...');
number.value++;
return true;
};
// 文件个数超出
const handleExceed = () => {
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
};
// 上传失败
const handleUploadError = () => {
proxy?.$modal.msgError('上传文件失败');
};
// 上传成功回调
const handleUploadSuccess = (res: any, file: UploadFile) => {
if (res.code === 200) {
uploadList.value.push({
name: res.data.fileName,
url: res.data.url,
ossId: res.data.ossId
});
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
fileUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
};
// 删除文件
const handleDelete = (index: number) => {
const ossId = fileList.value[index].ossId;
delOss(ossId);
fileList.value.splice(index, 1);
// 转换为后端需要的格式 [{fileName,fileId,fileUrl}]
const formattedList = fileList.value.map(file => ({
fileName: file.name,
fileId: file.ossId,
fileUrl: file.url
}));
emit('update:modelValue', formattedList);
};
// 上传结束处理
const uploadedSuccessfully = () => {
if (number.value > 0 && uploadList.value.length === number.value) {
fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
uploadList.value = [];
number.value = 0;
// 转换为后端需要的格式 [{fileName,fileId,fileUrl}]
const formattedList = fileList.value.map(file => ({
fileName: file.name,
fileId: file.ossId,
fileUrl: file.url
}));
emit('update:modelValue', formattedList);
emit('update:fileList', fileList.value);
proxy?.$modal.closeLoading();
}
};
// 获取文件名称
const getFileName = (name: string) => {
// 如果是url那么取最后的名字 如果不是直接返回
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1);
} else {
return name;
}
};
</script>
<style lang="scss" scoped>
.upload-file-uploader {
margin-bottom: 5px;
}
.upload-file-list .el-upload-list__item {
border: 1px solid #e4e7ed;
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;
}
</style>

View File

@ -8,8 +8,8 @@
<div class="top">
<div class="title">单据列表</div>
<div class="button-actions">
<button :class="{ active: type === 'chuku' }" @click="changeType('chuku')">出库单</button>
<button :class="{ active: type === 'ruku' }" @click="changeType('ruku')">入库单</button>
<button :class="{ active: type === 'chuku' }" @click="changeType('chuku')">出库单</button>
</div>
</div>
<div class="content" style="height: 100%;flex: 1;">
@ -23,20 +23,20 @@
<el-input v-model="queryParams.danjvNumber" placeholder="请输入单据编号"
clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设备类型" prop="shebeiType">
<!-- <el-form-item label="设备类型" prop="shebeiType">
<el-select v-model="queryParams.shebeiType" placeholder="请选择设备类型"
clearable>
<el-option v-for="dict in wz_device_type" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
</el-form-item> -->
<!-- <el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态"
clearable>
<el-option v-for="dict in shenheStatus" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="开始日期" prop="startDate">
<el-date-picker v-model="queryParams.startDate" type="date"
placeholder="请选择开始日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@ -63,21 +63,17 @@
<el-table v-loading="loading" border :data="churukudanList"
style="width: 100%;margin-top: 15px;">
<el-table-column label="单据编号" align="center" prop="danjvNumber" />
<el-table-column label="设备类型" align="center" prop="shebeiType">
<template #default="scope">
<span>{{ getTagLabel(wz_device_type, scope.row.shebeiType) }}</span>
</template>
</el-table-column>
<el-table-column label="经手人" align="center" prop="jingshourenName" />
<el-table-column label="产品名称" align="center" prop="chanpinName"></el-table-column>
<el-table-column label="经手人" align="center" prop="jingshourenName" width="80px" />
<el-table-column label="操作时间" align="center" prop="updateTime" />
<el-table-column label="总数量" align="center" prop="zonNumber" width="80px" />
<el-table-column label="审核状态" align="center" prop="shenheStatus">
<!-- <el-table-column label="审核状态" align="center" prop="shenheStatus">
<template #default="scope">
<el-tag :type="getTagType(shenheStatus, scope.row.shenheStatus)" as="span">
{{ getTagLabel(shenheStatus, scope.row.shenheStatus) }}
</el-tag>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="单据类型" align="center" prop="danjvType">
<template #default="scope">
<el-tag :type="getTagType(danjvType, scope.row.danjvType)">
@ -87,8 +83,8 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)"
v-hasPermi="['personnel:churukudan:edit']">修改</el-button>
<!-- <el-button link type="primary" @click="handleUpdate(scope.row)"
v-hasPermi="['personnel:churukudan:edit']">修改</el-button> -->
<el-button link type="primary" @click="handleDetail(scope.row)"
v-hasPermi="['personnel:churukudan:query']">详情</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)"
@ -118,7 +114,7 @@
<div class="item-box">
<div class="title">数据分析</div>
<div class="content">
<DataAnalysis />
<DataAnalysis :lineData="lineData" :barData="barData" />
</div>
</div>
</el-card>
@ -133,14 +129,17 @@
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="单据编号" prop="danjvNumber">
<el-input v-model="form.danjvNumber" placeholder="请输入单据编号" />
</el-form-item>
<el-form-item label="设备类型" prop="shebeiType">
<!-- <el-form-item label="设备类型" prop="shebeiType">
<el-select v-model="form.shebeiType" placeholder="请选择设备类型">
<el-option v-for="dict in wz_device_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="产品名称" prop="chanpinName">
<el-select v-model="form.chanpinName" placeholder="请选择产品名称">
<el-option v-for="dict in chanpinSelect" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="经手人id" prop="jingshourenId">
<el-input v-model="form.jingshourenId" placeholder="请输入经手人id" />
@ -152,7 +151,7 @@
<el-input v-model="form.contactNumber" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="总数量" prop="zonNumber">
<el-input v-model="form.zonNumber" placeholder="请输入总数量" />
<el-input v-model="form.zonNumber" placeholder="请输入总数量" type="number" min="0"/>
</el-form-item>
</el-form>
<template #footer>
@ -316,7 +315,7 @@
padding: 12px 0;
}
::v-deep(.el-card__body) {
:v-deep(.el-card__body) {
height: 100%;
}
</style>
@ -325,7 +324,7 @@ import SystemInfo from './components/SystemInfo.vue';
import DataAnalysis from './components/DataAnalysis.vue';
import { ref, computed } from 'vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { listChurukudan, getChurukudan, delChurukudan, addChurukudan, updateChurukudan, getChuRuKuCountBar } from '@/api/wuziguanli/churuku/index';
import { listChurukudan, getChurukudan, delChurukudan, addChurukudan, updateChurukudan, getChuRuKuCountLine, getChuRuKuDayCountBar, getChanpinLists } from '@/api/wuziguanli/churuku/index';
import { ChurukudanVO, ChurukudanQuery, ChurukudanForm } from '@/api/wuziguanli/churuku/types';
const { wz_device_type } = toRefs<any>(proxy?.useDict('wz_device_type'));
@ -342,8 +341,8 @@ const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const total = ref(0);
// 单据类型切换变量 - 默认库单
const type = ref<string>('chuku');
// 单据类型切换变量 - 默认库单
const type = ref<string>('ruku');
/** 切换单据类型 */
const changeType = (newType: string) => {
@ -427,6 +426,8 @@ const initFormData: ChurukudanForm = {
danjvType: undefined,
updateTime: undefined,
auditStatus: undefined,
chanpinName: undefined,
chanpinId: undefined,
}
const data = reactive<PageData<ChurukudanForm, ChurukudanQuery>>({
form: { ...initFormData },
@ -440,13 +441,18 @@ const data = reactive<PageData<ChurukudanForm, ChurukudanQuery>>({
startDate: undefined,
endDate: undefined,
auditStatus: undefined,
danjvType: '1', // 默认显示出库单
chanpinName: undefined,
chanpinId: undefined,
danjvType: '2', // 默认显示入库单
params: {
}
},
rules: {
shebeiType: [
{ required: true, message: "设备类型不能为空", trigger: "change" }
// shebeiType: [
// { required: true, message: "设备类型不能为空", trigger: "change" }
// ],
chanpinName: [
{ required: true, message: "产品名称不能为空", trigger: "change" }
],
jingshourenId: [
{ required: true, message: "经手人id不能为空", trigger: "blur" }
@ -460,10 +466,34 @@ const data = reactive<PageData<ChurukudanForm, ChurukudanQuery>>({
danjvType: [
{ required: true, message: "单据状态不能为空", trigger: "change" }
],
// 手机号码格式校验
contactNumber: [
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码格式", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
// 查询产品名称列表
const chanpinList = ref<any[]>([]);
const chanpinSelect = ref<any[]>([]);
// 查询产品名称列表
const getChanpinList = async () => {
try {
const res = await getChanpinLists({ projectId: userStore.selectedProject.id });
chanpinList.value = res.data || [];
chanpinSelect.value = chanpinList.value.map(item => ({
label:item.caigouPlanName +'-'+item.chanpinName,
value: item.id
}));
console.log('chanpinSelect.value', chanpinSelect.value);
} catch (error) {
console.error('获取产品名称列表失败:', error);
proxy?.$modal.msgError("获取产品名称列表失败,请稍后重试");
chanpinList.value = [];
}
}
/** 查询运维-物资-出入库单管理列表 */
const getList = async () => {
@ -526,23 +556,23 @@ const handleAdd = () => {
}
/** 修改按钮操作 */
const handleUpdate = async (row?: ChurukudanVO) => {
reset();
const _id = row?.id || ids.value[0];
if (!_id) {
proxy?.$modal.msgWarning("请选择要修改的数据");
return;
}
try {
const res = await getChurukudan(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改运维-物资-出入库单管理";
} catch (error) {
console.error('获取出入库单详情失败:', error);
proxy?.$modal.msgError("获取数据失败,请稍后重试");
}
}
// const handleUpdate = async (row?: ChurukudanVO) => {
// reset();
// const _id = row?.id || ids.value[0];
// if (!_id) {
// proxy?.$modal.msgWarning("请选择要修改的数据");
// return;
// }
// try {
// const res = await getChurukudan(_id);
// Object.assign(form.value, res.data);
// dialog.visible = true;
// dialog.title = "修改运维-物资-出入库单管理";
// } catch (error) {
// console.error('获取出入库单详情失败:', error);
// proxy?.$modal.msgError("获取数据失败,请稍后重试");
// }
// }
/** 提交按钮 */
const submitForm = () => {
@ -550,6 +580,7 @@ const submitForm = () => {
if (valid) {
buttonLoading.value = true;
try {
form.value.chanpinId = form.value.chanpinName
if (form.value.id) {
await updateChurukudan(form.value);
proxy?.$modal.msgSuccess("修改成功");
@ -607,7 +638,29 @@ const handleDelete = async (row?: ChurukudanVO) => {
}
}
// 折线图数据获取
const lineData = ref<any>();
const fetchChuRuKuCountLineData = async () => {
if (!queryParams.value.projectId) {
return;
}
let data = {
projectId: queryParams.value.projectId,
startDate: currentMonthDates[0].fullDate,
endDate: currentMonthDates[currentMonthDates.length - 1].fullDate,
}
try {
const res = await getChuRuKuCountLine(data);
if (res.code === 200) {
lineData.value = res.data;
}
// 这里可以添加数据处理和图表更新的逻辑
} catch (error) {
proxy?.$modal.msgError("获取统计数据失败");
}
}
// 柱状图数据获取
const barData = ref<any>();
const fetchChuRuKuCountBarData = async () => {
if (!queryParams.value.projectId) {
return;
@ -618,16 +671,15 @@ const fetchChuRuKuCountBarData = async () => {
endDate: currentMonthDates[currentMonthDates.length - 1].fullDate,
}
try {
const res = await getChuRuKuCountBar(data);
console.log(res);
const res = await getChuRuKuDayCountBar(data);
if (res.code === 200) {
barData.value = res.data;
}
// 这里可以添加数据处理和图表更新的逻辑
} catch (error) {
console.error('获取柱状图数据失败:', error);
// 可以选择是否显示错误提示根据UI需求决定
// proxy?.$modal.msgError("获取统计数据失败");
proxy?.$modal.msgError("获取统计数据失败");
}
}
// 监听用户选择的项目变化
watch(() => userStore.selectedProject, (newProject) => {
if (newProject && newProject.id) {
@ -638,12 +690,16 @@ watch(() => userStore.selectedProject, (newProject) => {
}
// 调用getList刷新数据
getList();
fetchChuRuKuCountLineData();
fetchChuRuKuCountBarData();
}
}, { immediate: true, deep: true });
onMounted(() => {
getList();
fetchChuRuKuCountLineData();
fetchChuRuKuCountBarData();
// 查询产品名称列表
getChanpinList();
});
// 组件卸载时清空projectId

View File

@ -9,15 +9,15 @@
<ArrowLeft />
</el-icon>
</span>
<h2>Q2风电轴承采购计划</h2>
<h2>{{ Info.jihuaName }}</h2>
</div>
</el-card>
</el-col>
</el-row>
<el-row gutter="10">
<el-row :gutter="10">
<el-col :span="18">
<el-card>
<detailInfo />
<detailInfo :detail-info="Info" />
</el-card>
</el-col>
<el-col :span="6" style="flex-grow: 1;">
@ -46,12 +46,66 @@
cursor: pointer;
}
</style>
<script setup>
<script setup lang="ts">
import detailInfo from './components/detailInfo.vue';
import DetailsProcess from './components/DetailsProcess.vue';
import { ref, onMounted, getCurrentInstance, toRefs, watch } from 'vue';
import { useRoute } from 'vue-router';
import type { ComponentInternalInstance } from 'vue';
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { caigouPlanDetail } from '@/api/wuziguanli/caigouPlan';
import { CaigouPlanVO, CaigouPlanQuery, CaigouPlanForm } from '@/api/wuziguanli/caigouPlan/types';
// 存储计划详情数据
const Info = ref<CaigouPlanVO>({} as CaigouPlanVO);
// 存储计划编号
const id = ref('');
// 获取详细信息
const getDetailInfo = async () => {
const res = await caigouPlanDetail(id.value);
if (res.code === 200) {
Info.value = res.data;
console.log(Info.value);
}
}
onMounted(() => {
// 接收路由参数
id.value = route.query.id as string || '';
console.log('组件挂载时路由参数id:', id.value);
// 确保id不为空时才调用接口
if (id.value) {
getDetailInfo();
} else {
proxy.$modal.msgError('未获取到详细信息')
setTimeout(() => {
router.back();
}, 800);
}
});
// 监听路由参数变化
watch(
() => route.query.id,
(newId) => {
id.value = newId as string || '';
if (id.value) {
getDetailInfo();
}
},
{ immediate: true }
);
const router = useRouter();
const handleBack = () => {
router.back();
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -214,7 +214,7 @@
<dict-tag :options="wz_inventory_type" :value="scope.row.kucunStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button type="text" @click="handleUpdate(scope.row)"
v-hasPermi="['personnel:beipinBeijian:edit']">编辑</el-button>
@ -223,7 +223,7 @@
<el-button type="text" @click="handleDelete(scope.row)"
v-hasPermi="['personnel:beipinBeijian:remove']">删除</el-button>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<div class="pagination-section">
<div class="pagination-info">
@ -252,7 +252,7 @@
<el-input v-model="form.guigexinghao" placeholder="请输入规格型号" />
</el-form-item>
<el-form-item label="库存数量" prop="kucunCount">
<el-input v-model="form.kucunCount" placeholder="请输入库存数量" />
<el-input v-model="form.kucunCount" placeholder="请输入库存数量" type="number" min="0" />
</el-form-item>
<el-form-item label="库存状态" prop="kucunStatus">
<el-select v-model="form.kucunStatus" placeholder="请选择库存状态">
@ -260,12 +260,12 @@
:value="dict.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="shebeiType">
<!-- <el-form-item label="设备类型" prop="shebeiType">
<el-select v-model="form.shebeiType" placeholder="请选择设备类型">
<el-option v-for="dict in wz_device_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-form>
<template #footer>
<div class="dialog-footer">
@ -408,7 +408,7 @@ const userStore = useUserStore();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { listBeipinBeijian, getBeipinBeijian, delBeipinBeijian, updateBeipinBeijian } from '@/api/wuziguanli/beijian';
import { listBeipinBeijian, getBeipinBeijian, delBeipinBeijian, updateBeipinBeijian,chuRuKuTotal } from '@/api/wuziguanli/beijian';
import { BeipinBeijianVO, BeipinBeijianQuery, BeipinBeijianForm } from '@/api/wuziguanli/beijian/types';
@ -502,6 +502,18 @@ const getDictLabel = (dictType, value) => {
return option?.label || value;
};
//查询总览
const getTotalView= async () => {
try {
const res = await chuRuKuTotal({projectId: queryParams.value.projectId});
console.log(res);
total.value = res.total;
} catch (error) {
proxy?.$modal.msgError('获取数据失败,请重试');
}
}
/** 查询运维-物资-备品配件列表 */
const getList = async () => {
loading.value = true;
@ -511,7 +523,6 @@ const getList = async () => {
total.value = res.total;
} catch (error) {
proxy?.$modal.msgError('获取数据失败,请重试');
console.error('获取备品配件列表失败:', error);
} finally {
loading.value = false;
}
@ -555,7 +566,6 @@ const handleUpdate = async (row?: BeipinBeijianVO) => {
dialog.visible = true;
} catch (error) {
proxy?.$modal.msgError('获取数据失败,请重试');
console.error('获取备品配件详情失败:', error);
}
}
@ -572,7 +582,6 @@ const handleDetail = async (row?: BeipinBeijianVO) => {
detailDialogVisible.value = true;
} catch (error) {
proxy?.$modal.msgError('获取数据失败,请重试');
console.error('获取备品配件详情失败:', error);
}
}
@ -595,7 +604,6 @@ const submitForm = () => {
await getList();
} catch (error) {
proxy?.$modal.msgError('操作失败,请重试');
console.error('提交表单失败:', error);
} finally {
buttonLoading.value = false;
}
@ -620,7 +628,6 @@ const handleDelete = async (row?: BeipinBeijianVO) => {
// 如果是用户取消确认,则不显示错误信息
if (error !== 'cancel') {
proxy?.$modal.msgError('删除失败,请重试');
console.error('删除数据失败:', error);
}
} finally {
loading.value = false;
@ -644,6 +651,8 @@ watch(() => userStore.selectedProject, (newProject) => {
onMounted(() => {
getList();
// 初始化查询总览
getTotalView();
});
// 组件卸载时清空projectId

View File

@ -1,10 +1,10 @@
<template>
<el-card style="border-radius: 15px;">
<el-row gutter="35">
<el-row :gutter="35">
<el-col :span="8" class="status-card">
<div class="title">设备状态</div>
<!-- gutter设置为20创建左右间隙 -->
<el-row gutter="20" style="width: 100%;">
<el-row :gutter="20" style="width: 100%;">
<!-- 一行2个每个占12格24/2=12 -->
<el-col :span="12">
<div class="item">
@ -120,7 +120,7 @@
}
.red {
::v-deep::before {
:v-deep::before {
position: absolute;
content: '';
background-color: rgba(227, 39, 39, 1);
@ -133,7 +133,7 @@
}
.yellow {
::v-deep::before {
:v-deep::before {
position: absolute;
content: '';
background-color: rgba(255, 208, 35, 1);

View File

@ -132,7 +132,7 @@
position: relative;
margin: 10px 0;
::v-deep::before {
:v-deep::before {
position: absolute;
width: 5px;
height: 5px;

View File

@ -0,0 +1,254 @@
<template>
<div class="year-month-picker">
<!-- 年份选择器 -->
<div class="picker-group">
<div class="picker-input" @click="isYearOpen = !isYearOpen" :class="{ 'open': isYearOpen }">
<span class="value">{{ selectedYear }}</span>
<span class="arrow"></span>
</div>
<ul class="options" v-show="isYearOpen">
<li v-for="year in years" :key="year" :class="{ 'selected': year === selectedYear }"
@click="handleYearSelect(year)">
{{ year }}
</li>
</ul>
</div>
<!-- 月份选择器 -->
<div class="picker-group">
<div class="picker-input" @click="isMonthOpen = !isMonthOpen" :class="{ 'open': isMonthOpen }">
<span class="value">{{ selectedMonth }}</span>
<span class="arrow"></span>
</div>
<ul class="options" v-show="isMonthOpen">
<li v-for="month in 12" :key="month" :class="{ 'selected': month === selectedMonth }"
@click="handleMonthSelect(month)">
{{ month }}
</li>
</ul>
</div>
</div>
</template>
<script setup>
import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
const props = defineProps({
year: {
type: Number,
required: true,
},
month: {
type: Number,
required: true,
},
startYear: {
type: Number,
default: 2000,
},
endYear: {
type: Number,
default: new Date().getFullYear(),
},
disabled: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:year', 'update:month', 'change']);
// 计算年份列表
const years = computed(() => {
const yearList = [];
for (let y = props.startYear; y <= props.endYear; y++) {
yearList.push(y);
}
return yearList;
});
// 内部状态
const selectedYear = ref(props.year);
const selectedMonth = ref(props.month);
const isYearOpen = ref(false);
const isMonthOpen = ref(false);
// 监听props变化同步到内部状态
watch(
() => [props.year, props.month],
([newYear, newMonth]) => {
selectedYear.value = newYear;
selectedMonth.value = newMonth;
},
{ immediate: true }
);
// 当内部值变化时,通知父组件
const notifyParent = () => {
emit('update:year', selectedYear.value);
emit('update:month', selectedMonth.value);
emit('change', { year: selectedYear.value, month: selectedMonth.value });
};
// 处理年份选择
const handleYearSelect = (year) => {
selectedYear.value = year;
isYearOpen.value = false;
notifyParent();
};
// 处理月份选择
const handleMonthSelect = (month) => {
selectedMonth.value = month;
isMonthOpen.value = false;
notifyParent();
};
// 点击外部关闭下拉框
const handleClickOutside = (event) => {
if (!event.target.closest('.year-month-picker')) {
isYearOpen.value = false;
isMonthOpen.value = false;
}
};
// 挂载时添加事件监听
onMounted(() => {
document.addEventListener('click', handleClickOutside);
// 验证初始值
if (!years.value.includes(selectedYear.value)) {
selectedYear.value = Math.max(props.startYear, Math.min(selectedYear.value, props.endYear));
}
selectedMonth.value = Math.max(1, Math.min(selectedMonth.value, 12));
notifyParent(); // 确保初始值正确通知
});
// 卸载时移除事件监听,防止内存泄漏
onBeforeUnmount(() => {
document.removeEventListener('click', handleClickOutside);
});
</script>
<style scoped lang="scss">
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.year-month-picker {
display: inline-flex;
border-radius: vw(8);
font-size: vw(14);
background-color: transparent;
box-shadow: 0 vh(2) vh(8) rgba(0, 0, 0, 0.08);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
border: vw(1) solid #c0c4cc;
}
.year-month-picker:hover {
border-color: #909399;
box-shadow: 0 vh(4) vh(12) rgba(0, 0, 0, 0.1);
}
.picker-group {
position: relative;
}
.picker-input {
width: fit-content;
display: flex;
gap: vw(8);
justify-content: space-between;
align-items: center;
padding: vh(8) vw(16);
cursor: pointer;
user-select: none;
border-right: vw(1) solid #e9e9e9;
}
/* 移除最后一个输入框的右边框 */
.picker-group:last-child .picker-input {
border-right: none;
}
.picker-input .value {
color: #fff;
}
.picker-input.open .arrow {
transform: rotate(180deg);
}
.arrow {
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-width: vw(6) vw(5) 0 vw(5);
border-color: #909399 transparent transparent transparent;
transition: transform 0.2s ease-in-out;
}
/* 美化后的下拉选项窗口 */
.options {
position: absolute;
top: 110%;
left: 0;
right: 0;
max-height: vh(200); /* 限制最大高度并可滚动 */
overflow-y: auto;
background-color: rgba(0, 0, 0, 0.3);
border-radius: vw(4);
box-shadow: 0 vh(4) vh(12) rgba(0, 0, 0, 0.15); /* 更明显的阴影 */
list-style: none;
z-index: 10;
padding: vh(4) 0;
margin: 0;
border: vw(1) solid #ebeef5;
}
.options li {
padding: vh(10) vw(16);
cursor: pointer;
transition: background-color 0.2s;
white-space: nowrap;
color: #fff;
}
.options li:hover {
background-color: #f5f7fa;
color: #1890ff;
}
.options li.selected {
background-color: #e6f7ff;
color: #1890ff;
font-weight: 500;
}
/* 美化滚动条 (WebKit浏览器) */
.options::-webkit-scrollbar {
width: vw(6);
}
.options::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: vw(10);
}
.options::-webkit-scrollbar-thumb {
background: #c9c9c9;
border-radius: vw(10);
}
.options::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
</style>

View File

@ -0,0 +1,225 @@
<template>
<div class="header">
<div class="header-left">
<DateSelector :year="currentYear" :month="currentMonth" :start-year="2010" :end-year="2030" />
<ProjectSelector v-model="selectedProjectId" :options="options" />
<!-- <div>
<el-date-picker v-model="value1" type="date" placeholder="请选择时间" value-format="YYYY-MM-DD" class="datePicker" />
</div>
<div>
<el-select v-model="value" placeholder="请选择项目">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div> -->
</div>
<div class="header-center">新能源场站智慧运维大数据平台</div>
<div class="header-right">
<div>
<div class="left-section">
<img src="@/assets/large/weather.png" alt="天气图标" />
<span>
<span>多云 9°/18°</span>
</span>
</div>
</div>
<div>{{ date.ymd }} {{ date.hms }}</div>
<!-- 分割线 -->
<div class="divider">
<div class="top-block"></div>
<div class="bottom-block"></div>
</div>
<!-- -->
<div class="change" @click="emit('changePage')">
<el-icon v-if="!isFull">
<Expand />
</el-icon>
<el-icon v-else>
<Fold />
</el-icon>
</div>
<!-- 分割线 -->
<div class="divider">
<div class="top-block"></div>
<div class="bottom-block"></div>
</div>
<!-- 右侧管理系统图标 + 文字 -->
<div class="outscreen" @click="outScreen">
<img src="@/assets/large/outscreen.png" width="20" height="20" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
declare var ue5: any;
import '@/assets/styles/element.scss';
import DateSelector from './date.vue';
import ProjectSelector from './project.vue';
defineProps({
isFull: {
type: Boolean,
default: false
},
});
const emit = defineEmits(['changePage']);
const date: any = ref({
ymd: '',
hms: '',
week: ''
});
const currentYear = ref(2025);
const currentMonth = ref(11);
const selectedProjectId = ref(1);
const value1 = ref('');
const value = ref('');
const options = ref([
{
value: 1,
label: '田东县乡村振兴光伏发电项目'
},
{
value: 2,
label: '田东县乡村振兴光伏发电项目(二期)'
},
{
value: 3,
label: '长顺县朝核农业光伏电站'
}
]);
const setTime = () => {
let date1 = new Date();
let year: any = date1.getFullYear();
let month: any = date1.getMonth() + 1;
let day: any = date1.getDate();
let hours: any = date1.getHours();
if (hours < 10) {
hours = '0' + hours;
}
let minutes: any = date1.getMinutes();
if (minutes < 10) {
minutes = '0' + minutes;
}
let seconds: any = date1.getSeconds();
if (seconds < 10) {
seconds = '0' + seconds;
}
date.value.ymd = year + '-' + month + '-' + day;
date.value.hms = hours + ':' + minutes + ':' + seconds;
date.value.week = date1.getDay();
};
// 添加定时器,每秒更新一次时间
const timer = setInterval(setTime, 1000);
const outScreen = () => {
console.log('outScreen');
ue5('exitfullscreen');
};
// 组件卸载时清除定时器
onUnmounted(() => {
clearInterval(timer);
});
</script>
<style scoped lang="scss">
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.header {
width: 100%;
height: 8vh;
display: grid;
grid-template-columns: 1fr 2fr 1fr;
}
.header-left {
padding-left: vw(40);
display: flex;
align-items: center;
gap: vw(20);
// justify-content: space-between;
// &>div {
// width: vw(240);
// margin-right: vw(20);
// }
}
.header-center {
display: flex;
align-items: center;
justify-content: center;
font-family: Rang_men_zheng_title;
font-size: vw(32);
letter-spacing: vw(8);
}
.header-right {
padding-right: vw(20);
display: flex;
align-items: center;
justify-content: flex-end;
font-size: vw(15);
.left-section {
display: flex;
align-items: center;
padding-right: vw(20);
// margin-right: auto; /* 让右侧元素(管理系统)居右 */
}
.left-section img {
width: 32px;
height: 32px;
margin-right: 8px;
/* 图标与文字间距 */
}
}
/* 分割线 */
.divider {
display: grid;
grid-template-rows: 1fr 1fr;
gap: vh(2);
padding: vh(14) vw(10);
.top-block,
.bottom-block {
width: vw(2);
height: vh(7);
background: #19b5fb;
}
}
.change {
font-size: vw(22);
line-height: vw(22);
margin-top: vw(2);
}
.outscreen {
width: vw(20);
height: vw(20);
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
</style>

View File

@ -0,0 +1,410 @@
<template>
<div class="leftpageContainer">
<!-- 头部图表 -->
<div class="topInfoContainer">
<div class="left">
<span class="top">
<span class="num">365</span>
<!-- <span class="unit">day</span> -->
</span>
<span class="desc">
运行天数
</span>
</div>
<div class="right">
<div class="operationStats">
<div class="statItem">
<div class="statLabel">
<span class="title">计划发电/实际发电</span>
<div class="progressText"><span class="actual">{{ operationData.efficiencyActual }}</span>/{{
operationData.efficiencyPlan }} <span class="unit"> kWh</span></div>
</div>
<div class="progressBar">
<div class="progressTrack">
<div class="progressFill status"
:style="{ width: (operationData.efficiencyActual / operationData.efficiencyPlan * 100) + '%' }">
</div>
</div>
<div class="progressCircle"
:style="{ left: (operationData.efficiencyActual / operationData.efficiencyPlan * 100) + '%' }">
</div>
</div>
</div>
<div class="statItem">
<div class="statLabel">
<span>待处理工单数量</span>
<div class="progressText"><span class="actual">{{ operationData.gdNum }}</span>/{{ operationData.gdNumTotal }}
<span class="unit"> </span>
</div>
</div>
<div class="progressBar">
<div class="progressTrack">
<div class="progressFill status"
:style="{ width: (operationData.gdNum / operationData.gdNumTotal * 100) + '%' }">
</div>
</div>
<div class="progressCircle"
:style="{ left: (operationData.gdNum / operationData.gdNumTotal * 100) + '%' }">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 中部图表 -->
<div class="middleInfo">
<SmallTitle :title="'光伏电站总览'" />
<div class="middleInfoContainer">
<div class="totalView">
<div class="totalNum">
<span class="num">264966.00</span>
<span class="unit">kWh</span>
</div>
<div class="totalDesc">
累计总发电量
</div>
</div>
<div class="electricity">
<div v-for="item in powerGenerationData" :key="item.type" class="powerGenerationBox">
<div class="left">
<img src="@/assets/ueimg/icon-2.png" alt="">
</div>
<div class="right">
<div class="title">{{ item.title }}</div>
<div class="num">{{ item.value }} <span class="unit">{{ item.unit }}</span></div>
</div>
</div>
</div>
</div>
</div>
<!-- 底部信息 -->
<div class="bottomInfo">
<SmallTitle :title="'主规模设备'" />
<div class="infoContainer">
<div v-for="item in infoList" :key="item.name" class="infoItem">
<div class="infoIcon">
<img :src="item.icon" alt="">
</div>
<div class="infoName">
{{ item.name }}
</div>
<div class="infoValue">
{{ item.value }}
</div>
<div class="infoUnit">
{{ item.unit }}
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import SmallTitle from './smalltitle.vue';
// 模拟数据量,用于拖动条渲染
const operationData = ref({
efficiencyPlan: 1500,
efficiencyActual: 125,
gdNumTotal: 100,
gdNum: 50,
});
const infoList = ref([
{
name: '变压器220KV',
value: 564,
unit: '(台)',
icon: '/assets/ue1.png',
},
{
name: '开关柜220KV',
value: 100,
unit: '(台)',
icon: '/assets/ue2.png',
},
{
name: '接地变110v',
value: 564,
unit: '(台)',
icon: '/assets/ue3.png',
},
{
name: '电缆110v',
value: 768,
unit: '(回)',
icon: '/assets/ue4.png',
},
{
name: 'GIS',
value: 100,
unit: '(个)',
icon: '/assets/ue5.png',
},
])
// 发电量数据
const powerGenerationData = ref([
{
type: 'day',
title: '日发电量',
value: 2649,
unit: 'kWh'
},
{
type: 'month',
title: '月发电量',
value: 2649,
unit: 'kWh'
},
{
type: 'year',
title: '年发电量',
value: 2649,
unit: 'kWh'
}
])
</script>
<style scoped lang="scss">
@import '@/views/ueScreen/gis.scss';
.leftpageContainer {
// 头部图表
.topInfoContainer {
width: 100%;
height: vh(128);
display: flex;
.left {
width: vw(180);
height: vh(140);
background-image: url('@/assets/ueimg/bg1.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
display: flex;
justify-content: center;
align-items: center;
position: relative;
.top {
position: absolute;
top: vh(14);
.num {
font-size: vh(24);
}
.unit {
font-size: vh(16);
color: rgba(255, 255, 255, 0.7);
}
}
.desc {
font-size: vh(12);
}
}
.right {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: vw(10);
font-family: 'SourceHanSansCN-Regular';
.operationStats {
width: 100%;
.statItem {
margin-bottom: vh(20);
.statLabel {
font-size: vh(16);
color: rgba(255, 255, 255, 0.87);
margin-bottom: vh(10);
display: flex;
align-items: center;
justify-content: space-between;
.title {
// width: vw(140);
}
.progressText {
padding-right: vw(4);
.actual {
color: rgba(125, 246, 255, 1)
}
}
}
.progressBar {
position: relative;
margin-bottom: vh(20);
.progressTrack {
height: vh(10);
background: rgba(255, 255, 255, 0.15);
overflow: hidden;
margin-bottom: vh(8);
position: relative;
.progressFill {
height: 100%;
transition: width 0.5s ease;
&.status {
background: linear-gradient(259.28deg, rgba(41, 241, 250, 1) 0%, rgba(41, 241, 250, 0) 100%);
}
}
}
.progressCircle {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: vh(24);
height: vh(24);
border-radius: 50%;
background: linear-gradient(135deg, #7df6ff 0%, #29f1fa 100%);
box-shadow: 0 0 vh(10) rgba(41, 241, 250, 0.8);
border: vh(2) solid rgba(255, 255, 255, 0.9);
z-index: 1;
transition: left 0.5s ease;
}
}
}
}
}
}
// 中部信息
.middleInfo {
.middleInfoContainer {
// margin-top: vh(12);
width: 100%;
height: vh(313);
// padding: vw(8);
box-sizing: border-box;
position: relative;
background-image: url('@/assets/ueimg/bg.png');
background-size: 100% 100%;
margin-bottom: vh(12);
.totalView {
display: flex;
flex-direction: column;
align-items: center;
.totalNum {
margin-top: vh(31);
.num {
font-size: vh(36);
font-family: 'LCDFont';
}
.unit {
margin-left: vw(11);
font-size: vh(16);
}
}
.totalDesc {
font-size: vh(12);
margin-top: vh(8);
}
}
.electricity {
width: vw(462);
display: flex;
justify-content: space-around;
position: absolute;
bottom: vh(27.51);
.powerGenerationBox {
display: flex;
align-items: center;
height: vh(60);
font-family: 'SourceHanSansCN-Regular';
color: rgba(255, 255, 255, 1);
.left {
img {
width: vw(48);
height: vh(48);
}
}
.right {
.title {
font-size: vh(16);
}
.num {
margin-top: vh(10.28);
font-family: 'D-Din';
font-size: vh(24);
text-shadow: 0px 0px 6px rgba(0, 255, 238, 1);
.unit {
font-size: vh(16);
}
}
}
}
}
}
}
// 底部信息
.bottomInfo {
background-color: rgba(17, 25, 24, 0.3);
.infoContainer {
.infoItem {
display: flex;
align-items: center;
width: 100%;
height: vh(74);
background-image: url('@/assets/ueimg/item.png');
background-size: cover;
padding: vw(8);
margin-top: vh(12);
box-sizing: border-box;
font-family: 'SourceHanSansCN-Regular';
color: rgba(255, 255, 255, 1);
.infoIcon {
img {
width: vw(42);
height: vh(42);
}
}
.infoName {
margin-left: vw(17);
font-size: vw(16);
width: vw(200);
height: vh(28);
}
.infoValue {
margin-left: vw(62);
font-size: vw(16);
}
.infoUnit {
margin-left: vw(34);
font-size: vw(16);
color: rgba(125, 255, 253, 1);
}
}
}
}
}
</style>

View File

@ -0,0 +1,365 @@
import * as echarts from 'echarts';
export let option1 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
// 图例
legend: {
top: '1%',
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#fff',
fontSize: 14
},
data: [
{ name: 'A区', itemStyle: { color: '#00bfff' } },
{ name: 'B区', itemStyle: { color: '#00f5a6' } },
{ name: 'C区', itemStyle: { color: '#ffa500' } }
]
},
// 网格
grid: {
left: '3%',
right: '5%',
bottom: '5%',
top: '15%',
containLabel: true
},
// X轴
xAxis: {
type: 'category',
boundaryGap: true,
axisTick: {
show: false
},
axisLabel: {
color: '#fff',
fontSize: 12
},
data: ['00:00', '06:00', '12:00', '18:00', '24:00']
},
// Y轴
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#fff'
}
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: 'rgba(255,255,255,0.2)'
}
},
axisLabel: {
color: '#fff',
fontSize: 12
},
min: 0,
max: 100,
interval: 25
},
// 系列
series: [
{
name: 'A区',
type: 'line',
data: [15, 70, 40, 55, 65, 85, 30, 80, 60],
lineStyle: {
color: '#00bfff',
width: 2
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'rgba(0, 191, 255, 0.3)'
}, {
offset: 1, color: 'rgba(0, 191, 255, 0.0)'
}]
}
},
symbol: 'none',
smooth: true
},
{
name: 'B区',
type: 'line',
data: [50, 20, 45, 50, 85, 70, 50, 60, 50],
lineStyle: {
color: '#00f5a6',
width: 2
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'rgba(0, 245, 166, 0.3)'
}, {
offset: 1, color: 'rgba(0, 245, 166, 0.0)'
}]
}
},
symbol: 'none',
smooth: true
},
{
name: 'C区',
type: 'line',
data: [20, 50, 30, 35, 30, 35, 30, 35, 30],
lineStyle: {
color: '#ffa500',
width: 2
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'rgba(255, 165, 0, 0.3)'
}, {
offset: 1, color: 'rgba(255, 165, 0, 0.0)'
}]
}
},
symbol: 'none',
smooth: true
}
],
backgroundColor: 'transparent'
};
export let option2 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
// 图例
legend: {
top: '3%',
itemWidth: 12,
itemHeight: 12,
textStyle: {
color: '#fff',
fontSize: 14
},
data: [
{ name: '发电量', itemStyle: { color: 'rgba(125, 255, 253, 1)' } },
{ name: '发电趋势', itemStyle: { color: '#ffa500' } }
]
},
// 网格
grid: {
left: '3%',
right: '3%',
bottom: '5%',
top: '30%',
containLabel: true
},
// X轴
xAxis: {
type: 'category',
boundaryGap: true,
axisTick: {
show: false
},
axisLabel: {
color: '#fff',
fontSize: 14
},
data: ['周一', '周二', '周三', '周四', '周五']
},
// Y轴
yAxis: {
type: 'value',
name: '单位: Kwh',
nameTextStyle: {
color: '#fff',
fontSize: 14,
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
color: 'rgba(255,255,255,0.3)'
}
},
axisLabel: {
color: '#fff',
fontSize: 14
},
interval: 1000
},
// 系列
series: [
{
name: '发电量',
type: 'bar',
data: [2800, 1800, 1200, 1700, 1500],
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'rgba(125, 255, 253, 1)'
}, {
offset: 1, color: 'rgba(225, 255, 255, 0)'
}]
},
borderRadius: [4, 4, 0, 0]
},
barWidth: '30px'
},
{
name: '发电趋势',
type: 'line',
data: [1800, 4000, 2500, 4000, 2000],
lineStyle: {
color: 'rgba(255, 209, 92, 1)',
width: 2
},
symbol: 'circle',
symbolSize: 10,
itemStyle: {
color: 'rgba(255, 209, 92, 1)',
borderColor: '#fff',
borderWidth: 2
},
smooth: false
}
],
// 背景透明
backgroundColor: 'transparent'
};
export let option3 = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
legend: {
data: ['光照度', '功率'],
top: '1%',
textStyle: {
color: '#fff',
fontSize: 14
}
},
grid: {
left: '3%',
right: '5%',
bottom: '5%',
top: '15%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: true,
axisTick: {
show: false
},
axisLabel: {
color: '#fff',
fontSize: 12
},
data: ['00:00', '06:00', '12:00', '18:00', '24:00']
},
yAxis: {
type: 'value',
axisLine: {
lineStyle: {
color: '#fff',
}
},
axisLabel: {
color: '#fff',
fontSize: 12
},
interval: 6,
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255, 255, 255, 0.3)',
width: 1,
type: [4, 3]
}
}
},
series: [
{
name: '光照度',
type: 'line',
data: [5.5, 5, 9, 11, 11.5, 12, 11.8, 12, 13],
itemStyle: {
color: 'rgba(82, 155, 255, 1)'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(72, 149, 239, 0.8)'
},
{
offset: 1,
color: 'rgba(72, 149, 239, 0.2)'
}
])
},
smooth: true
},
{
name: '功率',
type: 'line',
data: [2, 18, 5, 2, 6, 9, 12, 4, 5.5],
itemStyle: {
color: 'rgba(125, 255, 253, 1)'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgba(152, 230, 205, 0.8)'
},
{
offset: 1,
color: 'rgba(152, 230, 205, 0.2)'
}
])
},
smooth: true
}
],
backgroundColor: 'transparent'
};

View File

@ -0,0 +1,215 @@
<template>
<div class="project-picker">
<div class="picker-group">
<div class="picker-input" @click="isOpen = !isOpen" :class="{ 'open': isOpen }">
<span class="value" :title="selectedLabel">{{ selectedLabel }}</span>
<span class="arrow"></span>
</div>
<ul class="options" v-show="isOpen">
<li v-for="option in options" :key="option.value" :class="{ 'selected': option.value === modelValue }"
@click="handleSelect(option.value)">
{{ option.label }}
</li>
</ul>
</div>
</div>
</template>
<script setup>
import { ref, computed, onMounted, onBeforeUnmount } from 'vue';
const props = defineProps({
// 双向绑定的项目ID
modelValue: {
type: [Number, String],
required: true,
},
// 项目列表选项
options: {
type: Array,
required: true,
validator: (value) => {
// 简单验证options格式
return value.every(option => option.hasOwnProperty('value') && option.hasOwnProperty('label'));
}
},
// 是否禁用
disabled: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(['update:modelValue', 'change']);
// 内部状态
const isOpen = ref(false);
// 计算当前选中的标签
const selectedLabel = computed(() => {
const selectedOption = props.options.find(option => option.value === props.modelValue);
return selectedOption ? selectedOption.label : '';
});
// 处理选项选择
const handleSelect = (value) => {
if (value !== props.modelValue) {
emit('update:modelValue', value);
emit('change', value);
}
isOpen.value = false;
};
// 点击外部关闭下拉框
const handleClickOutside = (event) => {
if (!event.target.closest('.project-picker')) {
isOpen.value = false;
}
};
// 挂载时添加事件监听
onMounted(() => {
document.addEventListener('click', handleClickOutside);
});
// 卸载时移除事件监听
onBeforeUnmount(() => {
document.removeEventListener('click', handleClickOutside);
});
</script>
<style scoped lang="scss">
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.project-picker {
display: inline-flex;
border-radius: vw(8);
font-size: vw(14);
background-color: transparent;
box-shadow: 0 vh(2) vh(8) rgba(0, 0, 0, 0.08);
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
border: vw(1) solid #c0c4cc;
}
.project-picker:hover {
border-color: #909399;
box-shadow: 0 vh(4) vh(12) rgba(0, 0, 0, 0.1);
}
.picker-group {
position: relative;
}
.picker-input {
// 关键修改:设置一个最大宽度,防止文本过长导致容器被撑破
// 你可以根据需要调整这个值vw(300) 表示在1920px宽的屏幕下最大宽度是300px
max-width: 12vw;
width: 100%;
/* 让输入框尽可能利用可用空间但不超过max-width */
display: flex;
gap: vw(8);
justify-content: space-between;
align-items: center;
padding: vh(8) vw(16);
cursor: pointer;
user-select: none;
box-sizing: border-box;
/* 确保padding不会增加元素总宽度 */
}
.picker-input .value {
color: #fff;
// 关键修改:添加文本省略样式
white-space: nowrap;
/* 强制文本在一行显示 */
overflow: hidden;
/* 隐藏溢出的文本 */
text-overflow: ellipsis;
/* 显示省略号 */
flex-grow: 1;
/* 让 .value 元素占据可用空间,将箭头推到最右边 */
}
.picker-input.open .arrow {
transform: rotate(180deg);
}
.arrow {
display: inline-block;
width: 0;
height: 0;
border-style: solid;
border-width: vw(6) vw(5) 0 vw(5);
border-color: #909399 transparent transparent transparent;
transition: transform 0.2s ease-in-out;
}
/* 美化后的下拉选项窗口 */
.options {
position: absolute;
top: 110%;
left: 0;
right: 0;
max-height: vh(200);
/* 限制最大高度并可滚动 */
overflow-y: auto;
background-color: rgba(0, 0, 0, 0.3);
border-radius: vw(4);
box-shadow: 0 vh(4) vh(12) rgba(0, 0, 0, 0.15);
/* 更明显的阴影 */
list-style: none;
z-index: 10;
padding: vh(4) 0;
margin: 0;
border: vw(1) solid #ebeef5;
}
.options li {
padding: vh(10) vw(16);
cursor: pointer;
transition: background-color 0.2s;
white-space: nowrap;
color: #fff;
}
.options li:hover {
background-color: #f5f7fa;
color: #1890ff;
}
.options li.selected {
background-color: #e6f7ff;
color: #1890ff;
font-weight: 500;
}
/* 美化滚动条 (WebKit浏览器) */
.options::-webkit-scrollbar {
width: vw(6);
}
.options::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: vw(10);
}
.options::-webkit-scrollbar-thumb {
background: #c9c9c9;
border-radius: vw(10);
}
.options::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
</style>

View File

@ -0,0 +1,203 @@
<template>
<div class="right_box">
<div class="statistic">
<Smalltitle title="异常情况统计">
<div class="error_tip_box">
<div class="error_tip">两条异常消息!</div>
<img src="@/assets/ueimg/tip.png">
</div>
</Smalltitle>
<div class="error_list" ref="errorListRef">
<div v-for="item in errorList" :key="item" class="error_item">
<div class="item_info">
<el-icon>
<Warning />
</el-icon>
<div class="ml-1">A区</div>
<div class="flex-grow text-right">2025-08-08 10:24:36</div>
</div>
<div class="item_headline">多晶硅智能组件异常请及时处理</div>
</div>
</div>
</div>
<!-- -->
<div class="data_box">
<Smalltitle title="发电实时功率" />
<div class="echarts">
<EchartBoxTwo :option="option_fdssgl" ref="barChart" />
</div>
</div>
<!-- -->
<div class="data_box">
<Smalltitle title="发电总量趋势" />
<div class="echarts">
<EchartBoxTwo :option="option_fdzlqs" ref="barChart" />
</div>
</div>
<!-- -->
<div class="data_box">
<Smalltitle title="电站负荷曲线" />
<div class="echarts3">
<EchartBoxTwo :option="option_dzfhqx" ref="barChart" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import EchartBoxTwo from '@/components/EchartBox/index.vue';
import { option1, option2, option3 } from './options';
import Smalltitle from './smalltitle.vue';
const option_fdssgl = ref(null);
const option_fdzlqs = ref(null);
const option_dzfhqx = ref(null);
const errorListRef = ref<HTMLElement | null>(null);
const errorList = ref([1, 2, 3, 4, 5, 6, 7]);
const handleWheel = (event: WheelEvent) => {
const errorList = (event.target as HTMLElement).closest('.error_list');
if (errorList) {
event.preventDefault(); // 阻止页面或父元素的垂直滚动
errorList.scrollLeft += event.deltaY; // 横向滚动
}
};
const reszieFont = () => {
const fontSize = Math.sqrt(window.innerWidth) / 3;
option1.xAxis.axisLabel.fontSize = fontSize;
option1.yAxis.axisLabel.fontSize = fontSize;
option1.legend.textStyle.fontSize = fontSize;
option2.xAxis.axisLabel.fontSize = fontSize;
option2.yAxis.axisLabel.fontSize = fontSize;
option2.legend.textStyle.fontSize = fontSize;
option2.yAxis.nameTextStyle.fontSize = fontSize;
option3.xAxis.axisLabel.fontSize = fontSize;
option3.yAxis.axisLabel.fontSize = fontSize;
option3.legend.textStyle.fontSize = fontSize;
option_fdssgl.value = option1;
option_fdzlqs.value = option2;
option_dzfhqx.value = option3;
}
onMounted(() => {
reszieFont();
window.addEventListener('resize', reszieFont);
window.addEventListener('wheel', handleWheel, { passive: false });
// passive: false 是关键,允许我们在事件处理函数中调用 event.preventDefault()
});
onUnmounted(() => {
window.removeEventListener('resize', reszieFont);
window.removeEventListener('wheel', handleWheel);
});
</script>
<style scoped lang="scss">
$background-color: rgba(17, 25, 24, 0.3);
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.right_box {
display: flex;
flex-direction: column;
gap: vh(15);
width: 100%;
height: 100%;
padding-bottom: vh(20);
}
.statistic {
flex: 1;
display: flex;
flex-direction: column;
gap: vh(10);
background: $background-color;
}
.data_box {
display: flex;
flex-direction: column;
width: 100%;
height: calc(26vh - vh(25));
background-color: $background-color;
.echarts {
width: 100%;
// 40是title的高度
height: calc(26vh - vh(20 + 40));
}
}
.error_tip_box {
display: flex;
align-items: center;
justify-content: center;
gap: vw(5);
margin-right: vw(8);
img {
width: vw(20);
height: vh(20);
}
.error_tip {
height: vh(26);
width: vw(81);
border-radius: vw(13);
background: rgba(0, 255, 238, 0.12);
color: rgba(0, 255, 238, 1);
font-size: vw(10);
text-align: center;
line-height: vh(26);
}
}
.error_list {
flex: 1;
display: flex;
gap: vw(10);
margin: vh(10) vw(15);
overflow: hidden;
flex-wrap: nowrap;
cursor: grabbing;
.error_item {
flex: 0 0 auto;
width: vw(300);
padding: vh(10) vw(10);
color: #fff;
background: rgba(255, 255, 255, 0.09);
border: 1px solid rgba(0, 255, 238, 0.5);
border-radius: vw(8);
.item_info {
display: flex;
align-items: center;
justify-content: space-between;
font-size: vw(14);
font-weight: bold;
margin-bottom: vh(10);
}
.item_headline {
font-size: vw(16);
}
}
}
</style>

View File

@ -0,0 +1,56 @@
<template>
<div class="leftpageContainer">
<div class="bottomInfo">
<div class="title">
<span>{{ title }}</span>
<slot></slot>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
const props = defineProps({
title: {
type: Number||String,
default: ''
},
})
</script>
<style scoped lang="scss">
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.title {
background-image: url('@/assets/ueimg/Rectangle 766.png');
background-size: cover;
background-repeat: no-repeat;
border: vw(1) solid rgba(255, 255, 255, 0.1);
width: 100%;
height: vh(40);
display: flex;
align-items: center;
justify-content: space-between;
span {
margin-left: vw(41.42);
font-size: vh(20);
font-weight: 400;
letter-spacing: vw(1);
color: rgba(255, 255, 255, 1);
vertical-align: middle;
font-family: 'ue_title';
text-shadow: 0px 2px 4px rgba(51, 255, 252, 0.57);
}
}
</style>

View File

@ -0,0 +1,11 @@
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}

View File

@ -0,0 +1,123 @@
<template>
<div class="ueScreen">
<Header :isFull="isFull" @changePage="handleChangePage" />
<div class="content_box">
<LeftPage class="left" :style="{ left: isHideOther ? '-25vw' : '1vw' }" />
<RightPage class="right" :style="{ right: isHideOther ? '-25vw' : '1vw' }" />
</div>
</div>
</template>
<script setup lang="ts">
declare var ue5: any;
import Header from './components/header.vue';
import LeftPage from './components/leftPage.vue';
import RightPage from './components/rightPage.vue';
import { getToken } from '@/utils/auth';
import { useUserStoreHook } from '@/store/modules/user';
import usePermissionStore from '@/store/modules/permission';
import to from 'await-to-js';
const userStore = useUserStoreHook();
const isHideOther = ref(false);
const isFull = ref(false);
/**
* 切换中心页面全屏
*/
const handleChangePage = () => {
if (isFull.value) {
isFull.value = false;
isHideOther.value = false;
} else {
isFull.value = true;
isHideOther.value = true;
ue5('openUEUI');
}
};
// 调用静默登录接口
const silentLogin = async (isExpired = false) => {
const token = getToken();
if (token && !isExpired) return true;
try {
await to(
userStore.login({
username: 'admin',
password: 'admin123',
tenantId: '000000',
clientId: undefined,
grantType: undefined
})
);
} catch (e) {
ElMessage.error('无法获取数据,请联系管理员');
return false;
}
await to(userStore.getInfo());
await usePermissionStore().generateRoutes();
return true;
};
const initPage = async () => {
const logged = await silentLogin();
if (!logged) return;
};
onMounted(() => {
initPage();
window['silentLogin'] = silentLogin;
});
</script>
<style scoped lang="scss">
$vm_base: 1920;
$vh_base: 1080;
// 计算vw
@function vw($px) {
@return calc(($px / $vm_base) * 100vw);
}
// 计算vh
@function vh($px) {
@return calc(($px / $vh_base) * 100vh);
}
.ueScreen {
width: 100vw;
height: 100vh;
// background-image: url('@/assets/ueimg/bj.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
color: #fff;
overflow: hidden;
}
.content_box {
position: relative;
width: 100vw;
height: calc(100vh - 8vh);
}
.left {
position: absolute;
top: 0;
left: vw(20);
width: 25vw;
height: 100%;
transition: all 0.5s ease;
}
.right {
position: absolute;
top: 0;
right: vw(20);
width: 25vw;
height: 100%;
transition: all 0.5s ease;
}
</style>

View File

@ -201,15 +201,6 @@ import { ref, computed, onMounted, onUnmounted, nextTick, reactive, toRefs } fro
import router from '@/router';
import * as echarts from 'echarts'; // 导入ECharts
import renwuImage from '@/assets/images/renwu.png';
import { getCurrentInstance } from 'vue';
import { ref, computed, onMounted, onUnmounted, nextTick } from 'vue';
import router from '@/router';
import * as echarts from 'echarts'; // 导入ECharts
import renwuImage from '@/assets/images/renwu.png';
import { getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
// 搜索条件
const searchKeyword = ref('');