This commit is contained in:
daihh
2022-06-14 11:23:51 +08:00
2 changed files with 12 additions and 24 deletions

View File

@@ -64,14 +64,9 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
boxShow:{
type: Boolean,
default: true,
}
}, },
data() { data() {
return { return {
likeBox:false,
src: "", src: "",
showPages: undefined, showPages: undefined,
totalPages:0, totalPages:0,
@@ -103,13 +98,6 @@ export default {
this.loadInitPdf(newVal); this.loadInitPdf(newVal);
} }
}, },
boxShow(newVal){
if(newVal){
this.likeBox = true;
} else {
this.likeBox = false;
}
},
loadedRatio(newVal){ loadedRatio(newVal){
// 直接使用loadedRatio控制进度条没有加载效果 // 直接使用loadedRatio控制进度条没有加载效果
if(newVal == 1){ if(newVal == 1){
@@ -123,7 +111,6 @@ export default {
methods: { methods: {
goTop() { goTop() {
document.documentElement.scrollTop = 0; document.documentElement.scrollTop = 0;
this.likeBox = false;
}, },
loadProgress(e){ loadProgress(e){
console.log(e,'loadProgress'); console.log(e,'loadProgress');
@@ -139,7 +126,6 @@ export default {
this.showPages++; this.showPages++;
} }
this.isscroll = true; this.isscroll = true;
this.likeBox = true;
}, },
//加载页面 //加载页面
loadInitPdf(url) { loadInitPdf(url) {
@@ -164,16 +150,18 @@ export default {
let scrollTop = document.documentElement.scrollTop let scrollTop = document.documentElement.scrollTop
let $this=this; let $this=this;
if(this.isscroll){ if(this.isscroll){
this.showPages++; this.showPages++
this.moreState = 2; this.moreState = 2;
this.debounce(this.loadInitPdf($this.filePath),5000); // this.debounce(this.loadInitPdf($this.filePath),5000);
// this.debounce(,200000);
} }
if(this.pdfpage >= this.totalPages){ if(this.pdfpage >= this.totalPages){
this.isscroll = false; this.isscroll = false;
this.moreState = 3; this.moreState = 3;
} }
if(this.pdfpage < 4){ if(this.showPages >= this.totalPages){
this.likeBox = false; this.isscroll = false;
this.moreState = 3;
} }
// if(scrollTop > 400) { // if(scrollTop > 400) {
// document.querySelector('#articleAnking').style.cssText = "position: fixed;top: 0;width:242.5px"; // document.querySelector('#articleAnking').style.cssText = "position: fixed;top: 0;width:242.5px";
@@ -181,8 +169,6 @@ export default {
// document.querySelector('#articleAnking').style.cssText = "position: static"; // document.querySelector('#articleAnking').style.cssText = "position: static";
// } // }
}, },
debounce(func, wait) {// 非立即执行 debounce(func, wait) {// 非立即执行
let timeout; let timeout;
return function () { return function () {

View File

@@ -11,7 +11,7 @@
</el-form> </el-form>
<p class="basicInformation">人员信息</p> <p class="basicInformation">人员信息</p>
<div class="action"> <div class="action">
<el-input style="width: 20%" placeholder="请输入姓名或工号" v-model="searchValue"></el-input> <el-input style="width: 20%" clearable placeholder="请输入姓名或工号" v-model="searchValue"></el-input>
<el-button type="primary" class="findBtn" size="medium" @click="queryTableData">搜索</el-button> <el-button type="primary" class="findBtn" size="medium" @click="queryTableData">搜索</el-button>
<el-button type="primary" size="medium" @click="tableDataReset">重置</el-button> <el-button type="primary" size="medium" @click="tableDataReset">重置</el-button>
<el-button type="primary" size="medium" @click="openDialog">添加</el-button> <el-button type="primary" size="medium" @click="openDialog">添加</el-button>
@@ -168,7 +168,7 @@
usergroupApi.detail(that.$route.query.id).then((res) => { usergroupApi.detail(that.$route.query.id).then((res) => {
if (res.status == 200) { if (res.status == 200) {
that.form = res.result; that.form = res.result;
that.oldUserGroupItems = JSON.parse(JSON.stringify( res.result.userGroupItems )); // that.oldUserGroupItems = JSON.parse(JSON.stringify( res.result.userGroupItems ));
that.tableData = res.result.userGroupItems; that.tableData = res.result.userGroupItems;
that.queryTableData(); that.queryTableData();
} }
@@ -275,8 +275,10 @@
this.addUserShow = false; this.addUserShow = false;
}, },
tableDataReset(){ tableDataReset(){
this.tableData = JSON.parse(JSON.stringify( this.oldUserGroupItems )); this.searchValue = '';
this.queryTableData(); this.queryTableData();
// this.tableData = JSON.parse(JSON.stringify( this.oldUserGroupItems ));
// this.queryTableData();
}, },
queryTableData(){ queryTableData(){
if(this.searchValue){ if(this.searchValue){