mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 11:56:47 +08:00
增加课程查询添加受众信息
This commit is contained in:
@@ -59,10 +59,20 @@ const delLearning = function(ms_timeline_kid) {
|
|||||||
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
|
return ajax.post('/b1/system/user/ms-timeline-delete',{ms_timeline_kid});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户的kid,获取用户的受众权限
|
||||||
|
*
|
||||||
|
* @param {Object} kid
|
||||||
|
*/
|
||||||
|
const audience = function(kid) {
|
||||||
|
return ajax.get('/b1/system/user/audience-by-user?userId='+kid);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
myLearning,
|
myLearning,
|
||||||
cmtaskList,
|
cmtaskList,
|
||||||
reportList,
|
reportList,
|
||||||
courseList,
|
courseList,
|
||||||
delLearning
|
delLearning,
|
||||||
|
audience
|
||||||
}
|
}
|
||||||
|
|||||||
149
api/modules/usergroup.js
Normal file
149
api/modules/usergroup.js
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
import ajax from '@/utils/xajax.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param {
|
||||||
|
* pageIndex 起始页
|
||||||
|
* pageSize 每页条数
|
||||||
|
* name 名称
|
||||||
|
* gtype 类型 1表普通受众,2表自动受众
|
||||||
|
* status 状态 1表发布,0表未发布
|
||||||
|
* } query
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const list=function(query) {
|
||||||
|
return ajax.get('/xboe/usergroup/page',{params:query});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按父节点ID查询机构列表,适合构建动态机构树
|
||||||
|
* @param parentId 父节点ID 根目录为 -1
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const userOrgs=function(parentId) {
|
||||||
|
return ajax.get('/xboe/sys/user/org/list-by-parent?parentId='+parentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {*} name
|
||||||
|
*/
|
||||||
|
const findByName=function(name) {
|
||||||
|
return ajax.get('/xboe/usergroup/find',{name});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
* @param {受众ID} id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const detail=function(id) {
|
||||||
|
return ajax.get('/xboe/usergroup/detail?id='+id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
* @param {
|
||||||
|
* name:'';//名称 长50
|
||||||
|
* gtype:1;//类型 1表普通受众,2表自动受众
|
||||||
|
* description:''; // 描述 长200
|
||||||
|
* filterJson:''; //过滤条件
|
||||||
|
* status:1; //状态 是否发布 1表发布,0表未发布
|
||||||
|
* userGroupItems[
|
||||||
|
* {
|
||||||
|
* aid:'',//人员ID
|
||||||
|
* }
|
||||||
|
* ];// 受众人员信息
|
||||||
|
* } data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const save=function(data) {
|
||||||
|
return ajax.postJson('/xboe/usergroup/save',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param {
|
||||||
|
* id:'',//受众ID
|
||||||
|
* name:'';//名称 长50
|
||||||
|
* gtype:1;//类型 1表普通受众,2表自动受众
|
||||||
|
* description:''; // 描述 长200
|
||||||
|
* filterJson:''; //过滤条件
|
||||||
|
* status:1; //状态 是否发布 1表发布,0表未发布
|
||||||
|
* userGroupItems[
|
||||||
|
* {
|
||||||
|
* aid:'',//人员ID
|
||||||
|
* }
|
||||||
|
* ];// 受众人员信息
|
||||||
|
* } data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const update=function(data) {
|
||||||
|
return ajax.postJson('/xboe/usergroup/update',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复制
|
||||||
|
* @param {
|
||||||
|
* name 复制后的名称
|
||||||
|
* id 需要复制的受众ID
|
||||||
|
* } data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const copy=function(data) {
|
||||||
|
return ajax.post('/xboe/usergroup/copy',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布
|
||||||
|
* @param {
|
||||||
|
* 1表发布,0表未发布
|
||||||
|
* } status
|
||||||
|
* @param {
|
||||||
|
* 受众ID
|
||||||
|
* } id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const publish=function(status,id) {
|
||||||
|
let data = {};
|
||||||
|
data.status = status;
|
||||||
|
data.id = id;
|
||||||
|
return ajax.post('/xboe/usergroup/publish',data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param {受众ID} id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const del=function(id) {
|
||||||
|
return ajax.post('/xboe/usergroup/delete?id='+id);
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadTemplate=function(){
|
||||||
|
let requestParam ={
|
||||||
|
url: '/xboe/usergroup/download',
|
||||||
|
timeout: 0, // 下载不设置超时
|
||||||
|
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||||
|
}
|
||||||
|
return ajax.get(requestParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
const userGroupIds=function() {
|
||||||
|
return ajax.get('/xboe/usergroup/user-group-ids');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default{
|
||||||
|
list,
|
||||||
|
findByName,
|
||||||
|
detail,
|
||||||
|
save,
|
||||||
|
update,
|
||||||
|
copy,
|
||||||
|
publish,
|
||||||
|
del,
|
||||||
|
downloadTemplate,
|
||||||
|
userOrgs,
|
||||||
|
userGroupIds
|
||||||
|
}
|
||||||
@@ -255,9 +255,12 @@
|
|||||||
import apiOldCourse from '@/api/modules/course.js'
|
import apiOldCourse from '@/api/modules/course.js'
|
||||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||||
import apiUser from '@/api/system/user.js'
|
import apiUser from '@/api/system/user.js'
|
||||||
|
import apiQa from '@/api/modules/qa.js'
|
||||||
|
import {toScore} from '@/utils/tools.js'
|
||||||
import apiArticle from '@/api/modules/article.js'
|
import apiArticle from '@/api/modules/article.js'
|
||||||
import apiBoeCourse from '@/api/boe/course.js'
|
import apiBoeCourse from '@/api/boe/course.js'
|
||||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
export default{
|
export default{
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
@@ -312,9 +315,33 @@
|
|||||||
onLoad(options){
|
onLoad(options){
|
||||||
if(options.type){
|
if(options.type){
|
||||||
this.conType=parseInt(options.type);
|
this.conType=parseInt(options.type);
|
||||||
|
}else{
|
||||||
|
this.conType=1;
|
||||||
|
}
|
||||||
|
this.loadSeachWords();
|
||||||
|
//let localKey="user_"+this.userInfo.sysId+"_gids";
|
||||||
|
if(this.audiences.length==0){
|
||||||
|
//let hasIds;
|
||||||
|
// let hasIds=sessionStorage.getItem(localKey);
|
||||||
|
// if(hasIds && hasIds.length>0){
|
||||||
|
// this.audiences=hasIds.split(",");
|
||||||
|
// this.search();
|
||||||
|
// }else{
|
||||||
|
console.log(this.userInfo,'this.userInfo')
|
||||||
|
Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
||||||
|
//console.log(rs,'rs');
|
||||||
|
let aids=[];
|
||||||
|
if(rs[0].status==200){
|
||||||
|
aids.push(rs[0].result);
|
||||||
|
}
|
||||||
|
if(rs[1].status==200){
|
||||||
|
aids.push(rs[1].result);
|
||||||
|
}
|
||||||
|
this.audiences=aids;
|
||||||
|
//sessionStorage.setItem(localKey,this.audiences);
|
||||||
//this.search();
|
//this.search();
|
||||||
})
|
})
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
@@ -526,6 +553,7 @@
|
|||||||
},
|
},
|
||||||
async loadCourseData(){
|
async loadCourseData(){
|
||||||
uni.showLoading({title:'加载中...'});
|
uni.showLoading({title:'加载中...'});
|
||||||
|
this.course.params.keyword=this.keyword;
|
||||||
//查询课程
|
//查询课程
|
||||||
let $this=this;
|
let $this=this;
|
||||||
let dataList = [];
|
let dataList = [];
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ const user = {
|
|||||||
departFullName: res.result.departFullName,
|
departFullName: res.result.departFullName,
|
||||||
studyTotal: res.result.studyTotal,
|
studyTotal: res.result.studyTotal,
|
||||||
studyTotalH:studyTotalH,
|
studyTotalH:studyTotalH,
|
||||||
sex:res.result.sex
|
sex:res.result.sex,
|
||||||
|
sysId:res.result.sysId
|
||||||
};
|
};
|
||||||
user.avatar = user.avatar == "" ? "" : config.fileUrl + user.avatar;
|
user.avatar = user.avatar == "" ? "" : config.fileUrl + user.avatar;
|
||||||
commit('SET_UserInfo', user);
|
commit('SET_UserInfo', user);
|
||||||
|
|||||||
Reference in New Issue
Block a user