Browse Source

调整空值判断

master
xyiege 5 months ago
parent
commit
1e270f45f6
  1. 26
      vue/afvue/src/views/Sfilecompare.vue

26
vue/afvue/src/views/Sfilecompare.vue

@ -15,6 +15,7 @@
<div class="sflist"> <div class="sflist">
<ul > <ul >
<li v-for="item in fsclist" :key="item"> <li v-for="item in fsclist" :key="item">
<input type="checkbox" :value="item.path" class="sfchkbox" />
<a class="haschild" @click="goIntoDir(item.path,1)" v-if="item.isdir">{{item.path}}</a> <a class="haschild" @click="goIntoDir(item.path,1)" v-if="item.isdir">{{item.path}}</a>
<span v-else>{{item.path}}</span> <span v-else>{{item.path}}</span>
</li> </li>
@ -22,7 +23,7 @@
</div> </div>
<div class="tips" > <div class="tips" >
<span v-if="fsclist.length > 0">当前路径{{fspath}} ,文件数量{{ fsclist.length }}</span> <span v-if="fsclist.length > 0"> 服务器{{this.$refs.fsip.value}} 路径{{fspath}} ,文件数量{{ fsclist.length }}</span>
<span v-else>当前服务器{{fsip}}</span> <span v-else>当前服务器{{fsip}}</span>
</div> </div>
</div> </div>
@ -147,24 +148,21 @@ export default {
await GetFileList({ await GetFileList({
srcip: ip,path: npath, sport: port srcip: ip,path: npath, sport: port
}).then(res => { }).then(res => {
// var vlist = res.data.list
if(vlist){
//
if(nflag == 1){ if(nflag == 1){
// list
let vlist = res.data.list
if(vlist==null || vlist.length == 0){
npath="/"
}
this.fspath = npath this.fspath = npath
this.fsclist = vlist this.fsclist = vlist
} }
if(nflag == 2){ if(nflag == 2){
let vlist = res.data.list
if(vlist==null || vlist.length == 0){
npath="/"
}
this.sspath = npath this.sspath = npath
this.ssclist = vlist this.ssclist = vlist
} }
}else{
npath="/"
}
}) })
return rlist; return rlist;
}, },
@ -291,9 +289,15 @@ export default {
line-height: 40px; line-height: 40px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
} }
.sfcon .sflist ul li .sfchkbox{
margin-right: 12px;
}
.sfcon .sflist .haschild{ .sfcon .sflist .haschild{
cursor: pointer; cursor: pointer;
} }
.sfcon .sflist .tips{ .sfcon .sflist .tips{
width: 100%; width: 100%;
float: left; float: left;

Loading…
Cancel
Save