liyangzheng 1 年之前
父節點
當前提交
c26fde3e5b

二進制
src/assets/image/allright.png


+ 12 - 3
src/pages/mission/MissionVue.vue

@@ -9,7 +9,6 @@
                         color: item.isSelected ? 'white' : 'black',
                     }" @click="misChange(item, index)">{{ item.name }}</span>
                 </template>
-                <!-- <router-link to="/home/int">测试</router-link> -->
             </div>
             <!-- 功能盒子 -->
             <div class="settingBox">
@@ -17,8 +16,8 @@
                 <NoBox v-if="btnSelect == 0 && taskList.length == 0 && sizeNum == 0" :btnSelect="btnSelect"
                     :taskList="taskList" @backToMission="backToMission"></NoBox>
                 <!-- 有检测任务的盒子 -->
-                <HaveMis v-if="btnSelect == 0 && taskList.length != 0 && sizeNum == 0" @hmBack="hmBack" @haveBack="haveBack"
-                    @haveInCreate="haveInCreate"></HaveMis>
+                <HaveMis v-if="btnSelect == 0 && taskList.length != 0 && sizeNum == 0" @moreBack="moreBack" @hmBack="hmBack"
+                    @haveBack="haveBack" @haveInCreate="haveInCreate"></HaveMis>
                 <!-- 新建任务盒子 -->
                 <CreateNew v-if="btnSelect == 1" :btnSelect="btnSelect" :taskList="taskList" :editRow="editRow"
                     :status="status" @createBack="createBack">
@@ -127,6 +126,9 @@ export default {
         }
         function createBack(data) {
             btnSelect.value = data
+            btnList.value.forEach((tag) => {
+                tag.isSelected = tag.id === data + 1;
+            });
         }
         function haveBack(data) {
             if (data == null) {
@@ -135,10 +137,16 @@ export default {
                 taskList.value = data
             }
         }
+        function moreBack(data) {
+            btnSelect.value = data
+        }
         function haveInCreate(data, row, num) {
             btnSelect.value = data
             editRow.value = row
             status.value = num
+            btnList.value.forEach((tag) => {
+                tag.isSelected = tag.id === data + 1;
+            });
         }
         onMounted(() => {
             searchAllTask()
@@ -160,6 +168,7 @@ export default {
             haveInCreate,//havemis.vue返回的进入到创建任务vue
             editRow,//需要编辑的任务
             status,
+            moreBack,
         }
     },
     components: {

+ 48 - 26
src/pages/mission/components/CreateMis.vue

@@ -4,7 +4,7 @@
             <div>
                 <h1 style="font-size: 16px;font-weight: bolder;">{{ editAndAdd }}</h1>
             </div>
-            <div class="formBox">
+            <div class="formBox" v-loading="saveLoading">
                 <el-form ref="myForm" :inline="true" label-position="top" :model="newMission" class="demo-form-inline"
                     style="width: 1200px;margin: 0 auto;" :rules="missionRules" require-asterisk-position="right"
                     label-width="500px">
@@ -27,7 +27,7 @@
                     </el-form-item>
                     <el-form-item label="检测模型" prop="cmodel">
                         <el-input class="bestInput" style="width: 600px;" disabled placeholder="输入内容"
-                            v-model="cmodel"></el-input>
+                            v-model="newMission.cmodel"></el-input>
                         <el-button @click="modelOpen" style="height: 40px;margin-left: 5px;" type="primary" plain><el-icon>
                                 <Coin style="color: #449DFD;" />
                             </el-icon>选择模型</el-button>
@@ -45,16 +45,17 @@
                         <el-input style="width: 1136px;" v-model="newMission.misMes"></el-input>
                     </el-form-item>
                     <el-form-item label="SCD文件">
-                        <div style="width:100%;text-align: left;">{{ scdName }}</div>
+                        <!-- <div style="width:100%;text-align: left;">{{ scdName }}</div> -->
                         <el-upload ref="upload" class="upload-demo" :http-request="nowUpload" :limit="2"
                             element-loading-text="上传中..." element-loading-background="rgba(255, 255, 255, 0.8)"
                             :show-file-list="false">
                             <template #trigger>
                                 <el-button style="border-bottom: 1px solid #7BBAFD;width: calc(100vw - 1000px);"
-                                    type="primary" plain>选择SCD文件</el-button>
+                                    type="primary" plain>{{ scdName ? scdName : '选择SCD文件' }}</el-button>
                             </template>
                         </el-upload>
-                        <span style="margin-left: 10px;" v-loading="scdLoading">{{ scdLoading ? ' 正在进行SCD间隔装置分析' : ' SCD分析已完成' }}
+                        <span style="margin-left: 10px;" v-loading="scdLoading">{{ textIs ? scdLoading ? ' 正在进行SCD间隔装置分析' :
+                            ' SCD分析已完成' : '' }}
                         </span>
                     </el-form-item>
                 </el-form>
@@ -91,12 +92,13 @@
                             <span>装置列表——间隔:<em>{{ jg }}</em></span>
                             <span>检测模型:<em>{{ flashLevel ? flashLevel : '' }}</em></span>
                         </div>
-                        <div style="position: absolute;top: 0px;right: 0px;display: flex;justify-content: center;align-items: center;">
-                            
+                        <div
+                            style="position: absolute;top: 0px;right: 0px;display: flex;justify-content: center;align-items: center;">
+
                             <div style="margin: 0 10px;">
                                 <el-checkbox label="开启检测" size="large" />
                             </div>
-                           
+
                             <div style="margin: 5px;">
                                 <el-button type="primary" size="small" plain @click="checkTime">选择装置</el-button>
                             </div>
@@ -107,9 +109,8 @@
                             {{ item.ied_name }}
                         </div> -->
                         <el-tag v-for="(item, index) in mx" :key="item.ied_name" @click="tagClick(item, index)" size="large"
-                            :class="item.isChoose ? 'mx-2' : 'mx-1'" closable="true" effect="plain"
-                            @close="tagClose(item)">
-                            {{ '['+item.ied_name+']'+(item.attr_desc||'') }}
+                            :class="item.isChoose ? 'mx-2' : 'mx-1'" closable="true" effect="plain" @close="tagClose(item)">
+                            {{ '[' + item.ied_name + ']' + (item.attr_desc || '') }}
                         </el-tag>
                     </div>
                 </div>
@@ -122,7 +123,8 @@
         <!-- 模态框组件 -->
         <div>
             <LookScd v-if="scdLooks" :scdLooks="scdLooks" @nowBack="nowBack" @lookNum="lookNum"></LookScd>
-            <ModelTree v-if="treeMool" :treeMool="treeMool" :treeNeed="treeNeed" :checkedNodeNames="checkedNodeNames" @treeBack="treeBack" @treeNum="treeNum">
+            <ModelTree v-if="treeMool" :treeMool="treeMool" :treeNeed="treeNeed" :checkedNodeNames="checkedNodeNames"
+                @treeBack="treeBack" @treeNum="treeNum">
             </ModelTree>
             <FlashCreate v-if="fcModal" :fcModal="fcModal" @fcBack="fcBack"></FlashCreate>
             <CheckIed v-if="iedModal" :iedModal="iedModal" :loadScdId="loadScdId" @iedBack="iedBack"
@@ -142,7 +144,7 @@ import LookScd from '../modalComp/LookScd.vue';
 import ModelTree from '../modalComp/ModelTree.vue';
 import FlashCreate from '../modalComp/FlashCreate.vue';
 import CheckIed from '../modalComp/CheckIed.vue';
-import { ElMessage,ElMessageBox, ElLoading } from 'element-plus';
+import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
 export default {
     props: {
         btnSelect: {
@@ -173,7 +175,7 @@ export default {
             misMes: "",
             scdFolder: "",
             misId: "",
-            cmodel:"",
+            cmodel: "",
         })//创建任务提交表单
         let missionRules = ref({
             misName: [
@@ -226,7 +228,9 @@ export default {
         let states = ref(0)
         let flashLevel = ref("")
         const myForm = ref(null)//表单ref
+        let saveLoading = ref(false)
         let editAndAdd = ref("新建检测任务")
+        let textIs = ref(false)
         watch(() => props.editRow, (newVal) => {
             needEdit.value = newVal
         })
@@ -238,6 +242,7 @@ export default {
         function resetForm() {
             if (myForm.value) {
                 myForm.value.resetFields();
+                states.value = 1
             }
         };
         function reload() {
@@ -245,7 +250,6 @@ 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
@@ -262,14 +266,14 @@ export default {
                             let arr = res.data.models.map((item, index) => {
                                 return item.sys_model_id
                             })
-                            cmodel.value = modelnames.join(',')
+                            newMission.value.cmodel = modelnames.join(',')
                             mxId.value = arr
                             treeNeed.value = arr
                             checkedNodeNames.value = modelnames
                             loadScdId.value = res.data.scd_id
                             scdName.value = res.data.scd_info.scd_name
                             successScd.value = true
-                            scd.getLoadScd({ scd_id: res.data.scd_id*1 }).then(res => {
+                            scd.getLoadScd({ scd_id: res.data.scd_id * 1 }).then(res => {
                                 if (res.code == 0) {
                                     successScd.value = true
                                     anyData.value = res.data
@@ -338,6 +342,7 @@ export default {
         function saveMent() {//保存检测任务
             myForm.value.validate((val) => {
                 if (val) {
+                    saveLoading.value = true
                     task.createTask({
                         // id: newMission.value.misId - 0,
                         code: newMission.value.misNum,
@@ -354,14 +359,27 @@ export default {
                                 message: "创建成功",
                                 type: "success"
                             })
+                            saveLoading.value = false
                             // emit("createBack", 0)
                             scd.getLoadScd({ scd_id: loadScdId.value - 0 }).then(res => {
                                 if (res.code == 0) {
                                     successScd.value = true
                                     anyData.value = res.data
                                     console.log(anyData.value, 'any')
+                                } else {
+                                    ElMessage({
+                                        message: res.msg,
+                                        type: "error"
+                                    })
+
                                 }
                             })
+                        } else {
+                            ElMessage({
+                                message: res.msg,
+                                type: "error"
+                            })
+                            saveLoading.value = false
                         }
                     })
                 }
@@ -369,7 +387,7 @@ export default {
 
         }
         function nowUpload(e) {
-            if( scdLoading.value ){
+            if (scdLoading.value) {
                 return
             }
             const loading = ElLoading.service({
@@ -389,6 +407,7 @@ export default {
                     if (the.code == 0) {
                         loadScdId.value = the.data - 0
                         scdLoading.value = false
+                        textIs.value = true
                     }
                     // })
                 })
@@ -430,10 +449,10 @@ export default {
             })
         }
         function tagClose(row, num) {
-            ElMessageBox.confirm('确认从该间隔移除当前装置'+row.ied_name+'吗?','删除装置').then(() => {
+            ElMessageBox.confirm('确认从该间隔移除当前装置' + row.ied_name + '吗?', '删除装置').then(() => {
                 mx.value.splice(mx.value.indexOf(row), 1)
                 iedName.value = mx.value.map(item => item.ied_name).join(',');
-            }).catch(() => {})
+            }).catch(() => { })
         }
         function tagClick(row, num) {
             // 将所有对象的 isChoose 属性设置为 false
@@ -460,7 +479,7 @@ export default {
         }
         function treeNum(data, name) {
             mxId.value = data
-            cmodel.value = name.toString()
+            // cmodel.value = name.toString()
             newMission.value.cmodel = name.toString()
         }
         function lookNum(name, id) {
@@ -477,12 +496,12 @@ export default {
             iedModal.value = data
         }
         function iedArrBack(data) {
-            for(let i=0; i<data.length; i++){
-                let obj = mx.value.filter(item => item.ied_name==data[i].ied_name)
-                if( obj != null && obj.length > 0){
+            for (let i = 0; i < data.length; i++) {
+                let obj = mx.value.filter(item => item.ied_name == data[i].ied_name)
+                if (obj != null && obj.length > 0) {
                     ElMessage({
                         type: "info",
-                        message: data[i].ied_name+":该装置已存在!",
+                        message: data[i].ied_name + ":该装置已存在!",
                         duration: 3000,
                     })
                     return
@@ -558,6 +577,8 @@ export default {
             flashLevel,
             tagClick,//tag标签的点击事件
             editAndAdd,
+            textIs,
+            saveLoading,
         }
     },
     components: {
@@ -680,4 +701,5 @@ em {
 
 :deep(.el-icon svg) {
     /* color: red; */
-}</style>
+}
+</style>

+ 22 - 9
src/pages/mission/components/HaveMis.vue

@@ -82,11 +82,19 @@
 
       <!-- 已完成 -->
       <div class="noReportBox">
-        <div>
+        <div style="display: flex;justify-content: flex-start;align-items: center;">
           <p class="norep">最近检测任务-已完成</p>
+          <p style="display: flex;justify-content: flex-start;align-items: center;margin-left: 10px;cursor: pointer;">
+            <span style="display: block;color: #5090F1;" @click="moreMis">更多</span>
+            <svg style="width: 14px;height: 14px;display: block;" t="1706067807079" class="icon" viewBox="0 0 1024 1024" version="1.1"
+              xmlns="http://www.w3.org/2000/svg" p-id="4220" width="48" height="48">
+              <path
+                d="M160.117 212.026v-82.233a8 8 0 0 1 13.33-5.966l407.697 364.298c0.9 0.804 1.753 1.658 2.556 2.558 11.764 13.186 10.62 33.419-2.556 45.192L173.448 900.173a8 8 0 0 1-13.33-5.966v-82.233a16 16 0 0 1 5.338-11.93L487.814 512 165.456 223.957a16 16 0 0 1-5.339-11.931z m272.057 0v-82.233a8 8 0 0 1 13.33-5.966l407.697 364.298c0.9 0.804 1.753 1.658 2.556 2.558 11.764 13.186 10.62 33.419-2.556 45.192L445.505 900.173a8 8 0 0 1-13.33-5.966v-82.233a16 16 0 0 1 5.339-11.93L759.87 512 437.514 223.957a16 16 0 0 1-5.34-11.931z"
+                fill="#5090F1" p-id="4221"></path>
+            </svg>
+          </p>
         </div>
-        <div
-          style="display: flex;justify-content: flex-start;align-items: center;overflow-x: auto;width: calc(100vw - 100px);">
+        <div style="display: flex;justify-content: flex-start;align-items: center;">
           <div class="intBox" v-for="(item, index) in passList" @mouseover="intOvers(index)" @mouseout="intOuts(index)">
             <div class="intBoxOne">
               <p class="intOne">
@@ -203,14 +211,14 @@ export default {
     }
     // 生成报告和跳转页面
     function outcome(row, num) {
-      console.log(row,'rou');
+      console.log(row, 'rou');
       router.push({
         path: "/home/report/details",
         query: {
           reportId: row.id,
-          scdId:row.scd_id,
-          stationName:row.station_name,
-          names:row.name
+          scdId: row.scd_id,
+          stationName: row.station_name,
+          names: row.name
         }
       })
     }
@@ -243,7 +251,7 @@ export default {
         }
       })
       // 2为完成检测
-      task.getTask({ pageno: 1, pagesize: 10, state: 2 }).then(res => {
+      task.getTask({ pageno: 1, pagesize: 6, state: 2 }).then(res => {
         if (res.data == null) {
           passList.value = []
           return
@@ -273,6 +281,9 @@ export default {
         return "intBox"
       }
     }
+    function moreMis(){
+      emit("moreBack",2)
+    }
     function relison(e) {
       currEditTaskModels.value = e
     }
@@ -323,6 +334,7 @@ export default {
       isIndexs,
       relison,//开始检测后选择模型change事件
       outcome,//生成报告和跳转yemian
+      moreMis,
     };
   },
   components: {
@@ -499,4 +511,5 @@ p {
 
 :deep(.el-loading-spinner .path) {
   stroke: #ffffff;
-}</style>
+}
+</style>

+ 16 - 1
src/pages/mission/components/HistoryMis.vue

@@ -132,7 +132,22 @@ export default {
             delModal.value = true
         }
         function relady(row) {
-            console.log(row, 'riw');
+            task.reladyTask({
+                id:row.id
+            }).then(res=>{
+                if(res.code ==0){
+                    ElMessage({
+                        message:"任务已重置,请前往当前检测任务查看!",
+                        type:"success"
+                    })
+                    reload()
+                }else{
+                    ElMessage({
+                        message:res.msg,
+                        type:"error"
+                    })
+                }
+            })
         }
         function sureDelMis() {
 

+ 1 - 1
src/pages/netStructPicture/components/dialogIndex.vue

@@ -2,7 +2,7 @@
 <template>
   <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="my-header" :style="{ minHeight: checkData ? 'auto' : '36px' }">
         <div class="title" v-if="checkData">
           {{ `${checkData.desc}(${checkData.ied_name}) — 详细信息` }}
         </div>

+ 21 - 10
src/pages/report/components/ReportDetails.vue

@@ -5,8 +5,9 @@
                 <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>
+                <img v-if="btnType" src="../../../assets/image/board_file.png" alt="">
+                <img v-else src="../../../assets/image/allright.png" alt="">
+                <p style="font-size: 14px;font-weight: 400;">{{ 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>
@@ -27,16 +28,16 @@
             </div>
             <div class="messageBox">
                 <!-- 树形结构盒子 -->
-                <div class="treeBox">
+                <!-- <div class="treeBox">
 
-                </div>
+                </div> -->
                 <!-- 大表格盒子 -->
                 <div class="tableBox">
                     <!-- 头部按钮和统计数据盒子 -->
                     <div class="btnBox">
                         <!-- 按钮盒子 -->
                         <div class="btn">
-                            <el-button style="font-size: 16px;" type="primary" plain>
+                            <el-button style="font-size: 16px;" type="primary" plain @click="excelPort">
                                 <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
@@ -45,7 +46,7 @@
                                 </svg>
                                 导出所有结果
                             </el-button>
-                            <el-button style="font-size: 16px;" type="primary" plain>
+                            <!-- <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
@@ -53,7 +54,7 @@
                                         fill="#255be7" p-id="7826"></path>
                                 </svg>
                                 导出当前节点结果
-                            </el-button>
+                            </el-button> -->
                         </div>
                         <!-- 统计数据盒子 -->
                         <div class="count">
@@ -69,7 +70,7 @@
                     </div>
                     <div class="realBox" style="position: relative;">
                         <el-table :data="tableData" stripe
-                            style="width: 100%;height: calc(100vh - 410px);margin-top: 10px;">
+                            style="width: 100%;height: calc(100vh - 420px);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">
@@ -92,7 +93,7 @@
                                 </template>
                             </el-table-column>
                         </el-table>
-                        <Pagination style="position: absolute;" :totals="totals" @pageBack="pageBack"></Pagination>
+                        <Pagination style="position: absolute;right: 10px;" :totals="totals" @pageBack="pageBack"></Pagination>
                     </div>
                 </div>
             </div>
@@ -105,6 +106,7 @@ import { ref, watch, onMounted } from "vue"
 import { useRoute, useRouter } from "vue-router"
 import report from "@/api/report"
 import slc from "@/api/slc/slc"
+import systemRow from "@/api/systemRow"
 import Pagination from "./Pagination.vue"
 import { ElMessage } from "element-plus"
 import system from "@/api/system"
@@ -214,6 +216,14 @@ export default {
                 console.log(res, '下载');
             })
         }
+        // 导出结果至excel
+        function excelPort(){
+            systemRow.portExcel({
+                code:"scl-check-result",
+            }).then(res=>{
+                console.log(res,'导出');
+            })
+        }
         // 分页组件返回
         function pageBack(size, index) {
             loading.value = true
@@ -254,6 +264,7 @@ export default {
             btnType,//按钮状态
             fileId,//下载的报告id
             downReport,//下载报告
+            excelPort,
         }
     },
     components: {
@@ -320,7 +331,7 @@ em {
 }
 
 .tableBox {
-    width: 78%;
+    width: 100%;
     height: calc(100vh - 380px);
 }
 

+ 18 - 28
src/pages/setting/components/SetLog.vue

@@ -150,10 +150,13 @@ export default {
                         logTotal.value = res.count
                         loading.value = false
                     } else {
-                        ElMessage({
-                            message: res.msg,
-                            type: "error"
-                        })
+                        logList.value = []
+                        logTotal.value = 0
+                        loading.value = false
+                        // ElMessage({
+                        //     message: res.msg,
+                        //     type: "error"
+                        // })
                     }
                 })
             } else {
@@ -164,10 +167,9 @@ export default {
                         logTotal.value = res.count
                         loading.value = false
                     } else {
-                        ElMessage({
-                            message: res.msg,
-                            type: "error"
-                        })
+                        logList.value = []
+                        logTotal.value = 0
+                        loading.value = false
                     }
                 })
             }
@@ -199,12 +201,9 @@ export default {
                     logTotal.value = res.count
                     loading.value = false
                 } else {
-                    ElMessage({
-                        message: res.msg,
-                        type: "error"
-                    })
                     logList.value = []
-                    loading.value = false
+                        logTotal.value = 0
+                        loading.value = false
                 }
             })
         }
@@ -217,12 +216,9 @@ export default {
                     logTotal.value = res.count
                     loading.value = false
                 } else {
-                    ElMessage({
-                        message: res.msg,
-                        type: "error"
-                    })
                     logList.value = []
-                    loading.value = false
+                        logTotal.value = 0
+                        loading.value = false
                 }
             })
         }
@@ -235,12 +231,9 @@ export default {
                     logTotal.value = res.count
                     loading.value = false
                 } else {
-                    ElMessage({
-                        message: res.msg,
-                        type: "error"
-                    })
                     logList.value = []
-                    loading.value = false
+                        logTotal.value = 0
+                        loading.value = false
                 }
             })
         }
@@ -253,12 +246,9 @@ export default {
                     logTotal.value = res.count
                     loading.value = false
                 } else {
-                    ElMessage({
-                        message: res.msg,
-                        type: "error"
-                    })
                     logList.value = []
-                    loading.value = false
+                        logTotal.value = 0
+                        loading.value = false
                 }
             })
         }

+ 22 - 8
src/pages/system/SystemPage.vue

@@ -14,7 +14,8 @@
             <div class="setBox">
                 <!-- 公共组件box -->
                 <div class="traBox" v-if="selectIndex == 0 || ourNum == 0">
-                    <LineTree @listBack="listBack" @volBack="volBack" @lineBack="lineBack" :selectIndex="selectIndex">
+                    <LineTree @listBack="listBack" @volBack="volBack" @lineBack="lineBack" :moduleSize="moduleSize"
+                        :moduleIndex="moduleIndex" :selectIndex="selectIndex">
                     </LineTree>
                     <!--<ModuleTree v-if="selectIndex == 1 && ourNum == 1"  @mtBack="mtBack"></ModuleTree>-->
                 </div>
@@ -24,7 +25,7 @@
                     <InsideModule v-if="selectIndex == 1 && ourNum == 1" :tfType="tfType" :insideNeed="insideNeed"
                         :lineId="lineId" :setName="setName" :setId="setId" @closeDraw="closeDraw"></InsideModule>
                     <SetModule v-if="selectIndex == 1 && ourNum == 0" @backNum="backNum" :linkstyleid="lineId"
-                        :volId="volId" :fuckList="fuckList"></SetModule>
+                        :volId="volId" :fuckList="fuckList" :moduleTotal="moduleTotal" @pageCase="pageCase"></SetModule>
                 </div>
             </div>
         </div>
@@ -70,6 +71,9 @@ export default {
         let setName = ref('')//setmodule返回name
         let setId = ref('')
         let loading = ref(false)//加载动画
+        let moduleTotal = ref(0)//模型总数
+        let moduleIndex = ref(0)
+        let moduleSize = ref(10)
         function tagChange(row, num) {//标签切换
             selectIndex.value = num
             if (num == 1) {
@@ -86,11 +90,13 @@ export default {
                 lineId.value = id
             }, 1000)
         }
-        function volBack(data, id) {
-            setTimeout(() => {
-                fuckList.value = data
-                volId.value = id
-            }, 1000)
+        function volBack(data, id, num) {
+            // setTimeout(() => {
+            fuckList.value = data
+            volId.value = id
+            moduleTotal.value = num
+            console.log(moduleTotal.value, 'systempage');
+            // }, 1000)
         }
         function backNum(data, name, row) {
             ourNum.value = data
@@ -111,8 +117,12 @@ export default {
                 loading.value = false
             }, 1500)
         }
+        function pageCase(no, index) {
+            moduleSize.value = no
+            moduleIndex.value = index
+        }
         onMounted(() => {
-            if(route.query.isNow == "1"){
+            if (route.query.isNow == "1") {
                 selectIndex.value = 1
                 ourNum.value = 1
             }
@@ -136,6 +146,10 @@ export default {
             setId,
             loading,//加载动画
             lineBack,//lineTree.vue返回加载状态
+            moduleTotal,//模型总数
+            pageCase,
+            moduleIndex,
+            moduleSize,
         }
     },
     components: {

+ 61 - 12
src/pages/system/components/LineTree.vue

@@ -43,6 +43,14 @@ export default {
         selectIndex: {
             type: Number,
             required: true
+        },
+        moduleSize: {
+            type: Number,
+            required: true
+        },
+        moduleIndex: {
+            type: Number,
+            required: true
         }
     },
     setup(props, { emit }) {
@@ -58,16 +66,51 @@ export default {
         let selectIndex = ref(null)
         let vif = ref(true)
         let loading = ref(false)
+        let counts = ref(0)//总条数
+        let size = ref(0)
+        let index = ref(10)
+        let intE = ref("")
         watch(() => props.selectIndex, (newVal) => {
             result.value = newVal
             searchFlashLel()
         })
+        watch(() => props.moduleIndex, (newVal) => {
+            size.value = newVal
+            litLine.getAllm({ pageno: index.value, pagesize: size.value, vol_id: intE.value - 0 }).then(res => {
+                if (res.code == 0) {
+                    loading.value = true
+                    counts.value = res.count
+                    console.log(counts.value, 'linetree');
+                    emit("lineBack", loading.value)
+                    emit("volBack", res.data, intE.value - 0, counts.value)
+                } else {
+                    ElMessage({
+                        message: res.msg,
+                        type: "error"
+                    })
+                }
+            })
+        })
+        watch(() => props.moduleSize, (newVal) => {
+            index.value = newVal
+            litLine.getAllm({ pageno: index.value, pagesize: size.value, vol_id: intE.value - 0 }).then(res => {
+                if (res.code == 0) {
+                    loading.value = true
+                    counts.value = res.count
+                    console.log(counts.value, 'linetree');
+                    emit("lineBack", loading.value)
+                    emit("volBack", res.data, intE.value - 0, counts.value)
+                } else {
+                    ElMessage({
+                        message: res.msg,
+                        type: "error"
+                    })
+                }
+            })
+        })
         function searchLine() {
-            if (props.selectIndex == 0) {
-                litLine.getLineModel({ pageno: 1, pagesize: 99999 }).then(res => {
-                    // console.log(res, '987res');
-                })
-            }
+            size.value = props.moduleIndex
+            index.value = props.moduleSize
         }
         function searchFlashLel() {//拿到电压等级
             systemRow.getChildren({ code: "voltage_level" }).then(res => {
@@ -75,7 +118,7 @@ export default {
                 if (props.selectIndex == 1) {
                     vif.value = false
                     // 获取每个电压等级下的接线方式
-                    litLine.getAllLine({ pageno: 1, pagesize: 99999 }).then(res2 => {
+                    litLine.getAllLine({ pageno: 1, pagesize: 20 }).then(res2 => {
                         for (let i = 0; i < res2.data.length; i++) {
                             const vol_level_id = res2.data[i].vol_level_id
                             res.data.filter((item) => {
@@ -94,8 +137,7 @@ export default {
             })
         }
         function handleNodeClick(e) {
-            litLine.getAllLine({ pageno: 1, pagesize: 99999, vol_id: e.id - 0 }).then(res => {
-                // console.log(res, 'asdasdasd');
+            litLine.getAllLine({ pageno: 1, pagesize: 20, vol_id: e.id - 0 }).then(res => {
                 if (res.code == 0) {
                     loading.value = true
                     emit("lineBack", loading.value)
@@ -113,7 +155,7 @@ export default {
             // 模型管理       
             if (e.datatype === 'linkstyle') {
                 // 接线方式
-                litLine.getAllm({ pageno: 1, pagesize: 99999, line_link_style: e.id }).then(res => {
+                litLine.getAllm({ pageno: 1, pagesize: 20, line_link_style: e.id }).then(res => {
                     if (res.code == 0) {
                         loading.value = true
                         emit("lineBack", loading.value)
@@ -127,11 +169,14 @@ export default {
                 })
             } else {
                 // 电压等级
-                litLine.getAllm({ pageno: 1, pagesize: 99999, vol_id: e.id }).then(res => {
+                intE.value = e.id
+                litLine.getAllm({ pageno: 1, pagesize: 20, vol_id: intE.value - 0 }).then(res => {
                     if (res.code == 0) {
                         loading.value = true
+                        counts.value = res.count
+                        console.log(counts.value, 'linetree');
                         emit("lineBack", loading.value)
-                        emit("volBack", res.data, e.id)
+                        emit("volBack", res.data, e.id, counts.value)
                     } else {
                         ElMessage({
                             message: res.msg,
@@ -143,7 +188,7 @@ export default {
         }
         function pClick(row, num) {
             selectIndex.value = num
-            litLine.getAllLine({ pageno: 1, pagesize: 99999, vol_id: row.id - 0 }).then(res => {
+            litLine.getAllLine({ pageno: 1, pagesize: 20, vol_id: row.id - 0 }).then(res => {
                 if (res.code == 0) {
                     pushList.value = res.data
                     emit("listBack", pushList.value, row.id)
@@ -168,6 +213,10 @@ export default {
             pClick,
             vif,
             loading,
+            counts,//总条数
+            size,
+            index,
+            intE,
         }
     },
     components: {

+ 27 - 5
src/pages/system/components/LitLine.vue

@@ -11,8 +11,8 @@
                     </el-icon>添加新接线方式</el-button>
             </div>
             <div>
-                <el-table ref="multipleTableRef" :stripe="true" :data="lineList" style="width: 100%;height: calc(100vh - 240px);"
-                    @selection-change="handleSelectionChange">
+                <el-table ref="multipleTableRef" :stripe="true" :data="lineList"
+                    style="width: 100%;height: calc(100vh - 300px);" @selection-change="handleSelectionChange">
                     <el-table-column type="selection" width="55" />
                     <el-table-column label="编号" prop="id" width="auto">
                         <!-- <template #default="scope">{{ scope.row.cr }}</template> -->
@@ -40,6 +40,7 @@
                         </template>
                     </el-table-column>
                 </el-table>
+                <Pagination :totals="totals" @pageBack="pageBack"></Pagination>
             </div>
             <div>
                 <AddLine v-if="alModal" :alModal="alModal" :search="search" @alBack="alBack"></AddLine>
@@ -60,7 +61,7 @@ import AddLine from '../modalComp/AddLine.vue';
 import LookLine from '../modalComp/LookLine.vue';
 import DelLine from '../modalComp/DelLine.vue';
 import PicLook from '../modalComp/PicLook.vue';
-import { fn } from 'moment';
+import Pagination from './Pagination.vue';
 export default {
     props: {
         fuckList: {
@@ -77,12 +78,19 @@ export default {
         let delModal = ref(false)
         let picModal = ref(false)
         let listNum = ref(0)//0为查看,1为编辑
+        let totals = ref(0)//总条数
         watch(() => props.fuckList, (newVal) => {
             lineList.value = newVal
         })
         function search() {
-            litLine.getAllLine({ pageno: 1, pagesize: 999999 }).then(res => {
-                lineList.value = res.data
+            litLine.getAllLine({ pageno: 1, pagesize: 10 }).then(res => {
+                if (res.data != null) {
+                    lineList.value = res.data
+                    totals.value = res.count
+                } else {
+                    lineList.value = []
+                    totals.value = 0
+                }
             })
         }
         function handleSelectionChange(val) {
@@ -124,6 +132,17 @@ export default {
         function picBack(data) {
             picModal.value = data
         }
+        function pageBack(no, index) {
+            litLine.getAllLine({ pageno: no - 0, pagesize: index - 0 }).then(res => {
+                if (res.data != null) {
+                    lineList.value = res.data
+                    totals.value = res.count
+                } else {
+                    lineList.value = []
+                    totals.value = 0
+                }
+            })
+        }
         // watch(() => props.fuckList, (newVal) => {
         //     lineList.value = newVal
         // });
@@ -151,6 +170,8 @@ export default {
             picModal,
             lookPic,
             picBack,
+            totals,//总条数
+            pageBack,//Pagination.vue返回数据
         }
     },
     components: {
@@ -158,6 +179,7 @@ export default {
         LookLine,
         DelLine,
         PicLook,
+        Pagination,
     }
 }
 </script>

+ 57 - 0
src/pages/system/components/Pagination.vue

@@ -0,0 +1,57 @@
+<template>
+    <div>
+        <el-pagination v-model:current-page="page" v-model:page-size="size" :page-sizes="[10, 20, 30, 100]"
+            :small="small" :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper"
+            :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
+    </div>
+</template>
+
+<script>
+import { ref, onMounted, watch } from 'vue'
+export default {
+    props:{
+        totals:{
+            type:Number,
+            required:true,
+        },//总条数
+    },
+    setup(props,{emit}) {
+        let page = ref(1)//页码
+        let size = ref(10)//页数
+        let total = ref(0)//总数
+        let disabled = ref(false)
+        let background = ref(false)
+        watch(()=>props.totals,(newVal)=>{
+            total.value = newVal
+            console.log(total.value,'paginationwatch');
+        })
+        function reload(){
+            total.value = props.totals
+            console.log(total.value,'pagination');
+        }
+        function handleCurrentChange(e){
+            page.value = e
+            emit("pageBack",page.value,size.value)
+        }
+        function handleSizeChange(e){
+            size.value = e
+            emit("pageBack",page.value,size.value)
+        }
+        onMounted(()=>{
+            reload()
+        })
+        return {
+            page,
+            size,
+            total,
+            disabled,
+            background,
+            handleCurrentChange,
+            handleSizeChange,
+            reload,//初始化组件
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 22 - 3
src/pages/system/components/SetModule.vue

@@ -2,7 +2,7 @@
     <div>
         <div class="bigBox">
             <div style="text-align: center;">
-                <h2>模型管理</h2>
+                <h2 style="font-size: 18px;font-weight:bolder;">模型管理</h2>
             </div>
             <div class="btnBox">
                 <el-button type="primary" plain @click="addNode(0)"><el-icon>
@@ -10,7 +10,7 @@
                     </el-icon>添加模型</el-button>
             </div>
             <div class='tableBox'>
-                <el-table :data="tableData" style="width: 100%;height: calc(100vh - 240px);" :stripe="true"
+                <el-table :data="tableData" style="width: 100%;height: calc(100vh - 300px);" :stripe="true"
                     @selection-change="tableChange">
                     <el-table-column type="selection" width="55" />
                     <el-table-column prop="line_link_style_name" label="接线方式" width="auto" />
@@ -29,6 +29,7 @@
                     </el-table-column>
                 </el-table>
             </div>
+            <Pagination :totals="totals" @pageBack="pageBack"></Pagination>
             <div>
                 <AddNode v-if="nodeMos" :nodeMos="nodeMos" :goMap="goMap" :needRow="needRow" :modelType="modelType"
                     @addBack="addBack"></AddNode>
@@ -42,6 +43,7 @@ import { ref, onMounted, toRefs, watch } from 'vue';
 import { ElMessage } from 'element-plus';
 import litLine from '@/api/litLine'
 import AddNode from '../modalComp/AddNode.vue';
+import Pagination from './Pagination.vue';
 export default {
     props: {
         fuckList: {
@@ -55,7 +57,11 @@ export default {
         volId: {
             type: String,
             required: true
-        }
+        },
+        moduleTotal: {
+            type: Number,
+            required: true,
+        },//总条数
     },
     setup(props, { emit }) {
         let tableData = ref([
@@ -69,12 +75,19 @@ export default {
         let kisNum = ref(0)
         let needRow = ref({})
         let modelType = ref(0)//0为新增1为修改
+        let totals = ref(0)
         // let { goMap } = toRefs(props)
         watch(() => props.fuckList, (newVal) => {
             tableData.value = newVal
         })
+        watch(() => props.moduleTotal, (newVal) => {
+            totals.value = newVal
+            console.log(totals.value, 'setmodulewatch');
+        })
         function ready() {
             tableData.value = props.fuckList
+            totals.value = props.moduleTotal
+            console.log(totals.value, 'setmoduleready');
         }
         function tableChange(e) {
             console.log(e, 'table');
@@ -110,6 +123,9 @@ export default {
                 })
             }
         }
+        function pageBack(no, index) {
+            emit("pageCase", no, index)
+        }
         onMounted(() => {
             ready()
         })
@@ -124,10 +140,13 @@ export default {
             needRow,
             edit,
             modelType,//1为修改0为新增
+            totals,//总条数
+            pageBack,//Pagination.vue返回数据
         }
     },
     components: {
         AddNode,
+        Pagination,
     }
 }
 </script>

+ 6 - 4
src/pages/system/modalComp/AddNode.vue

@@ -117,6 +117,9 @@ export default {
         })
         function lineList() {
             dialogVisible.value = result
+            ruleForm.value.moduleId = props.needRow.area_type
+            ruleForm.value.flashName = props.needRow.vol_id
+            ruleForm.value.linkStyle = props.needRow.line_link_style
         }
         function searchFlashLel() {
             numType.value = props.modelType
@@ -124,16 +127,15 @@ export default {
             ruleForm.value.name = props.needRow.model_name || ''
             systemRow.getChildren({ code: "area_type" }).then(res => {
                 selectList.value = res.data
-                ruleForm.value.moduleId = props.needRow.area_type
+               
             })
             systemRow.getChildren({ code: "voltage_level" }).then(res => {
                 flashLel.value = res.data
-                ruleForm.value.flashName = props.needRow.vol_id
+                
             })
             litLine.getAllLine({ pageno: 1, pagesize: 99999 }).then(res => {
-                console.log(res, '接线方式');
                 moduleList.value = res.data
-                ruleForm.value.linkStyle = props.needRow.line_link_style
+                
             })
         }
         function flashChange(e) {

+ 1 - 1
src/router/index.js

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