<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2019-10-21 14:27:29
 * @LastEditors: 无尘
 * @LastEditTime: 2019-10-23 14:16:57
 -->

<!--
<review-result-detail
  :detailShow="detailShow"
  @hideDetailDialog="hideDetailDialog">
</review-result-detail>

import reviewResultDetail from '@/components/review/review-result-detail.vue'
 -->
<template>
  <div v-show="customDialog">
    <el-dialog class="edit-dialog" title="审核详情" :visible.sync="customDialog" width="600px" :before-close="handleClose">
      <div class="edit-dialog-body">
        <el-table :data="tableData" style="width: 100%" height="250">
          <el-table-column prop="publishRecordId" label="审核事项" show-overflow-tooltip> </el-table-column>
          <el-table-column label="品牌" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.remark }}
            </template>
          </el-table-column>
          <el-table-column label="提交人" show-overflow-tooltip>
            <template slot-scope="scope">
              <div class="flex">
                <div class="flex flex-align-center flex-pack-center bg-82C5FF table-head-pic">
                  <i v-if="!scope.row.headPic" class="iconfont icon-yewuduanmorentouxian"></i>
                  <img v-else :src="scope.row.headPic" alt="img" />
                </div>
                <div class="flex flex-column apply-info">
                  <span>{{ scope.row.applyName }}</span>
                  <span class="font-13">{{ scope.row.storeName }}</span>
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="提交时间" show-overflow-tooltip>
            <template slot-scope="scope">
              <div class="color-606266 line-18">{{ scope.row.publishTime | timeStampToYmd }}</div>
              <div class="color-606266 line-18">{{ scope.row.publishTime | timeStampToHms }}</div>
            </template>
          </el-table-column>
          <el-table-column label="审核结果" show-overflow-tooltip>
            <template slot-scope="scope">
              {{ scope.row.remark }}
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'record-list',
  props: {
    detailShow: {
      type: Boolean,
      default: false
    },
    tableListData: {
      type: Object,
      default() {
        return [];
      }
    }
  },
  data() {
    return {
      customDialog: false, // 弹框显示
      tableData: [
        /* {
          interfaceVersionId: '1',
          version: '测试',
          remark: '描述内容',
          createTime: 1564455643252
        } */
      ]
    };
  },
  methods: {
    /**
     *   关闭
     */
    handleClose(done) {
      const that = this;
      done();
      that.hideDialog();
    },

    /**
     *  取消
     */
    customCancel() {
      const that = this;
      that.hideDialog();
    },

    hideDialog() {
      const that = this;
      that.customDialog = false;
      that.$emit('hideDetailDialog');
    }
  },
  watch: {
    detailShow: function(newData, oldData) {
      const that = this;
      that.customDialog = newData;
    },
    tableListData: function(newData, oldData) {
      const that = this;
      that.tableData = newData;
    }
  },

  /* 接收数据 */
  mounted() {
    const that = this;
    that.customDialog = that.detailShow;
    that.tableData = that.tableListData;
  }
};
</script>

<style lang="less" scoped>
.bg-82C5FF {
  background: #82c5ff;
}
.edit-dialog {
  /deep/ .el-dialog__body {
    padding: 25px 20px 17px 20px;
    min-height: 352px;
  }

  /deep/ .el-dialog__footer {
    border: none;
    padding-top: 3px;
  }

  &__title {
    width: 100%;
    height: 38px;
    padding: 12px 15px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    background: rgba(235, 238, 245, 1);
  }

  .el-alert--info {
    width: 400px;
    font-size: 14px;
    color: #606266;
    background: #e6f7ff;
    border: 1px solid rgba(145, 213, 255, 1);
  }
  .el-icon-info {
    width: 12px;
    font-size: 12px;
    color: #1890ff;
  }
  .el-form {
    margin-top: 40px;
  }
}
</style>
