From 2be5953e3752ee0b1a6ee20fe1534f04b16def7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Thu, 7 Jul 2022 11:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/myWork/my/components/DoFocus.vue | 90 ++++++++++++++++++---- 1 file changed, 77 insertions(+), 13 deletions(-) diff --git a/src/views/myWork/my/components/DoFocus.vue b/src/views/myWork/my/components/DoFocus.vue index f15427e3..f18fe619 100644 --- a/src/views/myWork/my/components/DoFocus.vue +++ b/src/views/myWork/my/components/DoFocus.vue @@ -1,11 +1,23 @@ @@ -29,7 +41,13 @@ watch: { bizId(){ - this.searchUserFocuss() + this.searchMyUserFocuss(); + this.focusListVisible=false; + }, + focusListVisible(val){ + if(val){ + this.searchUserFocuss(); + } } }, data() { @@ -38,26 +56,72 @@ dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} userFocuss:[], + myUserFocuss:[], + focusListVisible:false, + + pageInfo:{//分页数据 + total:0,//服务器端收到0时,会自动计算总记录数,如果上传>0的不自动计算。 + pageSize:10,//每页数据 + count:false,//是否需要重新计算总记录数 + pageNum:1,//当前页码、从1开始计算 + orderFields:[],//排序列 如 ['sex','student_id'],必须为数据库字段 + orderDirs:[]//升序 asc,降序desc 如 性别 升序、学生编号降序 ['asc','desc'] + }, }//end return },//end data methods: { ...util, + getImg(userFocus){ + return "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"; + }, + //获取列表 UserFocus 我关注的项目或者任务 + searchMyUserFocuss() { + let params = { + pbizId:this.pbizId, + bizId:this.bizId, + focusType:this.focusType, + userid:this.userInfo.userid + }; + + this.load.list = true; + listUserFocus(params).then((res) => { + var tips=res.data.tips; + if(tips.isOk){ + this.myUserFocuss = res.data.data; + }else{ + this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' }); + } + this.load.list = false; + }).catch( err => this.load.list = false ); + }, //获取列表 UserFocus 我关注的项目或者任务 - searchUserFocuss() { - let params = { + searchUserFocuss() { + let params = { + pageSize: this.pageInfo.pageSize, + pageNum: this.pageInfo.pageNum, + total: this.pageInfo.total, + count:this.pageInfo.count, pbizId:this.pbizId, bizId:this.bizId, focusType:this.focusType }; - + if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ + let orderBys=[]; + for(var i=0;i { var tips=res.data.tips; if(tips.isOk){ - this.userFocuss = res.data.data; + this.userFocuss = res.data.data; + this.pageInfo.total = res.data.total; + this.pageInfo.count=false; }else{ this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: 'error' }); } @@ -65,18 +129,18 @@ }).catch( err => this.load.list = false ); }, initData: function(){ - this.searchUserFocuss(); + this.searchMyUserFocuss(); }, //删除userFocus handleDel: function ( ) { - var row=this.userFocuss[0] + var row=this.myUserFocuss[0] this.load.del=true; let params = { userid:row.userid, bizId:row.bizId, pbizId:row.pbizId }; delUserFocus(params).then((res) => { this.load.del=false; var tips=res.data.tips; if(tips.isOk){ - this.searchUserFocuss(); + this.searchMyUserFocuss(); } this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.del=false ); @@ -91,7 +155,7 @@ var tips=res.data.tips; if(tips.isOk){ - this.searchUserFocuss() + this.searchMyUserFocuss() this.$emit('submit');// @submit="afterAddSubmit" } this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' });