From a24a3d2aabd152d4e5259d1930bca917c5c6abbd Mon Sep 17 00:00:00 2001 From: fuguobin Date: Tue, 17 Oct 2023 18:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 3 +- src/api/table/types.ts | 10 +- src/types/auto-imports.d.ts | 2 - src/types/components.d.ts | 15 +- src/views/details/index.scss | 14 ++ src/views/details/index.vue | 211 ++++++++++++++---- src/views/monitoring/components/header.vue | 14 +- .../screen/components/infoPanel.vue | 2 +- src/views/monitoring/screen/index.scss | 2 +- vite.config.ts | 4 +- 11 files changed, 206 insertions(+), 73 deletions(-) diff --git a/.env.development b/.env.development index eb98de9..636c26e 100644 --- a/.env.development +++ b/.env.development @@ -3,4 +3,4 @@ VITE_APP_ENV = 'development' VITE_APP_TITLE = 'vue-vite-project-admin' VITE_APP_PORT = 8089 ##VITE_APP_WS_API = 'ws://localhost:9010' ## websocket地址 -VITE_APP_BASE_API = 'http://10.10.10.56:9010/' ## '/dev-api'线上接口 '/mock'本地模拟数据 +VITE_APP_BASE_API = '/dev-api' ## '/dev-api'线上接口 '/mock'本地模拟数据 diff --git a/.env.production b/.env.production index 73a264b..69b8686 100644 --- a/.env.production +++ b/.env.production @@ -5,5 +5,6 @@ VITE_APP_PORT = 8089 #VITE_APP_WS_API = 'ws://board.heatiot.cn:8001/prod-api' ## websocket地址 #VITE_APP_BASE_API = 'http://board.heatiot.cn:8001/prod-api/' ## 线上接口 #VITE_APP_WS_API = 'ws://${window.location.host}/ws' ## websocket地址 ws://10.10.10.56:9000/websocket/ -VITE_APP_BASE_API = '/prod-api/' ## '/dev-api'线上接口 '/mock'本地模拟数据 +VITE_APP_BASE_API = '/prod-api/' ## 正式环境 +# VITE_APP_BASE_API = '/biprod-api/' ## 测试环境 diff --git a/src/api/table/types.ts b/src/api/table/types.ts index 026900b..34e76b4 100644 --- a/src/api/table/types.ts +++ b/src/api/table/types.ts @@ -62,9 +62,17 @@ export interface TableVo { */ export interface PanelVo { backImg: string; - ext: any; + ext: string; + extJsb: extVo; id: number; title: string; type: string; value?: number; } +export interface extVo { + extData: any; +} + +export interface RoleQuery { + time: string; +} diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index fa36cff..5742656 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -6,7 +6,6 @@ declare global { const ElMessage: typeof import('element-plus/es')['ElMessage'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const ElNotification: typeof import('element-plus/es')['ElNotification'] - const ElTree: typeof import('element-plus/es')['ElTree'] const NEllipsis: typeof import('naive-ui')['NEllipsis'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] @@ -278,7 +277,6 @@ declare module 'vue' { readonly ElMessage: UnwrapRef readonly ElMessageBox: UnwrapRef readonly ElNotification: UnwrapRef - readonly ElTree: UnwrapRef readonly NEllipsis: UnwrapRef readonly asyncComputed: UnwrapRef readonly autoResetRef: UnwrapRef diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 6343560..83ac5bd 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -13,6 +13,7 @@ declare module '@vue/runtime-core' { ElButton: typeof import('element-plus/es')['ElButton'] ElCard: typeof import('element-plus/es')['ElCard'] ElCol: typeof import('element-plus/es')['ElCol'] + ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] @@ -21,13 +22,9 @@ declare module '@vue/runtime-core' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] - ElPagination: typeof import('element-plus/es')['ElPagination'] - ElRadio: typeof import('element-plus/es')['ElRadio'] - ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] @@ -35,16 +32,9 @@ declare module '@vue/runtime-core' { ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] - ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTree: typeof import('element-plus/es')['ElTree'] Hamburger: typeof import('./../components/Hamburger/index.vue')['default'] - IEpDelete: typeof import('~icons/ep/delete')['default'] - IEpEdit: typeof import('~icons/ep/edit')['default'] - IEpPlus: typeof import('~icons/ep/plus')['default'] - IEpPosition: typeof import('~icons/ep/position')['default'] - IEpRefresh: typeof import('~icons/ep/refresh')['default'] - IEpSearch: typeof import('~icons/ep/search')['default'] LangSelect: typeof import('./../components/LangSelect/index.vue')['default'] MultiUpload: typeof import('./../components/Upload/MultiUpload.vue')['default'] NBadge: typeof import('naive-ui')['NBadge'] @@ -73,7 +63,4 @@ declare module '@vue/runtime-core' { Video: typeof import('./../components/Video/index.vue')['default'] WangEditor: typeof import('./../components/WangEditor/index.vue')['default'] } - export interface ComponentCustomProperties { - vLoading: typeof import('element-plus/es')['ElLoadingDirective'] - } } diff --git a/src/views/details/index.scss b/src/views/details/index.scss index e69de29..5e35a50 100644 --- a/src/views/details/index.scss +++ b/src/views/details/index.scss @@ -0,0 +1,14 @@ +.details { + padding: 1.5rem; + .search { + margin-bottom: 1.5rem; + } + .echart { + .comparisonInfo { + .stackedLine { + width: 100%; + height: 500px; + } + } + } +} diff --git a/src/views/details/index.vue b/src/views/details/index.vue index 5fb4542..f6e2058 100644 --- a/src/views/details/index.vue +++ b/src/views/details/index.vue @@ -1,62 +1,187 @@ - +const resetForm = (formEl: FormInstance | undefined) => { + if (!formEl) return; + formEl.resetFields(); +}; +const optionss = [ + { + value: 'Option1', + label: 'Option1' + }, + { + value: 'Option2', + label: 'Option2' + }, + { + value: 'Option3', + label: 'Option3' + }, + { + value: 'Option4', + label: 'Option4' + }, + { + value: 'Option5', + label: 'Option5' + } +]; + +const options = { + title: { + text: 'Temperature Change in the Coming Week' + }, + tooltip: { + trigger: 'axis' + }, + legend: {}, + toolbox: { + show: true, + feature: { + dataZoom: { + yAxisIndex: 'none' + }, + dataView: { readOnly: false }, + magicType: { type: ['line', 'bar'] }, + restore: {}, + saveAsImage: {} + } + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + }, + yAxis: { + type: 'value', + axisLabel: { + formatter: '{value} °C' + } + }, + series: [ + { + name: 'Highest', + type: 'line', + data: [10, 11, 13, 11, 12, 12, 9], + markPoint: { + data: [ + { type: 'max', name: 'Max' }, + { type: 'min', name: 'Min' } + ] + }, + markLine: { + data: [{ type: 'average', name: 'Avg' }] + } + }, + { + name: 'Lowest', + type: 'line', + data: [1, -2, 2, 5, 3, 2, 0], + markPoint: { + data: [{ name: '周最低', value: -2, xAxis: 1, yAxis: -1.5 }] + }, + markLine: { + data: [ + { type: 'average', name: 'Avg' }, + [ + { + symbol: 'none', + x: '90%', + yAxis: 'max' + }, + { + symbol: 'circle', + label: { + position: 'start', + formatter: 'Max' + }, + type: 'max', + name: '最高点' + } + ] + ] + } + } + ] +}; + +onMounted(() => { + // 图表初始化 + const chart = echarts.init(stackedRef.value); + chart.setOption(options); + // 大小自适应 + window.addEventListener('resize', () => { + chart.resize(); + }); +}); + diff --git a/src/views/monitoring/components/header.vue b/src/views/monitoring/components/header.vue index 0f1f15b..cc32ccf 100644 --- a/src/views/monitoring/components/header.vue +++ b/src/views/monitoring/components/header.vue @@ -187,14 +187,14 @@ function returnBack() { } function waringClick() { //点击报警按钮 - if (waringData.value.length === 0) { - ElNotification({ - message: '暂没有报警信息!', - type: 'info', - }) - } else { + // if (waringData.value.length === 0) { + // ElNotification({ + // message: '暂没有报警信息!', + // type: 'info', + // }) + // } else { waringDrawer.value = true - } + // } } // function getWeatherData() { diff --git a/src/views/monitoring/screen/components/infoPanel.vue b/src/views/monitoring/screen/components/infoPanel.vue index ff639a3..6a19090 100644 --- a/src/views/monitoring/screen/components/infoPanel.vue +++ b/src/views/monitoring/screen/components/infoPanel.vue @@ -23,7 +23,7 @@

{{ item.title }}

-
+
{{ res.name }}: {{ res.unit }} diff --git a/src/views/monitoring/screen/index.scss b/src/views/monitoring/screen/index.scss index eee243e..d29c7b8 100644 --- a/src/views/monitoring/screen/index.scss +++ b/src/views/monitoring/screen/index.scss @@ -541,7 +541,7 @@ .numValueMore { flex: 1; - margin-left: 1rem; + margin-left: 1.5rem; span { font-size: 1.4rem; line-height: 30px; diff --git a/vite.config.ts b/vite.config.ts index 1dbf385..fc899d5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -45,9 +45,9 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { hmr: true, //配置HMR proxy: { [env.VITE_APP_BASE_API]: { - // target: 'http://172.1.2.106:9000/',//本地接口地址 + target: 'http://172.1.2.196:9010/',//本地接口地址 // target: 'http://172.1.2.48:9000/',//本地接口地址 - target: 'http://board.heatiot.cn:8001/prod-api/', //线上接口地址 + // target: 'http://board.heatiot.cn:8001/prod-api/', //线上接口地址 changeOrigin: true, rewrite: path => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') }