index.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <div class="widget-pipesectionui">
  3. <el-button-group>
  4. <el-button @click="showLayerList">图层控制</el-button>
  5. <el-button @click="showPbsTree">工程列表</el-button>
  6. <el-button @click="showDisplayControlList">显示控制</el-button>
  7. <el-dropdown @command="handleCommand">
  8. <el-button class="unit_handle">
  9. 部件查看<i class="el-icon-arrow-down el-icon--right"></i>
  10. </el-button>
  11. <el-dropdown-menu slot="dropdown">
  12. <el-dropdown-item command="point">点选</el-dropdown-item>
  13. <el-dropdown-item command="rect">框选</el-dropdown-item>
  14. </el-dropdown-menu>
  15. </el-dropdown>
  16. <el-dropdown @command="handleMenu">
  17. <el-button class="pipeInteraction">
  18. 管网交互<i class="el-icon-arrow-down el-icon--right"></i>
  19. </el-button>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item
  22. v-for="item in compMenu"
  23. :key="item.id"
  24. :command="item"
  25. >{{ item.name }}</el-dropdown-item
  26. >
  27. </el-dropdown-menu>
  28. </el-dropdown>
  29. <el-dropdown @command="handleMenu">
  30. <el-button>
  31. 管网分析<i class="el-icon-arrow-down el-icon--right"></i>
  32. </el-button>
  33. <el-dropdown-menu slot="dropdown">
  34. <el-dropdown-item
  35. v-for="item in analysisMenu"
  36. :key="item.id"
  37. :command="item"
  38. >{{ item.name }}</el-dropdown-item
  39. >
  40. </el-dropdown-menu>
  41. </el-dropdown>
  42. </el-button-group>
  43. <!-- <PipeVerticalSectionAnalysis ref="vsAnalysis" />
  44. <PipeCrossSectionAnalysis ref="csAnalysis" /> -->
  45. </div>
  46. </template>
  47. <script>
  48. import Vue from "vue";
  49. // import Store from "@/store/store.js";
  50. import { InfoWindow } from "@/utils/mapCommon/tools";
  51. // import PipeUnitInfo from "@/views/widgets/PipeUnitInfo/index.vue";
  52. // import DiameterMark from "@/views/widgets/DiameterMark/DiameterMark";
  53. // import CoordinateMark from "@/views/widgets/CoordinateMark/CoordinateMark";
  54. // import BoltPointMark from "@/views/widgets/BoltPointMark/BoltPointMark";
  55. // import ElevationMark from "@/views/widgets/ElevationMark/ElevationMark";
  56. // import FlagMark from "@/views/widgets/FlagMark/FlagMark";
  57. // import PipeVerticalSectionAnalysis from "@/views/widgets/PipeVerticalSectionAnalysis/widget.vue"
  58. // import PipeCrossSectionAnalysis from "@/views/widgets/PipeCrossSectionAnalysis/widget.vue"
  59. export default {
  60. name: "TopSectionUI",
  61. components:{
  62. // PipeVerticalSectionAnalysis,
  63. // PipeCrossSectionAnalysis
  64. },
  65. props: {
  66. isInit: false, //三维场景是否初始化
  67. },
  68. data() {
  69. return {
  70. compMenu: [
  71. {
  72. name: "部件二维码",
  73. id: "PartQRCodeManagement",
  74. widgetid: "Panel",
  75. },
  76. {
  77. name: "部件资料上传",
  78. id: "UnitDataUpload",
  79. widgetid: "Panel",
  80. },
  81. {
  82. name: "管底标高标注",
  83. id: "ElevationMark",
  84. widgetid: "Panel",
  85. },
  86. {
  87. name: "管径标注",
  88. id: "DiameterMark",
  89. widgetid: "Panel",
  90. },
  91. {
  92. name: "坐标标注",
  93. id: "CoordinateMark",
  94. widgetid: "Panel",
  95. },
  96. {
  97. name: "栓点标注",
  98. id: "BoltPointMark",
  99. widgetid: "Panel",
  100. },
  101. {
  102. name: "扯旗标注",
  103. id: "FlagMark",
  104. widgetid: "Panel",
  105. },
  106. {
  107. name: "地标标注",
  108. id: "LandMarkMarking",
  109. widgetid: "Panel",
  110. },
  111. {
  112. name: "标注管理",
  113. id: "ManageMarking",
  114. widgetid: "Panel",
  115. },
  116. ],
  117. analysisMenu:[
  118. {
  119. name: "管道开挖综合分析",
  120. id: "PipeCrossMergeAnalysis",
  121. widgetid: "HalfPanel",
  122. },
  123. {
  124. name: "排水专项检查",
  125. id: "DrainSpecialCheck",
  126. widgetid: "Panel",
  127. },
  128. {
  129. name: "开挖分析",
  130. id: "ExcavationAnalysis",
  131. widgetid: "Panel",
  132. },
  133. {
  134. name: "碰撞分析",
  135. id: "ImpactAnalysis",
  136. widgetid: "Panel",
  137. },
  138. {
  139. name: "纵剖面分析",
  140. id: "PipeVerticalSectionAnalysis",
  141. widgetid: "Panel",
  142. },
  143. {
  144. name: "横剖面分析",
  145. id: "PipeCrossSectionAnalysis",
  146. widgetid: "Panel",
  147. },
  148. {
  149. name: "范围分析",
  150. id: "BufferAnalysis",
  151. widgetid: "Panel",
  152. },
  153. {
  154. name: "上/下游追踪分析",
  155. id: "ConnectedAnalysis",
  156. widgetid: "Panel",
  157. },
  158. ],
  159. };
  160. },
  161. watch: {
  162. isInit() {
  163. this.viewer = window.viewer;
  164. },
  165. },
  166. methods: {
  167. showPbsTree() {
  168. const menu = {
  169. label: "PBS工程结构树",
  170. widgetid: "Panel",
  171. id: "PbsTreeManagement",
  172. };
  173. this.$store.dispatch("map/changeMethod", menu);
  174. if (this.$store.state.map.fullPanels.length > 0) {
  175. this.$store.dispatch("map/delAllFull");
  176. }
  177. },
  178. handleMenu(info) {
  179. switch (info.name) {
  180. case "管底标高标注":
  181. const elevationMark = new ElevationMark();
  182. elevationMark.initMarkEvents(this.viewer);
  183. break;
  184. case "管径标注":
  185. const diameterMark = new DiameterMark();
  186. diameterMark.initMarkEvents(this.viewer);
  187. break;
  188. case "坐标标注":
  189. const coordinateMark = new CoordinateMark();
  190. coordinateMark.initMarkEvents(this.viewer);
  191. break;
  192. case "栓点标注":
  193. const boltPointMark = new BoltPointMark();
  194. boltPointMark.initMarkEvents(this.viewer);
  195. break;
  196. case "扯旗标注":
  197. const flagMark = new FlagMark();
  198. flagMark.initMarkEvents(this.viewer);
  199. break;
  200. case "纵剖面分析":
  201. this.initAnalysis("纵剖面分析")
  202. break;
  203. case "横剖面分析":
  204. this.initAnalysis("横剖面分析")
  205. break;
  206. default:
  207. const menu = {
  208. label: info.name,
  209. widgetid: info.widgetid,
  210. id: info.id,
  211. };
  212. this.$store.dispatch("map/changeMethod", menu);
  213. if (
  214. info.widgetid !== "FullPanel" &&
  215. this.$store.state.map.fullPanels.length > 0
  216. ) {
  217. this.$store.dispatch("map/delAllFull");
  218. }
  219. }
  220. },
  221. handleCommand(command) {
  222. if (command === "point") {
  223. this.pointClick();
  224. } else {
  225. this.rectClick();
  226. }
  227. },
  228. /**
  229. 响应分析模块
  230. */
  231. initAnalysis(name) {
  232. if(name=='纵剖面分析'){
  233. this.$refs.vsAnalysis.initMarkEvents()
  234. }
  235. if(name=='横剖面分析'){
  236. this.$refs.csAnalysis.initPipeLayers()
  237. }
  238. },
  239. /**
  240. 点选
  241. */
  242. pointClick() {
  243. const pipeInfoConstructor = Vue.extend(PipeUnitInfo);
  244. const pipeInfo = new pipeInfoConstructor({
  245. data: {
  246. pickType: "point",
  247. isInteractive: true,
  248. locateUnit: null,
  249. },
  250. store: this.$store,
  251. }).$mount();
  252. },
  253. /**
  254. 框选
  255. */
  256. rectClick() {
  257. const pipeInfoConstructor = Vue.extend(PipeUnitInfo);
  258. const pipeInfo = new pipeInfoConstructor({
  259. data: {
  260. pickType: "rect",
  261. isInteractive: true,
  262. locateUnit: null,
  263. },
  264. store: this.$store,
  265. }).$mount();
  266. },
  267. /**
  268. * 图层控制
  269. */
  270. showLayerList(){
  271. const menu = {
  272. label: "图层控制",
  273. widgetid: "Panel",
  274. id: "LayerList",
  275. };
  276. this.$store.dispatch("map/changeMethod", menu);
  277. if (this.$store.state.map.fullPanels.length > 0) {
  278. this.$store.dispatch("map/delAllFull");
  279. }
  280. },
  281. /**
  282. * 显示控制
  283. */
  284. showDisplayControlList(){
  285. const menu = {
  286. label: "显示控制",
  287. widgetid: "Panel",
  288. id: "DisplayControlList",
  289. };
  290. this.$store.dispatch("map/changeMethod", menu);
  291. if (this.$store.state.map.fullPanels.length > 0) {
  292. this.$store.dispatch("map/delAllFull");
  293. }
  294. }
  295. },
  296. };
  297. </script>
  298. <style lang="scss" scoped>
  299. .widget-pipesectionui {
  300. position: absolute;
  301. z-index: 990;
  302. top: 13px;
  303. right: 17px;
  304. display: flex;
  305. flex-flow: row nowrap;
  306. border-radius: 4px;
  307. box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.4);
  308. .el-button {
  309. border-width: 0px;
  310. @media screen and (max-width:1700px) {
  311. padding:12px 10px;
  312. }
  313. }
  314. /deep/ .el-dropdown{
  315. margin: 0 -10px;
  316. }
  317. .el-button-group > .el-button:not(:last-child)::after {
  318. content: " ";
  319. width: 1px;
  320. height: 50%;
  321. background-color: #dedede;
  322. position: absolute;
  323. right: 0;
  324. top: 10px;
  325. z-index: 2;
  326. }
  327. .pipeInteraction{
  328. border-radius: 0;
  329. }
  330. .pipeInteraction::after{
  331. content: " ";
  332. width: 1px;
  333. height: 50%;
  334. background-color: #dedede;
  335. position: absolute;
  336. right: 0;
  337. top: 10px;
  338. z-index: 2;
  339. }
  340. .unit_handle {
  341. border-radius: 0;
  342. padding-right: 15px;
  343. ::after {
  344. content: " ";
  345. width: 1px;
  346. height: 50%;
  347. background-color: #dedede;
  348. position: absolute;
  349. right: 0;
  350. top: 10px;
  351. z-index: 2;
  352. }
  353. }
  354. .el-button:focus {
  355. color: #606266;
  356. background-color: #fff;
  357. }
  358. .el-button:hover {
  359. background-color: #fff;
  360. }
  361. }
  362. </style>