index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <div>
  3. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  4. <div class="nav">
  5. <div v-for="(item, index) in navtopData" :key="index" :class="{ 'nav-item-active': activeNav == index }"
  6. @click="clickNav(item, index)" class="nav-item" style="font-size: 12px">
  7. {{ item.name }}
  8. </div>
  9. </div>
  10. <div class="mostHead" v-if="activeName == 'first' && activeNav == 0">
  11. <h2 style="display: inline-block; margin-right: 2px; font-size: 20px">
  12. CID文件一次性检测
  13. </h2>
  14. <el-button type="primary" plain @click="portExcel">结果导出Excel</el-button>
  15. <span class="closeX" @click="closeX">×</span>
  16. </div>
  17. <el-tab-pane label="网络结构图" name="first">
  18. <net-work v-if="activeName == 'first' && activeNav == null"></net-work>
  19. <div class="disappear" v-if="activeName == 'first' && activeNav == 0">
  20. <!-- 左侧树形数据 -->
  21. <div style="width: 15%">
  22. <CidTree :nowScdId="nowScdId" @treeBack="treeBack"></CidTree>
  23. </div>
  24. <!-- 右侧展示图 -->
  25. <div style="width: 85%; height: calc(100vh - 280px); position: relative">
  26. <div class="abBox">
  27. <div>
  28. <span style="
  29. border-right: 1px solid black;
  30. padding-right: 300px;
  31. font-size: 12px;
  32. ">
  33. 基准文件:{{ arrName }}
  34. </span>
  35. </div>
  36. <div>
  37. <span style="font-size: 12px"> 对比文件:{{ upName }} </span>
  38. </div>
  39. <div class="uploadBox">
  40. <el-upload ref="upload" class="upload-demo" :http-request="nowUpload" :limit="2"
  41. element-loading-text="上传中..." element-loading-background="rgba(255, 255, 255, 0.8)"
  42. :on-remove="handleRemove" :on-change="fileSuccess" :show-file-list="false">
  43. <template #trigger>
  44. <el-button style="border-bottom: 1px solid #7bbafd" type="text" plain>上传CID</el-button>
  45. </template>
  46. </el-upload>
  47. </div>
  48. </div>
  49. <Gsix :activeName="activeName" :activeNav="activeNav" :backName="backName" :mustVal="mustVal"
  50. :arrName="arrName" :upName="upName"></Gsix>
  51. </div>
  52. </div>
  53. <div class="scdCheck" v-if="activeName == 'first' && activeNav == 1">
  54. <div class="mostHead" v-if="activeName == 'first' && activeNav == 1">
  55. <div class="scd-title">SCD文件一次性检测</div>
  56. <span class="closeX" @click="closeX">×</span>
  57. </div>
  58. <!-- 右侧内容 -->
  59. <div
  60. style="
  61. width: 97%;
  62. display: flex;
  63. justify-content: space-between;
  64. align-items: center;
  65. margin-top: 5px;
  66. ">
  67. <div class="treeBtn">
  68. <scdTree :nowStation="nowStation" @scdTreeBack="scdTreeBack"></scdTree>
  69. </div>
  70. <div class="scdMap">
  71. <scdMap :antherBack="antherBack" :activeNav="activeNav"></scdMap>
  72. </div>
  73. </div>
  74. </div>
  75. <CrcCheck v-if="activeName == 'first' && activeNav == 3" :nowScdId="nowScdId"></CrcCheck>
  76. <SlcCheck v-if="activeName == 'first' && activeNav == 2" :nowScdId="nowScdId"></SlcCheck>
  77. <!-- 虚端子关系图 -->
  78. <div v-if="clickNavCode == 'virtual'">
  79. <!-- <virtual-relation
  80. :checkData="checkData"
  81. :isOpen="isOpen"
  82. :iedRelation="iedRelation"
  83. @result="result">
  84. </virtual-relation> -->
  85. </div>
  86. </el-tab-pane>
  87. <el-tab-pane label="SCD可视化" name="second">
  88. <scd-visual v-if="!clickNavCode"></scd-visual>
  89. </el-tab-pane>
  90. </el-tabs>
  91. </div>
  92. </template>
  93. <script setup>
  94. import { ref, watch, onMounted } from "vue";
  95. import netWork from "./components/netWork";
  96. import scdVisual from "./components/scdVisual";
  97. import CidTree from "./components/CidTree.vue";
  98. import Gsix from "./components/Gsix.vue";
  99. import scdTree from "./components/scdTree.vue";
  100. import scdMap from "./components/scdMap.vue";
  101. import CrcCheck from "./newTitle/CrcCheck";
  102. import SlcCheck from "./newTitle/SlcCheck.vue";
  103. import { useRoute } from "vue-router";
  104. import cid from "@/api/cid/cid";
  105. import { ElMessage } from "element-plus";
  106. import systemRow from "@/api/systemRow";
  107. import scdCheck from "@/api/scdCheck/scdCheck";
  108. import virtualRelation from "./components/virtualRelation.vue"; //虚端
  109. let route = useRoute();
  110. const activeName = ref("first"); //默认展示网络结构图
  111. const navtopData = ref([
  112. { name: "CID一致性校核", code: "CID" },
  113. { name: "SCD文件一致性校核", code: "SCD" },
  114. { name: "SCL文件校核", code: "SCL" },
  115. { name: "CRC校核", code: "CRC" },
  116. { name: "虚端子关系图", code: "virtual" },
  117. ]);
  118. const activeNav = ref(null);
  119. const backName = ref('')//树组件返回名称
  120. let mustVal = ref(false)
  121. let upName = ref('')//上传的文件名称
  122. let arrName = ref('')//基准的文件名称
  123. let upFile = ref({})//上传文件流
  124. let backId = ref('')//返回id
  125. let nowScdId = ref('')//路由传参的scdid
  126. let antherBack = ref([])
  127. let nowStation = ref("")//变电站id
  128. watch(() => antherBack.value, (newVal) => {
  129. antherBack.value = newVal
  130. }, {
  131. deep: true
  132. })
  133. const reload = () => {
  134. nowScdId.value = route.query.id
  135. nowStation.value = route.query.station
  136. }
  137. // const clickNav = (navIndex) => { //点击导航栏事件
  138. // activeNav.value = navIndex;
  139. // }
  140. // const handleClick = (val) => {
  141. // if (val.props.name == 'first') {
  142. // activeNav.value = null
  143. // activeName.value = val.props.name
  144. // }
  145. // }
  146. // const reload = () => {
  147. // nowScdId.value = route.query.id;
  148. // };
  149. //虚端子关系====
  150. const isOpen = ref(false);
  151. //虚端子关系====
  152. const clickNavCode = ref(""); //点击导航栏的头部
  153. const clickNav = (item, navIndex) => {
  154. //点击导航栏事件
  155. clickNavCode.value = item.code;
  156. activeNav.value = navIndex;
  157. switch (item.code) {
  158. case "virtual":
  159. isOpen.value = true;
  160. break;
  161. }
  162. };
  163. const handleClick = (val) => {
  164. if (val.props.name == "first") {
  165. activeNav.value = null;
  166. activeName.value = val.props.name;
  167. }
  168. clickNavCode.value = "";
  169. };
  170. const treeBack = (data, ids) => {
  171. backName.value = data;
  172. arrName.value = data;
  173. backId.value = ids;
  174. console.log(ids, "ids");
  175. };
  176. const closeX = () => {
  177. activeName.value = "first";
  178. activeNav.value = null;
  179. };
  180. const nowUpload = (file, e) => {
  181. upFile.value = file.file
  182. upName.value = file.file.name
  183. cid.fileUpload({ station_id: nowStation.value - 0, file: upFile.value, data_type: "cid" }).then(res => {
  184. if (res.code == 0) {
  185. let idp = `${file.file.uid},${backId.value}`
  186. ElMessage({
  187. type: 'success',
  188. message: "上传成功!"
  189. })
  190. scdCheck.scdStart({ type: 'cid', station_id: nowStation.value - 0, ids: idp }).then(res => {
  191. console.log(res, 'show');
  192. })
  193. }
  194. })
  195. };
  196. const handleRemove = (file, e) => {
  197. console.log(file, e, "删除");
  198. };
  199. const fileSuccess = (file, e) => {
  200. mustVal.value = true;
  201. };
  202. function scdTreeBack(data) {
  203. antherBack.value = data;
  204. }
  205. const portExcel = () => {
  206. systemRow
  207. .portExcel({
  208. code: "scd-comp-result",
  209. })
  210. .then((res) => {
  211. if (res.data) {
  212. return;
  213. } else {
  214. ElMessage({
  215. message: res.msg,
  216. type: "info",
  217. });
  218. }
  219. });
  220. };
  221. onMounted(() => {
  222. reload();
  223. });
  224. </script>
  225. <style scoped lang="scss">
  226. $height: 40px;
  227. @mixin mid-center {
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. }
  232. :deep(.el-tabs__item) {
  233. margin: 16px 0 0 32px;
  234. font-size: 18px;
  235. }
  236. :deep(.el-tabs__item:last-child) {
  237. margin-left: 0;
  238. }
  239. :deep(.el-tabs__nav-wrap::after) {
  240. --el-border-color-light: none;
  241. }
  242. :deep(.el-tabs__item.is-active),
  243. :deep(.el-tabs__active-bar) {
  244. color: #255ce7;
  245. }
  246. :deep(.el-tabs__active-bar) {
  247. background-color: #255ce7;
  248. }
  249. //设置导航栏样式
  250. .nav {
  251. @include mid-center;
  252. .nav-item {
  253. width: 144px;
  254. height: $height;
  255. @include mid-center;
  256. margin-right: 8px;
  257. cursor: pointer;
  258. background: #fff url("~@/assets/image/instruct/navtop.png") no-repeat center;
  259. background-size: 144px $height;
  260. }
  261. .nav-item-active {
  262. background: #fff url("~@/assets/image/instruct/navtop_active.png") no-repeat center;
  263. background-size: 144px $height;
  264. color: #fff;
  265. }
  266. }
  267. //最外层的滚动条不要
  268. :deep(.el-main) {
  269. // overflow: hidden;
  270. }
  271. //ied的高度
  272. :deep(.network-wrap) {
  273. height: 70vh;
  274. overflow: auto;
  275. }
  276. // 头部导出excel
  277. .mostHead {
  278. width: 97%;
  279. height: auto;
  280. border-bottom: 1px solid #a3ade0;
  281. margin-bottom: 16px;
  282. display: flex;
  283. justify-content: space-between;
  284. align-items: center;
  285. }
  286. .closeX {
  287. font-size: 24px;
  288. color: #7484ab;
  289. cursor: pointer;
  290. }
  291. // CID显示
  292. .disappear {
  293. width: 97%;
  294. height: calc(100vh - 260px);
  295. margin: 0 auto;
  296. display: flex;
  297. justify-content: flex-start;
  298. align-items: center;
  299. }
  300. .abBox {
  301. width: 90%;
  302. height: 5%;
  303. display: flex;
  304. justify-content: space-around;
  305. align-items: center;
  306. background-color: white;
  307. margin-left: 10px;
  308. position: relative;
  309. }
  310. .uploadBox {
  311. position: absolute;
  312. top: 0px;
  313. right: -100px;
  314. }
  315. .scdCheck {
  316. width: 97.5%;
  317. height: calc(100vh - 205px);
  318. margin: 0 33px;
  319. // border: 1px solid red;
  320. }
  321. .treeBtn {
  322. width: 32%;
  323. // margin-right: 16px;
  324. height: calc(100vh - 205px);
  325. // border: 1px solid rebeccapurple;
  326. }
  327. .scdMap {
  328. width: 67%;
  329. height: calc(100vh - 205px);
  330. // border: 1px solid teal;
  331. background-color: #f6f8fa;
  332. }
  333. //scd一致性校验
  334. .scd-title {
  335. display: inline-block;
  336. margin-right: 2px;
  337. font-size: 16px;
  338. color: #1a2447;
  339. padding-bottom: 12px;
  340. }
  341. </style>