chuwu пре 5 година
родитељ
комит
cb2c28d174

+ 77 - 67
src/components/business_space/graphy/business.vue

@@ -15,80 +15,83 @@
                 <el-autocomplete popper-class="my-autocomplete" v-model="search" :fetch-suggestions="querySearch" placeholder="输入平面图中已有的业务空间名称进行查找" size="small" width="180px" @select="handleSelect">
                     <i class="el-icon-search el-input__icon" slot="suffix" @click="handleIconClick"></i>
                     <template slot-scope="{ item }">
-                <div class="name" style="position: relative;">
-                  {{ item.infos.RoomLocalName |cutString(8) }}
-                  <span
-                    class="addr"
-                    style="position: absolute;right:10px;color:#409EFF;"
-                  >定位</span>
+                        <div class="name" style="position: relative;">
+                        {{ item.infos.RoomLocalName |cutString(8) }}
+                        <span
+                            class="addr"
+                            style="position: absolute;right:10px;color:#409EFF;"
+                        >定位</span>
+                        </div>
+                    </template>
+                </el-autocomplete>
+                <el-button style="margin-left:10px;" type="text" @click="clearDimension">收起</el-button>
+             </div>
+            <!-- 点击元空间显示 -->
+            <div v-show="type == 3">
+                <div class="div50">
+                <el-button
+                    class="float-right"
+                    size="small"
+                    @click="SpaceDialog"
+                    type="primary"
+                    plain
+                >从未关联元空间的业务空间中选择</el-button>
                 </div>
-</template>
-        </el-autocomplete>
-        <el-button style="margin-left:10px;" type="text" @click="clearDimension">收起</el-button>
-      </div>
-      <!-- 点击元空间显示 -->
-      <div v-show="type == 3">
-        <div class="div50">
-          <el-button
-            class="float-right"
-            size="small"
-            @click="SpaceDialog"
-            type="primary"
-            plain
-          >从未关联元空间的业务空间中选择</el-button>
-        </div>
-        <div class="div50">
-          <el-button @click="clearDimension" size="small" plain>取 消</el-button>
-          <el-button size="small" @click="createSP" type="primary">创建新的业务空间</el-button>
-        </div>
-      </div>
-      <!-- 点击业务空间显示 -->
-      <div v-show="type == 4">
-        <div class="div50">
-          <el-button class="float-right" size="small" @click="divide" type="primary" plain>重新划分业务空间</el-button>
+                <div class="div50">
+                <el-button @click="clearDimension" size="small" plain>取 消</el-button>
+                <el-button size="small" @click="createSP" type="primary">创建新的业务空间</el-button>
+                </div>
+            </div>
+        <!-- 点击业务空间显示 -->
+        <div v-show="type == 4">
+            <div class="div50">
+            <el-button class="float-right" size="small" @click="divide" type="primary" plain>重新划分业务空间</el-button>
+            </div>
+            <div class="div50">
+            <el-button @click="clearDimension" size="small" plain>取 消</el-button>
+            <el-button @click="bussinDea" size="small" type="primary">查看详情</el-button>
+            </div>
         </div>
-        <div class="div50">
-          <el-button @click="clearDimension" size="small" plain>取 消</el-button>
-          <el-button @click="bussinDea" size="small" type="primary">查看详情</el-button>
+        <!-- 点击业务空间后点击元空间 -->
+        <div v-show="type == 5">
+            <div class="div50">
+            <el-button @click="clearDimension" class="float-right" size="small" plain>取 消</el-button>
+            </div>
+            <div class="div50">
+            <el-button size="small" @click="saveChange" type="primary">保存修改</el-button>
+            </div>
         </div>
-      </div>
-      <!-- 点击业务空间后点击元空间 -->
-      <div v-show="type == 5">
-        <div class="div50">
-          <el-button @click="clearDimension" class="float-right" size="small" plain>取 消</el-button>
+        <el-button
+            v-show="type == 1"
+            @click="getPiss"
+            style="position: absolute;top: 10px;right: 10px;"
+            size="small"
+            type="text"
+        >未关联元空间的业务空间 {{num}} 条</el-button>
         </div>
-        <div class="div50">
-          <el-button size="small" @click="saveChange" type="primary">保存修改</el-button>
+        <div
+        v-show="hasMap"
+        ref="canvasWidth"
+        class="canvasWidth"
+        v-loading="myLoading"
+        style="width:100%;"
+        >
+        <canvas :id="canvasId + 'canvas' " :width="canvasW" :height="canvasH"></canvas>
+        <div
+            style="height: 30px;overflow: hidden;z-index:99;transform: translateX(-50%);position: absolute;bottom: 10%;left: 50%;"
+        >
+            <el-button size="small" @click="smallSize" type="primary">- 缩小</el-button>
+            <el-button size="small" @click="suitableSize" type="primary">合适比例</el-button>
+            <el-button size="small" @click="bigSize" type="primary">+ 放大</el-button>
         </div>
-      </div>
-      <el-button
-        v-show="type == 1"
-        @click="getPiss"
-        style="position: absolute;top: 10px;right: 10px;"
-        size="small"
-        type="text"
-      >未关联元空间的业务空间 {{num}} 条</el-button>
     </div>
     <div
-      v-show="hasMap"
-      ref="canvasWidth"
-      class="canvasWidth"
-      v-loading="myLoading"
-      style="width:100%;"
+      v-show="!hasMap"
+      class="center"
     >
-      <canvas :id="canvasId + 'canvas' " :width="canvasW" :height="canvasH"></canvas>
-      <div
-        style="height: 30px;overflow: hidden;z-index:99;transform: translateX(-50%);position: absolute;bottom: 10%;left: 50%;"
-      >
-        <el-button size="small" @click="smallSize" type="primary">- 缩小</el-button>
-        <el-button size="small" @click="suitableSize" type="primary">合适比例</el-button>
-        <el-button size="small" @click="bigSize" type="primary">+ 放大</el-button>
-      </div>
+        <i class="iconwushuju iconfont"></i>
+        {{!!buildMess ? '请初始化平面图' : '请选择楼层'}}
     </div>
-    <div
-      v-show="!hasMap"
-      style="width:100%;line-height:500px;font-size:20px;text-align:center;color:#ccc;"
-    >请初始化平面图</div>
     <el-dialog title="提示" :visible.sync="dialogVisible" :before-close="clearDimension" width="30%">
       <p style="color:red;line-height:24px;margin-bottom: 10px;" v-show="isAbutMsg">注意:您选择的元空间并未相邻!</p>
       <p style="line-height:24px;margin-bottom: 10px;">请输入创建的业务空间名:</p>
@@ -267,7 +270,7 @@
                 graphyId: "",
                 relationList: [],
                 myLoading: false,
-                hasMap: true,
+                hasMap: false,
                 ruleForm: {
                     name: ""
                 },
@@ -444,6 +447,7 @@
                             // console.log("reader获取完毕")
                             var binaryString = readerEvt.target.result;
                             // let base64Data = btoa(binaryString)
+                            //解压数据
                             let base64Data = btoa(binaryString)
                             let unGzipData = pako.unzip(base64Data)
                             // console.log(unGzipData)
@@ -475,7 +479,13 @@
                             } else {
                                 _this.$message("没有元空间数据")
                             }
-                            _this.bimIdToId(ids, data);
+                            console.log(ids,'ids')
+                            if(!!ids && ids.length){
+                                _this.bimIdToId(ids, data);
+                            }else{
+                                //没有id没有map
+                                _this.hasMap = false
+                            }
                             _this.myLoading = true;
                         };
                         // console.log(reader)

+ 10 - 1
src/fetch/point_http.js

@@ -330,4 +330,13 @@ export function synchronizeProj(success) {
 }
 
 //ai自动识别
-// export function
+export function AIFindPoint(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/ai`, data, success)
+}
+
+//ai识别进度
+export function AIPlan(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/query-ai`, data, success)
+}

+ 2 - 1
src/views/point/config_point/steps/step1.vue

@@ -198,7 +198,8 @@
                     }),
                     type: this.protocolType
                 }
-                if (!param.length) {
+                console.log(delData,'delllll')
+                if (!delData.length) {
                     return false
                 }
                 this.$confirm('你确定要删除点位吗?').then(_ => {

+ 41 - 11
src/views/point/config_point/steps/step2.vue

@@ -33,9 +33,9 @@
         <own-dialog :width="'500px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="localFalgChange">
             <localtion-falg :renderData="renderData" @changeTag="changeLoc"></localtion-falg>
         </own-dialog>
-        <own-dialog :width="'500px'" :footer="footer" :index="true" :escape="false" :isModel="false" title="AI自动识别" :dialogVisible="aiDialog" @confirm="isTrue" @cancel="localFalgChange">
+        <own-dialog :width="'500px'" :footer="footer" :index="true" :escape="false" :isModel="false" title="AI自动识别" :dialogVisible="aiDialog" @confirm="isTrue" @cancel="aiClose">
             <!-- <localtion-falg :renderData="renderData" @changeTag="changeLoc"></localtion-falg> -->
-            <el-progress v-if="isTrue" :text-inside="true" :stroke-width="18" :percentage="usedNum"></el-progress>
+            <el-progress v-if="hadTrue" :text-inside="true" :stroke-width="18" :percentage="usedNum"></el-progress>
             <div v-else>
                 <p>确认要人工智能识别么?</p>
             </div>
@@ -59,7 +59,9 @@
     import {
         queryPoint,
         updatePoint,
-        deletePoint
+        deletePoint,
+        AIFindPoint,
+        AIPlan
     } from "@/fetch/point_http"
     import findKeyword from "@/components/config_point/find_keyword"
     import pagination from "@/components/common/myPagination"
@@ -89,7 +91,7 @@
                 renderData: {},
                 isLoading: false,
                 aiDialog: false,
-                isTrue: false,//是否确定人工智能升级
+                hadTrue: false,//是否确定人工智能升级
                 usedNum: 0,//识别百分比
                 footer:{}
             }
@@ -113,20 +115,44 @@
         },
         methods: {
             clickTable(info, row) {
-                // let activeCell = this.hot.getActiveEditor()
-                // this.renderData = info
-                // console.log(activeCell, 'activeCell')
-                // if (activeCell.prop == "LocationFlag") {
-                //     this.localtionDialog = true
-                // }
+                let activeCell = this.hot.getActiveEditor()
+                this.renderData = info
+                console.log(activeCell, 'activeCell')
+                if (activeCell.prop == "LocationFlag") {
+                    this.localtionDialog = true
+                }
             },
             //人工智能识别
             aiDiscern(){
+                // this.hadTrue = false
+                // this.footer = {}
                 // this.aiDialog = true
             },
             //确认人工识别
             isTrue(){
-                
+                console.log("222")
+                AIFindPoint({
+                    data: {
+                        DataSourceId: this.datasourceId
+                    },
+                    type: this.protocolType
+                },res => {
+                    this.timer = setInterval(() => {
+                        this.getSchedule()
+                    }, 1000)
+                    this.hadTrue = true
+                    this.footer = null
+                })
+            },
+            async getSchedule(){
+                await AIPlan({
+                    type: this.protocolType,
+                    data: {
+                        DataSourceId: this.datasourceId
+                    }
+                },res => {
+                    console.log(res)
+                })
             },
             changeLoc(val) {
                 this.renderData.LocationFlag = val
@@ -139,6 +165,10 @@
                 }
                 return false
             },
+            //关闭人工智能弹窗
+            aiClose(){
+                this.aiDialog = false
+            },
             //刷新
             reset() {
                 if (!this.changeFlag) {