licp
2024-05-06 2c62b12634a37586391f2465c99b0db5a66bc0ec
Merge branch 'master' of http://114.132.189.42:9002/r/mes-ocea-before into master
已修改1个文件
已添加2个文件
197 ■■■■■ 文件已修改
src/views/equipment/mqtt-show/components/largeAreaChart.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipment/mqtt-show/index.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/quality/processInspect/processInspect-form.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipment/mqtt-show/components/largeAreaChart.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
<template>
  <div ref="myChart" style="width: 100%; height: 100%;"></div>
</template>
<script>
import * as echarts from 'echarts'
var myChart = null
var option = null
let base = +new Date(1968, 9, 3)
let oneDay = 24 * 3600 * 1000
let date = []
let data = [Math.random() * 300]
for (let i = 1; i < 20000; i++) {
  var now = new Date((base += oneDay))
  date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'))
  data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]))
}
export default {
  //   props: {
  //     yAxisMonth: {
  //       type: Array,
  //       default: []
  //     },
  //     seriesData: {
  //       type: Array,
  //       default: []
  //     }
  //   },
  data() {
    return {
      option: {
        tooltip: {
          trigger: 'axis',
          position: function(pt) {
            return [pt[0], '10%']
          }
        },
        title: {
          left: '5%',
          text: 'Large Ara Chart'
        },
        toolbox: {
          right: '5%',
          feature: {
            dataZoom: {
              yAxisIndex: 'none'
            },
            restore: {},
            saveAsImage: {}
          }
        },
        grid: {
          right: '5%'
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: date
        },
        yAxis: {
          type: 'value',
          boundaryGap: [0, '100%']
        },
        dataZoom: [
          {
            type: 'inside',
            start: 0,
            end: 10
          },
          {
            start: 0,
            end: 10
          }
        ],
        series: [
          {
            name: 'Fake Data',
            type: 'line',
            symbol: 'none',
            sampling: 'lttb',
            itemStyle: {
              color: 'rgb(255, 70, 131)'
            },
            areaStyle: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                {
                  offset: 0,
                  color: 'rgb(255, 158, 68)'
                },
                {
                  offset: 1,
                  color: 'rgb(255, 70, 131)'
                }
              ])
            },
            data: data
          }
        ]
      }
    }
  },
  mounted() {
    myChart = echarts.init(this.$refs.myChart)
    option = this.makeOption()
    this.initDrag()
  },
  methods: {
    makeOption() {},
    initDrag() {
      myChart.setOption((option = this.option))
      option && myChart.setOption(option)
      // é¡µé¢å‘生变化tree也改变
      window.addEventListener('resize', () => {
        if (myChart) myChart.resize()
      })
    }
  }
}
</script>
<style lang="scss" scoped></style>
src/views/equipment/mqtt-show/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
<template>
  <div>
    <div class="header_div">
      <el-select v-model="value" placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
    </div>
    <el-row>
      <el-col
        v-for="(v, k) in index"
        :key="k"
        style="height: 40vh; padding-top: 0.4em;"
        :span="12"
        ><largeAreaChart
      /></el-col>
    </el-row>
  </div>
</template>
<script>
import largeAreaChart from './components/largeAreaChart.vue'
export default {
  components: {
    largeAreaChart: largeAreaChart
  },
  data() {
    return {
      index: 7,
      options: [
        {
          value: '选项1',
          label: '黄金糕'
        },
        {
          value: '选项2',
          label: '双皮奶'
        },
        {
          value: '选项3',
          label: '蚵仔煎'
        },
        {
          value: '选项4',
          label: '龙须面'
        },
        {
          value: '选项5',
          label: '北京烤鸭'
        }
      ],
      value: ''
    }
  }
}
</script>
<style>
.header_div {
  height: 5em;
  width: 100%;
  display: flex;
  align-items: center;
  margin-left: 3em;
}
</style>
src/views/quality/processInspect/processInspect-form.vue
@@ -808,7 +808,7 @@
                                if (obj.inspectionValue) {
                                    arr = obj.inspectionValue.split(",")
                                }
                                obj.empiricalValueAddss = arr
                                this.$set(obj, "empiricalValueAddss", arr)
                                if(!obj.inote){
                                    obj.inote = null
                                }