<template>
  <Dialog :is-dialog-exist="showDialog" :title="dialogTitle" :dialog-style="dialogStyle" @close-dialog="handleClose">
    <el-container>
      <el-main>
        <el-form ref="formData" :model="formData" :rules="rules" label-width="auto">
          <el-form-item label="状态">
            <span :style="{ fontSize: '16px',
                    color: selectItem.companyVerify === '3' ? '#FF494A' :
                    selectItem.companyVerify === '2' ? '#FFBB00' :
                    selectItem.companyVerify === '1' ? '#0DB903' : '#666666'
            }"> • {{ selectItem.idVerifiedText }}</span>
          </el-form-item>
          <el-form-item label="备注">
            <span style="color: #999999;">{{ selectItem.memo !== undefined && selectItem.memo.length > 0 ? selectItem.memo : '暂无' }}</span>
          </el-form-item>
        </el-form>
      </el-main>
      <el-footer>
        <el-button type="primary" @click="handleClose">确定</el-button>
      </el-footer>
    </el-container>
  </Dialog>
</template>

<script>
import Dialog from '@/components/Dialog/index'
/**
 * 站长等级的编辑dialog
 */
export default {
  components: { Dialog },
  props: {
    // 弹窗控制参数
    showDialog: {
      type: Boolean,
      default: false
    },
    // 弹窗标题
    dialogTitle: {
      type: String,
      default: ''
    },
    // 选中的数据
    selectItem: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      // dialog样式
      dialogStyle: {
        '--dialog-width': '500px',
        '--dialog-height': '280px',
        '--title-height': '51px'
      },
      // 提交参数
      formData: {},
      // 校验规则
      rules: {}
    }
  },
  watch: {
    showDialog(val) {
      if (val) {
        this.initDataView()
      }
    }
  },
  methods: {
    // 关闭弹窗
    handleClose() {
      this.$emit('handle-close')
    },
    // 初始化弹窗参数
    initDataView() {
      console.log('初始化弹窗参数')
    }
  }
}
</script>

<style lang="scss" scoped>
  .el-container {
    width: 100%;
    height: 100%;
    .el-main {
      height: 90%;
      width: 100%;
      padding-left: 30%;
      padding-right: 30%;
    }
    .el-footer {
      height: 10%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
</style>
