qushaowei
2024-03-14 e055d2d93b516985fbc2df0f6f5a135f3230cccf
Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop
已添加3个文件
已修改46个文件
4046 ■■■■■ 文件已修改
src/components/table2excel/table2excel.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/UserMenu.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/request.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/WorkshopSignage.vue 267 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/AlarmManager.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/DeviceBaseInfo.vue 119 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/EquipmentList.vue 362 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/EquipmentOperationParamsAlarm.vue 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/MdcMessageApproval.vue 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/MdcUtilizationRateList.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/EquipmentList/UserModal.vue 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/HolidayManagement/HolidayManagementModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/MdcMessageApproval/MdcMessageApprovalModal.vue 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue 213 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmManager/alarmManagerModal.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceLog/LogInfo.vue 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceLog/LogList.vue 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceLog/WorkChartModel.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcDriveTypeParamConfig/MdcDriveTypeParamConfigForm.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcPassRate/mdcPassRateModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationModal.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/WorkshopSignageManagement.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectDeviceDrawer.vue 225 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectDeviceModal.vue 286 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/UserModal.vue 958 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/table2excel/table2excel.js
@@ -93,15 +93,21 @@
            if( rc.flag.length > 0 ) {
              tempRows += "<td> </td>"; // exclude it!!
            } else {
              tempRows += "<td";
              // åŒ¹é…æ ¼å¼ä¸º'yyyy-mm'的日期字符串数据,若有其他需求后期再增加
              var regexPattern = /^\d{4}-\d{2}$/;
              if($(q).html().match(regexPattern)){
                tempRows += "<td style=\"mso-number-format:'yyyy-mm';\"";
              }else{
                tempRows += "<td";
                if(additionalStyles){
                  tempRows += " style='" + additionalStyles + "'";
                }
              }
              if( rc.rows > 0) {
                tempRows += " rowspan='" + rc.rows + "' ";
              }
              if( rc.cols > 0) {
                tempRows += " colspan='" + rc.cols + "' ";
              }
              if(additionalStyles){
                tempRows += " style='" + additionalStyles + "'";
              }
              tempRows += ">" + $(q).html() + "</td>";
            }
src/components/tools/UserMenu.vue
@@ -185,7 +185,7 @@
            return that.Logout({}).then(() => {
              // update-begin author:wangshuai date:20200601 for: é€€å‡ºç™»å½•跳转登录页面
              that.$router.push({ path: '/user/login' });
              window.location.reload()
              // window.location.reload()
              // update-end author:wangshuai date:20200601 for: é€€å‡ºç™»å½•跳转登录页面
            }).catch(err => {
              that.$message.error({
src/utils/request.js
@@ -79,7 +79,8 @@
        if (token) {
          store.dispatch('Logout').then(() => {
            setTimeout(() => {
              window.location.reload()
              router.push({ path: '/user/login' });
              // window.location.reload()
            }, 1500)
          })
        }
@@ -169,7 +170,10 @@
            onOk: () => {
              store.dispatch('Logout').then(() => {
                Vue.ls.remove(ACCESS_TOKEN)
                window.location.reload()
                setTimeout(() => {
                  router.push({ path: '/user/login' });
                  // window.location.reload()
                }, 1500)
              })
            }
          })
src/views/WorkshopSignage.vue
@@ -1,32 +1,49 @@
<template>
  <dv-full-screen-container class="full-screen-container">
    <header class="page-header" :style="{height: pageHeaderHeight+'px'}">
      {{ workshopDetails.workshopName }}
      <div class="header-left" v-has="'home:saveDevicePositionAndSize'" v-if="!isFullScreen">
        <a-space>
          <span v-if="!isSwitchChecked">开启功能</span>
          <span v-else>关闭功能</span>
          <a-switch
            checked-children="开"
            un-checked-children="关"
            @change="handleSwitchChange"
            v-model="isSwitchChecked"
            :disabled="isSwitchChecked"
          />
        </a-space>
        <a-button type="primary" icon="save" size="large" @click="saveDevicePositionAndSizeByApi">保存位置</a-button>
      </div>
      <div class="device-status-info">
        <a-space v-for="item in deviceStatusList" :key="item.value" class="single-status-info">
          <div>{{ item.label }}</div>
          <div class="status-square" :style="{ backgroundColor: item.color }"></div>
          <div>{{ getDeviceNumberByStatus(item.value) }}</div>
        </a-space>
      </div>
    </header>
    <div>
      <!--页头区域-->
      <header class="page-header" :style="{height: pageHeaderHeight+'px'}">
        <a-row style="height: 100%">
          <a-col :span="7" class="header-left">
            <a-space>
              <span v-if="!isSwitchChecked">开启功能</span>
              <span v-else>关闭功能</span>
              <a-switch
                checked-children="开"
                un-checked-children="关"
                @change="handleSwitchChange"
                v-model="isSwitchChecked"
                :disabled="isSwitchChecked"
              />
              <a-button type="primary" icon="save" size="large" @click="saveDevicePositionAndSizeByApi">保存位置</a-button>
            </a-space>
          </a-col>
    <dv-border-box-8>
      <div class="content-container" ref="deviceContainerRef">
          <a-col :span="10" class="workshop-name">{{ workshopDetails.workshopName }}</a-col>
          <a-col :span="7" class="device-status-info">
            <!--<a-space v-for="item in deviceStatusList" :key="item.value" class="single-status-info"-->
            <!--@click="handleScreenDevive(item)">-->
            <!--<div :style="{color:item.checked?'#1890FF':'#fff'}">{{ item.label }}</div>-->
            <!--<div class="status-square" :style="{ backgroundColor: item.color }"></div>-->
            <!--&lt;!&ndash;<a-checkbox :checked="item.checked" @change="checkboxChange(item)"></a-checkbox>&ndash;&gt;-->
            <!--<div>{{getDeviceNumberByStatus(item.value) }}</div>-->
            <!--</a-space>-->
            <a-space v-for="item in deviceStatusList" :key="item.value" class="single-status-info">
              <div :style="{color:item.checked?'#1890FF':'#fff'}">{{ item.label }}</div>
              <div class="status-square" :style="{ backgroundColor: item.color }"></div>
              <!--<a-checkbox :checked="item.checked" @change="checkboxChange(item)"></a-checkbox>-->
              <div>{{getDeviceNumberByStatus(item.value) }}</div>
            </a-space>
          </a-col>
        </a-row>
      </header>
      <!--拖拽设备区域-->
      <div class="content-container" ref="deviceContainerRef" style="overflow: auto">
        <img :src="imgSrc" width="1920" height="900">
        <div class="guideline guidelineX" :style="{top:guidelineXTop+'px',display:showGuideline}"></div>
        <div class="guideline guidelineY" :style="{left:guidelineYLeft+'px',display:showGuideline}"></div>
        <VueDragResize
          v-for="(item, index) in deviceList"
          :key="item.equipmentId"
@@ -38,11 +55,13 @@
          v-on:dragging="resize($event, index)"
          :parentLimitation="parentLimitation"
          :parentH="parentH"
          :parentW="parentW"
          :minw="70"
          :minh="70"
          :isDraggable="isDraggable"
          :isResizable="isResizable"
          :stickSize="6"
          @deactivated="showGuideline = 'none'"
        >
          <div class="single-device" :style="{ width: item.vw + 'px', height: item.vh + 'px' }"
               @click="openDetail(item)">
@@ -73,15 +92,15 @@
              ></div>
            </div>
            <div class="device-id" id="deviceId"
                 :style="{ fontSize: item.fontSize + 'px',color:workshopDetails.equipmentIdColor }">
                 :style="{ color:workshopDetails.equipmentIdColor }">
              {{ item.equipmentId }}
            </div>
          </div>
        </VueDragResize>
      </div>
    </dv-border-box-8>
    <EquipmentDetailModal ref="EquipmentDetailModal"></EquipmentDetailModal>
      <EquipmentDetailModal ref="EquipmentDetailModal"></EquipmentDetailModal>
    </div>
  </dv-full-screen-container>
</template>
@@ -110,6 +129,10 @@
        isSwitchChecked: false, // æ˜¯å¦å¼€å¯åŠŸèƒ½
        timingAcquisition: null, // å®šæ—¶åˆ·æ–°æ˜¯å¦å¼€å¯
        parentH: 5000,//父级高度
        parentW: 1920,//父级宽度
        showGuideline: 'none',
        guidelineXTop: 0,
        guidelineYLeft: 0,
        deviceList: [
          // {
          //   equipmentId: '123213213123232',// è®¾å¤‡ID
@@ -118,35 +141,47 @@
          //   coordinateLeft: 100, // æ‹–拽元素距盒子左侧距离
          //   vw: 100,  // ç¼©æ”¾å…ƒç´ å®½åº¦
          //   vh: 100, // ç¼©æ”¾å…ƒç´ é«˜åº¦
          //   fontSize: 12, // ç¼©æ”¾å…ƒç´ å­—体大小
          //   equipmentStatus: 1 // è®¾å¤‡çŠ¶æ€ 0:关机 22:报警 2:待机 3:运行 å¼€æœº:1(没有四色灯标识归为待机)
          // }
        ], // è®¾å¤‡ä¿¡æ¯åˆ—表
        deviceList_copy: [],
        deviceStatusList: [
          // {
          //   label: '全部',
          //   value: 99,
          //   color: '#fff',
          //   checked: true
          // },
          {
            label: '关机',
            value: 0,
            color: '#A8A8A8'
            color: '#A8A8A8',
            checked: false
          },
          {
            label: '待机',
            value: 2,
            color: '#FFFF00'
            color: '#FFFF00',
            checked: false
          },
          {
            label: '运行',
            value: 3,
            color: '#00EE00'
            color: '#00EE00',
            checked: false
          },
          {
            label: '报警',
            value: 22,
            color: '#FF0000'
            color: '#FF0000',
            checked: false
          }
        ],// è®¾å¤‡çŠ¶æ€æŒ‡ç¤ºç¯åˆ—è¡¨ï¼Œ
        windowHeight: null,// å½“前浏览器可视区域高度((不包括工具栏、书签、底部任务栏),进入页面时计算一次,除非重新加载页面否则浏览器可视区域高度则不发生改变
        windowHeight: null,// å½“前浏览器可视区域高度((不包括工具栏、书签、底部任务栏)
        isFullScreen: false,// è¿›å…¥çœ‹æ¿é¡µé¢æ—¶æ˜¯å¦ä¸ºå…¨å±æ¨¡å¼ï¼Œä¸åŒ…括正常模式进入后切换为全屏模式
        parentLimitation: false// æ‹–拽区域是否限制在父元素区域内
        parentLimitation: false,// æ‹–拽区域是否限制在父元素区域内,
        checkedStatusCount: null,// å·²å‹¾é€‰ç­›é€‰çŠ¶æ€ä¸ªæ•°
        imgSrc: ''// è½¦é—´å›¾çº¸åœ°å€
      }
    },
    watch: {
@@ -176,6 +211,7 @@
        api.getDeviceListInWorkshopSignagePageApi(id).then((res) => {
          if (res.result && res.result.length > 0) {
            this.deviceList = res.result
            this.deviceList_copy = res.result
          }
        })
      },
@@ -187,12 +223,13 @@
      getWorkshopDetailsByApi(id) {
        api.getWorkshopDetailByWorkshopIdApi(id).then((res) => {
          this.workshopDetails = res.result
          this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView(
            this.workshopDetails.backgroundImage
          )})`
          // this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView(
          //   this.workshopDetails.backgroundImage
          // )})`
          this.imgSrc = this.getImgView(this.workshopDetails.backgroundImage)
          this.$refs.deviceContainerRef.style.height = (this.windowHeight - this.pageHeaderHeight) + 'px'
          this.parentH = this.windowHeight - this.pageHeaderHeight
          // this.parentH = this.windowHeight - this.pageHeaderHeight
          this.parentH = 900
          this.parentLimitation = true // åœ¨çˆ¶å…ƒç´ é«˜åº¦è®¾ç½®åŽå†è®¾ç½®é™åˆ¶æ‹–拽区域,不这样有概率导致父元素高度未设置就限制拖拽
        })
      },
@@ -252,10 +289,13 @@
        // } else {
        //   this.deviceList[index].fontSize = 12
        // }
        this.showGuideline = 'block'
        this.deviceList[index].vw = newRect.width
        this.deviceList[index].vh = newRect.height
        this.deviceList[index].coordinateTop = newRect.top
        this.deviceList[index].coordinateLeft = newRect.left
        this.guidelineXTop = newRect.top + newRect.height / 2
        this.guidelineYLeft = newRect.left + newRect.width / 2
      },
      /**
@@ -264,7 +304,8 @@
       * @returns {number} è®¾å¤‡æ•°é‡
       */
      getDeviceNumberByStatus(value) {
        return this.deviceList.filter((item) => item.equipmentStatus === value).length
        if (value === 99) return this.deviceList_copy.length
        return this.deviceList_copy.filter((item) => item.equipmentStatus === value).length
      },
      /**
@@ -297,8 +338,87 @@
       * æµè§ˆå™¨å°ºå¯¸å‘生改变时触发
       */
      handleWindowSizeChange() {
        this.isFullScreen = !this.isFullScreen
        if (!this.isFullScreen) location.reload() // å¦‚果为全屏模式,则在切换模式时重新加载页面以重新获取浏览器可视区域高度
        // this.isFullScreen = !this.isFullScreen
        // if (!this.isFullScreen) location.reload() // å¦‚果为全屏模式,则在切换模式时重新加载页面以重新获取浏览器可视区域高度
        const windowHeight =
          window.innerHeight ||
          document.documentElement.clientHeight ||
          document.body.clientHeight
        // this.parentH = 99999
        // const scaleRate = windowHeight / this.windowHeight
        // this.windowHeight = windowHeight
        this.$refs.deviceContainerRef.style.height = (windowHeight - this.pageHeaderHeight) + 'px'
        // const timer = setTimeout(() => {
        //   this.deviceList.forEach(item => {
        //     item.coordinateTop = item.coordinateTop * scaleRate
        //     item.vh = item.vh * scaleRate
        //     console.log('vh', item.vh)
        //   })
        //   this.parentH = windowHeight - this.pageHeaderHeight
        //   console.log('changeDeviceList', this.deviceList)
        // }, 500)
        // console.log('scaleRate', scaleRate)
      },
      checkboxChange(obj) {
        //需要判断是否开启功能,目的是为了关闭定时器避免筛选后设备被定时刷新的新设备覆盖
        if (this.isOperatingDevice) {
          obj.checked = !obj.checked
          if (obj.value !== 99) {
            if (obj.checked) this.checkedStatusCount++
            else this.checkedStatusCount--
          }
          if (obj.value == 99) {
            this.deviceStatusList.forEach(item => {
              if (item.value !== obj.value) item.checked = obj.checked
            })
            if (obj.checked) {
              this.deviceList = this.deviceList_copy
              this.checkedStatusCount = this.deviceStatusList.length - 1
            } else {
              this.deviceList = []
              this.checkedStatusCount = 0
            }
          } else {
            this.deviceStatusList.forEach(item => {
              if (item.value === 99) {
                if (this.checkedStatusCount !== this.deviceStatusList.length - 1 || this.checkedStatusCount === 0) item.checked = false
                if (this.checkedStatusCount === this.deviceStatusList.length - 1) item.checked = true
              }
            })
            if (obj.checked) {
              this.deviceList.push(...this.deviceList_copy.filter(item => item.equipmentStatus === obj.value))
            } else {
              this.deviceList = this.deviceList.filter(item => item.equipmentStatus !== obj.value)
            }
          }
        } else {
          this.$notification.warning({
            message: '消息',
            description: '请开启功能后再进行筛选'
          })
        }
      },
      handleScreenDevive(obj) {
        //需要判断是否开启功能,目的是为了关闭定时器避免筛选后设备被定时刷新的新设备覆盖
        if (this.isOperatingDevice) {
          obj.checked = true
          this.deviceList = this.deviceList_copy
          this.deviceStatusList.forEach(item => {
            if (item.value !== obj.value) item.checked = false
          })
          if (obj.value == 99) this.deviceList = this.deviceList_copy
          else this.deviceList = this.deviceList.filter(item => item.equipmentStatus === obj.value)
        } else {
          this.$notification.warning({
            message: '消息',
            description: '请开启功能后再进行筛选'
          })
        }
      }
    },
    created() {
@@ -306,6 +426,7 @@
        this.getDeviceListByApi(this.$route.params.id)
        this.getWorkshopDetailsByApi(this.$route.params.id)
      }
      this.checkedStatusCount = this.deviceStatusList.length - 1
    },
    mounted() {
      // ç¦æ­¢ç”¨æˆ·é€‰ä¸­å†…容
@@ -317,7 +438,7 @@
        document.body.clientHeight
      // åˆ¤æ–­æµè§ˆå™¨å¯è§†åŒºåŸŸé«˜åº¦æ˜¯å¦ç­‰äºŽåˆ†è¾¨çŽ‡ï¼Œè‹¥ç›¸ç­‰åˆ™è¡¨ç¤ºè¿›å…¥æ—¶æµè§ˆå™¨ä¸ºå…¨å±æ¨¡å¼
      if (this.windowHeight === screen.height) this.isFullScreen = true
      // if (this.windowHeight === screen.height) this.isFullScreen = true
      window.addEventListener('resize', this.handleWindowSizeChange)
    },
@@ -336,38 +457,41 @@
    color: #fff;
    .page-header {
      font-size: 50px;
      text-align: center;
      position: relative;
      /*font-size: 50px;*/
      /*text-align: center;*/
      /*position: relative;*/
      .header-left {
        width: 450px;
        position: absolute;
        left: 0;
        top: 35px;
        height: 100%;
        display: flex;
        justify-content: space-evenly;
        justify-content: center;
        align-items: center;
        font-size: 16px;
        padding-top: 20px;
      }
      .workshop-name {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 50px;
      }
      .device-status-info {
        font-size: 16px;
        width: 400px;
        position: absolute;
        top: 40px;
        right: 40px;
        height: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        justify-content: space-between;
        padding-top: 20px;
        .single-status-info {
          margin: 10px;
          cursor: pointer;
          .status-square {
            width: 14px;
            height: 14px;
            border: 1px solid #fff;
            border-radius: 2px;
            border-radius: 3px;
          }
        }
      }
@@ -377,6 +501,22 @@
      width: 100%;
      background-repeat: no-repeat;
      background-size: 100% 100%;
      position: relative;
      .guideline{
        position: absolute;
        border: 1px dashed #ccc;
      }
      .guidelineX {
        width: 1920px;
        left: 0;
      }
      .guidelineY {
        top: 0;
        height: 900px;
      }
      .single-device {
        position: absolute;
@@ -418,4 +558,9 @@
      }
    }
  }
  /deep/ .ant-checkbox-inner {
    background-color: transparent;
    border-color: #fff;
  }
</style>
src/views/mdc/base/AlarmManager.vue
@@ -284,7 +284,7 @@
          // },
          {
            dataIndex:'isUse_dictText',
            title: '是否过滤',
            title: '是否启用',
            align: "center",
            width:380
           // dictCode:'alarm_is_use'
@@ -338,7 +338,7 @@
        fieldList.push({ type: 'string', value: 'alarmCode', text: '报警号', dictCode: '' })
        fieldList.push({ type: 'string', value: 'alarmDescription', text: '报警内容', dictCode: '' })
        fieldList.push({ type: 'int', value: 'driveType', text: '设备驱动类型', dictCode: '' })
        fieldList.push({ type: 'switch', value: 'isUse', text: '是否过滤' })
        fieldList.push({ type: 'switch', value: 'isUse', text: '是否启用' })
        this.superFieldList = fieldList
      },
src/views/mdc/base/DeviceBaseInfo.vue
@@ -5,31 +5,45 @@
        <base-tree @sendSelectBaseTree="changeSelection" @getCurrSelected="changeSelectionNode"></base-tree>
      </a-col>
      <a-col :md="24-5" :sm="24">
        <div class="equipMessage">
          <table>
            <tr>
              <td>关机
                <span class="equipShutdown"></span>
              </td>
              <td>{{offNumber}}</td>
              <td>待机
                <span class="standbyNumber"></span>
              </td>
              <td>{{standbyNumber}}</td>
              <td>运行
                <span class="equipRun"></span>
              </td>
              <td>{{workNumber}}</td>
              <td>报警
                <span class="equipAlarm"></span>
              </td>
              <td>{{warningNumber}}</td>
              <td>总数</td>
              <td>{{allNumber}}</td>
            </tr>
          </table>
        <!--<div class="equipMessage">-->
          <!--<table>-->
            <!--<tr>-->
              <!--<td>关机-->
                <!--<span class="equipShutdown"></span>-->
              <!--</td>-->
              <!--<td>{{offNumber}}</td>-->
              <!--<td>待机-->
                <!--<span class="standbyNumber"></span>-->
              <!--</td>-->
              <!--<td>{{standbyNumber}}</td>-->
              <!--<td>运行-->
                <!--<span class="equipRun"></span>-->
              <!--</td>-->
              <!--<td>{{workNumber}}</td>-->
              <!--<td>报警-->
                <!--<span class="equipAlarm"></span>-->
              <!--</td>-->
              <!--<td>{{warningNumber}}</td>-->
              <!--<td>总数</td>-->
              <!--<td>{{allNumber}}</td>-->
            <!--</tr>-->
          <!--</table>-->
        <!--</div>-->
        <div class="device-status-info">
          <a-space v-for="item in deviceStatusList" :key="item.value" class="single-status-info">
            <template v-if="item.value!=99">
              <div>{{ item.label }}</div>
              <div class="status-square" :style="{ backgroundColor: item.color }"></div>
              <div>{{getDeviceNumberByStatus(item.value) }}</div>
            </template>
            <template v-else>
              <div>{{ item.label }}</div>
              <div>{{getDeviceNumberByStatus(item.value) }}</div>
            </template>
          </a-space>
        </div>
        <div>
          <a-tabs default-active-key="1">
            <a-tab-pane key="1" tab="布局图">
@@ -86,7 +100,34 @@
        },
        param:{},
        timer:null,
        timerzhun:null
        timerzhun:null,
        deviceStatusList: [
          {
            label: '关机',
            value: 0,
            color: '#A8A8A8'
          },
          {
            label: '待机',
            value: 2,
            color: '#FFFF00'
          },
          {
            label: '运行',
            value: 3,
            color: '#00EE00'
          },
          {
            label: '报警',
            value: 22,
            color: '#FF0000'
          },
          {
            label: '总数',
            value: 99,
            color: '#fff'
          }
        ],// è®¾å¤‡çŠ¶æ€æŒ‡ç¤ºç¯åˆ—è¡¨ï¼Œ
      }
    },
    created() {
@@ -197,7 +238,17 @@
              description:err.message
            });
          })
      }
      },
      /**
       * æ ¹æ®è®¾å¤‡çŠ¶æ€å€¼èŽ·å–å¯¹åº”è®¾å¤‡æ•°é‡
       * @param value è®¾å¤‡çŠ¶æ€å€¼
       * @returns {number} è®¾å¤‡æ•°é‡
       */
      getDeviceNumberByStatus(value) {
        if (value === 99) return this.dataList.length
        return this.dataList.filter((item) => item.oporation === 1 && value === 2 || item.oporation === value).length
      },
    },
    mounted(){
      this.equipmentStatistics()
@@ -211,7 +262,7 @@
    }
  }
</script>
<style scoped>
<style scoped lang="less">
  @import '~@assets/less/common.less';
  .equipMessage {
@@ -251,4 +302,20 @@
  .equipMessage table td .equipAlarm {
    background-color: #FD0008;
  }
  .device-status-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    .single-status-info {
      margin: 10px;
      .status-square {
        width: 20px;
        height: 20px;
        border: 1px solid #ddd;
        border-radius: 3px;
      }
    }
  }
</style>
src/views/mdc/base/EquipmentList.vue
@@ -8,14 +8,12 @@
          <a-col :md="6" :sm="12">
            <a-form-item label="设备编号">
              <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="设备名称">
              <!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
              <a-input placeholder="请输入设备名称" v-model="queryParam.equipmentName"></a-input>
            </a-form-item>
          </a-col>
@@ -23,7 +21,8 @@
          <a-col :md="6" :sm="8">
            <a-form-item label="车间名称">
              <!--<a-input placeholder="请输入车间名称" v-model="queryParam.productionName"></a-input>-->
              <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="请选择车间"  tree-default-expand-all></a-tree-select>
              <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="请选择车间"
                             :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select>
            </a-form-item>
          </a-col>
@@ -37,7 +36,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator" style="border-top: 5px">
      <a-button @click="handleAdd" type="primary" icon="plus" >添加设备</a-button>
      <a-button @click="handleAdd" type="primary" icon="plus">添加设备</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('设备信息')">导出</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay" @click="handleMenuClick">
@@ -56,7 +55,8 @@
    <!-- 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;
        <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>
@@ -72,17 +72,10 @@
        :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 @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a-divider type="vertical"/>
          <a-dropdown>
            <a class="ant-dropdown-link">
@@ -93,28 +86,11 @@
                <a href="javascript:;" @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <!--<a-menu-item>-->
                <!--<a href="javascript:;" @click="handleChangePassword(record.username)">密码</a>-->
              <!--</a-menu-item>-->
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
              <!--<a-menu-item v-if="record.status==1">-->
                <!--<a-popconfirm title="确定冻结吗?" @confirm="() => handleFrozen(record.id,2,record.username)">-->
                  <!--<a>冻结</a>-->
                <!--</a-popconfirm>-->
              <!--</a-menu-item>-->
              <!--<a-menu-item v-if="record.status==2">-->
                <!--<a-popconfirm title="确定解冻吗?" @confirm="() => handleFrozen(record.id,1,record.username)">-->
                  <!--<a>解冻</a>-->
                <!--</a-popconfirm>-->
              <!--</a-menu-item>-->
            </a-menu>
          </a-dropdown>
        </span>
@@ -125,43 +101,21 @@
    <!-- table区域-end -->
    <user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
    <password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
    <sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal>
    <!-- ç”¨æˆ·å›žæ”¶ç«™ -->
    <user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/>
  </a-card>
</template>
<script>
  import UserModal from './modules/EquipmentList/UserModal'
  import PasswordModal from './modules/EquipmentList/PasswordModal'
  import {putAction,getFileAccessHttpUrl} from '@/api/manage';
  import {frozenBatch} from '@/api/api'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import SysUserAgentModal from "./modules/EquipmentList/SysUserAgentModal";
  import JInput from '@/components/jeecg/JInput'
  import UserRecycleBinModal from './modules/EquipmentList/UserRecycleBinModal'
  import JSuperQuery from '@/components/jeecg/JSuperQuery'
  import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { queryProductionTreeList } from '@/api/api'
  import {mapActions} from 'vuex'
  import { mapActions } from 'vuex'
  export default {
    name: "EquipmentList",
    name: 'EquipmentList',
    mixins: [JeecgListMixin],
    components: {
      JThirdAppButton,
      SysUserAgentModal,
      UserModal,
      PasswordModal,
      JInput,
      UserRecycleBinModal,
      JSuperQuery
    },
    data() {
      return {
@@ -172,103 +126,88 @@
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '设备编号',
            align: "center",
            align: 'center',
            dataIndex: 'equipmentId',
            width: 200,
            // sorter: true
            width: 200
          },
          {
            title: '设备名称',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'equipmentName',
            dataIndex: 'equipmentName'
          },
          {
            title: '车间',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'productionName'
          },
          {
            title: '设备类型',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'equipmentType',
            // scopedSlots: {customRender: "avatarslot"}
            dataIndex: 'equipmentType'
          },
          {
            title: '驱动类型',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'driveType',
            // sorter: true
            dataIndex: 'driveType'
          },
          {
            title: '机床IP',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'equipmentIp'
          },
          {
            title: '设备功率',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'devicePower'
          },
          {
            title: '部门',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'orgCodeTxt'
          },
          {
            title: '系统版本',
            align: "center",
            align: 'center',
            width: 200,
            dataIndex: 'systemVersion'
          },
          {
            title: '操作',
            dataIndex: 'action',
            scopedSlots: {customRender: 'action'},
            align: "center",
            scopedSlots: { customRender: 'action' },
            align: 'center',
            width: 150,
            fixed:'right'
            fixed: 'right'
          }
        ],
        // superQueryFieldList: [
        //   { type: 'input', value: 'username', text: '用户账号', },
        //   { type: 'input', value: 'realname', text: '用户姓名', },
        //   { type: 'select', value: 'sex', dbType: 'int', text: '性别', dictCode: 'sex' },
        // ],
        url: {
          syncUser: "/act/process/extActProcess/doSyncUser",
          list: "/mdc/mdcEquipment/list",
          delete: "/mdc/mdcEquipment/delete",
          deleteBatch: "/mdc/mdcEquipment/deleteBatch",
          exportXlsUrl: "/mdc/mdcEquipment/exportXls",
          // importExcelUrl: "sys/user/importExcel",
          list: '/mdc/mdcEquipment/list',
          delete: '/mdc/mdcEquipment/delete',
          deleteBatch: '/mdc/mdcEquipment/deleteBatch',
          exportXlsUrl: '/mdc/mdcEquipment/exportXls'
        },
        isDepartType:'',
        workshopTreeData:[]
        isDepartType: '',
        workshopTreeData: [],
        treeDefaultExpandedKeys: []
      }
    },
    computed: {
      // importExcelUrl: function(){
      //   return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      // }
    },
    created() {
      this.queryTreeData()
@@ -280,61 +219,60 @@
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
            if(this.isDepartType == -1){
              this.columns=[
            if (this.isDepartType == -1) {
              this.columns = [
                {
                  title: '#',
                  dataIndex: '',
                  key:'rowIndex',
                  width:60,
                  align:"center",
                  customRender:function (t,r,index) {
                    return parseInt(index)+1;
                  key: 'rowIndex',
                  width: 60,
                  align: 'center',
                  customRender: function(t, r, index) {
                    return parseInt(index) + 1
                  }
                },
                {
                  title: '设备编号',
                  align: "center",
                  align: 'center',
                  dataIndex: 'equipmentId',
                  width: 200,
                  width: 200
                  // sorter: true
                },
                {
                  title: '设备名称',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentName',
                  dataIndex: 'equipmentName'
                },
                {
                  title: '车间',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'productionName'
                },
                {
                  title: '设备类型',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentType',
                  // scopedSlots: {customRender: "avatarslot"}
                  dataIndex: 'equipmentType'
                },
                {
                  title: '驱动类型',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'driveType',
                  dataIndex: 'driveType'
                  // sorter: true
                },
                {
                  title: '机床IP',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentIp'
                },
                {
                  title: '设备功率',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'devicePower'
                },
@@ -347,98 +285,97 @@
                {
                  title: '系统版本',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'systemVersion'
                },
                {
                  title: '操作',
                  dataIndex: 'action',
                  scopedSlots: {customRender: 'action'},
                  align: "center",
                  scopedSlots: { customRender: 'action' },
                  align: 'center',
                  width: 150,
                  fixed:'right'
                  fixed: 'right'
                }
              ]
            }else{
              this.columns=[
            } else {
              this.columns = [
                {
                  title: '#',
                  dataIndex: '',
                  key:'rowIndex',
                  width:60,
                  align:"center",
                  customRender:function (t,r,index) {
                    return parseInt(index)+1;
                  key: 'rowIndex',
                  width: 60,
                  align: 'center',
                  customRender: function(t, r, index) {
                    return parseInt(index) + 1
                  }
                },
                {
                  title: '设备编号',
                  align: "center",
                  align: 'center',
                  dataIndex: 'equipmentId',
                  width: 200,
                  width: 200
                  // sorter: true
                },
                {
                  title: '设备名称',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentName',
                  dataIndex: 'equipmentName'
                },
                {
                  title: '车间',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'productionName'
                },
                {
                  title: '设备类型',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentType',
                  // scopedSlots: {customRender: "avatarslot"}
                  dataIndex: 'equipmentType'
                },
                {
                  title: '驱动类型',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'driveType',
                  dataIndex: 'driveType'
                  // sorter: true
                },
                {
                  title: '机床IP',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'equipmentIp'
                },
                {
                  title: '设备功率',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'devicePower'
                },
                {
                  title: '部门',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'orgCodeTxt'
                },
                {
                  title: '系统版本',
                  align: "center",
                  align: 'center',
                  width: 200,
                  dataIndex: 'systemVersion'
                },
                {
                  title: '操作',
                  dataIndex: 'action',
                  scopedSlots: {customRender: 'action'},
                  align: "center",
                  scopedSlots: { customRender: 'action' },
                  align: 'center',
                  width: 150,
                  fixed:'right'
                  fixed: 'right'
                }
              ]
@@ -447,125 +384,44 @@
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
              message: '消息',
              description: res.message
            })
          }
        }).finally(() =>{
        }).finally(() => {
        })
      },
      handleEdit: function (record) {
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = "编辑";
        this.$refs.modalForm.disableSubmit = false;
        this.$refs.modalForm.disSeach = true;
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŸ¥è¯¢åŒºåŸŸè½¦é—´æ ‘åˆ—è¡¨
       */
      getWorkshopListByApi() {
        queryProductionTreeList().then(res => {
          if (res.success) {
            this.workshopTreeData = res.result
            this.treeDefaultExpandedKeys = [...res.result].map(item => item.key)
          }
        })
      },
      handleEdit: function(record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.disSeach = true
        // è°ƒç”¨æŠ½å±‰è¡¨å•组件中的清除表单验证方法
        this.$refs.modalForm.removeValidate()
      },
      handleAdd: function () {
        this.$refs.modalForm.add();
        this.$refs.modalForm.title = "新增";
        this.$refs.modalForm.disableSubmit = false;
        this.$refs.modalForm.disSeach = false;
      },
      getAvatarView: function (avatar) {
        return getFileAccessHttpUrl(avatar)
      },
      batchFrozen: function (status) {
        if (this.selectedRowKeys.length <= 0) {
          // this.$message.warning('请选择一条记录!');
          this.$notification.warning({
            message:'消息',
            description:"请选择一条记录"
          });
          return false;
        } else {
          let ids = "";
          let that = this;
          let isAdmin = false;
          that.selectionRows.forEach(function (row) {
            if (row.username == 'admin') {
              isAdmin = true;
            }
          });
          if (isAdmin) {
            that.$message.warning('管理员账号不允许此操作,请重新选择!');
            return;
          }
          that.selectedRowKeys.forEach(function (val) {
            ids += val + ",";
          });
          that.$confirm({
            title: "确认操作",
            content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
            onOk: function () {
              frozenBatch({ids: ids, status: status}).then((res) => {
                if (res.success) {
                  // that.$message.success(res.message);
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });
                  that.loadData();
                  that.onClearSelected();
                } else {
                  // that.$message.warning(res.message);
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              });
            }
          });
        }
      handleAdd: function() {
        this.$refs.modalForm.add()
        this.$refs.modalForm.title = '新增'
        this.$refs.modalForm.disableSubmit = false
        this.$refs.modalForm.disSeach = false
      },
      handleMenuClick(e) {
        if (e.key == 1) {
          this.batchDel();
        } else if (e.key == 2) {
          this.batchFrozen(2);
        } else if (e.key == 3) {
          this.batchFrozen(1);
          this.batchDel()
        }
      },
      // handleFrozen: function (id, status, username) {
      //   let that = this;
      //   //TODO åŽå°æ ¡éªŒç®¡ç†å‘˜è§’色
      //   if ('admin' == username) {
      //     that.$message.warning('管理员账号不允许此操作!');
      //     return;
      //   }
      //   frozenBatch({ids: id, status: status}).then((res) => {
      //     if (res.success) {
      //       that.$message.success(res.message);
      //       that.loadData();
      //     } else {
      //       that.$message.warning(res.message);
      //     }
      //   });
      // },
      // handleChangePassword(username) {
      //   this.$refs.passwordmodal.show(username);
      // },
      passwordModalOk() {
        //TODO å¯†ç ä¿®æ”¹å®Œæˆ ä¸éœ€è¦åˆ·æ–°é¡µé¢ï¼Œå¯ä»¥æŠŠdatasource中的数据更新一下
      },
      onSyncFinally({isToLocal}) {
        // åŒæ­¥åˆ°æœ¬åœ°æ—¶åˆ·æ–°ä¸‹æ•°æ®
        if (isToLocal) {
          this.loadData()
        }
      },
      getWorkshopListByApi(){
        queryProductionTreeList().then(res=>{
          if(res.success) this.workshopTreeData=res.result
        })
      }
    }
  }
</script>
<style scoped>
src/views/mdc/base/EquipmentOperationParamsAlarm.vue
@@ -4,13 +4,36 @@
    <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-col :md="6" :sm="6">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentid"></a-input>
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
          <a-col :md="6" :sm="6">
            <a-form-item label="设备类型">
              <a-select placeholder="请选择设备类型" :triggerChange="true" v-model="queryParam.equipmentType"
                        :allowClear="true">
                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
                  {{item.equipmentTypeName}}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="6">
            <a-form-item label="驱动类型">
              <a-auto-complete
                v-model="queryParam.driveType"
                :data-source="driveTypeList"
                placeholder="请选择驱动类型"
                :filter-option="filterOption"
                :allowClear="true"
              />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="6">
            <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>
@@ -27,21 +50,31 @@
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"></a-table>
      :loading="loading"
      @change="handleTableChange"
    ></a-table>
  </a-card>
</template>
<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import api from '@/api/mdc'
  import { putAction, getAction } from '@/api/manage'
  export default {
    name: 'EquipmentOperationParamsAlarm',
    mixins: [JeecgListMixin],
    created(){
      this.getDriveTypeByApi()
      this.queryGroup()
    },
    data() {
      return {
        name: 'EquipmentOperationParamsAlarm',
        description: '这是设备运行参数报警页面',
        queryParam: {},
        driveTypeList:[],
        selectList: [],
        columns: [
          {
            title: '#',
@@ -56,49 +89,102 @@
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentid',
            dataIndex: 'equipmentId',
            width: 250
          },
          {
            title: '报警时间',
            align: 'center',
            dataIndex: 'collecttime',
            dataIndex: 'createTime',
            width: 250
          },
          {
            title: '设定值',
            align: 'center',
            width: 250,
            dataIndex: 'setvalue'
            dataIndex: 'setValue'
          },
          {
            title: '实际值',
            align: 'center',
            width: 250,
            dataIndex: 'realvalue'
            dataIndex: 'realValue'
          },
          {
            title: '报警号',
            align: 'center',
            width: 250,
            dataIndex: 'alarmno'
          },
          // {
          //   title: '报警号',
          //   align: 'center',
          //   width: 250,
          //   dataIndex: 'alarmno'
          // },
          {
            title: '报警内容',
            align: 'center',
            width: 250,
            dataIndex: 'alarmcontent'
            dataIndex: 'alarmContent'
          }
        ],
        url: {
          list: '/mdc/equipmentBeilvAlarm/list'
          list: '/mdc/mdcOverrunAlarm/list',
          queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType'
        },
        ipagination:{
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['30', '50', '100'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        /* æŽ’序参数 */
        isorter: {
          column: 'collecttime',
          column: 'createTime',
          order: 'desc'
        }
      }
    },
    methods:{
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
       */
      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
        );
      },
      queryGroup() {
        getAction(this.url.queryEquipmentType).then(res => {
          if (res.success) {
            this.selectList = res.result
            // this.selectList = res.result.map((item, index, arr) => {
            //   return { label: item.id, value: item.equipmentTypeName + '' }
            // })
          } else {
            // this.$message.warning(res.message)
            this.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
          this.loading = false
        })
      },
    }
  }
</script>
src/views/mdc/base/MdcMessageApproval.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,178 @@
<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 :span="6">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :span="6">
            <a-form-item label="消息状态">
              <a-select v-model='queryParam.msgStatus' placeholder="请选择消息状态">
                <a-select-option v-for="item in msgStatusOptionList" :key="item.value" :value="item.value">
                  {{item.title}}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :span="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <a-table
      ref="table"
      size="default"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange">
      <span slot="action" slot-scope="text, record">
        <a @click="showModal(record,0)">查看</a>
        <a-divider type="vertical" v-if="record.hasProcess||record.hasConfirm"></a-divider>
        <a @click="showModal(record,1)" v-if="record.hasProcess">上报</a>
        <a-divider type="vertical" v-if="record.hasConfirm&&record.hasProcess"></a-divider>
        <a @click="showModal(record,2)" v-if="record.hasConfirm">确认</a>
        <!--<a @click="showModal(record,0)">查看</a>-->
        <!--<a-divider type="vertical"></a-divider>-->
        <!--<a @click="showModal(record,1)">上报</a>-->
        <!--<a-divider type="vertical"></a-divider>-->
        <!--<a @click="showModal(record,2)">确认</a>-->
      </span>
    </a-table>
    <mdc-message-approval-modal ref="modalRef" :title="modalTitle" :visible="modalVisible" :buttonId="buttonId"
                                @closeModal="modalVisible = false" @formHasSubmitted="loadData"/>
  </a-card>
</template>
<script>
  import { getAction, putAction } from '@/api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import MdcMessageApprovalModal from './modules/MdcMessageApproval/MdcMessageApprovalModal'
  export default {
    name: 'MdcMessageApproval',
    mixins: [JeecgListMixin],
    components: { MdcMessageApprovalModal },
    data() {
      return {
        description: 'mdc消息确认页面',
        queryParam: {},
        columns: [
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId'
          },
          {
            title: '标题',
            align: 'center',
            dataIndex: 'titile'
          }, {
            title: '内容',
            align: 'center',
            dataIndex: 'msgContent',
            width: 450
          }, {
            title: '原因',
            align: 'center',
            dataIndex: 'reportContent',
            width: 450
          }, {
            title: '处理人',
            align: 'center',
            dataIndex: 'senderNames'
          }, {
            title: '确认人',
            align: 'center',
            dataIndex: 'approverNames'
          }, {
            title: '状态',
            align: 'center',
            dataIndex: 'msgStatus',
            customRender: function(text) {
              if (text == '0') {
                return '待处理'
              } else if (text == '1') {
                return '待确认'
              } else if (text == '2') {
                return '已确认'
              } else {
                return '已拒绝'
              }
            }
          }, {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            scopedSlots: { customRender: 'action' }
          }],
        url: {
          list: '/mdc/mdcMessageApproval/list'
        },
        loading: false,
        msgStatusOptionList: [],
        modalTitle: '',
        modalVisible: false,
        buttonId: null
      }
    },
    created() {
      this.initDictData('mdcMsgStatus')
    },
    methods: {
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æ•°æ®å­—å…¸é…ç½®msgStatus
       * @param dictCode æ•°æ®å­—典编号
       */
      initDictData(dictCode) {
        //根据字典Code, åˆå§‹åŒ–字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            console.log('res================', res)
            this.msgStatusOptionList = res.result
          }
        })
      },
      /**
       * ç‚¹å‡»æŒ‰é’®å±•示弹窗
       * @param record ç‚¹å‡»è¡Œä¿¡æ¯
       * @param buttonId æŒ‰é’®Id(查看:0,上报:1,确认:2)
       */
      showModal(record, buttonId) {
        this.buttonId = buttonId
        switch (buttonId) {
          case 0:
            this.modalTitle = '消息内容'
            break
          case 1:
            this.modalTitle = '上报原因'
            break
          case 2:
            this.modalTitle = '确认消息'
            break
          default:
            this.modalTitle = '消息内容'
        }
        this.$refs.modalRef.formParams = Object.assign({}, record)
        this.modalVisible = true
      }
    }
  }
</script>
src/views/mdc/base/MdcUtilizationRateList.vue
@@ -9,7 +9,8 @@
              <a-input placeholder="请输入类别" v-model="queryParam.rateParameterCategory"></a-input>
            </a-form-item>
          </a-col>
          <a-col>
          <a-col :md="6" :sm="8">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
src/views/mdc/base/modules/DeviceProcessReport/DeviceProcessReportList.vue
@@ -12,6 +12,7 @@
                    :data-source="driveTypeList"
                    placeholder="请选择驱动类型"
                    :filter-option="filterOption"
                    allowClear
                  />
                </a-form-item>
              </a-col>
@@ -209,9 +210,13 @@
    methods: {
      dateParamChange(value) {
        this.dates = value
        console.log('value', value)
        this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
        this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
        if(!value.length) {
          delete this.queryParam.startTime
          delete this.queryParam.endTime
        }else{
          this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
          this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
        }
      },
      exportExcel() {
@@ -227,24 +232,15 @@
      },
      searchQuery() {
        if (this.dates != '') {
          if (this.queryParam.typeTree == '1') {
            this.queryParam.parentId = this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          } else {
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ''
          }
          this.queryParam.pageNo = 1
          this.loadData()
        if (this.queryParam.typeTree == '1') {
          this.queryParam.parentId = this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        } else {
          // this.$message.warning("请选择时间")
          this.$notification.warning({
            message: '消息',
            description: '请选择时间'
          })
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ''
        }
        // this.onClearSelected()
        this.queryParam.pageNo = 1
        this.loadData()
      },
      searchReset() {
src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -78,7 +78,7 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备功率" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-model-item label="设备功率(kw)" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入设备功率"
                       v-model="model.devicePower"/>
            </a-form-model-item>
@@ -118,11 +118,32 @@
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="系统类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag  placeholder="请选择系统类型" :triggerChange="true" dictCode="system_type" v-model="model.systemType" allow-clear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="设备级别" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag placeholder="请选择设备级别" dictCode="device_level" v-model="model.deviceLevel" allow-clear/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item label="设备种类" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-dict-select-tag placeholder="请选择设备种类" dictCode="device_category" v-model="model.deviceCategory" allow-clear/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="请输入排序"
                       v-model="model.sortNo" style="width: 100%"/>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span='12'>
            <a-form-model-item v-if="isDepartType == 0" label="系统版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="请输入系统版本号"
@@ -224,11 +245,14 @@
          equipmentModel: "",
          equipmentIp: "",
          dataPort: "",
          driveType: ""
          driveType: "",
          systemType: "",
          deviceLevel: "",
          deviceCategory: ""
        },
        labelCol: {
          xs: { span: 24 },
          sm: { span: 6 },
          sm: { span: 8 },
        },
        wrapperCol: {
          xs: { span: 24 },
src/views/mdc/base/modules/HolidayManagement/HolidayManagementList.vue
@@ -3,7 +3,7 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD"/>
@@ -235,7 +235,7 @@
    },
    methods: {
      dateParamChange(v1, v2) {
        // console.log(v1,v2)
        console.log(v1,v2)
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        // console.log(v2[0],v2[1])
@@ -350,8 +350,6 @@
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        getAction(this.url.list,param).then((res) => {
          if(res.success){
            this.dataSource = res.result.records||res.result;
@@ -437,8 +435,10 @@
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        if(this.queryParam.startTime && this.queryParam.endTime){
          param.startTime = this.queryParam.startTime;
          param.endTime =  this.queryParam.endTime;
        }
        // console.log(param);
        getAction(this.url.list,param).then((res) => {
          if(res.success){
src/views/mdc/base/modules/HolidayManagement/HolidayManagementModal.vue
@@ -36,7 +36,7 @@
      </a-form>
    </a-spin>
    <holiday-management-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></holiday-management-modal-list>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -53,11 +53,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'HolidayManagementModal',
    components: { SelectDeviceModal, HolidayManagementModalList},
    components: { SelectDeviceDrawer, HolidayManagementModalList},
    props: {},
    data() {
      return {
@@ -185,10 +185,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/MdcMessageApproval/MdcMessageApprovalModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,144 @@
<template>
  <a-modal :title="title"
           :maskClosable="true"
           @cancel="closeModal"
           :visible="visible"
           :footer="null">
    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :form="form" :model="formParams" :rules="validatorRules">
        <a-form-model-item label="设备编号" :labelCol="{span: 4}" :wrapperCol="{span: 8}">
          <a-input v-model="formParams.equipmentId" disabled></a-input>
        </a-form-model-item>
        <a-form-model-item label="标题" :labelCol="{span: 4}" :wrapperCol="{span: 20}">
          <a-input v-model="formParams.titile" disabled></a-input>
        </a-form-model-item>
        <a-form-model-item label="内容" :labelCol="{span: 4}" :wrapperCol="{span: 20}">
          <a-input v-model="formParams.msgContent" disabled></a-input>
        </a-form-model-item>
        <a-form-model-item label="原因" :labelCol="{span: 4}" :wrapperCol="{span: 20}" prop="reportContent"
                           v-if="buttonId===1">
          <a-textarea v-model="formParams.reportContent" :disabled="buttonId!==1"></a-textarea>
        </a-form-model-item>
        <a-form-model-item label="原因" :labelCol="{span: 4}" :wrapperCol="{span: 20}" v-else>
          <a-textarea v-model="formParams.reportContent" :disabled="buttonId!==1"></a-textarea>
        </a-form-model-item>
        <a-form-model-item label="确认" :labelCol="{span: 4}" :wrapperCol="{span: 12}" prop="isConfirm"
                           v-if="buttonId==2">
          <a-select v-model='formParams.isConfirm' placeholder="请选择是否确认">
            <a-select-option value="2">确认</a-select-option>
            <a-select-option value="3">拒绝</a-select-option>
          </a-select>
        </a-form-model-item>
      </a-form-model>
    </a-spin>
    <div class="drawer-bottom-button" v-show="buttonId!==0">
      <a-popconfirm title="确定放弃操作?" @confirm="closeModal" okText="确定" cancelText="取消">
        <a-button style="margin-right: .8rem">取消</a-button>
      </a-popconfirm>
      <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">提交</a-button>
    </div>
  </a-modal>
</template>
<script>
  import { postAction } from '@/api/manage'
  export default {
    name: 'MdcMessageApprovalModal',
    props: {
      visible: {
        type: Boolean
      },
      title: {
        type: String
      },
      buttonId: {
        type: Number
      }
    },
    data() {
      return {
        form: this.$form.createForm(this),
        formParams: {
          equipmentId: '',
          titile: '',
          msgContent: '',
          reportContent: '',
          msgStatus: '',
          isConfirm: ''
        },
        confirmLoading: false,
        validatorRules: {
          reportContent: [
            { required: true, message: '请输入上报原因' }
          ],
          isConfirm: [
            { required: true, message: '请选择是否确认' }
          ]
        },
        url: {
          reportUrl: '/mdc/mdcMessageApproval/reportReason',
          confirmUrl: '/mdc/mdcMessageApproval/handleConfirm'
        }
      }
    },
    methods: {
      closeModal() {
        this.$refs.form.clearValidate()
        this.$emit('closeModal')
      },
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            this.formParams.msgStatus = this.formParams.isConfirm
            let obj
            if (this.buttonId === 1) {
              obj = postAction(this.url.reportUrl, this.formParams)
            } else {
              obj = postAction(this.url.confirmUrl, this.formParams)
            }
            obj.then((res) => {
              if (res.success) {
                that.$notification.success({
                  message: '消息',
                  description: res.message
                })
                that.$emit('formHasSubmitted')
              } else {
                that.$notification.warning({
                  message: '消息',
                  description: res.message
                })
              }
            }).finally(() => {
              that.confirmLoading = false
              that.closeModal()
            })
          } else {
            return false
          }
        })
      }
    }
  }
</script>
<style scoped lang="less">
  .drawer-bottom-button {
    position: absolute;
    bottom: -25px;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
</style>
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -1,60 +1,63 @@
<template>
  <div class="device_list">
      <!-- æŸ¥è¯¢åŒºåŸŸ -->
      <div class="seach-content">
        <div class="table-page-search-wrapper">
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="24">
              <a-col :md="5" :sm="5" :xs="5">
                <a-form-item label="驱动类型">
                  <a-auto-complete
                    v-model="queryParam.driveType"
                    :data-source="driveTypeList"
                    placeholder="请选择驱动类型"
                    :filter-option="filterOption"
                  />
                </a-form-item>
              </a-col>
              <a-col :md="7" :sm="7" :xs="7">
                <a-form-item label="时间">
                  <a-range-picker
                    :placeholder="['开始时间', '结束时间']"
                    format="YYYY-MM"
                    :value="dates"
                    :mode="['month', 'month']"
                    @panelChange="dateParamChange"
                  />
                </a-form-item>
              </a-col>
              <a-col :md="2" :sm="2" :xs="2">
                <a-space>
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                  <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
                </a-space>
              </a-col>
            </a-row>
          </a-form>
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="seach-content">
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="5" :sm="5" :xs="5">
              <a-form-item label="驱动类型">
                <a-auto-complete
                  v-model="queryParam.driveType"
                  :data-source="driveTypeList"
                  placeholder="请选择驱动类型"
                  :filter-option="filterOption"
                  :allowClear="true"
                />
              </a-form-item>
            </a-col>
            <a-col :md="7" :sm="7" :xs="7">
              <a-form-item label="时间">
                <a-range-picker
                  :placeholder="['开始时间', '结束时间']"
                  format="YYYY-MM"
                  :value="dates"
                  :mode="['month', 'month']"
                  @panelChange="dateParamChange"
                  @change="handleDateChange"
                />
              </a-form-item>
            </a-col>
            <a-col :md="2" :sm="2" :xs="2">
              <a-space>
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
              </a-space>
            </a-col>
          </a-row>
        </a-form>
        </div>
      </div>
    </div>
      <div id="EfficiencyShift" style="flex:1;overflow: hidden">
        <a-table :columns="columns" rowKey="equipmentId" :dataSource="dataSource.records" :pagination="false" :scroll="{x:'max-content',y:scrollY}" bordered></a-table>
      </div>
     <!--<div class="pagination">-->
       <!--<a-pagination-->
         <!--:total=dataSource.total-->
         <!--:show-total="(total, range) => `${range[0]}-${range[1]} å…± ${total} æ¡`"-->
         <!--:page-size="+queryParam.pageSize"-->
         <!--:default-current="1"-->
         <!--:current=+queryParam.pageNo-->
         <!--show-size-changer-->
         <!--:pageSizeOptions="['20','30','40','50']"-->
         <!--@change="handlePageNoChange"-->
         <!--@showSizeChange="handlePageSizeChange"-->
       <!--/>-->
     <!--</div>-->
    <div id="EfficiencyShift" style="flex:1;overflow: hidden">
      <a-table :columns="columns" rowKey="id" :dataSource="dataSource.records" :loading="tableLoading"
               :pagination="false" :scroll="{x:'max-content',y:scrollY}" bordered></a-table>
    </div>
    <!--<div class="pagination">-->
    <!--<a-pagination-->
    <!--:total=dataSource.total-->
    <!--:show-total="(total, range) => `${range[0]}-${range[1]} å…± ${total} æ¡`"-->
    <!--:page-size="+queryParam.pageSize"-->
    <!--:default-current="1"-->
    <!--:current=+queryParam.pageNo-->
    <!--show-size-changer-->
    <!--:pageSizeOptions="['20','30','40','50']"-->
    <!--@change="handlePageNoChange"-->
    <!--@showSizeChange="handlePageSizeChange"-->
    <!--/>-->
    <!--</div>-->
  </div>
</template>
@@ -125,7 +128,7 @@
            align: 'center',
            width: 100,
            dataIndex: 'shift',
            ellipsis: true,
            ellipsis: true
          },
          {
            title: '每班小时',
@@ -269,7 +272,8 @@
        ],
        dataSource: [],
        driveTypeList: [],
        scrollY:465,
        scrollY: 465,
        tableLoading: false
      }
    },
    props: { nodeTree: '', Type: '', nodePeople: '' },
@@ -280,12 +284,12 @@
      this.loadData()
      this.getDriveTypeByApi()
    },
    mounted(){
      window.addEventListener('resize',this.handleWindowResize)
    mounted() {
      window.addEventListener('resize', this.handleWindowResize)
      this.handleWindowResize()
    },
    beforeDestroy(){
      window.removeEventListener('resize',this.handleWindowResize)
    beforeDestroy() {
      window.removeEventListener('resize', this.handleWindowResize)
    },
    watch: {
      Type(valmath) {
@@ -329,11 +333,19 @@
    },
    methods: {
      dateParamChange(value) {
        console.log('dateParamChangeValue', value)
        this.dates = value
        this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM')
        this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM')
      },
      handleDateChange(value) {
        console.log('handleDateChangeValue', value)
        if (!value.length) {
          delete this.queryParam.startTime
          delete this.queryParam.endTime
          this.dates = []
        }
      },
      initShiftList() {
        getAction(this.url.initShiftList).then((res) => {
          if (res.success) {
@@ -373,29 +385,20 @@
      },
      searchQuery() {
        if (this.dates != '') {
          if (this.queryParam.typeTree == '1') {
            this.queryParam.parentId = this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          } else {
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ''
          }
          this.queryParam.pageNo = 1
          this.loadData()
        if (this.queryParam.typeTree == '1') {
          this.queryParam.parentId = this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        } else {
          // this.$message.warning("请选择时间")
          this.$notification.warning({
            message: '消息',
            description: '请选择时间'
          })
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ''
        }
        // this.onClearSelected()
        this.queryParam.pageNo = 1
        this.loadData()
      },
      searchReset() {
        this.queryParam = {
          pageSize: 20,
          pageSize: 10000,
          pageNo: 1
        }
        this.dates = []
@@ -412,11 +415,17 @@
      },
      loadData() {
        getAction(this.url.list, this.queryParam).then(res => {
          if (res.success) {
            this.dataSource = res.result
          }
        })
        this.tableLoading = true
        getAction(this.url.list, this.queryParam)
          .then(res => {
            if (res.success) {
              this.dataSource = res.result
              this.tableLoading = false
            }
          })
          .finally(() => {
            this.tableLoading = false
          })
      },
      /**
@@ -453,9 +462,9 @@
      /**
       * å½“浏览器可视窗口尺寸发生改变时触发
       */
      handleWindowResize(){
        const boxHeight = +window.getComputedStyle(document.getElementById('EfficiencyShift')).height.slice(0,-2)
        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0,-2)
      handleWindowResize() {
        const boxHeight = +window.getComputedStyle(document.getElementById('EfficiencyShift')).height.slice(0, -2)
        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
        this.scrollY = boxHeight - tableHeadHeight
      }
    }
@@ -468,35 +477,39 @@
    margin: 20px 0;
  }
  .device_list{
  .device_list {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  @media screen and (min-width: 1920px){
    .device_list{
      height: 811px!important;
  @media screen and (min-width: 1920px) {
    .device_list {
      height: 811px !important;
    }
  }
  @media screen and (min-width: 1680px) and (max-width: 1920px){
    .device_list{
      height: 811px!important;
  @media screen and (min-width: 1680px) and (max-width: 1920px) {
    .device_list {
      height: 811px !important;
    }
  }
  @media screen and (min-width: 1400px) and (max-width: 1680px){
    .device_list{
      height: 663px!important;
  @media screen and (min-width: 1400px) and (max-width: 1680px) {
    .device_list {
      height: 663px !important;
    }
  }
  @media screen and (min-width: 1280px) and (max-width: 1400px){
    .device_list{
      height: 564px!important;
  @media screen and (min-width: 1280px) and (max-width: 1400px) {
    .device_list {
      height: 564px !important;
    }
  }
  @media screen and (max-width: 1280px){
    .device_list{
      height: 564px!important;
  @media screen and (max-width: 1280px) {
    .device_list {
      height: 564px !important;
    }
  }
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
@@ -3,7 +3,7 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYYMMDD"/>
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue
@@ -47,7 +47,7 @@
      </a-form>
    </a-spin>
    <!--<torqueconfiguration-modal-list ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></torqueconfiguration-modal-list>-->
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -64,11 +64,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'TorqueconfigurationModal',
    components: { SelectDeviceModal, TorqueconfigurationModalList},
    components: { SelectDeviceDrawer, TorqueconfigurationModalList},
    props: {},
    data() {
      return {
@@ -213,10 +213,10 @@
      //   // })
      // },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue
@@ -11,7 +11,7 @@
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
            <a-form-item label="日期">
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange"/>
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange" :allowClear="false"/>
            </a-form-item>
          </a-col>
          <a-col :md="2" :sm="2" :xs="2">
@@ -20,12 +20,6 @@
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
          <!--<a-col :md="2" :sm="2" :xs="2">-->
            <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
          <!--</a-col>-->
          <!--<a-col :md="2" :sm="2" :xs="2">-->
            <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
          <!--</a-col>-->
        </a-row>
      </a-form>
    </div>
@@ -94,14 +88,9 @@
  import moment from 'moment'
  import { putAction, getAction } from '@/api/manage'
  import $ from 'jquery'
  import AFormItem from 'ant-design-vue/es/form/FormItem'
  import * as echarts from 'echarts'
  export default {
    name: 'StatisticalAnalysisMain',
    components:{
      AFormItem
    },
    props: { equip: {} },
    data(){
      return{
@@ -121,7 +110,7 @@
        dates: [],
        queryParam: {},
        queryParams:{
          collectTime:undefined,
          collectTime:null,
        },
        shiftSubList: [],
        shiftList: [],
@@ -133,11 +122,11 @@
      }
    },
    created(){
      let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD');
      this.queryParams.collectTime = collectTime;
      this.queryParams.dateTime = this.queryParams.collectTime.format('YYYYMMDD')
      // let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD');
      this.queryParams.collectTime = moment().add(-1,'d').format('YYYY-MM-DD')
      this.queryParams.dateTime = moment().add(-1,'d').format('YYYYMMDD')
      this.initEquipmentNode()
      this.queryStatistical();
      // this.queryStatistical();
      // this.getTime(37800);
    },
@@ -414,31 +403,24 @@
        StartupLine.setOption(statChartPieOption2);
      },
      queryStatistical(){
        if(this.queryParams.collectTime){
          getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
            if(res.success) {
              // console.log(res);
              this.StatCharOpeningRate = res.result.openRate;
              //利用率
              this.StatCharUsedRate = res.result.utilizationRate;
              //开机率
              this.UtilizationHeight = res.result.openRate;
              this.StatCharUsedopeningRate = res.result.StartupHeight;
              this.StartupHeight = res.result.StartupHeight;
              this.openingLong = this.getTime(res.result.openLong)
              this.waitingLong = this.getTime(res.result.waitLong);
              this.processLong = this.getTime(res.result.processLong);
              this.closedLong = this.getTime(res.result.closeLong);
              this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
              this.draw();
            }
          })
        }else{
          this.$notification.warning({
            message:'消息',
            description:'请选择时间'
          })
        }
        getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
          if(res.success) {
            // console.log(res);
            this.StatCharOpeningRate = res.result.openRate;
            //利用率
            this.StatCharUsedRate = res.result.utilizationRate;
            //开机率
            this.UtilizationHeight = res.result.openRate;
            this.StatCharUsedopeningRate = res.result.StartupHeight;
            this.StartupHeight = res.result.StartupHeight;
            this.openingLong = this.getTime(res.result.openLong)
            this.waitingLong = this.getTime(res.result.waitLong);
            this.processLong = this.getTime(res.result.processLong);
            this.closedLong = this.getTime(res.result.closeLong);
            this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
            this.draw();
          }
        })
      },
      dataChange(val) {
        this.queryParam.collectTime1 = "";
@@ -454,7 +436,7 @@
            if(res.result[0]){
              _this.$set(this.queryParam, 'tierName', res.result[0].title)
              _this.$set(this.queryParams, 'parentId', res.result[0].key)
              _this.queryStatistical()            }
            }
            // console.log(res.result[0].entity.tierName)
            _this.queryStatistical()
          } else {
@@ -483,7 +465,11 @@
      },
      searchReset() {
        this.queryParam = {}
        this.queryParams = {}
        this.queryParams = {
          collectTime:moment().add(-1,'d').format('YYYY-MM-DD'),
          dateTime:moment().add(-1,'d').format('YYYYMMDD')
        }
        this.initEquipmentNode()
        // this.dates = []
        // this.queryStatistical()
        // this.onClearSelected()
src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue
@@ -11,7 +11,7 @@
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
            <a-form-item label="日期">
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange"/>
              <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange" :allowClear="false"/>
            </a-form-item>
          </a-col>
          <a-col :md="2" :sm="2" :xs="2">
@@ -20,12 +20,6 @@
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
          <!--<a-col :md="2" :sm="2" :xs="2">-->
            <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
          <!--</a-col>-->
          <!--<a-col :md="2" :sm="2" :xs="2">-->
            <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
          <!--</a-col>-->
        </a-row>
      </a-form>
    </div>
@@ -97,14 +91,9 @@
  import moment from 'moment'
  import { putAction, getAction } from '@/api/manage'
  import $ from 'jquery'
  import AFormItem from 'ant-design-vue/es/form/FormItem'
  import * as echarts from 'echarts'
  export default {
    name: 'StatisticsLegend',
    components:{
      AFormItem
    },
    props: { equip: {} },
    data(){
      return{
@@ -136,16 +125,11 @@
      }
    },
    created(){
      let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD');
      this.queryParams.collectTime = collectTime;
      this.queryParams.dateTime = this.queryParams.collectTime.format('YYYYMMDD')
      this.initEquipmentNode('-1')
      this.queryStatistical();
      this.queryParams.collectTime = moment().add(-1,'d').format('YYYY-MM-DD')
      this.queryParams.dateTime = moment().add(-1,'d').format('YYYYMMDD')
      this.initEquipmentNode()
      // this.queryStatistical();
      // this.getTime(37800);
    },
@@ -595,45 +579,38 @@
        StartupLine.setOption(StartupLine_option);
      },
      queryStatistical(){
        if(this.queryParams.collectTime){
          getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
            if(res.success){
              this.StatCharOpeningRate = res.result.openRate;
              this.StatCharUsedRate = res.result.utilizationRate;
              this.UtilizationHeight = res.result.openRate;
              this.StatCharUsedopeningRate = res.result.usedOpenRate;
              this.StartupHeight = res.result.usedOpenRate;
              this.openingLong = this.getTime(res.result.openLong)
              this.waitingLong = this.getTime(res.result.waitLong);
              this.processLong = this.getTime(res.result.processLong);
              this.closedLong = this.getTime(res.result.closeLong);
              this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
              this.draw();
            }
          })
        }else{
          this.$notification.warning({
            message:'消息',
            description:'请选择时间'
          })
        }
        getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
          if(res.success){
            this.StatCharOpeningRate = res.result.openRate;
            this.StatCharUsedRate = res.result.utilizationRate;
            this.UtilizationHeight = res.result.openRate;
            this.StatCharUsedopeningRate = res.result.usedOpenRate;
            this.StartupHeight = res.result.usedOpenRate;
            this.openingLong = this.getTime(res.result.openLong)
            this.waitingLong = this.getTime(res.result.waitLong);
            this.processLong = this.getTime(res.result.processLong);
            this.closedLong = this.getTime(res.result.closeLong);
            this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
            this.draw();
          }
        })
      },
      dataChange(val) {
        this.queryParam.collectTime1 = "";
        if(val){
          this.queryParams.dateTime = val.format('YYYYMMDD')
          this.queryParams.collectTime = val.format('YYYY-MM-DD');
        }
      },
      initEquipmentNode(id) {
      initEquipmentNode() {
        let _this = this
        getAction(this.url.getBaseTree).then((res) => {
          if (res.success) {
            if(res.result[0]){
              _this.$set(this.queryParam, 'tierName', res.result[0].title)
              _this.$set(this.queryParams, 'parentId', res.result[0].key)
            }
            this.queryStatistical()
            // console.log(res.result[0].entity.tierName)
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
@@ -660,7 +637,11 @@
      },
      searchReset() {
        this.queryParam = {}
        this.queryParams = {}
        this.queryParams = {
          collectTime:moment().add(-1,'d').format('YYYY-MM-DD'),
          dateTime:moment().add(-1,'d').format('YYYYMMDD')
        }
        this.initEquipmentNode()
        // this.dates = []
        // this.queryStatistical()
        // this.onClearSelected()
src/views/mdc/base/modules/TorqueconfigurationList/TorqueconfigurationModal.vue
@@ -40,7 +40,7 @@
        </a-row>
      </a-form>
    </a-spin>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -57,11 +57,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'TorqueconfigurationModal',
    components: { SelectDeviceModal },
    components: { SelectDeviceDrawer },
    props: {},
    data() {
      return {
@@ -198,10 +198,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerList.vue
@@ -3,18 +3,18 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD HH:mm"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
          <a-col :md="5" :sm="5">
            <a-form-item label="设备编号">
              <a-input placeholder="输入设备编号查询" v-model="queryParams.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
          <a-col :md="5" :sm="5" :xs="5">
            <a-form-item label="设备名称">
              <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input>
            </a-form-item>
src/views/mdc/base/modules/UnplannedDowntimemManager/UnplannedDowntimemManagerModal.vue
@@ -43,7 +43,7 @@
        </a-row>
      </a-form>
    </a-spin>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -59,11 +59,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'UnplannedDowntimemManagerModal',
    components: { SelectDeviceModal,JDate},
    components: { SelectDeviceDrawer,JDate},
    props: {},
    data() {
      return {
@@ -200,10 +200,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue
@@ -8,7 +8,7 @@
            <a-col :md="7" :sm="7">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD"
                                v-model="dates"/>
                                v-model="dates" :allowClear="false"/>
              </a-form-item>
            </a-col>
            <a-col :lg="2" :md="2" :sm="2" :xs="2">
@@ -311,93 +311,15 @@
        this.queryParam.endDate = v2[1]
      },
      searchQuery() {
        if (this.dates && this.dates.length > 0) {
          if (this.queryParam.typeTree == '1') {
            this.queryParam.parentId = this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          } else {
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ''
          }
          this.loadData1()
        if (this.queryParam.typeTree == '1') {
          this.queryParam.parentId = this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        } else {
          this.$notification.warning({
            message: '提示',
            description: '请选择时间'
          })
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ''
        }
        // this.onClearSelected()
        this.loadData1()
      },
      // searchReset() {
      //   this.typeTree = this.queryParam.typeTree
      //   this.typeParent =  this.queryParam.parentId
      //   this.typeEquipment = this.queryParam.equipmentId
      //   this.queryParam = {}
      //   this.dates = []
      //   this.queryParam.typeTree = this.typeTree
      //   this.queryParam.parentId = this.typeParent
      //   this.queryParam.equipmentId =  this.typeEquipment
      //   // this.ipagination.current = 1
      //   this.loadData1();
      //   // this.queryParam = {}
      //   // this.dates = []
      //   // this.loadData()
      //   // this.onClearSelected()
      // },
      // loadData1() {
      //   let that = this
      //   that.columns=[
      //     {
      //       title: '设备编号',
      //       align: 'center',
      //       dataIndex: 'equipmentId',
      //       width:'150px'
      //     },
      //     {
      //       title: '设备名称',
      //       align: 'center',
      //       dataIndex: 'equipmentName',
      //       width:'150px'
      //     },
      //   ]
      //   that.tableHeads = []
      //   that.dataList = []
      //   getAction(this.url.efficiencyList, that.queryParam).then(res => {
      //     var tmp = {}
      //     console.log(res)
      //     if (res.success)
      //
      //       that.dataSource = res.result.mdcEfficiencyList
      //       for(var k = 0;k<that.dataSource[0].dataList.length;k++){
      //         that.columns.push(
      //           {
      //             title:that.dataSource[0].dataList.theDate,
      //             align: 'center',
      //             width:'120px',
      //             // dataIndex:'utilizationRate',
      //           }
      //         )
      //       }
      //       for(var i = 0;i<that.dataSource.length;i++){
      //         for (var j = 0; j < that.dataSource[i].dataList.length;j++){
      //           // that.columns.push(
      //           //   {
      //           //     title:that.dataSource[0].dataList[j].theDate,
      //           //     align: 'center',
      //           //     width:'120px',
      //           //     dataIndex:'utilizationRate',
      //           //   }
      //           // )
      //         }
      //
      //       }
      //       console.log(that.columns)
      //       console.log(that.dataSource)
      //       // this.initDeviceType(this.dataList)
      //       this.draw()
      //     }
      //   }
      loadData1() {
        this.outerDataLoading = true
        this.tableHeads = []
src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue
@@ -29,7 +29,7 @@
            </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="是否过滤" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-form-item label="是否启用" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <!--<j-switch  v-model="model.isUse"></j-switch>-->
                <a-switch  v-model="isUse"/>
                <!--<a-radio-group v-model="model.isUse">-->
src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue
@@ -30,11 +30,12 @@
                :data-source="driveTypeList"
                placeholder="请选择驱动类型"
                :filter-option="filterOption"
                :allowClear="true"
              />
            </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="是否过滤" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-form-item label="是否启用" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-switch :checked="isFilterChecked"  v-decorator="['isUse', validatorRules.isUse]" @change="isFilterChange"></a-switch>
              </a-form-item>
            </a-col>
src/views/mdc/base/modules/alarmManager/alarmManagerModal.vue
@@ -22,7 +22,7 @@
              </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="是否过滤" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-form-item label="是否启用" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-switch :default-checked = 'showM' v-decorator="['isUse', validatorRules.isUse]"></a-switch>
              </a-form-item>
            </a-col>
src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue
@@ -61,7 +61,7 @@
      <!-- table区域-end -->
    </div>
    <selectDeviceModal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"></selectDeviceModal>
    <SelectDeviceDrawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"></SelectDeviceDrawer>
  </div>
</template>
@@ -84,7 +84,7 @@
  import Tooltip from 'ant-design-vue/es/tooltip'
  import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
  import api from '@/api/mdc'
  import selectDeviceModal from '../../../../system/modules/SelectDeviceModal.vue'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer.vue'
  export default {
    name: 'comparativeAnalysismain',
@@ -98,7 +98,7 @@
      JInput,
      JDate,
      JEllipsis,
      selectDeviceModal
      SelectDeviceDrawer
    },
    props: { nodeTree: '', Type: '', nodePeople: '' },
    data() {
@@ -438,10 +438,10 @@
      // },
      deviceSearch() {
        console.log('触发')
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.queryParam.equipmentId.split(',')
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.queryParam.equipmentId.split(',')
      },
      /**
src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue
@@ -44,7 +44,7 @@
        </a-form>
      </a-spin>
      <device-calend-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-calend-list-model>
      <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
      <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
    </a-modal>
  </div>
</template>
@@ -63,11 +63,11 @@
  } from '@/api/api'
  import Calendar from 'vue-calendar-component';
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'ShiftInfoModel',
    components: { SelectDeviceModal, DeviceCalendListModel,Calendar},
    components: { SelectDeviceDrawer, DeviceCalendListModel,Calendar},
    props: {},
    data() {
      return {
@@ -241,10 +241,10 @@
        this.value = value;
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
      },
      getDeviceRows(val) {
        console.log("========",val);
src/views/mdc/base/modules/deviceLog/LogInfo.vue
@@ -174,7 +174,7 @@
  import { getAction } from '@/api/manage'
  // import {mapActions} from 'vuex'
  export default {
    components: {
     components: {
      LogList,
      WorkLogList,
      AlarmLogList,
@@ -332,28 +332,21 @@
      },
      searchQuery() {
        // console.log(this.queryParams.collectTime)
        if (this.queryParams.collectTime != undefined) {
          this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
          if (!this.queryParams.equipmentId || !this.queryParams.equipmentName) {
            this.$notification.warning({
              message: '消息',
              description: '请选择设备'
            })
            return false
          }
          this.queryChart()
        } else {
          // this.$message.warning("请选择时间")
          console.log('触发提示')
        this.queryParams.collectTimeStr = this.queryParams.collectTime.format('YYYY-MM-DD')
        if (!this.queryParams.equipmentId || !this.queryParams.equipmentName) {
          this.$notification.warning({
            message: '消息',
            description: '请选择时间'
            description: '请选择设备'
          })
          return false
        }
        this.queryChart()
        // this.queryList()
      },
      searchReset() {
        this.queryParams = {}
        this.queryParams = {
          collectTime : moment()
      }
        // this.queryList()
        this.equipment = {}
        this.queryChart()
src/views/mdc/base/modules/deviceLog/LogList.vue
@@ -3,7 +3,8 @@
    <!-- table区域-begin -->
    <div class="table_logList">
      <a-table ref="table" bordered size="middle" :rowKey="(record,index)=>{return index}" :columns="columns"
               :dataSource="dataList" :pagination="ipagination" :loading="loadingequip"  @change="handleTableChange" :customRow="rowClick">
               :dataSource="dataList" :pagination="ipagination" :loading="loadingequip" @change="handleTableChange"
               :customRow="rowClick">
        <template slot="status" slot-scope="status">
          <div v-if="status == '3' || status ==  '23'" style="color: #00ee00;width: 100%; height: 100%;">运行</div>
          <div v-else-if="status == '1' || status == '2'" style="color: #ffea91;width: 100%; height: 100%;">待机</div>
@@ -29,6 +30,7 @@
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  import moment from 'moment'
  export default {
    name: 'LogList',
    mixins: [JeecgListMixin],
@@ -44,26 +46,24 @@
        required: true,
        default: []
      },
      loadingequip:{
        type:Boolean,
      loadingequip: {
        type: Boolean,
        default: false
      }
    },
    watch:{
    },
    watch: {},
    data() {
      return {
        statusName: '',
        disabled: true,
        disableMixinCreated: true,
        loading: false,
        ipagination:{
        ipagination: {
          current: 1,
          pageSize: 100,
          pageSizeOptions: ['100', '500', '1000'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
            return range[0] + '-' + range[1] + ' å…±' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
@@ -79,14 +79,14 @@
          {
            title: '开始时间',
            align: 'center',
            dataIndex: 'startTime',
            dataIndex: 'startTime'
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.startTime>b.startTime?1:-1}
          },
          {
            title: '结束时间',
            align: 'center',
            dataIndex: 'endTime',
            dataIndex: 'endTime'
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.endTime>b.endTime?1:-1}
          },
@@ -94,25 +94,25 @@
            title: '持续时间',
            align: 'center',
            dataIndex: 'duration',
            customRender:(t,r,index) =>{
            customRender: (t, r, index) => {
              // console.log(t)
              var ss = parseInt(t)
              if(ss>=3600){
              if (ss >= 3600) {
                // æ ¹æ®ç§’数转换成对应的时分秒
                const hour = parseInt(ss / 3600) < 10 ? '0' + parseInt(ss / 3600) : parseInt(ss / 3600)
                const min = parseInt(ss % 3600 / 60) < 10 ? '0' + parseInt(ss % 3600 / 60) : parseInt(ss % 3600 / 60)
                const sec = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
                if(min == '00') {
                  if(sec == '00'){
                if (min == '00') {
                  if (sec == '00') {
                    return hour + '小时'
                  }else{
                    return hour + '小时'+ sec + '秒'
                  } else {
                    return hour + '小时' + sec + '秒'
                  }
                }else{
                  if(sec == '00') {
                } else {
                  if (sec == '00') {
                    return hour + '小时' + min + '分'
                  }else{
                  } else {
                    return hour + '小时' + min + '分' + sec + '秒'
                  }
                }
@@ -124,11 +124,11 @@
                // }
                // return hour + '小时' + min + '分' + sec + '秒'
              }else if(60<ss && ss<3600){
              } else if (60 < ss && ss < 3600) {
                const min1 = parseInt(ss % 3600 / 60) < 10 ? '0' + parseInt(ss % 3600 / 60) : parseInt(ss % 3600 / 60)
                const sec1 = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
                return  min1 + '分' + sec1 + "秒"
              }else{
                return min1 + '分' + sec1 + '秒'
              } else {
                const sec2 = parseInt(ss % 3600 % 60) < 10 ? '0' + parseInt(ss % 3600 % 60) : parseInt(ss % 3600 % 60)
                return sec2 + '秒'
              }
@@ -149,10 +149,10 @@
        //分页、排序、筛选变化时触发
        //TODO ç­›é€‰
        if (Object.keys(sorter).length > 0) {
          this.isorter.column = sorter.field;
          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
          this.isorter.column = sorter.field
          this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
        }
        this.ipagination = pagination;
        this.ipagination = pagination
        // this.loadData();
      },
      /**
@@ -160,15 +160,17 @@
       * @param record ç‚¹å‡»çš„当前行数据
       * @returns {{on: {click: on.click}}} æ·»åŠ äº‹ä»¶å¯¹è±¡
       */
      rowClick(record){
      rowClick(record) {
        return {
          on:{
            click:()=>{
              const timeObj={
                start:moment(record.startTime),
                end:moment(record.endTime)
          on: {
            click: () => {
              // å…³æœºçŠ¶æ€è®¾å¤‡æ—¥å¿—ä¸å¼¹å‡ºå·¥ä½œæ›²çº¿
              if (record.status === 0) return
              const timeObj = {
                start: moment(record.startTime),
                end: moment(record.endTime)
              }
              this.$bus.$emit('tableRowRecord',timeObj)
              this.$bus.$emit('tableRowRecord', timeObj)
            }
          }
        }
@@ -182,33 +184,38 @@
<style lang="less" scoped>
  @import '~@assets/less/common.less';
  @media screen and (min-width: 1920px){
    .table_logList{
      height: 417px!important;
  @media screen and (min-width: 1920px) {
    .table_logList {
      height: 417px !important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1680px) and (max-width: 1920px){
    .table_logList{
      height: 417px!important;
  @media screen and (min-width: 1680px) and (max-width: 1920px) {
    .table_logList {
      height: 417px !important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1400px) and (max-width: 1680px){
    .table_logList{
      height: 266px!important;
  @media screen and (min-width: 1400px) and (max-width: 1680px) {
    .table_logList {
      height: 266px !important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1280px) and (max-width: 1400px){
    .table_logList{
      height: 360px!important;
  @media screen and (min-width: 1280px) and (max-width: 1400px) {
    .table_logList {
      height: 360px !important;
      overflow: scroll;
    }
  }
  @media screen and (max-width: 1280px){
    .table_logList{
      height: 170px!important;
  @media screen and (max-width: 1280px) {
    .table_logList {
      height: 170px !important;
      overflow: scroll;
    }
  }
src/views/mdc/base/modules/deviceLog/WorkChartModel.vue
@@ -160,20 +160,19 @@
              temp.push({ label: item.chineseName, value: item.id, englishName: item.englishName })
            }
            that.plainOptions = temp
            if (temp.length > 0) {
              that.option = [temp[0].value]
              let param = {
                driveType: that.node.driveType,
                equipmentId: that.node.equipmentId,
                date: that.queryParams.paramDateStr,
                start: that.queryParams.startStr,
                end: that.queryParams.endStr,
                interval: that.queryParams.period,
                codeTypeId: that.option.join(',')
              }
              that.initChart(param)
            }
            let param = {
              driveType: that.node.driveType,
              equipmentId: that.node.equipmentId,
              date: that.queryParams.paramDateStr,
              start: that.queryParams.startStr,
              end: that.queryParams.endStr,
              interval: that.queryParams.period,
              codeTypeId: that.option.join(',')
            }
            that.initChart(param)
          }
        })
      },
@@ -230,7 +229,7 @@
        this.queryParams = {
          equipmentId: node.equipmentId,
          equipmentName: node.equipmentName,
          period: 1000,
          period: 100,
          paramDate: paramDate,
          paramDateStr: paramDate.format('yyyy-MM-DD'),
          start: start,
@@ -312,10 +311,10 @@
              position: 'left',
              boundaryGap: [0, '15%'],
              axisLine: {
                show: true
                // lineStyle:{
                //   color:'#000000'
                // }
                show: true,
                lineStyle:{
                  color:'#5470C6'
                }
              }
            },
            {
@@ -325,10 +324,10 @@
              position: 'left',
              boundaryGap: [0, '15%'],
              axisLine: {
                show: true
                // lineStyle:{
                //   color:'#000000'
                // }
                show: true,
                lineStyle:{
                  color:'#91CC75'
                }
              }
            },
            {
@@ -338,10 +337,10 @@
              position: 'left',
              boundaryGap: [0, '15%'],
              axisLine: {
                show: true
                // lineStyle:{
                //   color:'#000000'
                // }
                show: true,
                lineStyle:{
                  color:'#FAC858'
                }
              }
            }
          ],
@@ -377,6 +376,7 @@
            temp.push(item)
          }
        }
        console.log('temp',temp)
        getAction(this.url.workChart, param).then((res) => {
          if (JSON.stringify(res.result) == '[]' || res.result == null) {
            // this.$message.warning('无数据!')
@@ -423,12 +423,13 @@
                symbol: 'circle',
                symbolSize: 10,
                yAxisIndex: i,
                data: itemLine
              }
              result.push(line)
            }
            console.log('result===========',result)
            console.log('legend=============',lengenddata)
            // option.yAxis = Yarr;
            option.series = result
            option.legend = lengenddata
src/views/mdc/base/modules/deviceRepair/DeviceRepairList.vue
@@ -9,12 +9,12 @@
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD HH:mm:ss"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
          <a-col :md="5" :sm="5">
            <a-form-item label="设备编号">
              <a-input placeholder="输入设备编号查询" v-model="queryParams.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
          <a-col :md="5" :sm="5" :xs="5">
            <a-form-item label="设备名称">
              <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input>
            </a-form-item>
src/views/mdc/base/modules/deviceRepair/DeviceRepairModel.vue
@@ -74,7 +74,7 @@
        <!--</a-row>-->
      </a-form>
    </a-spin>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -91,11 +91,11 @@
    duplicateCheck
  } from '@/api/api'
  import Vue from 'vue'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'DeviceRepairModel',
    components: { SelectDeviceModal, JDate },
    components: { SelectDeviceDrawer, JDate },
    props: {
      equipmentId: {
        type: String
@@ -273,10 +273,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue
@@ -5,7 +5,7 @@
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="4" :sm="4">
            <a-col :md="5" :sm="5">
              <a-form-item label="设备类型">
                <a-select placeholder="请选择设备类型" :triggerChange="true" v-model="queryParam.equipmentType" :allowClear="true">
                  <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
@@ -14,17 +14,23 @@
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates"/>
            <a-col :md="5" :sm="5">
              <a-form-item label="驱动类型">
                <a-auto-complete
                  v-model="queryParam.driveType"
                  :data-source="driveTypeList"
                  placeholder="请选择驱动类型"
                  :filter-option="filterOption"
                  :allowClear="true"
                />
              </a-form-item>
            </a-col>
            <a-col :md="14" :sm="14" style="display: flex;align-items: flex-start;-webkit-align-items: flex-start;justify-content: space-between;">
              <a-space>
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
              </a-space>
            <a-col :md="6" :sm="6">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" :allowClear="false"/>
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="8" style="display: flex;align-items: flex-start;-webkit-align-items: flex-start;justify-content: space-between;">
              <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;margin-left: 24px">
                <tr>
                  <td v-for="(item, index) in identifying">{{item.title}}</td>
@@ -39,8 +45,15 @@
              </table>
            </a-col>
          </a-row>
          <a-row :gutter="24">
            <a-col :md="15" :sm="15">
          <a-row :gutter="24" type="flex" align="middle">
            <a-col :md="5" :sm="5">
              <a-space>
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
              </a-space>
            </a-col>
            <a-col :md="19" :sm="19">
              <a-checkbox-group :value="checkedList" :default-value="['lyl']" :options="efficiencyOptions"
                                @change="efficiencyOptionsOnChange"/>
            </a-col>
@@ -150,6 +163,8 @@
import $ from 'jquery'
import '@/components/table2excel/table2excel'
import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
import api from '@/api/mdc'
export default {
  name: 'EfficiencyPOList',
  components: {},
@@ -164,6 +179,7 @@
      queryParamEquip:{},
      queryParamPeople:{},
      identifying: [],
      driveTypeList:[],
      efficiencyOptions: [
        { label: '开动率', value: 'lyl' },
        { label: '开机率', value: 'kjl' },
@@ -192,6 +208,7 @@
    this.queryParam.typeTree = "1"
    this.loadData()
    this.queryGroup()
    this.getDriveTypeByApi()
  },
  watch: {
    Type(valmath){
@@ -423,10 +440,12 @@
      this.typeParent =  this.queryParam.parentId
      this.typeEquipment = this.queryParam.equipmentId
      this.queryParam = {}
      this.dates = []
      this.queryParam.typeTree = this.typeTree
      this.queryParam.parentId = this.typeParent
      this.queryParam.equipmentId =  this.typeEquipment
      this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)]
      this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
      this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
      // this.ipagination.current = 1
      this.loadData();
      // this.queryParam = {}
@@ -443,6 +462,12 @@
          // console.log(res.result)
          this.tableHeads = res.result.dates
          this.dataList = res.result.mdcEfficiencyList
          if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) {
            this.$notification.info({
              message: '消息',
              description: '暂无该设备类型数据'
            })
          }
          this.checkSameData(this.dataList)
          this.checkSameData1(this.dataList)
          this.checkSameData2(this.dataList)
@@ -470,7 +495,28 @@
      }).finally(() => {
        this.loading = false
      })
    }
    },
    /**
     * è°ƒç”¨æŽ¥å£èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
     */
    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>
src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue
@@ -6,7 +6,7 @@
        <div class="table-page-search-wrapper">
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="24">
              <a-col :md="4" :sm="4">
              <a-col :md="5" :sm="5">
                <a-form-item label="设备类型">
                  <a-select placeholder="请选择设备类型" :triggerChange="true" v-model="queryParam.equipmentType"
                            :allowClear="true">
@@ -16,19 +16,31 @@
                  </a-select>
                </a-form-item>
              </a-col>
              <a-col :md="5" :sm="5">
                <a-form-item label="驱动类型">
                  <a-auto-complete
                    v-model="queryParam.driveType"
                    :data-source="driveTypeList"
                    placeholder="请选择驱动类型"
                    :filter-option="filterOption"
                  />
                </a-form-item>
              </a-col>
              <a-col :md="6" :sm="6">
                <a-form-item label="时间">
                  <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD"
                                  v-model="dates"/>
                                  v-model="dates" :allowClear="false"/>
                </a-form-item>
              </a-col>
              <a-col :md="14" :sm="14" style="display: flex;align-items: flex-start;-webkit-align-items: flex-start;justify-content: space-between;">
                <a-space>
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                  <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
                  <a-button type="primary" icon="printer" v-print="'#Efficiency'" v-has="'efficiency:print'">打印</a-button>
                </a-space>
              <a-col :md="8" :sm="8"
                     style="display: flex;align-items: flex-start;-webkit-align-items: flex-start;justify-content: space-between;">
                <!--<a-space>-->
                  <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
                  <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
                  <!--<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>-->
                  <!--<a-button type="primary" icon="printer" v-print="'#Efficiency'" v-has="'efficiency:print'">打印-->
                  <!--</a-button>-->
                <!--</a-space>-->
                <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;margin-left: 24px">
                  <tr>
                    <td v-for="(item, index) in identifying">{{item.title}}</td>
@@ -43,8 +55,17 @@
                </table>
              </a-col>
            </a-row>
            <a-row :gutter="24">
              <a-col :md="15" :sm="15">
            <a-row :gutter="24" type="flex" align="middle">
              <a-col :md="6" :sm="6">
                <a-space>
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                  <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
                  <a-button type="primary" icon="printer" v-print="'#Efficiency'" v-has="'efficiency:print'">打印
                  </a-button>
                </a-space>
              </a-col>
              <a-col :md="18" :sm="18">
                <a-checkbox-group :value="checkedList" :default-value="['lyl']" :options="efficiencyOptions"
                                  @change="efficiencyOptionsOnChange"/>
              </a-col>
@@ -52,18 +73,18 @@
          </a-form>
        </div>
        <!--<div style="width: 530px;position: absolute;top: 0; right: 1.5%;">-->
          <!--<table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;">-->
            <!--<tr>-->
              <!--<td v-for="(item, index) in identifying">{{item.title}}</td>-->
            <!--</tr>-->
            <!--<tr>-->
              <!--<td style="text-align:center;" v-for="(item, index) in identifying">-->
                <!--<div class="identifyingclass" :style="{background: item.color}"></div>-->
              <!--</td>-->
              <!--&lt;!&ndash;<td style="text-align:center;"><div style="width: 55px;height: 15px;background-color: #e8ff37;display:inline-block"></div></td>&ndash;&gt;-->
              <!--&lt;!&ndash;<td style="text-align:center;"><div style="width: 55px;height: 15px;background-color: #99ff4e;display:inline-block"></div></td>&ndash;&gt;-->
            <!--</tr>-->
          <!--</table>-->
        <!--<table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;">-->
        <!--<tr>-->
        <!--<td v-for="(item, index) in identifying">{{item.title}}</td>-->
        <!--</tr>-->
        <!--<tr>-->
        <!--<td style="text-align:center;" v-for="(item, index) in identifying">-->
        <!--<div class="identifyingclass" :style="{background: item.color}"></div>-->
        <!--</td>-->
        <!--&lt;!&ndash;<td style="text-align:center;"><div style="width: 55px;height: 15px;background-color: #e8ff37;display:inline-block"></div></td>&ndash;&gt;-->
        <!--&lt;!&ndash;<td style="text-align:center;"><div style="width: 55px;height: 15px;background-color: #99ff4e;display:inline-block"></div></td>&ndash;&gt;-->
        <!--</tr>-->
        <!--</table>-->
        <!--</div>-->
      </div>
@@ -123,7 +144,9 @@
                    </div>
                  </td>
                  <td class="tdgu3  kaitou">{{item.equipmentId}}</td>
                  <td class="tdgu4 kaitou" style="min-width: 162px; max-width: 162px;width: 162px;">{{item.equipmentName}}</td>
                  <td class="tdgu4 kaitou" style="min-width: 162px; max-width: 162px;width: 162px;">
                    {{item.equipmentName}}
                  </td>
                  <td class="tdgu5 kaitou">{{item.equipmentType}}</td>
                </template>
@@ -169,6 +192,7 @@
  import $ from 'jquery'
  import '@/components/table2excel/table2excel'
  import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
  import api from '@/api/mdc'
  export default {
    name: 'EfficiencyList',
@@ -183,6 +207,7 @@
        deviceTypeDict: '',
        dates: [],
        selectList: [],
        driveTypeList:[],
        identifying: [],
        queryParam: {},
        queryParams: {},
@@ -223,6 +248,7 @@
      this.queryParam.typeTree = '1'
      this.loadData()
      this.queryGroup()
      this.getDriveTypeByApi()
    },
    watch: {
      Type(valmath) {
@@ -480,10 +506,12 @@
        this.typeParent = this.queryParam.parentId
        this.typeEquipment = this.queryParam.equipmentId
        this.queryParam = {}
        this.dates = []
        this.queryParam.typeTree = this.typeTree
        this.queryParam.parentId = this.typeParent
        this.queryParam.equipmentId = this.typeEquipment
        this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)]
        this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
        this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
        // this.ipagination.current = 1
        this.loadData()
        // this.queryParam = {}
@@ -499,6 +527,12 @@
          if (res.success) {
            this.tableHeads = res.result.dates
            this.dataList = res.result.mdcEfficiencyList
            if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) {
              this.$notification.info({
                message: '消息',
                description: '暂无该设备类型数据'
              })
            }
            this.distinguishColorList = res.result.utilizationRateList
            this.checkSameData(this.dataList)
            this.checkSameData1(this.dataList)
@@ -528,6 +562,27 @@
        }).finally(() => {
          this.loading = false
        })
      },
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
       */
      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
        );
      },
    }
  }
@@ -636,7 +691,7 @@
    left: 412px;
  }
  #Efficiency{
  #Efficiency {
    overflow: hidden;
  }
src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue
@@ -6,7 +6,7 @@
        <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="4" :sm="4" >
            <a-col :md="5" :sm="5" >
              <a-form-item label="设备类型">
                <a-select placeholder="请选择设备类型" :triggerChange="true" v-model="queryParam.equipmentType" :allowClear="true">
                  <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
@@ -15,9 +15,19 @@
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="5" :sm="5">
              <a-form-item label="驱动类型">
                <a-auto-complete
                  v-model="queryParam.driveType"
                  :data-source="driveTypeList"
                  placeholder="请选择驱动类型"
                  :filter-option="filterOption"
                />
              </a-form-item>
            </a-col>
            <a-col :md="5" :sm="5" :xs="5">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates"/>
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" :allowClear="false"/>
              </a-form-item>
            </a-col>
            <a-col :md="4" :sm="4" :xs="4">
@@ -39,18 +49,25 @@
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="7" :sm="7" :xs="7">
              <a-space>
                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
              </a-space>
            </a-col>
            <!--<a-col :md="7" :sm="7" :xs="7">-->
              <!--<a-space>-->
                <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
                <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
                <!--<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>-->
              <!--</a-space>-->
            <!--</a-col>-->
          </a-row>
          <a-row :gutter="24">
            <a-col :md="24" :sm="24" :xs="24" style="display: flex;justify-content: space-between">
              <a-checkbox-group :value="checkedList" :default-value="['lyl']" :options="efficiencyOptions"
                                @change="efficiencyOptionsOnChange"/>
          <a-row :gutter="24" type="flex" align="middle">
            <a-col :md="24" :sm="24" :xs="24" style="display: flex;justify-content: space-between;align-items: flex-start">
              <div>
                <a-space style="margin-right: 20px">
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
                  <a-button type="primary" @click="exportExcel" icon="download">导出</a-button>
                </a-space>
                <a-checkbox-group :value="checkedList" :default-value="['lyl']" :options="efficiencyOptions"
                                  @change="efficiencyOptionsOnChange"/>
              </div>
              <table cellpadding="5" cellspacing="1" style="border: 1px solid darkgray;">
                <tr>
                  <td v-for="(item, index) in identifying">{{item.title}}</td>
@@ -184,6 +201,8 @@
  import $ from 'jquery'
  import '@/components/table2excel/table2excel'
  import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
  import api from '@/api/mdc'
  export default {
    name: 'EfficiencyShiftList',
    components: {},
@@ -196,6 +215,7 @@
        allowClearSu:true,
        dates: [],
        selectList:[],
        driveTypeList:[],
        identifying: [],
        queryParam: {},
        queryParamEquip:{},
@@ -237,6 +257,7 @@
      this.queryParam.typeTree = "1"
      this.loadData();
      this.queryGroup()
      this.getDriveTypeByApi()
    },
    watch: {
      Type(valmath){
@@ -455,7 +476,7 @@
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        // ç‚¹å‡»æ—¶é—´é€‰æ‹©å™¨çš„æ¸…空按钮时会触发此判断(点击重置按钮不会触发),实现重置列表功能,切实改变列表显示效果
        if(!this.queryParam.startTime&&!this.queryParam.endTime)this.searchReset()
        // if(!this.queryParam.startTime&&!this.queryParam.endTime)this.searchReset()
      },
      efficiencyOptionsOnChange(checkedList) {
        let index = checkedList.indexOf('lyl')
@@ -470,22 +491,14 @@
        this.checkedList = checkedList
      },
      searchQuery() {
        if(this.dates != ''){
          if(this.queryParam.typeTree == "1"){
            this.queryParam.parentId =  this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          }else{
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ""
          }
          this.loadData()
        if(this.queryParam.typeTree == "1"){
          this.queryParam.parentId =  this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        }else{
          // this.$message.warning("请选择时间")
          this.$notification.warning({
            message:'消息',
            description:"请选择时间"
          });
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ""
        }
        this.loadData()
        // this.onClearSelected()
      },
      searchReset() {
@@ -493,7 +506,9 @@
        this.typeParent =  this.queryParam.parentId
        this.typeEquipment = this.queryParam.equipmentId
        this.queryParam = {}
        this.dates = []
        this.dates = [moment().subtract('days', 7), moment().subtract('days', 1)]
        this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
        this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
        this.queryParam.typeTree = this.typeTree
        this.queryParam.parentId = this.typeParent
        this.queryParam.equipmentId =  this.typeEquipment
@@ -508,6 +523,12 @@
          if (res.success) {
            this.tableHeads = res.result.dates
            this.dataList = res.result.mdcEfficiencyList
            if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) {
              this.$notification.info({
                message: '消息',
                description: '暂无该设备类型数据'
              })
            }
            this.checkSameData(this.dataList)
            this.checkSameData1(this.dataList)
            this.checkSameData2(this.dataList)
@@ -535,7 +556,28 @@
        }).finally(() => {
          this.loading = false
        })
      }
      },
      /**
       * è°ƒç”¨æŽ¥å£èŽ·å–æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
       */
      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>
src/views/mdc/base/modules/mdcDriveTypeParamConfig/MdcDriveTypeParamConfigForm.vue
@@ -139,7 +139,7 @@
        ],
        englishName: [
          { required: true, message: '请输入英文名称!' },
          { pattern: /^.{2,18}$/, message: '请输入2到18位任意字符!' ,trigger:'blur'},
          // { pattern: /^.{2,24}$/, message: '请输入2到24位任意字符!' ,trigger:'blur'},
        ],
        showFlag: [
          { required: true, message: '请输入显示标志!' },
src/views/mdc/base/modules/mdcPassRate/mdcPassRateList.vue
@@ -3,18 +3,18 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
          <a-col :md="5" :sm="5">
            <a-form-item label="设备编号">
              <a-input placeholder="输入设备编号查询" v-model="queryParams.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
          <a-col :md="5" :sm="5" :xs="5">
            <a-form-item label="设备名称">
              <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input>
            </a-form-item>
@@ -464,8 +464,10 @@
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        if(this.queryParam.startTime && this.queryParam.endTime){
          param.startTime = this.queryParam.startTime;
          param.endTime =  this.queryParam.endTime;
        }
        // console.log(param);
        getAction(this.url.list,param).then((res) => {
          if(res.success){
src/views/mdc/base/modules/mdcPassRate/mdcPassRateModal.vue
@@ -39,7 +39,7 @@
        </a-row>
      </a-form>
    </a-spin>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -55,11 +55,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'mdcPassRateModal',
    components: { SelectDeviceModal},
    components: { SelectDeviceDrawer},
    props: {},
    data() {
      return {
@@ -196,10 +196,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/mdcProcessQuantity/mdcProcessQuantityList.vue
@@ -3,18 +3,18 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
          <a-col :md="5" :sm="5">
            <a-form-item label="设备编号">
              <a-input placeholder="输入设备编号查询" v-model="queryParams.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
          <a-col :md="5" :sm="5" :xs="5">
            <a-form-item label="设备名称">
              <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input>
            </a-form-item>
@@ -473,8 +473,10 @@
        param.field = this.getQueryField();
        param.parentId = this.queryParams.parentId;
        param.equipmentId = this.queryParams.equipmentId;
        param.startTime = this.queryParam.startTime;
        param.endTime =  this.queryParam.endTime;
        if(this.queryParam.startTime && this.queryParam.endTime){
          param.startTime = this.queryParam.startTime;
          param.endTime =  this.queryParam.endTime;
        }
        // console.log(param);
        getAction(this.url.list,param).then((res) => {
          if(res.success){
src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue
@@ -3,18 +3,13 @@
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="7" :sm="7">
            <a-form-item label="时间">
              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD"/>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4">
        <a-row :gutter="24" style="width: 100%;">
          <a-col :md="5" :sm="5">
            <a-form-item label="设备编号">
              <a-input placeholder="输入设备编号查询" v-model="queryParams.equipmentId"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="4" :sm="4" :xs="4">
          <a-col :md="5" :sm="5" :xs="5">
            <a-form-item label="设备名称">
              <a-input placeholder="输入设备名称查询" v-model="queryParams.equipmentName"></a-input>
            </a-form-item>
@@ -25,15 +20,6 @@
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
          <!--<a-col :md="2" :sm="3" :xs="3">-->
            <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
          <!--</a-col>-->
          <!--<a-col :md="2" :sm="2" :xs="2">-->
            <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
          <!--</a-col>-->
          <!--<a-col :lg="2" :md="3" :sm="3" :xs="3">-->
            <!--<a-button type="primary" @click="exportExcel" icon="download">导出</a-button>-->
          <!--</a-col>-->
        </a-row>
      </a-form>
    </div>
@@ -63,7 +49,7 @@
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns"
               :scroll="{x:'max-content',y:scrollY}" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
               :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
               :rowSelection="{selectedRowKeys: selectedRowKeys}"
               @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
        <a @click="handleEdit(record)">编辑</a>
@@ -91,7 +77,6 @@
</template>
<script>
  import moment from 'moment'
  import $ from 'jquery'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import JDate from '../../../../../components/jeecg/JDate'
@@ -103,8 +88,6 @@
  } from '@/api/manage'
  import MdcStandardProcessDurationModal from './MdcStandardProcessDurationModal'
  import MdcStandardProcessDurationEdit from './MdcStandardProcessDurationEdit'
  // import DeviceRepairModelAdd from './DeviceRepairModelAdd'
  // import DeviceRepairModelEdit from './DeviceRepairModelEdit'
  import '@/components/table2excel/table2excel'
  import {
    JeecgListMixin
@@ -120,8 +103,6 @@
      Tooltip,
      MdcStandardProcessDurationModal,
      MdcStandardProcessDurationEdit,
      // DeviceRepairModelAdd,
      // DeviceRepairModelEdit,
      JDictSelectTag,
      JInput,
      JDate,
@@ -133,7 +114,6 @@
        typeTree:"",
        typeParent:1,
        typeEquipment:1,
        dates: [],
        xianshi:"",
        readOnly:true,
        queryParam: {},
@@ -154,18 +134,12 @@
            align: 'center',
            dataIndex: 'equipmentName',
            width:200
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1}
          },
          {
            title: '零件号',
            align: 'center',
            dataIndex: 'partsCode',
            width:150
            // scopedSlots:{customRender:'startTime'},
            // customRender:(text,row,index) => {
            //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
            // }
          },
          {
            title: '批次号',
@@ -214,7 +188,6 @@
      Type(valmath){
        this.dataList = [];
        this.queryParams.typeTree = valmath
        // console.log(this.queryParams.typeTree)
      },
      nodeTree(val) { //监听currSelected å˜åŒ–,将变化后的数值传递给 getCurrSelected äº‹ä»¶
        if (JSON.stringify(val) != '{}') {
@@ -257,19 +230,6 @@
        document.body.appendChild(a);
        a.click();
        a.remove();
      },
      dateParamChange(v1, v2) {
        // console.log(v1,v2)
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        // console.log(v2[0],v2[1])
      },
      onChange(value, dateString) {
        // console.log('Selected Time: ', value);
        // console.log('Formatted Selected Time: ', dateString);
      },
      onOk(value) {
        console.log('onOk: ', value);
      },
      searchReset() {
        if(this.queryParams.typeTree == "1"){
src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationModal.vue
@@ -44,7 +44,7 @@
        </a-row>
      </a-form>
    </a-spin>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-modal>
</template>
@@ -61,11 +61,11 @@
  import {
    duplicateCheck
  } from '@/api/api'
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer'
  export default {
    name: 'MdcStandardProcessDurationModal',
    components: { SelectDeviceModal },
    components: { SelectDeviceDrawer },
    props: {},
    data() {
      return {
@@ -210,10 +210,10 @@
        // })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = this.form.getFieldValue('equipmentIds') ? this.form.getFieldValue('equipmentIds').split(',') : []
      },
      //级联框onChange事件
      // onChange(value) {
src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue
@@ -5,18 +5,18 @@
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="6">
            <a-col :md="7" :sm="7">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD"
                                v-model="dates"/>
                                v-model="dates" :allowClear="false"/>
              </a-form-item>
            </a-col>
            <a-col :md="17" :sm="17" :xs="17">
              <a-form-item label="时间段">
                <a-space>
                  <a-time-picker :default-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeStart"/>
                  <a-time-picker :default-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeStart" :allowClear="false"/>
                  è‡³
                  <a-time-picker :default-value="moment('08:00', 'HH:mm')" format="HH:mm" @change="onChangeEnd"/>
                  <a-time-picker :default-value="moment('08:00', 'HH:mm')" format="HH:mm" @change="onChangeEnd" :allowClear="false"/>
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                </a-space>
              </a-form-item>
@@ -225,96 +225,20 @@
        this.dates = [v1[0], v1[1]]
      },
      searchQuery() {
        // å› è§¦åº•刷新会修改参数时间值,故在此用时间选择器的时间值对参数时间值再次赋值,若不这样做则参数时间值则会与时间选择器上的时间值不一致
        this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD')
        this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD')
        if (this.queryParam.startTime && this.queryParam.endTime && this.dates[0] && this.dates[1]) {
          if (this.queryParam.typeTree == '1') {
            this.queryParam.parentId = this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          } else {
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ''
          }
          this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1
          this.loadData1()
        } else {
          this.$notification.warning({
            message: '提示',
            description: '请选择时间或时间段'
          })
        }
        // this.onClearSelected()
        if (this.queryParam.typeTree == '1') {
          this.queryParam.parentId = this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        } else {
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ''
        }
        this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1
        this.loadData1()
      },
      // searchReset() {
      //   this.typeTree = this.queryParam.typeTree
      //   this.typeParent =  this.queryParam.parentId
      //   this.typeEquipment = this.queryParam.equipmentId
      //   this.queryParam = {}
      //   this.dates = []
      //   this.queryParam.typeTree = this.typeTree
      //   this.queryParam.parentId = this.typeParent
      //   this.queryParam.equipmentId =  this.typeEquipment
      //   // this.ipagination.current = 1
      //   this.loadData1();
      //   // this.queryParam = {}
      //   // this.dates = []
      //   // this.loadData()
      //   // this.onClearSelected()
      // },
      // loadData1() {
      //   let that = this
      //   that.columns=[
      //     {
      //       title: '设备编号',
      //       align: 'center',
      //       dataIndex: 'equipmentId',
      //       width:'150px'
      //     },
      //     {
      //       title: '设备名称',
      //       align: 'center',
      //       dataIndex: 'equipmentName',
      //       width:'150px'
      //     },
      //   ]
      //   that.tableHeads = []
      //   that.dataList = []
      //   getAction(this.url.efficiencyList, that.queryParam).then(res => {
      //     var tmp = {}
      //     console.log(res)
      //     if (res.success)
      //
      //       that.dataSource = res.result.mdcEfficiencyList
      //       for(var k = 0;k<that.dataSource[0].dataList.length;k++){
      //         that.columns.push(
      //           {
      //             title:that.dataSource[0].dataList.theDate,
      //             align: 'center',
      //             width:'120px',
      //             // dataIndex:'utilizationRate',
      //           }
      //         )
      //       }
      //       for(var i = 0;i<that.dataSource.length;i++){
      //         for (var j = 0; j < that.dataSource[i].dataList.length;j++){
      //           // that.columns.push(
      //           //   {
      //           //     title:that.dataSource[0].dataList[j].theDate,
      //           //     align: 'center',
      //           //     width:'120px',
      //           //     dataIndex:'utilizationRate',
      //           //   }
      //           // )
      //         }
      //
      //       }
      //       console.log(that.columns)
      //       console.log(that.dataSource)
      //       // this.initDeviceType(this.dataList)
      //       this.draw()
      //     }
      //   }
      loadData1() {
        this.loading = true
        this.tableHeads = []
src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue
@@ -8,7 +8,7 @@
            <a-col :md="7" :sm="7">
              <a-form-item label="时间">
                <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD"
                                v-model="dates"/>
                                v-model="dates" :allowClear="false"/>
              </a-form-item>
            </a-col>
            <a-col :lg="2" :md="3" :sm="3" :xs="3">
@@ -237,26 +237,19 @@
        this.dates = [v1[0], v1[1]]
      },
      searchQuery() {
        console.log('dates', this.dates)
        // å› è§¦åº•刷新会修改参数时间值,故在此用时间选择器的时间值对参数时间值再次赋值,若不这样做则参数时间值则会与时间选择器上的时间值不一致
        this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD')
        this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD')
        if (this.dates[0] && this.dates[1]) {
          if (this.queryParam.typeTree == '1') {
            this.queryParam.parentId = this.queryParamEquip.parentId
            this.queryParam.equipmentId = this.queryParamEquip.equipmentId
          } else {
            this.queryParam.parentId = this.queryParamPeople.parentId
            this.queryParam.equipmentId = ''
          }
          this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1
          this.loadData1()
        if (this.queryParam.typeTree == '1') {
          this.queryParam.parentId = this.queryParamEquip.parentId
          this.queryParam.equipmentId = this.queryParamEquip.equipmentId
        } else {
          this.$notification.warning({
            message: '提示',
            description: '请选择时间'
          })
          this.queryParam.parentId = this.queryParamPeople.parentId
          this.queryParam.equipmentId = ''
        }
        // this.onClearSelected()
        this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1
        this.loadData1()
      },
      // searchReset() {
      //   this.typeTree = this.queryParam.typeTree
src/views/system/WorkshopSignageManagement.vue
@@ -150,14 +150,14 @@
    <!-- è¡¨å•区域 -->
    <workshop-modal ref="modalForm" @ok="modalFormOk"></workshop-modal>
    <!--新增车间-->
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'添加已有设备'"></select-device-modal>
    <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'添加已有设备'"></select-device-drawer>
    <!--已有设备-->
  </a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectDeviceModal from './modules/SelectDeviceModal'
import SelectDeviceDrawer from './modules/SelectDeviceDrawer'
import WorkshopModal from './modules/WorkshopModal'
import { filterObj } from '@/utils/util'
import moment from 'moment'
@@ -166,7 +166,7 @@
  name: 'WorkshopSignageManagement',
  mixins: [JeecgListMixin],
  components: {
    SelectDeviceModal,
    SelectDeviceDrawer,
    WorkshopModal,
    moment,
  },
@@ -475,11 +475,11 @@
      if (this.currentWorkshopId == '') {
        this.$message.error('请选择一个车间!')
      } else {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = []
        this.$refs.selectDeviceModal.expandAll()
        this.$refs.selectDeviceDrawer.visible = true
        this.$refs.selectDeviceDrawer.selectedRowKeys = []
        this.$refs.selectDeviceDrawer.selectedRows = []
        this.$refs.selectDeviceDrawer.checkedKeys = []
        this.$refs.selectDeviceDrawer.expandAll()
      }
    },
src/views/system/modules/SelectDeviceDrawer.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,225 @@
<template>
  <a-drawer
    :title="title"
    :visible="visible"
    width="650"
    @ok="handleOk"
    @close="handleCancel"
  >
    <a-spin :spinning="loading">
      <!-- showLine -->
      <a-form>
        <a-form-item label="车间层级:">
          <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys"
                  :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys"
                  @expand="onExpand">
          </a-tree>
        </a-form-item>
      </a-form>
    </a-spin>
    <div class="drawer-bottom-button">
      <a-dropdown
        style="float: left"
        :trigger="['click']"
        placement="topCenter"
      >
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="expandAll">展开所有</a-menu-item>
          <a-menu-item key="2" @click="closeAll">合并所有</a-menu-item>
          <a-menu-item key="3" @click="refreshTree">刷新</a-menu-item>
        </a-menu>
        <a-button>
          æ ‘操作
          <a-icon type="up"/>
        </a-button>
      </a-dropdown>
      <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
        <a-button style="margin-right: .8rem">关闭</a-button>
      </a-popconfirm>
      <a-button
        @click="handleOk"
        type="primary"
      >确定
      </a-button>
    </div>
  </a-drawer>
</template>
<script>
  import {
    getAction,
    postAction,
    deleteAction
  } from '@/api/manage'
  import BaseTree from '@/views/mdc/common/BaseTree'
  import DepartTree from '@/views/mdc/base/modules/DepartList/DepartListTree/DepartTree'
  import { mapActions } from 'vuex'
  export default {
    name: 'SelectDeviceDrawer',
    components: {
      BaseTree, DepartTree
    },
    props: {
      editDisable: {
        type: Boolean,
        default() {
          return true
        }
      },
      title: {
        type: String
      }
    },
    data() {
      return {
        cardLoading: false,
        loading: false,
        treeDataSource: [],
        expandedKeys: [],
        checkedKeys: [],
        url: {
          getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction'
        },
        dataList: [],
        allTreeKeys: [],
        visible: false,
        dataSource: []
      }
    },
    created() {
      this.queryTreeData()
      this.closeAll()
    },
    methods: {
      ...mapActions(['QueryProduction']),
      onExpand(expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      queryTreeData() {
        this.loading = true
        this.cardLoading = true
        this.QueryProduction().then(res => {
          if (res.success) {
            this.dataList = []
            this.allTreeKeys = []
            this.getTreeDataSouce(res.result)
            this.treeDataSource = res.result
            this.generateList(this.treeDataSource)
            console.log('treeDataSource', this.treeDataSource)
            this.expandedKeys = this.allTreeKeys
          } else {
            this.$message.warn(res.message)
          }
        }).finally(() => {
          this.loading = false
          this.cardLoading = false
        })
      },
      generateList(data) {
        for (let i = 0; i < data.length; i++) {
          const node = data[i]
          const key = node.key
          const title = node.title
          this.dataList.push({
            key,
            title: title
          })
          this.allTreeKeys.push(key)
          if (node.children) {
            this.generateList(node.children)
          }
        }
      },
      getTreeDataSouce(data) {
        data.forEach(item => {
          if (item.children && item.children.length > 0) {
            this.getTreeDataSouce(item.children)
          }
          item.key = item.equipmentId ? item.equipmentId : item.key
          item.value = item.equipmentId ? item.equipmentId : item.value
        })
      },
      expandAll() {
        this.expandedKeys = this.allTreeKeys
      },
      closeAll() {
        this.expandedKeys = ['-1']
      },
      refreshTree() {
        this.queryTreeData()
      },
      onCheck(value, obj) {
        this.checkedKeys = value
        console.log('obj,', obj)
        this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId)
        console.log(this.deviceNodes)
      },
      handleCancel() {
        this.visible = false
      },
      handleOk() {
        this.$emit('selectFinished', this.deviceNodes)
        this.visible = false
      }
    }
  }
</script>
<style lang="less" scoped>
  /deep/ .ant-modal {
    /*transform-origin: 337px 50px;*/
  }
  .ant-card-body .table-operator {
    margin-bottom: 18px;
  }
  .ant-table-tbody .ant-table-row td {
    padding-top: 15px;
    padding-bottom: 15px;
  }
  .anty-row-operator button {
    margin: 0 5px
  }
  .ant-btn-danger {
    background-color: #ffffff
  }
  .ant-modal-cust-warp {
    height: 100%
  }
  .ant-modal-cust-warp .ant-modal-body {
    height: calc(100% - 110px) !important;
    overflow-y: auto
  }
  .ant-modal-cust-warp .ant-modal-content {
    height: 90% !important;
    overflow-y: hidden
  }
  .drawer-bottom-button {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
</style>
src/views/system/modules/SelectDeviceModal.vue
@@ -1,65 +1,26 @@
<template>
  <div>
    <a-drawer
      :title="title"
      :visible="visible"
      width="650"
      @ok="handleOk"
      @close="handleCancel"
    >
  <a-modal
    :title="title"
    :visible="visible"
    @ok="handleOk"
    @cancel="handleCancel"
  >
      <!--&lt;!&ndash; æŸ¥è¯¢åŒºåŸŸ &ndash;&gt;-->
      <!--<div class="table-page-search-wrapper">-->
      <!--<a-form layout="inline" @keyup.enter.native="searchQuery">-->
      <!--<a-row :gutter="24">-->
    <a-spin :spinning="loading">
      <!-- showLine -->
      <a-form>
        <a-form-item label="车间层级:">
          <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys"
                  :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys"
                  @expand="onExpand">
          </a-tree>
        </a-form-item>
      </a-form>
      <!--<a-col :span="10">-->
      <!--<a-form-item label="设备名称">-->
      <!--<a-input placeholder="请输入设备名称" v-model="queryParam.equipmentName"></a-input>-->
      <!--</a-form-item>-->
      <!--</a-col>-->
      <!--<a-col :span="8">-->
      <!--<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
      <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
      <!--<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
      <!--</span>-->
      <!--</a-col>-->
    </a-spin>
      <!--</a-row>-->
      <!--</a-form>-->
      <!--</div>-->
      <!--&lt;!&ndash; table区域-begin &ndash;&gt;-->
      <!--<div>-->
      <!--<a-table-->
      <!--size="small"-->
      <!--bordered-->
      <!--rowKey="equipmentId"-->
      <!--:columns="columns1"-->
      <!--:dataSource="dataSource1"-->
      <!--:pagination="ipagination"-->
      <!--:loading="loading"-->
      <!--:scroll="{ y: 240 }"-->
      <!--:rowSelection="{selectedRowKeys: selectedRowKeys,onSelectAll:onSelectAll,onSelect:onSelect,onChange: onSelectChange}"-->
      <!--@change="handleTableChange">-->
      <!--</a-table>-->
      <!--</div>-->
      <!--&lt;!&ndash; table区域-end &ndash;&gt;-->
      <a-spin :spinning="loading">
        <!-- showLine -->
        <a-form>
          <a-form-item label="车间层级:">
            <a-tree showLine ref="tree" :expandedKeys.sync="expandedKeys"
                    :treeData="treeDataSource" checkable @check="onCheck" v-model="checkedKeys"
                    @expand="onExpand">
            </a-tree>
          </a-form-item>
        </a-form>
      </a-spin>
      <div class="drawer-bottom-button">
    <template slot="footer">
      <div>
        <a-dropdown
          style="float: left"
          :trigger="['click']"
@@ -84,14 +45,12 @@
        >确定
        </a-button>
      </div>
    </template>
    </a-drawer>
  </div>
  </a-modal>
</template>
<script>
  // import { filterObj } from '@/utils/util'
  // import { getAction } from '@/api/manage'
  import {
    getAction,
    postAction,
@@ -99,7 +58,6 @@
  } from '@/api/manage'
  import BaseTree from '@/views/mdc/common/BaseTree'
  import DepartTree from '@/views/mdc/base/modules/DepartList/DepartListTree/DepartTree'
  import { mapActions } from 'vuex'
  export default {
    name: 'SelectDeviceModal',
@@ -115,122 +73,63 @@
      },
      title: {
        type: String
      },
      selectedProduction: {
        type: String
      }
    },
    data() {
      return {
        cardLoading: false,
        loading: false,
        treeDataSource: [],
        expandedKeys: [],
        checkedKeys: [],
        url: {
          getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction'
          getDeviceTree: '/mdc/mdcEquipment/loadTreeListByProductionIds'
        },
        selectedWorkshopIds: '',
        dataList: [],
        allTreeKeys: [],
        visible: false,
        dataSource: []
        // names: [],
        // placement: 'right',
        // description: '',
        // // æŸ¥è¯¢æ¡ä»¶
        // queryParam: {},
        // // è¡¨å¤´
        // columns1: [
        //   {
        //     title: '#',
        //     dataIndex: '',
        //     key: 'rowIndex',
        //     width: 50,
        //     align: 'center',
        //     customRender: function(t, r, index) {
        //       return parseInt(index) + 1
        //     }
        //   },
        //   {
        //     title: '设备编号',
        //     align: 'center',
        //     width: 100,
        //     dataIndex: 'equipmentId'
        //   },
        //   {
        //     title: '设备名称',
        //     align: 'center',
        //     width: 100,
        //     dataIndex: 'equipmentName'
        //   },
        //   {
        //     title: '设备类型',
        //     align: 'center',
        //     width: 100,
        //     dataIndex: 'equipmentType'
        //   },
        //   {
        //     title: '驱动类型',
        //     align: 'center',
        //     width: 100,
        //     dataIndex: 'driveType'
        //   }
        // ],
        // //数据集
        // dataSource1: [],
        // dataSource2: [],
        // // åˆ†é¡µå‚æ•°
        // ipagination: {
        //   current: 1,
        //   pageSize: 10,
        //   pageSizeOptions: ['10', '20', '30'],
        //   showTotal: (total, range) => {
        //     return range[0] + '-' + range[1] + ' å…±' + total + '条'
        //   },
        //   showQuickJumper: true,
        //   showSizeChanger: true,
        //   total: 0
        // },
        // loading: false,
        // selectedRowKeys: [],
        // selectedRows: [],
        // url: {
        //   list: '/mdc/mdcEquipment/list'
        // },
        // activeKey: '1',
        // isDepartType: ''
      }
    },
    created() {
      // this.loadData()
      this.queryTreeData()
      this.closeAll()
    },
    methods: {
      ...mapActions(['QueryProduction']),
      onExpand(expandedKeys) {
        this.expandedKeys = expandedKeys
        this.autoExpandParent = false
      },
      queryTreeData() {
      queryTreeData(value) {
        this.loading = true
        this.cardLoading = true
        this.QueryProduction().then(res => {
          if (res.success) {
            this.dataList = []
            this.allTreeKeys = []
            this.getTreeDataSouce(res.result)
            this.treeDataSource = res.result
            this.generateList(this.treeDataSource)
            console.log('treeDataSource', this.treeDataSource)
            this.expandedKeys = this.allTreeKeys
          } else {
            this.$message.warn(res.message)
          }
        }).finally(() => {
          this.loading = false
          this.cardLoading = false
        })
        this.selectedWorkshopIds = value
        getAction(this.url.getDeviceTree, { ids: value })
          .then(res => {
            if (res.success) {
              this.dataList = []
              this.allTreeKeys = []
              this.getTreeDataSouce(res.result)
              this.treeDataSource = res.result
              this.generateList(this.treeDataSource)
              this.expandedKeys = this.allTreeKeys
            } else {
              this.$notification.warning({
                message: '消息',
                description: res.message
              })
            }
          })
          .catch(err => {
            this.$notification.error({
              message: '消息',
              description: err.message
            })
          })
          .finally(() => {
            this.loading = false
          })
      },
      generateList(data) {
@@ -265,13 +164,11 @@
        this.expandedKeys = ['-1']
      },
      refreshTree() {
        this.queryTreeData()
        this.queryTreeData(this.selectedWorkshopIds)
      },
      onCheck(value, obj) {
        this.checkedKeys = value
        console.log('obj,', obj)
        this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId)
        console.log(this.deviceNodes)
      },
      handleCancel() {
        this.visible = false
@@ -280,81 +177,6 @@
        this.$emit('selectFinished', this.deviceNodes)
        this.visible = false
      }
      // add() {
      //   this.visible = true
      // },
      // loadData(arg) {
      //   //加载数据 è‹¥ä¼ å…¥å‚æ•°1则加载第一页的内容
      //   if (arg === 1) {
      //     this.ipagination.current = 1
      //   }
      //   var params = this.getQueryParams()//查询条件
      //   getAction(this.url.list, params).then((res) => {
      //     if (res.success) {
      //       this.dataSource1 = res.result.records
      //       this.ipagination.total = res.result.total
      //     }
      //   })
      // },
      // getQueryParams() {
      //   var param = Object.assign({}, this.queryParam, this.isorter)
      //   param.field = this.getQueryField()
      //   param.pageNo = this.ipagination.current
      //   param.pageSize = this.ipagination.pageSize
      //   return filterObj(param)
      // },
      // getQueryField() {
      //   //TODO å­—段权限控制
      // },
      // onSelectAll(selected, selectedRows, changeRows) {
      //   if (selected === true) {
      //     for (var a = 0; a < changeRows.length; a++) {
      //       this.dataSource2.push(changeRows[a])
      //     }
      //   } else {
      //     for (var b = 0; b < changeRows.length; b++) {
      //       this.dataSource2.splice(this.dataSource2.indexOf(changeRows[b]), 1)
      //     }
      //   }
      //   // console.log(selected, selectedRows, changeRows);
      // },
      // onSelect(record, selected) {
      //   console.log(this.selectedRowKeys)
      //   if (selected === true) {
      //     this.dataSource2.push(record)
      //   } else {
      //     var index = this.dataSource2.indexOf(record)
      //     //console.log();
      //     if (index >= 0) {
      //       this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
      //     }
      //   }
      // },
      // onSelectChange(selectedRowKeys, selectedRows) {
      //   console.log('selectedRowKeys', selectedRowKeys)
      //   this.selectedRowKeys = selectedRowKeys
      //   this.selectionRows = selectedRows
      // },
      // onClearSelected() {
      //   this.selectedRowKeys = []
      //   this.selectionRows = []
      // },
      // handleDelete: function(record) {
      //   this.dataSource2.splice(this.dataSource2.indexOf(record), 1)
      // },
      // handleTableChange(pagination, filters, sorter) {
      //   //分页、排序、筛选变化时触发
      //   console.log(sorter)
      //   //TODO ç­›é€‰
      //   if (Object.keys(sorter).length > 0) {
      //     this.isorter.column = sorter.field
      //     this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
      //   }
      //   this.ipagination = pagination
      //   this.loadData()
      // },
    }
  }
src/views/system/modules/UserModal.vue
@@ -130,7 +130,8 @@
            @back="backDepartInfo"
            :backDepart="true"
            :treeOpera="true"
          >></j-select-depart>
          >>
          </j-select-depart>
        </a-form-model-item>
        <!--车间分配-->
@@ -148,6 +149,17 @@
            :treeProductOpera="true"
          ></j-select-production>
        </a-form-model-item>
        <a-form-model-item
          label="选择设备"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
        >
          <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button
                          placeholder="请选择设备" :disabled="!model.selectedProduction"/>
        </a-form-model-item>
        <a-form-model-item
          label="班组分配"
          :labelCol="labelCol"
@@ -289,476 +301,512 @@
        @click="handleSubmit"
        type="primary"
        :loading="confirmLoading"
      >提交</a-button>
      >提交
      </a-button>
    </div>
    <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
  </a-drawer>
</template>
<script>
import moment from 'moment'
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
import { disabledAuthFilter } from "@/utils/authFilter"
import { duplicateCheck } from '@/api/api'
import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
import { mapActions } from 'vuex'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import moment from 'moment'
  import Vue from 'vue'
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import { getAction } from '@/api/manage'
  import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
  import { disabledAuthFilter } from '@/utils/authFilter'
  import { duplicateCheck } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import { mapActions } from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import SelectDeviceModal from './SelectDeviceModal'
export default {
  name: "UserModal",
  components: {
    JSelectProduction
  },
  data() {
    return {
      departDisabled: false, //是否是我的部门调用该页面
      productionDisabled: false, //是否是我的车间调用该页面
      roleDisabled: false, //是否是角色维护调用该页面
      modalWidth: 800,
      drawerWidth: 700,
      modaltoggleFlag: true,
      confirmDirty: false,
      userId: "", //保存用户id
      disableSubmit: false,
      dateFormat: "YYYY-MM-DD",
      validatorRules: {
        username: [{ required: true, message: '请输入用户账号!' },
        { validator: this.validateUsername, }],
        password: [{ required: true, pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, message: '密码由8位数字、大小写字母和特殊符号组成!' },
        { validator: this.validateToNextPassword, trigger: 'change' }],
        confirmpassword: [{ required: true, message: '请重新输入登录密码!', },
        { validator: this.compareToFirstPassword, }],
        realname: [{ required: true, message: '请输入用户名称!' }],
        phone: [{ required: false, message: '请输入手机号!' }, { validator: this.validatePhone }],
        email: [{ validator: this.validateEmail }],
        roles: {},
        workNo: [{ required: true, message: '请输入工号' },
        { validator: this.validateWorkNo }],
        telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },],
        teamId: [{ required: false, message: '请维护班组' }]
      },
      departIdShow: false,
      title: "操作",
      visible: false,
      model: {},
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      uploadLoading: false,
      confirmLoading: false,
      headers: {},
      url: {
        fileUpload: window._CONFIG['domianURL'] + "sys/common/upload",
        userWithDepart: "/sys/user/userDepartList", // å¼•入为指定用户查看部门信息需要的url
        //引入为指定用户查看车间信息需要的url
        userProductionList: '/sys/user/userProductionList',
        userId: "/sys/user/generateUserId", // å¼•入生成添加用户情况下的url
        syncUserByUserName: "/act/process/extActProcess/doSyncUserByUserName",//同步用户到工作流
        queryTenantList: '/sys/tenant/queryList'
      },
      tenantsOptions: [],
      rolesOptions: [],
      nextDepartOptions: [],
      nextProductionOptions: [],
      isDepartType: '',
    }
  },
  watch: {
    visible: {
      handler(value) {
        if (value) this.initDictData('password_length')
      }
    }
  },
  created() {
    const token = Vue.ls.get(ACCESS_TOKEN);
    this.headers = { "X-Access-Token": token }
    this.initRoleList()
    this.initTenantList()
    this.queryTreeData()
  },
  computed: {
    uploadAction: function () {
      return this.url.fileUpload;
    }
  },
  methods: {
    ...mapActions(['QueryDepartTree']),
    queryTreeData() {
      this.QueryDepartTree().then(res => {
        if (res.success) {
          this.isDepartType = res.result[0].value
        } else {
          // this.$message.warn(res.message)
          this.$notification.warning({
            message: '消息',
            description: res.message
          });
        }
      }).finally(() => {
      })
  export default {
    name: 'UserModal',
    components: {
      SelectDeviceModal,
      JSelectProduction
    },
    add() {
      this.refresh();
      this.edit({ activitiSync: '1', userIdentity: 1 });
    },
    edit(record) {
      let that = this;
      that.visible = true;
      //根据屏幕宽度自适应抽屉宽度
      this.resetScreenSize();
      that.userId = record.id;
      that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record);
      that.model = Object.assign({}, { selectedroles: '', selectedProduction: '' }, record);
      //身份为上级显示负责部门,否则不显示
      if (this.model.userIdentity == 2) {
        this.departIdShow = true;
      } else {
        this.departIdShow = false;
      }
      if (record.hasOwnProperty("id")) {
        that.getUserRoles(record.id);
        that.getUserDeparts(record.id);
      }
      console.log('that.model', that.model)
    },
    isDisabledAuth(code) {
      return disabledAuthFilter(code);
    },
    //窗口最大化切换
    toggleScreen() {
      if (this.modaltoggleFlag) {
        this.modalWidth = window.innerWidth;
      } else {
        this.modalWidth = 800;
      }
      this.modaltoggleFlag = !this.modaltoggleFlag;
    },
    // æ ¹æ®å±å¹•变化,设置抽屉尺寸
    resetScreenSize() {
      let screenWidth = document.body.clientWidth;
      if (screenWidth < 500) {
        this.drawerWidth = screenWidth;
      } else {
        this.drawerWidth = 700;
      }
    },
    //初始化租户字典
    initTenantList() {
      getAction(this.url.queryTenantList).then(res => {
        if (res.success) {
          this.tenantsOptions = res.result.map((item, index, arr) => {
            let c = { label: item.name, value: item.id + "" }
            return c;
          })
          console.log('this.tenantsOptions: ', this.tenantsOptions)
        }
      })
    },
    //初始化角色字典
    initRoleList() {
      queryall().then((res) => {
        if (res.success) {
          this.rolesOptions = res.result.map((item, index, arr) => {
            let c = { label: item.roleName, value: item.id }
            return c;
          })
          console.log('this.rolesOptions: ', this.rolesOptions)
        }
      });
    },
    getUserRoles(userid) {
      queryUserRole({ userid: userid }).then((res) => {
        if (res.success) {
          this.model.selectedroles = res.result.join(",");
          console.log('that.model.selectedroles=', this.model.selectedroles)
        }
      });
    },
    getUserDeparts(userid) {
      let that = this;
      //部门的url
      getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
        if (res.success) {
          let departOptions = [];
          let selectDepartKeys = []
          for (let i = 0; i < res.result.length; i++) {
            selectDepartKeys.push(res.result[i].key);
            //新增负责部门选择下拉框
            departOptions.push({
              value: res.result[i].key,
              label: res.result[i].title
            })
          }
          that.model.selecteddeparts = selectDepartKeys.join(",")
          that.model.selectedProduction = selectDepartKeys.join(",")
          that.nextDepartOptions = departOptions;
          console.log('that.nextDepartOptions=', that.nextDepartOptions)
        }
      })
      getAction(that.url.userProductionList, { userId: userid }).then((res) => {
        if (res.success) {
          let ProductionOptions = [];
          let selectProductKeys = []
          for (let i = 0; i < res.result.length; i++) {
            selectProductKeys.push(res.result[i].key);
            //新增负责部门选择下拉框
            ProductionOptions.push({
              value: res.result[i].key,
              label: res.result[i].title
            })
          }
          that.model.selectedProduction = selectProductKeys.join(",")
          that.nextProductionOptions = ProductionOptions;
          console.log('that.nextProductionOptions=', that.nextProductionOptions)
        }
      })
      //车间的url
    },
    backDepartInfo(info) {
      this.model.departIds = this.model.selecteddeparts;
      this.nextDepartOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + "" }
        return c;
      })
    },
    backProductionInfo(info) {
      this.model.productionIds = this.model.selectedProduction;
      this.nextProductionOptions = info.map((item, index, arr) => {
        let c = { label: item.text, value: item.value + "" }
        return c;
      })
    },
    refresh() {
      this.userId = ""
      this.nextDepartOptions = [];
      this.nextProductionOptions = [];
      this.departIdShow = false;
    },
    close() {
      this.$emit('close');
      this.visible = false;
      this.disableSubmit = false;
      this.nextDepartOptions = [];
      this.nextProductionOptions = []
      this.departIdShow = false;
      this.$refs.form.resetFields();
    },
    moment,
    handleSubmit() {
      const that = this;
      // è§¦å‘表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          that.confirmLoading = true;
          //如果是上级择传入departIds,否则为空
          if (this.model.userIdentity !== 2) {
            this.model.departIds = "";
          }
          let obj;
          if (!this.model.id) {
            this.model.id = this.userId;
            obj = addUser(this.model);
          } else {
            obj = editUser(this.model);
          }
          obj.then((res) => {
            if (res.success) {
              that.$message.success(res.message);
              that.$emit('ok');
            } else {
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            that.close();
          })
        } else {
          return false;
        }
      })
    },
    handleCancel() {
      this.close()
    },
    validateToNextPassword(rule, value, callback) {
      const confirmpassword = this.model.confirmpassword;
      if (value && confirmpassword && value !== confirmpassword) {
        callback('两次输入的密码不一样!');
      }
      if (value && this.confirmDirty) {
        this.$refs.form.validateField(['confirmpassword']);
      }
      callback();
    },
    compareToFirstPassword(rule, value, callback) {
      if (value && value !== this.model.password) {
        callback('两次输入的密码不一样!');
      } else {
        callback()
      }
    },
    validatePhone(rule, value, callback) {
      if (!value) {
        callback()
      } else {
        if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
          var params = {
            tableName: 'sys_user',
            fieldName: 'phone',
            fieldVal: value,
            dataId: this.userId
          };
          duplicateCheck(params).then((res) => {
            if (res.success) {
              callback()
            } else {
              callback("手机号已存在!")
            }
          })
        } else {
          callback("请输入正确格式的手机号码!");
        }
      }
    },
    validateEmail(rule, value, callback) {
      if (!value) {
        callback()
      } else {
        if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
          var params = {
            tableName: 'sys_user',
            fieldName: 'email',
            fieldVal: value,
            dataId: this.userId
          };
          duplicateCheck(params).then((res) => {
            console.log(res)
            if (res.success) {
              callback()
            } else {
              callback("邮箱已存在!")
            }
          })
        } else {
          callback("请输入正确格式的邮箱!")
        }
      }
    },
    validateUsername(rule, value, callback) {
      var params = {
        tableName: 'sys_user',
        fieldName: 'username',
        fieldVal: value,
        dataId: this.userId
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback()
        } else {
          callback("用户名已存在!")
        }
      })
    },
    validateWorkNo(rule, value, callback) {
      var params = {
        tableName: 'sys_user',
        fieldName: 'work_no',
        fieldVal: value,
        dataId: this.userId
      };
      duplicateCheck(params).then((res) => {
        if (res.success) {
          callback()
        } else {
          callback("工号已存在!")
        }
      })
    },
    handleConfirmBlur(e) {
      const value = e.target.value;
      this.confirmDirty = this.confirmDirty || !!value
    },
    beforeUpload: function (file) {
      var fileType = file.type;
      if (fileType.indexOf('image') < 0) {
        this.$message.warning('请上传图片');
        return false;
      }
      //TODO éªŒè¯æ–‡ä»¶å¤§å°
    },
    identityChange(e) {
      if (e.target.value === 1) {
        this.departIdShow = false;
      } else {
        this.departIdShow = true;
      }
    },
    initDictData(dictCode) {
      //根据字典Code, åˆå§‹åŒ–字典数组
      ajaxGetDictItems(dictCode, null).then((res) => {
        if (res.success) {
          const regExp = new RegExp("^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:\";'<>?,./]).{" + Number(res.result[0].value) + ",}$");
          this.validatorRules.password[0] = {
    data() {
      return {
        departDisabled: false, //是否是我的部门调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth: 800,
        drawerWidth: 700,
        modaltoggleFlag: true,
        confirmDirty: false,
        userId: '', //保存用户id
        disableSubmit: false,
        dateFormat: 'YYYY-MM-DD',
        validatorRules: {
          username: [{ required: true, message: '请输入用户账号!' },
            { validator: this.validateUsername }],
          password: [{
            required: true,
            pattern: regExp,
            message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`,
          }
            pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
            message: '密码由8位数字、大小写字母和特殊符号组成!'
          },
            { validator: this.validateToNextPassword, trigger: 'change' }],
          confirmpassword: [{ required: true, message: '请重新输入登录密码!' },
            { validator: this.compareToFirstPassword }],
          realname: [{ required: true, message: '请输入用户名称!' }],
          phone: [{ required: false, message: '请输入手机号!' }, { validator: this.validatePhone }],
          email: [{ validator: this.validateEmail }],
          roles: {},
          workNo: [{ required: true, message: '请输入工号' },
            { validator: this.validateWorkNo }],
          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
          teamId: [{ required: false, message: '请维护班组' }]
        },
        departIdShow: false,
        title: '操作',
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 }
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 }
        },
        uploadLoading: false,
        confirmLoading: false,
        headers: {},
        url: {
          fileUpload: window._CONFIG['domianURL'] + 'sys/common/upload',
          userWithDepart: '/sys/user/userDepartList', // å¼•入为指定用户查看部门信息需要的url
          //引入为指定用户查看车间信息需要的url
          userProductionList: '/sys/user/userProductionList',
          userId: '/sys/user/generateUserId', // å¼•入生成添加用户情况下的url
          syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流
          queryTenantList: '/sys/tenant/queryList'
        },
        tenantsOptions: [],
        rolesOptions: [],
        nextDepartOptions: [],
        nextProductionOptions: [],
        isDepartType: '',
        model: {
          selectedProduction: ''
        }
      })
      }
    },
    watch: {
      visible: {
        handler(value) {
          if (value) this.initDictData('password_length')
        }
      },
      'model.selectedProduction': {
        handler(newVal, oldVal) {
          if (newVal && this.$refs.selectDeviceModal) {
            // å¦‚果车间选择前后不一致则重置选择设备
            if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = ''
            this.$refs.selectDeviceModal.queryTreeData(newVal)
          }
          // å¦‚果清空车间值则重置选择设备
          if (newVal === '') this.model.equipmentIds = ''
        }
      }
    },
    created() {
      const token = Vue.ls.get(ACCESS_TOKEN)
      this.headers = { 'X-Access-Token': token }
      this.initRoleList()
      this.initTenantList()
      this.queryTreeData()
    },
    computed: {
      uploadAction: function() {
        return this.url.fileUpload
      }
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message: '消息',
              description: res.message
            })
          }
        }).finally(() => {
        })
      },
      add() {
        this.refresh()
        this.edit({
          activitiSync: '1',
          userIdentity: 1,
          selectedroles: '',
          selecteddeparts: '',
          selectedProduction: ''
        })
      },
      edit(record) {
        let that = this
        that.visible = true
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize()
        that.userId = record.id
        console.log('record', record)
        that.model = Object.assign({}, record)
        //身份为上级显示负责部门,否则不显示
        if (this.model.userIdentity == 2) {
          this.departIdShow = true
        } else {
          this.departIdShow = false
        }
        if (record.hasOwnProperty('id')) {
          that.getUserRoles(record.id)
          that.getUserDeparts(record.id)
        }
      },
      isDisabledAuth(code) {
        return disabledAuthFilter(code)
      },
      //窗口最大化切换
      toggleScreen() {
        if (this.modaltoggleFlag) {
          this.modalWidth = window.innerWidth
        } else {
          this.modalWidth = 800
        }
        this.modaltoggleFlag = !this.modaltoggleFlag
      },
      // æ ¹æ®å±å¹•变化,设置抽屉尺寸
      resetScreenSize() {
        let screenWidth = document.body.clientWidth
        if (screenWidth < 500) {
          this.drawerWidth = screenWidth
        } else {
          this.drawerWidth = 700
        }
      },
      //初始化租户字典
      initTenantList() {
        getAction(this.url.queryTenantList).then(res => {
          if (res.success) {
            this.tenantsOptions = res.result.map((item, index, arr) => {
              let c = { label: item.name, value: item.id + '' }
              return c
            })
          }
        })
      },
      //初始化角色字典
      initRoleList() {
        queryall().then((res) => {
          if (res.success) {
            this.rolesOptions = res.result.map((item, index, arr) => {
              let c = { label: item.roleName, value: item.id }
              return c
            })
          }
        })
      },
      getUserRoles(userid) {
        queryUserRole({ userid: userid }).then((res) => {
          if (res.success) {
            this.$set(this.model, 'selectedroles', res.result.join(','))
          }
        })
      },
      getUserDeparts(userid) {
        let that = this
        //部门的url èŽ·å–éƒ¨é—¨åˆ†é…
        getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
          if (res.success) {
            let departOptions = []
            let selectDepartKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectDepartKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              departOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(','))
            that.nextDepartOptions = departOptions
          }
        })
        // èŽ·å–è½¦é—´åˆ†é…
        getAction(that.url.userProductionList, { userId: userid }).then((res) => {
          if (res.success) {
            let ProductionOptions = []
            let selectProductKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectProductKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              ProductionOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selectedProduction', selectProductKeys.join(','))
            that.nextProductionOptions = ProductionOptions
          }
        })
        //车间的url
      },
      backDepartInfo(info) {
        this.model.departIds = this.model.selecteddeparts
        this.nextDepartOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      backProductionInfo(info) {
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      refresh() {
        this.userId = ''
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
      },
      close() {
        this.$emit('close')
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
        this.$refs.form.resetFields()
      },
      moment,
      handleSubmit() {
        const that = this
        // è§¦å‘表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true
            //如果是上级择传入departIds,否则为空
            if (this.model.userIdentity !== 2) {
              this.model.departIds = ''
            }
            let obj
            if (!this.model.id) {
              this.model.id = this.userId
              obj = addUser(this.model)
            } else {
              obj = editUser(this.model)
            }
            obj.then((res) => {
              if (res.success) {
                that.$message.success(res.message)
                that.$emit('ok')
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.confirmLoading = false
              that.close()
            })
          } else {
            return false
          }
        })
      },
      handleCancel() {
        this.close()
      },
      validateToNextPassword(rule, value, callback) {
        const confirmpassword = this.model.confirmpassword
        if (value && confirmpassword && value !== confirmpassword) {
          callback('两次输入的密码不一样!')
        }
        if (value && this.confirmDirty) {
          this.$refs.form.validateField(['confirmpassword'])
        }
        callback()
      },
      compareToFirstPassword(rule, value, callback) {
        if (value && value !== this.model.password) {
          callback('两次输入的密码不一样!')
        } else {
          callback()
        }
      },
      validatePhone(rule, value, callback) {
        if (!value) {
          callback()
        } else {
          if (new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(value)) {
            var params = {
              tableName: 'sys_user',
              fieldName: 'phone',
              fieldVal: value,
              dataId: this.userId
            }
            duplicateCheck(params).then((res) => {
              if (res.success) {
                callback()
              } else {
                callback('手机号已存在!')
              }
            })
          } else {
            callback('请输入正确格式的手机号码!')
          }
        }
      },
      validateEmail(rule, value, callback) {
        if (!value) {
          callback()
        } else {
          if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
            var params = {
              tableName: 'sys_user',
              fieldName: 'email',
              fieldVal: value,
              dataId: this.userId
            }
            duplicateCheck(params).then((res) => {
              console.log(res)
              if (res.success) {
                callback()
              } else {
                callback('邮箱已存在!')
              }
            })
          } else {
            callback('请输入正确格式的邮箱!')
          }
        }
      },
      validateUsername(rule, value, callback) {
        var params = {
          tableName: 'sys_user',
          fieldName: 'username',
          fieldVal: value,
          dataId: this.userId
        }
        duplicateCheck(params).then((res) => {
          if (res.success) {
            callback()
          } else {
            callback('用户名已存在!')
          }
        })
      },
      validateWorkNo(rule, value, callback) {
        var params = {
          tableName: 'sys_user',
          fieldName: 'work_no',
          fieldVal: value,
          dataId: this.userId
        }
        duplicateCheck(params).then((res) => {
          if (res.success) {
            callback()
          } else {
            callback('工号已存在!')
          }
        })
      },
      handleConfirmBlur(e) {
        const value = e.target.value
        this.confirmDirty = this.confirmDirty || !!value
      },
      beforeUpload: function(file) {
        var fileType = file.type
        if (fileType.indexOf('image') < 0) {
          this.$message.warning('请上传图片')
          return false
        }
        //TODO éªŒè¯æ–‡ä»¶å¤§å°
      },
      identityChange(e) {
        if (e.target.value === 1) {
          this.departIdShow = false
        } else {
          this.departIdShow = true
        }
      },
      initDictData(dictCode) {
        //根据字典Code, åˆå§‹åŒ–字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            const regExp = new RegExp('^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:";\'<>?,./]).{' + Number(res.result[0].value) + ',}$')
            this.validatorRules.password[0] = {
              required: true,
              pattern: regExp,
              message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`
            }
          }
        })
      },
      deviceSearch() {
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      },
      /**
       * é€‰æ‹©å·²æœ‰è®¾å¤‡åŽç‚¹å‡»ç¡®å®šæ—¶è§¦å‘
       * @param data å·²é€‰æ‹©çš„设备数组
       */
      selectOK(data) {
        console.log('data=', data)
        this.$set(this.model, 'equipmentIds', data.join(','))
      }
    }
  }
}
</script>
<style scoped>
.avatar-uploader > .ant-upload {
  width: 104px;
  height: 104px;
}
.ant-upload-select-picture-card i {
  font-size: 49px;
  color: #999;
}
  .avatar-uploader > .ant-upload {
    width: 104px;
    height: 104px;
  }
.ant-upload-select-picture-card .ant-upload-text {
  margin-top: 8px;
  color: #666;
}
  .ant-upload-select-picture-card i {
    font-size: 49px;
    color: #999;
  }
.ant-table-tbody .ant-table-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}
  .ant-upload-select-picture-card .ant-upload-text {
    margin-top: 8px;
    color: #666;
  }
.drawer-bottom-button {
  position: absolute;
  bottom: -8px;
  width: 100%;
  border-top: 1px solid #e8e8e8;
  padding: 10px 16px;
  text-align: right;
  left: 0;
  background: #fff;
  border-radius: 0 0 2px 2px;
}
  .ant-table-tbody .ant-table-row td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .drawer-bottom-button {
    position: absolute;
    bottom: -8px;
    width: 100%;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    left: 0;
    background: #fff;
    border-radius: 0 0 2px 2px;
  }
</style>