فهرست منبع

Merge branch 'graphEq'

shaun-sheep 4 سال پیش
والد
کامیت
d3a7f8cc6d

+ 2 - 2
package.json

@@ -20,9 +20,9 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.27",
-    "@saga-web/cad-engine": "2.0.576",
+    "@saga-web/cad-engine": "2.0.578",
     "@saga-web/draw": "2.1.110",
-    "@saga-web/graph": "2.1.131",
+    "@saga-web/graph": "2.1.133",
     "@saga-web/topology": "1.0.85",
     "axios": "^0.18.0",
     "echarts": "^4.1.0",

+ 2 - 1
src/components/business_space/newGraphy/graphy.vue

@@ -362,7 +362,8 @@
       that.clearGraphy()
       that.scene = new DivideFloorScene();
       that.canvasLoading = true;
-      if (this.FloorMap.split('.')[1].toString() == 'png' || this.FloorMap.split('.')[1].toString() == 'jpg') {
+      const temp = this.FloorMap.split('.')[1]
+      if (temp && temp.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
         // 平面图创建业务空间时再改 增加图片偏移量及缩放比例
         that.scene.loadImg(`/image-service/common/image_get?systemId=dataPlatform&key=${this.FloorMap}`, res => {
           this.getGraphtSuc(res)

+ 2 - 1
src/components/ledger/lib/bimDialog.vue

@@ -170,7 +170,8 @@
             if (this.floorData && this.floorData.StructureInfo && this.floorData.StructureInfo.FloorMap) {
                 this.isdata = true
                 let floorMap = this.floorData.StructureInfo.FloorMap
-                if (floorMap.split('.')[1].toString() == 'png' || floorMap.split('.')[1].toString() == 'jpg') {
+                const temp = floorMap.split('.')[1];
+                if (temp && temp.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
                   this.initGraphy(floorMap, 3)
                 } else {
                   this.initGraphy(floorMap, 2)

+ 60 - 19
src/views/ledger/facility/batchPoint.vue

@@ -4,8 +4,8 @@
 			<el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goback"></el-button>
 			<floor-cascader @change="changeFloor"></floor-cascader>
 			<my-cascader ref="cascader" @change="changeDevice"></my-cascader>
-			<!-- <el-button style="float:right;margin-top:1px;">取消</el-button> -->
-			<el-button @click="handleClickSave" style="float:right;margin-top:1px;margin-right:10px;">保存</el-button>
+			<el-button type="primary" size="mini" @click="handleClickSave" style="float:right;">确认</el-button>
+			<el-button size="mini" style="float:right;margin-right:10px;" @click="cancel">取消</el-button>
 		</el-row>
 		<el-row class="main-container">
 			<el-row class="main-container-header">
@@ -37,7 +37,7 @@
                                     @click="handleSelectIcon(item)"
                                 >
 									<p class="equip-item-text">{{item[showName] || '--'}}</p>
-									<i v-if="item.BIMLocation" class="iconfont icon-hook equip-item-icon" style="color: #67C23A;"></i>
+									<i v-if="item.hasLocation" class="iconfont icon-hook equip-item-icon" style="color: #67C23A;"></i>
 									<i v-else class="iconfont icon-cross equip-item-icon" style="color: #F56C6C;"></i>
 								</li>
 								<p style="text-align: center;" v-if="loading">加载中...</p>
@@ -47,7 +47,7 @@
 						<div v-show="!equipList.length" class="no-data">
 							<div class="position-icon">
 								<i class="icon-wushuju iconfont"></i>
-								数据暂无
+								暂无数据
 							</div>
 						</div>
 					</div>
@@ -77,7 +77,7 @@
                 <el-slider v-model="equipZ" :max="maxHeight" :step="0.0001" show-input></el-slider>
             </div>
             <el-row style="text-align: right;">
-                <el-button type="primary" size="mini" @click="visible = false">取消</el-button>
+                <el-button size="mini" @click="visible = false">取消</el-button>
                 <el-button type="primary" size="mini" @click="handleUpdateZ">确认</el-button>
             </el-row>
         </el-popover>
@@ -149,7 +149,8 @@ export default {
 		pageNumber: 1,
 		pageSize: 50,
         total: 0,
-        isChange: false //平面图设备是否更改
+        isChange: false, //平面图设备是否更改
+        isMarking: false, // 标记是否选中的是无坐标的设备,true-打点,打完以后重置为false
 	};
   },
   computed: {
@@ -194,6 +195,8 @@ export default {
     },
     // 点击列表设备
     handleSelectIcon(equip) {
+        // 保存当前选中设备数据
+        this.equipData = equip;
         // 选中样式处理
         this.equipList.forEach(item => {
             if (equip.EquipID === item.EquipID) {
@@ -202,13 +205,21 @@ export default {
                 item.selected = false;
             }
         })
-        // 关联平面图设备选中
-        if (this.scene) {
-            this.scene.iconList.forEach(item => {
-                if (item.data.id === equip.EquipID) {
-                    this.scene.selectContainer.setItem(item);
-                }
-            })
+        // 有坐标 执行选中
+        if (equip.hasLocation) {
+            // 清除打点动作
+            this.isMarking = false;
+            // 关联平面图设备选中
+            if (this.scene) {
+                this.scene.iconList.forEach(item => {
+                    if (item.data.id === equip.EquipID) {
+                        this.scene.selectContainer.setItem(item);
+                    }
+                })
+            }
+        } else {
+            // 无坐标 执行打点
+            this.isMarking = true;
         }
     },
     handleClickIcon(item, events) {
@@ -284,8 +295,9 @@ export default {
 				params.Filters += `;EquipLocalName contain'${this.keyword}' or EquipLocalID contain '${this.keyword}' or CADID contain '${this.keyword}'`
 			}
 
+	        this.canvasLoading = true;
 			queryEquip(params, (res) => {
-				this.equipList = this.equipList.concat(res.Content.map(item => {item.selected = false; return item;}));
+				this.equipList = this.equipList.concat(res.Content.map(item => {item.selected = false; item.hasLocation = !!item.BIMLocation; return item;}));
 				if (this.view && this.view.scene) {
 					res.Content.forEach(item =>{
 						if (item.LocationJson && item.LocationJson.X && item.LocationJson.Y) {
@@ -294,13 +306,16 @@ export default {
                                 X: item.LocationJson.X, 
                                 Y: -item.LocationJson.Y, 
                                 Z: item.LocationJson.Z,
-                                text: [`${item.EquipLocalName || '--'}\n${item.EquipLocalID || '--'}\n${item.LocationJson.Y || '--'}`]
+                                text: [`${item.EquipLocalName || '--'}\n${item.EquipLocalID || '--'}\n${item.CADID || '--'}`]
                             });
 						}
                     });
                     this.scene.iconMove(this, this.iconMove);
+                    this.scene.spaceClick(this, this.spaceClick);
                     this.scene.iconClick(this, this.handleClickIcon);
 					this.view.update();
+                    this.canvasLoading = false;
+                    this.isChange = false;
 				}
 				this.total = res.Total;
 				if (!this.noMore) { //判断是否有更多数据
@@ -314,6 +329,26 @@ export default {
     iconMove(item) {
         this.isChange = true;
     },
+    // 打点
+    spaceClick(item, e) {
+        if (this.isMarking) {
+            this.scene.addIconText({
+                id: this.equipData.EquipID,
+                X: e[0].x, 
+                Y: e[0].y, 
+                Z: 0,
+                text: [`${this.equipData.EquipLocalName || '--'}\n${this.equipData.EquipLocalID || '--'}\n${this.equipData.CADID || '--'}`]
+            });
+            // 保存按钮
+            this.isChange = true;
+            // 设置有坐标标识
+            this.equipData.hasLocation = true;
+            // 绑定事件
+            this.scene.iconClick(this, this.handleClickIcon)
+            // 重置打点动作
+            this.isMarking = false;
+        }
+    },
 	//初始化条件并查询设备
 	initParams() {
 		this.pageNumber = 1;
@@ -379,7 +414,7 @@ export default {
         if (this.scene && this.scene.iconList.length) {
             let param = {Content: []}
             this.scene.iconList.map((item) => {
-                if (item.data.id && item.data.Z) {
+                if (item.data.id) {
                     param.Content.push({
                         EquipID: item.data.id,
                         BIMLocation: `${item.x},${-item.y},${item.data.Z}`
@@ -387,6 +422,7 @@ export default {
                 }
             })
             updateEquip(param, () => {
+                this.isChange = false
                 this.$message({message: '保存成功!', type: 'success'});
             })
         }
@@ -395,8 +431,9 @@ export default {
     getGraphy() {
       this.scene = new LocationPointScene();
       this.scene.selectContainer.connect('listChange', this, this.listChange)
-	  this.canvasLoading = true;
-      if (this.floorMap.split('.')[1].toString() == 'png' || this.floorMap.split('.')[1].toString() == 'jpg') {
+      this.canvasLoading = true;
+      const temp = this.floorMap.split('.')[1];
+      if (temp && temp.toString().toLowerCase() == 'png' || temp.toString().toLowerCase() == 'jpg') {
         let x = 0;
         let y = 0;
         let scale = 1;
@@ -452,7 +489,11 @@ export default {
 	clearIcon() {
         if (this.scene)
         this.scene.clearIcon();
-	},
+    },
+    // 取消操作
+    cancel() {
+        this.initParams();
+    }
   },
   watch: {
     projectId() {

+ 1 - 1
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -4,7 +4,7 @@
         <div class='buttons'>
             <el-button icon='el-icon-back' size='mini' @click='backRouter'></el-button>
             <template v-if="!hasModel">
-                <el-upload class='upload-demo' action='string' :http-request='uploadAndSubmit' :show-file-list='false' v-if="step==-1">
+                <el-upload class='upload-demo' action='string' :http-request='uploadAndSubmit' :show-file-list='false' v-if="step==-1" accept=".jpg,.png">
                     <el-button size="mini">{{hasGraph?'替换平面图图片':'上传平面图图片'}}</el-button>
                 </el-upload>
                 <el-button style='float:right;' size='mini' type='primary' v-if="step==0" @click="nextStep" :disabled="nextStepBtnDisable">下一步</el-button>