Browse Source

提交最新代码

chuwu 5 years ago
parent
commit
5cb5a97dd9

+ 5 - 0
src/fetch/point_http.js

@@ -322,4 +322,9 @@ export function uploadPointFile(param, success) {
 export function deleteRelationList(param, success) {
     let data = param
     return post(`${point}/relation/group-delete`, data, success)
+}
+
+/**项目接口 */
+export function synchronizeProj(success) {
+    return post(`${point}/project/synchronize`, {}, success)
 }

+ 48 - 28
src/utils/point_edit/handson_header.js

@@ -1,27 +1,27 @@
 const headers = {
     "modbus-tcp": [{
-            InfoPointName: "SlaveID",
+            InfoPointName: "slave_id",
             InfoPointCode: "SlaveId",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "RegistersAddress",
+            InfoPointName: "registers_address ",
             InfoPointCode: "RegistersAddress",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "RegistersQuality",
+            InfoPointName: "registers_quality",
             InfoPointCode: "RegistersQuality",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "ConvertType",
+            InfoPointName: "convert_type",
             InfoPointCode: "ConvertType",
             InputMode: "select",
             DataSource: [{
@@ -43,7 +43,7 @@ const headers = {
             FirstTag: ""
         },
         {
-            InfoPointName: "RevertRule",
+            InfoPointName: "翻转规则",
             InfoPointCode: "RevertRule",
             InputMode: "B1",
             Visible: true,
@@ -51,29 +51,57 @@ const headers = {
         }
     ],
     "bacnet-ip": [{
-            InfoPointName: "设备标识",
+            InfoPointName: "device_id",
             InfoPointCode: "DeviceId",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "实例功能号",
+            InfoPointName: "instance_number",
             InfoPointCode: "InstanceNumber",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "数据类型",
+            InfoPointName: "data_type",
             InfoPointCode: "DataType",
             DataSource: [{
-                    Code: "1",
+                    Code: "analogInput",
                     Name: "analogInput"
                 },
                 {
-                    Code: "2",
+                    Code: "analogOutput",
                     Name: "analogOutput"
+                },
+                {
+                    Code: "analogValue",
+                    Name: "analogValue"
+                },
+                {
+                    Code: "binaryInput",
+                    Name: "binaryInput"
+                },
+                {
+                    Code: "binaryOutput",
+                    Name: "binaryOutput"
+                },
+                {
+                    Code: "binaryValue",
+                    Name: "binaryValue"
+                },
+                {
+                    Code: "multiStateInput",
+                    Name: "multiStateInput"
+                },
+                {
+                    Code: "multiStateOutput",
+                    Name: "multiStateOutput"
+                },
+                {
+                    Code: "multiStateValue",
+                    Name: "multiStateValue"
                 }
             ],
             InputMode: "select",
@@ -82,36 +110,28 @@ const headers = {
         }
     ],
     "opc": [{
-        InfoPointName: "点位编码(统一标识)",
+        InfoPointName: "item",
         InfoPointCode: "Item",
         InputMode: "B1",
         Visible: true,
         FirstTag: ""
     }],
     "knx": [{
-        InfoPointName: "组地址",
+        InfoPointName: "group_address",
         InfoPointCode: "GroupAddress",
         InputMode: "B1",
         Visible: true,
         FirstTag: ""
     }],
     "mqtt": [{
-            InfoPointName: "DeviceId",
-            InfoPointCode: "DeviceId",
-            InputMode: "B1",
-            Visible: true,
-            FirstTag: ""
-        },
-        {
-            InfoPointName: "Item",
-            InfoPointCode: "Item",
-            InputMode: "B1",
-            Visible: true,
-            FirstTag: ""
-        }
-    ],
+        InfoPointName: "topic",
+        InfoPointCode: "Topic",
+        InputMode: "B1",
+        Visible: true,
+        FirstTag: ""
+    }],
     "amqp": [{
-            InfoPointName: "Exchange",
+            InfoPointName: "exchange",
             InfoPointCode: "Exchange",
             InputMode: "B1",
             Visible: true,
@@ -125,7 +145,7 @@ const headers = {
             FirstTag: ""
         },
         {
-            InfoPointName: "Routingkey",
+            InfoPointName: "routing_key ",
             InfoPointCode: "RoutingKey",
             InputMode: "B1",
             Visible: true,

+ 101 - 49
src/views/data_admin/buildGraphy/index.vue

@@ -9,28 +9,28 @@
     <div class='condition'>
         <p>
             <span>建筑楼层</span>
-            <el-select v-model='buildVlaue' placeholder='请选择' clearable>
-                <el-option
-                    v-for='item in options'
-                    :key='item.Code'
-                    :label='item.Name'
+                <el-cascader
+                    placeholder='请选择'
+                   :options="options"
                     @active-item-change="handleItemChange"
+                    @change="changeFloor"
                     filterable
-                ></el-option>
-            </el-select>
+                ></el-cascader>
         </p>
     </div>
-    <div class="graphy-main">
-      <graphy-canvas v-if="show" :param="param" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
-    </div>
-    <div class="graphy-right">
-      <graphy-tabs v-show="show"
-        ref="tabs"
-        :pointParam="pointParam"
-        @setFalg="setFalg"
-        @getLocation="getLocation"
-        @getPointList="sendPointList"
-      ></graphy-tabs>
+    <div class="graphy-view">
+        <div class="graphy-main">
+            <graphy-canvas v-if="show" :param="param" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
+        </div>
+        <div class="graphy-right">
+        <graphy-tabs v-show="show"
+            ref="tabs"
+            :pointParam="pointParam"
+            @setFalg="setFalg"
+            @getLocation="getLocation"
+            @getPointList="sendPointList"
+        ></graphy-tabs>
+        </div>
     </div>
   </div>
 </template>
@@ -41,7 +41,7 @@ import graphyTree from "./graphyTree";
 import graphyTabs from "./graphyTabs";
 import graphyCanvas from "./graphyCanvas";
 import {mapGetters, mapActions} from 'vuex';
-import {getPT,getBuildSelect} from "@/api/scan/request"; //获取点位坐标
+import {getPT,getBuildSelect,getFloor} from "@/api/scan/request"; //获取点位坐标
 import Handsontable from "handsontable-pro"
 import 'handsontable-pro/dist/handsontable.full.css'
 import zhCN from 'handsontable-pro/languages/zh-CN';
@@ -82,21 +82,67 @@ export default {
     ])
   },
   methods: {
+      //修改楼层
+      changeFloor(val){
+          console.log(val)
+          let floorMap = "",name = ""
+          this.options.map(item => {
+              if(!!item.children && item.children.length){
+                  if(item.value == val[0]){
+                      item.children.map(child => {
+                          if(child.value == val[1]){
+                              console.log(child,'child')
+                              floorMap = child.map
+                              name = child.label
+                          }
+                      })
+                  }
+              }
+          })
+          let obj = {
+              code: val[1],
+              map: floorMap,
+              name: name
+          }
+          this.getPoint(obj)
+          console.log(floorMap)
+      },
       //获取建筑列表
       getList(){
           getBuildSelect(this.param).then(res => {
               console.log(res)
               this.options = res.data.BuildList.map(item => {
                   return {
-                      Code: item.BuildId,
-                      Name: item.BuildLocalName,
+                      value: item.BuildId,
+                      label: item.BuildLocalName,
                       children: []
                   }
               })
           })
       },
+      //点击事件
       handleItemChange(val){
-          console.log(val,'val')
+          if(val.length == 1){
+              let obj = Object.assign({BuildId: val[0]},this.param)
+                getFloor(obj).then(res => {
+                    console.log(res)
+                    this.options = this.options.map(item => {
+                        if(item.value == val[0]){
+                            item.children = res.data.FloorList.map(child => {
+                                return {
+                                    value: child.FloorId,
+                                    label: child.FloorLocalName + (child.FloorMap ? '' : '(需初始化数据)'),
+                                    map: child.FloorMap
+                                }
+                            })
+                        }
+                        return item
+                    })
+                    console.log(this.options)
+                })
+          }else if(val.length == 2){
+
+          }
       },
     changeValue(){
       this.$set(this.param,'ProjId',this.projectId)
@@ -105,8 +151,9 @@ export default {
       this.$set(this.pointParam,'UserId',this.userId)
       this.show = true
     },
+
+    //渲染
     getPoint(data) {
-        console.log(data)
       this.pointParam.FloorId = data.code;
       this.pointParam.fllorName = data.name;
       this.$refs.tabs.reset(this.pointParam, data.map);
@@ -157,33 +204,38 @@ export default {
 
 <style lang="less" scoped>
 #graphy {
-    position: relative;
+    // position: relative;
+    display: flex;
+    .graphy-view{
+        display: flex;
+        .graphy-main {
+            flex: 1;
+            // position: absolute;
+            // left: 200px;
+            // top: 0;
+            // right: 400px;
+            // bottom: 0;
+            // overflow: auto;
+        }
+        .graphy-right {
+            // position: absolute;
+            // right: 0;
+            width: 400px;
+            // top: 0;
+            // bottom: 0;
+            // border-left: 1px solid #ccc;
+            // overflow: hidden;
+        }
+    }
   .graphy-left {
-    width: 200px;
-    height: 100%;
-    position: absolute;
-    overflow-y: auto;
-    left: 0;
-    top: 0;
-    bottom: 0;
-    border-right: 1px solid #ccc;
-  }
-  .graphy-main {
-    position: absolute;
-    left: 200px;
-    top: 0;
-    right: 400px;
-    bottom: 0;
-    overflow: auto;
-  }
-  .graphy-right {
-    position: absolute;
-    right: 0;
-    width: 400px;
-    top: 0;
-    bottom: 0;
-    border-left: 1px solid #ccc;
-    overflow: hidden;
+    // width: 200px;
+    // height: 100%;
+    // position: absolute;
+    // overflow-y: auto;
+    // left: 0;
+    // top: 0;
+    // bottom: 0;
+    // border-right: 1px solid #ccc;
   }
 }
 </style>

+ 4 - 4
src/views/point/config_point/edit_origin/index.vue

@@ -25,8 +25,8 @@
                     <el-input v-model="formData.ProtocolInfo.User" style="display:inline-block;width:100px;"></el-input>/
                     <el-input v-model="formData.ProtocolInfo.Password" style="display:inline-block;width:100px;"></el-input>
                 </el-form-item>
-                <el-form-item label="ProgID" v-if="formData.ProtocolType == 'opc'">
-                    <el-input v-model="formData.ProtocolInfo.ProgID" style="display:inline-block;width:100px;"></el-input>
+                <el-form-item label="ProgId" v-if="formData.ProtocolType == 'opc'">
+                    <el-input v-model="formData.ProtocolInfo.ProgId" style="display:inline-block;width:100px;"></el-input>
                 </el-form-item>
             </el-form>
         </div>
@@ -62,7 +62,7 @@
                         "Port": "", //端口号,有些协议类型没有该信息
                         "User": "", //用户名
                         "Password": "", //密码
-                        "ProgID": "", //progID
+                        "ProgId": "", //progId
                     },
                     Description: ""
                 },
@@ -124,7 +124,7 @@
                             "Port": "",
                             "User": "", //用户名
                             "Password": "", //密码
-                            "ProgID": "", //progID
+                            "ProgId": "", //progId
                         }
                     } else {
                         //有信息点时

+ 12 - 2
src/views/point/config_point/index.vue

@@ -3,7 +3,7 @@
         <div style="line-height:32px;">
             <span>此项目包括<i style="color:#409EFF;">{{list.length}}</i>个数据源</span>
             <div style="float:right;">
-                <el-button>同步配置文件到云端</el-button>
+                <el-button @click="sameData">同步配置文件到云端</el-button>
                 <el-button style="width:140px;" @click="addItem">添加数据源</el-button>
             </div>
         </div>
@@ -32,7 +32,7 @@
         mapGetters,
         mapActions
     } from "vuex";
-    import { queryDataSourceCount } from "@/fetch/point_http"
+    import { queryDataSourceCount,synchronizeProj } from "@/fetch/point_http"
     export default {
         components: {
             dataOrigin
@@ -55,6 +55,16 @@
             this.getList()
         },
         methods: {
+            //同步数据
+            sameData(){
+                this.$confirm("确定要同步数据?").then( _ => {
+                    synchronizeProj(res => {
+                        this.$message.success("同步成功")
+                    })
+                }).catch(_ => {
+                    this.$message("取消同步")
+                })
+            },
             getList(){
                 this.isLoading = true
                 queryDataSourceCount({},res => {