|
|
|
@ -15,7 +15,10 @@ |
|
|
|
</div> |
|
|
|
<div class="sflist"> |
|
|
|
<ul > |
|
|
|
<li v-for="item in fsclist" :key="item">{{item.path}}</li> |
|
|
|
<li v-for="item in fsclist" :key="item"> |
|
|
|
<a class="haschild" @click="goIntoDir(item.path,1)" v-if="item.isdir">{{item.path}}</a> |
|
|
|
<span v-else>{{item.path}}</span> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -39,12 +42,15 @@ |
|
|
|
|
|
|
|
<div class="sflist"> |
|
|
|
<ul > |
|
|
|
<li v-for="item in ssclist" :key="item">{{item.path}}</li> |
|
|
|
<li v-for="item in ssclist" :key="item"> |
|
|
|
<a class="haschild" @click="goIntoDir(item.path,2)" v-if="item.isdir">{{item.path}}</a> |
|
|
|
<span v-else>{{item.path}}</span> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="tips" v-if="ssclist.length > 0"> |
|
|
|
<span>当前路径:{{fspath}} ,文件数量:{{ fsclist.length }}</span> |
|
|
|
<span>当前路径:{{sspath}} ,文件数量:{{ fsclist.length }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -52,7 +58,6 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { GetFileList,SerlistInUsing } from '@/api/scinfo' |
|
|
|
import { isLength } from 'lodash'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Sfilecompare', |
|
|
|
@ -98,6 +103,52 @@ export default { |
|
|
|
this.ssclist = res.data.list |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 进入子目录 |
|
|
|
goIntoDir(path,nflag){ |
|
|
|
// 根据nflag 来判断 |
|
|
|
let npath,sel |
|
|
|
if(nflag==1){ |
|
|
|
sel=this.$refs.fsip.value |
|
|
|
// 拼装url |
|
|
|
npath = this.fspath + path |
|
|
|
} |
|
|
|
if(nflag==2){ |
|
|
|
sel = this.$refs.ssip.value |
|
|
|
npath = this.sspath + path |
|
|
|
} |
|
|
|
let rrarr = this.preIp(sel) |
|
|
|
// ip转为base64 |
|
|
|
let ip = btoa(rrarr[0]) |
|
|
|
this.queryFlist(ip,rrarr[1],npath,nflag) |
|
|
|
}, |
|
|
|
// 查询内容 |
|
|
|
// nflag 1 第一个服务器 2 第二个服务器 |
|
|
|
async queryFlist(ip,port,npath,nflag){ |
|
|
|
let rlist = [] |
|
|
|
await GetFileList({ |
|
|
|
srcip: ip,path: npath, sport: port |
|
|
|
}).then(res => { |
|
|
|
// 绑定数据 |
|
|
|
if(nflag == 1){ |
|
|
|
this.fspath = npath |
|
|
|
this.fsclist = res.data.list |
|
|
|
} |
|
|
|
if(nflag == 2){ |
|
|
|
this.sspath = npath |
|
|
|
this.ssclist = res.data.list |
|
|
|
} |
|
|
|
}) |
|
|
|
return rlist; |
|
|
|
}, |
|
|
|
// 拆分组装ip |
|
|
|
preIp(ssip){ |
|
|
|
// 返回数组 |
|
|
|
let iparr = [] |
|
|
|
let sstr = ssip.split(":") |
|
|
|
iparr.push(sstr[0]) |
|
|
|
iparr.push(sstr[1]) |
|
|
|
return iparr |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -125,7 +176,7 @@ export default { |
|
|
|
margin-top: 22px; |
|
|
|
} |
|
|
|
.sfcon:nth-child(2) .sflist{ |
|
|
|
background-color: #c3c3c3; |
|
|
|
background-color: #f1ebeb; |
|
|
|
} |
|
|
|
.sfind{ |
|
|
|
width: 100%; |
|
|
|
@ -151,6 +202,9 @@ export default { |
|
|
|
line-height: 40px; |
|
|
|
border-bottom: 1px dashed #ccc; |
|
|
|
} |
|
|
|
.sfcon .sflist .haschild{ |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.sfcon .sflist .tips{ |
|
|
|
width: 100%; |
|
|
|
float: left; |
|
|
|
|