Lius
18 小时以前 54c22f2f0e98c35e48cdad6c4d0299d08beea630
update
已修改3个文件
190 ■■■■■ 文件已修改
src/views/mdc/base/modules/EquipmentList/UserModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/GradeSignage/EquipmentSignage.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -31,7 +31,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="安装位置">
              <a-input :disabled="disableSubmit || model.id" allow-clear placeholder="请输入安装位置"
              <a-input allow-clear placeholder="请输入安装位置"
                       v-model="model.equipmentName"/>
            </a-form-model-item>
          </a-col>
src/views/mdc/base/modules/EquipmentStandbyShutDown/EquipmentStandbyShutdownModal.vue
@@ -1,5 +1,5 @@
<template>
  <a-modal :title="title" :width="500" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
  <a-modal :title="title" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleOk"
           @cancel="handleCancel" cancelText="关闭">
    <a-spin :spinning="spinning">
      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelColLong"
@@ -40,18 +40,29 @@
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item label="停机日期" prop="theDate">
              <a-date-picker v-model="model.theDate" placeholder="请选择停机日期" value-format="YYYY-MM-DD"
            <a-form-model-item v-if="title === '编辑'" label="停机日期" prop="theDate">
              <a-date-picker :disabled="true" v-model="model.theDate" placeholder="请选择停机日期"
                             value-format="YYYY-MM-DD"
                             style="width: 100%"/>
            </a-form-model-item>
          </a-col>
            <a-form-item v-if="title === '新增'" label="停机日期" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
              <div class="mainBox">
                <Calendar
                  v-on:choseDay="clickDay"
                  :markDate="shiData"
                  :agoDayHide="value"
                ></Calendar>
              </div>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-model-item label="停机时长(min)" prop="downLong">
              <a-input-number v-model="model.downLong" :min="1" :step="1" :precision="0" placeholder="请输入停机时长(min)"
              <a-input-number v-model="model.downLong" :min="1" :step="1" :precision="0"
                              placeholder="请输入停机时长(min)"
                              style="width: 100%"/>
            </a-form-model-item>
          </a-col>
@@ -85,17 +96,19 @@
</template>
<script>
import Calendar from 'vue-calendar-component'
  import { getAction, postAction } from '@api/manage'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'EquipmentStandbyShutdownModal',
    components: { SelectDeviceDrawer },
  components: { SelectDeviceDrawer, Calendar },
    props: {},
    data() {
      return {
        title: '',
        visible: false,
      value: '',
        model: {},
        equipmentList: [],
        downtimeDescriptionList: [],
@@ -131,11 +144,14 @@
          add: '/mdc/mdcDowntime/add',
          edit: '/mdc/mdcDowntime/edit',
          getDowntimeDescriptionListByDowntimeType: '/mdc/mdcDowntimeReason/downtimeReasonList'
        }
      },
      shiData: [],
      sendDte: []
      }
    },
    methods: {
      add() {
      this.resetSelect()
        this.edit({
          downtimeType: 0
        })
@@ -175,7 +191,6 @@
      handleOk() {
        const that = this
        // 触发表单验证
        console.log('model', this.model)
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = that.spinning = true
@@ -185,6 +200,8 @@
            } else {
              url = that.url.edit
            }
          that.model.dateList = this.sendDte
          if (that.model.dateList && that.model.dateList.length > 0) {
            postAction(url, that.model)
              .then((res) => {
                if (res.success) {
@@ -205,7 +222,12 @@
                that.confirmLoading = that.spinning = false
              })
          } else {
            return false
            that.confirmLoading = false
            that.$notification.warning({
              message: '消息',
              description: '请选择生效时间!'
            })
          }
          }
        })
      },
@@ -230,16 +252,151 @@
        this.visible = false
        this.removeValidate()
      },
      // 关闭弹窗时清楚表单校验
      removeValidate() {
        if (this.$refs.form) this.$refs.form.clearValidate()
    },
    resetSelect() {//重置选中的日期
      this.selectDate = []
      this.shiData = []
      this.sendDte = []
    },
    fun(obj) {
      console.log(obj)
      if (obj) {
        if (obj = obj.split('/')) {
          var timShi = obj[1]
          var timFen = obj[2]
          if (timShi < 10) {
            timShi = '0' + timShi
          }
          if (timFen < 10) {
            timFen = '0' + timFen
          }
          var dd = (obj[0] + timShi + timFen)
          return dd
        }
      }
    },
    clickDay(today) {//选中日期
      let existDate = this.selectDate
      let isExist = true
      for (var i = 0; i < existDate.length; i++) {
        if (existDate[i].date === today) {
          this.selectDate.splice(i, 1)
          this.shiData.splice(i, 1)
          this.sendDte.splice(i, 1)
          isExist = false
        }
      }
      if (isExist) {//当前日期存在移除
        let tempDate = { date: today, className: 'mark1' }
        // let ddd = this.fun(today)
        let ddd = today
        let ccc = this.fun(today)
        this.selectDate.push(tempDate)
        this.shiData.push(ddd)
        this.sendDte.push(ccc)
      }
      }
    }
  }
</script>
<style scoped lang="less">
/deep/ .ant-modal-close {
  color: #1191b0;
  font-size: 24px;
}
/deep/ .ant-modal-close-x {
  font-size: 24px;
}
.ant-btn {
  padding: 0 10px;
  margin-left: 3px;
}
.ant-form-item-control {
  line-height: 0px;
}
/** 主表单行间距 */
.ant-form .ant-form-item {
  margin-bottom: 10px;
}
/** Tab页面行间距 */
.ant-tabs-content .ant-form-item {
  margin-bottom: 0px;
}
/deep/ .mark1 {
  color: white !important;
  background-color: #1890ff !important;
  border-radius: 50%;
}
/deep/ .mainBox .wh_content_all {
  background-color: #ffffff;
  border: 1px silver solid;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}
/deep/ .mainBox .wh_content_all .wh_jiantou1 {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
}
/deep/ .mainBox .wh_content_all .wh_jiantou2 {
  border-top: 2px solid #000000;
  border-right: 2px solid #000000;
}
/deep/ .mainBox .wh_content_all .wh_top_changge li {
  color: black;
}
/deep/ .mainBox .wh_content_all .wh_content_item {
  margin-top: 5px;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_top_tag {
  color: #000000;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_item_date {
  color: #000000;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_item_date:hover {
  color: #1890ff;
  border: 1px solid #1890ff;
  border-radius: 50%;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_other_dayhide {
  color: #bfbfbf !important;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_want_dayhide {
  color: #bfbfbf !important;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_chose_day {
  background: #ffffff;
  color: #000000;
}
/deep/ .mainBox .wh_content_all .wh_content_item .wh_isMark {
  color: #ffffff;
  background-color: blue;
}
</style>
src/views/mdc/base/modules/GradeSignage/EquipmentSignage.vue
@@ -242,6 +242,7 @@
        rightBottomChart2: null,
        rightBottomChart3: null,
        rightBottomChart1Data: [],
        timingAcquisition: null,
        rightBottomChart2And3Data: [],
        chartQuantity: 3,
        hasLoadedChartDataQuantity: 0,
@@ -282,11 +283,19 @@
    mounted() {
      this.getEquipmentListByApi()
      this.handleWindowResize()
      // 组件挂载后启动定时器
      this.timingAcquisition = setInterval(() => {
        this.getEquipmentStatusAndInfoByApi()
      }, 2000)
      window.addEventListener('resize', this.handleWindowResize)
    },
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWatchHistory)
      // 组件销毁前清除定时器
      if (this.timingAcquisition) {
        clearInterval(this.timingAcquisition)
      }
    },
    methods: {
      getEquipmentListByApi() {
@@ -302,7 +311,7 @@
      getEquipmentStatusAndInfoByApi() {
        const that = this
        this.equipmentStatusAndInfoObj = {}
        //this.equipmentStatusAndInfoObj = {}
        signageApi.getEquipmentOperationStatusAndInfoApi(this.currentProductionId)
          .then(res => {
            if (res.success) {