index.vue 8.0 KB

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