<template>
  <div class="app-container">
    <el-form :inline="true" :model="queryParams" class="demo-form-inline">
      <el-form-item :label="$t('area_management.StartDate')">
        <el-date-picker v-model="value1" type="date" :placeholder="$t('share.PleaseChoose')+$t('share.StartDate')">
        </el-date-picker>
      </el-form-item>
      <el-form-item :label="$t('area_management.EndDate')">
        <el-date-picker v-model="value1" type="date" :placeholder="$t('share.PleaseChoose')+$t('share.EndDate')">
        </el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search">{{$t('share.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">{{$t('share.new')}}</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain>{{ $t('area_management.RegionalDistribution') }}</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="$t('area_management.index')" type="index" align="center" width="55"/>
      <el-table-column prop="date" :label="$t('area_management.MaintenanceAreaConfigurationCode')" align="center" />
      <el-table-column prop="date" :label="$t('area_management.TheMaintenanceTimelineBegins')" align="center" />
      <el-table-column prop="date" :label="$t('area_management.EndOfMaintenanceTimeNode')" align="center" />
      <el-table-column prop="date" :label="$t('area_management.ValidOrNot')" align="center" />
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button type="text" icon="el-icon-edit"> {{ $t('area_management.loseEfficacy') }} </el-button>
          <el-button type="text" icon="el-icon-delete"> {{ $t('share.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="60%"
      :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" label-width="160px">
            <el-form-item :label="$t('area_management.type')" >
              <el-select :placeholder="$t('share.PleaseChoose')+$t('area_management.type')">
                <el-option label="item.label" value="item.value"> </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('area_management.MaintenanceAreaConfigurationCode')" >
              <el-input :placeholder="$t('share.PleaseEnter')+$t('area_management.MaintenanceAreaConfigurationCode')"></el-input>
            </el-form-item>
            <el-form-item :label="$t('area_management.TimeAndDate')" >
              <el-date-picker
                v-model="value1"
                type="daterange"
                range-separator="-"
                :start-placeholder="$t('area_management.StartDate')"
                :end-placeholder="$t('area_management.EndDate')"
              >
              </el-date-picker>
            </el-form-item>
            <el-form-item >
                <div style="text-align: center;">
                    <el-button type="primary" >{{ $t('share.confirm') }}</el-button>
                    <el-button>{{ $t('share.cancel') }}</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: this.$t('area_management.AddMaintenancePlan'),
      dialogVisible: false,
      treeData: [],
      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>
