zhaowei
6 天以前 48d85187a16a313c5244a830862db5e672e6997d
src/views/dashboard/EquipmentSignage.vue
@@ -189,15 +189,22 @@
        </dv-border-box-12>
      </div>
    </div>
    <SignageModal ref="modalRef" :modalVisible="modalVisible" :modalWidth="modalWidth" :modalTitle=modalTitle
                  :modalDataApiUrl="modalDataApiUrl"
                  :modalDataApiParams="modalDataApiParams"
                  @closeModal="modalVisible=false"/>
  </div>
</template>
<script>
  import signageApi from '@/api/signage'
  import moment from 'moment'
  import SignageModal from './modules/SignageModal'
  export default {
    name: 'EquipmentSignage',
    components: { SignageModal },
    props: {
      productionCode: {
        type: String,
@@ -220,18 +227,24 @@
        equipmentDetails: {},
        buttonList: [
          {
            label: '备件信息'
            label: '备件信息',
            pageName: '',
            modalDataApiUrl: ''
          },
          {
            label: '保养计划'
            label: '保养计划',
            pageName: '',
            modalDataApiUrl: '/eam/equipment/list'
          },
          {
            label: '报修',
            pageName: 'eam-MalfunctionRepair'
            pageName: 'eam-MalfunctionRepair',
            modalDataApiUrl: ''
          },
          {
            label: '设备班次',
            pageName: 'mdc-base-DeviceCalendar'
            pageName: 'mdc-base-DeviceCalendar',
            modalDataApiUrl: ''
          }
        ],
        lineChart: '',
@@ -249,7 +262,13 @@
        },
        hideLoadingDelayTime: 500,
        isDisplayEquipmentDetails: false,
        isBelongToMdc: true// 是否在mdc设备表中
        isBelongToMdc: true,// 是否在mdc设备表中
        modalVisible: false,
        modalWidth: 1048,
        modalTitle: '',
        modalDataApiUrl: '',
        modalTableColumns: [],
        modalDataApiParams: {}
      }
    },
    created() {
@@ -276,9 +295,10 @@
          if (newVal) this.lineChartWidth = '40%'
          else this.lineChartWidth = '65%'
          this.$nextTick(() => {
            this.lineChart.resize()
            if (this.lineChart) this.lineChart.resize()
          })
        }
        },
        immediate: true
      }
    },
    methods: {
@@ -374,6 +394,66 @@
            name: record.pageName,
            params: { equipmentId: this.equipmentId }
          })
        } else {
          this.$refs.modalRef.modalTableColumns = [
            {
              title: '#',
              dataIndex: '',
              key: 'rowIndex',
              width: 60,
              align: 'center',
              customRender: function(t, r, index) {
                return parseInt(index) + 1
              }
            },
            {
              width: 150,
              align: 'center',
              title: '设备编号',
              dataIndex: 'num',
              key: 'num'
            },
            {
              width: 200,
              align: 'center',
              title: '设备名称',
              dataIndex: 'name',
              key: 'name'
            },
            {
              width: 200,
              align: 'center',
              title: '设备型号',
              dataIndex: 'model',
              key: 'model'
            },
            {
              width: 250,
              align: 'center',
              title: '规格',
              key: 'specification',
              dataIndex: 'specification'
            },
            {
              width: 170,
              align: 'center',
              title: '下次二保时间',
              key: 'nextSecondMaintenanceTime',
              dataIndex: 'nextSecondMaintenanceTime'
            },
            {
              width: 170,
              align: 'center',
              title: '下次三保时间',
              key: 'nextThirdMaintenanceTime',
              dataIndex: 'nextThirdMaintenanceTime'
            }
          ]
          this.modalWidth = 1248
          this.modalTitle = record.label
          this.modalDataApiParams = { num: this.equipmentId }
          this.modalDataApiUrl = record.modalDataApiUrl
          this.modalVisible = true
        }
      },
@@ -543,8 +623,8 @@
            }
          })
          .finally(() => {
            option.title.text = moment().subtract(1, 'days').format('M月D日') + '利用率'
            option.series[0].name = '利用率'
            option.title.text = moment().subtract(1, 'days').format('M月D日') + 'TEEP'
            option.series[0].name = 'TEEP'
            option.series[0].data = [this.gaugeChartData.utilizationRate]
            this.gaugeChart1.setOption(option, true)
            setTimeout(() => this.gaugeChart1.hideLoading(), this.hideLoadingDelayTime)
@@ -569,7 +649,7 @@
      drawGaugeChart2(opt) {
        const option = Object.assign({}, opt)
        signageApi.getGaugeColorByTypeApi('lyl')
        signageApi.getGaugeColorByTypeApi('kdl')
          .then(res => {
            if (res.success) {
              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
@@ -603,7 +683,7 @@
      drawGaugeChart3(opt) {
        const option = Object.assign({}, opt)
        signageApi.getGaugeColorByTypeApi('lyl')
        signageApi.getGaugeColorByTypeApi('kdl')
          .then(res => {
            if (res.success) {
              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
@@ -669,7 +749,7 @@
          xAxis: this.lineChartData.dateList,
          yAxis: [
            {
              name: '利用率',
              name: 'TEEP',
              value: this.lineChartData.dataList.map(item => item.utilizationRate)
            },
            {
@@ -681,7 +761,7 @@
              value: this.lineChartData.dataList.map(item => item.overallEquipmentEfficiency)
            }
          ],
          yAxisName: '整年度利用率(%)'
          yAxisName: '整年度TEEP(%)'
        }
        let legendData = []
        let seriesData = []
@@ -695,6 +775,13 @@
            symbolSize: 8,
            itemStyle: {
              color: colorArr[index1]
            },
            label: {
              show: true,
              position: 'top',
              textStyle: {
                color: 'inherit'
              }
            },
            lineStyle: {
              width: 2
@@ -744,7 +831,7 @@
            axisLabel: {
              interval: 0,
              show: true,
              fontSize: 12,
              fontSize: 14,
              color: '#fff'
              // rotate: -30,
            },
@@ -765,7 +852,7 @@
              nameTextStyle: {
                color: '#1AD8DE',
                fontSize: 18,
                padding: [0, 0, 0, 110]
                padding: [0, 0, 0, 120]
              },
              nameGap: 25,
              type: 'value',
@@ -788,12 +875,13 @@
            },
            {
              type: 'value',
              position: 'right',
              position: 'left',
              splitNumber: 5,
              max: 100,
              axisLabel: {
                show: true,
                color: '#fff'
                color: '#fff',
                fontSize:14
              },
              axisLine: {
                show: true,