LXXXY 5 gadi atpakaļ
vecāks
revīzija
321901aadd

+ 2 - 2
src/api/point/request.js

@@ -11,14 +11,14 @@ export function getIntegrateStatisticsToLoop(param, success) {
 
 //系统集成统计条形
 export function getIntegrateStatisticsToBar(param, success) {
-    let url = `/pointconfig/datasource/queryWithCount`
+    let url = `/pointconfig/report/meterfunc-statis`
     let data = param
     http.postJson(url, data, success)
 }
 
 //表号功能号总览
 export function getTabFunNumOverview(param, success) {
-    let url = `/ScanBuilding/service/user/query`
+    let url = `/pointconfig/report/meterfunc-overview`
     let data = param
     data = {
         "Comming": 'revit',

+ 18 - 7
src/components/point/report/integrateStatistics.vue

@@ -2,14 +2,14 @@
   <div id="integrateStatistics">
     <!-- 环形表 -->
     <div class="statistics-chart">
-      <div class="chart-title">表号功能号总数量:</div>
+      <div class="chart-title">表号功能号总数量:{{ pointData.tabFuncNumSum }}</div>
       <hr style="width:90%" />
       <div ref="loopchart" class="chart"></div>
       <hr style="width:80%" />
       <div style="padding:15px 10%;line-height:2;">
-        1点位对多表号功能号:{{ pointData[0] }}
+        1点位对多表号功能号:{{ pointData.oneToM }}
         <br />
-        多点为对1表号功能号:{{ pointData[1] }}
+        多点为对1表号功能号:{{ pointData.mToOne }}
         <el-button
           @click="showOverview"
           type="info"
@@ -21,7 +21,7 @@
     </div>
     <!-- 图形图 -->
     <div class="statistics-chart" style="border-top:5px solid #eee;">
-      <div class="chart-title">表号功能号总数量:{{ originalPoint }}</div>
+      <div class="chart-title">共包含原始点位:{{ originalPoint }} 个</div>
       <hr style="width:90%" />
       <div ref="barchart" class="chart" :style="{height:barChartData.length * 120 + 'px'}"></div>
     </div>
@@ -56,7 +56,11 @@ export default {
       loopChartData: [],
       barChartData: [],
       //表号功能号
-      pointData: [1111, 2222],
+      pointData: {
+        tabFuncNumSum:0,
+        oneToM: 0,
+        mToOne: 0
+      },//总数 一对多 多对一
       //原始点数量
       originalPoint: null
     };
@@ -69,9 +73,16 @@ export default {
     loadChart() {
       //获取环形图数据
       getIntegrateStatisticsToBar({}, res => {
+        if(res.Result && res.Result == "success"){
+          this.pointData = {
+            tabFuncNumSum: res.Content[0].Sum,
+            oneToM: res.Content[0].OtoM, 
+            mToOne: res.Content[0].MtoO
+            };
+        }
         this.loopChartData = [
-          { value: 567, name: "已对实例数量" },
-          { value: 324, name: "可断数量" }
+          { value: res.Content[0].RelatedCount, name: "已对实例数量" },
+          { value: res.Content[0].Sum - res.Content[0].RelatedCount, name: "其他" }
         ];
 
         //环形图参数

+ 46 - 8
src/components/point/report/objectInstance.vue

@@ -1,6 +1,7 @@
 <template>
     <!-- 对象实例 -->
     <div id="objectInstance">
+        <div ref="test1"></div>
         <div class="obj-item" v-for="form in forms" :key="form.id">
             <el-form :model="form" label-width="150px">
                 <el-form-item label="对象类型:">
@@ -22,7 +23,7 @@
                     {{form.mesPointVal}}
                 </el-form-item>
                 <el-form-item label="对象实例位置图:">
-                    <img :src="form.instanceMap" class="instanceMap" />
+                    <canvas height="200" width="100" class="instanceMap" :id="form.instanceId"></canvas>
                 </el-form-item>
             </el-form>
         </div>
@@ -32,6 +33,9 @@
 <script>
 import { mapGetters, mapActions } from 'vuex'
 
+import { SGraphyView } from "@sybotan-web/graphy/lib";
+import { DivideFloorScene, } from "cad-engine"
+
 import {
     getTabFunNumObjInstance
 } from '@/api/point/request'
@@ -49,10 +53,14 @@ export default {
                 //     mesPointVal: 'value1',   对应值
                 //     instanceMap: 'm'         对象实例位置图
                 // }
-            ]
+            ],
+            views: [],
+            scenes: [],
+            canvasLoadings: []
         }
     },
     methods: {
+        //加载对象实例
         loadObjectInstance() {
             getTabFunNumObjInstance({}, res => {
                 // this.forms = res;
@@ -71,7 +79,7 @@ export default {
                         objType: 'type2',
                         localName: 'name1',
                         localNum: 'num1',
-                        instanceId: 'id1',
+                        instanceId: 'id2',
                         mesPointName: 'name1',
                         mesPointVal: 'value1',
                         instanceMap: 'm'
@@ -80,7 +88,7 @@ export default {
                         objType: 'type3',
                         localName: 'name1',
                         localNum: 'num1',
-                        instanceId: 'id1',
+                        instanceId: 'id3',
                         mesPointName: 'name1',
                         mesPointVal: 'value1',
                         instanceMap: 'm'
@@ -89,13 +97,44 @@ export default {
                         objType: 'type4',
                         localName: 'name1',
                         localNum: 'num1',
-                        instanceId: 'id1',
+                        instanceId: 'id4',
                         mesPointName: 'name1',
                         mesPointVal: 'value1',
                         instanceMap: 'm'
                     },
-                ]
+                ];
+
+                //加载canvas
+
+                this.forms.map(item => {
+                    let that = this;
+                    that.clearGraphy()
+                    that.views.map(it => {
+                        it
+                    })
+                    that.view = new SGraphyView('floorCanvas')
+                    that.scene = new DivideFloorScene();
+                    that.canvasLoading = true;
+                    let instance = document.getElementById(item.instanceId);
+
+                    let ctx = instance.getContext('2d');
+                    cxt.moveTo(10,10);
+                    cxt.lineTo(150,50);
+                    cxt.lineTo(10,50);
+                    cxt.stroke();
+                });
             })
+        },
+        //清楚画布
+        clearGraphy(){
+            if (this.view) {
+                this.views = [];
+                this.scenes = this.scenes.map(item => {
+                    item.root.children = null;
+                    return item;
+                })
+                this.scenes = [];
+            }
         }
     },
     mounted() {
@@ -122,8 +161,7 @@ export default {
     overflow:auto;
 }
 .instanceMap{
-    height:100px;
-    width:100px;
+    min-height:100px; 
 }
 .obj-item{
     margin: 15px 10px;

+ 15 - 30
src/components/point/report/tabFunNumOverview.vue

@@ -6,33 +6,33 @@
                 <i slot="suffix" class="el-input__icon el-icon-search" @click="getOverViewList()"></i>
             </el-input>
 
-            <el-button size="mini" @click="handleDrawer({},3)" style="float: right;">新增自定义</el-button>
+            <el-button type="primary" size="mini" @click="handleDrawer({},3)" style="float: right;">新增自定义</el-button>
         </div>
         <!-- 数据表格 -->
         <div class="table-area">
             <el-table :data="tableData" style="width: 100%" height="calc(100% - 40px)" v-loading="loading" :header-cell-style="headerStyle">
-                <el-table-column prop='TableNum' label='表号-功能号' show-overflow-tooltip min-width="100"></el-table-column>
-                <el-table-column prop='CoValue' label='对应值(单位)' show-overflow-tooltip min-width="120">
+                <el-table-column prop='MeterFunc' label='表号-功能号' show-overflow-tooltip min-width="100"></el-table-column>
+                <el-table-column prop='Data.Data' label='对应值(单位)' show-overflow-tooltip min-width="120">
                     <template slot-scope="scope">
-                        <span>{{ scope.row.CoValue }}</span>
+                        <span>{{ scope.row.Data.Data }}</span>
                         <i @click="handleDrawer(scope.row, 0)" class="el-icon-s-data"></i>
                     </template>
                 </el-table-column>
-                <el-table-column prop='GetTime' label='获取时间' show-overflow-tooltip>
+                <el-table-column prop='Data.Time' label='获取时间' show-overflow-tooltip>
                     <template slot-scope="scope">
-                        <span>{{ scope.row.GetTime }}</span>
+                        <span>{{ scope.row.Data.Time }}</span>
                         <i class="el-icon-refresh" @click="refreshThisRow(scope.row)"></i>
                     </template>
                 </el-table-column>
-                <el-table-column prop='SubSysPoint' label='涉及子系统点位(数据来源)' show-overflow-tooltip min-width="150">
+                <el-table-column prop='RelatedPoint' label='涉及子系统点位(数据来源)' show-overflow-tooltip min-width="150">
                     <template slot-scope="scope">
-                        <span>{{ scope.row.SubSysPoint }}</span>
+                        <span>{{ scope.row.RelatedPoint }}</span>
                         <i @click="handleDrawer(scope.row, 1)" class="el-icon-coin"></i>
                     </template>
                 </el-table-column>
-                <el-table-column prop='ObjInstance' label='涉及的对象实例(应用到)' show-overflow-tooltip min-width="150">
+                <el-table-column prop='RelatedInstance' label='涉及的对象实例(应用到)' show-overflow-tooltip min-width="150">
                     <template slot-scope="scope">
-                        <span>{{ scope.row.ObjInstance }}</span>
+                        <span>{{ scope.row.RelatedInstance }}</span>
                         <i @click="handleDrawer(scope.row, 2)" class="el-icon-coin"></i>
                     </template>
                 </el-table-column>
@@ -113,32 +113,17 @@ export default {
         getOverViewList(){
             this.loading = true;
             getTabFunNumOverview({}, res => {
-                // this.tableData = res;
-                this.allTableData = [
-                    {TableNum: 'DK1', CoValue: 'DK2', GetTime: 'DK3', SubSysPoint: 'DK4', ObjInstance: 'DK5'},
-                    {TableNum: 'DK2', CoValue: 'DK7', GetTime: 'DK8', SubSysPoint: 'DK9', ObjInstance: 'DK10'},
-                    {TableNum: 'DK3', CoValue: 'DK12', GetTime: 'DK13', SubSysPoint: 'DK14', ObjInstance: 'DK15'},
-                    {TableNum: 'DK4', CoValue: 'DK2', GetTime: 'DK3', SubSysPoint: 'DK4', ObjInstance: 'DK5'},
-                    {TableNum: 'DK5', CoValue: 'DK7', GetTime: 'DK8', SubSysPoint: 'DK9', ObjInstance: 'DK10'},
-                    {TableNum: 'DK6', CoValue: 'DK12', GetTime: 'DK13', SubSysPoint: 'DK14', ObjInstance: 'DK15'},
-                    {TableNum: 'DK7', CoValue: 'DK2', GetTime: 'DK3', SubSysPoint: 'DK4', ObjInstance: 'DK5'},
-                    {TableNum: 'DK8', CoValue: 'DK7', GetTime: 'DK8', SubSysPoint: 'DK9', ObjInstance: 'DK10'},
-                    {TableNum: 'DK9', CoValue: 'DK12', GetTime: 'DK13', SubSysPoint: 'DK14', ObjInstance: 'DK15'},
-                    {TableNum: 'DK10', CoValue: 'DK2', GetTime: 'DK3', SubSysPoint: 'DK4', ObjInstance: 'DK5'},
-                    {TableNum: 'DK11', CoValue: 'DK7', GetTime: 'DK8', SubSysPoint: 'DK9', ObjInstance: 'DK10'},
-                    {TableNum: 'DK12', CoValue: 'DK12', GetTime: 'DK13', SubSysPoint: 'DK14', ObjInstance: 'DK15'},
-                    {TableNum: 'DK13', CoValue: 'DK2', GetTime: 'DK3', SubSysPoint: 'DK4', ObjInstance: 'DK5'},
-                    {TableNum: 'DK14', CoValue: 'DK7', GetTime: 'DK8', SubSysPoint: 'DK9', ObjInstance: 'DK10'},
-                    {TableNum: 'DK15', CoValue: 'DK12', GetTime: 'DK13', SubSysPoint: 'DK14', ObjInstance: 'DK15'}
-                ];
-                this.loading = false;
+                if(res.Result && res.Result == "success"){
+                    this.allTableData = res.Content;
+                    this.loading = false;
+                }
             });        
         },
         //刷新当前行数据
         refreshThisRow(row){
             let index = this.tableData.indexOf(row);
             getTabFunNumOverview({}, res => {
-                this.tableData[index].GetTime = new Date().getTime();
+                this.tableData[index].Data.Time = new Date().getTime();
             });
         },
         //分页更换size