<template>
  <el-dialog :title="title" :visible.sync="dialogVisible" width="500px" id="nodeDialog">
    <div class="node-des">
      <p>节点检查说明</p>
      <div class="gray-border">
        <div v-if='checkType=="firstCheck"||checkType=="secondCheck"'>
          <p>强制检查项</p>
          <p v-for="(t,i) in check[checkType].checkList" :key='i'>
            <i class="el-icon-check" v-if="show&&!t.check"></i>
            <i class="el-icon-close" v-if="show&&t.check"></i>
            {{t.name}}
          </p>
          <p v-if="check[checkType].notCheckList.length">非强制检查项</p>
          <p v-for="(t,i) in check[checkType].notCheckList" :key='-i-1'>
            <i class="el-icon-check" v-if="show&&!t.check"></i>
            <i class="el-icon-close" v-if="show&&t.check"></i>
            {{t.name}}
          </p>
        </div>
      </div>
    </div>
    <div class="result-des" v-if="0">
      <p>处理结果</p>
      <div class="gray-border"></div>
    </div>
    <div class="err-des" v-if="errMsg">
      <p>错误说明</p>
      <div>{{errMsg}}</div>
    </div>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      title: '节点名称',
      check: {
        firstCheck: {
          checkList: [
            { name: '楼层平面图命名规范检查', check: false },
            { name: '项目长度单位检查', check: false },
          ],
          notCheckList: [
            { name: '楼层缺失检查', check: false },
            { name: '构件范围检查', check: false },
            { name: '设备族编码检查', check: false },
            { name: '部件所在位置检查', check: false },
            { name: '柱边界检查', check: false },
            { name: '连接件检查', check: false },
            { name: '系统类型名称检查', check: false },
            { name: '未在空间中的设备', check: false },
            { name: '管段检查', check: false },
            { name: '管网及相关设备检查', check: false },
            { name: 'Revit族参数完整性检查', check: false },
            { name: 'xyz坐标重叠检查', check: false }
          ],
        },
        secondCheck: {
          checkList: [
            { name: '楼层标高与楼层顺序号检查', check: false, value: 'LevelCheck' },
            { name: '轴网检查', check: false, value: 'GridCheck' }
          ],
          notCheckList: [],
        }
      },
      show: false,
      errMsg: '',
      checkType: ''
    };
  },
  methods: {
    showDialog(msg, type, title) {
      this.errMsg = msg.ErrorMsg || '';
      this.checkType = type || '';
      this.title = title
      this.show = msg.BeginTime
      if (type) {
        this.check[type].checkList.forEach(t => {
          if (t.value && t.value == 'GridCheck') {
            t.check = msg.GridCheck || false
          }
          if (t.value && t.value == 'LevelCheck') {
            t.check = msg.LevelCheck || false
          }
        })
      }
      this.dialogVisible = true;
    }
  }
};
</script>
<style lang="less" scoped>
#nodeDialog {
  .node-des,
  .result-des {
    color: #89969f;
    & > div {
      min-height: 50px;
      padding: 5px;
      p {
        font-size: 12px;
        i {
          margin: 0 5px 0 0;
        }
      }
    }
    & > p {
      margin: 5px 0;
    }
  }
  .err-des {
    color: #ff6660;
    & > div {
      border: 1px solid #ff6660;
      min-height: 50px;
    }
  }
  .gray-border {
    border: 1px solid #dedee0;
  }
  .red-border {
    border: 1px solid #ff6660;
  }
  .el-icon-check {
    font-size: 14px;
    color: #4cba38;
  }
  .el-icon-close {
    font-size: 14px;
    color: #ff6660;
  }
  /deep/ .el-dialog__body {
    max-height: 400px;
    overflow-y: auto;
  }
}
</style>