From 55c60e84df6378b5e79bb5ebf1c3ce8dc281c69f Mon Sep 17 00:00:00 2001 From: longyvfengyun <496960745@qq.com> Date: 星期一, 20 十一月 2023 15:58:42 +0800 Subject: [PATCH] 内容提交 --- src/components/echarts/options/getNormalBar.js | 7 ++++--- src/components/echarts/options/normalLine.js | 4 ++-- src/views/videoShow.vue | 3 ++- src/assets/js/axios.js | 4 +--- src/views/battShow.vue | 25 +++++++++++++++++++++---- 5 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/assets/js/axios.js b/src/assets/js/axios.js index 8503b4d..abf4256 100644 --- a/src/assets/js/axios.js +++ b/src/assets/js/axios.js @@ -3,10 +3,8 @@ // 璺ㄥ煙璇锋眰 axios.defaults.baseURL = 'http://110.40.173.177:8005/'; } else { - //axios.defaults.baseURL = location.protocol + '//' + location.host + '/envir/'; - axios.defaults.baseURL = "http://110.40.173.177:8005/"; + axios.defaults.baseURL = location.protocol + '//' + location.hostname + ':8005/'; } - // 娣诲姞璇锋眰鎷︽埅鍣� axios.interceptors.request.use(function (config) { // 鍦ㄥ彂閫佽姹備箣鍓嶅仛浜涗粈涔� diff --git a/src/components/echarts/options/getNormalBar.js b/src/components/echarts/options/getNormalBar.js index 6ac10fa..88d38db 100644 --- a/src/components/echarts/options/getNormalBar.js +++ b/src/components/echarts/options/getNormalBar.js @@ -4,7 +4,7 @@ const getNormalBar = (data)=>{ const defaultOption = { minRatio: 0, - maxRatio: 1.2, + maxRatio: 1.1, grid: { top: '15%', right: '3%', @@ -46,7 +46,7 @@ if(isNaN(min)) { return 0; }else { - return min * option.minRatio; + return (min * option.minRatio).toHold(3); } }, max(data) { @@ -54,7 +54,7 @@ if(isNaN(max)) { return 1; }else { - return (max * option.maxRatio).toHold(0); + return (max * option.maxRatio).toHold(3); } }, axisLabel: { @@ -88,6 +88,7 @@ data: [], type: 'bar', showBackground: true, + symbolSize: 0, backgroundStyle: { color: 'rgba(180, 180, 180, 0.2)' }, diff --git a/src/components/echarts/options/normalLine.js b/src/components/echarts/options/normalLine.js index 37e93e8..bb5e858 100644 --- a/src/components/echarts/options/normalLine.js +++ b/src/components/echarts/options/normalLine.js @@ -42,7 +42,7 @@ if(isNaN(min)) { return 0; }else { - return (min * option.minRatio).toHold(0); + return (min * option.minRatio).toHold(2); } }, max(data) { @@ -50,7 +50,7 @@ if(isNaN(max)) { return 1; }else { - return (max * option.maxRatio).toHold(0); + return (max * option.maxRatio).toHold(2); } }, axisLabel: { diff --git a/src/views/battShow.vue b/src/views/battShow.vue index c6f44d0..47fc852 100644 --- a/src/views/battShow.vue +++ b/src/views/battShow.vue @@ -89,6 +89,8 @@ } }); const volBarOption = getNormalBar({ + minRatio: 0.999, + maxRatio: 1.001, grid: { top: '15%', right: '3%', @@ -107,7 +109,7 @@ const tempNum = getBarNum(tempData); tempBarOption.option.min = tempNum.min; tempBarOption.option.max = tempNum.max; - tempBarOption.title.text = "鏈�澶у��="+tempNum.max+"鈩�;鏈�灏忓��="+tempNum.min+"鈩�;骞冲潎鍊�="+tempNum.avg+"鈩�" + tempBarOption.title.text = "鏈�澶у��="+tempNum.max+"鈩�;鏈�灏忓��="+tempNum.min+"鈩�;骞冲潎鍊�="+tempNum.avg+"鈩�"; tempBarOption.series[0].data = tempData; let volData = data.monomerVol.split(",").map((item, key) => { @@ -116,7 +118,20 @@ const volNum = getBarNum(volData); volBarOption.option.min = volNum.min; volBarOption.option.max = volNum.max; - volBarOption.title.text = "鏈�澶у��="+volNum.max+"V;鏈�灏忓��="+volNum.min+"V;骞冲潎鍊�="+volNum.avg+"V" + volBarOption.title.text = "鏈�澶у��="+volNum.max+"V;鏈�灏忓��="+volNum.min+"V;骞冲潎鍊�="+volNum.avg+"V"; + volBarOption.series[0].type="line"; + volBarOption.series[0].markPoint= { + data: [ + { + type: 'max', + name: 'Max', + itemStyle: { + color: "#FF0000" + } + }, + { type: 'min', name: 'Min' } + ] + }; volBarOption.series[0].data = volData; }else { tempBarOption.series[0].data = []; @@ -127,10 +142,12 @@ } const alarmLineOption = getNormalLine({ - minRatio: 0.9 + minRatio: 1, + maxRatio: 1, }); const totalVolLineOption = getNormalLine({ - minRatio: 0.9 + minRatio: 1, + maxRatio: 1, }); let lineData = { diff --git a/src/views/videoShow.vue b/src/views/videoShow.vue index 40eb965..ade636f 100644 --- a/src/views/videoShow.vue +++ b/src/views/videoShow.vue @@ -6,6 +6,7 @@ import VideoItemIcon from "@/components/videoItemIcon.vue"; import videoContent from "@/assets/images/video-content.jpeg"; const num = ref([]); +const imgSrc = ref("http://192.168.1.109:8080/?action=stream"); const changeVideoState = (data)=>{ num.value.forEach(item=>{ @@ -68,7 +69,7 @@ <flex-box> <abs-pos-layout> <div class="img-container"> - <img :src="videoContent" alt="" /> + <img :src="imgSrc" alt="" /> </div> </abs-pos-layout> </flex-box> -- Gitblit v1.9.1