scdMap.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <div>
  3. <div class="fileBox">
  4. <div>
  5. <span style="border-right: 1px solid #516380;padding-right: 200px;">基准文件:
  6. <!-- {{ chicken }} -->
  7. <span style="color:#09162C;">{{ newChicken}}</span></span>
  8. </div>
  9. <div>
  10. <span>对比文件:<span style="color:#09162C;">{{ kun }}</span></span>
  11. </div>
  12. </div>
  13. <!-- <div class="mapBox" v-if="lookType == 0"> -->
  14. <!-- <div class="scdBox">
  15. <div>
  16. <img src="../../../assets/image/squer_scd.png" alt="">
  17. <p>SCD版本</p>
  18. </div>
  19. <div>
  20. <div id="oldScd">
  21. <img src="../../../assets/icon/cilce_gray.png" alt="">
  22. <span>V1.1.0</span>
  23. </div>
  24. <div id="newScd">
  25. <img src="../../../assets/icon/clice_blue.png" alt="">
  26. <span>V1.1.1</span>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="crcBox">
  31. <div>
  32. <img src="../../../assets/image/squer_crc.png" alt="">
  33. <p>CRC</p>
  34. </div>
  35. <div>
  36. <div id="oldCrc">
  37. <img src="../../../assets/icon/cilce_gray.png" alt="">
  38. <span>1000000111100000</span>
  39. </div>
  40. <div id="newCrc">
  41. <img src="../../../assets/icon/clice_blue.png" alt="">
  42. <span>1000000111100022</span>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="iedBox">
  47. <div id="oldIed">
  48. <img src="../../../assets/image/squer_ied.png" alt="">
  49. <p>IED</p>
  50. </div>
  51. <div id="newIed">
  52. <p id="addId" @click="lookAdd">
  53. <el-icon style="color: #1D48E8;font-size: 18px;display: block;">
  54. <CirclePlus />
  55. </el-icon>
  56. <span style="display: block;color: #1D48E8;">新增(5)</span>
  57. </p>
  58. <p id="editId" @click="lookEdit">
  59. <el-icon style="color: #FECC2A;font-size: 18px;display: block;">
  60. <EditPen />
  61. </el-icon>
  62. <span style="display: block;color: #FECC2A;">修改(10)</span>
  63. </p>
  64. <p id="delId" @click="lookDel">
  65. <el-icon style="color: red;font-size: 18px;display: block;">
  66. <Delete />
  67. </el-icon>
  68. <span style="display: block;color: red;">删除(2)</span>
  69. </p>
  70. </div>
  71. </div> -->
  72. <!-- </div> -->
  73. <div class="right-main">
  74. <ScdNow v-if="lookType == 0" @nowBack="nowBack" :arrNew="arrNew"></ScdNow>
  75. </div>
  76. <ScdAdd v-if="lookType == 1" :arrNew="arrNew"></ScdAdd>
  77. <ScdDel v-if="lookType == 3" :arrNew="arrNew"></ScdDel>
  78. <ScdEdit v-if="lookType == 2" :arrNew="arrNew"></ScdEdit>
  79. </div>
  80. </template>
  81. <script>
  82. import { ref, onMounted, toRefs, watch, onBeforeUnmount } from 'vue';
  83. import LeaderLine from '../../../../public/leader-line.min.js';
  84. import scdCheck from '@/api/scdCheck/scdCheck'
  85. import image from "../utils/image"
  86. import ScdAdd from './ScdAdd.vue';
  87. import ScdDel from './ScdDel.vue';
  88. import ScdEdit from './ScdEdit.vue';
  89. import ScdNow from './ScdNow.vue';
  90. import { ElLoading } from 'element-plus';
  91. import { useRoute } from "vue-router";
  92. export default {
  93. props: {
  94. antherBack: {
  95. type: Array,
  96. required: true
  97. },
  98. activeNav: {
  99. type: Number,
  100. required: true
  101. }
  102. },
  103. setup(props, { emit }) {
  104. let arrNew = ref([])
  105. let chicken = ref('')
  106. const route = useRoute();
  107. let kun = ref('')
  108. let lineList = []//线条显示
  109. let lookType = ref(0)//0为查看整体,1为新增,2为修改,3为删除
  110. watch(() => props.antherBack, (newVal) => {
  111. if(newVal == null) return
  112. arrNew.value = newVal//监听传递数据变化
  113. if (!arrNew.value || !newVal) {
  114. return
  115. } else {
  116. if (arrNew.value.length == 1) {
  117. chicken.value = arrNew.value[0].scd_name
  118. }
  119. if (arrNew.value.length == 2) {
  120. chicken.value = arrNew.value[0].scd_name
  121. kun.value = arrNew.value[1].scd_name
  122. }
  123. }
  124. })
  125. function lastList() {//初始化数据
  126. lookType.value = 0
  127. arrNew.value = props.antherBack
  128. if (!arrNew.value || !props.antherBack) {
  129. if (arrNew.value.length == 1) {
  130. chicken.value = arrNew.value[0].scd_name
  131. }
  132. if (arrNew.value.length == 2) {
  133. chicken.value = arrNew.value[0].scd_name
  134. kun.value = arrNew.value[1].scd_name
  135. }
  136. }
  137. }
  138. function nowBack(data) {
  139. lookType.value = data
  140. }
  141. const openFullScreen2 = () => {
  142. const loading = ElLoading.service({
  143. lock: true,
  144. text: '正在加载',
  145. background: 'rgba(0, 0, 0, 0.7)',
  146. })
  147. setTimeout(() => {
  148. loading.close()
  149. }, 2000)
  150. }
  151. const newChicken = ref('')
  152. onMounted(() => {
  153. newChicken.value = route.query.stationName;
  154. lastList()
  155. openFullScreen2()
  156. })
  157. onBeforeUnmount(() => {
  158. lookType.value = 0
  159. lineList.forEach(line => line.remove());//清除连线
  160. })
  161. return {
  162. chicken,//基准文件
  163. kun,//对比文件
  164. arrNew,//传递数组
  165. lastList,//初始化数据
  166. lineList,//线条显示
  167. lookType,//0为查看整体,1为新增,2为修改,3为删除
  168. nowBack,
  169. openFullScreen2,//加载
  170. newChicken
  171. }
  172. },
  173. components: {
  174. ScdAdd,
  175. ScdDel,
  176. ScdEdit,
  177. ScdNow
  178. }
  179. }
  180. </script>
  181. <style scoped lang="scss">
  182. p {
  183. margin: 0;
  184. padding: 0;
  185. }
  186. .fileBox {
  187. width: 90%;
  188. height: 40px;
  189. background-color: white;
  190. margin: 10px auto;
  191. display: flex;
  192. justify-content: space-around;
  193. align-items: center;
  194. color: #516380;
  195. }
  196. .mapBox {
  197. width: 100%;
  198. height: calc(100vh - 350px);
  199. margin: 0 auto;
  200. display: flex;
  201. justify-content: space-around;
  202. align-items: flex-start;
  203. }
  204. .scdBox {
  205. width: 33%;
  206. height: auto;
  207. text-align: center;
  208. /* border: 1px solid red; */
  209. }
  210. .crcBox {
  211. width: 33%;
  212. height: auto;
  213. text-align: center;
  214. /* border: 1px solid red; */
  215. }
  216. .iedBox {
  217. width: 33%;
  218. height: auto;
  219. text-align: center;
  220. /* border: 1px solid red; */
  221. position: relative;
  222. }
  223. #newIed {
  224. position: absolute;
  225. top: 100px;
  226. right: 0px;
  227. }
  228. #addId {
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. width: 112px;
  233. height: 40px;
  234. border: 1px dashed #1D48E8;
  235. background-color: rgb(239, 243, 255);
  236. border-radius: 5px;
  237. margin-bottom: 20px;
  238. cursor: pointer;
  239. }
  240. #editId {
  241. display: flex;
  242. justify-content: center;
  243. align-items: center;
  244. width: 112px;
  245. height: 40px;
  246. border: 1px dashed #FECC2A;
  247. background-color: rgb(255, 251, 242);
  248. border-radius: 5px;
  249. margin-bottom: 20px;
  250. cursor: pointer;
  251. }
  252. #delId {
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. width: 112px;
  257. height: 40px;
  258. border: 1px dashed red;
  259. background-color: rgb(255, 236, 236);
  260. border-radius: 5px;
  261. margin-bottom: 20px;
  262. cursor: pointer;
  263. }
  264. </style>