马宇豪
2023-03-24 df39b348c7743e3275aca6053a46c2d63efc5bfb
src/views/intellectInspect/inspectIndex/index.vue
@@ -13,13 +13,16 @@
            <div class="chart-item">
              <div class="chart-tit">
                <span class="tit">年度巡检异常趋势</span>
                <div class="filter-part">
                  <el-cascader v-model="searchDepId" :options="depList" :props="casProps" :show-all-levels="false" size="small"/>
                </div>
              </div>
              <div class="chart" :id="xjLine"></div>
            </div>
            <div class="chart-item">
              <div class="chart-tit">
                <span class="tit">异常区域设备统计</span>
                <div class="filter-part">
                <div class="filter-part2">
                  <el-switch
                      v-model="chartStatus"
                      inline-prompt
@@ -206,6 +209,7 @@
import { departmentApi } from '/@/api/systemManage/department';
import screenfull from "screenfull";
import { BorderBox10 as DvBorderBox10 } from '@kjgl77/datav-vue3'
import {specialIndexApi} from "/@/api/specialWorkSystem/specialIndex";
// 定义接口来定义对象的类型
interface stateType {
    tableData: Array<string>;
@@ -228,7 +232,10 @@
    dialogVisible:boolean;
    workNum: string;
    beImgs: [];
    afImgs: []
    afImgs: [];
    searchDepId: number|null
    depList: Array<any>
    casProps:object
}
interface type {
    id: number;
@@ -272,6 +279,32 @@
                { id: 4, name: '月' },
                { id: 5, name: '年' }
            ],
            searchDepId: null,
            depList: [
              {
                name: '电石事业部',
                depId: 49
              },
              {
                name: '电力事业部',
                id: 50
              },
              {
                name: '有机化工事业部',
                id: 48
              },
              {
                name: '甲醇事业部',
                id: 32
              }
            ],
            casProps: {
              expandTrigger: 'hover',
              emitPath: false,
              value: 'depId',
              label: 'depName',
              checkStrictly: true
            },
            classGroupList: [],
            quotaList: [],
            inspectPointAllList: [],
@@ -289,10 +322,11 @@
        // 页面载入时执行方法
        onMounted(() => {
            getDepartmentData();
            getCountExcepOrder();
            getInspectRecord();
            getListExcepOrder();
            getDayData();
            getDepartmentData();
            initXjLine()
            initSbtj()
        });
@@ -310,6 +344,17 @@
        }
        const checkAllList =()=>{
          unusualListRef.value.showUnusualList()
        }
        const getCountExcepOrder = async ()=>{
          let res = await inspectIndexApi().getCountExcepOrder({depId: state.searchDepId});
          if (res.data.code === '200') {
            console.log('折线图趋势数据>>>', res.data.data)
          } else {
            ElMessage({
              type: 'warning',
              message: res.data.msg
            });
          }
        }
        const acceptance =(row:object)=>{
          ElMessageBox.confirm(
@@ -597,6 +642,14 @@
            let res = await departmentApi().getDepartmentList();
            if (res.data.code === '200') {
                state.departmentList = res.data.data;
                const newList = []
                for(let i of state.departmentList[0].children){
                  if(i.depId == 32 || i.depId == 48 ||i.depId == 49 || i.depId == 50){
                    newList.push(i)
                  }
                }
                state.depList = newList
                console.log(state.depList,'3434')
            } else {
                ElMessage({
                    type: 'warning',
@@ -743,6 +796,21 @@
            display: flex;
            align-items: center;
            justify-content: right;
            .el-select{
              width: 50% !important;
              margin-left: 10px;
            }
            .el-switch{
              width: 100% !important;
              :deep(.el-switch__core){
                width: 100% !important;
              }
            }
          }
          .filter-part2{
            display: flex;
            align-items: center;
            justify-content: right;
            width: 20%;
            .el-switch{
              width: 100% !important;
@@ -802,10 +870,6 @@
          .tit{
            font-size: 20px;
            font-weight: bolder;
          }
          :deep(.el-switch__core){
            width: 120px;
          }
          .top-info {
            display: flex;