index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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(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>结果导出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. 基准文件:asfsdgagdgf.cid
  28. </span>
  29. </div>
  30. <div>
  31. <span style="font-size: 12px;">
  32. 对比文件:asfsdgagdgf.cid
  33. </span>
  34. </div>
  35. <div class="uploadBox">
  36. <el-upload ref="upload" class="upload-demo" :http-request="nowUpload" :limit="1"
  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"></Gsix>
  46. </div>
  47. </div>
  48. </el-tab-pane>
  49. <el-tab-pane label="SCD可视化" name="second">Config</el-tab-pane>
  50. </el-tabs>
  51. </div>
  52. </template>
  53. <script setup>
  54. import { ref } from "vue";
  55. import netWork from "./components/netWork";
  56. import CidTree from "./components/CidTree.vue";
  57. import Gsix from "./components/Gsix.vue";
  58. import { useRoute } from 'vue-router';
  59. import cid from "@/api/cid/cid";
  60. const activeName = ref("first");//默认展示网络结构图
  61. const navtopData = ref([
  62. { name: "CID一致性校核" },
  63. { name: "SCD文件一致性校核" },
  64. { name: "SCL文件校核" },
  65. { name: "CRC校核" },
  66. { name: "虚端子关系图" },
  67. ]);
  68. const activeNav = ref(null);
  69. const backName = ref('')//树组件返回名称
  70. let mustVal = ref(false)
  71. let fileWater = ref({})//文件流
  72. const clickNav = (navIndex) => { //点击导航栏事件
  73. activeNav.value = navIndex;
  74. }
  75. const handleClick = (val) => {
  76. if (val.props.name == 'first') {
  77. activeNav.value = null
  78. activeName.value = val.props.name
  79. }
  80. }
  81. const treeBack = (data) => {
  82. backName.value = data
  83. }
  84. const closeX = () => {
  85. activeName.value = 'first'
  86. activeNav.value = null
  87. }
  88. const nowUpload = (file, e) => {
  89. console.log(file.file, '上传');
  90. fileWater.value = file.file
  91. cid.fileUpload({ station_id: 1, file: file.file }).then(res => {
  92. console.log(res, '文件上传');
  93. })
  94. }
  95. const handleRemove = (file, e) => {
  96. console.log(file, e, '删除');
  97. }
  98. const fileSuccess = (file, e) => {
  99. mustVal.value = true
  100. }
  101. </script>
  102. <style scoped lang="scss">
  103. $height: 40px;
  104. @mixin mid-center {
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. }
  109. :deep(.el-tabs__item) {
  110. margin: 16px 0 0 32px;
  111. font-size: 18px;
  112. }
  113. :deep(.el-tabs__item:last-child) {
  114. margin-left: 0;
  115. }
  116. :deep(.el-tabs__nav-wrap::after) {
  117. --el-border-color-light: none;
  118. }
  119. :deep(.el-tabs__item.is-active),
  120. :deep(.el-tabs__active-bar) {
  121. color: #255ce7;
  122. }
  123. :deep(.el-tabs__active-bar) {
  124. background-color: #255ce7;
  125. }
  126. //设置导航栏样式
  127. .nav {
  128. @include mid-center;
  129. .nav-item {
  130. width: 144px;
  131. height: $height;
  132. @include mid-center;
  133. margin-right: 8px;
  134. cursor: pointer;
  135. background: #fff url("~@/assets/image/instruct/navtop.png") no-repeat center;
  136. background-size: 144px $height;
  137. }
  138. .nav-item-active {
  139. background: #fff url("~@/assets/image/instruct/navtop_active.png") no-repeat center;
  140. background-size: 144px $height;
  141. }
  142. }
  143. //最外层的滚动条不要
  144. :deep(.el-main) {
  145. // overflow: hidden;
  146. }
  147. //ied的高度
  148. :deep(.network-wrap) {
  149. height: 70vh;
  150. overflow: auto;
  151. }
  152. // 头部导出excel
  153. .mostHead {
  154. width: 97%;
  155. height: auto;
  156. border-bottom: 1px solid #A3ADE0;
  157. margin: 0px auto;
  158. position: relative;
  159. }
  160. .closeX {
  161. font-size: 30px;
  162. position: absolute;
  163. top: 20px;
  164. right: 0px;
  165. cursor: pointer;
  166. }
  167. // CID显示
  168. .disappear {
  169. width: 97%;
  170. height: calc(100vh - 260px);
  171. margin: 0 auto;
  172. display: flex;
  173. justify-content: flex-start;
  174. align-items: center;
  175. }
  176. .abBox {
  177. width: 90%;
  178. height: 5%;
  179. display: flex;
  180. justify-content: space-around;
  181. align-items: center;
  182. background-color: white;
  183. margin-left: 10px;
  184. position: relative;
  185. }
  186. .uploadBox {
  187. position: absolute;
  188. top: 0px;
  189. right: -100px;
  190. }
  191. </style>