<!-- 经销商授权信息-查看 -->
<template>
  <el-dialog title="查看" :visible.sync="visible" :close-on-click-modal="false" :close-on-press-escape="false">
    <el-form :model="formData" label-position="left" label-width="120px">
      <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key">
        <el-input v-if="column.type == 'Input'" readonly v-model="formData[column.key]" autocomplete="off">
        </el-input>

        <el-date-picker v-if="column.type == 'DateRange'" readonly v-model="formData[column.key]" type="daterange"
          format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>

        <el-date-picker v-if="column.type == 'Date'" readonly v-model="formData[column.key]" type="date"
          format="yyyy-MM-dd " value-format="yyyy-MM-dd" placeholder="选择日期">
        </el-date-picker>

      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="setVisible(false)">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { FormColumns } from './column';
import { initParams } from '../utils/init'
export default {

  name: 'authprivSee',
  data() {

    return {
      visible: false,
      formData: { ...initParams(FormColumns) },
      formColumns: FormColumns,

    }
  },
  methods: {
    // 控制弹窗展示
    setVisible(val) {

      this.visible = val;

    },
    setFormData(data) {

      if (data.id) {

        this.formData = {

          ...data,

          time: [data.startTime, data.endTime]

        };

      }

    },
  },
  created() {
  }

}
</script>


<style lang="scss" scoped>
.authpriv {
  width: calc(100% - 24px);
  height: 100%;
  margin: 10px
}
</style>