<template>
  <div>
    <el-dialog
        :before-close="handleClose"
        :modal="true"
        :modal-append-to-body="false"
        :visible.sync="dialogVisible"
        class="dissatisfied-detail"
        title=""
        width="1366px"
    >
      <div class="content">
        <div class="main-title main-title2">
          <Title text="资源调度"/>
        </div>

        <div class="contents">
          <el-row :gutter="30">
            <el-col :span="5">
              <div class="tree">
                <el-tree
                    :data="data"
                    :default-expand-all="true"
                    :props="defaultProps"
                    icon-class="el-icon-arrow-right"
                    @node-click="handleNodeClick"
                />
              </div>
            </el-col>
            <el-col :span="19">
              <div class="table">
                <el-table v-loading="loading" :data="list" element-loading-background="rgba(0, 0, 0, 0.3)"
                          max-height="600px">
                  <el-table-column label="资源类型" prop="orgName" width="120"/>
                  <el-table-column label="所属组织" prop="name" width="180"/>
                  <el-table-column label="姓名/名称" prop="name" width="120"/>
                  <el-table-column label="联系电话" prop="name" width="120"/>
                  <el-table-column label="状态" prop="name" width="120"/>
                  <el-table-column label="距离" prop="name" width="120"/>
                  <el-table-column label="操作" prop="op" width="250">
                    <template slot-scope="scope">
                      <CallPhone text="拨打电话"/>
                      <span class="handle">处理</span>
                      <span class="view" @click="handleViews(scope.row)">查看</span>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-dialog>
    <ResourceInfo ref="ResourceInfo"/>
  </div>
</template>

<script>
import Title from "@/views/dataBoard/satisfactionEval/components/Title";
import CallPhone from "@/views/dataBoard/cpts/CallPhone";
import ResourceInfo from "@/views/dataBoard/overview/components/ResourceInfo";

export default {
  name: "ResourceScheduling",
  components: {Title, CallPhone, ResourceInfo},
  data() {
    return {
      loading: false,
      dialogVisible: false,
      list: [{}, {}],
      data: [
        {
          label: '一级 1',
          children: [{
            label: '二级 1-1',
            children: [{
              label: '三级 1-1-1'
            }]
          }]
        }, {
          label: '一级 2',
          children: [{
            label: '二级 2-1',
            children: [{
              label: '三级 2-1-1'
            }]
          }, {
            label: '二级 2-2',
            children: [{
              label: '三级 2-2-1'
            }]
          }]
        }, {
          label: '一级 3',
          children: [{
            label: '二级 3-1',
            children: [{
              label: '三级 3-1-1'
            }]
          }, {
            label: '二级 3-2',
            children: [{
              label: '三级 3-2-1'
            }]
          }]
        }],
      defaultProps: {
        children: 'children',
        label: 'label'
      }
    };
  },
  methods: {
    handleClose(done) {
      this.dialogVisible = false;
    },
    open(id) {
      this.dialogVisible = true;
      this.getDetail(id);
    },
    getDetail(id) {

    },
    handleViews() {
      this.$refs.ResourceInfo.open()
    },
    handleNodeClick() {

    }
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/scss/dataBoard/dialog.scss";
@import "@/assets/scss/dataBoard/tree.scss";
@import "@/assets/scss/dataBoard/table2.scss";

.handle {
  font-size: 14px;
  margin-left: 10px;
  color: #9A69EC;
}

.view {
  font-size: 14px;
  margin-left: 10px;
  color: #007FF1;
}
</style>
