<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="demo-form-inline">
      <el-form-item label="开始日期">
        <el-date-picker v-model="value1" type="date" placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="结束日期">
        <el-date-picker v-model="value1" type="date" placeholder="选择日期">
        </el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search">搜索</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-plus" @click="add">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain>区域下发</el-button>
      </el-col>
    </el-row>
    <el-table :data="tableData" border style="width: 100%; margin-top: 10px">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" type="index" align="center" />
      <el-table-column prop="date" label="检修区域配置编码" align="center" />
      <el-table-column prop="date" label="检修时间节点开始" align="center" />
      <el-table-column prop="date" label="检修时间节点结束" align="center" />
      <el-table-column prop="date" label="是否有效" align="center" />
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button type="text" icon="el-icon-edit"> 失效 </el-button>
          <el-button type="text" icon="el-icon-delete"> 删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
    />
    <el-dialog
      :title="title"
      :visible.sync="dialogVisible"
      width="42%"
      :before-close="handleClose"
    >
      <el-row :gutter="10">
        <el-col :span="9">
          <el-input></el-input>
          <el-tree
            :data="treeData"
            :props="defaultProps"
            @node-click="handleNodeClick"
          ></el-tree>
        </el-col>
        <el-col :span="15">
          <el-form :model="dialogForm">
            <el-form-item label="类型" label-width="150px">
              <el-select>
                <el-option label="item.label" value="item.value"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="检修区域配置编码" label-width="150px">
              <el-input placeholder="请输入检修区域配置编码"></el-input>
            </el-form-item>
            <el-form-item label="时间日期" label-width="150px">
              <el-date-picker
                v-model="value1"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              >
              </el-date-picker>
            </el-form-item>
            <el-form-item >
                <div style="text-align: center;">
                    <el-button type="primary" >确定</el-button>
                    <el-button>取消</el-button>
                </div>
               
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      queryParams: {
        user: "",
      },
      total: 4,
      tableData: [{}],
      title: "新增检修计划",
      dialogVisible: false,
      treeData: [
        {
          label: "一级 1",
          type: 1,
          children: [
            {
              label: "二级 1-1",
              children: [
                {
                  label: "三级 1-1-1",
                  children: [
                    {
                      label: "四级 1-1-1-1",
                      type: 4,
                    },
                    {
                      label: "四级 1-1-1-2",
                      type: 4,
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
      dialogForm: {},
    };
  },
  methods: {
    add(){
      this.dialogVisible = true;
    }
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-date-editor{
    width: 100%;
}
::v-deep .el-select{
    width: 100%;
}
</style>
