index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. <template>
  2. <ComMapBox ref="ComMapBox">
  3. <div class="widget-pipeUnitInfo">
  4. <div class="header">
  5. <div class="wrap">
  6. <div class="title">{{ title }}</div>
  7. <span class="close" @click="close()">
  8. <i class="el-icon-close" />
  9. </span>
  10. </div>
  11. </div>
  12. <div class="content">
  13. <el-tabs value="info">
  14. <el-tab-pane label="概览" name="info"
  15. ><BaseInfo ref="baseInfoPanel" :apiUrls="apiUrls" :currentUnit="currentUnit"
  16. /></el-tab-pane>
  17. <el-tab-pane label="设计" name="design"><Design ref="designPanel" /></el-tab-pane>
  18. <el-tab-pane label="扫码" name="sminfo"><SmInfo ref="scanPanel" /></el-tab-pane>
  19. <el-tab-pane label="质量" name="quality"><Quality ref="qualityPanel" /></el-tab-pane>
  20. <el-tab-pane label="合同材料" name="contract"><Contract ref="contractPanel" /></el-tab-pane>
  21. <el-tab-pane label="图纸档案" name="document"><Dcouments ref="dcoumentPanel" /></el-tab-pane>
  22. </el-tabs>
  23. </div>
  24. </div>
  25. </ComMapBox>
  26. </template>
  27. <script lang="ts">
  28. import _ from 'lodash'
  29. import Config from './config.json'
  30. import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
  31. import ComMapBox from '@/views/groupPage/components/ComMapBox.vue'
  32. //内容组件
  33. import BaseInfo from '@/views/groupPage/districtPageModules/pipeUnitInfo/BaseInfo.vue'
  34. import Design from '@/views/groupPage/districtPageModules/pipeUnitInfo/Design.vue'
  35. import SmInfo from '@/views/groupPage/districtPageModules/pipeUnitInfo/SmInfo.vue'
  36. import Quality from '@/views/groupPage/districtPageModules/pipeUnitInfo/Quality.vue'
  37. import Contract from '@/views/groupPage/districtPageModules/pipeUnitInfo/Contract.vue'
  38. import Dcouments from '@/views/groupPage/districtPageModules/pipeUnitInfo/Documents.vue'
  39. //API以及帮助工具
  40. import apis from '@/api/PipeUnitInfo'
  41. import {
  42. createTooltip,
  43. converCesiumToSuperMapEllipse,
  44. CesiumToSuperMap,
  45. PipeUnitInfoPipe,
  46. queryMapByGeometry,
  47. queryByAttribute,
  48. drawRect
  49. } from '@/views/groupPage/util'
  50. const Cesium = (window as any).Cesium
  51. const SuperMap = (window as any).SuperMap
  52. //属性查看
  53. @Component({ name: 'pipeUnitInfo', components: { ComMapBox, BaseInfo, Design, SmInfo, Quality, Contract, Dcouments } })
  54. export default class pipeUnitInfo extends Vue {
  55. position: Array<any> = []
  56. viewer
  57. primitiveCollection
  58. pointPrimitiveCollection
  59. polylineprimitiveCollection
  60. title: string = ''
  61. apiUrls = {
  62. bjsmidfw: '',
  63. sjdt: '',
  64. sjfw: '',
  65. createPicNode: '/tofly-sxgk/structure/createPicNode', //检查井部件二维码
  66. createPicPipe: '/tofly-sxgk/structure/createPicPipe' //管道部件二维码
  67. }
  68. getDircList = null
  69. pickType = 'point' //点选(point)、框选(rect)模式
  70. clickType = '' //用于点击(click)不缩放情况
  71. isInteractive: boolean = true //是否与gis场景交互
  72. locateUnit = null //用于不合GIS场景交互情况下,查看部件信息{}
  73. toolTip = null
  74. tooltipHandler = null
  75. selectPick = null
  76. currentUnit = {
  77. geoType: '',
  78. code: '',
  79. prjId: ''
  80. }
  81. //computed
  82. get mapConfig() {
  83. return this.$store.state.bigScreen.mapConfig
  84. }
  85. mounted() {
  86. //
  87. this.viewer = (window as any).viewer
  88. this.getDirc(() => {
  89. this.apiUrls.sjfw = this.mapConfig.gisResource.tiplayers.config['sjfw'].url
  90. this.apiUrls.bjsmidfw = this.mapConfig.gisResource.tiplayers.config['bjsmidfw'].url
  91. this.apiUrls.sjdt = this.mapConfig.gisResource.maps.config['sjdt'].url
  92. if (this.isInteractive) {
  93. if (this.pickType === 'point') {
  94. this.addPointClickEvent()
  95. } else {
  96. this.addRectClickEvent()
  97. }
  98. } else {
  99. if (this.locateUnit) {
  100. this.queryForPipeUnitInfoByPBS(this.locateUnit.name, this.locateUnit.id)
  101. }
  102. }
  103. })
  104. }
  105. /**
  106. * 获取图层空间管理信息表
  107. *
  108. */
  109. getDirc(callback) {
  110. let data = {
  111. current: 1,
  112. size: 1000
  113. }
  114. apis.getLayermanagement(data).then((results) => {
  115. this.getDircList = results.result.records
  116. callback()
  117. })
  118. }
  119. //点选
  120. addPointClickEvent() {
  121. this.toolTip = createTooltip(document.querySelector('#' + this.$store.state.bigScreen.mapContainerId))
  122. const handler = new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)
  123. this.tooltipHandler = handler
  124. handler.setInputAction((e) => {
  125. const radius = 2
  126. const position = this.viewer.scene.pickPosition(e.position)
  127. const ellpise = new Cesium.Entity({
  128. position: position,
  129. ellipse: {
  130. semiMajorAxis: radius,
  131. semiMinorAxis: radius,
  132. material: Cesium.Color.ORANGERED,
  133. classificationType: Cesium.ClassificationType.TERRAIN
  134. }
  135. })
  136. this.close()
  137. const positions = converCesiumToSuperMapEllipse(ellpise)
  138. this.queryForPipeUnitInfoByPolygon(positions.positions)
  139. }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
  140. handler.setInputAction((movement) => {
  141. this.toolTip.showAt(movement.endPosition, '<p>鼠标左键确定缓冲中心,右键单击取消</p>')
  142. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE)
  143. this.tooltipHandler.setInputAction(
  144. function (movement) {
  145. this.otherDestroy()
  146. }.bind(this),
  147. Cesium.ScreenSpaceEventType.RIGHT_CLICK
  148. )
  149. }
  150. /**
  151. * 框选查询
  152. */
  153. addRectClickEvent() {
  154. const drawRectHandler = drawRect(
  155. document.querySelector('#' + this.$store.state.bigScreen.mapContainerId),
  156. this.viewer,
  157. (ids) => {
  158. const leftTopPoint = this.viewer.scene.pickPosition(ids.leftTopPoint)
  159. const rightBottomPoint = this.viewer.scene.pickPosition(ids.rightBottomPoint)
  160. const leftBottomPoint = this.viewer.scene.pickPosition(ids.leftBottomPoint)
  161. const rightTopPoint = this.viewer.scene.pickPosition(ids.rightTopPoint)
  162. const positions = [leftTopPoint, leftBottomPoint, rightBottomPoint, rightTopPoint]
  163. this.queryForPipeUnitInfoByPolygon(positions)
  164. }
  165. )
  166. drawRectHandler.activate()
  167. }
  168. /**
  169. * 该方法用于空间查询数据服务
  170. * @param {Cesium.Cartesian3[]} positions 多边形顶点
  171. */
  172. queryForPipeUnitInfoByPolygon(positions) {
  173. const geometry = CesiumToSuperMap.convertPolygon(Cesium, SuperMap, { positions: positions })
  174. const layers = this.viewer.scene.layers
  175. const layerList = layers.layerQueue
  176. const fieldName = Config.fields
  177. const pipeInfo = []
  178. const allPipe = PipeUnitInfoPipe
  179. const filters = []
  180. layerList.forEach((item) => {
  181. if (!item.visible) return false
  182. const pipe = _.find(allPipe, (sjpipe) => {
  183. const isnode = sjpipe.geometryType === 'point' && sjpipe.WELL.indexOf(item.name) > -1
  184. const ispipe = sjpipe.geometryType === 'line' && item.name === sjpipe.name
  185. return (isnode || ispipe) && sjpipe.pipeType === 'SJ'
  186. })
  187. if (!pipe) return false
  188. let unipipeInfo = { dataset: null }
  189. if (pipe.geometryType === 'line') {
  190. unipipeInfo.dataset = pipe.origindataset
  191. } else if (pipe.geometryType === 'point' && pipe.WELL.indexOf(item.name) > -1) {
  192. unipipeInfo.dataset = pipe.origindataset
  193. }
  194. const isExsit = _.find(pipeInfo, (pipeItem) => {
  195. return pipeItem.dataset === unipipeInfo.dataset
  196. })
  197. if (!isExsit) {
  198. pipeInfo.push(unipipeInfo)
  199. const filter = unipipeInfo.dataset + '@' + pipe.datasource
  200. filters.push(filter)
  201. }
  202. })
  203. if (filters.length === 0) return
  204. const onComplete = function (geoResult) {
  205. if (geoResult.originResult.currentCount === 0) {
  206. this.$message.warning('当前范围内无管网数据')
  207. this.close()
  208. return
  209. }
  210. this.flashMapService(geoResult.originResult.recordsets, geoResult.originResult.totalCount)
  211. }.bind(this)
  212. queryMapByGeometry({
  213. url: this.apiUrls.sjdt,
  214. datasetNames: filters,
  215. geometry: geometry,
  216. fields: [fieldName.id, fieldName.pbs, fieldName.pipeID],
  217. completed: onComplete.bind(this),
  218. failed: function (err) {
  219. console.log(err)
  220. }
  221. })
  222. if (!this.primitiveCollection) {
  223. this.primitiveCollection = new Cesium.PrimitiveCollection()
  224. this.viewer.scene.primitives.add(this.primitiveCollection)
  225. }
  226. }
  227. /**
  228. * 该方法用于添加二维管线高亮
  229. * @param records
  230. */
  231. flashMapService(records, totalCount) {
  232. if (!records || records.length === 0) return
  233. if (!this.primitiveCollection) return
  234. const primtCol = this.primitiveCollection
  235. primtCol.removeAll()
  236. this.selectPick = null
  237. records.forEach((record) => {
  238. if (record.features.length == 0) return false
  239. record.features.forEach((feature) => {
  240. const geometry = feature.geometry.points
  241. const geotype = feature.geometry.type.toLowerCase().indexOf('line') > -1 ? 'LINE' : 'POINT'
  242. if (geotype === 'LINE') {
  243. const pointA = Cesium.Cartesian3.fromDegrees(geometry[0].x, geometry[0].y, 200)
  244. const pointB = Cesium.Cartesian3.fromDegrees(geometry[1].x, geometry[1].y, 200)
  245. primtCol.add(this.generaGroundPolyline([pointA, pointB], feature, totalCount === 1))
  246. } else {
  247. const pointS = Cesium.Cartesian3.fromDegrees(geometry[0].x, geometry[0].y, 70)
  248. primtCol.add(this.generaGroundCircle(pointS, 1.5, feature, totalCount === 1))
  249. }
  250. })
  251. })
  252. if (primtCol.length === 1) {
  253. const primitive = primtCol.get(0)
  254. this.showUnitInfoPanel(primitive.geometryInstances.id)
  255. // this.showUnitInfoPanel('HB06BB02.001.01.01.27')
  256. } else {
  257. this.addPrimitiveHandler()
  258. }
  259. }
  260. //添加多选容器
  261. addPrimitiveHandler() {
  262. this.clearDrawEvent()
  263. this.toolTip = createTooltip(document.querySelector('#' + this.$store.state.bigScreen.mapContainerId))
  264. const handler = new Cesium.ScreenSpaceEventHandler(this.viewer.canvas)
  265. this.tooltipHandler = handler
  266. const that = this
  267. handler.setInputAction(function () {}, Cesium.ScreenSpaceEventType.WHEEL)
  268. handler.setInputAction(function (movement) {
  269. that.removeHightLight(that.selectPick)
  270. var pick = that.viewer.scene.drillPick(movement.position)
  271. if (pick.length != 0) {
  272. that.showSelect(pick)
  273. } else {
  274. this.close()
  275. }
  276. }, Cesium.ScreenSpaceEventType.LEFT_CLICK)
  277. handler.setInputAction(
  278. function (movement) {
  279. that.toolTip.showAt(movement.endPosition, '<p>鼠标左键选择高亮管线,右键单击取消</p>')
  280. }.bind(this),
  281. Cesium.ScreenSpaceEventType.MOUSE_MOVE
  282. )
  283. handler.setInputAction(
  284. function (movement) {
  285. that.otherDestroy()
  286. }.bind(this),
  287. Cesium.ScreenSpaceEventType.RIGHT_CLICK
  288. )
  289. }
  290. /**
  291. *
  292. * @param pick 屏幕点击获取到的对象
  293. */
  294. showSelect(pick) {
  295. if (pick.length > 0) {
  296. this.pickHightLight(pick[0])
  297. this.showUnitInfoPanel(pick[0].id)
  298. }
  299. }
  300. /**
  301. * 对象高亮
  302. * @param pick 拾取对象
  303. * @param index 对象索引值
  304. */
  305. pickHightLight(pick) {
  306. var attributes = pick.primitive.getGeometryInstanceAttributes(pick.id) //获取某个实例的属性集
  307. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.fromBytes(255, 125, 0)) //设置其高亮
  308. this.selectPick = pick
  309. }
  310. /**
  311. * 清除对象高亮
  312. * @param pick
  313. * @param index
  314. */
  315. removeHightLight(pick) {
  316. if (pick) {
  317. var attributes = pick.primitive.getGeometryInstanceAttributes(pick.id) //获取某个实例的属性集
  318. attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.fromBytes(0, 255, 255, 100)) //设置其初始颜色
  319. }
  320. }
  321. /**
  322. * 该方法用于生成贴地线图元
  323. * @returns groundPolylinePrimitive
  324. */
  325. generaGroundPolyline(positions, feature, isPicked) {
  326. const fields = Config.fields
  327. const id = feature.fieldValues[feature.fieldNames.indexOf(fields.id)]
  328. const code = feature.fieldValues[feature.fieldNames.indexOf(fields.pbs)]
  329. const pipeId = feature.fieldValues[feature.fieldNames.indexOf(fields.pipeID)]
  330. const color = isPicked
  331. ? new Cesium.ColorGeometryInstanceAttribute(1.0, 0.5, 0.0, 1.0)
  332. : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  333. const instance = new Cesium.GeometryInstance({
  334. geometry: new Cesium.GroundPolylineGeometry({
  335. positions: positions,
  336. width: 15.0
  337. }),
  338. attributes: {
  339. color: color
  340. },
  341. id: code
  342. })
  343. const polyline = new Cesium.GroundPolylinePrimitive({
  344. geometryInstances: instance,
  345. appearance: new Cesium.PolylineColorAppearance(),
  346. classificationType: Cesium.ClassificationType.TERRAIN
  347. })
  348. polyline.custom = { id: id, pipeId: pipeId }
  349. return polyline
  350. }
  351. /**
  352. * 该方法用于生成贴地圆图元
  353. * @returns groundPolylinePrimitive
  354. */
  355. generaGroundCircle(center, axis, feature, isPicked) {
  356. const fields = Config.fields
  357. const id = feature.fieldValues[feature.fieldNames.indexOf(fields.id)]
  358. const code = feature.fieldValues[feature.fieldNames.indexOf(fields.pbs)]
  359. const pipeId = feature.fieldValues[feature.fieldNames.indexOf(fields.pipeID)]
  360. const color = isPicked
  361. ? new Cesium.ColorGeometryInstanceAttribute(1.0, 0.5, 0.0, 1.0)
  362. : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
  363. const instance = new Cesium.GeometryInstance({
  364. geometry: new Cesium.EllipseGeometry({
  365. center: center,
  366. semiMajorAxis: axis,
  367. semiMinorAxis: axis,
  368. height: 100.0
  369. }),
  370. attributes: {
  371. color: color
  372. },
  373. id: code
  374. })
  375. const circle = new Cesium.GroundPrimitive({
  376. geometryInstances: instance,
  377. appearance: new Cesium.PerInstanceColorAppearance({
  378. flat: true,
  379. translucent: false
  380. }),
  381. classificationType: Cesium.ClassificationType.TERRAIN
  382. })
  383. circle.custom = { id: id, pipeId: pipeId }
  384. return circle
  385. }
  386. /**
  387. * 该方法用于根据pbs编码定位部件位置
  388. * @param pbs
  389. */
  390. showUnitInfoPanel(pbs) {
  391. const data = {
  392. pbs: pbs
  393. }
  394. apis.getPidByPbs(data).then((result) => {
  395. if (result.code !== 1) return
  396. let lyName = result.result.layerName
  397. const code = pbs
  398. if (lyName.indexOf(',') > -1) {
  399. lyName = lyName.split(',')[1]
  400. } else {
  401. lyName = lyName
  402. }
  403. this.queryForPipeUnitInfoByPBS(lyName, code)
  404. })
  405. }
  406. /**
  407. * 该方法用于通过iserver接口利用pbs编码查询构件信息
  408. * @param {string} tableName 数据服务中的三维数据表名
  409. * @param {string} code 构件pbs编码
  410. */
  411. queryForPipeUnitInfoByPBS(tableName, code) {
  412. const gl = this
  413. const queryParameter = Config.queryParameter
  414. const datasets = queryParameter.datasets
  415. const dataset = _.find(datasets, function (item) {
  416. return item.layername === tableName
  417. })
  418. if (dataset) {
  419. const options = {
  420. url: this.apiUrls.sjfw,
  421. datasetNames: [queryParameter.dataSource + ':' + dataset.layername],
  422. whereclause: "CODE='" + code + "'",
  423. completed: function (result) {
  424. if (result.result.featureCount > 0) {
  425. // this.clearAllPrimitives() //先清除已存在的高亮对象
  426. //交互式部件查看不需高亮
  427. if (!gl.isInteractive) {
  428. this.entitiesHighLight(result, code, dataset.name)
  429. } //++
  430. const attrs = result.result.features[0].attributes
  431. const geometry = result.originResult.features[0].geometry
  432. const geoType = geometry.type
  433. gl.formPipeAttribs(geoType, attrs)
  434. //添加部件类型
  435. const title = attrs['TYPE'] + ' ' + attrs['PIPE_ID']
  436. gl.location(geometry, () => {
  437. gl.title = title
  438. gl.initPanle()
  439. })
  440. }
  441. }.bind(this),
  442. failed: function (error) {
  443. console.error(error)
  444. }
  445. }
  446. queryByAttribute(options)
  447. }
  448. }
  449. /**
  450. * 该方法用于组织管线或管点属性信息
  451. * @param {object} attrs 属性信息
  452. * @param {string} geotType 几何类型
  453. * @returns {Array<any>} 返回包含中文字段名的信息
  454. */
  455. formPipeAttribs(geotType, attrs) {
  456. const unitType = geotType === 'LINE3D' ? 'LINE' : 'POINT'
  457. const fields = Config.fieldsInfo[unitType]
  458. let info = []
  459. for (let name in fields) {
  460. info.push({ title: fields[name], value: attrs[name] })
  461. }
  462. //记录部件类型和PBScode
  463. this.currentUnit.code = attrs['CODE']
  464. this.currentUnit.prjId = attrs['PRJ_ID']
  465. this.currentUnit.geoType = unitType
  466. return info
  467. }
  468. /**
  469. * 提供对外接口时,定位至构件位置
  470. * @param geometry 几何图形
  471. * @param completed 回调函数
  472. */
  473. location(geometry, completed) {
  474. const position = geometry.position
  475. const location = Cesium.Cartographic.fromDegrees(position.x, position.y, position.z + 50)
  476. const scenePosition = Cesium.Cartographic.fromDegrees(position.x, position.y, position.z)
  477. const cartesian3 = Cesium.Cartographic.toCartesian(location)
  478. ;(this.$refs['ComMapBox'] as any).setPosition(Cesium.Cartographic.toCartesian(scenePosition))
  479. const camera = this.viewer.camera
  480. if (this.clickType === 'click') {
  481. completed()
  482. } else {
  483. camera.flyTo({
  484. destination: cartesian3,
  485. orientation: {
  486. heading: camera.heading,
  487. pitch: Cesium.Math.toRadians(-82),
  488. roll: 0
  489. },
  490. complete: completed()
  491. })
  492. }
  493. }
  494. //各面板数据注入
  495. initPanle() {
  496. //设计信息初始化
  497. let sjhtml = ''
  498. let designInfos: any = this.currentUnit.geoType === 'LINE' ? Config.pipeDesignInfo : Config.pointDesignInfo
  499. let simpleInfos: any = this.currentUnit.geoType === 'LINE' ? Config.fieldsInfo.LINE : Config.fieldsInfo.POINT
  500. designInfos = replaceUpperCase(designInfos, 1)
  501. simpleInfos = replaceUpperCase(simpleInfos, 2)
  502. function replaceUpperCase(obj, type) {
  503. const result = Object.keys(obj).map((item) => {
  504. return {
  505. title: type == 1 ? item : obj[item],
  506. code: type == 1 ? obj[item].replace(/_/g, '').toLowerCase() : item.replace(/_/g, '').toLowerCase()
  507. }
  508. })
  509. return result
  510. }
  511. const apirequest =
  512. this.currentUnit.geoType === 'LINE'
  513. ? apis.getPipeInfo({ code: this.currentUnit.code })
  514. : apis.getNodeInfo({ code: this.currentUnit.code })
  515. apirequest.then((res) => {
  516. let result = res.result
  517. if (res.result.pressureType) {
  518. let indexInfo = ''
  519. switch (res.result.pressureType) {
  520. case '1':
  521. indexInfo = '待建'
  522. break
  523. case '2':
  524. indexInfo = '建设中'
  525. break
  526. case '3':
  527. indexInfo = '完工'
  528. break
  529. }
  530. if (indexInfo != '') {
  531. // let dom = $('.bubbletitle')
  532. // let title = dom.text()
  533. // //modify by tmx 20210630 统一图层和业务库中部件编码显示
  534. // let arrTitle = title.split(' ')
  535. // if (arrTitle.length > 0) {
  536. // dom.text(arrTitle[0] + ' ' + (res.result.pipeId ? res.result.pipeId : '') + '(' + indexInfo + ')')
  537. // } else {
  538. // dom.text(dom.text() + '(' + indexInfo + ')')
  539. // }
  540. }
  541. }
  542. if (result !== null) {
  543. result = Object.keys(result).map((item) => {
  544. let temp = item.toLowerCase()
  545. return {
  546. compare: temp,
  547. value: result[item]
  548. }
  549. })
  550. designInfos.forEach((item) => {
  551. result.forEach((el) => {
  552. if (item.code === el.compare) {
  553. item.value = el.value
  554. }
  555. })
  556. })
  557. simpleInfos.forEach((item) => {
  558. result.forEach((el) => {
  559. if (item.code === el.compare) {
  560. if (item.code == 'flowdirection') {
  561. let value = el.value + ''
  562. item.value = value == '0' ? '起点到终点' : value == '1' ? '终点到起点' : value == '2' ? '双向流动' : '/'
  563. } else {
  564. item.value = el.value
  565. }
  566. }
  567. })
  568. })
  569. //概述信息
  570. ;(this.$refs.baseInfoPanel as any).showUnitInfoPage(res.result, simpleInfos)
  571. //设计信息
  572. ;(this.$refs.designPanel as any).showDesignPage(designInfos)
  573. // 合同信息初始化
  574. ;(this.$refs.contractPanel as any).showhtclPage(result, this.currentUnit)
  575. } else {
  576. // sjhtml += `<tbody>
  577. // <tr><td style="text-align: center">暂无设计信息</td></tr>
  578. // </tbody>`
  579. // this.domObj
  580. // .find('#' + this.unitQualityID)
  581. // .empty()
  582. // .append("<table class='table'>" + sjhtml + '</table>')
  583. }
  584. })
  585. const unitInfo = this.currentUnit
  586. // 质量信息初始化
  587. if (unitInfo.code) {
  588. ;(this.$refs.qualityPanel as any).showUnitQualityPage(unitInfo.code)
  589. }
  590. //扫码信息初始化
  591. if (unitInfo.code && unitInfo.geoType) {
  592. ;(this.$refs.scanPanel as any).showSmInfoPage(unitInfo.geoType, 'CON', unitInfo.code, unitInfo.prjId)
  593. }
  594. //档案信息资料
  595. ;(this.$refs.dcoumentPanel as any).showDAPage(unitInfo)
  596. }
  597. //清除所有元素
  598. otherDestroy() {
  599. this.clearDrawEvent()
  600. this.clearAllPrimitives()
  601. this.$store.state.bigScreen.propertiesViewValue = null
  602. this.close()
  603. }
  604. //清除所有元素并清空属性选择
  605. reset() {
  606. this.clearDrawEvent()
  607. this.clearAllPrimitives()
  608. }
  609. //清除鼠标事件
  610. clearDrawEvent() {
  611. if (this.toolTip) {
  612. this.toolTip.remove()
  613. this.toolTip = null
  614. }
  615. if (this.tooltipHandler && !this.tooltipHandler.isDestroyed()) {
  616. this.tooltipHandler.destroy()
  617. this.tooltipHandler = null
  618. }
  619. }
  620. /**
  621. * 该方法用于清除二维点和线的primitivecollection
  622. */
  623. clearAllPrimitives() {
  624. this.viewer.scene.layers.releaseSelection()
  625. if (this.pointPrimitiveCollection) {
  626. this.pointPrimitiveCollection.removeAll()
  627. const isPointDel = this.viewer.scene.primitives.remove(this.pointPrimitiveCollection)
  628. if (isPointDel) this.pointPrimitiveCollection = null
  629. }
  630. if (this.polylineprimitiveCollection) {
  631. this.polylineprimitiveCollection.removeAll()
  632. const isPolylineDel = this.viewer.scene.primitives.remove(this.polylineprimitiveCollection)
  633. if (isPolylineDel) this.polylineprimitiveCollection = null
  634. }
  635. if (this.primitiveCollection) {
  636. this.primitiveCollection.removeAll()
  637. const isDel = this.viewer.scene.primitives.remove(this.primitiveCollection)
  638. if (isDel) this.primitiveCollection = null
  639. }
  640. }
  641. //关闭弹窗
  642. close() {
  643. ;(this.$refs['ComMapBox'] as any).remove()
  644. }
  645. }
  646. </script>
  647. <style lang='scss' scoped>
  648. .widget-pipeUnitInfo {
  649. height: 2.864583rem /* 550/192 */;
  650. width: 5rem /* 960/192 */;
  651. background-color: rgba(7, 44, 73, 0.86);
  652. .header {
  653. padding: 0.026042rem /* 5/192 */;
  654. background: #0ea7ff;
  655. .wrap {
  656. width: 100%;
  657. display: flex;
  658. justify-content: space-between;
  659. padding: 0.026042rem /* 5/192 */;
  660. background: rgba(6, 13, 25, 1);
  661. box-shadow: 0 0 8px 5px #060d19;
  662. border-radius: 2px;
  663. .title {
  664. font-size: 0.072917rem /* 14/192 */;
  665. font-family: Source Han Sans CN-HEAVY;
  666. font-weight: bold;
  667. color: #0ea7ff;
  668. background: linear-gradient(0deg, #a3d3ff 0%, #e4f3ff 100%);
  669. background-clip: text;
  670. -webkit-text-fill-color: transparent;
  671. }
  672. .close {
  673. color: #a3d3ff;
  674. font-size: 0.083333rem /* 16/192 */;
  675. cursor: pointer;
  676. }
  677. }
  678. }
  679. .content {
  680. padding: 0.052083rem /* 10/192 */ 0.104167rem /* 20/192 */;
  681. >>> .el-tabs {
  682. height: 100%;
  683. width: 100%;
  684. padding: 0;
  685. .el-tabs__item {
  686. font-size: 0.072917rem;
  687. font-weight: 500;
  688. color: rgba(255, 255, 255, 0.8);
  689. }
  690. .el-tabs__item.is-active {
  691. color: #0ea7ff;
  692. background: transparent;
  693. }
  694. .el-tabs__item:hover {
  695. color: #0ea7ff;
  696. }
  697. .el-tabs__content {
  698. height: calc(100% - 42px);
  699. color: #8eb2ce;
  700. }
  701. .el-tab-pane {
  702. height: 100%;
  703. width: 100%;
  704. }
  705. .el-tabs__nav-wrap::after {
  706. background-color: rgba(14, 167, 255, 0.2);
  707. }
  708. }
  709. /deep/ .el-input__inner {
  710. background: rgba(14, 167, 255, 0.2);
  711. border: none;
  712. border-radius: 2px;
  713. color: #e5f4ff;
  714. white-space: nowrap;
  715. text-overflow: ellipsis;
  716. overflow: hidden;
  717. }
  718. >>> .el-input.value {
  719. flex: 0.6;
  720. display: inline-block;
  721. position: relative;
  722. white-space: nowrap;
  723. text-overflow: ellipsis;
  724. overflow: hidden;
  725. color: black;
  726. border: none;
  727. }
  728. >>> span.title {
  729. flex: 0.4;
  730. display: block;
  731. text-align: right;
  732. white-space: nowrap;
  733. text-overflow: ellipsis;
  734. overflow: hidden;
  735. padding: 6px;
  736. position: relative;
  737. float: left;
  738. font-size: 0.072917rem /* 14/192 */;
  739. font-weight: 400;
  740. color: #82bae2;
  741. }
  742. }
  743. .content:after {
  744. content: '';
  745. position: absolute;
  746. bottom: -28px;
  747. left: 50% !important;
  748. border-width: 14px;
  749. border-style: solid;
  750. border-color: transparent #fff;
  751. display: block;
  752. border-top-color: rgba(7, 44, 73, 0.86);
  753. border-left-color: rgba(255, 255, 255, 0);
  754. width: 0;
  755. border-right-color: rgba(255, 255, 255, 0);
  756. border-bottom-color: rgba(255, 255, 255, 0);
  757. }
  758. }
  759. </style>