liyangzheng 1 year ago
parent
commit
7a888c5d41

+ 70 - 44
src/pages/components/draw/DrawDesigns.vue

@@ -124,26 +124,26 @@ export default {
             coolName.value = newVal
         })
         watch(() => props.coolObj, (newVal) => {
-            setTimeout(() => {
-                loading.value = true
-                copyObj.value = newVal
-                modelId.value = copyObj.value.id
-                cid.getModelInfo({ id: copyObj.value.id, pageno: 1, pagesize: 20 }).then(res => {
-                    if (res.data[0].relation_json == null || res.data[0].relation_json == '') return;
-                    const origiondata = JSON.parse(res.data[0].relation_json)
-                    lf.value.render(origiondata);
-                    loading.value = false
-                    console.log('watchRender');
-                    for (let index = 0; index < origiondata.edges.length; index++) {
-                        const element = origiondata.edges[index];
-                        if (element.properties != null && element.properties["issv"] === 'SV') {
-                            let lineStyle = lf.value.getEdgeModelById(element.id)//.getEdgeStyle();
-                            // console.log(lineStyle)
-                            lineStyle.setProperties({ svEdge: { stroke: 'orange' } })
-                        }
+            // setTimeout(() => {
+            loading.value = true
+            copyObj.value = newVal
+            modelId.value = copyObj.value.id
+            cid.getModelInfo({ id: copyObj.value.id, pageno: 1, pagesize: 20 }).then(res => {
+                if (res.data[0].relation_json == null || res.data[0].relation_json == '') return;
+                const origiondata = JSON.parse(res.data[0].relation_json)
+                lf.value.render(origiondata);
+                loading.value = false
+                console.log('调用了coolobg的watch');
+                for (let index = 0; index < origiondata.edges.length; index++) {
+                    const element = origiondata.edges[index];
+                    if (element.properties != null && element.properties["issv"] === 'SV') {
+                        let lineStyle = lf.value.getEdgeModelById(element.id)//.getEdgeStyle();
+                        // console.log(lineStyle)
+                        lineStyle.setProperties({ svEdge: { stroke: 'orange' } })
                     }
-                }, { immediate: true })
-            }, 3000);
+                }
+            }, { immediate: true })
+            // }, 3000);
         })
         watch(() => props.svOrGoose, (newVal) => {
             numCase.value = newVal
@@ -177,25 +177,47 @@ export default {
             console.log(JSON.stringify(lf.value.getGraphData()))
             const xml = lfJson2Xml(lf.value.getGraphData());
             const data = JSON.stringify(lf.value.getGraphData())
-            cid.saveMap(
-                {
-                    id: copyObj.value.id - 0 || modelId.value - 0,
-                    //model_name: coolName.value,
-                    //vol_id: coolObj.value.id - 0,
-                    //line_link_style: coolId.value - 0,
-                    relation_json: data,
-                    //area_type: "116329",
-                }
-            ).then(res => {
-                if (res.code == 0) {
-                    ElMessage({
-                        type: "success",
-                        message: "保存成功!",
-                        duration: 2000,
-                    })
-                    // window.location.reload()
-                }
-            })
+            if (modelId.value != undefined && modelId.value != null && modelId.value != '') {
+                cid.saveMap(
+                    {
+                        id: modelId.value - 0,
+                        relation_json: data,
+                    }
+                ).then(res => {
+                    if (res.code == 0) {
+                        ElMessage({
+                            type: "success",
+                            message: "保存成功!",
+                            duration: 2000,
+                        })
+                    }else{
+                        ElMessage({
+                            message:res.msg,
+                            type:"error"
+                        })
+                    }
+                })
+            } else {
+                cid.saveMap(
+                    {
+                        id: copyObj.value.id - 0,
+                        relation_json: data,
+                    }
+                ).then(res => {
+                    if (res.code == 0) {
+                        ElMessage({
+                            type: "success",
+                            message: "保存成功!",
+                            duration: 2000,
+                        })
+                    }else{
+                        ElMessage({
+                            message:res.msg,
+                            type:"error"
+                        })
+                    }
+                })
+            }
         }
         function cleanMap() {
             lf.value.clearData()
@@ -225,7 +247,6 @@ export default {
         function lastRender() {
             loading.value = true
             modelId.value = route.query.modelid
-            console.log(modelId.value, 'modelid')
             cid.getModelInfo({ id: modelId.value - 0, pageno: 1, pagesize: 20 }).then(res => {
                 if (res.data[0].relation_json == null || res.data[0].relation_json == '') return;
                 const origiondata = JSON.parse(res.data[0].relation_json)
@@ -235,7 +256,7 @@ export default {
                     const element = origiondata.edges[index];
                     if (element.properties != null && element.properties["issv"] === 'SV') {
                         let lineStyle = lf.value.getEdgeModelById(element.id)//.getEdgeStyle();
-                        console.log(lineStyle)
+                        // console.log(lineStyle)
                         lineStyle.setProperties({ svEdge: { stroke: 'orange' } })
                     }
                 }
@@ -362,7 +383,7 @@ export default {
                     },//节点内文字样式
                 });
                 lf.value.on("edge:click", function (data, e, position) {
-                    console.log(data,'data1');
+                    console.log(data, 'data1');
                     delId.value = data.data.id
                     if (copyColor.value == '#255CE7') {
                         lf.value.graphModel.updateText(data.data.id, "GOOSE");
@@ -383,7 +404,7 @@ export default {
                     }
                 })
                 lf.value.on('node:click', function (data, e, position) {//传送坐标轴参数到父组件
-                    console.log(data,'data3');
+                    console.log(data, 'data3');
                     copyId.value = data.data.id
                     nodeId.value = data.data.id
                     setX.value = data.data.x
@@ -426,7 +447,7 @@ export default {
                 })
                 // console.log(lf.value.graphModel,'sss');
                 lf.value.on('edge:click', function (data, e, position) {//解决点击连接线问题
-                    console.log(data,'data2');
+                    console.log(data, 'data2');
                     if (copyColor.value == '#255CE7') {
                         blue()
                         lf.value.changeEdgeType(data.data.id, "baseEdge")
@@ -441,7 +462,11 @@ export default {
                 // lf.value.register(logicFlows)
                 lf.value.extension.dndPanel.setPatternItems(needMap.value);
                 lf.value.render();
-                lastRender()
+                console.log(route.query.modelid, '498651');
+                if (route.query.modelid != '' && route.query.modelid != null && route.query.modelid != undefined) {
+                    console.log(456789);
+                    lastRender()
+                }
                 setTimeout(() => {
                     loading.value = false
                 }, 10000)
@@ -456,6 +481,7 @@ export default {
         onBeforeUnmount(() => {
             // lf.value.remove()
             coolObj.value = {}
+            router.push("/home/setting")
         })
         return {
             container,

+ 14 - 17
src/pages/mission/components/HistoryMis.vue

@@ -1,5 +1,5 @@
 <template>
-    <div style="margin-left: 20px;position: relative;" v-loading="loading">
+    <div style="margin-left: 20px;" v-loading="loading">
         <div style="display: flex;justify-content: flex-start;align-items: center;">
             <div style="margin-right: 20px;">
                 <span>名称:</span>
@@ -16,8 +16,8 @@
                 <el-button @click="record">重置</el-button>
             </div>
         </div>
-        <div>
-            <el-table :data="tableData" style="width: 98%;height: calc(100vh - 240px);" stripe>
+        <div style="position: relative;">
+            <el-table :data="tableData" style="width: 98%;height: calc(100vh - 340px);" stripe>
                 <el-table-column fixed label="序号" width="150">
                     <template #default="scope">
                         {{ scope.$index + 1 }}
@@ -45,13 +45,10 @@
                     </template>
                 </el-table-column>
             </el-table>
+            <PageNation :totals="totals" :pageNum="pageNum" :pageSize="pageSize" @pageBack="pageBack"></PageNation>
         </div>
-        <div>
-            <PageNation :totals="totals" :pageNum="pageNum" :pageSize="pageSize" @pageBack="pageBack"
-                style="position: absolute;top: 750px;right: 50px;"></PageNation>
-            <DelHistory v-if="delModal" :delModal="delModal" :delId="delId" :reload="reload" @delBack="delBack">
-            </DelHistory>
-        </div>
+        <DelHistory v-if="delModal" :delModal="delModal" :delId="delId" :reload="reload" @delBack="delBack">
+        </DelHistory>
     </div>
 </template>
 
@@ -133,18 +130,18 @@ export default {
         }
         function relady(row) {
             task.reladyTask({
-                id:row.id
-            }).then(res=>{
-                if(res.code ==0){
+                id: row.id
+            }).then(res => {
+                if (res.code == 0) {
                     ElMessage({
-                        message:"任务已重置",
-                        type:"success"
+                        message: "任务已重置",
+                        type: "success"
                     })
                     reload()
-                }else{
+                } else {
                     ElMessage({
-                        message:res.msg,
-                        type:"error"
+                        message: res.msg,
+                        type: "error"
                     })
                 }
             })

+ 1 - 1
src/pages/mission/components/PageNation.vue

@@ -1,5 +1,5 @@
 <template>
-    <div>
+    <div style="position: absolute;bottom: -60px;right: 20px;">
         <el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 30, 40]"
             :small="small" :disabled="disabled" :background="background" layout="total, sizes, prev, pager, next, jumper"
             :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />

+ 1 - 1
src/pages/mission/components/StartMission.vue

@@ -129,7 +129,7 @@ export default {
                 }).then(res => {
                     endList.value = res.data
                 })
-            }, 10000)
+            }, 20000)
         }
         function backDown() {
             emit("smBack", arrow.value)

+ 1 - 1
src/pages/mission/modalComp/ModelTree.vue

@@ -3,7 +3,7 @@
         <div class="bigBox">
             <el-dialog v-loading="loading" v-model="dialogVisible" title="选择模型" width="30%" @close="sureclose" :close-on-click-modal="false">
                 <el-tree ref="treeRef" :data="treeData" style="height: calc(100vh - 500px);overflow-y: auto;" show-checkbox
-                    node-key="id" @check-change="handleCheckChange" :check-strictly="true" default-expand-all
+                    node-key="id" @check-change="handleCheckChange" :check-strictly="false" default-expand-all
                     :expand-on-click-node="false" :props="defaultProps" :default-checked-keys="checkKey" />
                 <template #footer>
                     <span class="dialog-footer">

+ 1 - 0
src/pages/netStructPicture/newTitle/SlcCheck.vue

@@ -338,6 +338,7 @@ const excelPort = () => {
   exportLink.value = "";
   const nodeName = clickTreeData.value ? clickTreeData.value.datatype : "";
   const nodeId = clickTreeData.value ? clickTreeData.value.id : "";
+  console.log(nodeName,nodeId);
   exportModal.value = true;
   //导出excel
   scdExpTableData({

+ 32 - 11
src/pages/report/components/ReportDetails.vue

@@ -64,21 +64,22 @@
                         <el-table :data="tableData" stripe
                             style="width: 100%;height: calc(100vh - 420px);margin-top: 10px;">
                             <el-table-column prop="ied_name" label="装置名称" width="120" />
-                            <el-table-column prop="ied_desc" label="装置描述" width="240" show-overflow-tooltip />
-                            <el-table-column label="等级" width="100">
+                            <el-table-column prop="ied_desc" label="装置描述" width="240" />
+                            <el-table-column prop="alert_level" label="等级" width="100">
                                 <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="120">
+                            <el-table-column prop="line_no" label="行号" width="100">
                                 <template #default="scope">
-                                    <span style="color: blue;border-bottom: 1px solid blue;cursor: pointer;" @click="lineno(scope.row)">{{
-                                        scope.row.line_no }}</span>
+                                    <span style="color: blue;border-bottom: 1px solid blue;cursor: pointer;"
+                                        @click="lineno(scope.row)">{{
+                                            scope.row.line_no }}</span>
                                 </template>
                             </el-table-column>
-                            <el-table-column prop="parse_result" label="描述" width="auto" show-overflow-tooltip />
-                            <el-table-column label="标准及条款" width="200" show-overflow-tooltip>
+                            <el-table-column prop="parse_result" label="描述" width="auto"  />
+                            <el-table-column label="标准及条款" width="400" show-overflow-tooltip>
                                 <template #default="scope">
                                     <p>{{ scope.row.apply_standard }}</p>
                                     <p>{{ scope.row.apply_standard_no }}</p>
@@ -92,7 +93,8 @@
             </div>
         </div>
         <div>
-            <LooKLine v-if="lineSearch" :lineSearch="lineSearch" :scdIds="scdIds" :lineNum="lineNum" @lineClose="lineClose"></LooKLine>
+            <LooKLine v-if="lineSearch" :lineSearch="lineSearch" :scdIds="scdIds" :lineNum="lineNum" :lineMsg="lineMsg" @lineClose="lineClose">
+            </LooKLine>
         </div>
     </div>
 </template>
@@ -107,6 +109,7 @@ import Pagination from "./Pagination.vue"
 import { ElMessage } from "element-plus"
 import system from "@/api/system"
 import LooKLine from "../modal/LookLine.vue"
+import { scdExpTableData } from "@/api/scdCheck/scdCheck2";
 export default {
     setup() {
         let route = useRoute()
@@ -124,6 +127,7 @@ export default {
         let fileId = ref("")//需要下载的报告id'
         let totals = ref(0)
         let lineSearch = ref(false)
+        let lineMsg = ref('')//行描述
         let lineNum = ref(0)//行号
         // 初始化组件
         function reload() {
@@ -217,14 +221,30 @@ export default {
         }
         // 导出结果至excel
         function excelPort() {
+            // const nodeName = clickTreeData.value ? clickTreeData.value.datatype : "";
+            // const nodeId = clickTreeData.value ? clickTreeData.value.id : "";
             systemRow.portExcel({
                 code: "scl-check-result",
+                caption: "检测报告",
+                expcols: "ied_name,ied_desc,alert_level,line_no,parse_result,apply_standard,apply_standard_no",
+                expcolnames: "装置名称,装置描述,等级,行号,描述,应用标准,标准条款",
+                scd_id: route.query.scdId - 0,
+                node_name: "",
+                node_id: "",
             }).then(res => {
-                console.log(res, '导出');
+                if (res.data) {
+                   location.href = window.ApiServer + "/" + res.data;
+                } else {
+                    ElMessage({
+                        message: res.msg,
+                        type: "info",
+                    });
+                }
             })
         }
         //查看行位置
-        function lineno(row){
+        function lineno(row) {
+            lineMsg.value = row.parse_result
             lineNum.value = row.line_no
             lineSearch.value = true
         }
@@ -246,7 +266,7 @@ export default {
                 }
             })
         }
-        function lineClose(data){
+        function lineClose(data) {
             lineSearch.value = data
         }
         onMounted(() => {
@@ -276,6 +296,7 @@ export default {
             lineno,//查看行位置
             lineNum,//行号
             lineClose,//lookline.vue返回模态框状态
+            lineMsg,
         }
     },
     components: {

+ 35 - 8
src/pages/report/modal/LookLine.vue

@@ -1,12 +1,21 @@
 <template>
     <div>
-        <el-dialog v-model="dialogDisabled" width="50vw" append-to-body draggable @close="closes">
+        <el-dialog v-model="dialogDisabled" width="60vw" append-to-body draggable @close="closes">
             <template #header>
                 <div class="my-header">
                     <div class="title">SCD源XML查看</div>
                 </div>
             </template>
             <div class="line-title">{{ lineNoTitle }}</div>
+            <div style="
+            color: red;
+            font-size: 16px;
+            margin: 15px 0px;
+            border-bottom: 1px solid #dbdbdb;
+            text-align: center;
+            padding-bottom: 10px;
+            ">{{
+                messageLine }}</div>
             <el-scrollbar height="500px">
                 <div class="main-cont-line">
                     <div class="main-line">
@@ -42,7 +51,11 @@ export default {
         lineNum: {
             type: String,
             required: true
-        }
+        },
+        lineMsg: {
+            type: String,
+            required: true
+        },//描述
     },
     setup(props, { emit }) {
         let dialogDisabled = ref(false)
@@ -50,6 +63,7 @@ export default {
         let line = ref(0)//行号
         let clicklineNOData = ref("")
         let lineNoData = ref([])
+        let messageLine = ref("")
         watch(() => props.lineNum, (newVal) => {
             line.value = newVal
             clicklineNOData.value = newVal
@@ -57,15 +71,20 @@ export default {
         watch(() => props.scdIds, (newVal) => {
             needScdId.value = newVal
         })
+        watch(() => props.lineMsg, (newVal) => {
+            messageLine.value = newVal
+        })
         // 初始化函数
         function reload() {
             dialogDisabled.value = props.lineSearch
             needScdId.value = props.scdIds
             line.value = props.lineNum
             clicklineNOData.value = props.lineNum
+            messageLine.value = props.lineMsg
+            console.log(messageLine.value, 'message');
             scdLineSourcexml({
                 scd_id: needScdId.value - 0,
-                line_no: line.value - 0
+                lineno: line.value - 0
             }).then(res => {
                 if (res.data != null) {
                     lineNoData.value = res.data
@@ -76,10 +95,6 @@ export default {
             dialogDisabled.value = false
             emit("lineClose", dialogDisabled.value)
         }
-        function needSure() {
-            dialogDisabled.value = false
-            emit("lineClose", dialogDisabled.value)
-        }
         onMounted(() => {
             reload()
         })
@@ -92,6 +107,7 @@ export default {
             closes: needClose,
             clicklineNOData,
             lineNoData,
+            messageLine,
         }
     }
 }
@@ -103,4 +119,15 @@ export default {
     color: #fff;
     margin-right: 20px;
 }
-</style>
+
+.my-header {
+    border-bottom: 1px solid #a3ade0;
+    font-size: 16px;
+    color: #1a2447;
+    padding-bottom: 10px;
+}
+
+:deep(.el-dialog__body) {
+    margin: 0 !important;
+    padding: 0 !important;
+}</style>

+ 21 - 1
src/pages/system/modalComp/AddNode.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <el-dialog v-model="dialogVisible" title="添加模型定义" width="30%" @close="closes" :close-on-click-modal="false">
+        <el-dialog v-model="dialogVisible" :title="tips" width="30%" @close="closes" :close-on-click-modal="false">
             <!--  -->
             <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="120px" class="demo-ruleForm"
                 status-icon>
@@ -81,6 +81,7 @@ export default {
         let moduleList = ref([])
         let flashLel = ref([])
         let coolRow = ref({})
+        let tips = ref('添加模型定义')
         let rules = reactive({
             name: [
                 { required: true, message: '请输入名称', trigger: 'blur' },
@@ -115,14 +116,32 @@ export default {
         watch(() => props.modelType, (newVal) => {
             numType.value = newVal
         })
+        watch(()=>props.modelType,(newVal)=>{
+            numType.value = newVal
+            if(numType.value == 0){
+                tips.value = '添加模型定义'
+            }else{
+                tips.value = '修改模型定义'
+            }
+        })
         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
+            if(numType.value == 0){
+                tips.value = '添加模型定义'
+            }else{
+                tips.value = '修改模型定义'
+            }
         }
         function searchFlashLel() {
             numType.value = props.modelType
+            if(numType.value == 0){
+                tips.value = '添加模型定义'
+            }else{
+                tips.value = '修改模型定义'
+            }
             ruleForm.value.id = props.needRow.id || 0
             ruleForm.value.name = props.needRow.model_name || ''
             systemRow.getChildren({ code: "area_type" }).then(res => {
@@ -236,6 +255,7 @@ export default {
             coolRow,
             ruleFormRef,//表单ref
             numType,//0新增1修改
+            tips
         }
     }
 }