liyangzheng il y a 1 an
Parent
commit
102d00ef04

+ 7 - 2
src/pages/setting/components/SystemCode.vue

@@ -28,7 +28,7 @@
                         </el-icon>
                         新增系统字典
                     </el-button>
-                    <el-table :data="systemList" style="width: 100%;height: calc(100vh - 260px);" :stripe="true">
+                    <el-table :data="systemList" style="width: 100%;height: calc(100vh - 260px);" :stripe="true" v-loading="tableLoading">
                         <el-table-column label="序号" #default="scope">
                             {{ scope.$index + 1 }}
                         </el-table-column>
@@ -60,7 +60,7 @@
                 <AddSc v-if="setModal" :setModal="setModal" :addOrEdit="addOrEdit" :handleNodeClick="handleNodeClick"
                     :pageCode="pageCode" :searchSystem="searchSystem" :editRow="editRow" @getModal="getModal">
                 </AddSc>
-                <DelSc v-if="delModal" :delModal="delModal" :delId="delId" :searchSystem="searchSystem"
+                <DelSc v-if="delModal" :delModal="delModal" :delId="delId" :pageCode="pageCode" :handleNodeClick="handleNodeClick" :searchSystem="searchSystem"
                     @delBack="delBack">
                 </DelSc>
             </div>
@@ -96,6 +96,7 @@ export default {
         })
         let loading = ref(false)//加载动画
         let pageCode = ref("")//分页组件需要的code
+        let tableLoading = ref(false)//表格的刷新
         function searchSystem() {//查询所有字典
             loading.value = true
             systemList.value = []
@@ -138,13 +139,16 @@ export default {
         }
         function handleNodeClick(e) {
             pageCode.value = e.code
+            tableLoading.value = true
             systemRow.getChildren({ code: pageCode.value }).then(res => {
                 if (res.data) {
                     systemList.value = res.data
                     totals.value = res.data.length
+                    tableLoading.value = false
                 } else {
                     systemList.value = []
                     totals.value = 0
+                    tableLoading.value = false
                 }
             })
         }
@@ -198,6 +202,7 @@ export default {
             handleNodeClick,//树形组件点击节点方法
             loading,//加载方法
             pageCode,//分页组件需要的code 
+            tableLoading,//表格的刷新
         }
     },
     components: {

+ 2 - 1
src/pages/setting/modalComp/AddSc.vue

@@ -119,7 +119,8 @@ export default {
                             if (res.returncode == 200) {
                                 dialogVisible.value = false
                                 emit("getModal", dialogVisible.value)
-                                props.searchSystem()
+                                let e = { code: props.pageCode }
+                                props.handleNodeClick(e)
                                 ElMessage({
                                     type: "success",
                                     message: "新增成功"

+ 14 - 4
src/pages/setting/modalComp/DelSc.vue

@@ -10,7 +10,8 @@
                 </div>
                 <div style="display: flex;justify-content:center;align-items: center;margin-top: 40px;">
                     <el-button style="display: block;width: 150px;height: 30px;" @click="cancels">取消</el-button>
-                    <el-button style="display: block;width: 150px;height: 30px;" type="primary" @click="sureDel">确认</el-button>
+                    <el-button style="display: block;width: 150px;height: 30px;" type="primary"
+                        @click="sureDel">确认</el-button>
                 </div>
             </el-dialog>
         </div>
@@ -34,7 +35,15 @@ export default {
         searchSystem: {
             type: Function,
             required: true
-        }
+        },
+        handleNodeClick: {
+            type: Function,
+            required: true
+        },//systemCode.vue传过来的树形组件方法
+        pageCode: {
+            type: Object,
+            required: true
+        },//systemCode.vue传过来的code
     },
     setup(props, { emit }) {
         let result = props.delModal
@@ -56,8 +65,9 @@ export default {
                         message: "删除成功!"
                     })
                     dialogVisible.value = false
-                    emit("delBack", dialogVisible.value,1)
-                    props.searchSystem()
+                    emit("delBack", dialogVisible.value, 1)
+                    let e = { code: props.pageCode }
+                    props.handleNodeClick(e)
                 }
             })
         }

+ 1 - 1
src/pages/system/components/LitLine.vue

@@ -45,7 +45,7 @@
                 <Pagination :totals="totals" @pageBack="pageBack"></Pagination>
             </div>
             <div>
-                <AddLine v-if="alModal" :alModal="alModal" :sunSearch="sunSearch" @alBack="alBack"></AddLine>
+                <AddLine v-if="alModal" :alModal="alModal" :flashId="flashId" :checkFlash="checkFlash" @alBack="alBack"></AddLine>
                 <LookLine v-if="lookModal" :lookModal="lookModal" :flashId="flashId" :checkFlash="checkFlash" :needList="needList" :search="search"
                     @lookBack="lookBack" :listNum="listNum"></LookLine>
                 <DelLine v-if="delModal" :delModal="delModal" :flashId="flashId" :checkFlash="checkFlash" :needList="needList" :sunSearch="sunSearch"

+ 14 - 4
src/pages/system/modalComp/AddLine.vue

@@ -33,7 +33,7 @@
 </template>
 
 <script>
-import { ref, onMounted, toRefs, reactive } from 'vue';
+import { ref, onMounted, toRefs, reactive,watch } from 'vue';
 import { ElMessage } from 'element-plus';
 import systemRow from '@/api/systemRow';
 import litLine from "@/api/litLine"
@@ -44,15 +44,20 @@ export default {
             type: Boolean,
             required: true
         },
-        sunSearch: {
+        checkFlash: {
             type: Function,
             required: true
-        }
+        },//litline传过来的方法
+        flashId:{
+            type:String,
+            required:true,
+        },//litline传过来的电压等级
     },
     setup(props, { emit }) {
         let dialogVisible = ref(false)
         let result = props.alModal
         let { cancels, sureClick } = toRefs(props)
+        let flashIds = ref("")//本组件的电压id
         let ruleForm = ref({
             name: "",
             volId: "",
@@ -72,8 +77,12 @@ export default {
             ],
         })
         let ruleFormRef = ref(null)
+        watch(()=>props.flashId,(newVal)=>{
+            flashIds.value = newVal
+        })
         function lineList() {
             dialogVisible.value = result
+            flashIds.value = props.flashId
         }
         function searchFlashLel() {
             systemRow.getChildren({ code: "voltage_level" }).then(res => {
@@ -110,7 +119,7 @@ export default {
                                 type: "success",
                                 duration: 1500
                             })
-                            props.sunSearch()
+                            props.checkFlash(flashIds.value)
                         }else{
                             ElMessage({
                                 message:res.msg,
@@ -143,6 +152,7 @@ export default {
             rules,
             closes: cancelBack,
             ruleFormRef,
+            flashIds,
         }
     }
 }