|
@@ -14,9 +14,16 @@
|
|
|
<span style="float: left;">对应的工程信息化信息</span>
|
|
|
<el-link icon="el-icon-close" :underline="false" @click="visible = false"></el-link>
|
|
|
</div>-->
|
|
|
-
|
|
|
+ <!-- 点击图标,出现的弹窗 -->
|
|
|
<div v-if='equipIds.length && !tabData.pointData.length' style='margin-top: 10px;'>
|
|
|
- <el-table :data='tabData.tableData' max-height='235' style='width: 100%' @row-click='handleClickEquipDetail' v-loading='eqLoading'>
|
|
|
+ <el-table
|
|
|
+ :data='tabData.tableData'
|
|
|
+ max-height='235'
|
|
|
+ style='width: 100%'
|
|
|
+ @row-click='handleClickEquipDetail'
|
|
|
+ v-loading='eqLoading'
|
|
|
+ :cell-class-name='tableCellClassName'
|
|
|
+ >
|
|
|
<el-table-column prop='sbjc' label='设备简称' width='144' :show-overflow-tooltip='true'></el-table-column>
|
|
|
<el-table-column prop='sl' width='50' label='数量' :show-overflow-tooltip='true'></el-table-column>
|
|
|
<el-table-column prop='sb_status' width='80' label='设备状态' :show-overflow-tooltip='true'></el-table-column>
|
|
@@ -32,7 +39,7 @@
|
|
|
<el-button size="mini" type="primary" @click="visible = false">关闭</el-button>
|
|
|
</div>-->
|
|
|
</div>
|
|
|
-
|
|
|
+ <!-- 点击空间,出现的弹窗 -->
|
|
|
<div v-else-if='!equipIds.length && tabData.pointData.length' style='margin-top: 10px;'>
|
|
|
<ul class='pointList'>
|
|
|
<li v-for='point in tabData.pointData' :key='point.id' @click='handleClickPointDeatil(point)'>
|
|
@@ -45,7 +52,7 @@
|
|
|
<!-- <el-button size="mini" type="primary" @click="visible = false">关闭</el-button> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <!-- 既有空间,又有设备的弹窗 -->
|
|
|
<el-tabs v-else-if='equipIds.length && tabData.pointData.length' v-model='activeName'>
|
|
|
<el-tab-pane label='设备设施' name='equip'>
|
|
|
<el-table
|
|
@@ -53,6 +60,7 @@
|
|
|
max-height='235'
|
|
|
style='width: 100%'
|
|
|
@row-click='handleClickEquipDetail'
|
|
|
+ :cell-class-name='tableCellClassName'
|
|
|
v-loading='eqLoading'
|
|
|
>
|
|
|
<el-table-column prop='sbjc' label='设备简称' width='164' :show-overflow-tooltip='true'></el-table-column>
|
|
@@ -88,6 +96,11 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+/**
|
|
|
+ * @author yunxing
|
|
|
+ * @date 2020年08月21日11:04
|
|
|
+ * @description 停用,已拆除的状态,使用message进行提示
|
|
|
+ */
|
|
|
import { SFengParser, ProjectRf } from '@saga-web/feng-map'
|
|
|
import { SFloorParser, ItemOrder, ItemColor, SPolygonItem, SBoardItem } from '@saga-web/big'
|
|
|
import { FloorView } from '@/lib/FloorView'
|
|
@@ -104,7 +117,7 @@ import bus from '@/utils/bus.js'
|
|
|
import { TipelineItem } from '../../lib/items/TipelineItem'
|
|
|
import { SImageLegendItem } from '../../lib/items/SImageLegendItem'
|
|
|
import equipDetail from '../../views/equipment/table/equipDetail'
|
|
|
-
|
|
|
+import { debounce } from 'lodash'
|
|
|
// import { uuid } from "@/components/mapClass/until";
|
|
|
|
|
|
export default {
|
|
@@ -128,6 +141,10 @@ export default {
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
},
|
|
|
+ statusTextPosition: {
|
|
|
+ top: 0,
|
|
|
+ left: 0,
|
|
|
+ },
|
|
|
visible: false,
|
|
|
eqLoading: true,
|
|
|
equipIds: [],
|
|
@@ -139,6 +156,7 @@ export default {
|
|
|
showBtnWell: false,
|
|
|
count: 0, // 顶楼为多张图时计数器
|
|
|
equipKey: 1, //设备弹窗使用key值,解决打开弹窗数据为上次弹窗的数据
|
|
|
+ statusDisabled: ['停用', '已拆除'], //显示红色的设备状态
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -196,6 +214,7 @@ export default {
|
|
|
queryAssetAll({ data, postParams }).then((res) => {
|
|
|
this.tabData.tableData = res.data.data
|
|
|
this.eqLoading = false
|
|
|
+ console.log(this.tabData)
|
|
|
})
|
|
|
}
|
|
|
this.popoverPosition.top = `${e.clientY}px`
|
|
@@ -215,14 +234,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 查看浮层设备详情
|
|
|
- handleClickEquipDetail(row) {
|
|
|
+ handleClickEquipDetail: debounce(function (row, column, event) {
|
|
|
+ // 设备状态为停用或已拆除时,弹出消息
|
|
|
+ if (this.statusDisabled.includes(row?.sb_status)) {
|
|
|
+ let message = `当前设备为“${row.sb_status}”状态,请前往编辑器重新编辑`
|
|
|
+ // 防止出现多条message
|
|
|
+ // 已经有 message时,并且this.message的message字段与message一致时, 不进行提示
|
|
|
+ if (this.message && this.message.visible && this.message.message === message) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ this.message = this.$message({
|
|
|
+ message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return true
|
|
|
+ }
|
|
|
if (row.assetnum) {
|
|
|
this.equipKey++
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.equipDetail.open({ row: JSON.stringify(row) })
|
|
|
})
|
|
|
}
|
|
|
- },
|
|
|
+ }, 0),
|
|
|
// handleClickEquipDetail(row) {
|
|
|
// if (row.assetuid) {
|
|
|
// window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
|
|
@@ -288,16 +322,16 @@ export default {
|
|
|
if (this.canvasID != `canvas${this.id}`) {
|
|
|
this.canvasID = `canvas${this.id}`
|
|
|
}
|
|
|
- this.getGraphDetail().then(res => {
|
|
|
+ this.getGraphDetail().then((res) => {
|
|
|
if (res.Content.length == 1) {
|
|
|
- const data = res.Content[0];
|
|
|
+ const data = res.Content[0]
|
|
|
if (data.MaxY && data.MinX) {
|
|
|
- window.fengmapData.maxY = data.MaxY;
|
|
|
- window.fengmapData.minX = data.MinX;
|
|
|
+ window.fengmapData.maxY = data.MaxY
|
|
|
+ window.fengmapData.minX = data.MinX
|
|
|
}
|
|
|
}
|
|
|
- this.parserData(floorid);
|
|
|
- });
|
|
|
+ this.parserData(floorid)
|
|
|
+ })
|
|
|
// this.parserData(floorid);
|
|
|
} else if (this.haveFengMap == 0) {
|
|
|
this.view.scene = this.scene
|
|
@@ -661,12 +695,12 @@ export default {
|
|
|
return readGroup(data)
|
|
|
},
|
|
|
// 获取图最大最小值
|
|
|
- getGraphDetail(){
|
|
|
- const categoryId = this.categoryId ? this.categoryId : this.$cookie.get('categoryId');
|
|
|
+ getGraphDetail() {
|
|
|
+ const categoryId = this.categoryId ? this.categoryId : this.$cookie.get('categoryId')
|
|
|
const data = {
|
|
|
- Filters:`categoryId='${categoryId}';projectId='${this.urlMsg.ProjectID}';BuildingID='1';FloorID='${this.floorid}';isPub=true`
|
|
|
- };
|
|
|
- return graphQuery(data);
|
|
|
+ Filters: `categoryId='${categoryId}';projectId='${this.urlMsg.ProjectID}';BuildingID='1';FloorID='${this.floorid}';isPub=true`,
|
|
|
+ }
|
|
|
+ return graphQuery(data)
|
|
|
},
|
|
|
// 地图尺寸
|
|
|
mapSize() {
|
|
@@ -717,13 +751,22 @@ export default {
|
|
|
* 当点击位置不在canvas内部时 ( 如点击 页面空白,图例,楼层,设备设施左侧列表项时),将visible置为false,隐藏popover
|
|
|
*/
|
|
|
handlePopover(e) {
|
|
|
- this.$nextTick(()=>{
|
|
|
- if(!this.$refs.graphy.contains(e.target)){
|
|
|
- console.log(1111)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (!this.$refs.graphy.contains(e.target)) {
|
|
|
this.visible = false
|
|
|
}
|
|
|
+ this.showStatusText = false
|
|
|
+ this.statusText = ''
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @description 设备状态列, 状态为停用或已拆除时,样式红色
|
|
|
+ */
|
|
|
+ tableCellClassName({ row, column, rowIndex, columnIndex }) {
|
|
|
+ if (columnIndex === 2 && this.statusDisabled.includes(row.sb_status)) {
|
|
|
+ return 'status-disabled'
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
'view.scale': {
|
|
@@ -874,5 +917,10 @@ a:hover {
|
|
|
/deep/ .el-tabs__item:nth-child(2) {
|
|
|
border-radius: 4px 0px 0px 4px;
|
|
|
}
|
|
|
+ // 设备状态
|
|
|
+ .status-disabled {
|
|
|
+ color: #c0c4cc !important;
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|