zenglf
2023-10-24 575a75a0519e53ceec6bb5d31f682124596c3bae
src/views/mdc/base/modules/deviceLog/LogInfo.vue
@@ -16,7 +16,8 @@
          </a-col>
          <a-col :md="6" :sm="6">
            <a-form-item label="日期">
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange" format='YYYY-MM-DD'/>
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" @change="dataChange"
                             format='YYYY-MM-DD'/>
            </a-form-item>
          </a-col>
          <a-col :md="3" :sm="3">
@@ -60,9 +61,9 @@
                            <span v-if="item.status == 23"
                                  :style='{display: "inline-block",width:item.dateProportion,  height: "100%", background: "#19FE01",position:"absolute",bottom:"0"}'></span>
                          </div>
                          <div  v-if="item.status == 22" style="z-index: 999;"
                                :style='{display: "inline-block",left:item.left,width:item.dateProportion,  height: "100%",position:"absolute"}'
                                v-for="item in waring">
                          <div v-if="item.status == 22" style="z-index: 999;"
                               :style='{display: "inline-block",left:item.left,width:item.dateProportion,  height: "100%",position:"absolute"}'
                               v-for="item in waring">
                            <span
                              :style='{display: "inline-block",width:"100%", left:0, height: "68%", background: "#FD0008",position:"absolute",bottom:"0"}'></span>
                          </div>
@@ -150,7 +151,8 @@
        </a-tabs>
      </div>
    </div>
    <work-chart-model ref="workChartModel"></work-chart-model>
    <work-chart-model ref="workChartModel" :collectTime="this.queryParams.collectTime"
                      :equipment="this.equipment"></work-chart-model>
    <work-history-model ref="workHistoryModel"></work-history-model>
  </div>
</template>
@@ -176,17 +178,17 @@
    props: { equement: {} },
    data() {
      return {
        readOnly:true,
        readOnly: true,
        defaultId: '',
        defaultName: '',
        middleTime: '',
        queryParam:{},
        queryParam: {},
        queryParams: {
          collectTime:undefined,
          collectTime: undefined
        },
        loadingstayus:false,
        loadingrunStatus:false,
        loadingwarnStatus:false,
        loadingstayus: false,
        loadingrunStatus: false,
        loadingwarnStatus: false,
        normal: [],
        waring: [],
        normalList: [],
@@ -200,7 +202,7 @@
          getEquipmentByPid: '/mdc/mdcEquipment/getEquipmentByPid',
          list: '/mdc/mdcEquipmentRunningSection/logList'
        },
        ProStartId:''
        ProStartId: ''
      }
    },
    methods: {
@@ -223,27 +225,27 @@
      tabChange(val) {
        this.activeKey = val
      },
      disabledDate(current){
      disabledDate(current) {
        //Can not slect days before today and today
        return current && current > moment().subtract('days', 0);
        return current && current > moment().subtract('days', 0)
      },
      queryChart() {
        // this.normal = []
        // this.waring = []
        this.loadingstayus = true;
        this.loadingrunStatus = true;
        this.loadingstayus = true
        this.loadingrunStatus = true
        this.loadingwarnStatus = true
        getAction(this.url.list, this.queryParams).then((res) => {
          this.normalList = []
          this.waringList = []
          this.runList = []
          this.loadingstayus = false;
          this.loadingrunStatus = false;
          this.loadingstayus = false
          this.loadingrunStatus = false
          this.loadingwarnStatus = false
          this.normal = []
          this.waring = []
          if (res.success) {
            if(res.result != null){
            if (res.result != null) {
              for (let i = 0; i < res.result.length; i++) {
                this.normalList.push(res.result[i])
                if ('22' == res.result[i].status) {
@@ -253,11 +255,11 @@
                  res.result[i].left = leftTmp / 86400 * 100 + '%'
                  this.waring.push(res.result[i])
                }else if('3' == res.result[i].status){
                } else if ('3' == res.result[i].status) {
                  this.runList.push(res.result[i])
                  res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%'
                  this.normal.push(res.result[i])
                }else{
                } else {
                  res.result[i].dateProportion = res.result[i].duration / 86400 * 100 + '%'
                  this.normal.push(res.result[i])
                  // console.log(this.normal)
@@ -324,23 +326,23 @@
      },
      searchQuery() {
        // console.log(this.queryParams.collectTime)
        if(this.queryParams.collectTime != undefined){
        if (this.queryParams.collectTime != undefined) {
          this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
          if(!this.queryParams.equipmentId||!this.queryParams.equipmentName){
          if (!this.queryParams.equipmentId || !this.queryParams.equipmentName) {
            this.$notification.warning({
              message:'消息',
              description:"请选择设备"
            });
              message: '消息',
              description: '请选择设备'
            })
            return false
          }
          this.queryChart()
        }else{
        } else {
          // this.$message.warning("请选择时间")
          console.log('触发提示')
          this.$notification.warning({
            message:'消息',
            description:"请选择时间"
          });
            message: '消息',
            description: '请选择时间'
          })
        }
        // this.queryList()
      },
@@ -354,28 +356,29 @@
        // this.onClearSelected()
      },
      openWorkChart() {
        if(!this.equipment.equipmentId){
        if (!this.equipment.equipmentId) {
          // this.$message.warning("请选择设备进行查询")
          this.$notification.warning({
            message:'消息',
            description:"请选择设备进行查询"
          });
        }else{
            message: '消息',
            description: '请选择设备进行查询'
          })
        } else {
          // 判断是否点击设备日志表格行的数据,此时为点击表格数据为false
          this.$refs.workChartModel.isClicklogListRow = false
          this.$refs.workChartModel.add(this.equipment)
          this.$refs.workChartModel.title = '工作曲线'
        }
      },
      openHistoryChart() {
        // console.log(this.equipment);
        if(!this.equipment.equipmentId){
        if (!this.equipment.equipmentId) {
          // this.$message.warning("请选择设备进行查询")
          this.$notification.warning({
            message:'消息',
            description:"请选择设备进行查询"
          });
            message: '消息',
            description: '请选择设备进行查询'
          })
          // console.log(1111)
        } else{
        } else {
          this.$refs.workHistoryModel.add(this.equipment)
          this.$refs.workHistoryModel.title = '历史日志'
        }
@@ -386,13 +389,13 @@
        this.searchQuery()
      },
      dataAfter() {
        if((this.queryParams.collectTime).format('YYYY-MM-DD') ==  moment().format('YYYY-MM-DD')){
        if ((this.queryParams.collectTime).format('YYYY-MM-DD') == moment().format('YYYY-MM-DD')) {
          // this.$message.warning("请选择今天以及今天之前的日期!!")
          this.$notification.warning({
            message:'消息',
            description:'请选择今天以及今天之前的日期!!'
          });
        }else{
            message: '消息',
            description: '请选择今天以及今天之前的日期!!'
          })
        } else {
          this.queryParams.collectTime = moment(this.queryParams.collectTime.add(1, 'd'), 'YYYY-MM-DD')
          this.searchQuery()
        }
@@ -413,16 +416,16 @@
              this.equipment = {}
              // _this.$message.warning('请联系管理员,开放设备权限!')
              _this.$notification.warning({
                message:'消息',
                description:'请联系管理员,开放设备权限!'
              });
                message: '消息',
                description: '请联系管理员,开放设备权限!'
              })
            }
          }else{
          } else {
            // this.$message.warning(res.message)
            _this.$notification.warning({
              message:'消息',
              description:res.message
            });
              message: '消息',
              description: res.message
            })
          }
        })
@@ -431,13 +434,12 @@
    created() {
      this.queryParams.collectTime = moment()
      this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
      this.initEquipment();
      this.initEquipment()
      // this.queryTreeData();
    },
    watch: {
      equement(val) {
        console.log('通过watch触发')
        if (val && val.equipmentId) {
          this.$set(this.queryParams, 'equipmentName', val.equipmentName)
          this.$set(this.queryParams, 'equipmentId', val.equipmentId)
@@ -492,7 +494,8 @@
  #mdcLogShow > div {
    flex: 1;
  }
  /*.mdcLogShowOne{*/
    /*position: absolute;*/
  /*position: absolute;*/
  /*}*/
</style>