zhaowei
2025-01-21 baf140f1668a508a566f8ee04077ea5900090a66
OEE页面新增计算OEE功能
已添加1个文件
已修改2个文件
107 ■■■■■ 文件已修改
src/api/mdc.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/mdc.js
@@ -40,5 +40,8 @@
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteParamThresholdApi: id => deleteAction('/mdc/mdcEquipmentThreshold/delete', { id }),
  // åˆ é™¤è®¾å¤‡å‚数阈值
  deleteBatchParamThresholdApi: ids => deleteAction('/mdc/mdcEquipmentThreshold/deleteBatch', { ids })
  deleteBatchParamThresholdApi: ids => deleteAction('/mdc/mdcEquipmentThreshold/deleteBatch', { ids }),
  // -------------------------------------OEE页面--------------------------------------------
  // è®¡ç®—OEE
  computeOeeApi: params => postAction('/mdc/mdcOeeInfo/computeOee', params)
}
src/views/mdc/base/modules/OEEAnalysis/ComputeOeeModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
<template>
  <a-modal title="计算OEE" :visible="visible" :width="550" @cancel="handleModalClose" @ok="handleComputeOee"
           :maskClosable="false">
    <a-form-model :model="model" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="日期">
            <a-range-picker v-model="dates" style="width: 100%" value-format="YYYY-MM-DD"
                            @change="dateParamChange"></a-range-picker>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
  </a-modal>
</template>
<script>
  import mdcApi from '@/api/mdc'
  export default {
    name: 'ComputeOeeModal',
    components: {},
    data() {
      return {
        visible: false,
        model: {},
        dates: [],
        labelColLong: {
          xs: { span: 24 },
          sm: { span: 3 }
        },
        wrapperColLong: {
          xs: { span: 24 },
          sm: { span: 21 }
        }
      }
    },
    methods: {
      handleComputeOee() {
        console.log('model', this.model)
        if (this.dates.length === 0) {
          this.$notification.warning({
            message: '消息',
            description: '请选择时间'
          })
          return
        }
        mdcApi.computeOeeApi(this.model)
          .then(res => {
            if (res.success) {
              this.$notification.success({
                message: '消息',
                description: res.message
              })
              this.visible = false
            } else {
              this.$notification.error({
                message: '消息',
                description: '计算失败'
              })
            }
          })
          .catch(err => {
            this.$notification.error({
              message: '消息',
              description: '计算失败'
            })
          })
      },
      dateParamChange(value1, value2) {
        this.model.startTime = value2[0]
        this.model.endTime = value2[1]
      },
      handleModalClose() {
        this.visible = false
        this.model = {}
        this.dates = []
      }
    }
  }
</script>
<style scoped>
</style>
src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -28,6 +28,7 @@
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <div class="table-operator">
      <a-button type="primary" icon="download" @click="handleExportXls('OEE')">导出</a-button>
      <a-button type="primary" icon="edit" @click="handleComputeModalOpen">计算</a-button>
    </div>
    <!-- table区域-begin -->
@@ -47,17 +48,20 @@
        </template>
      </a-table>
    </div>
    <ComputeOeeModal ref="computeOeeModalRef"/>
  </div>
</template>
<script>
  import moment from 'moment'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ComputeOeeModal from './ComputeOeeModal'
  export default {
    name: 'OEEAnalysisList',
    mixins: [JeecgListMixin],
    components: {},
    components: { ComputeOeeModal },
    props: { nodeTree: '', Type: '', nodePeople: '' },
    data() {
      return {
@@ -217,11 +221,18 @@
      }
    },
    methods: {
      handleComputeModalOpen() {
        console.log('触发进入open')
        const { $refs } = this
        $refs.computeOeeModalRef.visible = true
      },
      dateParamChange(v1, v2) {
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        this.dates = [v1[0], v1[1]]
      },
      searchReset() {
        this.dates = [moment().subtract(1, 'day'), moment()]
        this.queryParam = {
@@ -230,6 +241,7 @@
        }
        this.loadData(1)
      },
      /**
       * å½“浏览器可视窗口尺寸发生改变时触发
       */