1、车间看板页面实现鼠标悬浮于设备上出现设备详细信息弹窗,鼠标移出弹窗消失
2、设备参数阈值管理页面新增至mdc模块设备基础配置菜单下并完成所有布局及功能实现
已添加3个文件
已修改2个文件
2562 ■■■■■ 文件已修改
src/api/mdc.js 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/WorkshopSignage.vue 526 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/DeviceParamThresholdManagement.vue 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue 1538 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdc.js
@@ -4,7 +4,7 @@
  // -------------------------------------驱动参数管理页面----------------------------------------
  // èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
  getDriveTypeApi: () => getAction('/mdc/mdcDriveTypeParamConfig/getDriveParamOptions'),
  // -------------------------------------车间看板页面----------------------------------------
  // -------------------------------------车间看板页面--------------------------------------------
  // é¦–页获取大屏入口车间列表
  getWorkshopListInHomePageApi: () => getAction('/mdc/mdcWorkshopInfo/getWorkshopList'),
  // æ ¹æ®è½¦é—´id查询设备列表
@@ -30,5 +30,16 @@
  // åˆ é™¤å•个大屏车间和设备关系
  deleteSingleDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipment', params),
  // æ‰¹é‡åˆ é™¤å¤§å±è½¦é—´å’Œè®¾å¤‡å…³ç³»
  deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params)
  deleteBatchDeviceInWorkshopApi: params => deleteAction('/mdc/mdcWorkshopInfo/deleteWorkshopEquipmentBatch', params),
  // -------------------------------------设备参数阈值管理页面--------------------------------------------
  // æ ¹æ®é©±åŠ¨ç±»åž‹èŽ·å–å‚æ•°
  getParamListByDriveTypeApi: controlSystemType => getAction(`/mdc/mdcDriveTypeParamConfig/getDriveParamOptionsByType?controlSystemType=${controlSystemType}`),
  // å¢žåŠ è®¾å¤‡å‚æ•°é˜ˆå€¼
  addParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/add', params),
  // ç¼–辑设备参数阈值
  editParamThresholdApi: params => postAction('/mdc/mdcEquipmentThreshold/edit', params),
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteParamThresholdApi: id => deleteAction('/mdc/mdcEquipmentThreshold/delete', { id }),
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteBatchParamThresholdApi: ids => deleteAction('/mdc/mdcEquipmentThreshold/deleteBatch', { ids })
}
src/views/WorkshopSignage.vue
@@ -36,7 +36,8 @@
          :isResizable="isResizable"
          :stickSize="6"
        >
          <div class="single-device" :style="{ width: item.vw + 'px', height: item.vh + 'px' }">
          <div class="single-device" :style="{ width: item.vw + 'px', height: item.vh + 'px' }"
               @mouseenter="openDetail(item)">
            <div class="device-status">
              <div
                v-if="item.equipmentStatus == 2 || item.equipmentStatus == 1"
@@ -77,293 +78,318 @@
        </div>
      </div>
    </dv-border-box-8>
    <EquipmentDetailModal ref="EquipmentDetailModal"></EquipmentDetailModal>
  </dv-full-screen-container>
</template>
<script>
import VueDragResize from 'vue-drag-resize'
import api from '@/api/mdc'
import { getFileAccessHttpUrl } from '@/api/manage'
  import VueDragResize from 'vue-drag-resize'
  import api from '@/api/mdc'
  import { getFileAccessHttpUrl } from '@/api/manage'
  import EquipmentDetailModal from './mdc/base/modules/WorkshopSignage/EquipmentDetailModal'
  import { message } from 'ant-design-vue'
export default {
  components: {
    VueDragResize,
  },
  data() {
    return {
      workshopDetails: {}, //  è½¦é—´è¯¦ç»†ä¿¡æ¯,
      isDraggable: false, // æ˜¯å¦å¼€å¯æ‹–拽
      isResizable: false, // æ˜¯å¦å¼€å¯ç¼©æ”¾
      isSwitchChecked: false, // æ˜¯å¦å¼€å¯åŠŸèƒ½
      timingAcquisition: null, // å®šæ—¶åˆ·æ–°æ˜¯å¦å¼€å¯
      deviceList: [
        // {
        //   equipmentId: '123213213123232',// è®¾å¤‡ID
        //   equipmentImage: require('@/assets/8.png'), // è®¾å¤‡å›¾ç‰‡
        //   coordinateTop: 200, // æ‹–拽元素距盒子顶距离
        //   coordinateLeft: 100, // æ‹–拽元素距盒子左侧距离
        //   vw: 100,  // ç¼©æ”¾å…ƒç´ å®½åº¦
        //   vh: 100, // ç¼©æ”¾å…ƒç´ é«˜åº¦
        //   fontSize: 12, // ç¼©æ”¾å…ƒç´ å­—体大小
        //   equipmentStatus: 1 // è®¾å¤‡çŠ¶æ€ 0:关机 22:报警 2:待机 3:运行 å¼€æœº:1(没有四色灯标识归为待机)
        // }
      ], // è®¾å¤‡ä¿¡æ¯åˆ—表
      deviceStatusList: [
        {
          label: '关机',
          value: 0,
          color: '#A8A8A8',
        },
        {
          label: '待机',
          value: 2,
          color: '#FFFF00',
        },
        {
          label: '运行',
          value: 3,
          color: '#00EE00',
        },
        {
          label: '报警',
          value: 22,
          color: '#FF0000',
        },
      ], // è®¾å¤‡çŠ¶æ€æŒ‡ç¤ºç¯åˆ—è¡¨
    }
  },
  watch: {
    isSwitchChecked: {
      handler(newVal) {
        if (!newVal) {
          console.log('定时器开启中')
          this.timingAcquisition = setInterval(() => {
            this.getDeviceListByApi(this.$route.params.id)
          }, 2000)
        } else {
          console.log('关闭定时器')
          clearInterval(this.timingAcquisition)
          this.timingAcquisition = null
        }
      },
      immediate: true,
    },
  },
  methods: {
    /**
     * é€šè¿‡è½¦é—´Id调用接口获取设备信息列表
     * @param id è½¦é—´Id
     */
    getDeviceListByApi(id) {
      console.log('重新刷新')
      api.getDeviceListInWorkshopSignagePageApi(id).then((res) => {
        if (res.result && res.result.length > 0) {
          this.deviceList = res.result
        }
      })
    },
  message.config({
    maxCount: 3
  })
    /**
     * é€šè¿‡è½¦é—´Id调用接口获取车间详细信息
     * @param id è½¦é—´Id
     */
    getWorkshopDetailsByApi(id) {
      api.getWorkshopDetailByWorkshopIdApi(id).then((res) => {
        this.workshopDetails = res.result
        this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView(
          this.workshopDetails.backgroundImage
        )})`
      })
  export default {
    components: {
      VueDragResize,
      EquipmentDetailModal
    },
    /**
     * å›¾ç‰‡é¢„览
     * @param text å›¾ç‰‡åœ°å€
     */
    getImgView(text) {
      if (text && text.indexOf(',') > 0) {
        text = text.substring(0, text.indexOf(','))
    data() {
      return {
        workshopDetails: {}, //  è½¦é—´è¯¦ç»†ä¿¡æ¯,
        isDraggable: false, // æ˜¯å¦å¼€å¯æ‹–拽
        isResizable: false, // æ˜¯å¦å¼€å¯ç¼©æ”¾
        isSwitchChecked: false, // æ˜¯å¦å¼€å¯åŠŸèƒ½
        timingAcquisition: null, // å®šæ—¶åˆ·æ–°æ˜¯å¦å¼€å¯
        deviceList: [
          // {
          //   equipmentId: '123213213123232',// è®¾å¤‡ID
          //   equipmentImage: require('@/assets/8.png'), // è®¾å¤‡å›¾ç‰‡
          //   coordinateTop: 200, // æ‹–拽元素距盒子顶距离
          //   coordinateLeft: 100, // æ‹–拽元素距盒子左侧距离
          //   vw: 100,  // ç¼©æ”¾å…ƒç´ å®½åº¦
          //   vh: 100, // ç¼©æ”¾å…ƒç´ é«˜åº¦
          //   fontSize: 12, // ç¼©æ”¾å…ƒç´ å­—体大小
          //   equipmentStatus: 1 // è®¾å¤‡çŠ¶æ€ 0:关机 22:报警 2:待机 3:运行 å¼€æœº:1(没有四色灯标识归为待机)
          // }
        ], // è®¾å¤‡ä¿¡æ¯åˆ—表
        deviceStatusList: [
          {
            label: '关机',
            value: 0,
            color: '#A8A8A8'
          },
          {
            label: '待机',
            value: 2,
            color: '#FFFF00'
          },
          {
            label: '运行',
            value: 3,
            color: '#00EE00'
          },
          {
            label: '报警',
            value: 22,
            color: '#FF0000'
          }
        ] // è®¾å¤‡çŠ¶æ€æŒ‡ç¤ºç¯åˆ—è¡¨
      }
      return getFileAccessHttpUrl(text)
    },
    /**
     * ç‚¹å‡»ä¿å­˜æŒ‰é’®è°ƒç”¨æŽ¥å£ä¿å­˜æ‹–拽后的位置与设备图标尺寸
     */
    saveDevicePositionAndSizeByApi() {
      console.log('触发保存')
      if (this.isOperatingDevice) {
        api.saveDevicePositionAndSizeApi(this.deviceList).then((res) => {
          if (res.code === 200) {
            this.$notification.success({
              message: '消息',
              description: res.message,
            })
            this.isOperatingDevice = false
            if (this.isSwitchChecked) {
              this.isSwitchChecked = false
              this.isResizable = !this.isResizable
              this.isDraggable = !this.isDraggable
            }
            this.getDeviceListByApi(this.$route.params.id)
    watch: {
      isSwitchChecked: {
        handler(newVal) {
          if (!newVal) {
            console.log('定时器开启中')
            this.timingAcquisition = setInterval(() => {
              this.getDeviceListByApi(this.$route.params.id)
            }, 2000)
          } else {
            console.log('关闭定时器')
            clearInterval(this.timingAcquisition)
            this.timingAcquisition = null
          }
        },
        immediate: true
      }
    },
    methods: {
      /**
       * é€šè¿‡è½¦é—´Id调用接口获取设备信息列表
       * @param id è½¦é—´Id
       */
      getDeviceListByApi(id) {
        console.log('重新刷新')
        api.getDeviceListInWorkshopSignagePageApi(id).then((res) => {
          if (res.result && res.result.length > 0) {
            this.deviceList = res.result
          }
        })
      } else {
        this.$notification.warning({
          message: '消息',
          description: '请开启功能后再进行保存',
      },
      /**
       * é€šè¿‡è½¦é—´Id调用接口获取车间详细信息
       * @param id è½¦é—´Id
       */
      getWorkshopDetailsByApi(id) {
        api.getWorkshopDetailByWorkshopIdApi(id).then((res) => {
          this.workshopDetails = res.result
          this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView(
            this.workshopDetails.backgroundImage
          )})`
        })
      },
      /**
       * å›¾ç‰‡é¢„览
       * @param text å›¾ç‰‡åœ°å€
       */
      getImgView(text) {
        if (text && text.indexOf(',') > 0) {
          text = text.substring(0, text.indexOf(','))
        }
        return getFileAccessHttpUrl(text)
      },
      /**
       * ç‚¹å‡»ä¿å­˜æŒ‰é’®è°ƒç”¨æŽ¥å£ä¿å­˜æ‹–拽后的位置与设备图标尺寸
       */
      saveDevicePositionAndSizeByApi() {
        console.log('触发保存')
        if (this.isOperatingDevice) {
          api.saveDevicePositionAndSizeApi(this.deviceList).then((res) => {
            if (res.code === 200) {
              this.$notification.success({
                message: '消息',
                description: res.message
              })
              this.isOperatingDevice = false
              if (this.isSwitchChecked) {
                this.isSwitchChecked = false
                this.isResizable = !this.isResizable
                this.isDraggable = !this.isDraggable
              }
              this.getDeviceListByApi(this.$route.params.id)
            }
          })
        } else {
          this.$notification.warning({
            message: '消息',
            description: '请开启功能后再进行保存'
          })
        }
      },
      /**
       * è®¾å¤‡æ‹–拽或缩放时触发事件
       * @param newRect æ‹–拽或缩放后的尺寸及距离
       * @param index æ‹–拽设备在数组中的下标
       */
      resize(newRect, index) {
        // if (newRect.width > 100) {
        //   if (newRect.width / newRect.height < 2) {
        //     this.deviceList[index].fontSize = newRect.width / 10
        //   } else {
        //     this.deviceList[index].fontSize = newRect.height / 5
        //   }
        // } else {
        //   this.deviceList[index].fontSize = 12
        // }
        this.deviceList[index].vw = newRect.width
        this.deviceList[index].vh = newRect.height
        this.deviceList[index].coordinateTop = newRect.top
        this.deviceList[index].coordinateLeft = newRect.left
      },
      /**
       * æ ¹æ®è®¾å¤‡çŠ¶æ€å€¼èŽ·å–å¯¹åº”è®¾å¤‡æ•°é‡
       * @param value è®¾å¤‡çŠ¶æ€å€¼
       * @returns {number} è®¾å¤‡æ•°é‡
       */
      getDeviceNumberByStatus(value) {
        return this.deviceList.filter((item) => item.equipmentStatus === value).length
      },
      /**
       * å¼€å¯åŠŸèƒ½è§¦å‘äº‹ä»¶
       * @param checked å½“前switch状态,是否开启,初始为false
       */
      handleSwitchChange(checked) {
        this.isOperatingDevice = true
        this.isResizable = !this.isResizable
        this.isDraggable = !this.isDraggable
      },
      openDetail(item) {
        if (item.equipmentStatus == 0) {
          // this.$message.warn("设备处于关机状态!");
          this.$message.warning('设备处于关机状态!')
          return false
        }
        console.log(item)
        console.log(this.$refs.EquipmentDetailModal)
        this.$refs.EquipmentDetailModal.initData(item.equId)
        this.$refs.EquipmentDetailModal.timerModel(item.equId)
        // this.equipMessageTimer = setInterval(() => {
        //   setTimeout( this.$refs.equmentDetaiModel.initData(item.equipmentId),0)
        // },1000*10)
      },
    },
    created() {
      if (this.$route.params.id) {
        this.getDeviceListByApi(this.$route.params.id)
        this.getWorkshopDetailsByApi(this.$route.params.id)
      }
    },
    /**
     * è®¾å¤‡æ‹–拽或缩放时触发事件
     * @param newRect æ‹–拽或缩放后的尺寸及距离
     * @param index æ‹–拽设备在数组中的下标
     */
    resize(newRect, index) {
      // if (newRect.width > 100) {
      //   if (newRect.width / newRect.height < 2) {
      //     this.deviceList[index].fontSize = newRect.width / 10
      //   } else {
      //     this.deviceList[index].fontSize = newRect.height / 5
      //   }
      // } else {
      //   this.deviceList[index].fontSize = 12
      // }
      this.deviceList[index].vw = newRect.width
      this.deviceList[index].vh = newRect.height
      this.deviceList[index].coordinateTop = newRect.top
      this.deviceList[index].coordinateLeft = newRect.left
    mounted() {
      // ç¦æ­¢ç”¨æˆ·é€‰ä¸­å†…容
      document.onselectstart = () => false
    },
    /**
     * æ ¹æ®è®¾å¤‡çŠ¶æ€å€¼èŽ·å–å¯¹åº”è®¾å¤‡æ•°é‡
     * @param value è®¾å¤‡çŠ¶æ€å€¼
     * @returns {number} è®¾å¤‡æ•°é‡
     */
    getDeviceNumberByStatus(value) {
      return this.deviceList.filter((item) => item.equipmentStatus === value).length
    },
    /**
     * å¼€å¯åŠŸèƒ½è§¦å‘äº‹ä»¶
     * @param checked å½“前switch状态,是否开启,初始为false
     */
    handleSwitchChange(checked) {
      this.isOperatingDevice = true
      this.isResizable = !this.isResizable
      this.isDraggable = !this.isDraggable
    },
  },
  created() {
    if (this.$route.params.id) {
      this.getDeviceListByApi(this.$route.params.id)
      this.getWorkshopDetailsByApi(this.$route.params.id)
    beforeDestroy() {
      // ç¡®ä¿é”€æ¯å®šæ—¶å™¨åŠå›žæ”¶èµ„源
      clearInterval(this.timingAcquisition)
      this.timingAcquisition = null
    }
  },
  mounted() {
    // ç¦æ­¢ç”¨æˆ·é€‰ä¸­å†…容
    document.onselectstart = () => false
  },
  beforeDestroy() {
    // ç¡®ä¿é”€æ¯å®šæ—¶å™¨åŠå›žæ”¶èµ„源
    clearInterval(this.timingAcquisition)
    this.timingAcquisition = null
  },
}
  }
</script>
<style scoped lang="less">
.full-screen-container {
  background-image: url('../assets/Bj.jpg');
  background-size: 100% 100%;
  color: #fff;
  .page-header {
    height: 80px;
    font-size: 50px;
    text-align: center;
    position: relative;
    .header-right {
      width: 450px;
      position: absolute;
      right: 0px;
      top: 35px;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
      font-size: 16px;
    }
  }
  .content-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
  .full-screen-container {
    background-image: url('../assets/Bj.jpg');
    background-size: 100% 100%;
    color: #fff;
    .device-status-info {
      width: 400px;
      position: absolute;
      top: 5px;
      right: 5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    .page-header {
      height: 80px;
      font-size: 50px;
      text-align: center;
      position: relative;
      .single-status-info {
        width: 60px;
      .header-right {
        width: 450px;
        position: absolute;
        right: 0px;
        top: 35px;
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        font-size: 16px;
      }
    }
    .content-container {
      position: relative;
      width: 100%;
      height: 100%;
      background-repeat: no-repeat;
      background-size: 100% 100%;
      .device-status-info {
        width: 400px;
        position: absolute;
        top: 5px;
        right: 5px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .status-square {
          width: 14px;
          height: 14px;
          border: 1px solid #fff;
          border-radius: 2px;
        .single-status-info {
          width: 60px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          .status-square {
            width: 14px;
            height: 14px;
            border: 1px solid #fff;
            border-radius: 2px;
          }
        }
      }
    }
    .single-device {
      position: absolute;
      border: 1px solid transparent;
      padding: 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      cursor: default;
      &:active {
        border: 1px solid #1890ff;
      }
      .device-status {
        width: 100%;
        height: 100%;
      .single-device {
        position: absolute;
        border: 1px solid transparent;
        padding: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        cursor: default;
        .status-image {
          background-size: 100% 100%;
          background-repeat: no-repeat;
          width: 45px;
          margin-right: 10px;
        &:active {
          border: 1px solid #1890ff;
        }
        .device-image {
          background-size: 100% 100%;
          background-repeat: no-repeat;
        .device-status {
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: space-between;
          .status-image {
            background-size: 100% 100%;
            background-repeat: no-repeat;
            width: 45px;
            margin-right: 10px;
          }
          .device-image {
            background-size: 100% 100%;
            background-repeat: no-repeat;
            width: 100%;
            height: 100%;
          }
        }
      }
    }
  }
}
</style>
src/views/mdc/base/DeviceParamThresholdManagement.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,232 @@
<template>
  <a-card :bordered="false">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="12">
            <a-form-item label="中文名">
              <j-input placeholder="请输入中文名" v-model="queryParam.chineseName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="英文名">
              <j-input placeholder="请输入英文名" v-model="queryParam.englishName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="驱动类型">
              <a-auto-complete
                v-model="queryParam.controlSystemType"
                :data-source="driveTypeList"
                placeholder="请选择控制系统类型"
                :filter-option="filterOption"
              />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" style="border-top: 5px">
      <a-button @click="handleAdd" type="primary" icon="plus">添加参数阈值</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay" @click="handleMenuClick">
          <a-menu-item key="1">
            <a-icon type="delete" @click="batchDel"/>
            åˆ é™¤
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px">
          æ‰¹é‡æ“ä½œ
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{
        selectedRowKeys.length }}</a>项&nbsp;&nbsp;
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        bordered
        size="middle"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <template slot="avatarslot" slot-scope="text, record, index">
          <div class="anty-img-wrap">
            <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
          </div>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical"/>
          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <ParamThresholdModal ref="modalForm" @ok="modalFormOk" :driveTypeList="driveTypeList"/>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import api from '@/api/mdc'
  import ParamThresholdModal from './modules/DeviceParamThresholdManagement/ParamThresholdModal'
  export default {
    name: 'EquipmentList',
    mixins: [JeecgListMixin],
    components: {
      ParamThresholdModal
    },
    data() {
      return {
        name: 'DeviceParamThresholdManagement',
        description: '这是设备参数阈值管理页面',
        queryParam: {},
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '中文名',
            align: 'center',
            dataIndex: 'chineseName',
            width: 120
            // sorter: true
          },
          {
            title: '英文名',
            align: 'center',
            width: 150,
            dataIndex: 'englishName'
          },
          {
            title: '驱动类型',
            align: 'center',
            width: 180,
            dataIndex: 'controlSystemType'
          },
          {
            title: '阈值上限',
            align: 'center',
            width: 120,
            dataIndex: 'maxThreshold'
            // scopedSlots: {customRender: "avatarslot"}
          },
          {
            title: '阈值下限',
            align: 'center',
            width: 80,
            dataIndex: 'minThreshold'
            // sorter: true
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: { customRender: 'action' },
            align: 'center',
            width: 120
          }
        ],
        driveTypeList: [],
        url: {
          list: '/mdc/mdcEquipmentThreshold/list',
          delete: '/mdc/mdcEquipmentThreshold/delete',
          deleteBatch: '/mdc/mdcEquipmentThreshold/deleteBatch'
        }
      }
    },
    created() {
      this.getDriveTypeByApi()
    },
    methods: {
      handleEdit: function(record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        // è°ƒç”¨æŠ½å±‰è¡¨å•组件中的清除表单验证方法
        this.$refs.modalForm.removeValidate()
      },
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '新增'
      },
      handleMenuClick(e) {
        if (e.key == 1) {
          this.batchDel()
        } else if (e.key == 2) {
          this.batchFrozen(2)
        } else if (e.key == 3) {
          this.batchFrozen(1)
        }
      },
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
       */
      getDriveTypeByApi() {
        api.getDriveTypeApi().then((res) => {
          this.driveTypeList = res.result.map(item => item.value)
        })
      },
      /**
       * è”想输入框筛选功能
       * @param input è¾“入的内容
       * @param option é…ç½®
       * @returns {boolean} åˆ¤æ–­æ˜¯å¦ç­›é€‰
       */
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
        )
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>
src/views/mdc/base/modules/DeviceParamThresholdManagement/ParamThresholdModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,251 @@
<template>
  <a-modal
    :title="title"
    :maskClosable="true"
    :width="modalWidth"
    @cancel="visible=false"
    :visible="visible">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
                    :wrapperCol="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="controlSystemType" label="驱动类型">
              <a-select v-model="model.controlSystemType" @change="handleDriveTypeChange"
                        placeholder="请选择驱动类型">
                <a-select-option v-for="(item,index) in driveTypeList" :key="index" :value="item">
                  {{item}}
                </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="chineseName" label="参数">
              <a-select v-model="model.chineseName" placeholder="请选择参数">
                <a-select-option v-for="item in paramList" :key="item.value" :value="item.value">
                  {{item.label}}
                </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="maxThreshold" label="阈值上限">
              <a-input v-model="model.maxThreshold" placeholder="请输入阈值上限"></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="minThreshold" label="阈值下限">
              <a-input v-model="model.minThreshold" placeholder="请输入阈值下限"></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
    <template slot="footer">
      <a-popconfirm title="确定放弃操作?" @confirm="visible=false" okText="确定" cancelText="取消">
        <a-button style="margin-right: .8rem">取消</a-button>
      </a-popconfirm>
      <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
    </template>
  </a-modal>
</template>
<script>
  import pick from 'lodash.pick'
  import api from '@/api/mdc'
  export default {
    name: 'ParamThresholdModal',
    components: {},
    props: {
      driveTypeList: {
        type: Array
      }
    },
    data() {
      return {
        modalWidth: 700,
        form: this.$form.createForm(this),
        validatorRules: {
          controlSystemType: [
            {
              required: true, message: '请选择驱动类型'
            }
          ],
          chineseName: [
            {
              required: true, message: '请选择参数'
            }
          ],
          minThreshold: [
            {
              required: true, message: '请输入阈值上限'
            },
            {
              pattern: /^[0-9]+$/,
              message: '请输入阿拉伯数字'
            }
          ],
          maxThreshold: [
            {
              required: true, message: '请输入阈值下限'
            },
            {
              pattern: /^[0-9]+$/,
              message: '请输入阿拉伯数字'
            }
          ]
        },
        title: '操作',
        visible: false,
        model: {
          controlSystemType: '',
          chineseName: '',
          minThreshold: '',
          maxThreshold: ''
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 15 }
        },
        confirmLoading: false,
        url: {
          userId: '/sys/user/generateUserId' // å¼•入生成添加用户情况下的url
        },
        paramList: []
      }
    },
    created() {
    },
    methods: {
      add() {
        this.visible = true
        this.model = {
          controlSystemType: '',
          chineseName: '',
          minThreshold: '',
          maxThreshold: ''
        }
        this.paramList = []
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model, 'controlSystemType', 'chineseName', 'minThreshold', 'maxThreshold'))
        })
      },
      edit(record) {
        this.visible = true
        this.model = Object.assign({}, record)
        api.getParamListByDriveTypeApi(record.controlSystemType)
          .then(res => {
            if (res.success) {
              this.paramList = res.result
            }
          })
        this.model.chineseName = `${record.englishName}(${record.chineseName})`
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model, 'controlSystemType', 'chineseName', 'minThreshold', 'maxThreshold'))
        })
      },
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            if (this.model.maxThreshold > this.model.minThreshold) {
              that.confirmLoading = true
              let obj
              if (this.title == '新增') {
                obj = api.addParamThresholdApi(this.model)
              } else {
                obj = api.editParamThresholdApi(this.model)
              }
              obj.then((res) => {
                if (res.success) {
                  that.$notification.success({
                    message: '消息',
                    description: res.message
                  })
                  that.$emit('ok')
                } else {
                  that.$notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              }).finally(() => {
                that.confirmLoading = false
                this.visible = false
              })
            } else {
              this.$notification.warning({
                message: '消息',
                description: '阈值上限不能小于等于阈值下限'
              })
            }
          } else {
            return false
          }
        })
      },
      /**
       * è”想输入框筛选功能
       * @param input è¾“入的内容
       * @param option é…ç½®
       * @returns {boolean} åˆ¤æ–­æ˜¯å¦ç­›é€‰
       */
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
        )
      },
      /**
       * é©±åŠ¨å‚æ•°ç±»åž‹é€‰ä¸­åŽæ¸²æŸ“ç›¸åº”çš„å‚æ•°åˆ—è¡¨
       * @param value é©±åŠ¨å‚æ•°ç±»åž‹é€‰ä¸­é¡¹
       */
      handleDriveTypeChange(value) {
        api.getParamListByDriveTypeApi(value)
          .then(res => {
            if (res.success) {
              this.paramList = res.result
              this.model.chineseName = res.result.length ? res.result[0].value : ''
              if (this.model.chineseName) this.$refs.form.clearValidate('chineseName')
            }
          })
      },
      /**
       * ç¼–辑或查看详情数据时清除抽屉表单验证
       */
      removeValidate() {
        if (this.$refs.form) this.$refs.form.clearValidate()
      }
    }
  }
</script>
<style scoped>
</style>
src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1538 @@
<template>
  <div ref="wrap" @mouseenter="getModalNode">
    <a-modal
      :title="title"
      width="70%"
      :visible="visible"
      :getContainer="() => this.$refs.wrap"
      @cancel="handleCancel"
      cancelText="关闭"
      wrap-class-name="full-modal"
      centered
      :closable="false"
      :footer="null"
    >
      <div
        id="mdcEquiInfo"
        style="padding:1px;"
      >
        <table
          width="100%"
          style="border-collapse: separate;border-spacing:0px; color: #fff"
        >
          <tr>
            <td v-if="this.spindlebeilv != null">
              <div
                class="mdcEquipMon"
                style="width: 250px; height: 200px;margin : 0 auto;padding: 0;"
                align="center"
              >
                ä¸»è½´å€çއ
                <div
                  id="mdcEquiMoniGauge1"
                  ref="chart1"
                  style="width: 100%; height: 95%;"
                ></div>
              </div>
            </td>
            <td v-if="this.feedbeilv != null">
              <div
                class="mdcEquipMon"
                style="width: 210px; height: 180px;margin : 0 auto;"
                align="center"
              >
                è¿›ç»™å€çއ
                <div
                  id="mdcEquiMoniGauge2"
                  ref="chart2"
                  style="width: 100%; height: 95%;"
                ></div>
              </div>
            </td>
            <td v-if="this.spindleload != null">
              <div
                class="mdcEquipMon"
                style="width: 210px; height: 180px;margin : 0 auto;"
                align="center"
              >主轴负荷
                <div
                  id="mdcEquiMoniGauge3"
                  ref="mdcEquiMoniGauge3"
                  style="width: 100%; height: 95%;"
                ></div>
              </div>
            </td>
            <td v-if="this.rapidfeed != null">
              <div
                class="mdcEquipMon"
                style="width: 210px; height: 180px;margin : 0 auto;"
                align="center"
              >快速进给倍率
                <div
                  id="mdcEquiMoniGauge4"
                  ref="mdcEquiMoniGauge4"
                  style="width: 100%; height: 95%;"
                ></div>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="5">
              <a-descriptions
                title="基础信息"
                :column="4"
              >
                <a-descriptions-item label="设备编号">{{resultData.equipmentID}}</a-descriptions-item>
                <a-descriptions-item label="设备名称">{{resultData.equipmentName}}</a-descriptions-item>
                <a-descriptions-item label="IP地址">{{resultData.equipmentIP}}</a-descriptions-item>
                <a-descriptions-item label="端口号">{{resultData.dataPort}}</a-descriptions-item>
                <a-descriptions-item label="系统版本号">{{resultData.SystemVersion}}</a-descriptions-item>
                <a-descriptions-item label="驱动类型">{{resultData.driveType}}</a-descriptions-item>
                <a-descriptions-item label="系统型号">{{resultData.SystemType}}</a-descriptions-item>
                <a-descriptions-item label="设备类型">{{resultData.deviceType}}</a-descriptions-item>
                <a-descriptions-item label="设备功率">{{resultData.devicePower}}</a-descriptions-item>
                <a-descriptions-item label="有效轴数">{{resultData.ValidAxis}}</a-descriptions-item>
                <a-descriptions-item label="最大轴数">{{resultData.MaxAxis}}</a-descriptions-item>
                <a-descriptions-item label="备注">{{resultData.remark}}</a-descriptions-item>
              </a-descriptions>
              <!-- <a-descriptions
                title="运行数据"
                v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' "
                :column="4"
              >
                <a-descriptions-item label="主轴倍率(%)">{{resultData.spindlebeilv}}</a-descriptions-item>
                <a-descriptions-item label="进给倍率(%)">{{resultData.feedbeilv}}</a-descriptions-item>
                <a-descriptions-item label="主轴负荷(%)">{{resultData.spindleload}}</a-descriptions-item>
                <a-descriptions-item label="主轴转速(rpm)">{{resultData.spindlespeed}}</a-descriptions-item>
                <a-descriptions-item label="进给速度(mm/min)">{{resultData.feedrate}}</a-descriptions-item>
              </a-descriptions>
              <a-descriptions
                title="运行数据 for lsv2"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="主轴倍率(%)">{{resultData.spindlebeilv}}</a-descriptions-item>
                <a-descriptions-item label="设备正常运行时间">{{resultData.equipmentNormalTime}}</a-descriptions-item>
                <a-descriptions-item label="快速进给倍率(%)">{{resultData.rapidfeed}}</a-descriptions-item>
                <a-descriptions-item label="NC正常运行时间">{{resultData.nCNormalTime}}</a-descriptions-item>
                <a-descriptions-item label="进给倍率(%)">{{resultData.feedbeilv}}</a-descriptions-item>
                <a-descriptions-item label="设备运行时间">{{resultData.equipmentTime}}</a-descriptions-item>
                <a-descriptions-item label="当前刀具号">{{resultData.toolNum}}</a-descriptions-item>
              </a-descriptions> -->
              <!-- <a-descriptions
                title="程序信息"
                v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' "
                :column="4"
              >
                <a-descriptions-item label="序列号">{{resultData.sequencenumber}}</a-descriptions-item>
                <a-descriptions-item
                  label="当前执行代码"
                  :span="2"
                >{{resultData.executingcode}}</a-descriptions-item>
                <a-descriptions-item label="工件名称">{{resultData.productName}}</a-descriptions-item>
              </a-descriptions> -->
              <!-- <a-descriptions
                title="程序信息  for lsv2"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="当前程序">{{resultData.program}}</a-descriptions-item>
                <a-descriptions-item label="程序执行点">{{resultData.programPosition}}</a-descriptions-item>
                <a-descriptions-item label="操作模式">{{resultData.operationType}}</a-descriptions-item>
                <a-descriptions-item label="错误信息编号一">{{resultData.firstErrorNum}}</a-descriptions-item>
                <a-descriptions-item label="错误信息一">{{resultData.firstError}}</a-descriptions-item>
                <a-descriptions-item label="错误信息">{{resultData.errorinfo}}</a-descriptions-item>
                <a-descriptions-item label="错误信息编号二">{{resultData.secondErrorNum}}</a-descriptions-item>
                <a-descriptions-item label="错误信息二">{{resultData.secondError}}</a-descriptions-item>
              </a-descriptions> -->
              <!--<a-descriptions
                title="轴监控数据 fro SIEMENS840DSL"
                v-if="driverType == 'SIEMENS840DSL'"
                :column="4"
              >
                <a-descriptions-item label="X轴温度">{{resultData.temperatureX}}</a-descriptions-item>
                <a-descriptions-item label="Y轴温度">{{resultData.temperatureY}}</a-descriptions-item>
                <a-descriptions-item label="Z轴温度">{{resultData.temperatureZ}}</a-descriptions-item>
                <a-descriptions-item label="A轴温度">{{resultData.temperatureA}}</a-descriptions-item>
                <a-descriptions-item label="B轴温度">{{resultData.temperatureB}}</a-descriptions-item>
                <a-descriptions-item label="X轴电流">{{resultData.equipmentCurrentX}}</a-descriptions-item>
                <a-descriptions-item label="Y轴电流">{{resultData.equipmentCurrentY}}</a-descriptions-item>
                <a-descriptions-item label="Z轴电流">{{resultData.equipmentCurrentZ}}</a-descriptions-item>
                <a-descriptions-item label="A轴电流">{{resultData.equipmentCurrentA}}</a-descriptions-item>
                <a-descriptions-item label="B轴电流">{{resultData.equipmentCurrentB}}</a-descriptions-item>
                <a-descriptions-item label="X轴随动误差">{{resultData.equipmentLagErrorX}}</a-descriptions-item>
                <a-descriptions-item label="Y轴随动误差">{{resultData.equipmentLagErrorY}}</a-descriptions-item>
                <a-descriptions-item label="Z轴随动误差">{{resultData.equipmentLagErrorZ}}</a-descriptions-item>
                <a-descriptions-item label="A轴随动误差">{{resultData.equipmentLagErrorA}}</a-descriptions-item>
                <a-descriptions-item label="B轴随动误差">{{resultData.equipmentLagErrorB}}</a-descriptions-item>
              </a-descriptions>
-->
              <!-- <a-descriptions
                title="坐标信息 "
                v-if="driverType == 'FANUC'"
                :column="3"
              >
                <a-descriptions-item label="绝对坐标X">{{resultData.xabsolute}}</a-descriptions-item>
                <a-descriptions-item label="绝对坐标Y">{{resultData.yabsolute}}</a-descriptions-item>
                <a-descriptions-item label="绝对坐标Z">{{resultData.zabsolute}}</a-descriptions-item>
                <a-descriptions-item label="机床坐标X">{{resultData.xmachine}}</a-descriptions-item>
                <a-descriptions-item label="机床坐标Y">{{resultData.ymachine}}</a-descriptions-item>
                <a-descriptions-item label="机床坐标Z">{{resultData.zmachine}}</a-descriptions-item>
              </a-descriptions>
              <a-descriptions
                title="坐标信息 for lsv2"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="X坐标">{{resultData.xmachine}}</a-descriptions-item>
                <a-descriptions-item label="Y坐标">{{resultData.ymachine}}</a-descriptions-item>
                <a-descriptions-item label="Z坐标">{{resultData.zmachine}}</a-descriptions-item>
                <a-descriptions-item label="A坐标">{{resultData.amachine}}</a-descriptions-item>
                <a-descriptions-item label="B坐标">{{resultData.bmachine}}</a-descriptions-item>
                <a-descriptions-item label="C坐标">{{resultData.cmachine}}</a-descriptions-item>
              </a-descriptions>
              <a-descriptions
                title="坐标信息 for lsv2"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="X坐标">{{resultData.xmachine}}</a-descriptions-item>
                <a-descriptions-item label="Y坐标">{{resultData.ymachine}}</a-descriptions-item>
                <a-descriptions-item label="Z坐标">{{resultData.zmachine}}</a-descriptions-item>
                <a-descriptions-item label="A坐标">{{resultData.amachine}}</a-descriptions-item>
                <a-descriptions-item label="B坐标">{{resultData.bmachine}}</a-descriptions-item>
                <a-descriptions-item label="C坐标">{{resultData.cmachine}}</a-descriptions-item>
              </a-descriptions>
              <a-descriptions
                title="坐标信息"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="X坐标">{{resultData.xmachine}}</a-descriptions-item>
                <a-descriptions-item label="Y坐标">{{resultData.ymachine}}</a-descriptions-item>
                <a-descriptions-item label="Z坐标">{{resultData.zmachine}}</a-descriptions-item>
                <a-descriptions-item label="A坐标">{{resultData.amachine}}</a-descriptions-item>
                <a-descriptions-item label="B坐标">{{resultData.bmachine}}</a-descriptions-item>
                <a-descriptions-item label="C坐标">{{resultData.cmachine}}</a-descriptions-item>
              </a-descriptions> -->
              <!---数据源调整  åŠ¨æ€å±•ç¤º è¿è¡Œæ•°æ®---->
              <a-descriptions
                title="运行数据"
                v-show="mdcDriveTypeParamConfigList != null"
                v-if="driverType != 'PLC'"
                :column="4"
              >
                <a-descriptions-item
                  v-for="(item,id) in mdcDriveTypeParamConfigList  "
                  :key="item.id"
                  :label="item.chineseName"
                >{{item.value}}
                </a-descriptions-item>
              </a-descriptions>
              <!--<a-descriptions-->
              <!--title="坐标信息"-->
              <!--v-show="xyzAliasesList != null"-->
              <!--v-if="driverType != 'PLC'"-->
              <!--:column="4"-->
              <!--&gt;-->
              <!--<a-descriptions-item-->
              <!--v-for="(item,id) in xyzAliasesList  "-->
              <!--:key="item.id"-->
              <!--:label="item.title"-->
              <!--&gt;{{item.value}}</a-descriptions-item>-->
              <!--</a-descriptions>-->
              <a-descriptions
                title="版本信息 for lsv2"
                v-if="driverType == 'LSV2'"
                :column="4"
              >
                <a-descriptions-item label="NC版本">{{resultData.nCVersion}}</a-descriptions-item>
                <a-descriptions-item label="TNC版本">{{resultData.tNCVersion}}</a-descriptions-item>
                <a-descriptions-item label="OPT版本">{{resultData.oPTVersion}}</a-descriptions-item>
                <a-descriptions-item label="PLC版本">{{resultData.pLCVersion}}</a-descriptions-item>
              </a-descriptions>
            </td>
          </tr>
        </table>
      </div>
      <template slot="footer">
        <a-button
          :style="{ marginRight: '8px' }"
          @click="handleCancel"
          style="color: #1191b0;"
        >关闭
        </a-button>
      </template>
    </a-modal>
  </div>
</template>
<script>
  import {
    getAction,
    postAction
  } from '@/api/manage'
  import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
  export default {
    name: 'EqumentDetaiModal',
    components: {},
    props: {},
    data() {
      return {
        mdcDriveTypeParamConfigList: [],
        xyzAliasesList: [],
        title: '',
        //主轴倍率
        spindlebeilv: 1,
        //进给倍率
        feedbeilv: 1,
        // ä¸»è½´è´Ÿè·
        spindleload: 1,
        //快速进给倍率
        rapidfeed: 1,
        visible: false,
        resultData: {},
        driverType: '',
        deviceTypeDict: '',
        url: {
          mdcEquipmentDetailedInfo: '/mdc/mdcEquipment/mdcEquipmentDetailedInfo'
        },
        modalTimer: null,
        ee: ' ',
        modalNode: null,
        timeout: null
      }
    },
    mounted() {
    },
    watch: {},
    methods: {
      drawLine() {
        let _this = this
        if (_this.spindlebeilv) {
          //基于准备好的dom,初始化echarts实例
          let mdcEquiMoniGauge1 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge1'), 'macarons')
          let mdcEquiMoniGaugeOption1 = {
            tooltip: {
              formatter: '{a} <br/>{b} : {c}%'
            },
            series: [{
              name: '外部线',
              type: 'gauge',
              radius: '65%', // åŠ¨æ€
              startAngle: 225,
              endAngle: -45,
              axisLine: {
                lineStyle: {
                  color: [
                    [1, '#31F3FF'] // åŠ¨æ€
                  ],
                  width: 1
                }
              },
              axisLabel: {
                show: false
              },
              axisTick: {
                show: false
              },
              splitLine: {
                show: false
              },
              detail: {
                show: false
              },
              title: { //标题
                show: false
              }
            },
              {
                name: '外部刻度',
                type: 'gauge',
                radius: '80%',
                min: 0, //最小刻度
                max: 300, //最大刻度
                splitNumber: 10, //刻度数量
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  show: false,
                  lineStyle: {
                    color: [
                      [1, 'rgba(0,0,0,0)']
                    ]
                  }
                }, //仪表盘轴线
                axisLabel: {
                  show: true,
                  color: '#31F3FF',
                  fontSize: 10, // åŠ¨æ€
                  distance: -20 // åŠ¨æ€
                }, //刻度标签。
                axisTick: {
                  show: false
                }, //刻度样式
                splitLine: {
                  show: false
                }
              },
              {
                name: '内部宽线条',
                type: 'gauge',
                radius: '55%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 4
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '内部细线条',
                type: 'gauge',
                radius: '40%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 3
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '间隔条形',
                type: 'gauge',
                radius: '52.5%',
                z: 4,
                splitNumber: 35,
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    opacity: 0
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: true,
                  length: 20,
                  splitNumber: 1,
                  lineStyle: {
                    color: '#122B3C',
                    width: 1
                  }
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '数据',
                type: 'gauge',
                radius: '52.5%',
                z: 3,
                startAngle: 225,
                max: 300,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [_this.spindlebeilv / 300, '#31F3FF'], // åŠ¨æ€
                      [1, '#185363']
                    ],
                    width: 4
                  }
                },
                tooltip: {
                  show: false
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: true,
                  fontWeight: 'bold',
                  fontSize: 12,
                  color: '#fff'
                },
                pointer: {
                  show: true,
                  width: 3
                },
                data: [{
                  name: '',
                  value: _this.spindlebeilv
                }]
              },
              // å†…圆
              {
                'name': '内圆环',
                'type': 'pie',
                'radius': ['4%', '2%'],
                'hoverAnimation': false,
                tooltip: {
                  show: false
                },
                cursor: 'default',
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#fff'
                },
                animation: false,
                'data': [1]
              },
              // å†…圆
              {
                'name': '内圆环2',
                'type': 'pie',
                'radius': '2%',
                'hoverAnimation': false,
                cursor: 'default',
                tooltip: {
                  show: false
                },
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#31F3FF'
                },
                animation: false,
                'data': [1]
              }
            ]
          }
          mdcEquiMoniGauge1.setOption(mdcEquiMoniGaugeOption1)
        }
        if (_this.feedbeilv) {
          let mdcEquiMoniGauge2 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge2'), 'macarons')
          let mdcEquiMoniGaugeOption2 = {
            tooltip: {
              formatter: '{a} <br/>{b} : {c}%'
            },
            series: [{
              name: '外部线',
              type: 'gauge',
              radius: '65%', // åŠ¨æ€
              startAngle: 225,
              endAngle: -45,
              axisLine: {
                lineStyle: {
                  color: [
                    [1, '#31F3FF'] // åŠ¨æ€
                  ],
                  width: 1
                }
              },
              axisLabel: {
                show: false
              },
              axisTick: {
                show: false
              },
              splitLine: {
                show: false
              },
              detail: {
                show: false
              },
              title: { //标题
                show: false
              }
            },
              {
                name: '外部刻度',
                type: 'gauge',
                radius: '80%',
                min: 0, //最小刻度
                max: 300, //最大刻度
                splitNumber: 10, //刻度数量
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  show: false,
                  lineStyle: {
                    color: [
                      [1, 'rgba(0,0,0,0)']
                    ]
                  }
                }, //仪表盘轴线
                axisLabel: {
                  show: true,
                  color: '#31F3FF',
                  fontSize: 10, // åŠ¨æ€
                  distance: -20 // åŠ¨æ€
                }, //刻度标签。
                axisTick: {
                  show: false
                }, //刻度样式
                splitLine: {
                  show: false
                }
              },
              {
                name: '内部宽线条',
                type: 'gauge',
                radius: '55%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 4
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '内部细线条',
                type: 'gauge',
                radius: '40%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 3
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '间隔条形',
                type: 'gauge',
                radius: '52.5%',
                z: 4,
                splitNumber: 35,
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    opacity: 0
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: true,
                  length: 20,
                  splitNumber: 1,
                  lineStyle: {
                    color: '#122B3C',
                    width: 1
                  }
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '数据',
                type: 'gauge',
                radius: '52.5%',
                z: 3,
                startAngle: 225,
                max: 300,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [_this.feedbeilv / 300, '#31F3FF'], // åŠ¨æ€
                      [1, '#185363']
                    ],
                    width: 4
                  }
                },
                tooltip: {
                  show: false
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: true,
                  fontWeight: 'bold',
                  fontSize: 12,
                  color: '#fff'
                },
                pointer: {
                  show: true,
                  width: 3
                },
                data: [{
                  name: '',
                  value: _this.feedbeilv
                }]
              },
              // å†…圆
              {
                'name': '内圆环',
                'type': 'pie',
                'radius': ['4%', '2%'],
                'hoverAnimation': false,
                tooltip: {
                  show: false
                },
                cursor: 'default',
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#fff'
                },
                animation: false,
                'data': [1]
              },
              // å†…圆
              {
                'name': '内圆环2',
                'type': 'pie',
                'radius': '2%',
                'hoverAnimation': false,
                cursor: 'default',
                tooltip: {
                  show: false
                },
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#31F3FF'
                },
                animation: false,
                'data': [1]
              }
            ]
          }
          mdcEquiMoniGauge2.setOption(mdcEquiMoniGaugeOption2)
        }
        if (_this.spindleload) {
          let mdcEquiMoniGauge3 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge3'), 'macarons')
          let mdcEquiMoniGaugeOption3 = {
            tooltip: {
              formatter: '{a} <br/>{b} : {c}%'
            },
            series: [{
              name: '外部线',
              type: 'gauge',
              radius: '65%', // åŠ¨æ€
              startAngle: 225,
              endAngle: -45,
              axisLine: {
                lineStyle: {
                  color: [
                    [1, '#31F3FF'] // åŠ¨æ€
                  ],
                  width: 1
                }
              },
              axisLabel: {
                show: false
              },
              axisTick: {
                show: false
              },
              splitLine: {
                show: false
              },
              detail: {
                show: false
              },
              title: { //标题
                show: false
              }
            },
              {
                name: '外部刻度',
                type: 'gauge',
                radius: '80%',
                min: 0, //最小刻度
                max: 300, //最大刻度
                splitNumber: 10, //刻度数量
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  show: false,
                  lineStyle: {
                    color: [
                      [1, 'rgba(0,0,0,0)']
                    ]
                  }
                }, //仪表盘轴线
                axisLabel: {
                  show: true,
                  color: '#31F3FF',
                  fontSize: 10, // åŠ¨æ€
                  distance: -20 // åŠ¨æ€
                }, //刻度标签。
                axisTick: {
                  show: false
                }, //刻度样式
                splitLine: {
                  show: false
                }
              },
              {
                name: '内部宽线条',
                type: 'gauge',
                radius: '55%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 4
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '内部细线条',
                type: 'gauge',
                radius: '40%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 3
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '间隔条形',
                type: 'gauge',
                radius: '52.5%',
                z: 4,
                splitNumber: 35,
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    opacity: 0
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: true,
                  length: 20,
                  splitNumber: 1,
                  lineStyle: {
                    color: '#122B3C',
                    width: 1
                  }
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '数据',
                type: 'gauge',
                radius: '52.5%',
                z: 3,
                startAngle: 225,
                max: 300,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [_this.spindleload / 300, '#31F3FF'], // åŠ¨æ€
                      [1, '#185363']
                    ],
                    width: 4
                  }
                },
                tooltip: {
                  show: false
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: true,
                  fontWeight: 'bold',
                  fontSize: 12,
                  color: '#fff'
                },
                pointer: {
                  show: true,
                  width: 3
                },
                data: [{
                  name: '',
                  value: _this.spindleload
                }]
              },
              // å†…圆
              {
                'name': '内圆环',
                'type': 'pie',
                'radius': ['4%', '2%'],
                'hoverAnimation': false,
                tooltip: {
                  show: false
                },
                cursor: 'default',
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#fff'
                },
                animation: false,
                'data': [1]
              },
              // å†…圆
              {
                'name': '内圆环2',
                'type': 'pie',
                'radius': '2%',
                'hoverAnimation': false,
                cursor: 'default',
                tooltip: {
                  show: false
                },
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#31F3FF'
                },
                animation: false,
                'data': [1]
              }
            ]
          }
          mdcEquiMoniGauge3.setOption(mdcEquiMoniGaugeOption3)
        }
        if (_this.rapidfeed) {
          let mdcEquiMoniGauge4 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge4'), 'macarons')
          let mdcEquiMoniGaugeOption4 = {
            tooltip: {
              formatter: '{a} <br/>{b} : {c}%'
            },
            series: [{
              name: '外部线',
              type: 'gauge',
              radius: '65%', // åŠ¨æ€
              startAngle: 225,
              endAngle: -45,
              axisLine: {
                lineStyle: {
                  color: [
                    [1, '#31F3FF'] // åŠ¨æ€
                  ],
                  width: 1
                }
              },
              axisLabel: {
                show: false
              },
              axisTick: {
                show: false
              },
              splitLine: {
                show: false
              },
              detail: {
                show: false
              },
              title: { //标题
                show: false
              }
            },
              {
                name: '外部刻度',
                type: 'gauge',
                radius: '80%',
                min: 0, //最小刻度
                max: 300, //最大刻度
                splitNumber: 10, //刻度数量
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  show: false,
                  lineStyle: {
                    color: [
                      [1, 'rgba(0,0,0,0)']
                    ]
                  }
                }, //仪表盘轴线
                axisLabel: {
                  show: true,
                  color: '#31F3FF',
                  fontSize: 10, // åŠ¨æ€
                  distance: -20 // åŠ¨æ€
                }, //刻度标签。
                axisTick: {
                  show: false
                }, //刻度样式
                splitLine: {
                  show: false
                }
              },
              {
                name: '内部宽线条',
                type: 'gauge',
                radius: '55%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 4
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '内部细线条',
                type: 'gauge',
                radius: '40%',
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [1, '#122B3C']
                    ],
                    width: 3
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '间隔条形',
                type: 'gauge',
                radius: '52.5%',
                z: 4,
                splitNumber: 35,
                startAngle: 225,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    opacity: 0
                  }
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: true,
                  length: 20,
                  splitNumber: 1,
                  lineStyle: {
                    color: '#122B3C',
                    width: 1
                  }
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: false
                },
                title: {
                  show: false
                }
              },
              {
                name: '数据',
                type: 'gauge',
                radius: '52.5%',
                z: 3,
                startAngle: 225,
                max: 300,
                endAngle: -45,
                axisLine: {
                  lineStyle: {
                    color: [
                      [_this.rapidfeed / 300, '#31F3FF'], // åŠ¨æ€
                      [1, '#185363']
                    ],
                    width: 4
                  }
                },
                tooltip: {
                  show: false
                },
                axisLabel: {
                  show: false
                },
                axisTick: {
                  show: false
                },
                splitLine: {
                  show: false
                },
                detail: {
                  show: true,
                  fontWeight: 'bold',
                  fontSize: 12,
                  color: '#fff'
                },
                pointer: {
                  show: true,
                  width: 3
                },
                data: [{
                  name: '',
                  value: _this.rapidfeed
                }]
              },
              // å†…圆
              {
                'name': '内圆环',
                'type': 'pie',
                'radius': ['4%', '2%'],
                'hoverAnimation': false,
                tooltip: {
                  show: false
                },
                cursor: 'default',
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#fff'
                },
                animation: false,
                'data': [1]
              },
              // å†…圆
              {
                'name': '内圆环2',
                'type': 'pie',
                'radius': '2%',
                'hoverAnimation': false,
                cursor: 'default',
                tooltip: {
                  show: false
                },
                'labelLine': {
                  'normal': {
                    'show': false
                  }
                },
                itemStyle: {
                  color: '#31F3FF'
                },
                animation: false,
                'data': [1]
              }
            ]
          }
          mdcEquiMoniGauge4.setOption(mdcEquiMoniGaugeOption4)
        }
      },
      handleCancel() {
        this.$emit('close')
        this.visible = false
        this.modalNode.removeEventListener('mouseleave', this.closeModal)
        if(this.modalTimer){
          clearInterval(this.modalTimer)
          this.modalTimer = null
        }
        if (this.timeout) {
          clearTimeout(this.timeout)
          this.timeout = null
        }
      },
      timerModel(id) {
        this.ee = id
        this.modalTimer = setInterval(() => {
          setTimeout(this.initData(this.ee), 0)
        }, 1000 * 4)
      },
      initData(id) {
        let _this = this
        this.visible = true
        // _this.drawLine()
        getAction(this.url.mdcEquipmentDetailedInfo, { id: id }).then((res) => {
          if (res.success) {
            _this.resultData = res.result
            _this.driverType = res.result.deviceType
            _this.spindlebeilv = res.result.spindlebeilv
            _this.feedbeilv = res.result.feedbeilv
            _this.spindleload = res.result.spindleload
            _this.rapidfeed = res.result.rapidfeed
            _this.mdcDriveTypeParamConfigList = res.result.mdcDriveTypeParamConfigList
            _this.xyzAliasesList = res.result.xyzAliasesList
            this.$nextTick(() => {
              _this.drawLine()
            })
            // _this.initDeviceType(_this.resultData.deviceType)
          } else {
            // _this.$message.warn(res.message)
            _this.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        })
      },
      getModalNode() {
        console.log(document.querySelector('.ant-modal-content'))
        this.modalNode = document.querySelector('.ant-modal-content')
        this.timeout = setTimeout(() => {
          this.modalNode.addEventListener('mouseleave', this.closeModal)
        }, 100)
      },
      closeModal() {
        this.handleCancel()
      }
    },
    beforeDestroy() {
      clearInterval(this.modalTimer)
      this.modalTimer = null
    }
  }
</script>
<style scoped lang="less">
  body {
    overflow-y: hidden !important;
  }
  .full-modal {
    .ant-modal {
      top: 0;
      padding-bottom: 0;
      margin: 0;
      background-color: #4a4a48 !important;
      opacity: 0.5;
    }
    /deep/ .ant-modal-content {
      display: flex;
      flex-direction: column;
      /*height: calc(100vh);*/
      background-color: #4a4a48;
    }
    .ant-modal-body {
      flex: 1;
    }
  }
  /deep/ .ant-modal-content {
    /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/
    /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/
    /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
    /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
    /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
    /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
    background-color: #312c2c;
    opacity: 0.7;
  }
  /deep/ .ant-modal-close {
    color: #1191b0;
    font-size: 24px;
  }
  /deep/ .ant-modal-close-x {
    font-size: 24px;
  }
  /deep/ .ant-modal-footer {
    border-top: none;
  }
  /deep/ .ant-descriptions {
    border: 1px solid #16738d;
    margin: 10px 0;
  }
  /deep/ .ant-descriptions-title {
    color: #fff;
    padding: 10px;
    margin-bottom: 0;
  }
  /deep/ .ant-descriptions-view {
    padding: 0 20px;
  }
  /deep/ .ant-descriptions-view .ant-descriptions-row .ant-descriptions-item {
    padding-bottom: 5px;
  }
  /deep/ .ant-descriptions-item-colon {
    color: #fff;
    width: 5.1vw;
  }
  /deep/ .ant-descriptions-item-content {
    color: #fff;
    border: 1px solid #4bcfc8;
    padding: 0 10px;
    width: auto;
    min-width: 130px;
    /*max-width: 300px;*/
    height: 25px;
  }
  .mdcEquipMon {
    color: #fff;
  }
  fieldset {
    border: 1px solid #16738d;
    padding: 17px;
    margin: 14px;
  }
  fieldset legend {
    display: inline;
    width: 88px;
  }
  table tr td {
    text-align: left;
    color: #fff;
  }
  table tr td input {
    border: 1px solid #a6eff9;
  }
  .ant-btn {
    padding: 0 10px;
    margin-left: 3px;
    color: #fff !important;
    background-color: #1191b0;
    border: none;
  }
  .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;
  }
</style>