longyvfengyun
2023-11-20 55c60e84df6378b5e79bb5ebf1c3ce8dc281c69f
内容提交
5个文件已修改
43 ■■■■■ 已修改文件
src/assets/js/axios.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/echarts/options/getNormalBar.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/echarts/options/normalLine.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/battShow.vue 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/videoShow.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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) {
  // 在发送请求之前做些什么
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)'
        },
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: {
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 = {
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>