<!--
 * @Author: zwq
 * @Date: 2020-12-29 16:37:56
 * @LastEditors: gtz
 * @LastEditTime: 2022-03-16 19:13:47
 * @Description:
-->
<template>
  <el-dialog
    :title="'btn.detail' | i18nFilter"
    :visible.sync="visible"
  >
    <el-form ref="dataForm" :model="dataForm" label-width="100px">
      <el-form-item :label="$t('module.dashboard.currLocation')" prop="currLocation">
        {{ dataForm.currLocation }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.storageBoxCode')" prop="storageBoxCode">
        {{ dataForm.storageBoxCode }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.isEmpty')" prop="isEmpty">
        {{ dataForm.isEmpty >= 0 ? emptyDict[dataForm.isEmpty] : '' }}
      </el-form-item>
      <el-form-item :label="$t('module.dashboard.status')" prop="status">
        {{ dataForm.status >= 0 ? statusDict[dataForm.status] : '' }}
      </el-form-item>
    </el-form>
    <div class="drawer-footer">
      <el-button @click="visible = false">{{ 'btn.cancel' | i18nFilter }}</el-button>
    </div>
  </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
      },
      emptyDict: {
        0: this.$t('module.dashboard.empty'),
        1: this.$t('module.dashboard.notEmpty')
      },
      statusDict: {
        0: this.$t('module.dashboard.initialize'),
        1: this.$t('module.dashboard.finish')
      }
    }
  },
  methods: {
    init(data) {
      this.visible = true
      console.log(data)
    }
  }
}
</script>

<style scoped>
.drawer-footer {
  width: 100%;
  margin-top: 50px;
  border-top: 1px solid #e8e8e8;
  padding: 10px 50px;
  text-align: left;
  background: #fff;
}
</style>
