Browse Source

完善进入子目录

master
xyiege 5 months ago
parent
commit
eb998b46ab
  1. 64
      vue/afvue/src/views/Sfilecompare.vue

64
vue/afvue/src/views/Sfilecompare.vue

@ -15,7 +15,10 @@
</div> </div>
<div class="sflist"> <div class="sflist">
<ul > <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> </ul>
</div> </div>
@ -39,12 +42,15 @@
<div class="sflist"> <div class="sflist">
<ul > <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> </ul>
</div> </div>
<div class="tips" v-if="ssclist.length > 0"> <div class="tips" v-if="ssclist.length > 0">
<span>当前路径{{fspath}} ,文件数量{{ fsclist.length }}</span> <span>当前路径{{sspath}} ,文件数量{{ fsclist.length }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -52,7 +58,6 @@
<script> <script>
import { GetFileList,SerlistInUsing } from '@/api/scinfo' import { GetFileList,SerlistInUsing } from '@/api/scinfo'
import { isLength } from 'lodash';
export default { export default {
name: 'Sfilecompare', name: 'Sfilecompare',
@ -98,6 +103,52 @@ export default {
this.ssclist = res.data.list 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)
// ipbase64
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; margin-top: 22px;
} }
.sfcon:nth-child(2) .sflist{ .sfcon:nth-child(2) .sflist{
background-color: #c3c3c3; background-color: #f1ebeb;
} }
.sfind{ .sfind{
width: 100%; width: 100%;
@ -151,6 +202,9 @@ export default {
line-height: 40px; line-height: 40px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
} }
.sfcon .sflist .haschild{
cursor: pointer;
}
.sfcon .sflist .tips{ .sfcon .sflist .tips{
width: 100%; width: 100%;
float: left; float: left;

Loading…
Cancel
Save