<template>
  <MOSTY.FromPage :title="props.formData.title" @closeDialog="closepost">
    <template #content>
      <MOSTY.Assort :title="'基础信息'" />
      <el-form :model="props.formData" ref="ruleFormRef" label-position="right" :rules="rules" label-width="150px"
        :disabled='!props.formData.saveBtnShow'>
        <el-form-item label="所属场所:" prop="sitename">
          <el-select v-if="['wxxfz', 'wxkzs'].includes(addtype) && !props.formData.id" v-model="props.formData.sitename"
            @change="cahngecsmc" clearable style="width: 337px" placeholder="请选择场所名称">
            <el-option v-for="item in csmclist" :key="item" :label="item.placename" :value="item.id" />
          </el-select>
          <el-input v-else v-model="props.formData.sitename" style="width: 337px" disabled />
        </el-form-item>
        <el-form-item :label="props.formData.publicarea == '1' ? '所属场区:' : '所属建筑物:'" prop="buildingname">
          <el-select v-if="['wxxfz', 'wxkzs'].includes(addtype) && !props.formData.id"
            v-model="props.formData.buildingname" @change="cahngejzwmc" clearable style="width: 337px"
            :placeholder="props.formData.publicarea == '1' ? '请选择所属场区' : '请选择所属建筑物'">
            <el-option v-for="item in jzwlist" :key="item" :label="item.buildingname" :value="item.id" />
          </el-select>
          <el-input v-else v-model="props.formData.buildingname" style="width: 337px" disabled />
        </el-form-item>
        <el-form-item label="所属楼层:" prop="floorname"
          v-if="!['cq', 'jzw'].includes(addtype) && props.formData.publicarea != '1'">
          <el-select v-if="['wxxfz', 'wxkzs'].includes(addtype) && !props.formData.id"
            v-model="props.formData.floorname" @change="cahngelcmc" clearable style="width: 337px"
            placeholder="请选择所属楼层">
            <el-option v-for="item in lclist" :key="item" :label="item.floorname" :value="item.id" />
          </el-select>
          <el-input v-else v-model.number="props.formData.floorname" style="width: 337px" disabled />

        </el-form-item>
        <el-form-item label="部位名称:" prop="partname" v-if="!['wxxfz', 'wxkzs'].includes(addtype)">
          <el-input v-model="props.formData.partname" style="width: 337px" />
        </el-form-item>
        <el-form-item label="消防站名称:" prop="qtmc" v-if="['wxxfz'].includes(addtype)">
          <el-input v-model="props.formData.qtmc" style="width: 337px" />
        </el-form-item>
        <el-form-item label="消防控制室名称:" prop="qtmc" v-if="['wxkzs'].includes(addtype)">
          <el-input v-model="props.formData.qtmc" style="width: 337px" />
        </el-form-item>
        <el-form-item label="部位面积:" prop="area">
          <el-input v-model.number="props.formData.area" @blur="props.formData.area = JEblurFn(props.formData.area)"
            type="number" placeholder="请填写部位面积" style="width: 337px">
            <template #append>平方米</template></el-input>
        </el-form-item>

        <!-- 部位类型暂时注释 -->
        <!-- :disabled='props.formData.id || ["wxxfz", "wxkzs"].includes(addtype)' -->
        <el-form-item label="部位类型:" prop="checktype">
          <MOSTY.DictTree :zdlist="bwlxlist" :type="'array'" v-model="props.formData.checktype" :placeholder='"请选择部位类型"'
            style="width: 337px;" />
        </el-form-item>
        <el-form-item label="耐火等级:" v-if='props.formData.publicarea != "1"'>
          <el-select v-model="props.formData.fireresisrating" clearable placeholder="请选择耐火等级" style="width: 337px">
            <el-option v-for="item in D_TB_NHDJ" :key="item" :label="item.label" :value="item.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="所在位置:" prop="location">
          <el-input v-model="props.formData.location" style="width: 337px" />
        </el-form-item>
        <el-form-item label="备注：" style="width: 100%; overflow: scroll;">
          <el-input v-model="props.formData.bz" :rows="3" type="textarea" style="width:1310px" />
        </el-form-item>
        <el-form-item label="部位信息图片:">
          <div style='display:flex;'>
            <MOSTY.ErwmImg v-if="props.formData.id"
              :url="qrcodeImg(props.formData.id, 'P', props.formData.sitename, props.formData.partname ? props.formData.partname : props.formData.qtmc)"
              :filename='"部位二维码"' />
            <MOSTY.Upload :width="'100%'" :limit="5" :nopicer="false" :isImg="true" :ShowfileList="false"
              :disabled='!props.formData.saveBtnShow' v-model="props.formData.venuefile"
              @filehandleChange="changeFiles">
            </MOSTY.Upload>
          </div>
        </el-form-item>
      </el-form>
      <MOSTY.Assort :title="'管理信息'" />
      <el-form :model="props.formData" ref="ruleFormRef2" label-position="right" :rules="rules2" label-width="150px"
        :disabled='!props.formData.saveBtnShow'>
        <el-form-item label="责任部门:" prop="deptname" style="display: flex">
          <el-input v-model="props.formData.deptname" placeholder="请选择责任部门" clearable readonly style="width: 337px">
            <template #append>
              <el-button class='cursor' @click="ChooesDdld('01')">选择</el-button></template>
          </el-input>
        </el-form-item>
        <el-form-item label="部位负责人:" prop="postusername" style="display: flex;width:100%;">
          <el-input v-model="props.formData.postusername" type="textarea" :rows="4" readonly style="width: 93%"
            clearable>
          </el-input>
          <el-button class='cursor ml10' @click="ChooesDdld('02')">选择</el-button>
        </el-form-item>

        <el-form-item label="巡查相关方：" prop="xgfMc">
          <XiangGFSelect style="width: 337px" v-model="formData.xgfMc" v-model:id="formData.xgfId"
                         @change="xgfDwChange" @update:modelValue="updateModelValue" @update:id='updateId' />
        </el-form-item>
        <el-form-item label="相关方责任人：" prop="xgfRyMc">
          <XiangGFRen inputWidth="337px" v-model:ids="formData.xgfRyId" v-model:cName="formData.xgfRyMc" :relatedid="formData.xgfId"
                      :disabled="!formData.xgfId" @update:ids="updateIds" @update:cName="updateName" />
        </el-form-item>

        <!-- <el-form-item label="部位负责人电话:" prop="contactnumber">
          <el-input v-model="props.formData.contactnumber" style="width: 337px" />
        </el-form-item> -->
      </el-form>
      <div v-if='props.formData.id'>
        <MOSTY.Assort :title="'关联信息(固定信息、动态信息)'" />
        <div>
          <div class='table-lable'>
            <span>固定信息</span>
            <img :src="getImgUrl('img/icon-jt.png')" style='cursor:pointer' @click='isShowgd = !isShowgd' />
          </div>
          <div v-show='isShowgd'>
            <MOSTY.TabList :tablist='tablist' :type='"bw"' :obj='props.formData' @handleChange="changelicolor"
              @resetChange='resetChange' />
          </div>
        </div>
        <div>
          <div class=' table-lable'>
            <span>动态信息</span>
            <img :src="getImgUrl('img/icon-jt.png')" style='cursor:pointer' @click='isShowdt = !isShowdt' />
          </div>
          <div v-show='isShowdt'>
            <MOSTY.TabList :tablist='tablist2' :type='"bw"' :obj='props.formData' @handleChange="changelicolor2" />
          </div>
        </div>
      </div>
    </template>
    <template #footer>
      <el-button type="primary" @click="saveData(ruleFormRef)" v-loading="saveloading"
        v-if='props.formData.saveBtnShow'> <el-icon>
          <DocumentChecked />
        </el-icon>保存 </el-button>
      <el-button @click="closepost"><el-icon>
          <DocumentDelete />
        </el-icon>关闭</el-button>
    </template>
    <template #dwbox>
      <!-- 选择部门 -->
      <Choosebm :showDdld="showDept" :searchType="'01'" :deptId='getItem("deptId").ssdwid' @closezzjg="closezzjg"
        @listdata="getSonValue" :zzlx="zzlx" />
      <!-- 选择场所负责人 -->
      <ChooseUser v-model="chooseUserVisible" :Single="singleShow" :data="memberList" :deptId="props.formData.deptid"
        @choosedUsers="getSonValue" />
    </template>
  </MOSTY.FromPage>
  <div>

  </div>
</template>

<script setup>
import { getImgUrl } from "@/utils/tools.js"
import { ref, getCurrentInstance, defineAsyncComponent, onMounted } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
import { ElMessage } from "element-plus";
import * as rule from "@/utils/rules.js";
import { getItem } from "@/utils/storage";
import { getApi, postApi } from "@/api/tobAcco_api.js";
import Choosebm from "@/components/MyComponents/ChooseDept/index.vue";
import ChooseUser from "@/components/MyComponents/ChooseUser/Leader.vue";
import { qrcodeImg } from "@/utils/tools.js";
import { JEblurFn } from "@/utils/auth.js";
import XiangGFSelect from "@/components/dialog/component/XiangGFSelect.vue"
import XiangGFRen from "@/components/dialog/component/XiangGFRen.vue"
const { proxy } = getCurrentInstance();
const { D_TB_NHDJ } = proxy.$dict("D_TB_NHDJ");
const rules = {
  sitename: [{ required: true, message: "请输入场所名称", trigger: "blur" }],
  partname: [{ required: true, message: "请输入部位名称", trigger: "blur" }],
  buildingname: [{ required: true, message: "请输入所属建筑物", trigger: "blur" }],
  floorname: [{ required: true, message: "请输入所属楼层", trigger: "blur" }],
  floornumber: [{ required: true, message: "请输入楼层数", trigger: "blur" }],
  location: [{ required: true, message: "请输入所在位置", trigger: "blur" }],
  qtmc: [{ required: true, message: "请输入名称", trigger: "blur" }],
  checktype: [{ required: true, message: "请选择部位类型", trigger: "blur" }],
  ...rule.numbernineRule({ validator: true, require: true, iszs: true, firstNum: 7, lastNum: 2 }, "area"),
  fireresisrating: [{ required: true, message: "请选择耐火类别", trigger: "blur" }],
};
const rules2 = {
  ...rule.phoneRule({ validator: true, require: true }, "contactnumber"),
  postusername: [{ required: true, message: "请选择部位负责人", trigger: "blur" }],
  deptname: [{ required: true, message: "请选择责任部门", trigger: "blur" }],
};
const csmclist = ref([]);
const ruleFormRef2 = ref()
const ruleFormRef = ref()
const jzwlist = ref([]);
const lclist = ref([]);
const addtype = ref('')
const bwlxdis = ref(false)
const saveloading = ref(false)
const zzlx = ref(null);
const showDept = ref(false);
const chooseUserVisible = ref(false); //选择领导弹窗
const singleShow = ref(true); //单选多选
const memberList = ref([]);
// 办公区域修改页面弹窗数据

const tablist = ref([
  // { title: '办公区域', icon: 'jianzhuwu', actives: true, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Bgqyindex.vue")) },
  // { title: '安全设备设施', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Security.vue")) },
  // { title: '安全器材', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Apparatus.vue")) },
  // { title: '安全标识', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Safetysigns.vue")) },
  // { title: '生产设备设施', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Produce.vue")) },
  // { title: '变配电设备设施', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Distributing.vue")) },
  // { title: '特种设备', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Equipment.vue")) },
])
const tablist2 = ref([
  // { title: '检查标准', num: 0, icon: 'jianzhuwu', sblx: '', actives: true, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Synthesize.vue")) },
  // { title: '检查记录', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Standard.vue")) },
  // { title: '风险清单', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Risklist.vue")) },
  // { title: '隐患清单', num: 0, icon: 'sbss2', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/Pitfall.vue")) }
])
const isShowgd = ref(true)
const isShowdt = ref(true)
const bwlxlist = ref([])
const emits = defineEmits(["saveSuccess", '"update:modelValue"']);
// 接收子组件传来的
const props = defineProps({
  modelValue: {
    type: Boolean,
    required: true
  },
  formData: {
    type: Object,
    default: {}
  },
  type: String
});
const deptId = ref("");


onMounted(() => {
  addtype.value = props.type
  bwlxdis.value = false
  props.formData.area = props.formData.area ? Number(props.formData.area).toFixed(2) : null
  //楼层进入只能是室内重点与非重点
  // 建筑物进入只能是场区重点与非重点
  if (props.formData.type == 'jzw') {
    if (props.type == 'zdbw') {
      cqzdbwlist('1004')
      //获取重点部位类型字典数
    } else if (props.type == 'fzdbw') {
      //获取非重点部位类型字典数
      cqzdbwlist('1005')
    }
  } else if ((props.formData.type == 'lc')) {
    if (props.type == 'zdbw') {
      cqzdbwlist('1001')
      //获取重点部位类型字典数
    } else if (props.type == 'fzdbw') {
      //获取非重点部位类型字典数
      cqzdbwlist('1002')
    }
  } else if (props.formData.type == 'cq') {
    if (["100105050000", "100105020000"].includes(props.formData.checktype)) {
      cqzdbwlist('100105')
    } else {
      getApi({ zdbh: 'D_TB_JCYWLX', dm: '10' }, '/mosty-base/sysDict/getJcyelxDictTree').then(res => {
        res[0].itemList = res[0].itemList.filter(item => {
          return item.dm.indexOf('1004') == 0 || item.dm.indexOf('1005') == 0
        })
        bwlxlist.value = res[0].itemList
      })
    }
  } else if (props.formData.type == 'wxxfz') {
    // 100105050000
    props.formData.checktype = '100105050000'
    tablist.value.push({ title: '消防站队员信息', icon: 'jianzhuwu', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/wxxfzTzb.vue")) })
    bwlxdis.value = true
    cqzdbwlist('100105')
    getcsData()
  } else if (props.formData.type == 'wxkzs') {
    props.formData.checktype = '100105020000'
    tablist.value.push({ title: '消防控制室值班人员信息', icon: 'jianzhuwu', actives: false, components: defineAsyncComponent(() => import("@/components/MyComponents/TabList/xfkzsTzb.vue")) })
    bwlxdis.value = true
    cqzdbwlist('100105')
    getcsData()
  } else {
    getApi({ zdbh: 'D_TB_JCYWLX', dm: '10' }, '/mosty-base/sysDict/getJcyelxDictTree').then(res => {
      res[0].itemList = res[0].itemList.filter(item => {
        return item.dm.indexOf('1001') == 0 || item.dm.indexOf('1002') == 0
      })
      bwlxlist.value = res[0].itemList
    })
  }
  if (props.formData.id) {
    getaqbscount()
    getscsbsscount()
    getbpdcount()
    getaqqccount()
    gettzsbcount()
    getaqsbsscount()
    getCount()
  }

  tablist2.value[1].sblx = props.formData.checktype
  console.log(props.formData, 'props.formData');
})
//根据操作人 查询 场所
function getcsData() {
  getApi({}, "/mosty-jcgl/site/getSiteListByUser").then((res) => {
    csmclist.value = res;
  });
}
// 获取相关方责任人id
const updateIds = (ids) => {
  props.formData.xgfRyId = ids
}
// 获取相关方人员列表
const updateName = (names) => {
  props.formData.xgfRyMc = names
}
// 获取检查方名称
const updateModelValue = (ModelValue) => {
  props.formData.xgfMc = ModelValue
}
// 获取检查方id
const updateId = (id) => {
  props.formData.xgfId = id
}
//获取场所选择
const cahngecsmc = (val) => {
  csmclist.value.forEach((item) => {
    if (item.id == val) {
      props.formData.siteid = item.id;
      props.formData.sitename = item.placename;
      props.formData.buildingname = '';
      props.formData.buildingid = '';
      props.formData.publicarea = '';
      props.formData.floorname = '';
      props.formData.floorid = '';
      props.formData.partname = '';
      props.formData.partid = '';
      getjzwlist(item.id)
    }
  });
};


//	根据placeid，查询建筑物
function getjzwlist(placeid) {
  getApi({ placeid }, '/mosty-jcgl/building/queryBuildingByPlaceid').then(res => {
    jzwlist.value = res ? res : []
  })
}
//获取建筑物名称
function cahngejzwmc(val) {
  jzwlist.value.forEach((item) => {
    if (item.id == val) {
      props.formData.buildingid = item.id;
      props.formData.buildingname = item.buildingname;
      props.formData.publicarea = item.publicarea;
      props.formData.floorname = '';
      props.formData.floorid = '';
      props.formData.partname = '';
      props.formData.partid = '';
      if (item.publicarea == '1') {
        if (["100105050000", "100105020000"].includes(props.formData.checktype)) {
          cqzdbwlist('100105')
        } else {
          getApi({ zdbh: 'D_TB_JCYWLX', dm: '10' }, '/mosty-base/sysDict/getJcyelxDictTree').then(res => {
            res[0].itemList = res[0].itemList.filter(item => {
              return item.dm.indexOf('1004') == 0 || item.dm.indexOf('1005') == 0
            })
            bwlxlist.value = res[0].itemList
          })
        }

      } else {
        getlcdata(item.id);
      }
    }
  });
}
//根据建筑物查询楼层
function getlcdata(id) {
  getApi({ id }, '/mosty-jcgl/floor/queryFloorByBuildId').then(res => {
    lclist.value = res ? res : []
  })
}
//获取楼层名称
function cahngelcmc(val) {
  lclist.value.forEach((item) => {
    if (item.id == val) {
      props.formData.floorid = item.id;
      props.formData.floorname = item.floorname;
      props.formData.partname = '';
      props.formData.partid = '';
    }
  });
}

//安全标识总数
function getaqbscount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sitelogo/countAllSitelogo').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '安全标识') {
        item.num = res ? res : 0
      }
    })
  })
}
//安全器材总数
function getaqqccount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sbglAqqc/countAll').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '安全器材') {
        item.num = res ? res : 0
      }
    })
  })
}
//生产设备设施总数
function getscsbsscount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sbglScsbss/countAll').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '生产设备设施') {
        item.num = res ? res : 0
      }
    })
  })
}
//变配电设备设施总数
function getbpdcount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sbglBpdsb/countAll').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '变配电设备设施') {
        item.num = res ? res : 0
      }
    })
  })
}
//安全设备设施总数
function getaqsbsscount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sbglAqsbss/countAll').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '安全设备设施') {
        item.num = res ? res : 0
      }
    })
  })

}
//特种设备总数
function gettzsbcount() {
  postApi({ partid: props.formData.id, type: '1' }, '/mosty-jcgl/sbglTzsb/countAll').then(res => {
    tablist.value.forEach(item => {
      if (item.title == '特种设备') {
        item.num = res ? res : 0
      }
    })
  })
}
//获取风险清单总数
function getCount() {
  getApi({ partid: props.formData.id }, '/mosty-jcgl/dynamic/riskStatistics').then(res => {
    tablist2.value.forEach(item => {
      if (item.title == '风险清单') {
        item.num = res ? res.R + res.O + res.Y + res.B : 0
      }
    })
  })
}
//获取重点部位字典数据
function cqzdbwlist(val) {
  getApi({ zdbh: 'D_TB_JCYWLX', dm: val, level: 6 }, '/mosty-base/sysDict/getJcyelxDictTree').then(res => {
    bwlxlist.value = res[0].itemList
  })
}
function closepost() {
  if (props.formData.saveBtnShow) {
    proxy.$modal.confirm('离开会丢失页面中修改的内容，确认离开吗？')
      .then(() => {
        emits("saveSuccess");
      })
      .catch(() => {
        // catch error
      })
  } else {
    emits("saveSuccess");
  }

}
//选择部门
function ChooesDdld(val) {
  zzlx.value = val;
  if (val == "01") {
    showDept.value = true;
  } else if (val == "02") {
    if (props.formData.deptid) {
      memberList.value = props.formData.postuserid ? props.formData.postuserid.split(',') : [];
      singleShow.value = false;
      chooseUserVisible.value = true;
    } else {
      ElMessage.error("请先选择责任部门！!");
    }

  }
}
const getSonValue = (value) => {
  if (zzlx.value == "01") {
    props.formData.deptname = value.orgName;
    props.formData.deptid = value.id;
    deptId.value = value.id;
  } else if (zzlx.value == "02") {
    props.formData.postusername = value.map(item => {
      if (item.mobile) {
        return item.userName + '（' + item.mobile + '）'
      } else {
        return item.userName
      }

    }).toString();
    props.formData.postuserid = value.map(item => {
      return item.id
    }).toString();
  }
};


//关闭弹窗
const closezzjg = (val) => {
  showDept.value = val;
};


// 保存数据
const saveData = async (formEl) => {
  saveloading.value = true
  if (!formEl) return
  await formEl.validate((valid) => {
    if (valid) {
      ruleFormRef2.value.validate((valid) => {
        if (valid) {
          props.formData.venuefile = props.formData.venuefile
            ? props.formData.venuefile.toString()
            : null;
          if (props.formData.type == 'cq') {
            props.formData.checktype = props.formData.checktype ? props.formData.checktype.toString() : ''
            props.formData.sfcq = '1'
          } else {
            props.formData.sfcq = props.formData.publicarea == '1' ? '1' : '2';
          }
          props.formData.area = props.formData.area ? parseFloat(props.formData.area) : null
          props.formData.partname = props.formData.partname ? props.formData.partname : props.formData.qtmc
          if (['wxxfz', 'wxkzs'].includes(addtype.value)) {
            props.formData.partname = props.formData.qtmc
          }
          if (!props.formData.id) {
            postApi(props.formData, "/mosty-jcgl/part/addScenePartOne").then((res) => {
              if (res) {
                ElMessage.success("新增成功");
                emits("saveSuccess", res);
              }
            }).finally(() => {
              saveloading.value = false
            })
          } else {
            postApi(props.formData, "/mosty-jcgl/part/updateScenePartOne").then((res) => {
              ElMessage.success("修改成功");
              emits("saveSuccess");
            }).finally(() => {
              saveloading.value = false
            })
          }
        } else {
          saveloading.value = false
          ElMessage.warning('请输入必填项！！！')
        }
      })

    } else {
      saveloading.value = false
      ElMessage.error("请输入必填项!");
    }
  });
};
//分类点击事件
function changelicolor(val) {
  tablist.value.forEach(item => {
    if (item.title == val.title) {
      item.actives = true
    } else {
      item.actives = false
    }
  })
  if (val.title == '安全设备设施') {
    getaqsbsscount()
  } else if (val.title == '安全器材') {
    getaqqccount()
  } else if (val.title == '安全标识') {
    getaqbscount()
  } else if (val.title == '生产设备设施') {
    getscsbsscount()
  } else if (val.title == '变配电设备设施') {
    getbpdcount()
  } else if (val.title == '特种设备') {
    gettzsbcount()
  }
}
function changelicolor2(val) {
  tablist2.value.forEach(item => {
    if (item.title == val.title) {
      item.actives = true
    } else {
      item.actives = false
    }
  })
  if (val.title == '风险清单') {
    getCount()
  }
}
//刷新接口
function resetChange(val) {
  if (val == 'aqbs') {
    getaqbscount()
  } else if (val == 'scsb') {
    getscsbsscount()
  } else if (val == 'bpdsb') {
    getbpdcount()
  } else if (val == 'aqqc') {
    getaqqccount()
  } else if (val == 'tzsb') {
    gettzsbcount()
  } else if (val == 'aqsbss') {
    getaqsbsscount()
  }
}

</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  --el-dialog-margin-top: 10vh !important;
}

::v-deep .el-form {
  width: 90%;
  margin: 10px 20px;
  padding: 10px;
  flex-wrap: wrap;
  justify-content: start;
}



::v-deep .el-tabs--border-card>.el-tabs__header .el-tabs__item {
  color: #fff;
}

::v-deep .el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active {
  color: var(--el-color-primary);
}

.table-lable {
  margin: 10px;
  color: var(--el-color-primary);
}

::v-deep ::-webkit-scrollbar {
  display: none !important;
}

::v-deep .el-pagination {
  justify-content: center !important;
}

::v-deep .el-form-item__content {
  margin-left: 0px !important;
}
</style>
