liyangzheng 1 жил өмнө
parent
commit
9078edcea2

BIN
src/assets/icon/file_blue.png


BIN
src/assets/icon/file_upload.png


BIN
src/assets/icon/point.png


BIN
src/assets/image/board_file.png


+ 9 - 2
src/pages/401/NotFind.vue

@@ -1,14 +1,21 @@
 <template>
     <div>
+        <h1>您来到了哪里?点击<em @click="toLogin" style="color: blue;cursor: pointer;">这里    </em>跳转到登录页</h1>
     </div>
 </template>
 
 <script>
+import { useRouter } from 'vue-router';
+import router from '@/router';
 export default {
     setup() {
+        function toLogin(){
+            router.push("/login")
+        }
 
-
-        return {}
+        return {
+            toLogin,
+        }
     }
 }
 </script>

+ 17 - 7
src/pages/login/LoginNow.vue

@@ -21,14 +21,17 @@
                             placeholder="你的密码..." maxlength="32" />
                     </el-form-item>
                 </el-form>
-                <el-button class="loginBtn" type="primary" @click="sureLog" @keyup.enter="sureLog">登录</el-button>
+                <div @keyup.enter="sureLog">
+                    <el-button class="loginBtn" type="primary" @click="sureLog">登录</el-button>
+                </div>
             </div>
+
         </div>
     </div>
 </template>
 
 <script>
-import { ref, onMounted } from "vue"
+import { ref, onMounted, onBeforeUnmount } from "vue"
 import { useRouter } from 'vue-router'
 import { ElMessage } from "element-plus"
 import login from "@/api/login"
@@ -83,9 +86,6 @@ export default {
                         message: '登陆成功!',
                         type: "success"
                     })
-                    // windowEx.Size(1920, 1080)
-
-                    // windowEx.Position('center')
                 } else {
                     ElMessage({
                         message: res.msg,
@@ -93,8 +93,13 @@ export default {
                     })
                 }
             })
-
         }
+        // 添加键盘事件监听器
+        function handleKeyUp(event) {
+            if (event.key === 'Enter') {
+                sureLog();
+            }
+        };
         function WinClose() {
             windowEx.Exit()
         }
@@ -102,6 +107,7 @@ export default {
             windowEx.Min()
         }
         onMounted(() => {
+            window.addEventListener('keyup', handleKeyUp);
             // window.onload = function () {
             //     // 设置定时器,在 5000 毫秒(即 5 秒)后执行刷新操作
             //     setTimeout(function () {
@@ -109,6 +115,9 @@ export default {
             //     }, 100); // 5000 毫秒 = 5 秒
             // };
         })
+        onBeforeUnmount(() => {
+            window.removeEventListener('keyup', handleKeyUp);
+        })
         return {
             encryptPassword,
             less,
@@ -116,7 +125,8 @@ export default {
             loginForm,
             isLogin,
             WinMin,
-            WinClose
+            WinClose,
+            handleKeyUp,
         }
     }
 }

+ 4 - 1
src/pages/mission/components/CreateMis.vue

@@ -245,6 +245,7 @@ export default {
             if (states.value == 2) {
                 if (props.editRow.name) {
                     needEdit.value = props.editRow
+                    console.log(needEdit.value);
                     newMission.value.misName = needEdit.value.name//任务名称
                     newMission.value.misNum = needEdit.value.code
                     newMission.value.misId = needEdit.value.id //任务id
@@ -333,12 +334,14 @@ export default {
                 })
             }
         }
+        // t
         function saveMent() {//保存检测任务
             myForm.value.validate((val) => {
                 if (val) {
                     task.createTask({
-                        id: newMission.value.misId - 0,
+                        // id: newMission.value.misId - 0,
                         code: newMission.value.misNum,
+                        id: needEdit.value.id - 0,
                         name: newMission.value.misName,
                         station_id: newMission.value.flashId - 0,
                         memo: newMission.value.misMes,

+ 5 - 1
src/pages/mission/components/HaveMis.vue

@@ -203,10 +203,14 @@ export default {
     }
     // 生成报告和跳转页面
     function outcome(row, num) {
+      console.log(row,'rou');
       router.push({
         path: "/home/report/details",
         query: {
-          reportId: row.id
+          reportId: row.id,
+          scdId:row.scd_id,
+          stationName:row.station_name,
+          names:row.name
         }
       })
     }

+ 31 - 15
src/pages/mission/components/StartMission.vue

@@ -7,11 +7,15 @@
                 <p class="dateMis">创建日期:{{ loadingMis.ct }}</p>
                 <img src="../../../assets/image/start_mission.png" style="width: 200px;height: 200px;" alt="">
                 <p class="loading1" v-if="end">请耐心等待检测完成</p>
-                <p style="color: greenyellow;font-size: 16px;display: flex;justify-content: center;align-items: center;" v-else>
-                    <p style="display: block;">检测已完成</p>
-                    <el-icon style="color: greenyellow;display: block;"><SuccessFilled /></el-icon>
+                <p style="color: greenyellow;font-size: 16px;display: flex;justify-content: center;align-items: center;"
+                    v-else>
+                <p style="display: block;">检测已完成</p>
+                <el-icon style="color: greenyellow;display: block;">
+                    <SuccessFilled />
+                </el-icon>
                 </p>
-                <el-button type="primary" @click="misDown">取消</el-button>
+                <el-button type="primary" @click="misDown" v-if="end">取消</el-button>
+                <el-button type="primary" @click="backDown" v-else>返回</el-button>
             </div>
             <!-- 步骤和结果 -->
             <div class="stepAndEnd">
@@ -21,18 +25,26 @@
                 </div>
                 <!-- 结果 -->
                 <div class="endBox">
+                    <div style="display: flex;justify-content: flex-start;align-items: center;">
+                        <img style="display: block;" src="../../../assets/icon/file_blue.png" alt="">
+                        <span style="display: block;font-size: 14px;font-size: 16px;font-weight: 400;">检测结果</span>
+                    </div>
                     <el-table :data="endList" stripe style="width: 100%;height: calc(100vh - 600px);">
-                        <el-table-column prop="ied_name" label="装置名称" width="180" />
-                        <el-table-column prop="ied_desc" label="装置描述" width="180" :show-overflow-tooltip="true" />
-                        <el-table-column label="等级" width="180">
+                        <el-table-column prop="ied_name" label="装置名称" width="150" />
+                        <el-table-column prop="ied_desc" label="装置描述" width="150" :show-overflow-tooltip="true" />
+                        <el-table-column label="等级" width="130">
                             <template #default="scope">
                                 <span :style="{ 'color': scope.row.alert_level == 'error' ? 'red' : 'yellow' }">{{
                                     levelChoose(scope.row.alert_level) }}</span>
                             </template>
                         </el-table-column>
-                        <el-table-column prop="line_no" label="行号" width="180" />
-                        <el-table-column prop="parse_result" label="描述" width="180" :show-overflow-tooltip="true" />
-                        <el-table-column width="180" label="标准及条款" :show-overflow-tooltip="true">
+                        <el-table-column prop="line_no" label="行号" width="130" >
+                            <template #default="scope">
+                                <span style="color: blue;border-bottom: 1px solid blue;">{{ scope.row.line_no }}</span>
+                            </template>
+                        </el-table-column>
+                        <el-table-column prop="parse_result" label="描述" width="auto" :show-overflow-tooltip="true" />
+                        <el-table-column width="220" label="标准及条款" :show-overflow-tooltip="true">
                             <template #default="scope">
                                 <p>{{ scope.row.apply_standard }}</p>
                                 <p>{{ scope.row.apply_standard_no }}</p>
@@ -51,6 +63,7 @@ import StepMethod from './StepMethod.vue';
 import task from '@/api/task';
 import slc from '@/api/slc/slc';
 import { ElMessage } from 'element-plus';
+
 export default {
     props: {
         startMis: {
@@ -93,11 +106,11 @@ export default {
                             })
                         }
                     })
-                }, 2000)
+                }, 1000)
                 setTimeout(() => {
                     clearInterval(countTime)
                     end.value = false
-                }, 20000)
+                }, 30000)
             })
             setTimeout(() => {
                 slc.getScdByIdFromMission({
@@ -106,10 +119,12 @@ export default {
                     pagesize: 20,
                 }).then(res => {
                     endList.value = res.data
-                    console.log(endList.value, 'end');
                 })
             }, 10000)
         }
+        function backDown() {
+            emit("smBack", arrow.value)
+        }
         function levelChoose(bit) {
             if (bit == "error") {
                 return '错误'
@@ -129,6 +144,7 @@ export default {
             endList,//结果表格
             levelChoose,//等级筛选
             end,
+            backDown,
         }
     },
     components: {
@@ -179,6 +195,7 @@ p {
     height: calc(100vh - 600px);
     /* border: 1px solid green; */
     margin-top: 20px;
+    background-color: #F7F8FB;
 }
 
 .nowMis {
@@ -200,5 +217,4 @@ p {
     font-family: Source Han Sans CN-Regular, Source Han Sans CN;
     font-weight: 400;
     color: #255CE7;
-}
-</style>
+}</style>

+ 23 - 10
src/pages/mission/components/StepMethod.vue

@@ -1,9 +1,13 @@
 <template>
     <div>
         <div class="bigBox">
-            <h1 style="margin: 0;padding: 0;">检测详情</h1>
-            <el-steps  space="10px" finish-status="success" direction="vertical">
-                <el-step v-for="(step, index) in steps" :status="setStatus(step.status)" :key="index" :description="step.description" :title="step.title">
+            <div style="display: flex;justify-content: flex-start;align-items: center;">
+                    <img style="display: block;" src="../../../assets/icon/point.png" alt="">
+                    <span style="display: block;font-size: 14px;font-size: 16px;font-weight: 400;">检测详情</span>
+                </div>
+            <el-steps space="10px" finish-status="success" process-status="wait" direction="vertical">
+                <el-step v-for="(step, index) in steps" :status="setStatus(step.status)" :key="index"
+                    :description="step.description" :title="step.title">
                     {{ step.content }}
                 </el-step>
             </el-steps>
@@ -14,7 +18,7 @@
   
 <script>
 import { ref, onMounted, toRefs, watch } from "vue";
-import { Edit, Picture, Upload } from '@element-plus/icons-vue'
+import { Edit, Picture, Upload, Loading } from '@element-plus/icons-vue'
 import { ElMessage } from "element-plus";
 export default {
     props: {
@@ -66,24 +70,33 @@ export default {
                 return 'success'
             } else if (num == 0) {
                 return "process"
-            }else if(num == 3){
+            } else if (num == 3) {
                 return 'error'
             }
         }
         onMounted(() => {
             reload()
-            setInterval(() => {
-                nextStep()
-            }, 1000);
+            // setInterval(() => {
+            //     nextStep()
+            // }, 1000);
         })
         return {
             activeStep,
             steps,
             nextStep,
-            setStatus
+            setStatus,
+            Loading,
         };
     },
 };
 </script>
-<style></style>
+<style scoped>
+/*   */
+:deep(.el-step.is-vertical .el-step__title) {
+    font-size: 14px;
+    font-family: Source Han Sans CN, Source Han Sans CN;
+    font-weight: 400;
+    color: #1A2447;
+}
+</style>
   

+ 59 - 80
src/pages/netStructPicture/components/dialogIndex.vue

@@ -1,14 +1,6 @@
 <!-- 整个装置大的弹窗 -->
 <template>
-  <el-dialog
-    @close="cancelClick"
-    v-model="isOpen"
-    width="93vw"
-    append-to-body
-    draggable
-    top="5vh"
-    style="height: 92vh"
-  >
+  <el-dialog @close="cancelClick" v-model="isOpen" width="93vw" append-to-body draggable top="5vh" style="height: 92vh">
     <template #header>
       <div class="my-header">
         <div class="title" v-if="checkData">
@@ -18,80 +10,43 @@
     </template>
     <div class="main">
       <div class="main-left">
-        <el-input
-          v-model="searchInput"
-          class="w-50 m-2"
-          size="large"
-          placeholder="快捷搜索"
-          :suffix-icon="Search"
-          @change="searchClick"
-          style="width: 90%; margin-left: 5%; margin-top: 10px"
-        />
+        <el-input v-model="searchInput" class="w-50 m-2" size="large" placeholder="快捷搜索" :suffix-icon="Search"
+          @change="searchClick" style="width: 90%; margin-left: 5%; margin-top: 10px" />
         <el-scrollbar height="72vh">
-          <p
-            v-for="(item, index) in iedRelation"
-            :key="index"
-            class="scrollbar-demo-item"
-            @click="clickLeft(item, index)"
-            :class="{ 'left-item-active': activeLeft == index }"
-          >
-            <span class="ied-name">{{ item.ied_name }}</span
-            ><span class="desc" v-if="!isScdView">{{ item.desc }}</span>
+          <p v-for="(item, index) in iedRelation" :key="index" class="scrollbar-demo-item" @click="clickLeft(item, index)"
+            :class="{ 'left-item-active': activeLeft == index }">
+            <span class="ied-name">{{ item.ied_name }}</span><span class="desc" v-if="!isScdView">{{ item.desc }}</span>
             <span class="desc" v-else>{{ item.ied_desc }}</span>
           </p>
         </el-scrollbar>
       </div>
       <!-- 右侧版块 -->
-      <div class="main-right">
+      <div class="main-right" v-loading="loading">
         <div class="nav">
-          <div
-            v-for="(item, index) in navtopData"
-            :key="index"
-            :class="{ 'nav-item-active': activeNav == index }"
-            @click="clickNav(index, item.code)"
-            class="nav-item"
-          >
+          <div v-for="(item, index) in navtopData" :key="index" :class="{ 'nav-item-active': activeNav == index }"
+            @click="clickNav(index, item.code)" class="nav-item">
             {{ item.name }}
           </div>
         </div>
         <div v-if="inoutName.__name == 'inoutControl'" class="nav">
-          <div
-            v-for="(item, index) in inoutNav"
-            :key="index"
-            @click="clickInoutNav(item, index)"
-            class="inout"
-          >
-            <span
-              class="inout-item"
-              :class="{ 'inout-item-active': inoutItemNavIndex == index }"
-              >{{ item.name }}</span
-            >
+          <div v-for="(item, index) in inoutNav" :key="index" @click="clickInoutNav(item, index)" class="inout">
+            <span class="inout-item" :class="{ 'inout-item-active': inoutItemNavIndex == index }">{{ item.name }}</span>
           </div>
         </div>
-        <div
-          class="main-right-item"
-          :class="{
-            'inout-right-item': inoutName.__name == 'inoutControl',
-            soures: inoutName.__name == 'virtualRelation',
-            relatio: inoutName.__name == 'relationShip',
-          }"
-        >
+        <div class="main-right-item" :class="{
+          'inout-right-item': inoutName.__name == 'inoutControl',
+          soures: inoutName.__name == 'virtualRelation',
+          relatio: inoutName.__name == 'relationShip',
+        }">
           <!-- isPhoto是输入输出控制块的, -->
-          <component
-            :is="activeNavName"
-            :checkData="checkData"
-            :isOpen="isOpen"
-            :iedRelation="iedRelation"
-            @result="result"
-            :isPhoto="isPhoto"
-            :delScdId="delScdId"
-          ></component>
+          <component :is="activeNavName" :checkData="checkData" :isOpen="isOpen" :iedRelation="iedRelation"
+            @result="result" :isPhoto="isPhoto" :delScdId="delScdId"></component>
         </div>
       </div>
     </div>
   </el-dialog>
 </template>
-  <script setup>
+<script setup>
 import {
   onMounted,
   watch,
@@ -120,18 +75,18 @@ const props = defineProps({
   },
   iedRelationData: {
     type: Object,
-    default: () => {},
+    default: () => { },
   },
   checkDialogData: {
     type: Object,
-    default: () => {},
+    default: () => { },
   },
   scdView: {
     type: Boolean,
     default: false,
   },
-  delScdId:{
-    type:String,
+  delScdId: {
+    type: String,
     default: '',
   }
 });
@@ -145,6 +100,7 @@ const inoutNav = ref([
   { name: "GOOSE接收", code: "GOOSEreceive" },
 ]);
 const isScdView = ref(false);
+let loading = ref(false)
 watch(
   () => props.scdView,
   (newValue) => {
@@ -152,9 +108,9 @@ watch(
   }
 );
 const delScdIds = ref('');
-watch(()=>props.delScdId,(newValue)=>{
-  if(newValue){
-    delScdIds.value= newValue
+watch(() => props.delScdId, (newValue) => {
+  if (newValue) {
+    delScdIds.value = newValue
   }
 })
 watch(
@@ -232,20 +188,23 @@ const clickLeft = async (item, navIndex) => {
   //点击侧边栏事件
   checkData.value = null;
   activeLeft.value = navIndex;
+  loading.value = true
   if (!isScdView.value) {
     checkData.value = item;
+    loading.value = false
   } else {
-    let id='';
-    if(delScdIds.value){
-      id=delScdIds.value
-    }else{
-      id=route.query.id
+    let id = '';
+    if (delScdIds.value) {
+      id = delScdIds.value
+    } else {
+      id = route.query.id
     }
     const iedRes = await scdIedRelation({
-      scd_id:id,
+      scd_id: id,
       ied_name: item.ied_name,
       reset: 1,
     });
+    loading.value = false
     checkData.value = iedRes.data[item.ied_name];
   }
 };
@@ -261,58 +220,71 @@ const clickInoutNav = (item, index) => {
   inoutItemNavIndex.value = index;
 };
 </script>
-  <style scoped lang="scss">
+<style scoped lang="scss">
 @mixin mid-center {
   display: flex;
   align-items: center;
   justify-content: center;
 }
+
 $height: 40px;
+
 :deep(.el-dialog__header) {
   border-bottom: 1px solid #a3ade0;
 }
+
 .my-header {
   border-bottom: 1px solid #a3ade0;
   font-size: 16px;
   color: #1a2447;
+
   .title {
     padding-bottom: 15px;
   }
 }
+
 .main {
   display: flex;
 }
+
 :deep(.el-scrollbar) {
   --el-scrollbar-bg-color: #7484ab;
 }
+
 .main-left {
   width: 23%;
   background-color: #f7f8fb;
+
   .scrollbar-demo-item {
     cursor: pointer;
     width: 90%;
     margin-left: 5%;
     display: flex;
     padding: 4px 0;
+
     .ied-name {
       width: 25%;
     }
   }
 }
+
 .main-right {
   width: 75%;
   display: flex;
   flex-direction: column;
 }
+
 .main-right-item {
   margin-top: 20px;
   height: 72vh;
   overflow-y: auto;
 }
+
 //设置导航栏样式
 .nav {
   height: 40px;
   @include mid-center;
+
   .nav-item {
     width: 144px;
     height: $height;
@@ -322,21 +294,24 @@ $height: 40px;
     background: #fff url("~@/assets/image/instruct/navtop.png") no-repeat center;
     background-size: 144px $height;
   }
+
   .nav-item-active {
-    background: #fff url("~@/assets/image/instruct/navtop_active.png") no-repeat
-      center;
+    background: #fff url("~@/assets/image/instruct/navtop_active.png") no-repeat center;
     color: #fff;
     background-size: 144px $height;
   }
 }
+
 .left-item-active {
   color: #255ce7;
 }
+
 .inout {
   padding: 0 16px;
   border-right: 1px solid #7484ab;
   margin-top: 24px;
 }
+
 .inout-item {
   display: inline-block;
   width: 92px;
@@ -346,6 +321,7 @@ $height: 40px;
   color: #000;
   line-height: 26px;
 }
+
 .inout-item-active {
   background: #f6f9ff;
   border-radius: 2px 2px 2px 2px;
@@ -355,6 +331,7 @@ $height: 40px;
   color: #255ce7;
   border: 1px solid #255ce7;
 }
+
 .inout-right-item,
 .soures,
 .relatio {
@@ -362,9 +339,11 @@ $height: 40px;
   margin-left: 16px;
   height: 65vh;
 }
+
 .soures {
   height: 72vh;
 }
+
 .relatio {
   height: 65vh;
 }

+ 11 - 22
src/pages/netStructPicture/components/infoTable.vue

@@ -2,17 +2,10 @@
 <template>
   <div v-loading="loading">
     <div class="cont-table">
-      <el-table
-        :data="dingzhiData"
-        stripe
-        style="width: 100%"
-        :cell-style="{ color: '#000', cursor: 'pointer' }"
-        @row-click="svSendRowClick3"
-        :highlight-current-row="true"
-        ref="myTable5"
-      >
+      <el-table :data="dingzhiData" stripe style="width: 100%" :cell-style="{ color: '#000', cursor: 'pointer' }"
+        @row-click="svSendRowClick3" :highlight-current-row="true" ref="myTable5">
         <el-table-column type="index" label="序号" width="60" />
-        <el-table-column prop="accesspoint_name" label="访问点"/>
+        <el-table-column prop="accesspoint_name" label="访问点" />
         <el-table-column label="逻辑设备(lnst)" width="160">
           <template #default="scope">
             {{ `${scope.row.ld_desc}(${scope.row.ld_inst})` }}
@@ -35,15 +28,9 @@
       <div class="title">
         定值条目列表详情(共<span v-if="dingzhiDataChild">{{
           dingzhiDataChild.length
-        }}</span
-        >条)
+        }}</span>条)
       </div>
-      <el-table
-        :data="dingzhiDataChild"
-        style="width: 100%"
-        stripe
-        :cell-style="{ color: '#000' }"
-      >
+      <el-table :data="dingzhiDataChild" style="width: 100%" stripe :cell-style="{ color: '#000' }">
         <el-table-column type="index" label="序号" width="80" />
         <el-table-column prop="doi_desc" label="条目描述" />
         <el-table-column prop="da_datatype" label="数据类型" />
@@ -60,14 +47,14 @@ const route = useRoute();
 const props = defineProps({
   checkData: {
     type: Object,
-    default: () => {},
+    default: () => { },
   },
   isPhoto: {
     type: String,
     default: "",
   },
-  delScdId:{
-    type:String,
+  delScdId: {
+    type: String,
     default: '',
   }
 });
@@ -80,7 +67,7 @@ const getDingzhisList = async () => {
     scd_id: scdIdValue,
     ied_name: props.checkData.ied_name,
   });
-  loading.value= false;
+  loading.value = false;
   if (dingRes.data.length > 0) {
     dingzhiData.value = dingRes.data;
     dingzhiDataChild.value = dingRes.data[0].list;
@@ -117,9 +104,11 @@ onMounted(() => {
   flex-direction: column;
   justify-content: space-between;
 }
+
 :deep(.el-table) {
   flex-basis: 45%;
 }
+
 .title {
   margin: 16px;
   color: #51637f;

+ 49 - 10
src/pages/report/ReportVue.vue

@@ -2,20 +2,21 @@
     <div>
         <div class="bigBox">
             <div class="tableBox">
-                <el-table :data="reportList" style="width: 100%;height: calc(100vh - 240px);position: relative;" :stripe="true">
+                <el-table :data="reportList" style="width: 100%;height: calc(100vh - 240px);position: relative;"
+                    :stripe="true">
                     <el-table-column label="序号" width="auto">
                         <template #default="{ $index }">{{ $index + 1 }}</template>
                     </el-table-column>
                     <el-table-column prop="name" label="任务名称" width="auto" />
-                    <el-table-column prop="flash" label="变电站" width="auto" />
+                    <el-table-column prop="station_name" label="变电站" width="auto" />
                     <el-table-column prop="scd_name" label="SCD名称" width="auto" />
-                    <el-table-column prop="date" label="检测日期" width="auto" />
+                    <el-table-column prop="start_time" label="检测日期" width="auto" />
                     <el-table-column fixed="right" label="操作" width="auto">
                         <template #default="scope">
                             <el-button text type="primary" size="small" @click="lookReport(scope.row)"><el-icon>
                                     <View />
                                 </el-icon>查看</el-button>
-                            <el-button text type="primary" size="small"><el-icon>
+                            <el-button text type="primary" size="small" @click="downFile(scope.row)"><el-icon>
                                     <Download />
                                 </el-icon>报告下载</el-button>
                         </template>
@@ -24,7 +25,7 @@
             </div>
             <!-- 分页组件 -->
             <div class="pageBox">
-                <Pagination style="position: relative;" :total="reportList.length"></Pagination>
+                <Pagination style="position: relative;" :totals="totals" @pageBack="pageBack"></Pagination>
             </div>
         </div>
     </div>
@@ -34,6 +35,8 @@
 import { ref, onMounted, watch } from 'vue'
 import Pagination from './components/Pagination.vue'
 import report from "@/api/report"
+import task from '@/api/task'
+import system from "@/api/system"
 import { useRouter, useRoute } from "vue-router"
 import { ElMessage } from 'element-plus'
 export default {
@@ -42,12 +45,41 @@ export default {
         let router = useRouter()//路由跳转api
         let reportList = ref([
         ])//报告列表
+        let totals = ref(0)//总条数
         // 初始化组件
         function reload() {
-            report.allReport({ pageno: 1, pagesize: 20 }).then(res => {// 获取所有报告
+            // 2为完成检测
+            task.getTask({ pageno: 1, pagesize: 10, state: 2 }).then(res => {
+                if (res.data == null) {
+                    reportList.value = []
+                    return
+                } else {
+                    reportList.value = res.data
+                    totals.value = res.count
+                }
+            })
+        }
+        // 跳转到查看详情页面
+        function lookReport(row) {
+            console.log(row, 'rows');
+            // router.push('/home/report/details')
+            router.push({
+                path: "/home/report/details",
+                query: {
+                    reportId: row.id,
+                    scdId: row.scd_id,
+                    stationName: row.station_name,
+                    names: row.name
+                }
+            })
+        }
+        // 分页组件返回数据
+        function pageBack(size, index) {
+            report.allReport({ pageno: index - 0, pagesize: size - 0 }).then(res => {// 获取所有报告
                 // console.log(res, 'res');
                 if (res.data != null) {
                     reportList.value = res.data
+                    totals.value = res.data.length
                 } else {
                     ElMessage({
                         message: "暂无数据",
@@ -56,10 +88,14 @@ export default {
                 }
             })
         }
-        // 跳转到查看详情页面
-        function lookReport(row) {
-            console.log(row,'rows');
-            // router.push('/home/report/details')
+        // 下载报告
+        function downFile(row){
+            console.log(row,'row');
+            system.downLoad({
+                ids:row.report_id
+            }).then(res=>{
+                console.log(res,'down');
+            })
         }
         onMounted(() => {
             reload()
@@ -68,6 +104,9 @@ export default {
             reportList,//报告列表
             reload,//初始化组件
             lookReport,// 跳转到查看详情页面
+            totals,//总条数
+            pageBack,//分页组件返回数据
+            downFile,//下载报告
         }
     },
     components: {

+ 24 - 11
src/pages/report/components/Pagination.vue

@@ -1,33 +1,45 @@
 <template>
     <div style="position: relative;">
-        <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 30, 40]"
+        <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 30, 100]"
             :small="small" :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper"
             :total="realTotal" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
     </div>
 </template>
 
 <script>
-import { ref, onMounted } from 'vue';
+import { ref, onMounted,watch } from 'vue';
 export default {
     props: {
-        total: {
+        totals: {
             type: Number,
             required: true
         }
     },
     setup(props, { emit }) {
-        let realTotal = props.total
-        let currentPage = ref(1)
-        let pageSize = ref(10)
+        let realTotal = ref(0)//总条数
+        let currentPage = ref(1)//页码
+        let pageSize = ref(10)//条数
         let small = ref(false)
         let background = ref(false)
         let disabled = ref(false)
-        function handleSizeChange(val) {
-            console.log(`${val} items per page`)
+        watch(()=>props.totals,(newVal)=>{
+            realTotal.value = newVal
+        })
+        function handleSizeChange(val) {//条数
+            pageSize.value = val
+            emit("pageBack",pageSize.value,currentPage.value)
         }
-        function handleCurrentChange(val) {
-            console.log(`current page: ${val}`)
+        function handleCurrentChange(val) {//页码
+            currentPage.value = val
+            emit("pageBack",pageSize.value,currentPage.value)
         }
+        // 初始化组件
+        function reload(){
+            realTotal.value = props.totals
+        }
+        onMounted(()=>{
+            reload()
+        })
         return {
             currentPage,
             pageSize,
@@ -36,7 +48,8 @@ export default {
             disabled,
             handleSizeChange,
             handleCurrentChange,
-            realTotal,
+            realTotal,//总条数
+            reload,//初始化组件
         }
     }
 }

+ 319 - 8
src/pages/report/components/ReportDetails.vue

@@ -1,35 +1,346 @@
 <template>
-    <div>
-        <h1>4894655</h1>
+    <div class="bigBoxs">
+        <div class="topBox">
+            <div class="cilBox">
+                <p style="font-size: 18px;font-weight: 400;">{{ stationNames }}-{{ relathing }}</p>
+            </div>
+            <div class="createReport">
+                <img src="../../../assets/image/board_file.png" alt="">
+                <p>{{ btnType?'还未生成报告':"报告已生成" }}</p>
+                <el-button :type="btnType ? 'primary' : 'info'" plain @click="nowGet" :disabled="!btnType">立即生成</el-button>
+                <el-button :type="btnType ? 'info' : 'primary'" plain :disabled="btnType" @click="downReport">下载报告</el-button>
+            </div>
+        </div>
+        <div class="bottomBox" v-loading="loading">
+            <div class="miniBox">
+                <img style="width: 20px;height: 20px;display: block;margin-top: 10px;margin-left: 10px;"
+                    src="../../../assets/icon/file_blue.png" alt="">
+                <span style="
+                font-size: 16px;
+                font-family: Source Han Sans CN, Source Han Sans CN;
+                font-weight: 500;
+                color: #1A2447;
+                display: flex;
+                margin-top: 10px;
+                /* margin-left: 10px; */
+                ">检测结果</span>
+            </div>
+            <div class="messageBox">
+                <!-- 树形结构盒子 -->
+                <div class="treeBox">
+
+                </div>
+                <!-- 大表格盒子 -->
+                <div class="tableBox">
+                    <!-- 头部按钮和统计数据盒子 -->
+                    <div class="btnBox">
+                        <!-- 按钮盒子 -->
+                        <div class="btn">
+                            <el-button style="font-size: 16px;" type="primary" plain>
+                                <svg t="1705980404021" class="iconSvg" viewBox="0 0 1024 1024" version="1.1"
+                                    xmlns="http://www.w3.org/2000/svg" p-id="7825" width="48" height="48">
+                                    <path
+                                        d="M486.4 367.616l-89.344 86.016a25.6 25.6 0 1 1-35.584-36.864l131.84-128A25.6 25.6 0 0 1 512 281.6h2.816a25.6 25.6 0 0 1 16.128 7.68l123.392 128a25.6 25.6 0 1 1-36.864 35.584L537.6 370.688V614.4a25.6 25.6 0 0 1-51.2 0zM972.8 230.4v691.2a102.4 102.4 0 0 1-102.4 102.4H153.6a102.4 102.4 0 0 1-102.4-102.4V102.4a102.4 102.4 0 0 1 102.4-102.4h593.92z m-230.4-162.56V204.8a25.6 25.6 0 0 0 25.6 25.6h133.12zM921.6 281.6h-153.6a76.8 76.8 0 0 1-76.8-76.8V51.2H153.6a51.2 51.2 0 0 0-51.2 51.2v819.2a51.2 51.2 0 0 0 51.2 51.2h716.8a51.2 51.2 0 0 0 51.2-51.2zM358.4 768a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2z"
+                                        fill="#255be7" p-id="7826"></path>
+                                </svg>
+                                导出所有结果
+                            </el-button>
+                            <el-button style="font-size: 16px;" type="primary" plain>
+                                <svg t="1705980404021" class="iconSvg" viewBox="0 0 1024 1024" version="1.1"
+                                    xmlns="http://www.w3.org/2000/svg" p-id="7825" width="48" height="48">
+                                    <path
+                                        d="M486.4 367.616l-89.344 86.016a25.6 25.6 0 1 1-35.584-36.864l131.84-128A25.6 25.6 0 0 1 512 281.6h2.816a25.6 25.6 0 0 1 16.128 7.68l123.392 128a25.6 25.6 0 1 1-36.864 35.584L537.6 370.688V614.4a25.6 25.6 0 0 1-51.2 0zM972.8 230.4v691.2a102.4 102.4 0 0 1-102.4 102.4H153.6a102.4 102.4 0 0 1-102.4-102.4V102.4a102.4 102.4 0 0 1 102.4-102.4h593.92z m-230.4-162.56V204.8a25.6 25.6 0 0 0 25.6 25.6h133.12zM921.6 281.6h-153.6a76.8 76.8 0 0 1-76.8-76.8V51.2H153.6a51.2 51.2 0 0 0-51.2 51.2v819.2a51.2 51.2 0 0 0 51.2 51.2h716.8a51.2 51.2 0 0 0 51.2-51.2zM358.4 768a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2z"
+                                        fill="#255be7" p-id="7826"></path>
+                                </svg>
+                                导出当前节点结果
+                            </el-button>
+                        </div>
+                        <!-- 统计数据盒子 -->
+                        <div class="count">
+                            <span style="margin-right: 5px;font-size: 16px;font-weight: 400;">全部:
+                                <em>{{ Number(warnCount) + Number(dangerCount) + Number(infoCount) }}</em></span>
+                            <span style="margin-right: 5px;font-size: 16px;font-weight: 400;">错误:
+                                <em style="color: red;">{{ dangerCount }}</em></span>
+                            <span style="margin-right: 5px;font-size: 16px;font-weight: 400;">告警:
+                                <em style="color: orange;">{{ warnCount }}</em></span>
+                            <span style="font-size: 16px;font-weight: 400;">提示:
+                                <em style="color: blue;">{{ infoCount }}</em></span>
+                        </div>
+                    </div>
+                    <div class="realBox" style="position: relative;">
+                        <el-table :data="tableData" stripe
+                            style="width: 100%;height: calc(100vh - 410px);margin-top: 10px;">
+                            <el-table-column prop="ied_name" label="装置名称" width="180" />
+                            <el-table-column prop="ied_desc" label="装置描述" width="180" />
+                            <el-table-column label="等级" width="150">
+                                <template #default="scope">
+                                    <el-tag class="ml-2" :type="typeLevel(scope.row.alert_level)">{{
+                                        canLevel(scope.row.alert_level) }}</el-tag>
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="行号" width="150">
+                                <template #default="scope">
+                                    <span style="color: blue;border-bottom: 1px solid blue;cursor: pointer;">{{
+                                        scope.row.line_no }}</span>
+                                </template>
+                            </el-table-column>
+                            <el-table-column prop="parse_result" label="描述" width="auto" />
+                            <el-table-column label="标准及条款" width="150">
+                                <template #default="scope">
+                                    <p>{{ scope.row.apply_standard }}</p>
+                                    <p>{{ scope.row.apply_standard_no }}</p>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                        <Pagination style="position: absolute;" :totals="totals" @pageBack="pageBack"></Pagination>
+                    </div>
+                </div>
+            </div>
+        </div>
     </div>
 </template>
 
 <script>
 import { ref, watch, onMounted } from "vue"
-import { useRoute,useRouter } from "vue-router"
+import { useRoute, useRouter } from "vue-router"
 import report from "@/api/report"
+import slc from "@/api/slc/slc"
+import Pagination from "./Pagination.vue"
+import { ElMessage } from "element-plus"
+import system from "@/api/system"
 export default {
     setup() {
         let route = useRoute()
         let router = useRouter()
         let reportId = ref('')//报告id
+        let scdIds = ref("")//scdid
+        let tableData = ref([])//表格数据
+        let warnCount = ref(0)//告警总数
+        let dangerCount = ref(0)//错误总数
+        let infoCount = ref(0)//提示总数
+        let stationNames = ref("")//变电站名称
+        let relathing = ref('')//检测名称
+        let loading = ref(false)
+        let btnType = ref(true)//生成报告按钮和下载报告按钮状态
+        let fileId = ref("")//需要下载的报告id'
+        let totals = ref(0)
         // 初始化组件
-        function reload(){
-            console.log(route,'route')
-            report.genderReport({task_id:route.query.reportId-0}).then(res=>{
-                console.log(res,'ressss');
+        function reload() {
+            console.log(route, 'route')
+            stationNames.value = route.query.stationName
+            relathing.value = route.query.names
+            reportId.value = route.query.reportId
+            // report.genderReport({ task_id: route.query.reportId - 0 }).then(res => {
+            //     console.log(res, 'ressss');
+            // })
+            loading.value = true
+            slc.getScdByIdFromMission({
+                scd_id: route.query.scdId - 0,
+                pageno: 1,
+                pagesize: 20,
+            }).then(res => {//获取总数量
+                if (res.data != null) {
+                    console.log(res.data);
+                    tableData.value = res.data
+                    totals.value = res.count
+                    loading.value = false
+                } else {
+                    loading.value = false
+                }
+            })
+            slc.getErrorByLevel({
+                scd_id: route.query.scdId - 0
+            }).then(res => {//获取各个等级总数
+                if (res.data != null) {
+                    res.data.map(item => {
+                        if (item.alert_level == 'waring') {
+                            warnCount.value = item.cnt
+                        } else if (item.alert_level == 'error') {
+                            dangerCount.value = item.cnt
+                        } else if (item.alert_level == 'info') {
+                            infoCount.value = item.cnt
+                        }
+                    })
+                }
+            })
+            report.allReport({
+                pageno: 1,
+                pagesize: 20,
+                name: relathing.value
+            }).then(res => {
+                console.log(res, 'oisaghuih');
+            })
+        }
+        // 筛选等级
+        function canLevel(level) {
+            if (level == 'waring') {
+                return `告警`
+            } else if (level == 'error') {
+                return `错误`
+            } else if (level == 'info') {
+                return `提示`
+            }
+        }
+        // 筛选tag标签状态
+        function typeLevel(level) {
+            if (level == 'waring') {
+                return `warning`
+            } else if (level == 'error') {
+                return `danger`
+            } else if (level == 'info') {
+                return `info`
+            }
+        }
+        // 生成报告
+        function nowGet() {
+            report.genderReport({
+                task_id: reportId.value - 0
+            }).then(res => {
+                if (res.data != null) {
+                    fileId.value = res.data.TaskId
+                    btnType.value = false
+                    ElMessage({
+                        message: "生成报告成功",
+                        type: "success"
+                    })
+                }
+            })
+        }
+        // 下载报告
+        function downReport() {
+            system.downLoad({
+                ids: fileId.value - 0
+            }).then(res => {
+                console.log(res, '下载');
             })
         }
-        onMounted(()=>{
+        // 分页组件返回
+        function pageBack(size, index) {
+            loading.value = true
+            slc.getScdByIdFromMission({
+                scd_id: route.query.scdId - 0,
+                pageno: index,
+                pagesize: size,
+            }).then(res => {//获取总数量
+                if (res.data != null) {
+                    console.log(res.data);
+                    tableData.value = res.data
+                    totals.value = res.count
+                    loading.value = false
+                } else {
+                    loading.value = false
+                }
+            })
+        }
+        onMounted(() => {
             reload()
         })
         return {
             reload,//初始化组件
+            reportId,//报告id
+            tableData,//表格数据
+            scdIds,//scdid
+            canLevel,//筛选等级
+            typeLevel,//筛选tag标签状态
+            warnCount,//告警总数
+            dangerCount,//错误总数
+            infoCount,//提示总数
+            loading,//
+            stationNames,
+            relathing,
+            totals,//总条数
+            pageBack,
+            nowGet,//生成报告按钮
+            btnType,//按钮状态
+            fileId,//下载的报告id
+            downReport,//下载报告
         }
+    },
+    components: {
+        Pagination,
     }
 }
 </script>
 
 <style scoped>
+p {
+    margin: 0;
+    padding: 0;
+}
+
+em {
+    list-style: none;
+    font-style: normal;
+}
+
+.bigBoxs {
+    width: 98%;
+    height: calc(100vh - 90px);
+    margin: 0 auto;
+}
+
+.createReport {
+    width: 100%;
+    height: calc(100vh - 780px);
+    text-align: center;
+    line-height: 30px;
+    padding-top: 10px;
+    background: #F7F8FB;
+}
 
+.bottomBox {
+    width: 100%;
+    height: calc(100vh - 320px);
+    background-color: #F7F8FB;
+    margin-top: 20px;
+}
+
+.miniBox {
+    width: 100%;
+    height: auto;
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+}
+
+.messageBox {
+    width: 100%;
+    height: calc(100vh - 380px);
+    /* border: 1px solid saddlebrown; */
+    margin-top: 10px;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+}
+
+.treeBox {
+    width: 20%;
+    height: calc(100vh - 380px);
+    border: 1px solid #A3ADE0;
+}
+
+.tableBox {
+    width: 78%;
+    height: calc(100vh - 380px);
+}
+
+.btnBox {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+}
+
+.btn {
+    width: 30%;
+}
+
+.count {
+    width: 25%;
+}
+
+.iconSvg {
+    width: 20px;
+    height: 20px;
+}
 </style>

+ 5 - 4
src/pages/setting/components/SetLog.vue

@@ -203,6 +203,7 @@ export default {
                         message: res.msg,
                         type: "error"
                     })
+                    logList.value = []
                     loading.value = false
                 }
             })
@@ -220,6 +221,7 @@ export default {
                         message: res.msg,
                         type: "error"
                     })
+                    logList.value = []
                     loading.value = false
                 }
             })
@@ -237,6 +239,7 @@ export default {
                         message: res.msg,
                         type: "error"
                     })
+                    logList.value = []
                     loading.value = false
                 }
             })
@@ -254,6 +257,7 @@ export default {
                         message: res.msg,
                         type: "error"
                     })
+                    logList.value = []
                     loading.value = false
                 }
             })
@@ -274,10 +278,7 @@ export default {
                     logTotal.value = res.count
                     loading.value = false
                 } else {
-                    ElMessage({
-                        message: '未找到数据',
-                        type: "error"
-                    })
+                    logList.value = []
                     loading.value = false
                 }
             })

+ 3 - 3
src/pages/system/components/LineTree.vue

@@ -113,7 +113,7 @@ export default {
             // 模型管理       
             if (e.datatype === 'linkstyle') {
                 // 接线方式
-                litLine.getAllm({ pageno: 1, pagesize: 20, line_link_style: e.id }).then(res => {
+                litLine.getAllm({ pageno: 1, pagesize: 99999, line_link_style: e.id }).then(res => {
                     if (res.code == 0) {
                         loading.value = true
                         emit("lineBack", loading.value)
@@ -127,7 +127,7 @@ export default {
                 })
             } else {
                 // 电压等级
-                litLine.getAllm({ pageno: 1, pagesize: 20, vol_id: e.id }).then(res => {
+                litLine.getAllm({ pageno: 1, pagesize: 99999, vol_id: e.id }).then(res => {
                     if (res.code == 0) {
                         loading.value = true
                         emit("lineBack", loading.value)
@@ -143,7 +143,7 @@ export default {
         }
         function pClick(row, num) {
             selectIndex.value = num
-            litLine.getAllLine({ pageno: 1, pagesize: 10, vol_id: row.id - 0 }).then(res => {
+            litLine.getAllLine({ pageno: 1, pagesize: 99999, vol_id: row.id - 0 }).then(res => {
                 if (res.code == 0) {
                     pushList.value = res.data
                     emit("listBack", pushList.value, row.id)

+ 19 - 13
src/pages/system/components/SetModule.vue

@@ -5,12 +5,13 @@
                 <h2>模型管理</h2>
             </div>
             <div class="btnBox">
-                <el-button type="primary" plain @click="addNode"><el-icon>
+                <el-button type="primary" plain @click="addNode(0)"><el-icon>
                         <Plus />
                     </el-icon>添加模型</el-button>
             </div>
             <div class='tableBox'>
-                <el-table :data="tableData" style="width: 100%;height: calc(100vh - 240px);" :stripe="true" @selection-change="tableChange">
+                <el-table :data="tableData" style="width: 100%;height: calc(100vh - 240px);" :stripe="true"
+                    @selection-change="tableChange">
                     <el-table-column type="selection" width="55" />
                     <el-table-column prop="line_link_style_name" label="接线方式" width="auto" />
                     <el-table-column prop="model_name" label="模型名称" width="auto" />
@@ -18,7 +19,7 @@
                     <el-table-column prop="area_type_name" label="间隔类型" width="auto" />
                     <el-table-column fixed="right" label="操作" width="180">
                         <template #default="scope">
-                            <el-button link type="primary" size="small" @click="edit(scope.row)"><el-icon>
+                            <el-button link type="primary" size="small" @click="edit(scope.row, 1)"><el-icon>
                                     <EditPen />
                                 </el-icon>修改</el-button>
                             <el-button link type="primary" size="small" @click="goMap(scope.row)"><el-icon>
@@ -29,14 +30,15 @@
                 </el-table>
             </div>
             <div>
-                <AddNode v-if="nodeMos" :nodeMos="nodeMos" :goMap="goMap" :needRow="needRow" @addBack="addBack"></AddNode>
+                <AddNode v-if="nodeMos" :nodeMos="nodeMos" :goMap="goMap" :needRow="needRow" :modelType="modelType"
+                    @addBack="addBack"></AddNode>
             </div>
         </div>
     </div>
 </template>
 
 <script>
-import { ref, onMounted, toRefs,watch } from 'vue';
+import { ref, onMounted, toRefs, watch } from 'vue';
 import { ElMessage } from 'element-plus';
 import litLine from '@/api/litLine'
 import AddNode from '../modalComp/AddNode.vue';
@@ -50,8 +52,8 @@ export default {
             type: String,
             required: true
         },
-        volId:{
-            type:String,
+        volId: {
+            type: String,
             required: true
         }
     },
@@ -66,8 +68,9 @@ export default {
         let nodeMos = ref(false) // 添加间隔模态框
         let kisNum = ref(0)
         let needRow = ref({})
+        let modelType = ref(0)//0为新增1为修改
         // let { goMap } = toRefs(props)
-        watch(()=>props.fuckList,(newVal)=>{
+        watch(() => props.fuckList, (newVal) => {
             tableData.value = newVal
         })
         function ready() {
@@ -76,12 +79,14 @@ export default {
         function tableChange(e) {
             console.log(e, 'table');
         }
-        function addNode() {
+        function addNode(num) {
             needRow.value = {}
+            modelType.value = num
             nodeMos.value = true
         }
-        function edit(row) {
+        function edit(row, num) {
             needRow.value = row
+            modelType.value = num
             nodeMos.value = true
         }
         function goMap(row) {
@@ -94,13 +99,13 @@ export default {
                 })
             }
             needRow.value = row
-            emit("backNum", kisNum.value,row.model_name,needRow.value)
+            emit("backNum", kisNum.value, row.model_name, needRow.value)
         }
         function addBack(isshow) {
             nodeMos.value = false
             needRow.value = null
-            if(isshow){
-                litLine.getAllm({pageno: 1, pagesize: 20,line_link_style:props.linkstyleid,vol_id:props.volId||''}).then(res => {
+            if (isshow) {
+                litLine.getAllm({ pageno: 1, pagesize: 20, line_link_style: props.linkstyleid, vol_id: props.volId || '' }).then(res => {
                     tableData.value = res.data
                 })
             }
@@ -118,6 +123,7 @@ export default {
             addBack,
             needRow,
             edit,
+            modelType,//1为修改0为新增
         }
     },
     components: {

+ 72 - 36
src/pages/system/modalComp/AddNode.vue

@@ -61,7 +61,11 @@ export default {
         needRow: {
             type: Object,
             require: true
-        }
+        },
+        modelType: {
+            type: Number,
+            required: true
+        },//修改或新增,0新增,1修改
     },
     setup(props, { emit }) {
         let dialogVisible = ref(false)//模态框显示
@@ -83,21 +87,22 @@ export default {
             ],
             flashName: [
                 {
-                    required: true, message: '请选择电压等级', trigger: 'blur'
+                    required: true, message: '请选择电压等级', trigger: 'change'
                 }
             ],
             linkStyle: [
                 {
-                    required: true, message: '请选择接线方式', trigger: 'blur'
+                    required: true, message: '请选择接线方式', trigger: 'change'
                 }
             ],
             moduleId: [
                 {
-                    required: true, message: '请选择间隔类型', trigger: 'blur'
+                    required: true, message: '请选择间隔类型', trigger: 'change'
                 }
             ]
         })
         let ruleFormRef = ref(null)
+        let numType = ref(0)//0新增1修改
         watch(() => props.needRow, (newVal) => {
             coolRow.value = newVal
             ruleForm.value.name = coolRow.value.model_name || ''
@@ -107,10 +112,14 @@ export default {
             ruleForm.value.id = coolRow.value.id || 0
             dialogVisible.value = true
         })
+        watch(() => props.modelType, (newVal) => {
+            numType.value = newVal
+        })
         function lineList() {
             dialogVisible.value = result
         }
         function searchFlashLel() {
+            numType.value = props.modelType
             ruleForm.value.id = props.needRow.id || 0
             ruleForm.value.name = props.needRow.model_name || ''
             systemRow.getChildren({ code: "area_type" }).then(res => {
@@ -121,7 +130,7 @@ export default {
                 flashLel.value = res.data
                 ruleForm.value.flashName = props.needRow.vol_id
             })
-            litLine.getAllLine({ pageno: 1, pagesize: 100 }).then(res => {
+            litLine.getAllLine({ pageno: 1, pagesize: 99999 }).then(res => {
                 console.log(res, '接线方式');
                 moduleList.value = res.data
                 ruleForm.value.linkStyle = props.needRow.line_link_style
@@ -141,41 +150,67 @@ export default {
             emit("addBack", false)
         }
         function getSure() {
-            if (ruleForm.value.name == '' || ruleForm.value.flashName == '' || ruleForm.value.linkStyle == '' || ruleForm.value.moduleId == '') {
-                ruleFormRef.value.validate((valid) => {
-                    if (valid) {
-                        // 验证通过,执行相应操作
-                        console.log('验证通过');
-                    } else {
-                        // 验证不通过,执行相应操作
-                        console.log('验证不通过');
-                    }
-                });
-            } else {
-                cid.saveMap({
-                    id: ruleForm.value.id,
-                    model_name: ruleForm.value.name,
-                    vol_id: ruleForm.value.flashName - 0,
-                    line_link_style: ruleForm.value.linkStyle - 0,
-                    area_type: ruleForm.value.moduleId - 0,
-                }).then(res => {
-                    if (res.code == 0) {
-                        ElMessage({
-                            type: "success",
-                            message: "添加成功",
-                            duration: 2000
+            // if (ruleForm.value.name == '' || ruleForm.value.flashName == '' || ruleForm.value.linkStyle == '' || ruleForm.value.moduleId == '') {
+            ruleFormRef.value.validate((valid) => {
+                if (valid) {
+                    // 验证通过,执行相应操作
+                    if (numType.value == 0) {
+                        cid.saveMap({
+                            // id: ruleForm.value.id,
+                            model_name: ruleForm.value.name,
+                            vol_id: ruleForm.value.flashName - 0,
+                            line_link_style: ruleForm.value.linkStyle - 0,
+                            area_type: ruleForm.value.moduleId - 0,
+                        }).then(res => {
+                            if (res.code == 0) {
+                                ElMessage({
+                                    type: "success",
+                                    message: "新增成功",
+                                    duration: 2000
+                                })
+                                dialogVisible.value = false
+                                emit("addBack", true)
+                            } else {
+                                ElMessage({
+                                    type: "error",
+                                    message: res.msg,
+                                    duration: 2000
+                                })
+                            }
                         })
-                        dialogVisible.value = false
-                        emit("addBack", true)
                     } else {
-                        ElMessage({
-                            type: "error",
-                            message: res.msg,
-                            duration: 2000
+                        cid.saveMap({
+                            id: ruleForm.value.id,
+                            model_name: ruleForm.value.name,
+                            vol_id: ruleForm.value.flashName - 0,
+                            line_link_style: ruleForm.value.linkStyle - 0,
+                            area_type: ruleForm.value.moduleId - 0,
+                        }).then(res => {
+                            if (res.code == 0) {
+                                ElMessage({
+                                    type: "success",
+                                    message: "修改成功",
+                                    duration: 2000
+                                })
+                                dialogVisible.value = false
+                                emit("addBack", true)
+                            } else {
+                                ElMessage({
+                                    type: "error",
+                                    message: res.msg,
+                                    duration: 2000
+                                })
+                            }
                         })
                     }
-                })
-            }
+                } else {
+                    // 验证不通过,执行相应操作
+                    console.log('验证不通过');
+                }
+            });
+            // } else {
+
+            // }
         }
         onMounted(() => {
             lineList()
@@ -198,6 +233,7 @@ export default {
             flashCase,
             coolRow,
             ruleFormRef,//表单ref
+            numType,//0新增1修改
         }
     }
 }

+ 4 - 0
src/router/index.js

@@ -98,6 +98,10 @@ const router = createRouter({
     routes,
 })
 router.beforeEach((to, from, next) => {
+    console.log(to, from);
+    if (to.meta.name == null || to.meta.name == '' || to.meta.name == undefined) {
+        next("/401")
+    }
     // 假设您有一个名为 isAuthenticated 的全局变量来表示用户是否已登录
     let isAuthenticated = false; // 请替换为实际的登录状态判断逻辑
     let loginStatus = sessionStorage.getItem("loginStatus")