ming 3 år sedan
förälder
incheckning
f9a7f34bb0

+ 36 - 0
src/api/stationManage/index.js

@@ -7,4 +7,40 @@ export function platformList(params) {
         method: 'GET',
         params,
     })
+}
+
+//台区-新增
+export function platformAreaAdd(params) {
+    return request({
+        url: 'platformArea/platformAreaAdd',
+        method: 'POST',
+        data: params,
+    })
+}
+
+// 台区-修改
+export function platformAreaUpdate(params) {
+    return request({
+        url: '/platformArea/platformAreaUpdate',
+        method: 'POST',
+        data: params,
+    })
+}
+
+// 台区-删除
+// export function platformAreaDel(params) {
+//     return request({
+//         url: '/platformArea/platformAreaDel',
+//         method: 'GET',
+//         params,
+//     })
+// }
+
+//台区-删除
+export function platformAreaDel(params) {
+    return request({
+        url: '/platformArea/platformAreaDel',
+        method: 'GET',
+        params,
+    })
 }

+ 4 - 0
src/assets/css/index.scss

@@ -343,6 +343,10 @@ ul li {
     top: 5px;
 }
 
+.custom-tree-node span:first-child {
+    width: 100px
+}
+
 // 告警管理渐变背景色
 .alarmingTable {
     a {

+ 204 - 200
src/router/index.js

@@ -1,32 +1,31 @@
 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'),
+            import ('@/views/401'),
         hidden: true,
     },
 ]
@@ -70,11 +69,9 @@ export const asyncRoutes = [
             },
             path: 'index',
             component: () =>
-                import('@/views/alarmManage/index'),
-
-        },
+                import ('@/views/alarmManage/index'),
 
-        ]
+        }, ]
     },
     {
         path: '/siteManage',
@@ -91,7 +88,7 @@ export const asyncRoutes = [
             },
             path: '/siteManage',
             component: () =>
-                import('@/views/siteManage/index'),
+                import ('@/views/siteManage/index'),
             selectLeftMenu: '/alarmManage',
             hidden: true
         }]
@@ -112,7 +109,7 @@ export const asyncRoutes = [
             },
             path: '/stationManage',
             component: () =>
-                import('@/views/stationManage/index'),
+                import ('@/views/stationManage/index'),
             hidden: true
         }]
     },
@@ -125,41 +122,48 @@ export const asyncRoutes = [
      * channelList 通道列表
      * attribTemplate 属性模板
      */
+
     {
-        meta: { icon: 'deviceManage', title: '设备管理', },
         path: '/deviceManage',
-        component: Layout,
         redirect: '/deviceManage/powerEquip',
-        children: [{
-            meta: { icon: 'powerEquip', title: '设备管理', },
-            path: 'powerEquip',
-            component: () =>
-                import('@/views/deviceManage/powerEquip/index.vue'),
+        meta: {
+            title: '设备管理',
+            icon: 'deviceManage',
         },
-        // {
-        //   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: Layout,
+        children: [{
+            meta: {
+                title: '设备管理',
+                icon: 'deviceManage',
+            },
+            path: '/deviceManage',
             component: () =>
-                import('@/views/deviceManage/attribTemplate/index.vue'),
-        }
-        ]
+                import ('@/views/deviceManage/powerEquip'),
+            hidden: true
+        }]
     },
 
+
+    // {
+    //     meta: { icon: 'deviceManage', title: '设备管理', },
+    //     path: '/deviceManage',
+    //     component: Layout,
+    //     redirect: '/deviceManage/powerEquip',
+    //     children: [{
+    //             meta: { icon: 'powerEquip', title: '设备管理', },
+    //             path: 'powerEquip',
+    //             component: () =>
+    //                 import ('@/views/deviceManage/powerEquip/index.vue'),
+    //         },
+    //         {
+    //             meta: { icon: 'attribTemplate', title: '属性模板', },
+    //             path: 'attribTemplate',
+    //             component: () =>
+    //                 import ('@/views/deviceManage/attribTemplate/index.vue'),
+    //         }
+    //     ]
+    // },
+
     /**
      * dataManage 数据管理
      * sameAnalysis 同比分析报表
@@ -175,45 +179,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'),
+            // }
         ]
     },
 
@@ -230,29 +234,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'),
+            },
 
         ]
     },
@@ -267,19 +271,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
+            }
         ]
     },
 
@@ -293,7 +297,7 @@ export const asyncRoutes = [
             meta: { title: '计划停电', icon: 'planOutage', },
             path: '/planOutage',
             component: () =>
-                import('@/views/planOutage/index'),
+                import ('@/views/planOutage/index'),
             hidden: true
         }],
     },
@@ -313,33 +317,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'),
+            },
         ]
     },
 
@@ -359,35 +363,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'),
+            },
 
         ]
     },
@@ -403,17 +407,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'),
+            },
         ]
     },
 
@@ -429,25 +433,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',
+                },
             },
-        },
         ],
     },
 

+ 4 - 4
src/views/deviceManage/powerEquip/index.vue

@@ -139,9 +139,9 @@
       <el-tab-pane label="通信设备" name="communicateEquip">
         <communicate-Equip :Height="Height"></communicate-Equip>
       </el-tab-pane>
-      <el-tab-pane label="通道列表" name="channelList">
+      <!-- <el-tab-pane label="通道列表" name="channelList">
         <channel-List :Height="Height"></channel-List>
-      </el-tab-pane>
+      </el-tab-pane> -->
     </el-tabs>
   </div>
 </template>
@@ -152,7 +152,7 @@ import deviceDetails from './deviceDetails.vue'
 import videoEquip from './videoEquip/index.vue'
 import insertDialog from './powerDialog/insertDialog.vue'
 import communicateEquip from './communicateEquip/index.vue'
-import channelList from './channelList/index.vue'
+// import channelList from './channelList/index.vue'
 
 import * as api from '@/api/deviceManage/powerEquip/deviceAttribute'
 import { ElMessage } from 'element-plus'
@@ -164,7 +164,7 @@ export default defineComponent({
     videoEquip,
     insertDialog,
     communicateEquip,
-    channelList,
+    // channelList,
   },
   props: {},
   setup() {

+ 6 - 2
src/views/siteManage/basicInfo/index.vue

@@ -231,6 +231,11 @@ import { ElMessage } from 'element-plus'
 import { useStore } from 'vuex'
 import { parseTime, validatorPhone } from '@/utils'
 
+
+import {
+  getAccessToken,
+} from '@/utils/accessToken'
+
 export default defineComponent({
   name: 'BasicInfo',
   setup() {
@@ -239,8 +244,7 @@ export default defineComponent({
     const dialogImageUrl = ref('')
     const dialogVisible = ref(false)
     const disabled = ref(false)
-    const accessToken = ref(  // 请求头字段待写活
-      'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjFkNzIxMzA2LTVkMmYtNDE0MS1hMmI0LWIxMjgyMzVhZDM1ZCJ9.GpQLs96TH00EvUE4S5XsaYgFaL7gH5uabDpiFOHwDCxus0jdcB_gQu3XPB0BgJwNiFI8DA5JuQhSnnTezBbdyw'
+    const accessToken = ref('eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjI5ZTdlODM2LTFjMDAtNGRmYS1iMjRmLTg1NzU2MGZkNDlhMSJ9.Uu__ruYZVzmXzbtplcwdNXnI4rPkIthljy4ymfor9k3rhRzr27wJBMs9YLlJyODzYeSEEfQIGf-2sF0etsawiA'
     )
     const dropData = ref([])
     const dropData2 = ref([])

+ 69 - 126
src/views/siteManage/index.vue

@@ -23,7 +23,7 @@
           <i class="el-icon-search el-input__icon"></i>
         </template>
       </el-input>
-
+      <!-- <el-scrollbar> -->
       <el-tree
         class="filter-tree siteTree"
         :data="data"
@@ -35,6 +35,7 @@
         :filter-node-method="filterNode"
         ref="tree"
       >
+      
         <template #default="{ node, data }">
           <span
             class="custom-tree-node"
@@ -42,29 +43,33 @@
             @mouseenter="mouseenter(data)"
             @mouseleave="mouseleave(data)"
           >
-            <span>{{ node.label }}</span>
+            <el-tooltip
+                class="item"
+                effect="dark"
+                :content="node.label"
+                placement="top-start"
+              >
+                <span>{{ node.label }}</span>
+              </el-tooltip>
             <span>
               <a
                 class="deleteLink"
                 v-show="data.show"
                 @click="remove(node, data)"
               >
-                <i size="mini" class="el-icon-delete"></i>
+                <!-- <i size="mini" class="el-icon-delete"></i> -->
               </a>
             </span>
           </span>
         </template>
       </el-tree>
+      <!-- </el-scrollbar> -->
     </div>
     <!-- 树形组件end -->
 
     <!-- 站点主题start -->
-    <div class="grid-content nestingDom" style="width: calc(100% - 300px);">
-      <el-tabs
-        v-if="this.treeLevel == 3"
-        v-model="activeName"
-        type="card"
-      >
+    <div class="grid-content nestingDom" style="width: calc(100% - 300px)">
+      <el-tabs v-if="this.treeLevel == 3" v-model="activeName" type="card">
         <el-tab-pane label="基本信息" name="first">
           <basic-info class="basicInfo"></basic-info>
         </el-tab-pane>
@@ -94,19 +99,19 @@
 
       <!-- 新建分组start -->
       <add-group-com
-       :dialogTitle="dialogTitle"
-      :itemInfo="tableItem"
-      @closeDialog="closeDialog"
-      :flag="showDialog"
+        :dialogTitle="dialogTitle"
+        :itemInfo="tableItem"
+        @closeDialog="closeDialog"
+        :flag="showDialog"
       ></add-group-com>
       <!-- 新建分组end -->
 
       <!-- 新建站点start -->
       <add-site-com
         :dialogTitle="dialogTitle"
-      :itemInfo="tableItem"
-      @closeDialog="closeDialog"
-      :flag="showDialog2"
+        :itemInfo="tableItem"
+        @closeDialog="closeDialog"
+        :flag="showDialog2"
       ></add-site-com>
       <!-- 新建站点end -->
     </div>
@@ -115,8 +120,7 @@
 </template>
 
 <script>
-
-import { defineComponent, ref,reactive,watch,onMounted} from 'vue'
+import { defineComponent, ref, reactive, watch, onMounted } from 'vue'
 
 import basicInfo from './basicInfo'
 import WatchDog from './watchDog'
@@ -131,6 +135,9 @@ import addSiteCom from './addSiteCom'
 import * as api from '@/api/siteManage/index'
 import { ElMessage } from 'element-plus'
 
+
+
+
 export default defineComponent({
   components: {
     basicInfo,
@@ -151,81 +158,17 @@ export default defineComponent({
     const filterText = ref('')
     const data = ref([
       {
-          label: '所有站点',
-          children: [
-            {
-              label: '分组一',
-              children: [
-                {
-                  label: '站点 1-1',
-                  show: false,
-                },
-                {
-                  label: '站点 1-2',
-                  show: false,
-                },
-                {
-                  label: '站点 1-3',
-                  show: false,
-                },
-                {
-                  label: '站点 1-4',
-                  show: false,
-                },
-              ],
-            },
-            {
-              label: '分组二',
-              children: [
-                {
-                  label: '站点 2-1',
-                  show: false,
-                },
-                {
-                  label: '站点 2-2',
-                  show: false,
-                },
-                {
-                  label: '站点 2-3',
-                  show: false,
-                },
-                {
-                  label: '站点 2-4',
-                  show: false,
-                },
-              ],
-            },
-            {
-              label: '其他分组',
-              children: [
-                {
-                  label: '其他 3-1',
-                  show: false,
-                },
-                {
-                  label: '其他 3-2',
-                  show: false,
-                },
-                {
-                  label: '其他 3-3',
-                  show: false,
-                },
-                {
-                  label: '其他 3-4',
-                  show: false,
-                },
-              ],
-            },
-          ],
-        },
+        label: '所有站点',
+        children: []
+      },
     ])
     const defaultProps = ref({
-        children: 'children',
-        label: 'label',
-      })
-    
-    const getMsgFormSon=()=> {
-     activeName.value = 'third';
+      children: 'children',
+      label: 'label',
+    })
+
+    const getMsgFormSon = () => {
+      activeName.value = 'third'
     }
     function mouseenter(data) {
       data.show = true
@@ -237,59 +180,59 @@ export default defineComponent({
       if (!value) return true
       return data.label.indexOf(value) !== -1
     }
-    const  handleNodeClick=(data, obj, node)=> {
+    const handleNodeClick = (data, obj, node) => {
       data, node
       treeLevel.value = obj.level
     }
 
     const tree = ref(null)
 
-    watch(filterText, (val) => { //直接监听
-    val
-    console.log(tree)
-    //  tree.value.filter(val)
+    watch(filterText, (val) => {
+      //直接监听
+      val
+      console.log(tree)
+      //  tree.value.filter(val)
     })
 
     // 关闭操作
-    const  closeDialog=()=> {
+    const closeDialog = () => {
       showDialog.value = false
-      showDialog2.value = false;
-      treeLevel.value=3
-      
+      showDialog2.value = false
+      treeLevel.value = 3
     }
     //新建分组
     const tableItem = reactive([])
-    const  addGroup=() =>{
+    const addGroup = () => {
       tableItem.value = {
-         id: "",
-        stationName: "",
-        xh: "",
-        userName: "",
+        id: '',
+        stationName: '',
+        xh: '',
+        userName: '',
         list: [],
-        done: "",
-        guaZai: "",
+        done: '',
+        guaZai: '',
         checked: true,
-      };
+      }
       dialogTitle.value = '新建分组'
       showDialog.value = true
     }
 
     //新建站点
-    const addSite=()=> {
+    const addSite = () => {
       tableItem.value = {
-         id: "",
-        stationName: "",
-        xh: "",
-        userName: "",
+        id: '',
+        stationName: '',
+        xh: '',
+        userName: '',
         list: [],
-        done: "",
-        guaZai: "",
+        done: '',
+        guaZai: '',
         checked: true,
-      };
+      }
       dialogTitle.value = '新建站点'
       showDialog2.value = true
     }
-    const remove=(node, data)=> {
+    const remove = (node, data) => {
       const parent = node.parent
       const children = parent.data.children || parent.data
       const index = children.findIndex((d) => d.id === data.id)
@@ -297,14 +240,16 @@ export default defineComponent({
       this.dataSource = [...this.dataSource]
     }
 
-
-     //左侧树结构列表
+    //左侧树结构列表
     function siteTreeList() {
       api.siteTreeList({}).then((requset) => {
         if (requset.status === 'SUCCESS') {
-          // console.log(requset.data)
-          // tableData.value = requset.data
-          // store.state.list = tableData
+          var jsona = JSON.stringify(requset.data)
+          var jsonb = jsona.replace(/"grouping_name"/g, '"label"');
+          jsonb=jsonb.replace(/"site_list"/g, '"children"');
+          jsonb=jsonb.replace(/"site_name"/g, '"label"');
+          var jsonc = JSON.parse(jsonb)
+          data.value[0].children=jsonc
         } else {
           ElMessage.error(requset.msg)
         }
@@ -332,10 +277,8 @@ export default defineComponent({
       closeDialog,
       addGroup,
       addSite,
-      remove
-      
+      remove,
     }
-
   },
 })
 </script>
@@ -354,7 +297,7 @@ export default defineComponent({
   border-radius: 20px !important;
 }
 .treeDom {
-  width: 270px;
+  width: 290px;
   position: absolute;
   left: 0;
   // margin-left: 20px;

+ 54 - 31
src/views/stationManage/dialogComponent.vue

@@ -14,16 +14,16 @@
         label-width="100px"
         :rules="rules"
       >
-        <el-form-item label="台区名称:" prop="stationName">
-          <el-input v-model="form.stationName"></el-input>
+        <el-form-item label="台区名称:" prop="platformAreaName">
+          <el-input v-model="form.platformAreaName"></el-input>
         </el-form-item>
-        <el-form-item label="台区编号:" prop="stationCode">
-          <el-input v-model="form.stationCode"></el-input>
+        <el-form-item label="台区编号:" prop="platformAreaCode">
+          <el-input v-model="form.platformAreaCode"></el-input>
         </el-form-item>
-        <el-form-item label="台区地址:" prop="stationAddress">
-          <el-input v-model="form.stationAddress"></el-input>
+        <el-form-item label="台区地址:" prop="platformAreaAddress">
+          <el-input v-model="form.platformAreaAddress"></el-input>
         </el-form-item>
-        <el-form-item label="站点列表:" prop="siteList">
+        <!-- <el-form-item label="站点列表:" prop="siteList">
           <el-select
             v-model="form.siteList"
             multiple
@@ -38,13 +38,13 @@
               :value="item.value"
             ></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
 
-        <el-form-item label="已勾选:" prop="pointNum">
+        <el-form-item label="已勾选:" prop="pointNum" v-if="dialogTitle=='编辑'">
           <el-input v-model="form.pointNum" style="width: 200px"></el-input>
           个站点
         </el-form-item>
-        <el-form-item label="共挂载:" prop="deviceNum">
+        <el-form-item label="共挂载:" prop="deviceNum" v-if="dialogTitle=='编辑'">
           <el-input v-model="form.deviceNum" style="width: 200px"></el-input>
           个设备
         </el-form-item>
@@ -62,6 +62,8 @@
 
 <script>
 import { defineComponent, ref, watchEffect } from 'vue'
+import * as api from '@/api/stationManage/index.js'
+import { ElMessage } from 'element-plus'
 
 export default defineComponent({
   name: 'DialogComponent',
@@ -134,12 +136,33 @@ export default defineComponent({
       console.log(formInfo)
       formInfo.value.validate((valid) => {
         if (valid) {
-          // 走保存请求
-          this.$message({
-            message: '操作成功!',
-            type: 'success',
-          })
-          this.closeDialog(1)
+          if (props.dialogTitle === '新增') {
+           
+            api.platformAreaAdd(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
+                ElMessage.success({
+                  message: '新增成功',
+                  type: 'success',
+                })
+                closeDialog()
+              } else {
+                ElMessage.error(requset.msg)
+              }
+            })
+          }else {
+             alert(1)
+            api.platformAreaUpdate(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
+                ElMessage.success({
+                  message: '修改成功',
+                  type: 'success',
+                })
+                closeDialog()
+              } else {
+                ElMessage.error(requset.msg)
+              }
+            })
+          } 
         } else {
           console.log('error submit!!')
           return false
@@ -157,9 +180,9 @@ export default defineComponent({
       open,
       submitForm,
       rules: {
-        stationName: [
+        platformAreaName: [
           // required  是否为必填项, trigger:表单验证的触发时机,失去焦点进行验证
-          { required: false, message: '请输入台区名称', trigger: 'blur' },
+          { required: true, message: '请输入台区名称', trigger: 'blur' },
           {
             min: 3,
             max: 6,
@@ -167,7 +190,7 @@ export default defineComponent({
             trigger: 'blur',
           },
         ],
-        stationCode: [
+        platformAreaCode: [
           { required: true, message: '请输入台区编号', trigger: 'blur' },
           {
             min: 3,
@@ -176,7 +199,7 @@ export default defineComponent({
             trigger: 'blur',
           },
         ],
-        stationAddress: [
+        platformAreaAddress: [
           { required: true, message: '请输入台区地址', trigger: 'blur' },
           {
             min: 3,
@@ -185,17 +208,17 @@ export default defineComponent({
             trigger: 'blur',
           },
         ],
-        siteList: [
-          { required: true, message: '请选择站点列表', trigger: 'change' },
-        ],
-        pointNum: [
-          { required: true, message: '请输入已选站点个数', trigger: 'blur' },
-          { trigger: 'blur' },
-        ],
-        deviceNum: [
-          { required: true, message: '请输入挂载设备个数', trigger: 'blur' },
-          { trigger: 'blur' },
-        ],
+        // siteList: [
+        //   { required: true, message: '请选择站点列表', trigger: 'change' },
+        // ],
+        // pointNum: [
+        //   { required: true, message: '请输入已选站点个数', trigger: 'blur' },
+        //   { trigger: 'blur' },
+        // ],
+        // deviceNum: [
+        //   { required: true, message: '请输入挂载设备个数', trigger: 'blur' },
+        //   { trigger: 'blur' },
+        // ],
       },
     }
   },

+ 102 - 29
src/views/stationManage/index.vue

@@ -67,19 +67,46 @@
           >
             编辑
           </el-button>
-          <el-button
-            @click="handleDelete(scope.$index, scope.row)"
-            type="text"
-            size="small"
-            class="delete-text"
+          <el-popconfirm
+            confirm-button-text="是"
+            cancel-button-text="否"
+            icon="el-icon-info"
+            icon-color="red"
+            title="确定删除?"
+            @confirm="handleDelete(scope.row)"
+            @cancel="cancelEvent"
           >
-            删除
-          </el-button>
+            <template #reference>
+              <el-button type="text" size="small" class="delete-text">
+                删除
+              </el-button>
+            </template>
+          </el-popconfirm>
         </template>
       </el-table-column>
     </el-table>
     <!-- 表格end -->
 
+    <!-- 分页start -->
+    <div class="paginationBlock">
+      <el-pagination
+        v-model:currentPage="currentPage"
+                :page-sizes="[15, 20, 25, 30]"
+                :page-size="pageSize"
+                layout="total, sizes, prev, pager, next, jumper"
+                :total="total"
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                background
+
+      >
+      </el-pagination>
+    </div>
+
+    <!-- 分页end -->
+
+    
+
     <!--弹框组件开始-----------------------start-->
     <dialog-component
       :dialogTitle="dialogTitle"
@@ -103,6 +130,12 @@ import siteList from './siteList'
 export default defineComponent({
   components: { DialogComponent, siteList },
   setup(props, context) {
+
+    const total = ref(0)
+    const pageSize = ref(10)
+    const currentPage = ref(1)
+
+
     const platformAreaName = ref('')
     const pageShow = ref(true)
     const showDialog = ref(false)
@@ -159,32 +192,31 @@ export default defineComponent({
       }
     }
 
+     const handleSizeChange = (val) => {
+      pageSize.value = val
+      platformList()
+    }
+    const handleCurrentChange = (val) => {
+      currentPage.value = val
+      platformList()
+    }
+
     const tableItem = reactive([])
     const dialogTitle = ref('')
-    // 添加操作
 
-    const addItem = () => {
-      tableItem.value = {
-        id: '',
-         platformAreaName: '',
-        platformAreaCode: '',
-        platformAreaAddress: '',
-        siteList: [],
-        done: '',
-        guaZai: '',
-      }
 
-      dialogTitle.value = '新增'
-      showDialog.value = true
-    }
+    
 
     //电力监测设备列表
     function platformList() {
-      api.platformList().then((requset) => {
+      api.platformList({
+          size: pageSize.value,
+          current: currentPage.value,
+        }).then((requset) => {
           if (requset.status === 'SUCCESS') {
             console.log(requset.data)
             tableData.value = requset.data.records
-            // total.value = requset.data.total
+            total.value = requset.data.total
             // store.state.siteList = tableData
           } else {
             ElMessage.error(requset.msg)
@@ -206,22 +238,54 @@ export default defineComponent({
         })
     }
 
+    // 添加操作
+    const addItem = () => {
+      tableItem.value = {
+        platformAreaName: '',
+        platformAreaCode: '',
+        platformAreaAddress: '',
+      }
+      dialogTitle.value = '新增'
+      showDialog.value = true
+    }
+
     // 编辑操作
     const editRow = (row) => {
       console.log(row)
-      tableItem.value = row
+      // tableItem.value = row
+      tableItem.value={
+        id:row.id,
+        platformAreaName:row.platformAreaName,
+        platformAreaCode:row.platformAreaCode,
+        platformAreaAddress:row.platformAreaAddress,
+
+      }
       dialogTitle.value = '编辑'
       showDialog.value = true
     }
     // 关闭操作
     const closeDialog = () => {
-      showDialog.value = false
+      showDialog.value = false;
+      platformList()
     }
 
-    //删除操作
-    const handleDelete = (index, row) => {
-      console.log(index, row)
-      alert(index)
+    //删除 是否删除  ---- 是
+    const handleDelete = (row) => {
+      api.platformAreaDel({ id: row.id }).then((requset) => {
+        if (requset.status === 'SUCCESS') {
+          ElMessage.success({
+            message: '删除成功',
+            type: 'success',
+          })
+           platformList()
+        } else {
+          ElMessage.error(requset.msg)
+        }
+      })
+    }
+    //是否删除  ---- 否
+    const cancelEvent = () => {
+      console.log('cancel!')
     }
 
     onMounted(() => {
@@ -246,6 +310,15 @@ export default defineComponent({
       editRow,
       closeDialog,
       handleDelete,
+      cancelEvent,
+
+
+
+      total,
+      pageSize,
+      currentPage,
+      handleSizeChange,
+      handleCurrentChange,
     }
   },
 })

+ 9 - 2
vue.config.js

@@ -93,6 +93,13 @@ module.exports = {
     },
     configureWebpack() {
         return {
+            module: {
+                rules: [{
+                    test: /\.mjs$/,
+                    include: /node_modules/,
+                    type: "javascript/auto"
+                }]
+            },
             resolve: {
                 alias: {
                     '@': resolve('src'),
@@ -167,9 +174,9 @@ module.exports = {
                             archive: [{
                                 source: `./${outputDir}`,
                                 destination: `./${outputDir}/${abbreviation}_${outputDir}_${date}.7z`,
-                            },],
+                            }, ],
                         },
-                    },])
+                    }, ])
                     .end()
             })
         }