Gsix.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. <template>
  2. <div class="bigBox" id="bigBox">
  3. <div id="leftBox">
  4. <!-- 左左 -->
  5. <div id="topLeft">
  6. <div id="goose">
  7. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/squer.png"
  8. alt="">
  9. <p class="overp" style="">{{ iedName }}</p>
  10. </div>
  11. </div>
  12. <!-- 左中 -->
  13. <div id="mainLeft">
  14. <div class="mainDiv" id="mainOne">
  15. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  16. alt="">
  17. <p>GOOSE通信参数</p>
  18. </div>
  19. <div class="mainDiv" id="mainTwo">
  20. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  21. alt="">
  22. <p>GOOSE通信参数</p>
  23. <img class="iconImg" :src="checkType('gai')" alt="">
  24. </div>
  25. <div class="mainDiv" id="mainThree">
  26. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  27. alt="">
  28. <p>GOOSE通信参数</p>
  29. <img class="iconImg" :src="checkType('shan')" alt="">
  30. </div>
  31. </div>
  32. <!-- 左右 -->
  33. <div id="botLeft">
  34. <div class="botDiv" id="botOne">
  35. <img src="../../../assets/icon/editIp.png" alt="">
  36. <p>123.11.1</p>
  37. </div>
  38. <div class="botDiv" id="botTwo">
  39. <img src="../../../assets/icon/terIp.png" alt="">
  40. <p>255.255.255.0</p>
  41. </div>
  42. <div class="botDiv" id="botThree">
  43. <img src="../../../assets/icon/luIp.png" alt="">
  44. <p>SKT</p>
  45. </div>
  46. </div>
  47. </div>
  48. <div id="rightBox">
  49. <!-- 右左 -->
  50. <div id="topRight">
  51. <div class="tightDiv" id="ditOne">
  52. <img src="../../../assets/icon/editIp.png" alt="">
  53. <p>123.11.2</p>
  54. </div>
  55. <div class="tightDiv" id="ditTwo">
  56. <img src="../../../assets/icon/editIp.png" alt="">
  57. <p>255.255.255.1</p>
  58. </div>
  59. <div class="tightDiv" id="ditThree">
  60. <img src="../../../assets/icon/editIp.png" alt="">
  61. <p>SKY</p>
  62. </div>
  63. <div class="tightDiv1" id="ditFour">
  64. <img src="../../../assets/icon/macIp.png" alt="">
  65. <p>1231698168798</p>
  66. </div>
  67. <div class="tightDiv1" id="ditFive">
  68. <img src="../../../assets/icon/VLAN-ID.png" alt="">
  69. <p>98615</p>
  70. </div>
  71. </div>
  72. <!-- 右中 -->
  73. <div id="mainRight">
  74. <div class="tightMain" id="fitOne">
  75. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  76. alt="">
  77. <p>GOOSE通信参数1</p>
  78. </div>
  79. <div class="tightMain" id="fitTwo">
  80. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  81. alt="">
  82. <p>GOOSE通信参数2</p>
  83. </div>
  84. <div class="tightMain" id="fitThree">
  85. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/goose.png"
  86. alt="">
  87. <p>GOOSE通信参数3</p>
  88. </div>
  89. </div>
  90. <!-- 右右 -->
  91. <div id="botRight">
  92. <div id="upFile">
  93. <img style="width: 80px;height: 80px;border: 1px dashed gray;" src="../../../assets/image/squer.png"
  94. alt="">
  95. <p class="" style="">{{ antherName }}</p>
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import { ref, onMounted, watch, onBeforeUnmount } from 'vue'
  103. import LeaderLine from "../../../../public/leader-line.min.js"
  104. import delSz from '@/assets/icon/shan.png'
  105. import editSz from "@/assets/icon/gai.png"
  106. import addSz from '@/assets/icon/zeng.png'
  107. import G6 from '@antv/g6';
  108. export default {
  109. props: {
  110. activeName: {
  111. type: String,
  112. required: true
  113. },
  114. activeNav: {
  115. type: Number,
  116. required: true
  117. },
  118. backName: {
  119. type: String,
  120. required: true
  121. },
  122. mustVal: {
  123. type: Boolean,
  124. required: true
  125. },
  126. arrName: {
  127. type: String,
  128. required: true
  129. },
  130. upName: {
  131. type: String,
  132. required: true
  133. }
  134. },
  135. setup(props, { emit }) {
  136. let leaderLines = [];//控制线条显示
  137. let iedName = ref('')
  138. let antherName = ref('')
  139. watch(() => props.backName, (newVal) => {
  140. iedName.value = newVal
  141. })
  142. watch(() => props.upName, (newVal) => {
  143. antherName.value = newVal
  144. })
  145. // 判断增删改角标
  146. function checkType(type) {
  147. if (type == 'zeng') {
  148. return addSz
  149. } else if (type == 'gai') {
  150. return editSz
  151. } else if (type == 'shan') {
  152. return delSz
  153. }
  154. }
  155. onMounted(() => {
  156. iedName.value = props.backName
  157. antherName.value = props.upName
  158. let goose = document.getElementById('goose')//左盒子开始元素
  159. let mainOne = document.getElementById('mainOne')//左盒子中部上半区元素
  160. let mainTwo = document.getElementById('mainTwo')//左盒子中部中间元素
  161. let mainThree = document.getElementById('mainThree')//左盒子中部下半区元素
  162. let botOne = document.getElementById('botOne')//左盒子右部上半
  163. let botTwo = document.getElementById('botTwo')//左盒子右部中间
  164. let botThree = document.getElementById('botThree')//左盒子右部下半
  165. let upFile = document.getElementById('upFile')//右盒子开始元素
  166. let ditOne = document.getElementById('ditOne')//右盒子左侧上方
  167. let ditTwo = document.getElementById('ditTwo')//右盒子左侧中部
  168. let ditThree = document.getElementById('ditThree')//右盒子左侧下方
  169. let ditFive = document.getElementById('ditFive')
  170. let ditFour = document.getElementById('ditFour')
  171. let fitOne = document.getElementById("fitOne")//右盒子中部上方
  172. let fitTwo = document.getElementById("fitTwo")//右盒子中部中部
  173. let fitThree = document.getElementById("fitThree")//右盒子中部下方
  174. // 连线开始文字startLabel: "开始",
  175. // 连线中间文字middleLabel: "中间",
  176. // 连线结束文字endLabel: "结束",
  177. // 左部分连线
  178. leaderLines.push(new LeaderLine(goose, mainOne, { color: 'gray', size: 2, path: "grid" }))//左连中
  179. leaderLines.push(new LeaderLine(goose, mainTwo, { color: 'gray', size: 2, path: "grid" }))//左连中
  180. leaderLines.push(new LeaderLine(goose, mainThree, { color: 'gray', size: 2, path: "grid" }))//左连中
  181. leaderLines.push(new LeaderLine(mainTwo, botOne, { color: 'orange', size: 2, path: "grid", endLabel: "装置IP", startSocket: "center", }))//中连右
  182. leaderLines.push(new LeaderLine(mainTwo, botTwo, { color: 'orange', size: 2, path: "grid", endLabel: "掩码", startLabel: "修改" }))//中连右
  183. leaderLines.push(new LeaderLine(mainTwo, botThree, { color: 'orange', size: 2, path: "grid", endLabel: '网关' }))//中连右
  184. // 右部分连线
  185. leaderLines.push(new LeaderLine(upFile, fitOne, { color: 'gray', size: 2, path: "grid" }))//右连中
  186. leaderLines.push(new LeaderLine(upFile, fitTwo, { color: 'gray', size: 2, path: "grid" }))//右连中
  187. leaderLines.push(new LeaderLine(upFile, fitThree, { color: 'gray', size: 2, path: "grid" }))//右连中
  188. leaderLines.push(new LeaderLine(fitTwo, ditOne, { color: 'orange', size: 2, path: "grid" }))//中连左
  189. leaderLines.push(new LeaderLine(fitTwo, ditTwo, { color: 'orange', size: 2, path: "grid" }))//中连左
  190. leaderLines.push(new LeaderLine(fitTwo, ditThree, { color: 'orange', size: 2, path: "grid" }))//中连左
  191. leaderLines.push(new LeaderLine(fitThree, ditFive, { color: 'red', size: 2, path: "grid", startLabel: "删除" }))//中连左
  192. leaderLines.push(new LeaderLine(fitThree, ditFour, { color: 'red', size: 2, path: "grid" }))//中连左
  193. leaderLines.push(new LeaderLine(mainThree, ditFour, { color: 'red', size: 2, path: "grid", startLabel: "删除", endLabel: "MAC地址" }))//中连左
  194. leaderLines.push(new LeaderLine(mainThree, ditFive, { color: 'red', size: 2, path: "grid", endLabel: "VLAN-IP" }))//中连左
  195. // 公共连线
  196. // 连线开始点样式
  197. // disc 圆形 , square 方形 , arrow1 箭头1 , arrow2 箭头2 , arrow3 箭头3 ,
  198. // hand 手指 , crosshair 十字准线 , behind 无(默认)
  199. /*
  200. 以下为示例
  201. */
  202. // leaderLines.push(new LeaderLine(mainTwo, fitTwo, {
  203. // color: "orange",//连接线颜色
  204. // size: 10,//连接线宽度
  205. // path: "grid",//连接线样式
  206. // startSocket: "bottom",//开始链接元素位置
  207. // endSocket: "bottom",//结束链接元素位置
  208. // dash: {
  209. // // 绘制线的长度 'auto'=size*2
  210. // len: 1,
  211. // // 绘制线之间的间隙 'auto'=size
  212. // gap: 6,
  213. // // 线条滚动 true 是(或者{duration: 1000, timing: 'linear'},详见动画选项), false 否(默认)
  214. // animation: {
  215. // duration: 800,//动画速度
  216. // timing: "linear",
  217. // },
  218. // },//动画开启
  219. // endPlug: 'arrow3',//结束箭头
  220. // endPlugSize: 0.5,//结束箭头size
  221. // }))
  222. })
  223. onBeforeUnmount(() => {
  224. leaderLines.forEach(line => line.remove());//清除连线
  225. })
  226. return {
  227. iedName,
  228. checkType,
  229. antherName,
  230. }
  231. }
  232. }
  233. </script>
  234. <style scoped>
  235. p,
  236. h1,
  237. h2 {
  238. padding: 0;
  239. margin: 0;
  240. }
  241. p,
  242. h2 {
  243. font-size: 12px;
  244. }
  245. .bigBox {
  246. width: 99%;
  247. height: 96%;
  248. margin-left: 10px;
  249. /* border: 1px solid red; */
  250. display: flex;
  251. justify-content: space-around;
  252. align-items: center;
  253. }
  254. #leftBox {
  255. width: 50%;
  256. height: 100%;
  257. /* border: 1px solid green; */
  258. display: flex;
  259. justify-content: space-around;
  260. align-items: center;
  261. }
  262. #topLeft {
  263. width: 23%;
  264. height: 100%;
  265. display: flex;
  266. justify-content: space-around;
  267. align-items: center;
  268. }
  269. #mainLeft {
  270. width: 23%;
  271. height: 100%;
  272. text-align: center;
  273. display: grid;
  274. place-items: center;
  275. }
  276. #botLeft {
  277. width: 53%;
  278. height: 100%;
  279. }
  280. /* ↓ */
  281. #rightBox {
  282. width: 50%;
  283. height: 100%;
  284. /* border: 1px solid blue; */
  285. display: flex;
  286. justify-content: space-around;
  287. align-items: center;
  288. }
  289. #puBox {
  290. width: 50%;
  291. height: 100%;
  292. /* border: 1px solid blue; */
  293. display: flex;
  294. justify-content: space-around;
  295. align-items: center;
  296. }
  297. #topRight {
  298. width: 53%;
  299. height: 100%;
  300. /* border: 1px solid red; */
  301. display: flex;
  302. flex-direction: column;
  303. align-items: flex-start;
  304. }
  305. #mainRight {
  306. width: 23%;
  307. height: 100%;
  308. /* border: 1px solid red; */
  309. text-align: center;
  310. display: grid;
  311. place-items: center;
  312. }
  313. #botRight {
  314. width: 23%;
  315. height: 100%;
  316. /* border: 1px solid red; */
  317. display: flex;
  318. justify-content: space-around;
  319. align-items: center;
  320. }
  321. /* ↑ */
  322. #goose {
  323. width: 80px;
  324. height: 100px;
  325. text-align: center;
  326. }
  327. #upFile {
  328. width: 80px;
  329. height: 100px;
  330. text-align: center;
  331. }
  332. .mainDiv {
  333. width: 90px;
  334. height: 100px;
  335. text-align: center;
  336. position: relative;
  337. }
  338. .tightMain {
  339. width: 90px;
  340. height: 100px;
  341. text-align: center;
  342. }
  343. .botDiv {
  344. width: 180px;
  345. height: 60px;
  346. border: 1px dashed orange;
  347. border-right: none;
  348. margin-left: auto;
  349. /* 将子元素推向右侧 */
  350. margin-top: 20px;
  351. background-color: #FAF6F3;
  352. text-align: center;
  353. }
  354. .tightDiv {
  355. width: 180px;
  356. height: 60px;
  357. border: 1px dashed orange;
  358. border-left: none;
  359. margin-right: auto;
  360. /* 将子元素推向右侧 */
  361. margin-top: 20px;
  362. background-color: #FAF6F3;
  363. text-align: center;
  364. }
  365. .tightDiv1 {
  366. width: 80px;
  367. height: 60px;
  368. border: 1px dashed red;
  369. /* border-left: none; */
  370. margin-right: auto;
  371. /* 将子元素推向右侧 */
  372. margin-top: 20px;
  373. background-color: #FAF6F3;
  374. text-align: center;
  375. }
  376. #botLeft {
  377. display: flex;
  378. flex-direction: column;
  379. align-items: flex-start;
  380. }
  381. .overp {
  382. width: 90px;
  383. overflow: hidden;
  384. white-space: nowrap;
  385. text-overflow: ellipsis;
  386. }
  387. .overp:hover {
  388. overflow: visible;
  389. }
  390. .iconImg {
  391. position: absolute;
  392. top: -5px;
  393. right: 0px;
  394. }</style>