Przeglądaj źródła

Merge branch 'master' of http://47.111.81.118:3000/xf15575941817/admin-fiveFollowing

ming 3 lat temu
rodzic
commit
fbe6ca717d

+ 10 - 0
src/api/dataManage/patrolPlan.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request'
+
+//巡检管理-巡检计划-计划列表查询
+export function patrolInspectionSchemeList(params) {
+    return request({
+        url: '/patrolInspectionScheme/patrolInspectionSchemeList',
+        method: 'GET',
+        params,
+    })
+}

+ 11 - 0
src/api/planOutage/index.js

@@ -27,3 +27,14 @@ export function plannedOutageAdd(params) {
     })
 }
 
+//停电计划-修改
+export function plannedOutageUpdate(params) {
+    return request({
+        url: '/wcBlackoutPlan/plannedOutageUpdate',
+        method: 'POST',
+        data: params,
+    })
+}
+
+
+

+ 209 - 201
src/router/index.js

@@ -1,24 +1,32 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import Layout from '@/layout'
 
-export const constantRoutes = [{
+export const constantRoutes = [
+    {
         path: '/login',
         component: () =>
-            import ('@/views/login'),
+            import('@/views/login'),
         hidden: true,
     },
     {
         path: '/403',
         name: '403',
         component: () =>
-            import ('@/views/403'),
+            import('@/views/403'),
         hidden: true,
     },
     {
         path: '/404',
         name: '404',
         component: () =>
-            import ('@/views/404'),
+            import('@/views/404'),
+        hidden: true,
+    },
+    {
+        path: '/401',
+        name: '401',
+        component: () =>
+            import('@/views/401'),
         hidden: true,
     },
 ]
@@ -55,16 +63,16 @@ export const asyncRoutes = [
         },
         component: Layout,
         children: [{
-                meta: {
-                    title: '告警管理',
-                    icon: 'alarmManage',
-                    affix: true,
-                },
-                path: 'index',
-                component: () =>
-                    import ('@/views/alarmManage/index'),
-
+            meta: {
+                title: '告警管理',
+                icon: 'alarmManage',
+                affix: true,
             },
+            path: 'index',
+            component: () =>
+                import('@/views/alarmManage/index'),
+
+        },
 
         ]
     },
@@ -83,7 +91,7 @@ export const asyncRoutes = [
             },
             path: '/siteManage',
             component: () =>
-                import ('@/views/siteManage/index'),
+                import('@/views/siteManage/index'),
             selectLeftMenu: '/alarmManage',
             hidden: true
         }]
@@ -104,7 +112,7 @@ export const asyncRoutes = [
             },
             path: '/stationManage',
             component: () =>
-                import ('@/views/stationManage/index'),
+                import('@/views/stationManage/index'),
             hidden: true
         }]
     },
@@ -123,32 +131,32 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/deviceManage/powerEquip',
         children: [{
-                meta: { icon: 'powerEquip', title: '设备管理', },
-                path: 'powerEquip',
-                component: () =>
-                    import ('@/views/deviceManage/powerEquip/index.vue'),
-            },
-            // {
-            //   title: 'index-layout.menu.deviceManage.videoEquip',
-            //   path: 'videoEquip',
-            //   component: () => import('@/views/deviceManage/videoEquip/index.vue'),
-            // },
-            // {
-            //   title: 'index-layout.menu.deviceManage.communicateEquip',
-            //   path: 'communicateEquip',
-            //   component: () => import('@/views/deviceManage/communicateEquip/index.vue'),
-            // },
-            // {
-            //   title: 'index-layout.menu.deviceManage.channelList',
-            //   path: 'channelList',
-            //   component: () => import('@/views/deviceManage/channelList/index.vue'),
-            // },
-            {
-                meta: { icon: 'attribTemplate', title: '属性模板', },
-                path: 'attribTemplate',
-                component: () =>
-                    import ('@/views/deviceManage/attribTemplate/index.vue'),
-            }
+            meta: { icon: 'powerEquip', title: '设备管理', },
+            path: 'powerEquip',
+            component: () =>
+                import('@/views/deviceManage/powerEquip/index.vue'),
+        },
+        // {
+        //   title: 'index-layout.menu.deviceManage.videoEquip',
+        //   path: 'videoEquip',
+        //   component: () => import('@/views/deviceManage/videoEquip/index.vue'),
+        // },
+        // {
+        //   title: 'index-layout.menu.deviceManage.communicateEquip',
+        //   path: 'communicateEquip',
+        //   component: () => import('@/views/deviceManage/communicateEquip/index.vue'),
+        // },
+        // {
+        //   title: 'index-layout.menu.deviceManage.channelList',
+        //   path: 'channelList',
+        //   component: () => import('@/views/deviceManage/channelList/index.vue'),
+        // },
+        {
+            meta: { icon: 'attribTemplate', title: '属性模板', },
+            path: 'attribTemplate',
+            component: () =>
+                import('@/views/deviceManage/attribTemplate/index.vue'),
+        }
         ]
     },
 
@@ -167,45 +175,45 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/dataManage/sameAnalysis',
         children: [{
-                meta: { icon: 'sameAnalysis', title: '同比分析报表', },
-                path: 'sameAnalysis',
-                component: () =>
-                    import ('@/views/dataManage/sameAnalysis/index.vue'),
-            },
-            {
-                meta: { icon: 'chainAnalysis', title: '环比分析报表', },
-                path: 'chainAnalysis',
-                component: () =>
-                    import ('@/views/dataManage/chainAnalysis/index.vue'),
-            },
-            {
-                meta: { icon: 'handOpera', title: '手动抄表', },
-                title: 'index-layout.menu.dataManage.handOpera',
-                path: 'handOpera',
-                component: () =>
-                    import ('@/views/dataManage/handOpera/index.vue'),
-            },
-            {
-                meta: { icon: 'energyReport', title: '用能月报', },
-                title: 'index-layout.menu.dataManage.energyReport',
-                path: 'energyReport',
-                component: () =>
-                    import ('@/views/dataManage/energyReport/index.vue'),
-            },
-            {
-                meta: { icon: 'demandAnalysis', title: '需量分析', },
-                title: 'index-layout.menu.dataManage.demandAnalysis',
-                path: 'demandAnalysis',
-                component: () =>
-                    import ('@/views/dataManage/demandAnalysis/index.vue'),
-            },
-            {
-                meta: { icon: 'consumConfig', title: '能耗分析配置', },
-                title: 'index-layout.menu.dataManage.consumConfig',
-                path: 'consumConfig',
-                component: () =>
-                    import ('@/views/dataManage/consumConfig/index.vue'),
-            }
+            meta: { icon: 'sameAnalysis', title: '同比分析报表', },
+            path: 'sameAnalysis',
+            component: () =>
+                import('@/views/dataManage/sameAnalysis/index.vue'),
+        },
+        {
+            meta: { icon: 'chainAnalysis', title: '环比分析报表', },
+            path: 'chainAnalysis',
+            component: () =>
+                import('@/views/dataManage/chainAnalysis/index.vue'),
+        },
+        {
+            meta: { icon: 'handOpera', title: '手动抄表', },
+            title: 'index-layout.menu.dataManage.handOpera',
+            path: 'handOpera',
+            component: () =>
+                import('@/views/dataManage/handOpera/index.vue'),
+        },
+        {
+            meta: { icon: 'energyReport', title: '用能月报', },
+            title: 'index-layout.menu.dataManage.energyReport',
+            path: 'energyReport',
+            component: () =>
+                import('@/views/dataManage/energyReport/index.vue'),
+        },
+        {
+            meta: { icon: 'demandAnalysis', title: '需量分析', },
+            title: 'index-layout.menu.dataManage.demandAnalysis',
+            path: 'demandAnalysis',
+            component: () =>
+                import('@/views/dataManage/demandAnalysis/index.vue'),
+        },
+        {
+            meta: { icon: 'consumConfig', title: '能耗分析配置', },
+            title: 'index-layout.menu.dataManage.consumConfig',
+            path: 'consumConfig',
+            component: () =>
+                import('@/views/dataManage/consumConfig/index.vue'),
+        }
         ]
     },
 
@@ -222,29 +230,29 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/powerQuality/harmonicReport',
         children: [{
-                meta: { icon: 'harmonicReport', title: '谐波报表', },
-                path: 'harmonicReport',
-                component: () =>
-                    import ('@/views/powerQuality/harmonicReport/index.vue'),
-            },
-            {
-                meta: { icon: 'realTimeMonitoring', title: '实时监测', },
-                path: 'realTimeMonitoring',
-                component: () =>
-                    import ('@/views/powerQuality/realTimeMonitoring/index.vue'),
-            },
-            {
-                meta: { icon: 'asseReport', title: '评估报告', },
-                path: 'asseReport',
-                component: () =>
-                    import ('@/views/powerQuality/asseReport/index.vue'),
-            },
-            {
-                meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
-                path: 'unbalanceAnalysis',
-                component: () =>
-                    import ('@/views/powerQuality/unbalanceAnalysis/index.vue'),
-            },
+            meta: { icon: 'harmonicReport', title: '谐波报表', },
+            path: 'harmonicReport',
+            component: () =>
+                import('@/views/powerQuality/harmonicReport/index.vue'),
+        },
+        {
+            meta: { icon: 'realTimeMonitoring', title: '实时监测', },
+            path: 'realTimeMonitoring',
+            component: () =>
+                import('@/views/powerQuality/realTimeMonitoring/index.vue'),
+        },
+        {
+            meta: { icon: 'asseReport', title: '评估报告', },
+            path: 'asseReport',
+            component: () =>
+                import('@/views/powerQuality/asseReport/index.vue'),
+        },
+        {
+            meta: { icon: 'unbalanceAnalysis', title: '三相不平衡分析', },
+            path: 'unbalanceAnalysis',
+            component: () =>
+                import('@/views/powerQuality/unbalanceAnalysis/index.vue'),
+        },
 
         ]
     },
@@ -259,19 +267,19 @@ export const asyncRoutes = [
         meta: { title: '月度报告', icon: 'monthReport', },
         component: Layout,
         children: [{
-                meta: { title: '月度报告', icon: 'monthReport', },
-                path: '/monthReport',
-                component: () =>
-                    import ('@/views/monthReport/index'),
-                hidden: true
-            },
-            {
-                meta: { title: '月报模板', icon: 'reportModel', },
-                path: '/reportModel',
-                component: () =>
-                    import ('@/views/monthReport/reportModel'),
-                hidden: true
-            }
+            meta: { title: '月度报告', icon: 'monthReport', },
+            path: '/monthReport',
+            component: () =>
+                import('@/views/monthReport/index'),
+            hidden: true
+        },
+        {
+            meta: { title: '月报模板', icon: 'reportModel', },
+            path: '/reportModel',
+            component: () =>
+                import('@/views/monthReport/reportModel'),
+            hidden: true
+        }
         ]
     },
 
@@ -285,7 +293,7 @@ export const asyncRoutes = [
             meta: { title: '计划停电', icon: 'planOutage', },
             path: '/planOutage',
             component: () =>
-                import ('@/views/planOutage/index'),
+                import('@/views/planOutage/index'),
             hidden: true
         }],
     },
@@ -305,33 +313,33 @@ export const asyncRoutes = [
         redirect: '/patrolManage/patrolPlan',
         name: 'patrolManage',
         children: [{
-                meta: { title: '巡检计划', icon: 'patrolPlan' },
-                path: 'patrolPlan',
-                name: 'patrolPlan',
-                component: () =>
-                    import ('@/views/patrolManage/patrolPlan/index.vue'),
-            },
-            {
-                meta: { title: '巡检记录', icon: 'patrolRecord' },
-                path: 'patrolRecord',
-                name: 'patrolRecord',
-                component: () =>
-                    import ('@/views/patrolManage/patrolRecord/index.vue'),
-            },
-            {
-                meta: { title: '巡检内容', icon: '巡检内容' },
-                path: 'patrolContent',
-                name: 'patrolContent',
-                component: () =>
-                    import ('@/views/patrolManage/patrolContent/index.vue'),
-            },
-            {
-                meta: { title: '检查条目', icon: '检查条目' },
-                path: 'checkEntries',
-                name: 'checkEntries',
-                component: () =>
-                    import ('@/views/patrolManage/checkEntries/index.vue'),
-            },
+            meta: { title: '巡检计划', icon: 'patrolPlan' },
+            path: 'patrolPlan',
+            name: 'patrolPlan',
+            component: () =>
+                import('@/views/patrolManage/patrolPlan/index.vue'),
+        },
+        {
+            meta: { title: '巡检记录', icon: 'patrolRecord' },
+            path: 'patrolRecord',
+            name: 'patrolRecord',
+            component: () =>
+                import('@/views/patrolManage/patrolRecord/index.vue'),
+        },
+        {
+            meta: { title: '巡检内容', icon: '巡检内容' },
+            path: 'patrolContent',
+            name: 'patrolContent',
+            component: () =>
+                import('@/views/patrolManage/patrolContent/index.vue'),
+        },
+        {
+            meta: { title: '检查条目', icon: '检查条目' },
+            path: 'checkEntries',
+            name: 'checkEntries',
+            component: () =>
+                import('@/views/patrolManage/checkEntries/index.vue'),
+        },
         ]
     },
 
@@ -351,35 +359,35 @@ export const asyncRoutes = [
         redirect: '/operManage/siteAchives',
         name: 'operManage',
         children: [{
-                meta: { title: '现场档案', icon: 'siteAchives', },
-                path: 'siteAchives',
-                component: () =>
-                    import ('@/views/operManage/siteAchives/index.vue'),
-            },
-            {
-                meta: { title: '缺陷管理', icon: 'defectManage', },
-                path: 'defectManage',
-                component: () =>
-                    import ('@/views/operManage/defectManage/index.vue'),
-            },
-            {
-                meta: { title: '工单管理', icon: 'workManage', },
-                path: 'workManage',
-                component: () =>
-                    import ('@/views/operManage/workManage/index.vue'),
-            },
-            {
-                meta: { title: '运维统计', icon: 'operStatistics', },
-                path: 'operStatistics',
-                component: () =>
-                    import ('@/views/operManage/operStatistics/index.vue'),
-            },
-            {
-                meta: { title: '工作量统计', icon: 'workStatistics', },
-                path: 'workStatistics',
-                component: () =>
-                    import ('@/views/operManage/workStatistics/index.vue'),
-            },
+            meta: { title: '现场档案', icon: 'siteAchives', },
+            path: 'siteAchives',
+            component: () =>
+                import('@/views/operManage/siteAchives/index.vue'),
+        },
+        {
+            meta: { title: '缺陷管理', icon: 'defectManage', },
+            path: 'defectManage',
+            component: () =>
+                import('@/views/operManage/defectManage/index.vue'),
+        },
+        {
+            meta: { title: '工单管理', icon: 'workManage', },
+            path: 'workManage',
+            component: () =>
+                import('@/views/operManage/workManage/index.vue'),
+        },
+        {
+            meta: { title: '运维统计', icon: 'operStatistics', },
+            path: 'operStatistics',
+            component: () =>
+                import('@/views/operManage/operStatistics/index.vue'),
+        },
+        {
+            meta: { title: '工作量统计', icon: 'workStatistics', },
+            path: 'workStatistics',
+            component: () =>
+                import('@/views/operManage/workStatistics/index.vue'),
+        },
 
         ]
     },
@@ -395,17 +403,17 @@ export const asyncRoutes = [
         component: Layout,
         redirect: '/systemManage/userManage',
         children: [{
-                meta: { title: '用户管理', icon: 'userManage', },
-                path: 'userManage',
-                component: () =>
-                    import ('@/views/systemManage/userManage/index.vue'),
-            },
-            {
-                meta: { title: '权限管理', icon: 'rolePermission', },
-                path: 'rolePermission',
-                component: () =>
-                    import ('@/views/systemManage/rolePermission/index.vue'),
-            },
+            meta: { title: '用户管理', icon: 'userManage', },
+            path: 'userManage',
+            component: () =>
+                import('@/views/systemManage/userManage/index.vue'),
+        },
+        {
+            meta: { title: '权限管理', icon: 'rolePermission', },
+            path: 'rolePermission',
+            component: () =>
+                import('@/views/systemManage/rolePermission/index.vue'),
+        },
         ]
     },
 
@@ -421,25 +429,25 @@ export const asyncRoutes = [
             icon: 'apps-line',
         },
         children: [{
-                path: 'table',
-                name: 'Table',
-                component: () =>
-                    import ('@/views/vab/table'),
-                meta: {
-                    title: '表格',
-                    icon: 'table-2',
-                },
+            path: 'table',
+            name: 'Table',
+            component: () =>
+                import('@/views/vab/table'),
+            meta: {
+                title: '表格',
+                icon: 'table-2',
             },
-            {
-                path: 'icon',
-                name: 'Icon',
-                component: () =>
-                    import ('@/views/vab/icon'),
-                meta: {
-                    title: '图标',
-                    icon: 'remixicon-line',
-                },
+        },
+        {
+            path: 'icon',
+            name: 'Icon',
+            component: () =>
+                import('@/views/vab/icon'),
+            meta: {
+                title: '图标',
+                icon: 'remixicon-line',
             },
+        },
         ],
     },
 

+ 212 - 0
src/views/401.vue

@@ -0,0 +1,212 @@
+<template>
+  <div class="error-container">
+    <div class="error-content">
+      <a-row :gutter="20">
+        <a-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
+          <div class="pic-error">
+            <img class="pic-error-parent" src="@/assets/error_images/403.png" />
+            <img
+              class="pic-error-child left"
+              src="@/assets/error_images/cloud.png"
+            />
+          </div>
+        </a-col>
+
+        <a-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
+          <div class="bullshit">
+            <div class="bullshit-oops">{{ oops }}</div>
+            <div class="bullshit-headline">{{ headline }}</div>
+            <div class="bullshit-info">{{ info }}</div>
+            <a class="bullshit-return-home" href="#/index">
+              {{ jumpTime }}s&nbsp;{{ btn }}
+            </a>
+          </div>
+        </a-col>
+      </a-row>
+    </div>
+  </div>
+</template>
+
+<script>
+  import { mapActions } from 'vuex'
+
+  export default {
+    name: 'Page403',
+    data() {
+      return {
+        jumpTime: 5,
+        oops: '抱歉!',
+        headline: '请刷新页面或重新登录...',
+        info: '认证失败,无法访问系统资源。',
+        btn: '返回首页',
+        timer: 0,
+      }
+    },
+    mounted() {
+      this.timeChange()
+    },
+    beforeUnmount() {
+      clearInterval(this.timer)
+    },
+    methods: {
+      ...mapActions({
+        delVisitedRoute: 'tagsBar/delVisitedRoute',
+        delOthersVisitedRoutes: 'tagsBar/delOthersVisitedRoutes',
+      }),
+      timeChange() {
+        this.timer = setInterval(() => {
+          if (this.jumpTime) {
+            this.jumpTime--
+          } else {
+            this.$router.push({ path: '/' })
+            this.delOthersVisitedRoutes({ path: '/' })
+            clearInterval(this.timer)
+          }
+        }, 1000)
+      },
+    },
+  }
+</script>
+
+<style lang="less" scoped>
+  .error-container {
+    position: relative;
+    height: 100vh;
+
+    .error-content {
+      position: absolute;
+      top: 55%;
+      left: 50%;
+      width: 40vw;
+      height: 400px;
+      transform: translate(-50%, -50%);
+
+      .pic-error {
+        position: relative;
+        float: left;
+        width: 100%;
+        overflow: hidden;
+
+        &-parent {
+          width: 100%;
+        }
+
+        &-child {
+          position: absolute;
+
+          &.left {
+            top: 17px;
+            left: 220px;
+            width: 80px;
+            opacity: 0;
+            animation-name: cloudLeft;
+            animation-duration: 2s;
+            animation-timing-function: linear;
+            animation-delay: 1s;
+            animation-fill-mode: forwards;
+          }
+
+          @keyframes cloudLeft {
+            0% {
+              top: 17px;
+              left: 220px;
+              opacity: 0;
+            }
+
+            20% {
+              top: 33px;
+              left: 188px;
+              opacity: 1;
+            }
+
+            80% {
+              top: 81px;
+              left: 92px;
+              opacity: 1;
+            }
+
+            100% {
+              top: 97px;
+              left: 60px;
+              opacity: 0;
+            }
+          }
+        }
+      }
+
+      .bullshit {
+        position: relative;
+        float: left;
+        width: 300px;
+        padding: 30px 0;
+        overflow: hidden;
+
+        &-oops {
+          margin-bottom: @vab-margin;
+          font-size: 32px;
+          font-weight: bold;
+          line-height: 40px;
+          opacity: 0;
+          animation-name: slideUp;
+          animation-duration: 0.5s;
+          animation-fill-mode: forwards;
+        }
+
+        &-headline {
+          margin-bottom: 10px;
+          font-size: 20px;
+          font-weight: bold;
+          line-height: 24px;
+          color: #222;
+          opacity: 0;
+          animation-name: slideUp;
+          animation-duration: 0.5s;
+          animation-delay: 0.1s;
+          animation-fill-mode: forwards;
+        }
+
+        &-info {
+          margin-bottom: 30px;
+          font-size: 13px;
+          line-height: 21px;
+          opacity: 0;
+          animation-name: slideUp;
+          animation-duration: 0.5s;
+          animation-delay: 0.2s;
+          animation-fill-mode: forwards;
+        }
+
+        &-return-home {
+          display: block;
+          float: left;
+          width: 110px;
+          height: 36px;
+          font-size: 14px;
+          line-height: 36px;
+          color: #fff;
+          text-align: center;
+          cursor: pointer;
+          background: @vab-color-blue;
+          border-radius: 100px;
+          opacity: 0;
+          animation-name: slideUp;
+          animation-duration: 0.5s;
+          animation-delay: 0.3s;
+          animation-fill-mode: forwards;
+        }
+
+        @keyframes slideUp {
+          0% {
+            opacity: 0;
+            transform: translateY(60px);
+          }
+
+          100% {
+            opacity: 1;
+            transform: translateY(0);
+          }
+        }
+      }
+    }
+  }
+</style>

+ 1 - 0
src/views/deviceManage/powerEquip/deviceDetails.vue

@@ -218,6 +218,7 @@ export default defineComponent({
         listSelect()
       }
     })
+    
     onMounted(() => {
       listSelect()
     })

+ 62 - 8
src/views/monthReport/index.vue

@@ -6,6 +6,7 @@
           placeholder="输入站点名称或关键字"
           v-model="filterText"
           class="attContentInput"
+          clearable
         >
           <template #suffix>
             <i class="el-icon-search el-input__icon"></i>
@@ -15,12 +16,27 @@
 
       <div class="monthSwitch">
         <el-tree
-          :data="data"
+          class="monthTree"
+          ref="tree"
+          :data="store.state.siteList"
           show-checkbox
           node-key="id"
-          :default-expanded-keys="[2, 3]"
           :props="defaultProps"
-        />
+          :filter-node-method="filterNode"
+        >
+          <template #default="{ node }">
+            <span class="custom-tree-node">
+              <el-tooltip
+                class="item"
+                effect="dark"
+                :content="node.label"
+                placement="top"
+              >
+                <span>{{ node.label }}</span>
+              </el-tooltip>
+            </span>
+          </template>
+        </el-tree>
       </div>
     </div>
     <div class="monthContent2" v-if="modleBool">
@@ -49,7 +65,7 @@
 </template>
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, ref } from 'vue'
+import { defineComponent, ref, watch } from 'vue'
 import baseicTable from './tables/basicTable.vue'
 import deviationTable from './tables/deviationTable.vue'
 import reportModel from './reportModel.vue'
@@ -60,7 +76,8 @@ export default defineComponent({
   props: {},
   setup() {
     const store = useStore()
-    store
+    const tree = ref(null)
+    const filterText = ref('')
 
     const handleClick = (tab, event) => {
       console.log(tab, event)
@@ -76,13 +93,38 @@ export default defineComponent({
       modleBool.value = value.modleBool
     }
 
+    //tree 树形控件处理方法
+    const filterNode = (value, data) => {
+      if (!value) return true
+      return data.siteName.indexOf(value) !== -1
+    }
+    // 异步任务 用于给tree传值
+    const writeValue = (val) => {
+      return tree.value.filter(val)
+    }
+    // 定义 watch 监听
+    watch(
+      filterText,
+      (newCount, old, clear) => {
+        // 执行异步任务,并得到关闭异步任务的 id
+        let id = writeValue(newCount, old)
+        // 如果 watch 监听被重复执行了,则会先清除上次未完成的异步任务
+        clear(() => clearTimeout(id))
+      },
+      // watch 刚被创建的时候不执行
+      { lazy: true }
+    )
     return {
+      filterNode,
       headClass,
       modleAll,
+      handleClick, //tabs切换事件
+
       modleBool,
-      filterText: ref(''),
+      store,
+      tree,
+      filterText,
       activeName: ref('monthList'),
-      handleClick, //tabs切换事件
       data: [
         {
           id: 1,
@@ -105,7 +147,8 @@ export default defineComponent({
       ],
       defaultProps: {
         children: 'children',
-        label: 'label',
+        id: 'id',
+        label: 'siteName',
       },
     }
   },
@@ -164,4 +207,15 @@ export default defineComponent({
 .el-tabs--card > .el-tabs__header .el-tabs__nav {
   border: none;
 }
+</style>
+<style>
+.monthTree {
+  width: 100%;
+  overflow: hidden;
+  height: 76vh;
+  overflow-y: auto;
+}
+.monthTree::-webkit-scrollbar {
+  display: none;
+}
 </style>

+ 69 - 39
src/views/patrolManage/patrolPlan/tables/inspePlan.vue

@@ -5,12 +5,14 @@
         class="inspePlanInput"
         v-model="inspePlanInput"
         placeholder="按名称或编号搜索"
+        @input="listSelect()"
       />
       <span class="inspePlanSpan">状态:</span>
-      <div>
-        <el-radio v-model="radio" label="1">所有</el-radio>
-        <el-radio v-model="radio" label="2">进行中</el-radio>
-        <el-radio v-model="radio" label="3">已完成</el-radio>
+      <div @change="listSelect()">
+        <el-radio v-model="radio" :label="3">所有</el-radio>
+        <el-radio v-model="radio" :label="0">注销</el-radio>
+        <el-radio v-model="radio" :label="1">进行中</el-radio>
+        <el-radio v-model="radio" :label="2">已完成</el-radio>
       </div>
     </div>
     <div>
@@ -19,31 +21,26 @@
         border
         stripe
         :header-cell-style="headClass"
-        style="max-height: 42.5rem"
+        :height="Height"
       >
         <el-table-column
-          prop="reportName"
-          label="计划编号"
+          prop="inspectionSchemeName"
+          label="巡检计划名称"
           width=""
         ></el-table-column>
         <el-table-column
-          prop="reportDate"
-          label="计划名称"
+          prop="schemeStartDate"
+          label="计划开始日期"
           width=""
         ></el-table-column>
         <el-table-column
-          prop="proposal"
-          label="期"
+          prop="schemeEndDate"
+          label="计划结束日期"
           width=""
         ></el-table-column>
         <el-table-column
-          prop="mailbox"
-          label="巡检周期"
-          width=""
-        ></el-table-column>
-        <el-table-column
-          prop="state"
-          label="巡检班组"
+          prop="inspectionCycleNumber"
+          label="巡检周期数目"
           width=""
         ></el-table-column>
         <el-table-column
@@ -87,9 +84,9 @@
         <el-pagination
           v-model:currentPage="currentPage"
           :page-sizes="[15, 20, 25, 30]"
-          :page-size="15"
+          :page-size="pageSize"
           layout="total, sizes, prev, pager, next, jumper"
-          :total="tableData.length"
+          :total="total"
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
           background
@@ -99,57 +96,90 @@
   </div>
 </template>
 <script>
-import { defineComponent, ref } from 'vue'
+import { defineComponent, onMounted, ref } from 'vue'
+import * as api from '@/api/dataManage/patrolPlan'
+import { ElMessage } from 'element-plus'
 
 export default defineComponent({
   name: 'patolPlan',
   components: {},
   props: {},
-  setup(props,context) {
+  setup(props, context) {
+    const radio = ref(3)
+    const total = ref(0)
+    const pageSize = ref(15)
+    const currentPage = ref(1)
+    const tableData = ref([])
+    const inspePlanInput = ref('')
+
     props
     const Update = (row) => {
       console.log('', row)
-      
     }
     const Select = (row) => {
-      context.emit('selectBool',false)
+      context.emit('selectBool', false)
       console.log('', row)
     }
     const stop = (row) => {
       console.log('', row)
     }
 
-    // 表头样式设置
-    const headClass = () => {
-      return 'background:#FAFAFA !important;color: black;'
+    function listSelect() {
+      api
+        .patrolInspectionSchemeList({
+          status: radio.value,
+          inspectionSchemeName: inspePlanInput.value,
+          size: pageSize.value,
+          current: currentPage.value,
+        })
+        .then((requset) => {
+          if (requset.status === 'SUCCESS') {
+            total.value = requset.data.total
+            tableData.value = requset.data.records
+          } else {
+            ElMessage.error(requset.msg)
+          }
+        })
+      console.log()
     }
 
+    onMounted(() => {
+      listSelect()
+    })
+
     const handleSizeChange = (val) => {
       console.log(`${val} items per page`)
     }
     const handleCurrentChange = (val) => {
       console.log(`current page: ${val}`)
     }
+
+    const Height = ref(0)
+    Height.value = window.innerHeight - 300 + 'px'
+    window.addEventListener('resize', () => {
+      Height.value = window.innerHeight - 300 + 'px'
+    })
+    // 表头样式设置
+    const headClass = () => {
+      return 'background:#FAFAFA !important;color: black;'
+    }
     return {
-      inspePlanInput: ref(''),
-      currentPage: ref(1),
+      listSelect,
       handleSizeChange,
       handleCurrentChange,
       headClass,
       Update, //修改事件
       Select, //查询事件
       stop, //暂停事件
+
+      inspePlanInput,
       input: ref(''),
-      radio: ref('1'),
-      tableData: [
-        {
-          reportName: '05-01',
-          reportDate: 'Tom',
-          proposal: '',
-          mailbox: '',
-          state: '',
-        },
-      ],
+      radio,
+      total,
+      currentPage,
+      pageSize,
+      Height,
+      tableData,
     }
   },
 })

+ 32 - 23
src/views/planOutage/dialogComponent.vue

@@ -79,10 +79,7 @@ export default defineComponent({
   emits: ['closeDialog'],
   props: {
     show_Dialog: Boolean,
-    dialogTitle: {
-      type: String,
-      default: '新增',
-    },
+    dialogTitle: String,
     itemInfo: {
       type: Object,
       default: function () {
@@ -97,13 +94,6 @@ export default defineComponent({
     const form = ref([])
     const formInfo = ref(null)
 
-    //禁止选择以前的时间
-    const pickerEndDate = (time) => {
-      const timeRange = 1 * 24 * 60 * 60 * 1000
-
-      return time.getTime() <= Date.now() - timeRange * 1
-    }
-
     const roleValid = (rule, value, callback) => {
       rule
       if (value.length === 0) {
@@ -117,28 +107,41 @@ export default defineComponent({
     const submitForm = () => {
       formInfo.value.validate((valid) => {
         if (valid) {
-          store.commit('TimeAll_function', form.value.time)
-          const time = store.state.Time_Data
-          form.value.startTime = time[0]
-          form.value.endTime = time[1]
-          api.plannedOutageAdd(form.value).then((requset) => {
-            if (requset.status === 'SUCCESS') {
-              if (props.dialogTitle === '新增') {
+          var timeType = typeof form.value.time[0]
+          if (timeType == 'object') {
+            store.commit('TimeAll_function', form.value.time)
+            const time = store.state.Time_Data
+            form.value.startTime = time[0]
+            form.value.endTime = time[1]
+          } else {
+            form.value.startTime = form.value.time[0]
+            form.value.startTime = form.value.time[1]
+          }
+          if (props.dialogTitle === '新增') {
+            api.plannedOutageAdd(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
                 ElMessage.success({
                   message: '新增成功',
                   type: 'success',
                 })
+                closeDialog()
               } else {
+                ElMessage.error(requset.msg)
+              }
+            })
+          } else {
+            api.plannedOutageUpdate(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
                 ElMessage.success({
                   message: '修改成功',
                   type: 'success',
                 })
+                closeDialog()
+              } else {
+                ElMessage.error(requset.msg)
               }
-              closeDialog()
-            } else {
-              ElMessage.error(requset.msg)
-            }
-          })
+            })
+          }
         } else {
           console.log('error submit!!')
           return false
@@ -161,6 +164,12 @@ export default defineComponent({
       showDialog.value = props.show_Dialog
     })
 
+    //禁止选择以前的时间
+    const pickerEndDate = (time) => {
+      const timeRange = 1 * 24 * 60 * 60 * 1000
+
+      return time.getTime() <= Date.now() - timeRange * 1
+    }
     /**
      * 手机号校验
      */

+ 5 - 1
src/views/planOutage/index.vue

@@ -161,7 +161,7 @@
 
 <script>
 import { useStore } from 'vuex'
-import { defineComponent, ref } from 'vue'
+import { defineComponent, onMounted, ref } from 'vue'
 import DialogComponent from './dialogComponent'
 import * as api from '@/api/planOutage/index'
 import { ElMessage } from 'element-plus'
@@ -283,6 +283,10 @@ export default defineComponent({
         })
     }
 
+    onMounted(() => {
+      Select()
+    })
+
     const handleSizeChange = (val) => {
       pageSize.value = val
       Select()