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 @@
-
- 已关注 取消关注
+
+ 已关注
+ 未关注
+
+
+ 取消关注关注列表
-
- 未关注 去关注
+
+ 去关注关注列表
+
+
+
+
+ {{item.username}}
+
+
+
@@ -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' });