mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-06 17:36:42 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/portal
This commit is contained in:
@@ -1,197 +1,27 @@
|
|||||||
import axios from 'axios'
|
/** 管理端接口 **/
|
||||||
import qs from 'qs'
|
import ajax from '../unionAjax.js';
|
||||||
import { Notification, MessageBox, Message } from 'element-ui'
|
const baseURL ="/manageApi";
|
||||||
import store from '@/store'
|
|
||||||
import { getToken } from '@/utils/token'
|
|
||||||
import errorCode from '@/utils/errorCode'
|
|
||||||
/**
|
|
||||||
*request请求 axios.request(config)
|
|
||||||
*requestJson请求 axios.request(config)
|
|
||||||
*get请求 axios.get(url[, config])
|
|
||||||
*post请求 axios.post(url[, data[, config]])
|
|
||||||
*postJson请求 axios.post(url[, data[, config]])
|
|
||||||
*put请求 axios.put(url[, data[, config]])
|
|
||||||
*putJson请求 axios.put(url[, data[, config]])
|
|
||||||
*patch请求 axios.patch(url[, data[, config]])
|
|
||||||
*patchJson请求 axios.patch(url[, data[, config]])
|
|
||||||
*delete请求 axios.delete(url[, config])
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/**用户的待办任务数量*/
|
||||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
const getTaskNum = function(){
|
||||||
const TokenName='token';
|
return ajax.get(baseURL,'/todoTask/queryTodoTaskCounts');
|
||||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
|
||||||
//只是用于发送json对象数据时使用post,put,patch
|
|
||||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
|
||||||
//只是用于发送json对象数据时使用post,put,patch
|
|
||||||
//用于普通的发送请求
|
|
||||||
const formRequest=axios.create({
|
|
||||||
// headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
|
||||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
|
||||||
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
|
||||||
//超时
|
|
||||||
timeout: 10000,
|
|
||||||
})
|
|
||||||
//发送json对象的拦截器
|
|
||||||
formRequest.interceptors.request.use(config => {
|
|
||||||
//是否需要设置 token
|
|
||||||
const isToken = (config.headers || {}).isToken === false
|
|
||||||
let curToken=getToken();
|
|
||||||
//curToken='eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzIzMTE2MTIsImV4cCI6MTY3MjMxODgxMiwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.a4f41376e994c5fcd3ab537ce17572ef4c633863f87785cf7b6ffa353e2ed51c';
|
|
||||||
if (curToken && !isToken) {
|
|
||||||
config.headers[TokenName] = curToken // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
||||||
}
|
|
||||||
return config
|
|
||||||
}, error => {
|
|
||||||
console.log(error)
|
|
||||||
Promise.reject(error)
|
|
||||||
});
|
|
||||||
formRequest.interceptors.response.use(res => {
|
|
||||||
//console.log(res);
|
|
||||||
const code = res.data.status || 200;
|
|
||||||
if(code===200){
|
|
||||||
return res.data
|
|
||||||
}else{
|
|
||||||
if(code === 401){
|
|
||||||
store.dispatch('LogOut').then(() => {
|
|
||||||
location.href = this.webBaseUrl + ReLoginUrl;
|
|
||||||
})
|
|
||||||
}else if(code===403){
|
|
||||||
var msg='当前操作没有权限';
|
|
||||||
Message({message: msg, type: 'error'});
|
|
||||||
return Promise.reject(new Error(msg))
|
|
||||||
}else{
|
|
||||||
//Message({message: res.data.message, type: 'error'});
|
|
||||||
//console.log('err' + res.data.error);
|
|
||||||
return res.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
console.log('err',error)
|
|
||||||
let { message } = error;
|
|
||||||
if (message == "Network Error") {
|
|
||||||
message = "网络异常,请稍后重试";
|
|
||||||
}
|
|
||||||
else if (message.includes("timeout")) {
|
|
||||||
message = "网络异常或接口错误,请求超时";
|
|
||||||
}
|
|
||||||
else if (message.includes("Request failed with status code")) {
|
|
||||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
|
||||||
}
|
|
||||||
Message({
|
|
||||||
message: message,
|
|
||||||
type: 'error',
|
|
||||||
duration: 5 * 1000
|
|
||||||
})
|
|
||||||
return Promise.reject(error)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* request请求,可以自定义参数
|
|
||||||
*/
|
|
||||||
const request=formRequest.request;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get请求 ,只有url
|
|
||||||
*/
|
|
||||||
const get = function(baseURL,url){
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'get',
|
|
||||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**用户的待办任务数量
|
||||||
* post请求
|
{
|
||||||
* @param {Object} url
|
"pageNo":1,
|
||||||
* @param {Object} postData
|
"pageSize":10,
|
||||||
*/
|
"cmtask_name":"",任务名称
|
||||||
const post=function(baseURL,url,postData){
|
"cmtask_code":"",任务Id
|
||||||
if(postData){
|
"cmtask_status":"",状态
|
||||||
postData=qs.stringify(postData);
|
"cmtask_id":"965341999643234304" 学员id,当前人的
|
||||||
}
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'post',
|
|
||||||
data:postData,
|
|
||||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
//post请求
|
*/
|
||||||
const postForm=function(baseURL,url,data){
|
const userTaskList = function(data){
|
||||||
return request({
|
return ajax.postJson(baseURL,'/todoTask/queryTodoTaskDetail',data);
|
||||||
baseURL,
|
|
||||||
url,
|
|
||||||
data,
|
|
||||||
method: 'post',
|
|
||||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// const postJson=jsonRequest.post;
|
|
||||||
|
|
||||||
const postJson=function(baseURL,url,postData){
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'post',
|
|
||||||
data:postData,
|
|
||||||
headers:{'Content-Type':'application/json'},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出文件请求定义
|
|
||||||
const postJsonToFile=function(baseURL,url,postData){
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'post',
|
|
||||||
data:postData,
|
|
||||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* put请求
|
|
||||||
*/
|
|
||||||
const put=function(baseURL,url,data){
|
|
||||||
if(data){
|
|
||||||
data=qs.stringify(data);
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'put',
|
|
||||||
data:data,
|
|
||||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const putJson=function(baseURL,url,data){
|
|
||||||
return request({
|
|
||||||
baseURL,
|
|
||||||
url: url,
|
|
||||||
method: 'put',
|
|
||||||
data:data,
|
|
||||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
tokenName:TokenName,
|
getTaskNum,
|
||||||
request,
|
userTaskList
|
||||||
get,
|
|
||||||
post,
|
|
||||||
postJson,
|
|
||||||
postJsonToFile,
|
|
||||||
put,
|
|
||||||
putJson,
|
|
||||||
}
|
}
|
||||||
|
|||||||
197
src/api/unionAjax.js
Normal file
197
src/api/unionAjax.js
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
import axios from 'axios'
|
||||||
|
import qs from 'qs'
|
||||||
|
import { Notification, MessageBox, Message } from 'element-ui'
|
||||||
|
import store from '@/store'
|
||||||
|
import { getToken } from '@/utils/token'
|
||||||
|
import errorCode from '@/utils/errorCode'
|
||||||
|
/**
|
||||||
|
*request请求 axios.request(config)
|
||||||
|
*requestJson请求 axios.request(config)
|
||||||
|
*get请求 axios.get(url[, config])
|
||||||
|
*post请求 axios.post(url[, data[, config]])
|
||||||
|
*postJson请求 axios.post(url[, data[, config]])
|
||||||
|
*put请求 axios.put(url[, data[, config]])
|
||||||
|
*putJson请求 axios.put(url[, data[, config]])
|
||||||
|
*patch请求 axios.patch(url[, data[, config]])
|
||||||
|
*patchJson请求 axios.patch(url[, data[, config]])
|
||||||
|
*delete请求 axios.delete(url[, config])
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||||
|
const TokenName='token';
|
||||||
|
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||||
|
//只是用于发送json对象数据时使用post,put,patch
|
||||||
|
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||||
|
//只是用于发送json对象数据时使用post,put,patch
|
||||||
|
//用于普通的发送请求
|
||||||
|
const formRequest=axios.create({
|
||||||
|
//headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||||
|
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||||
|
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||||
|
//超时
|
||||||
|
timeout: 10000,
|
||||||
|
})
|
||||||
|
//发送json对象的拦截器
|
||||||
|
formRequest.interceptors.request.use(config => {
|
||||||
|
//是否需要设置 token
|
||||||
|
const isToken = (config.headers || {}).isToken === false
|
||||||
|
let curToken=getToken();
|
||||||
|
//curToken='eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzIzMTE2MTIsImV4cCI6MTY3MjMxODgxMiwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.a4f41376e994c5fcd3ab537ce17572ef4c633863f87785cf7b6ffa353e2ed51c';
|
||||||
|
if (curToken && !isToken) {
|
||||||
|
config.headers[TokenName] = curToken // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
}, error => {
|
||||||
|
console.log(error)
|
||||||
|
Promise.reject(error)
|
||||||
|
});
|
||||||
|
formRequest.interceptors.response.use(res => {
|
||||||
|
//console.log(res);
|
||||||
|
const code = res.data.status || 200;
|
||||||
|
if(code===200){
|
||||||
|
return res.data
|
||||||
|
}else{
|
||||||
|
if(code === 401){
|
||||||
|
store.dispatch('LogOut').then(() => {
|
||||||
|
location.href = this.webBaseUrl + ReLoginUrl;
|
||||||
|
})
|
||||||
|
}else if(code===403){
|
||||||
|
var msg='当前操作没有权限';
|
||||||
|
Message({message: msg, type: 'error'});
|
||||||
|
return Promise.reject(new Error(msg))
|
||||||
|
}else{
|
||||||
|
//Message({message: res.data.message, type: 'error'});
|
||||||
|
//console.log('err' + res.data.error);
|
||||||
|
return res.data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log('err',error)
|
||||||
|
let { message } = error;
|
||||||
|
if (message == "Network Error") {
|
||||||
|
message = "网络异常,请稍后重试";
|
||||||
|
}
|
||||||
|
else if (message.includes("timeout")) {
|
||||||
|
message = "网络异常或接口错误,请求超时";
|
||||||
|
}
|
||||||
|
else if (message.includes("Request failed with status code")) {
|
||||||
|
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||||
|
}
|
||||||
|
Message({
|
||||||
|
message: message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 5 * 1000
|
||||||
|
})
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request请求,可以自定义参数
|
||||||
|
*/
|
||||||
|
const request=formRequest.request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get请求 ,只有url
|
||||||
|
*/
|
||||||
|
const get = function(baseURL,url){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'get',
|
||||||
|
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* post请求
|
||||||
|
* @param {Object} url
|
||||||
|
* @param {Object} postData
|
||||||
|
*/
|
||||||
|
const post=function(baseURL,url,postData){
|
||||||
|
if(postData){
|
||||||
|
postData=qs.stringify(postData);
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'post',
|
||||||
|
data:postData,
|
||||||
|
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//post请求
|
||||||
|
const postForm=function(baseURL,url,data){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url,
|
||||||
|
data,
|
||||||
|
method: 'post',
|
||||||
|
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// const postJson=jsonRequest.post;
|
||||||
|
|
||||||
|
const postJson=function(baseURL,url,postData){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'post',
|
||||||
|
data:postData,
|
||||||
|
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出文件请求定义
|
||||||
|
const postJsonToFile=function(baseURL,url,postData){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'post',
|
||||||
|
data:postData,
|
||||||
|
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* put请求
|
||||||
|
*/
|
||||||
|
const put=function(baseURL,url,data){
|
||||||
|
if(data){
|
||||||
|
data=qs.stringify(data);
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'put',
|
||||||
|
data:data,
|
||||||
|
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const putJson=function(baseURL,url,data){
|
||||||
|
return request({
|
||||||
|
baseURL,
|
||||||
|
url: url,
|
||||||
|
method: 'put',
|
||||||
|
data:data,
|
||||||
|
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
tokenName:TokenName,
|
||||||
|
request,
|
||||||
|
get,
|
||||||
|
post,
|
||||||
|
postJson,
|
||||||
|
postJsonToFile,
|
||||||
|
put,
|
||||||
|
putJson,
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ import { getToken, setToken, removeToken } from '@/utils/token'
|
|||||||
import app from '@/api/console.js'
|
import app from '@/api/console.js'
|
||||||
import apiLogin from '@/api/login.js'
|
import apiLogin from '@/api/login.js'
|
||||||
import apiMessage from '@/api/system/message.js'
|
import apiMessage from '@/api/system/message.js'
|
||||||
|
import apiManage from '@/api/manage/manage.js'
|
||||||
import apiCourse from "@/api/modules/course.js";
|
import apiCourse from "@/api/modules/course.js";
|
||||||
import apiBoeCourse from "@/api/boe/course.js";
|
import apiBoeCourse from "@/api/boe/course.js";
|
||||||
import apiBoeLogout from "@/api/boe/login.js";
|
import apiBoeLogout from "@/api/boe/login.js";
|
||||||
@@ -79,6 +80,13 @@ const user = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
refrashStudyTaskCount({ commit }) {
|
refrashStudyTaskCount({ commit }) {
|
||||||
|
// apiManage.getTaskNum().then(res=>{
|
||||||
|
// if(res.code==200){
|
||||||
|
// commit('SET_StudyTaskCount',res.data.todoTaskCounts);
|
||||||
|
// }else{
|
||||||
|
// console.log("获取学习任务数失败:"+res.msg);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
apiBoeCourse.cmtaskList({page:1,size:1,get_count:1}).then(res=>{
|
apiBoeCourse.cmtaskList({page:1,size:1,get_count:1}).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|||||||
@@ -131,10 +131,10 @@
|
|||||||
<el-table-column label="操作" width="180px" fixed="right">
|
<el-table-column label="操作" width="180px" fixed="right">
|
||||||
<template slot-scope="scope" class="btn-gl">
|
<template slot-scope="scope" class="btn-gl">
|
||||||
<el-button type="text" size="mini" v-if="scope.row.status == 5 && !scope.row.published" @click="releaseData(scope.row)">发布</el-button>
|
<el-button type="text" size="mini" v-if="scope.row.status == 5 && !scope.row.published" @click="releaseData(scope.row)">发布</el-button>
|
||||||
<el-button v-if="scope.row.published" @click="showManageStudy(scope.row)" type="text" size="mini">管理</el-button>
|
<el-button v-if="pageManage && scope.row.published" @click="showStudent(scope.row)" type="text" size="mini">学员</el-button>
|
||||||
<el-button v-if="scope.row.status == 2" @click="withdraw(scope.row)" type="text" size="mini">撤回</el-button>
|
<el-button v-if="!forChoose && scope.row.published" @click="showManageStudy(scope.row)" type="text" size="mini">管理</el-button>
|
||||||
|
<el-button v-if="!forChoose && scope.row.status == 2" @click="withdraw(scope.row)" type="text" size="mini">撤回</el-button>
|
||||||
<el-button v-if="scope.row.status != 2" type="text" size="mini" @click="editCurriculum(scope.row)">编辑</el-button>
|
<el-button v-if="scope.row.status != 2" type="text" size="mini" @click="editCurriculum(scope.row)">编辑</el-button>
|
||||||
<el-button v-if="scope.row.status != 2 && !scope.row.published" type="text" size="mini" @click="copyCourse(scope.row)">复制</el-button>
|
|
||||||
<el-button v-if="scope.row.status != 2 && !scope.row.published" type="text" size="mini" @click="delItem(scope.row)">删除</el-button>
|
<el-button v-if="scope.row.status != 2 && !scope.row.published" type="text" size="mini" @click="delItem(scope.row)">删除</el-button>
|
||||||
<el-dropdown v-if="scope.row.published" type="text" size="mini" style="margin-left:10px">
|
<el-dropdown v-if="scope.row.published" type="text" size="mini" style="margin-left:10px">
|
||||||
<el-button type="text" size="mini">更多<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
<el-button type="text" size="mini">更多<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
||||||
@@ -143,6 +143,7 @@
|
|||||||
<el-dropdown-item v-if="scope.row.published" @click.native="isDisable(scope.row)">{{scope.row.enabled? '停用':'启用'}}</el-dropdown-item>
|
<el-dropdown-item v-if="scope.row.published" @click.native="isDisable(scope.row)">{{scope.row.enabled? '停用':'启用'}}</el-dropdown-item>
|
||||||
<el-dropdown-item v-if="scope.row.published" @click.native="showQrimage(scope.row)">二维码</el-dropdown-item><!--发布之后才可以查看二维码-->
|
<el-dropdown-item v-if="scope.row.published" @click.native="showQrimage(scope.row)">二维码</el-dropdown-item><!--发布之后才可以查看二维码-->
|
||||||
<el-dropdown-item v-if="scope.row.published" @click.native="setTop(scope.row)">{{scope.row.isTop? '取消置顶':'置顶'}}</el-dropdown-item>
|
<el-dropdown-item v-if="scope.row.published" @click.native="setTop(scope.row)">{{scope.row.isTop? '取消置顶':'置顶'}}</el-dropdown-item>
|
||||||
|
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
@@ -298,6 +299,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
forChoose:false,
|
forChoose:false,
|
||||||
|
pageManage:false,
|
||||||
showDetails: false,
|
showDetails: false,
|
||||||
examin:{
|
examin:{
|
||||||
detailType: '',
|
detailType: '',
|
||||||
@@ -380,6 +382,10 @@ export default {
|
|||||||
if(chooseFlag && chooseFlag=='choose'){
|
if(chooseFlag && chooseFlag=='choose'){
|
||||||
this.forChoose=true;
|
this.forChoose=true;
|
||||||
}
|
}
|
||||||
|
if(this.$route.query && this.$route.query.page && this.$route.query.page == 'manage') {
|
||||||
|
this.pageManage=true;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.$route.query && this.$route.query.open && this.$route.query.open == 'new') {
|
if (this.$route.query && this.$route.query.open && this.$route.query.open == 'new') {
|
||||||
this.addNewCourse();
|
this.addNewCourse();
|
||||||
}
|
}
|
||||||
@@ -398,6 +404,10 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showStudent(row){
|
||||||
|
//出现学员管理
|
||||||
|
window.parent.openSelectStu(row);
|
||||||
|
},
|
||||||
handleChoose(row){ //选择课程
|
handleChoose(row){ //选择课程
|
||||||
window.parent.selectCourse(row);
|
window.parent.selectCourse(row);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
<el-button type="primary" size="medium" @click="queryUserData">搜索</el-button>
|
<el-button type="primary" size="medium" @click="queryUserData">搜索</el-button>
|
||||||
<el-button type="primary" class="findBtn" size="medium" @click="reset">重置</el-button>
|
<el-button type="primary" class="findBtn" size="medium" @click="reset">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table ref="userTable" :data="userData" v-loading="userDataLoading" tooltip-effect="dark" @selection-change="userSelectionChange">
|
<el-table ref="groupUserTable" :data="userData" v-loading="userDataLoading" tooltip-effect="dark" @selection-change="userSelectionChange">
|
||||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||||
<el-table-column label="姓名" prop="realName" align="center"></el-table-column>
|
<el-table-column label="姓名" prop="realName" align="center"></el-table-column>
|
||||||
<el-table-column prop="userNo" label="工号" align="center"></el-table-column>
|
<el-table-column prop="userNo" label="工号" align="center"></el-table-column>
|
||||||
@@ -388,15 +388,22 @@
|
|||||||
if(this.multipleSelection.length == 0){
|
if(this.multipleSelection.length == 0){
|
||||||
this.$message({ type: "error", message: '请先选择要删除的数据' ,offset:50});
|
this.$message({ type: "error", message: '请先选择要删除的数据' ,offset:50});
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
let $this=this;
|
||||||
for (let j = 0; j < this.tableData.length; j++) {
|
//console.log(this.multipleSelection,'this.multipleSelection');
|
||||||
if (this.tableData[j].aid === this.multipleSelection[i].aid) {
|
this.multipleSelection.forEach(item=>{
|
||||||
this.tableData.splice(j, 1)
|
var delIdx=-1;
|
||||||
break
|
$this.tableData.forEach((row,rowIdx)=>{
|
||||||
|
if(row.id==item.id){
|
||||||
|
delIdx=rowIdx;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(delIdx>-1){
|
||||||
|
$this.tableData.splice(delIdx, 1)
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
this.multipleSelection=[];
|
||||||
this.queryTableData();
|
this.$refs.multipleTable.clearSelection();
|
||||||
|
|
||||||
},
|
},
|
||||||
openImportDialog(){
|
openImportDialog(){
|
||||||
this.selectFile = '';
|
this.selectFile = '';
|
||||||
|
|||||||
@@ -60,11 +60,7 @@
|
|||||||
<el-dialog title="复制受众" :visible.sync="copyUserGroupShow" :close-on-click-modal="false" width="500px" custom-class="g-dialog">
|
<el-dialog title="复制受众" :visible.sync="copyUserGroupShow" :close-on-click-modal="false" width="500px" custom-class="g-dialog">
|
||||||
<el-form ref="copyForm" :rules="copyRules" :model="copyForm" label-width="100px">
|
<el-form ref="copyForm" :rules="copyRules" :model="copyForm" label-width="100px">
|
||||||
<el-form-item label="受众名称:" prop="name">
|
<el-form-item label="受众名称:" prop="name">
|
||||||
<el-input
|
<el-input v-model="copyForm.audienceName" placeholder="请输入受众名称" maxlength="50"></el-input>
|
||||||
v-model="copyForm.audienceName"
|
|
||||||
placeholder="请输入受众名称"
|
|
||||||
maxlength="50"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -335,6 +331,9 @@
|
|||||||
this.copyForm.audienceName = row.name;
|
this.copyForm.audienceName = row.name;
|
||||||
},
|
},
|
||||||
copy(){
|
copy(){
|
||||||
|
if(!this.copyForm.audienceName){
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.copyForm.validate((valid) => {
|
this.$refs.copyForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
apiAudience.copy(this.copyForm).then((res) => {
|
apiAudience.copy(this.copyForm).then((res) => {
|
||||||
|
|||||||
@@ -32,8 +32,9 @@
|
|||||||
<span v-if="item.cmtask_status==0">未开始</span>
|
<span v-if="item.cmtask_status==0">未开始</span>
|
||||||
<span v-if="item.cmtask_status==1">进行中</span>
|
<span v-if="item.cmtask_status==1">进行中</span>
|
||||||
<span v-if="item.cmtask_status==2">已完成</span>
|
<span v-if="item.cmtask_status==2">已完成</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uc-course-time">推送时间:{{ formatsec(Number(item.updated_at) * 1000 )}}</div>
|
<!-- <div class="uc-course-time">推送时间:{{ formatsec(Number(item.updated_at) * 1000 )}}</div> -->
|
||||||
|
<div class="uc-course-time">推送时间:{{ item.created_at}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uc-course-btns">
|
<div class="uc-course-btns">
|
||||||
<el-button @click="jumpRouter(item)" type="primary" size="small">开始学习</el-button>
|
<el-button @click="jumpRouter(item)" type="primary" size="small">开始学习</el-button>
|
||||||
@@ -68,9 +69,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import studyItem from '@/components/Course/studyItem.vue';
|
import studyItem from '@/components/Course/studyItem.vue';
|
||||||
import apiBoeCourse from '@/api/boe/course.js';
|
import apiBoeCourse from '@/api/boe/course.js';
|
||||||
|
import apiManage from '@/api/manage/manage.js'
|
||||||
import {formatsec} from '@/utils/datetime.js'
|
import {formatsec} from '@/utils/datetime.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'ucStudyCourses',
|
name: 'ucStudyTask',
|
||||||
components: { studyItem },
|
components: { studyItem },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -120,8 +122,17 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
jumpRouter(item) {
|
jumpRouter(item) {
|
||||||
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`,'_self' )
|
//window.open(`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`,'_self')
|
||||||
location.href=`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`;
|
location.href=`${this.webBaseUrl}/course/boeframe?id=${item.cmtask_id}`;
|
||||||
|
|
||||||
|
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||||
|
// if(item.cmtask_type==1){ //学习路径图
|
||||||
|
// //let params=encodeURIComponent('projectId='+courseId);
|
||||||
|
// //this.$router.push('/forward?to='+studentPath+'/projectdetails¶ms='+params);
|
||||||
|
// location.href=urlPre+'/fe-student/pathdetails?routerId='+item.cmtask_code
|
||||||
|
// }else if(item.cmtask_type==2){ //学习项目
|
||||||
|
// location.href=urlPre+'/fe-student/projectdetails?projectId='+item.cmtask_code
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
loadBoeData() {
|
loadBoeData() {
|
||||||
@@ -129,13 +140,23 @@ export default {
|
|||||||
this.params.cmtask_status = this.status;
|
this.params.cmtask_status = this.status;
|
||||||
}
|
}
|
||||||
let params={
|
let params={
|
||||||
// keyword:this.keyword,
|
pageNo:this.page,
|
||||||
page:this.page,
|
pageSize:this.size,
|
||||||
size:this.size,
|
|
||||||
cmtask_status:this.params.cmtask_status,
|
cmtask_status:this.params.cmtask_status,
|
||||||
cmtask_name:this.params.cmtask_name,
|
cmtask_name:this.params.cmtask_name,
|
||||||
}
|
}
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
|
// apiManage.userTaskList(params).then(res=>{
|
||||||
|
// if(res.code==200){
|
||||||
|
// this.total = 10;
|
||||||
|
// this.couresList = res.data.records;
|
||||||
|
// }else{
|
||||||
|
// this.$message.error('查询数据失败:'+res.msg);
|
||||||
|
// }
|
||||||
|
// this.loading=false;
|
||||||
|
// }).catch(()=>{
|
||||||
|
// this.loading=false;
|
||||||
|
// })
|
||||||
apiBoeCourse.cmtaskList(params).then(res=>{
|
apiBoeCourse.cmtaskList(params).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.total = res.result.count
|
this.total = res.result.count
|
||||||
|
|||||||
@@ -117,6 +117,15 @@ module.exports = {
|
|||||||
// 114.115.162.187 测试环境
|
// 114.115.162.187 测试环境
|
||||||
// 192.168.0.107 晋宇
|
// 192.168.0.107 晋宇
|
||||||
proxy: {
|
proxy: {
|
||||||
|
'/manageApi': {
|
||||||
|
// 目标代理服务器地址
|
||||||
|
target: 'https://u-pre.boe.com',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: false,
|
||||||
|
pathRewrite: {
|
||||||
|
'^/manageApi': '/manageApi'
|
||||||
|
}
|
||||||
|
},
|
||||||
'/systemapi': {
|
'/systemapi': {
|
||||||
// 目标代理服务器地址
|
// 目标代理服务器地址
|
||||||
target: 'http://127.0.0.1:9090',
|
target: 'http://127.0.0.1:9090',
|
||||||
@@ -129,7 +138,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
'/uboeApi': {
|
'/uboeApi': {
|
||||||
// 目标代理服务器地址
|
// 目标代理服务器地址
|
||||||
target: 'https://u-pre.boe.com',
|
target: 'https://u-pre.boe.comww',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
secure: false,
|
secure: false,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
|
|||||||
Reference in New Issue
Block a user