123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <template>
- <div>
- <el-tabs v-model="activeName" class="demo-tabs">
- <div class="nav">
- <div v-for="(item, index) in navtopData" :key="index" :class="{ 'nav-item-active': activeNav == index }"
- @click="clickNav(index)" class="nav-item" style="font-size: 12px;">
- {{ item.name }}
- </div>
- </div>
- <div class="mostHead" v-if="activeName == 'first' && activeNav == 0">
- <h2 style="display: inline-block;margin-right: 2px;font-size: 20px;">CID文件一次性检测</h2>
- <el-button type="primary" plain @click="portExcel">结果导出Excel</el-button>
- <span class="closeX" @click="closeX">×</span>
- </div>
- <el-tab-pane label="网络结构图" name="first">
- <net-work v-if="activeName == 'first' && activeNav == null"></net-work>
- <div class="disappear" v-if="activeName == 'first' && activeNav == 0">
- <!-- 左侧树形数据 -->
- <div style="width: 15%;">
- <CidTree @treeBack="treeBack"></CidTree>
- </div>
- <!-- 右侧展示图 -->
- <div style="width: 85%; height: calc(100vh - 280px);position: relative;">
- <div class="abBox">
- <div>
- <span style="border-right: 1px solid black;padding-right: 300px;font-size: 12px;">
- 基准文件:{{ arrName }}
- </span>
- </div>
- <div>
- <span style="font-size: 12px;">
- 对比文件:{{ upName }}
- </span>
- </div>
- <div class="uploadBox">
- <el-upload ref="upload" class="upload-demo" :http-request="nowUpload" :limit="2"
- element-loading-text="上传中..." element-loading-background="rgba(255, 255, 255, 0.8)"
- :on-remove="handleRemove" :on-change="fileSuccess" :show-file-list="false">
- <template #trigger>
- <el-button style="border-bottom: 1px solid #7BBAFD;" type="text" plain>上传CID</el-button>
- </template>
- </el-upload>
- </div>
- </div>
- <Gsix :activeName="activeName" :activeNav="activeNav" :backName="backName" :mustVal="mustVal"
- :arrName="arrName" :upName="upName"></Gsix>
- </div>
- </div>
- <div class="scdCheck" v-if="activeName == 'first' && activeNav == 1">
- <div class="mostHead" v-if="activeName == 'first' && activeNav == 1">
- <h2 style="display: inline-block;margin-right: 2px;font-size: 20px;">SCD文件一次性检测</h2>
- <span class="closeX" @click="closeX">×</span>
- </div>
- <!-- 内容 -->
- <div style="width: 100%;display: flex;justify-content: space-around;align-items: center;margin-top: 5px;">
- <div class="treeBtn">
- <scdTree @scdTreeBack="scdTreeBack"></scdTree>
- </div>
- <div class="scdMap">
- <scdMap :antherBack="antherBack" :activeNav="activeNav"></scdMap>
- </div>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="SCD可视化" name="second">
- <scd-visual></scd-visual>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
-
- <script setup>
- import { ref, watch, onMounted } from "vue";
- import netWork from "./components/netWork";
- import scdVisual from "./components/scdVisual";
- import CidTree from "./components/CidTree.vue";
- import Gsix from "./components/Gsix.vue";
- import scdTree from "./components/scdTree.vue";
- import scdMap from "./components/scdMap.vue"
- import { useRoute } from 'vue-router';
- import cid from "@/api/cid/cid";
- import { ElMessage } from "element-plus";
- import systemRow from "@/api/systemRow";
- import scdCheck from "@/api/scdCheck/scdCheck";
- const activeName = ref("first");//默认展示网络结构图
- const navtopData = ref([
- { name: "CID一致性校核" },
- { name: "SCD文件一致性校核" },
- { name: "SCL文件校核" },
- { name: "CRC校核" },
- { name: "虚端子关系图" },
- ]);
- const activeNav = ref(null);
- const backName = ref('')//树组件返回名称
- let mustVal = ref(false)
- let upName = ref('')//上传的文件名称
- let arrName = ref('')//基准的文件名称
- let upFile = ref({})//上传文件流
- let backId = ref('')//返回id
- let antherBack = ref([])
- watch(() => antherBack.value, (newVal) => {
- antherBack.value = newVal
- }, {
- deep: true
- })
- const clickNav = (navIndex) => { //点击导航栏事件
- activeNav.value = navIndex;
- }
- const handleClick = (val) => {
- if (val.props.name == 'first') {
- activeNav.value = null
- activeName.value = val.props.name
- }
- }
- const treeBack = (data, ids) => {
- backName.value = data
- arrName.value = data
- backId.value = ids
- console.log(ids, 'ids');
- }
- const closeX = () => {
- activeName.value = 'first'
- activeNav.value = null
- }
- const nowUpload = (file, e) => {
- upFile.value = file.file
- upName.value = file.file.name
- cid.fileUpload({ station_id: 861, file: upFile.value,data_type:"cid" }).then(res => {
- if (res.code == 0) {
- let idp = `${file.file.uid},${backId.value}`
- ElMessage({
- type: 'success',
- message: "上传成功!"
- })
- scdCheck.scdStart({type:'cid',station_id:861,ids:idp}).then(res=>{
- console.log(res,'show');
- })
- }
- })
- };
- const handleRemove = (file, e) => {
- console.log(file, e, '删除');
- }
- const fileSuccess = (file, e) => {
- mustVal.value = true
- }
- function scdTreeBack(data) {
- antherBack.value = data
- }
- const portExcel = () => {
- systemRow.portExcel({
- code: "scd-comp-result"
- }).then(res => {
- if (res.data) {
- return
- } else {
- ElMessage({
- message: res.msg,
- type: "info"
- })
- }
- })
- }
- onMounted(()=>{
- })
- </script>
- <style scoped lang="scss">
- $height: 40px;
- @mixin mid-center {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- :deep(.el-tabs__item) {
- margin: 16px 0 0 32px;
- font-size: 18px;
- }
- :deep(.el-tabs__item:last-child) {
- margin-left: 0;
- }
- :deep(.el-tabs__nav-wrap::after) {
- --el-border-color-light: none;
- }
- :deep(.el-tabs__item.is-active),
- :deep(.el-tabs__active-bar) {
- color: #255ce7;
- }
- :deep(.el-tabs__active-bar) {
- background-color: #255ce7;
- }
- //设置导航栏样式
- .nav {
- @include mid-center;
- .nav-item {
- width: 144px;
- height: $height;
- @include mid-center;
- margin-right: 8px;
- cursor: pointer;
- background: #fff url("~@/assets/image/instruct/navtop.png") no-repeat center;
- background-size: 144px $height;
- }
- .nav-item-active {
- background: #fff url("~@/assets/image/instruct/navtop_active.png") no-repeat center;
- background-size: 144px $height;
- color: #fff;
- }
- }
- //最外层的滚动条不要
- :deep(.el-main) {
- // overflow: hidden;
- }
- //ied的高度
- :deep(.network-wrap) {
- height: 70vh;
- overflow: auto;
- }
- // 头部导出excel
- .mostHead {
- width: 97%;
- height: auto;
- border-bottom: 1px solid #A3ADE0;
- margin: 0px auto;
- position: relative;
- }
- .closeX {
- font-size: 30px;
- position: absolute;
- top: 20px;
- right: 0px;
- cursor: pointer;
- }
- // CID显示
- .disappear {
- width: 97%;
- height: calc(100vh - 260px);
- margin: 0 auto;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- }
- .abBox {
- width: 90%;
- height: 5%;
- display: flex;
- justify-content: space-around;
- align-items: center;
- background-color: white;
- margin-left: 10px;
- position: relative;
- }
- .uploadBox {
- position: absolute;
- top: 0px;
- right: -100px;
- }
- .scdCheck {
- width: 97.5%;
- height: calc(100vh - 205px);
- margin-left: 20px;
- margin-top: 5px;
- // border: 1px solid red;
- }
- .treeBtn {
- width: 35%;
- height: calc(100vh - 205px);
- // border: 1px solid rebeccapurple;
- }
- .scdMap {
- width: 65%;
- height: calc(100vh - 205px);
- // border: 1px solid teal;
- background-color: #F6F8FA;
- }
- </style>
|