Browse Source

adm:feat> 修改设备/系统添加问题

onlyh 3 years ago
parent
commit
5bc09d38c6
2 changed files with 23 additions and 16 deletions
  1. 4 0
      src/views/maintain/device/index.vue
  2. 19 16
      src/views/maintain/system/index.vue

+ 4 - 0
src/views/maintain/device/index.vue

@@ -452,6 +452,8 @@ export default class extends Vue {
         deleteEquip([{id: this.currRowContent.id}]).then(res => {
             if (res.result == 'success') {
                 this.$message.success('删除成功')
+                this.deviceList();
+                this.dataCount()
                 this.handleChangeDevice()
                 this.dialogVisible = false;
             }
@@ -545,6 +547,8 @@ export default class extends Vue {
             if (res.result == 'success') {
                 this.$message.success('创建成功');
                 this.dialogVisible = false;
+                this.deviceList();
+                this.dataCount()
                 this.handleChangeDevice()
             }
         })

+ 19 - 16
src/views/maintain/system/index.vue

@@ -64,16 +64,16 @@
 </template>
 
 <script lang="ts">
-import { Component, Vue, Watch } from "vue-property-decorator";
-import { AdmMultiTable, AdmSearch, baseDataForm, Pagination, Statistics } from "../components/index";
-import { createSystem, dictQuery, queryCountSystem, querySystem, updateSystem } from "@/api/datacenter";
+import {Component, Vue, Watch} from "vue-property-decorator";
+import {AdmMultiTable, AdmSearch, baseDataForm, Pagination, Statistics} from "../components/index";
+import {createSystem, dictQuery, queryCountSystem, querySystem, updateSystem} from "@/api/datacenter";
 import tools from "@/utils/maintain";
-import { UserModule } from "@/store/modules/user";
-import { allSystem, BeatchQueryParam,allSystems } from "@/api/equipComponent";
+import {UserModule} from "@/store/modules/user";
+import {allSystem, BeatchQueryParam, allSystems} from "@/api/equipComponent";
 
 @Component({
     name: "adm-system",
-    components: { Statistics, AdmSearch, AdmMultiTable, Pagination, baseDataForm },
+    components: {Statistics, AdmSearch, AdmMultiTable, Pagination, baseDataForm},
 })
 export default class extends Vue {
     optionProps = {
@@ -224,7 +224,7 @@ export default class extends Vue {
         this.systemMsg = '添加系统'
         this.currRowContent = {}
         this.dialogVisible = true;
-        allSystems({}).then(res=> {
+        allSystems({}).then(res => {
             this.addlist = res.content
         })
     }
@@ -240,7 +240,7 @@ export default class extends Vue {
             };
 
             await dictQuery(param).then((res: any) => {
-                const { basicInfos, dictStages } = this.informationArrangement(res.content);
+                const {basicInfos, dictStages} = this.informationArrangement(res.content);
                 // 添加系统分类
                 // dictStages.map((item: any) => {
                 //     item = { ...item, classification: this.systemLabel };
@@ -323,14 +323,14 @@ export default class extends Vue {
                 orders: "sort asc, name desc",
             };
             let param2 = {
-                filters: this.systemType[1] ? `classCode='${ this.systemType[1] }'` : undefined,
+                filters: this.systemType[1] ? `classCode='${this.systemType[1]}'` : undefined,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.inputSearch != "") {
-                param2.filters = `localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`;
+                param2.filters = `localName contain '${this.inputSearch}' or localId contain '${this.inputSearch}'`;
             }
             let promise = new Promise((resolve) => {
                 dictQuery(param).then((res) => {
@@ -343,10 +343,9 @@ export default class extends Vue {
                 });
             });
             Promise.all([promise, promise2]).then((res) => {
-                let tableData = [];
                 this.loading = false;
                 // 类型下信息点,重组数据
-                let { basicInfos, dictStages } = this.informationArrangement(res[0].content)
+                let {basicInfos, dictStages} = this.informationArrangement(res[0].content)
                 this.headersStage = {
                     basicInfos: {
                         name: "基础信息台账",
@@ -399,14 +398,18 @@ export default class extends Vue {
                 content: [from]
             }
             createSystem(param).then(res => {
-                res.result == 'success' && this.$message.success('添加成功')
-                this.dialogVisible = false
-                this.changeSystemList()
+                if (res.result == 'success') {
+                    this.systemList();
+                    this.dataCount();
+                    this.changeSystemList()
+                    this.$message.success('添加成功')
+                    this.dialogVisible = false
+                }
             })
         }
     }
 
-    @Watch("systemType", { immediate: true, deep: true })
+    @Watch("systemType", {immediate: true, deep: true})
     handleDeviceMsg() {
         this.systemVal = this.systemType
     }