<template>
  <div>
    <el-dialog
      :title="title"
      :visible.sync="showFormDia"
      width="85%"
      :before-close="handleClose"
      custom-class="bbsl-location-dialog"
      top="1.7vh"
    >
      <el-tabs v-model="activeName">
        <div class="bbsl-scroll-pane">
          <el-form
            ref="formInfo"
            :rules="rules"
            :model="params"
            label-width="150px"
            class="bbsl-scroll-form"
            style="width:100%"
          >
            <p class="from-title" id="step1">
              <i class="el-icon-info"></i>
              <span>基础信息</span>
            </p>
            <el-row>
              <el-col :span="8">
                <el-form-item label="堤防名称：" prop="dikeName">
                  <el-input size="mini" placeholder="请输入堤防名称" v-model="params.dikeName"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="堤防代码：" prop="dikeCode">
                  <el-input
                    maxlength="18"
                    size="mini"
                    placeholder="请输入堤防代码"
                    v-model="params.dikeCode"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="行政区划：" prop="addvcd">
                  <el-cascader
				  filterable
                    :show-all-levels="false"
                    style="width: 100%"
                    :options="basAdNames"
                    v-model="params.addvcd"
                    :props="{
                    value: 'code',
                    label: 'name',
                    children: 'children',
                }"
                    @change="onhouChange"
                    placeholder="请选择所属行政区划"
                    clearable
                  ></el-cascader>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="堤防类型：" prop="dikeType">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.dikeType"
                    clearable
                    placeholder="请选择堤防类型"
                  >
                    <el-option
                      v-for="item in dikeTypes"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="堤防级别：" prop="dikeGrad">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.dikeGrad"
                    clearable
                    placeholder="请选择堤防级别"
                  >
                    <el-option
                      v-for="item in dikeGrads"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="所属河流：" prop="rvName">
                  <el-cascader
				  filterable
                    size="mini"
                    clearable
                    placeholder="请输入所属河流"
                    v-model="params.rvName"
                    :props="{
                        value: 'code',
                        label: 'name',
                        children: 'children',
												checkStrictly: true
                            }"
                    style="width: 100%"
                    @change="changeRvname"
                    :options="rvNames"
                  >
                  </el-cascader>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="堤防型式：" prop="dikePatt">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.dikePatt"
                    clearable
                    placeholder="请选择堤防型式"
                  >
                    <el-option
                      v-for="item in dikePatts"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="高程系统：" prop="elevSys">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.elevSys"
                    clearable
                    placeholder="请选择高程系统"
                  >
                    <el-option
                      v-for="item in elevSyss"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="工程任务：" prop="engTask">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.engTask"
                    clearable
                    placeholder="请选择工程任务"
                  >
                    <el-option
                      v-for="item in engTasks"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="工程建设情况：" prop="engStat">
                  <el-select
                    style="width: 100%"
                    size="mini"
                    v-model="params.engStat"
                    clearable
                    placeholder="请选择工程任务"
                  >
                    <el-option
                      v-for="item in engStats"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="归口管理部门：" prop="admDep">
                  <el-input
                    style="width: 100%"
                    size="mini"
                    v-model="params.admDep"
                    clearable
                    placeholder="请输入归口管理部门"
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="河流岸别：" prop="bankType">
                  <el-select
                    @change="changeBank"
                    style="width: 100%"
                    size="mini"
                    v-model="params.bankType"
                    clearable
                    placeholder="请选择河流岸别"
                  >
                    <el-option
                      v-for="item in bankTypes"
                      :key="item.id"
                      :label="item.name"
                      :value="item.value"
                    ></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="开工时间：" prop="startDate">
                  <el-date-picker
                    style="width: 100%"
                    value-format="yyyy-MM-dd"
                    v-model="params.startDate"
                    type="date"
					size="mini"
                    placeholder="选择开工时间"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="建成时间：" prop="compDate">
                  <el-date-picker
                    style="width: 100%"
					size="mini"
                    value-format="yyyy-MM-dd"
                    v-model="params.compDate"
                    type="date"
                    placeholder="选择建成时间"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="备注：" prop="note">
                <el-input
                  type="textarea"
                  :autosize="{minRows: 2, maxRows: 4}"
                  placeholder="请输入内容"
                  v-model="params.note"
                ></el-input>
              </el-form-item>
            </el-row>
            <p class="from-title" id="step2">
              <i class="el-icon-location"></i>
              <span>所在位置</span>
            </p>
            <el-row>
              <el-col :span="8">
                <el-form-item label="起点所在位置：" prop="startLoc">
                  <el-input size="mini" placeholder="请输入起点位置" v-model="params.startLoc"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="起点经纬度(。)：" prop="startLong">
                  <el-col :span="11">
                    <el-input
                      @input="deadLevs('1')"
                      size="mini"
                      placeholder="请输入起点经度"
                      v-model="params.startLong"
                      maxlength="18"
                    ></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input
                      @input="deadLevs('2')"
                      size="mini"
                      placeholder="请输入起点经度"
                      v-model="params.startLat"
                      maxlength="18"
                    ></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="堤防长度(m)：" prop="dikeLen">
                  <el-input
                    maxlength="32"
                    @input="dfLength"
                    size="mini"
                    placeholder="请输入堤防长度"
                    v-model="params.dikeLen"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="终点所在位置：" prop="endLoc">
                  <el-input size="mini" placeholder="请输入终点位置" v-model="params.endLoc"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="终点经纬度(。)：" prop="endLong">
                  <el-col :span="11">
                    <el-input
                      @input="deadLevs('3')"
                      size="mini"
                      placeholder="请输入终点经度"
                      v-model="params.endLong"
                      maxlength="18"
                    ></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input
                      @input="deadLevs('11')"
                      size="mini"
                      placeholder="请输入终点纬度"
                      v-model="params.endLat"
                      maxlength="18"
                    ></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="桩号：" prop="dikeStartNum">
                  <el-col :span="11">
                    <el-input size="mini" placeholder="请输入起点桩号" v-model="params.dikeStartNum"></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input size="mini" placeholder="请输入终点桩号" v-model="params.dikeEndNum"></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <p class="from-title" id="step2">
              <i class="el-icon-s-tools"></i>
              <span>工程数据</span>
            </p>
            <el-row>
              <el-col :span="8">
                <el-form-item label="设计水位(m)：" prop="dikeWal">
                  <el-input
                    @input="deadLevs('4')"
                    size="mini"
                    placeholder="请输入设计水位"
                    v-model="params.dikeWal"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="规划防洪标准：" prop="dikePfcs">
                  <el-input size="mini" placeholder="请输入规划防洪标准" v-model="params.dikePfcs"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="现状防洪标准：" prop="dikeFcs">
                  <el-input size="mini" placeholder="请输入现状防洪标准" v-model="params.dikeFcs"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="堤防高度(m)：" prop="dikeHeigMin">
                  <el-col :span="11">
                    <el-input
                      @input="dikeHeigMins"
                      size="mini"
                      style="width: 100%"
                      placeholder="输入最小高度"
                      v-model="params.dikeHeigMin"
                    ></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input
                      style="width: 100%"
                      @input="dikeHeigMaxs"
                      size="mini"
                      placeholder="输入最大高度"
                      v-model="params.dikeHeigMax"
                    ></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="堤防宽度(m)：" prop="dikeTopWidMin">
                  <el-col :span="11">
                    <el-input
                      @input="dikeTopWidMins"
                      size="mini"
                      placeholder="请输入堤防最小宽度"
                      v-model="params.dikeTopWidMin"
                    ></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input
                      @input="dikeTopWidMaxs"
                      size="mini"
                      placeholder="请输入堤防最大宽度"
                      v-model="params.dikeTopWidMax"
                    ></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="坝顶高程(m)：" prop="startDikeTopEl">
                  <el-col :span="11">
                    <el-input
                      @input="checkInput"
                      size="mini"
                      placeholder="请输入起点坝顶高程"
                      v-model="params.startDikeTopEl"
                    ></el-input>
                  </el-col>
                  <el-col class="line" style="text-align:center" :span="2">-</el-col>
                  <el-col :span="11">
                    <el-input
                      @input="endDikeTopEls"
                      size="mini"
                      placeholder="请输入终点坝顶高程"
                      v-model="params.endDikeTopEl"
                    ></el-input>
                  </el-col>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="8">
                <el-form-item label="防洪保护区面积(km2)：" prop="dikeFca">
                  <el-input
                    @input="deadLevs('5')"
                    size="mini"
                    oninput="value=value.replace(/[^\d.]/g,'')"
                    placeholder="请输入防洪保护区面积"
                    v-model="params.dikeFca"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="保护耕地面积(km2)：" prop="dikeCla">
                  <el-input
                    @input="deadLevs('6')"
                    size="mini"
                    oninput="value=value.replace(/[^\d.]/g,'')"
                    placeholder="请输入保护耕地面积"
                    v-model="params.dikeCla"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="保护人口(万人)：" prop="dikePop">
                  <el-input
                    size="mini"
                    @input="personNumber"
                    placeholder="请输入保护人口"
                    v-model="params.dikePop"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </el-tabs>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="goInfo">保 存</el-button>
        <el-button @click="handleClose">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import dikeManager from '@/api/reservoirManagement/dikeManager.js'
import req from '@/request.js'
import latitude from '@/mixins/latitude'
export default {
  name: 'dikeForm-dialog',
  props: {
    showFormDia: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    },
    pId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      activeName: 'form',
      params: {
        addvcd: null, //行政区划
        startDate: null, //开工时间
        dikePop: null, //保护人口
        dikeCla: null, //保护耕地面积（km2
        dikeFca: null, //防洪保护区面积（km2）
        dikeFcs: null, //现防洪标准
        dikePfcs: null, //规划防洪标准
        dikeWal: null, //设计水位
        bankType: null, //河流岸别
        rvName: null, //所属河流
        dikeCode: null, //堤防代码
        dikeName: null, //堤防名称
        admDep: null, //归口管理部门
        compDate: null, //建成时间
        dikeEndNum: null, //堤防终点桩号
        dikeGrad: null, //堤防级别（参考字典
        dikeHeigMax: null, //堤防最大高度（单位：米）
        dikeHeigMin: null, //堤防最小高度（单位：米
        dikeLen: null, //堤防长度（单位：米）
        dikePatt: null, //堤防型式（参考字典
        dikeStartNum: null, //堤防起点桩号
        dikeTopWidMax: null, //堤顶最大宽度（单位：米）
        dikeTopWidMin: null, //堤顶最小宽度（单位：米））
        dikeType: null, //堤防类型（参考字典）
        elevSys: null, //高程系统
        endDikeTopEl: null, //终点堤顶高程（单位：米
        endLat: null, //终点纬度（单位：[°]）
        endLoc: null, //终点所在位置
        endLong: null, //终点经度（单位：[°]）
        engStat: null, //工程建设情况
        engTask: null, //工程任务（参考字典）
        startDikeTopEl: null, //起点堤顶高程（单位：米）
        startLat: null, //起点纬度（单位：[°]
        startLoc: null, //起点所在位置
        startLong: null, //起点经度（单位：[°]）
        note: null
      },
      basAdNames: [], //行政区划
      dikeTypes: [], //堤防类型
      dikePatts: [], //堤防形式
      dikeGrads: [], //df堤防级别
      elevSyss: [], //高程系统
      engTasks: [], //工程任务
      rvNames: [], //河流下拉
      bankTypes: [], //岸别
      ifMainDams: [
        {name: '未知', value: '0'},
        {name: '是', value: '1'},
        {name: '否', value: '2'}
      ],
      damTypeMats: [],
      damTypeStrs: [],
      engStats: [], //工程建设情况
      rules: {
        dikeName: [
          {
            required: true,
            message: '请输入堤防名称',
            trigger: 'blur'
          }
        ],
        dikeCode: [
          {required: true, message: '请输入堤防代码', trigger: 'blur'}
        ],
        dikeType: [
          {required: true, message: '请选择堤防类型', trigger: 'blur'}
        ],
        dikeGrad: [
          {required: true, message: '请选择堤防级别', trigger: 'blur'}
        ],
        addvcd: [{required: true, message: '请选择行政区划', trigger: 'blur'}]
      }
    }
  },
  created() {
    this.getDetailInfo()
    this.getSysDict()
    //河流下拉
    dikeManager.getrvName({}, res => {
      console.log(res);
      
      this.rvNames = res.value
    })
    dikeManager.getbasAdName({}, res => {
      this.basAdNames = res.value
    })
  },
  methods: {
    onhouChange(val) {
      if (val) {
        this.params.addvcd = val[val.length - 1]
      }
    },
    deadLevs(val) {
      switch (val) {
        case '1':
          this.params.startLong = latitude.TreeFour(this.params.startLong)
          break
        case '2':
          this.params.startLat = latitude.TreeFour(this.params.startLat)
          break
        case '3':
          this.params.endLong = latitude.TreeFour(this.params.endLong)
          break
        case '4':
          this.params.dikeWal = latitude.FourTwo(this.params.dikeWal)
          break
        case '5':
          this.params.dikeFca = latitude.ElghtTwo(this.params.dikeFca)
          break
        case '6':
          this.params.dikeCla = latitude.ElghtTwo(this.params.dikeCla)
          break
        default:
          this.params.endLat = latitude.TreeFour(this.params.endLat)
      }
    },
    checkInput() {
      this.params.startDikeTopEl = this.TwoTwo(this.params.startDikeTopEl)
    },
    endDikeTopEls() {
      this.params.endDikeTopEl = this.TwoTwo(this.params.endDikeTopEl)
    },
    dikeHeigMins() {
      this.params.dikeHeigMin = this.TwoTwo(this.params.dikeHeigMin)
    },
    dikeHeigMaxs() {
      this.params.dikeHeigMax = this.TwoTwo(this.params.dikeHeigMax)
    },
    dikeTopWidMins() {
      this.params.dikeTopWidMin = this.TwoTwo(this.params.dikeTopWidMin)
    },
    dikeTopWidMaxs() {
      this.params.dikeTopWidMax = this.TwoTwo(this.params.dikeTopWidMax)
    },
    personNumber() {
      this.params.dikePop = this.TwoTwo(this.params.dikePop)
    },
    dfLength() {
      this.params.dikeLen = this.TwoTwos(this.params.dikeLen)
    },
    SixTwo(value) {
      value = value.replace(/^0*(0\.|[1-3])/, '$1')
      value = value.replace(/[^\d.]/g, '') //清除"数字"和"."以外的字符
      value = value.replace(/^\./g, '') //验证第一个字符是数字而不是字符
      value = value.replace(/\.{1,}/g, '.') //只保留第一个.清除多余的
      value = value
        .replace('.', '$#$')
        .replace(/\./g, '')
        .replace('$#$', '.')
      value = value.replace(/^(\-)*(\d*)\.(\d\d).*$/, '$1$2.$3') //只能输入两个小数
      value =
        value.indexOf('.') > 0
          ? value.split('.')[0].substring(0, 4) + '.' + value.split('.')[1]
          : value.substring(0, 4)
      return value
    },
    TwoTwo(value) {
      value = value.replace(/^0*(0\.|[1-3])/, '$1')
      value = value.replace(/[^\d.]/g, '') //清除"数字"和"."以外的字符
      value = value.replace(/^\./g, '') //验证第一个字符是数字而不是字符
      value = value.replace(/\.{1,}/g, '.') //只保留第一个.清除多余的
      value = value
        .replace('.', '$#$')
        .replace(/\./g, '')
        .replace('$#$', '.')
      value = value.replace(/^(\-)*(\d*)\.(\d\d).*$/, '$1$2.$3') //只能输入两个小数
      value =
        value.indexOf('.') > 0
          ? value.split('.')[0].substring(0, 6) + '.' + value.split('.')[1]
          : value.substring(0, 6)
      return value
    },
    TwoTwos(value) {
      value = value.replace(/^0*(0\.|[1-3])/, '$1')
      value = value.replace(/[^\d.]/g, '') //清除"数字"和"."以外的字符
      value = value.replace(/^\./g, '') //验证第一个字符是数字而不是字符
      value = value.replace(/\.{1,}/g, '.') //只保留第一个.清除多余的
      value = value
        .replace('.', '$#$')
        .replace(/\./g, '')
        .replace('$#$', '.')
      value = value.replace(/^(\-)*(\d*)\.(\d\d\d\d).*$/, '$1$2.$3') //只能输入两个小数
      value =
        value.indexOf('.') > 0
          ? value.split('.')[0].substring(0, 6) + '.' + value.split('.')[1]
          : value.substring(0, 6)
      return value
    },
    changeRvname(val) {
      if (val) {
        this.params.rvName = val
      } else {
        this.params.rvName = null
      }
    },
    changeBank(val) {
      if (val) {
        this.params.bankType = val
      } else {
        this.params.bankType = null
      }
    },
    // 根据ID查询
    getDetailInfo() {
      if (this.title === '修改') {
        this.getSysDict()
        dikeManager.detailId(this.pId, res => {
          this.params = res.value
          this.$set(this.params)
        })
      }
    },

    handleClose() {
      this.params = {
        addvcd: null, //行政区划
        dikeCla: null, //保护耕地面积（km2
        dikeFca: null, //防洪保护区面积（km2）
        dikeFcs: null, //现防洪标准
        dikeCode: null, //堤防代码
        rvName: null, //所属河流
        dikeName: null, //堤防名称
        admDep: null, //归口管理部门
        compDate: null, //建成时间
        dikeEndNum: null, //堤防终点桩号
        dikeGrad: null, //堤防级别（参考字典
        dikeHeigMax: null, //堤防最大高度（单位：米）
        dikeHeigMin: null, //堤防最小高度（单位：米
        dikeLen: null, //堤防长度（单位：米）
        dikePatt: null, //堤防型式（参考字典
        dikeStartNum: null, //堤防起点桩号
        dikeTopWidMax: null, //堤顶最大宽度（单位：米）
        dikeTopWidMin: null, //堤顶最小宽度（单位：米））
        dikeType: null, //堤防类型（参考字典）
        elevSys: null, //高程系统
        endDikeTopEl: null, //终点堤顶高程（单位：米
        endLat: null, //终点纬度（单位：[°]）
        endLoc: null, //终点所在位置
        endLong: null, //终点经度（单位：[°]）
        engStat: null, //工程建设情况
        engTask: null, //工程任务（参考字典）
        startDikeTopEl: null, //起点堤顶高程（单位：米）
        startLat: null, //起点纬度（单位：[°]
        startLoc: null, //起点所在位置
        startLong: null, //起点经度（单位：[°]）
        note: null,
        bankType: null, //河流岸别
        dikeWal: null, //设计水位
        dikePfcs: null, //规划防洪标准
        dikePop: null, //保护人口
        startDate: null //开工时间
      }
      this.$emit('closeFormDiao')
    },
    goInfo(e) {
      this.$refs.formInfo.validate(valid => {
        if (valid) {
          if (this.title === '新增') {
            dikeManager.addSave(this.params, response => {
              if (response.state) {
                this.$notify({
                  type: 'success',
                  message: '新增成功',
                  duration: 2000
                  // offset: 80
                })
                this.$emit('closeFormDiao')
                this.$emit('refList')
              } else {
              }
            })
          }
          if (this.title === '修改') {
            dikeManager.upData(this.params, response => {
              if (response.state) {
                this.$notify({
                  type: 'success',
                  message: '修改成功',
                  duration: 2000
                  // offset: 80
                })
                this.$emit('closeFormDiao')
                this.$emit('refList')
              } else {
              }
            })
          }
        } else {
          return false
        }
      })
    },
    //获取字典数据
    getSysDict() {
      let portal = window.context.portal
      return new Promise((resolve, reject) => {
        req.post(portal + '/sys/sysDictionary/v1/queryAllDictItems').then(
          response => {
            resolve(response.data)
            this.dikeTypes = response.data.dflx //堤防类型
            this.dikeGrads = response.data.dfjb //堤防级别
            this.dikePatts = response.data.dfxs //堤防形式
            this.elevSyss = response.data.gcxt //堤防高程系统
            this.engTasks = response.data.gcrw //堤防工程任务
            this.bankTypes = response.data.hlab //岸别
            this.engStats = response.data.gcjsqk
            if (this.title === '新增') {
              this.params.dikeType = this.dikeTypes[0].value
              this.params.dikeGrad = this.dikeGrads[0].value
              this.params.bankType = this.bankTypes[0].value
              this.params.dikePatt = this.dikePatts[0].value
              this.params.elevSys = this.elevSyss[0].value
              this.params.engTask = this.engTasks[0].value
              this.params.engStat = this.engStats[0].value
            }
          },
          error => {
            reject(error)
          }
        )
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.el-divider--horizontal {
  margin: 24px 0 5px 0;
  height: 7px !important;
  background: #88b4dd !important;
  .el-divider__text {
    font-size: 16px !important;
  }
}
// ::v-deep .el-input__inner {
//   border: 1px solid orange;
// }
// ::v-deep .el-textarea__inner {
//   border: 1px solid orange;
// }
</style>
