10 changed files with 381 additions and 9 deletions
-
1src/api/xm/core/xmMyFocus.js
-
3src/router/routes_xm.js
-
77src/views/xm/core/xmMenu/XmMenuDetailRoute.vue
-
9src/views/xm/core/xmMenu/XmMenuEdit.vue
-
113src/views/xm/core/xmMyFocus/XmMyDoFocus.vue
-
12src/views/xm/core/xmMyFocus/XmMyFocusList.vue
-
77src/views/xm/core/xmQuestion/XmQuestionDetailRoute.vue
-
11src/views/xm/core/xmQuestion/XmQuestionEdit.vue
-
77src/views/xm/core/xmTask/XmTaskDetailRoute.vue
-
10src/views/xm/core/xmTask/XmTaskEdit.vue
@ -0,0 +1,77 @@ |
|||
<template> |
|||
<section class="padding"> |
|||
<xm-menu-edit v-if="xmMenu" :xm-menu="xmMenu" :visible="showInfo"></xm-menu-edit> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
|
|||
import { listXmMenu } from '@/api/xm/core/xmMenu'; |
|||
import { mapGetters } from 'vuex'; |
|||
import XmMenuEdit from './XmMenuEdit' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
watch:{ |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
xmMenu:null, |
|||
showInfo:false, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
|
|||
|
|||
initByQueryId(){ |
|||
if(this.$route.query && this.$route.query.id){ |
|||
var localStorageXmMenu=localStorage.getItem("xm-menu-info-route") |
|||
var menu=null; |
|||
if(localStorageXmMenu){ |
|||
menu=JSON.parse(localStorageXmMenu) |
|||
if(menu && menu.id==this.$route.query.id){ |
|||
this.xmMenu=menu |
|||
this.showInfo=true; |
|||
}else{ |
|||
this.getXmMenu(this.$route.query.id); |
|||
} |
|||
}else{ |
|||
this.getXmMenu(this.$route.query.id); |
|||
} |
|||
} |
|||
}, |
|||
getXmMenu(id){ |
|||
listXmMenu({id:id}).then(res=>{ |
|||
var tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
this.xmMenu=res.data.data[0] |
|||
localStorage.setItem("xm-menu-info-route",JSON.stringify(this.xmMenu)) |
|||
this.showInfo=true; |
|||
}else{ |
|||
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
},//end methods |
|||
components: { |
|||
XmMenuEdit, |
|||
//在下面添加其它组件 |
|||
}, |
|||
activated(){ |
|||
this.initByQueryId(); |
|||
}, |
|||
mounted() { |
|||
this.initByQueryId(); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
@ -0,0 +1,113 @@ |
|||
<template> |
|||
<section> |
|||
<el-row v-if="xmMyFocuss.length>0"> |
|||
<el-tag type="success">已关注</el-tag> <el-button @click="handleDel">取消关注</el-button> |
|||
</el-row> |
|||
|
|||
<el-row v-if="xmMyFocuss.length<=0"> |
|||
<el-tag type="primary">未关注</el-tag> <el-button @click="saveSubmit">去关注</el-button> |
|||
</el-row> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
import config from "@/common/config"; //全局公共库import |
|||
import { initDicts, listXmMyFocus,addXmMyFocus,delXmMyFocus } from '@/api/xm/core/xmMyFocus'; |
|||
import { mapGetters } from 'vuex' |
|||
|
|||
export default { |
|||
name:'xmMyDoFocus', |
|||
components: { |
|||
|
|||
}, |
|||
computed: { |
|||
...mapGetters([ 'userInfo' ]), |
|||
|
|||
}, |
|||
props:['pbizId','bizId','focusType','bizName'], |
|||
|
|||
watch: { |
|||
bizId(){ |
|||
this.searchXmMyFocuss() |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|||
dicts:{},//下拉选择框的所有静态数据 params={categoryId:'all',itemCodes:['sex']} 返回结果 {sex: [{id:'1',name:'男'},{id:'2',name:'女'}]} |
|||
|
|||
xmMyFocuss:[], |
|||
}//end return |
|||
},//end data |
|||
methods: { |
|||
|
|||
...util, |
|||
|
|||
//获取列表 XmMyFocus 我关注的项目或者任务 |
|||
searchXmMyFocuss() { |
|||
let params = { |
|||
pbizId:this.pbizId, |
|||
bizId:this.bizId, |
|||
focusType:this.focusType |
|||
}; |
|||
|
|||
|
|||
this.load.list = true; |
|||
listXmMyFocus(params).then((res) => { |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.xmMyFocuss = 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 ); |
|||
}, |
|||
initData: function(){ |
|||
this.searchXmMyFocuss(); |
|||
}, |
|||
//删除xmMyFocus |
|||
handleDel: function ( ) { |
|||
var row=this.xmMyFocuss[0] |
|||
this.load.del=true; |
|||
let params = { userid:row.userid, bizId:row.bizId, pbizId:row.pbizId }; |
|||
delXmMyFocus(params).then((res) => { |
|||
this.load.del=false; |
|||
var tips=res.data.tips; |
|||
if(tips.isOk){ |
|||
this.searchXmMyFocuss(); |
|||
} |
|||
this.$notify({ position:'bottom-left', showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err => this.load.del=false ); |
|||
}, |
|||
//新增、编辑提交XmMyFocus 我关注的项目或者任务父组件监听@submit="afterEditSubmit" |
|||
saveSubmit: function () { |
|||
this.load.edit=true |
|||
let params = {pbizId:this.pbizId,bizId:this.bizId,focusType:this.focusType,bizName:this.bizName} |
|||
var func=addXmMyFocus |
|||
func(params).then((res) => { |
|||
this.load.edit=false |
|||
var tips=res.data.tips; |
|||
|
|||
if(tips.isOk){ |
|||
this.searchXmMyFocuss() |
|||
this.$emit('submit');// @submit="afterAddSubmit" |
|||
} |
|||
this.$notify({ position:'bottom-left',showClose:true, message: tips.msg, type: tips.isOk?'success':'error' }); |
|||
}).catch( err =>this.load.edit=false); |
|||
}, |
|||
},//end method |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
initDicts(this); |
|||
this.initData() |
|||
}); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,77 @@ |
|||
<template> |
|||
<section class="padding"> |
|||
<xm-question-edit v-if="xmQuestion" :xm-question="xmQuestion" :visible="showInfo"></xm-question-edit> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
|
|||
import { listXmQuestion } from '@/api/xm/core/xmQuestion'; |
|||
import { mapGetters } from 'vuex'; |
|||
import XmQuestionEdit from './XmQuestionEdit' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
watch:{ |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
xmQuestion:null, |
|||
showInfo:false, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
|
|||
|
|||
initByQueryId(){ |
|||
if(this.$route.query && this.$route.query.id){ |
|||
var localStorageXmQuestion=localStorage.getItem("xm-question-info-route") |
|||
var question=null; |
|||
if(localStorageXmQuestion){ |
|||
question=JSON.parse(localStorageXmQuestion) |
|||
if(question && question.id==this.$route.query.id){ |
|||
this.xmQuestion=question |
|||
this.showInfo=true; |
|||
}else{ |
|||
this.getXmQuestion(this.$route.query.id); |
|||
} |
|||
}else{ |
|||
this.getXmQuestion(this.$route.query.id); |
|||
} |
|||
} |
|||
}, |
|||
getXmQuestion(id){ |
|||
listXmQuestion({id:id}).then(res=>{ |
|||
var tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
this.xmQuestion=res.data.data[0] |
|||
localStorage.setItem("xm-question-info-route",JSON.stringify(this.xmQuestion)) |
|||
this.showInfo=true; |
|||
}else{ |
|||
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
},//end methods |
|||
components: { |
|||
XmQuestionEdit, |
|||
//在下面添加其它组件 |
|||
}, |
|||
activated(){ |
|||
this.initByQueryId(); |
|||
}, |
|||
mounted() { |
|||
this.initByQueryId(); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
@ -0,0 +1,77 @@ |
|||
<template> |
|||
<section class="padding"> |
|||
<xm-task-edit v-if="xmTask" :xm-task="xmTask" :visible="showInfo"></xm-task-edit> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
import util from '@/common/js/util';//全局公共库 |
|||
|
|||
import { listXmTask } from '@/api/xm/core/xmTask'; |
|||
import { mapGetters } from 'vuex'; |
|||
import XmTaskEdit from './XmTaskEdit' |
|||
|
|||
export default { |
|||
computed: { |
|||
...mapGetters([ |
|||
'userInfo','roles' |
|||
]), |
|||
}, |
|||
watch:{ |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
xmTask:null, |
|||
showInfo:false, |
|||
} |
|||
},//end data |
|||
methods: { |
|||
|
|||
|
|||
initByQueryId(){ |
|||
if(this.$route.query && this.$route.query.id){ |
|||
var localStorageTask=localStorage.getItem("xm-task-info-route") |
|||
var task=null; |
|||
if(localStorageTask){ |
|||
task=JSON.parse(localStorageTask) |
|||
if(task && task.id==this.$route.query.id){ |
|||
this.xmTask=task |
|||
this.showInfo=true; |
|||
}else{ |
|||
this.getTask(this.$route.query.id); |
|||
} |
|||
}else{ |
|||
this.getTask(this.$route.query.id); |
|||
} |
|||
} |
|||
}, |
|||
getTask(id){ |
|||
listXmTask({id:id}).then(res=>{ |
|||
var tips = res.data.tips; |
|||
if(tips.isOk){ |
|||
this.xmTask=res.data.data[0] |
|||
localStorage.setItem("xm-task-info-route",JSON.stringify(this.xmTask)) |
|||
this.showInfo=true; |
|||
}else{ |
|||
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
},//end methods |
|||
components: { |
|||
XmTaskEdit, |
|||
//在下面添加其它组件 |
|||
}, |
|||
activated(){ |
|||
this.initByQueryId(); |
|||
}, |
|||
mounted() { |
|||
this.initByQueryId(); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue