<!--
 * @Author: zwq
 * @Date: 2020-12-29 16:37:56
 * @LastEditors: gtz
 * @LastEditTime: 2022-03-18 16:18:38
 * @Description:
-->
<template>
  <el-dialog
    :title="'btn.detail' | i18nFilter"
    :visible.sync="visible"
  >
    <el-form ref="dataForm" :model="dataForm" label-width="150px">
      <el-form-item :label="$t('module.dashboard.name')" prop="name">
        {{ dataForm.name }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.attribute')" prop="attribute">
        {{ dataForm.attribute ? portAttributeObj[dataForm.attribute] : '' }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.cassetteStatus')" prop="cassetteVoList">
        {{ dataForm.cassetteVoList && dataForm.cassetteVoList.length && dataForm.cassetteVoList[0].status ? cassetteStatusObj[dataForm.cassetteVoList[0].status] : '' }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.workOrderNo')" prop="workOrderNo">
        {{ dataForm.workOrderNo }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.storageBoxCode')" prop="storageBoxCode">
        {{ dataForm.storageBoxCode }}
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
    </span>
  </el-dialog>
</template>

<script>

export default {
  data() {
    return {
      visible: false,
      dataForm: {
        code: null,
        createTime: null,
        currLocation: null,
        currLocationId: null,
        id: null,
        isEmpty: null,
        status: null,
        storageBoxCode: null,
        storageBoxId: null,
        updateTime: null
      },
      cassetteStatusObj: {
        '1': 'Empty Cassette',
        '2': 'Dummy Cassette',
        '3': 'OK Cassette',
        '4': 'NOK Cassette'
      },
      portAttributeObj: {
        1: 'Working Port',
        2: 'Buffer Port',
        3: 'Exception Port'
      }
    }
  },
  methods: {
    init(data) {
      console.log(data)
      this.visible = true
      this.dataForm = data
    }
  }
}
</script>
