Переглянути джерело

adm:feat > 解决关系总览里删除关系接口问题

shaun-sheep 4 роки тому
батько
коміт
78afcc81a9

+ 2 - 1
src/api/relation/api.js

@@ -162,7 +162,8 @@ export function relAdd(data) {
 
 //删除关系
 export function relDelete(param, success) {
-  let url = `${baseUrl}${dataCenter}/relation-manual-calc/rel-del`
+  // let url = `${baseUrl}${dataCenter}/relation-manual-calc/rel-del`
+  let url = `${baseUrl}${dataCenter}/rel-manual-calc/del`
   httpUtil.postJson(url, param, success)
 }
 

+ 13 - 8
src/components/dialogs/changeRea.vue

@@ -7,7 +7,8 @@
       <div id="changeRea">
         <div class="title-search" style="margin-bottom: 10px;">
           <floor-cascader @change="changeFloor"></floor-cascader>
-          <el-input placeholder="输入本地名称或本地编码查询" v-model="search" size="small" style="width:250px;marginLeft:30px;" clearable></el-input>
+          <el-input placeholder="输入本地名称或本地编码查询" v-model="search" size="small" style="width:250px;marginLeft:30px;"
+                    clearable></el-input>
           <el-button @click="getPropertyData" size="small">查找</el-button>
         </div>
         <!-- <div>
@@ -18,26 +19,28 @@
             <el-table-column label="资产名称">
               <template slot-scope="scope">
                 <el-radio :label="scope.row.id" :ref="scope.row.id" :value="scope.row.localName || scope.row.name">
-                  {{scope.row.localName || scope.row.name}}
+                  {{ scope.row.localName || scope.row.name }}
                 </el-radio>
               </template>
             </el-table-column>
             <el-table-column label="本地编码">
-              <template slot-scope="scope">{{scope.row.localId || scope.row.id}}</template>
+              <template slot-scope="scope">{{ scope.row.localId || scope.row.id }}</template>
             </el-table-column>
             <el-table-column prop="name" label="所在楼层">
               <template slot-scope="scope">
-                {{ scope.row.building?scope.row.building.localName?scope.row.building.localName:'':'' }}-{{ scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':'' }}
+                {{
+                  scope.row.building ? scope.row.building.localName ? scope.row.building.localName : '' : ''
+                }}-{{ scope.row.Floor ? scope.row.Floor.FloorLocalName ? scope.row.Floor.FloorLocalName : '' : '' }}
               </template>
             </el-table-column>
             <el-table-column label="设备族">
               <template slot-scope="scope">
-                {{scope.row.EquipFamilyList[0].FamilyName}}
+                {{ scope.row.EquipFamilyList[0].FamilyName }}
               </template>
             </el-table-column>
             <el-table-column label="安装位置">
               <template slot-scope="scope">
-                {{scope.row.LedgerParam?scope.row.LedgerParam.Siteinstall?scope.row.LedgerParam.Siteinstall.InstallLocation:"--":"--"}}
+                {{ scope.row.LedgerParam ? scope.row.LedgerParam.Siteinstall ? scope.row.LedgerParam.Siteinstall.InstallLocation : "--" : "--" }}
               </template>
             </el-table-column>
           </el-table>
@@ -56,6 +59,7 @@ import paramDetails from "@/components/dialogs/list/paramDetails"
 import { queryProperty } from "@/api/scan/request"
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import { mapGetters, mapActions } from "vuex"
+
 export default {
   components: {
     myPagination,
@@ -96,7 +100,8 @@ export default {
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
-  mounted() { },
+  mounted() {
+  },
   methods: {
     //确认选择
     clickTrue() {
@@ -135,7 +140,7 @@ export default {
         cascade: [
           {
             name: "equipFamilyList",
-            projection: [ "family", "familyName" ]
+            projection: ["family", "familyName"]
           },
           {
             name: "building",

+ 3 - 3
src/views/relation/relationShip/index.vue

@@ -490,9 +490,9 @@
       deleteObject(index, row) {
         this.visible = true
         this.delParam = {
-          "FromId": row.Id,
-          "RelType": localStorage.getItem('RelManualType'),
-          "ToId": row.cId
+          "fromId": row.Id,
+          "relType": localStorage.getItem('RelManualType'),
+          "toId": row.cId
         }
         // relDelete(param, res => {
         //   this.init()