mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-08 02:16:43 +08:00
Compare commits
122 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bbc3904e0 | ||
|
|
3d7ca1cc20 | ||
|
|
b529695751 | ||
|
|
ebae7f6c0b | ||
|
|
16355a1e5e | ||
|
|
91f06d4ed6 | ||
|
|
4ee084cff2 | ||
|
|
9b3b3b94ef | ||
|
|
427ff20531 | ||
|
|
43aaeabf99 | ||
|
|
6c5e189448 | ||
|
|
38fe26c146 | ||
|
|
27e3f37033 | ||
|
|
f5ac82769f | ||
|
|
ce4be998a4 | ||
|
|
2f034447b6 | ||
|
|
8524f7ec6f | ||
|
|
3f108ab9b7 | ||
|
|
9c3b1f8857 | ||
|
|
57c01d2519 | ||
|
|
e9f872dd07 | ||
|
|
3a5462465b | ||
|
|
fb2e07cea3 | ||
|
|
24de64d8e5 | ||
|
|
86ec8138dd | ||
|
|
bc15ec9e21 | ||
|
|
79040580a1 | ||
|
|
4b2285a6f9 | ||
|
|
a15c8510c2 | ||
|
|
109122f1c1 | ||
|
|
6d6d0e4539 | ||
|
|
5e561930e1 | ||
|
|
556eaea825 | ||
|
|
2fd3ac0de2 | ||
|
|
bbafde31b5 | ||
|
|
3eae32b617 | ||
|
|
dfdba51202 | ||
|
|
0b5d0e3180 | ||
|
|
9bc6af207b | ||
|
|
8711bbaabb | ||
|
|
a25198f80f | ||
|
|
cc7801d42d | ||
|
|
ef868f8165 | ||
|
|
417d911f5d | ||
|
|
aa1301575e | ||
|
|
2a633e25e5 | ||
|
|
81b8ef168c | ||
|
|
7f587138ff | ||
|
|
973e3f947d | ||
|
|
6afc19d21c | ||
|
|
305a5481c8 | ||
|
|
01bbe6c5c4 | ||
|
|
be10b56885 | ||
|
|
b2458b6b92 | ||
|
|
f7d247dca2 | ||
|
|
560d180583 | ||
|
|
e9953f2ac6 | ||
|
|
b2908ba75e | ||
|
|
d087082613 | ||
|
|
f8c6f55e73 | ||
|
|
f0ea689166 | ||
|
|
5b2a6d304c | ||
|
|
44ccf8db6d | ||
|
|
5f42a95f47 | ||
|
|
b0bc517936 | ||
|
|
897684b4f2 | ||
|
|
c9185722f8 | ||
|
|
f43a03b661 | ||
|
|
69294e0d49 | ||
|
|
b00e2c80b0 | ||
|
|
a901e488b4 | ||
|
|
512144d7d7 | ||
|
|
fd85b8b5d0 | ||
|
|
d1d65d41ca | ||
|
|
526e5e0e48 | ||
|
|
cee45f82cb | ||
|
|
4b668cf186 | ||
|
|
a656c27e24 | ||
|
|
743478655e | ||
|
|
f07ef38cd5 | ||
|
|
47ab19db7e | ||
|
|
254344a528 | ||
|
|
55b8ee7840 | ||
|
|
109d154387 | ||
|
|
e48cb36917 | ||
|
|
79cd4d2e03 | ||
|
|
cc4909897b | ||
|
|
2e7fa1cc2e | ||
|
|
dfc22479bb | ||
|
|
ac788d59f3 | ||
|
|
4f74216c6e | ||
|
|
a5279210c7 | ||
|
|
e0db15c85d | ||
|
|
b38a4768a6 | ||
|
|
63439cb57f | ||
|
|
478890ff09 | ||
|
|
b18f9d132b | ||
|
|
a1047420fb | ||
|
|
7b02644cde | ||
|
|
2f6e38430e | ||
|
|
6a875182d7 | ||
|
|
a7ccf26932 | ||
|
|
a2760f2ec6 | ||
|
|
5d8f9874c8 | ||
|
|
fbf3b19e40 | ||
|
|
1d2d20acb0 | ||
|
|
3cc0f690a4 | ||
|
|
0d01f7da86 | ||
|
|
803d9c2dbb | ||
|
|
101ebdbbad | ||
|
|
1b47071a99 | ||
|
|
8a39d424a2 | ||
|
|
43a8ae3606 | ||
|
|
ebf99e8a7f | ||
|
|
6d37310bc4 | ||
|
|
f9675b1ab7 | ||
|
|
ed6fb14367 | ||
|
|
ee43ea7b0c | ||
|
|
83bda2e8a5 | ||
|
|
90622d6ebc | ||
|
|
b7273410a0 | ||
|
|
9580dd9735 |
26
src/App.vue
26
src/App.vue
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div id="app" style="width: 100vw">
|
||||
<div id="app">
|
||||
<keep-alive :include="['case']">
|
||||
<router-view />
|
||||
12312
|
||||
</keep-alive>
|
||||
<!-- 添加AI Call组件 -->
|
||||
<AICall
|
||||
:dialogVisible="showAICall"
|
||||
<AICall
|
||||
:dialogVisible="showAICall"
|
||||
@close="onCloseAICall"
|
||||
@restore="onRestoreAICall"
|
||||
/>
|
||||
@@ -16,7 +16,7 @@
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex';
|
||||
import AICall from '@/views/portal/case/AICall.vue';
|
||||
|
||||
|
||||
export default{
|
||||
name: 'App',
|
||||
components: {
|
||||
@@ -31,12 +31,12 @@
|
||||
// 通过Vuex关闭AI Call组件
|
||||
this.$store.dispatch('app/setShowAICall', false);
|
||||
},
|
||||
|
||||
|
||||
onRestoreAICall() {
|
||||
// 通过Vuex显示AI Call组件
|
||||
this.$store.dispatch('app/setShowAICall', true);
|
||||
},
|
||||
|
||||
|
||||
// 检查当前路由是否应该显示AI弹窗
|
||||
checkRouteForAICall() {
|
||||
const currentRoute = this.$route.name;
|
||||
@@ -59,7 +59,7 @@
|
||||
// if(this.userInfo && this.userInfo.name!=''){
|
||||
// this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
|
||||
// }
|
||||
|
||||
|
||||
// 初始化检查路由
|
||||
this.checkRouteForAICall();
|
||||
},
|
||||
@@ -87,16 +87,4 @@
|
||||
border: 1px solid #e7e7e7 !important;
|
||||
box-shadow: 0px 1px 5px 1px rgba(92,98,111,.3);
|
||||
}
|
||||
|
||||
#app {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#app > *:not(.case-expert-dialog) {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.case-expert-dialog {
|
||||
pointer-events: auto;
|
||||
}
|
||||
</style>
|
||||
241
src/api/ajax.js
241
src/api/ajax.js
@@ -19,93 +19,88 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
|
||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
const TokenName='XBOE-Access-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: 60000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code === 401) {
|
||||
//Message({message: msg, type: 'error'});
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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 => {
|
||||
const formRequest=axios.create({
|
||||
// headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
// baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 60000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
//Message({message: msg, type: 'error'});
|
||||
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 = "网络异常,请稍后重试";
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "网络异常或接口错误,请求超时";
|
||||
message = "网络异常或接口错误,请求超时";
|
||||
}
|
||||
else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request = formRequest.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' }
|
||||
})
|
||||
const get = function(baseURL,url){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,61 +108,61 @@ const get = function (baseURL, url) {
|
||||
* @param {Object} url
|
||||
* @param {Object} postData
|
||||
*/
|
||||
const post = function (baseURL, url, postData) {
|
||||
if (postData) {
|
||||
postData = qs.stringify(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' }
|
||||
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 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) {
|
||||
const postJson=function(baseURL,url,postData){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const postPdf = function (baseURL, url, postData) {
|
||||
const postPdf=function(baseURL,url,postData){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
method: 'post',
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/pdf' },
|
||||
baseURL,
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/pdf'},
|
||||
})
|
||||
}
|
||||
|
||||
// 导出文件请求定义
|
||||
const postJsonToFile = function (baseURL, url, postData) {
|
||||
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'
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -175,39 +170,39 @@ const postJsonToFile = function (baseURL, url, postData) {
|
||||
/**
|
||||
* put请求
|
||||
*/
|
||||
const put = function (baseURL, url, data) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
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' }
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
})
|
||||
}
|
||||
|
||||
const putJson = function (baseURL, url, data) {
|
||||
const putJson=function(baseURL,url,data){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
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,
|
||||
postPdf,
|
||||
tokenName:TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
postJsonToFile,
|
||||
put,
|
||||
putJson,
|
||||
postPdf,
|
||||
}
|
||||
|
||||
@@ -19,95 +19,90 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
|
||||
// const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName = 'token';
|
||||
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(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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)
|
||||
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 = "网络异常,请稍后重试";
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "网络异常或接口错误,请求超时";
|
||||
message = "网络异常或接口错误,请求超时";
|
||||
}
|
||||
else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request = formRequest.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' }
|
||||
})
|
||||
const get = function(baseURL,url){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,49 +110,49 @@ const get = function (baseURL, url) {
|
||||
* @param {Object} url
|
||||
* @param {Object} postData
|
||||
*/
|
||||
const post = function (baseURL, url, postData) {
|
||||
if (postData) {
|
||||
postData = qs.stringify(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' }
|
||||
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 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) {
|
||||
const postJson=function(baseURL,url,postData){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json'},
|
||||
})
|
||||
}
|
||||
|
||||
// 导出文件请求定义
|
||||
const postJsonToFile = function (baseURL, url, postData) {
|
||||
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'
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'post',
|
||||
data:postData,
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -165,38 +160,38 @@ const postJsonToFile = function (baseURL, url, postData) {
|
||||
/**
|
||||
* put请求
|
||||
*/
|
||||
const put = function (baseURL, url, data) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
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' }
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data:data,
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
})
|
||||
}
|
||||
|
||||
const putJson = function (baseURL, url, data) {
|
||||
const putJson=function(baseURL,url,data){
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'put',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
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,
|
||||
tokenName:TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
postJsonToFile,
|
||||
put,
|
||||
putJson,
|
||||
}
|
||||
|
||||
@@ -18,201 +18,191 @@ import errorCode from '@/utils/errorCode'
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl = process.env.VUE_APP_LOGIN_URL;
|
||||
const TokenName = 'token';
|
||||
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
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
});
|
||||
//发送json对象的拦截器
|
||||
jsonRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code1 = res.data.status || 200;
|
||||
const code = parseInt(code1);
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
const code1 = res.data.status || 200;
|
||||
const code=parseInt(code1);
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
}else{
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = 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 Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = 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 Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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 = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson = jsonRequest.request;
|
||||
const requestJson=jsonRequest.request;
|
||||
//get请求
|
||||
const get = formRequest.request;
|
||||
const get=formRequest.request;
|
||||
//post请求
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url, data, config);
|
||||
return formRequest.post(url,data,config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson = jsonRequest.post;
|
||||
const postJson=jsonRequest.post;
|
||||
//put请求
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url, data, config);
|
||||
return formRequest.put(url,data,config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson = jsonRequest.put;
|
||||
const putJson=jsonRequest.put;
|
||||
//patch请求
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url, data, config);
|
||||
return formRequest.patch(url,data,config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson = jsonRequest.patch;
|
||||
const patchJson=jsonRequest.patch;
|
||||
//delete请求
|
||||
const del = formRequest.delete;
|
||||
const del=formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
}
|
||||
|
||||
@@ -16,196 +16,186 @@ import errorCode from '@/utils/errorCode'
|
||||
*patchJson请求 axios.patch(url[, data[, config]])
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl = "/login";
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
|
||||
const ReLoginUrl="/login";
|
||||
const TokenName='XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
});
|
||||
//发送json对象的拦截器
|
||||
jsonRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
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;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
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,
|
||||
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
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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);
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
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)
|
||||
}
|
||||
}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 = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson = jsonRequest.request;
|
||||
const requestJson=jsonRequest.request;
|
||||
//get请求
|
||||
const get = formRequest.request;
|
||||
const get=formRequest.request;
|
||||
//post请求
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url, data, config);
|
||||
return formRequest.post(url,data,config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson = jsonRequest.post;
|
||||
const postJson=jsonRequest.post;
|
||||
//put请求
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url, data, config);
|
||||
return formRequest.put(url,data,config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson = jsonRequest.put;
|
||||
const putJson=jsonRequest.put;
|
||||
//patch请求
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url, data, config);
|
||||
return formRequest.patch(url,data,config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson = jsonRequest.patch;
|
||||
const patchJson=jsonRequest.patch;
|
||||
//delete请求
|
||||
const del = formRequest.delete;
|
||||
const del=formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
}
|
||||
|
||||
@@ -17,195 +17,185 @@ import errorCode from '@/utils/errorCode'
|
||||
*delete请求 axios.delete(url[, config])
|
||||
*/
|
||||
|
||||
const ReLoginUrl = "/login";
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
const ReLoginUrl="/login";
|
||||
const TokenName='XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
});
|
||||
//发送json对象的拦截器
|
||||
jsonRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
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;
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
}
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
// 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);
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
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)
|
||||
}
|
||||
}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 = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson = jsonRequest.request;
|
||||
const requestJson=jsonRequest.request;
|
||||
//get请求
|
||||
const get = formRequest.request;
|
||||
const get=formRequest.request;
|
||||
//post请求
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url, data, config);
|
||||
return formRequest.post(url,data,config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson = jsonRequest.post;
|
||||
const postJson=jsonRequest.post;
|
||||
//put请求
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url, data, config);
|
||||
return formRequest.put(url,data,config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson = jsonRequest.put;
|
||||
const putJson=jsonRequest.put;
|
||||
//patch请求
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url, data, config);
|
||||
return formRequest.patch(url,data,config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson = jsonRequest.patch;
|
||||
const patchJson=jsonRequest.patch;
|
||||
//delete请求
|
||||
const del = formRequest.delete;
|
||||
const del=formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del
|
||||
}
|
||||
|
||||
@@ -440,12 +440,6 @@ const queryCrowd=function(query){
|
||||
const ids=function (data){
|
||||
return ajax.postJson('/xboe/m/course/manage/ids',data);
|
||||
}
|
||||
|
||||
const saveTip = function() {
|
||||
return ajax.postJson('/xboe/m/course/manage/saveTip');
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
saveBase,
|
||||
submitCourse,
|
||||
@@ -488,7 +482,6 @@ export default {
|
||||
exportCourseAudit,
|
||||
exportCourse,
|
||||
queryCrowd,
|
||||
ids,
|
||||
saveTip
|
||||
ids
|
||||
|
||||
}
|
||||
|
||||
@@ -41,43 +41,6 @@
|
||||
<el-button @click="toInputCourse()" type="primary">确定</el-button>
|
||||
</span> -->
|
||||
</el-dialog>
|
||||
|
||||
<!-- 蒙层引导组件 -->
|
||||
<div v-if="showGuidance" class="guidance-overlay" @click="closeGuidance">
|
||||
<div class="guidance-content">
|
||||
<div class="guidance-title"></div> <!--新功能引导-->
|
||||
<div class="guidance-steps">
|
||||
<div class="guidance-step" :class="{ active: currentStep === 1 }">
|
||||
<div class="step-number"></div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">用标签为课程精准定位,吸引更多学员!可从以下维度构思:</div>
|
||||
<div class="step-desc" style="padding-left: 20px;">✨ 讲领域(如:品质管理)</div>
|
||||
<div class="step-desc" style="padding-left: 20px;">✨ 教技能(如:沟通技巧)</div>
|
||||
<div class="step-desc" style="padding-left: 20px;">✨ 涉内容(如:5W1H分析法)</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="guidance-step" :class="{ active: currentStep === 2 }">
|
||||
<div class="step-number">2</div>
|
||||
<div class="step-content">
|
||||
<div class="step-title">添加课程标签</div>
|
||||
<div class="step-desc">为课程添加相关标签,最多5个,便于搜索和分类,可回车创建新标签</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<!-- <div class="guidance-actions">
|
||||
<el-button @click="previousStep1" v-if="currentStep > 1">上一步</el-button>
|
||||
<el-button type="primary" @click="nextStep">
|
||||
{{ currentStep === 2 ? '完成' : '下一步' }}
|
||||
</el-button>
|
||||
<el-button @click="closeGuidance">跳过引导</el-button>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 高亮指引元素 -->
|
||||
<!-- <div v-if="showGuidance" class="highlight-element" :style="highlightStyle"></div>-->
|
||||
|
||||
|
||||
<!--微课-->
|
||||
<el-dialog v-if="weike.dlgShow" width="980px" :title="curCourseId == '' ? '新建课程' : '编辑课程'" :visible.sync="weike.dlgShow" :close-on-click-modal="false" custom-class="g-dialog" top="8vh">
|
||||
<el-form label-width="100px" size="small" class="wei-from" style="min-height: 600px;">
|
||||
@@ -101,29 +64,18 @@
|
||||
</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容分类" required >
|
||||
<el-form-item label="内容分类" required>
|
||||
<el-cascader
|
||||
placeholder="选择内容分类"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
v-model="sysTypeList"
|
||||
:props="{ value: 'id', label: 'name' }"
|
||||
:options="sysTypeListMap"
|
||||
@focus="onContentTypeFocus"
|
||||
@change="onContentTypeChange">
|
||||
</el-cascader>
|
||||
:options="sysTypeListMap"></el-cascader>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标签" required class="guidance-highlight" data-step="1" style="display: flex" >
|
||||
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList"
|
||||
:initialTags="courseTags" @change="handleTagsChange"
|
||||
@focus="onTagFocus" style="width: 95%;">
|
||||
</courseTag>
|
||||
<el-tooltip content="点击查看标签新功能引导" placement="top">
|
||||
<i class="el-icon-question" style="color: #409EFF; cursor: pointer;" @click="handleTagHelp"></i>
|
||||
</el-tooltip>
|
||||
<el-form-item label="标签" required>
|
||||
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList" :initialTags="courseTags" @change="handleTagsChange"></courseTag>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="资源归属" required>
|
||||
<el-input placeholder="请选择" v-model="orgName" >
|
||||
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
|
||||
@@ -269,16 +221,14 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容分类" required >
|
||||
<el-form-item label="内容分类" required>
|
||||
<el-cascader
|
||||
placeholder="选择内容分类"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
v-model="sysTypeList"
|
||||
:props="{ value: 'id', label: 'name' }"
|
||||
:options="sysTypeListMap"
|
||||
@focus="onContentTypeFocus"
|
||||
@change="onContentTypeChange">
|
||||
:options="sysTypeListMap">
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
|
||||
@@ -306,16 +256,9 @@
|
||||
</el-select> -->
|
||||
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签" required class="tag-from-item" data-step="1" >
|
||||
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList"
|
||||
:initialTags="courseTags" @change="handleTagsChange"
|
||||
@focus="onTagFocus" >
|
||||
</courseTag>
|
||||
<el-tooltip content="点击查看标签新功能引导" placement="top">
|
||||
<i class="el-icon-question" style="color: #409EFF; cursor: pointer;" @click="handleTagHelp"></i>
|
||||
</el-tooltip>
|
||||
<el-form-item label="标签" required>
|
||||
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList" :initialTags="courseTags" @change="handleTagsChange"></courseTag>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model.trim="keywords" maxlength="100" @keyup.enter.native="changeKeywords" placeholder="请输入关键字"></el-input>
|
||||
<el-tag v-for="(tag,index) in tips" size="small" :key="index" closable type="info" @close="closeKeywordsTag(tag,index)">
|
||||
@@ -593,13 +536,7 @@ export default {
|
||||
dlgShow: false
|
||||
},
|
||||
rightTypeId: {},
|
||||
catalogSortDialogShow: false,
|
||||
// 蒙层引导相关数据
|
||||
showGuidance: false,
|
||||
currentStep: 1,
|
||||
highlightStyle: {},
|
||||
guidanceElements: [],
|
||||
isFirstCreate: false, // 标记是否为首次创建
|
||||
catalogSortDialogShow: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -653,9 +590,6 @@ export default {
|
||||
this.loadUserGroup();
|
||||
},
|
||||
methods: {
|
||||
handleTagHelp(){
|
||||
this.checkAndShowGuidance();
|
||||
},
|
||||
// 关键字的更改
|
||||
changeKeywords(option){
|
||||
if(option.target.value){
|
||||
@@ -915,7 +849,7 @@ export default {
|
||||
|
||||
},
|
||||
resetCurCourseContent() {
|
||||
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentRefId: '', courseId: this.courseInfo.id };
|
||||
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentName: '', contentRefId: '', courseId: this.courseInfo.id };
|
||||
},
|
||||
// chooseCourseType(item, idx, open) {
|
||||
// this.courseChooseId = item.id;
|
||||
@@ -963,106 +897,19 @@ export default {
|
||||
this.courseInfo = rs.result;
|
||||
this.curCourseId = this.courseInfo.id
|
||||
console.log('保存课程成功',this.curCourseId)
|
||||
console.log('isTip ',this.courseInfo.isTip)
|
||||
// if(this.courseInfo.isTip){
|
||||
// // 检查是否为首次创建,显示引导
|
||||
// this.checkAndShowGuidance();
|
||||
// }
|
||||
|
||||
if (this.courseChooseId == 1) {
|
||||
this.weike.dlgShow = true;
|
||||
} else {
|
||||
this.biaoke.dlgShow = true;
|
||||
}
|
||||
// this.$nextTick(() => {
|
||||
// this.initTagComponent();
|
||||
// // 如果显示引导,初始化高亮元素
|
||||
// if (this.showGuidance) {
|
||||
// this.$nextTick(() => {
|
||||
// this.initGuidanceElements();
|
||||
// this.highlightCurrentStep();
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
this.$nextTick(() => {
|
||||
this.initTagComponent();
|
||||
});
|
||||
} else {
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 检查并显示引导
|
||||
checkAndShowGuidance() {
|
||||
// 检查本地存储,判断是否为首次创建
|
||||
// const hasShownGuidance = localStorage.getItem('course_creation_guidance_shown');
|
||||
// if (!hasShownGuidance) {
|
||||
this.showGuidance = true;
|
||||
this.currentStep = 1;
|
||||
this.isFirstCreate = true;
|
||||
// 标记引导已显示
|
||||
localStorage.setItem('course_creation_guidance_shown', 'true');
|
||||
// apiCourse.saveTip();
|
||||
// }
|
||||
},
|
||||
// 初始化引导元素
|
||||
initGuidanceElements() {
|
||||
this.guidanceElements = Array.from(document.querySelectorAll('.guidance-highlight'));
|
||||
},
|
||||
|
||||
// 高亮当前步骤对应的元素
|
||||
highlightCurrentStep() {
|
||||
if (this.guidanceElements.length === 0) return;
|
||||
|
||||
const currentElement = this.guidanceElements[this.currentStep - 1];
|
||||
if (currentElement) {
|
||||
currentElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
},
|
||||
// 下一步
|
||||
nextStep() {
|
||||
if (this.currentStep < 2) {
|
||||
this.currentStep++;
|
||||
this.highlightCurrentStep();
|
||||
} else {
|
||||
this.closeGuidance();
|
||||
}
|
||||
},
|
||||
|
||||
// 上一步
|
||||
previousStep1() {
|
||||
if (this.currentStep > 1) {
|
||||
this.currentStep--;
|
||||
this.highlightCurrentStep();
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭引导
|
||||
closeGuidance() {
|
||||
this.showGuidance = false;
|
||||
this.currentStep = 1;
|
||||
this.highlightStyle = {};
|
||||
},
|
||||
// 内容分类获得焦点时的处理
|
||||
onContentTypeFocus() {
|
||||
if (this.showGuidance && this.currentStep === 1) {
|
||||
this.currentStep = 2;
|
||||
this.highlightCurrentStep();
|
||||
}
|
||||
},
|
||||
|
||||
// 内容分类改变时的处理
|
||||
onContentTypeChange() {
|
||||
if (this.showGuidance && this.currentStep === 1) {
|
||||
this.currentStep = 2;
|
||||
this.highlightCurrentStep();
|
||||
}
|
||||
},
|
||||
|
||||
// 标签获得焦点时的处理
|
||||
onTagFocus() {
|
||||
if (this.showGuidance && this.currentStep === 2) {
|
||||
this.closeGuidance();
|
||||
}
|
||||
},
|
||||
|
||||
// 新增初始化标签方法
|
||||
initTagComponent() {
|
||||
if (this.$refs.courseTag) {
|
||||
@@ -1969,126 +1816,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 蒙层样式 */
|
||||
.guidance-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.guidance-content {
|
||||
position: fixed;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 24px;
|
||||
max-width: 500px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
||||
z-index: 10000;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.guidance-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.guidance-steps {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.guidance-step {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 16px;
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.guidance-step.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.step-number {
|
||||
//width: 24px;
|
||||
height: 24px;
|
||||
//background: #409EFF;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.step-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.step-title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.step-desc {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.guidance-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* 高亮元素样式 */
|
||||
.highlight-element {
|
||||
position: fixed;
|
||||
border: 2px solid #409EFF;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 15px rgba(64, 158, 255, 0.5);
|
||||
z-index: 9998;
|
||||
pointer-events: none;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 被高亮元素的样式 */
|
||||
.guidance-highlight {
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
//.el-form-item__content {
|
||||
// display: flex;
|
||||
// width: 80%;
|
||||
// .tag-container {
|
||||
// width: 95%;
|
||||
// }
|
||||
//}
|
||||
.tag-from-item .el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
display: flex;
|
||||
//align-items: center;
|
||||
.tag-container {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
.guidance-highlight .el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
display: flex;
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
|
||||
<template>
|
||||
<div class="tag-container" @click="handleContainerClick">
|
||||
<div class="tag-container">
|
||||
<el-select style="width: 100%;"
|
||||
v-model="selectedTags"
|
||||
multiple
|
||||
filterable
|
||||
value-key="id"
|
||||
remote
|
||||
reserve-keyword
|
||||
:remote-method="debouncedSearch"
|
||||
:loading="loading"
|
||||
:placeholder="'回车创建新标签'"
|
||||
:no-data-text="'无此标签,按回车键创建'"
|
||||
@remove-tag="handleTagRemove"
|
||||
@change="handleSelectionChange"
|
||||
@keyup.enter.native="handleEnterKey"
|
||||
@keyup.delete.native="handleDeleteKey"
|
||||
@focus="handleFocus"
|
||||
ref="tagSelect"
|
||||
v-model="selectedTags"
|
||||
multiple
|
||||
filterable
|
||||
value-key="id"
|
||||
remote
|
||||
reserve-keyword
|
||||
:remote-method="debouncedSearch"
|
||||
:loading="loading"
|
||||
:placeholder="'回车创建新标签'"
|
||||
@remove-tag="handleTagRemove"
|
||||
@change="handleSelectionChange"
|
||||
@keyup.enter.native="handleEnterKey"
|
||||
@keyup.delete.native="handleDeleteKey"
|
||||
@focus="handleFocus"
|
||||
ref="tagSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in searchResults"
|
||||
@@ -141,11 +141,6 @@ export default {
|
||||
if (this.sysTypeList.length > 0) {
|
||||
await this.doSearch('');
|
||||
}
|
||||
this.$emit('focus');
|
||||
},
|
||||
handleContainerClick() {
|
||||
// 容器点击时也触发焦点事件
|
||||
this.$emit('focus');
|
||||
},
|
||||
// 新增:重置标签状态的方法
|
||||
resetTagState() {
|
||||
@@ -217,9 +212,6 @@ export default {
|
||||
this.$emit('change', this.displayTags);
|
||||
|
||||
this.clearInput();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tagSelect.visible = false;
|
||||
});
|
||||
},
|
||||
|
||||
clearInput() {
|
||||
@@ -321,7 +313,7 @@ export default {
|
||||
this.searchResults = tags
|
||||
// 当搜索结果为空时,提示用户可以按回车键创建标签
|
||||
if (tags.length === 0) {
|
||||
// this.$message.info('无此标签,按回车键创建')
|
||||
this.$message.info('无此标签,按回车键创建')
|
||||
}
|
||||
} finally {
|
||||
this.loading = false
|
||||
@@ -367,9 +359,8 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
/*
|
||||
|
||||
::v-deep(.el-tag) {
|
||||
flex: 0 0 calc(50% - 8px);
|
||||
max-width: calc(50% - 8px);
|
||||
box-sizing: border-box;
|
||||
margin-right: 8px;
|
||||
@@ -377,20 +368,6 @@ export default {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}*/
|
||||
|
||||
::v-deep(.el-tag) {
|
||||
flex: 1 1 auto; /* 自动调整宽度 */
|
||||
min-width: 30%; /* 设置最小宽度 */
|
||||
max-width: 48%; /* 设置最大宽度,留出边距 */
|
||||
box-sizing: border-box;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep(.el-select__input) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
109
src/security.js
109
src/security.js
@@ -11,16 +11,16 @@ import xpage from '@/utils/xpage'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login', '/logout', '/loading', '/pc/loading', '/500', '/auth-redirect', '/forget', '/reset/password']
|
||||
const whiteList = ['/login','/logout','/loading','/pc/loading','/500','/auth-redirect','/forget','/reset/password']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
watermark.set("");
|
||||
//动态计算文件的路径
|
||||
let configPath = process.env.VUE_APP_FILE_RELATIVE_PATH;
|
||||
if (configPath.startsWith('http')) {
|
||||
xpage.constants.fileBaseUrl = configPath;
|
||||
} else {
|
||||
xpage.constants.fileBaseUrl = window.location.protocol + '//' + window.location.host + configPath;
|
||||
let configPath=process.env.VUE_APP_FILE_RELATIVE_PATH;
|
||||
if(configPath.startsWith('http')){
|
||||
xpage.constants.fileBaseUrl=configPath;
|
||||
}else{
|
||||
xpage.constants.fileBaseUrl=window.location.protocol+'//'+window.location.host+configPath;
|
||||
}
|
||||
|
||||
NProgress.start();
|
||||
@@ -28,71 +28,66 @@ router.beforeEach((to, from, next) => {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next()
|
||||
} else {
|
||||
if (getToken()) {
|
||||
if (to.path === '/login') {
|
||||
}else{
|
||||
if(getToken()){
|
||||
if(to.path === '/login'){
|
||||
// 如果是外部用户,把配置的路由跳转到个人中心
|
||||
if (store.getters.userInfo.role === 2) {
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH + '/uc/study/courses' })
|
||||
} else {
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH + '/index' })
|
||||
if(store.getters.userInfo.role === 2){
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH+'/uc/study/courses' })
|
||||
}else{
|
||||
next({ path: process.env.VUE_APP_PUBLIC_PATH+'/index' })
|
||||
}
|
||||
NProgress.done();
|
||||
} else {
|
||||
//console.log('store.getters.userInfo:',store.getters.userInfo.role)
|
||||
// 如果是外部用户,把配置的路由跳转到个人中心
|
||||
if (store.getters.userInfo.role === 2) {
|
||||
if (to.path === '/index' || to.path === '/course' || to.path === '/case' || to.path === '/article') location.href = '/pc/uc/study/task'
|
||||
if(store.getters.userInfo.role === 2){
|
||||
if(to.path === '/index' || to.path === '/course' || to.path === '/case' || to.path === '/article' ) location.href = '/pc/uc/study/task'
|
||||
}
|
||||
//后续这里需要增加一定的控制
|
||||
if (!store.getters.init) {
|
||||
sessionStorage.removeItem(xpage.constants.localCaseFiltersKey);
|
||||
sessionStorage.removeItem(xpage.constants.localCourseFiltersKey);
|
||||
// 判断当前控制台是否已拉取完数据
|
||||
store.dispatch('InitData').then(res => {
|
||||
//加载白名单信息
|
||||
//testUser.init();
|
||||
//加载信息资源归属,系统分类信息
|
||||
store.dispatch('resOwner/loadResOwners');
|
||||
store.dispatch('sysType/loadSysTypes');
|
||||
if (!store.getters.init) {
|
||||
sessionStorage.removeItem(xpage.constants.localCaseFiltersKey);
|
||||
sessionStorage.removeItem(xpage.constants.localCourseFiltersKey);
|
||||
// 判断当前控制台是否已拉取完数据
|
||||
store.dispatch('InitData').then(res => {
|
||||
//加载白名单信息
|
||||
//testUser.init();
|
||||
//加载信息资源归属,系统分类信息
|
||||
store.dispatch('resOwner/loadResOwners');
|
||||
store.dispatch('sysType/loadSysTypes');
|
||||
|
||||
store.commit('app/SET_INITDATA', true);
|
||||
//routers数据先使用固定的,以后在初始化接口中返回
|
||||
let myRouters = routers();
|
||||
store.dispatch('GenerateRoutes', { routers: myRouters }).then(accessRoutes => {
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
});
|
||||
store.commit('app/SET_INITDATA',true);
|
||||
//routers数据先使用固定的,以后在初始化接口中返回
|
||||
let myRouters=routers();
|
||||
store.dispatch('GenerateRoutes',{routers:myRouters}).then(accessRoutes=>{
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
});
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
store.commit('app/SET_INITDATA', false);
|
||||
//如果初始化错误,就不再执行了,不然会一直循环下去
|
||||
next({ path: '/500' })
|
||||
//NProgress.done();
|
||||
})
|
||||
} else {
|
||||
to.meta.keepAlive = true
|
||||
next();
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
store.commit('app/SET_INITDATA',false);
|
||||
//如果初始化错误,就不再执行了,不然会一直循环下去
|
||||
next({ path: '/500' })
|
||||
//NProgress.done();
|
||||
})
|
||||
} else {
|
||||
to.meta.keepAlive = true
|
||||
next();
|
||||
}
|
||||
|
||||
}
|
||||
//next();
|
||||
} else {
|
||||
}else{
|
||||
|
||||
//next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
//设置之前的路径
|
||||
//store.commit('portal/SetBackUrl',location.href);
|
||||
//console.log(location.href,'location.href');
|
||||
//let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
//let backUrl=location.href.substring(urlPre.length); encodeURIComponent()
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = process.env.VUE_APP_LOGIN_URL + "?returnUrl=" + encodeURIComponent(location.href);
|
||||
} else {
|
||||
window.location.href = process.env.VUE_APP_LOGIN_URL + "?returnUrl=" + encodeURIComponent(location.href);
|
||||
}
|
||||
// location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+encodeURIComponent(location.href);
|
||||
NProgress.done()
|
||||
//next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
//设置之前的路径
|
||||
//store.commit('portal/SetBackUrl',location.href);
|
||||
//console.log(location.href,'location.href');
|
||||
//let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
//let backUrl=location.href.substring(urlPre.length); encodeURIComponent()
|
||||
location.href=process.env.VUE_APP_LOGIN_URL+"?returnUrl="+encodeURIComponent(location.href);
|
||||
NProgress.done()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,255 +19,215 @@ import errorCode from '@/utils/errorCode'
|
||||
|
||||
//const ReLoginUrl="/login";
|
||||
|
||||
const ReLoginUrl = process.env.VUE_APP_LOGIN_URL;
|
||||
const ReLoginUrl=process.env.VUE_APP_LOGIN_URL;
|
||||
|
||||
const TokenName = 'XBOE-Access-Token';
|
||||
const TokenName='XBOE-Access-Token';
|
||||
/**axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded'**/
|
||||
//只是用于发送json对象数据时使用post,put,patch
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
timeout: 60000,
|
||||
const jsonRequest=axios.create({
|
||||
headers:{'Content-Type':'application/json;charset=utf-8'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
timeout: 60000,
|
||||
});
|
||||
//发送json对象的拦截器
|
||||
jsonRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
}else if(code===302){
|
||||
location.href = ReLoginUrl;
|
||||
}else{
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err:' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
timeout: 10000,
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code===403){
|
||||
var msg='当前操作没有权限';
|
||||
Message({message: msg, type: 'error'});
|
||||
return Promise.reject(new Error(msg))
|
||||
}else if(code===302){
|
||||
location.href = ReLoginUrl;
|
||||
}else{
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
//return Promise.reject(new Error(res.data.message))
|
||||
return res.data;//返回给用户做业务处理
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
//location.href = this.webBaseUrl + ReLoginUrl;
|
||||
}
|
||||
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 = function (cfg) {
|
||||
if (cfg.data) {
|
||||
cfg.data = qs.stringify(cfg.data);
|
||||
const request=function(cfg){
|
||||
if(cfg.data){
|
||||
cfg.data=qs.stringify(cfg.data);
|
||||
}
|
||||
};
|
||||
//requestJson请求
|
||||
const requestJson = jsonRequest.request;
|
||||
const requestJson=jsonRequest.request;
|
||||
//get请求
|
||||
const get = formRequest.request;
|
||||
const get=formRequest.request;
|
||||
//post请求
|
||||
const post = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const post=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.post(url, data, config);
|
||||
return formRequest.post(url,data,config);
|
||||
}
|
||||
//post请求
|
||||
const postForm = function (url, data, config) {
|
||||
return formRequest.post(url, data, config);
|
||||
const postForm=function(url,data,config){
|
||||
return formRequest.post(url,data,config);
|
||||
}
|
||||
//postJson请求
|
||||
const postJson = jsonRequest.post;
|
||||
const postJson=jsonRequest.post;
|
||||
//put请求
|
||||
const put = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const put=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.put(url, data, config);
|
||||
return formRequest.put(url,data,config);
|
||||
}
|
||||
//putJson请求
|
||||
const putJson = jsonRequest.put;
|
||||
const putJson=jsonRequest.put;
|
||||
//patch请求
|
||||
const patch = function (url, data, config) {
|
||||
if (data) {
|
||||
data = qs.stringify(data);
|
||||
const patch=function(url,data,config){
|
||||
if(data){
|
||||
data=qs.stringify(data);
|
||||
}
|
||||
return formRequest.patch(url, data, config);
|
||||
return formRequest.patch(url,data,config);
|
||||
}
|
||||
//patchJson请求
|
||||
const patchJson = jsonRequest.patch;
|
||||
const patchJson=jsonRequest.patch;
|
||||
//delete请求
|
||||
const del = formRequest.delete;
|
||||
const del=formRequest.delete;
|
||||
|
||||
|
||||
export default {
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del,
|
||||
postForm
|
||||
request,
|
||||
requestJson,
|
||||
get,
|
||||
post,
|
||||
postJson,
|
||||
put,
|
||||
putJson,
|
||||
patch,
|
||||
patchJson,
|
||||
del,
|
||||
postForm
|
||||
}
|
||||
|
||||
@@ -153,29 +153,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="xindex-content">
|
||||
|
||||
|
||||
<!-- 推荐课程 -->
|
||||
<div class="modules xcontent2">
|
||||
<!-- <div class="xcontent2-main"> -->
|
||||
<!--内容块-->
|
||||
|
||||
|
||||
<!-- </div> -->
|
||||
<!-- 精品课模块 -->
|
||||
<div class="xcontent2-main">
|
||||
<div class="modules-title xindex-main" v-if="this.qusisityList.list.length > 0">
|
||||
<!-- <span class="jin-text">精品课</span> -->
|
||||
<div class="jin-zhe"></div>
|
||||
<!-- <span class="modules-text" style="color: #3D86F4;">精品课</span> -->
|
||||
<span class="quyer-tag" style="margin-left: 0px;">
|
||||
<!-- <img src="../assets/images/tutoring1.pn" alt=""> -->
|
||||
<img class="modules-text" style="height: 28px;" src="../assets/images/course/courseTitle.png" alt="">
|
||||
</span>
|
||||
|
||||
<span class="more">
|
||||
<router-link to="/qualityCourse">查看更多>></router-link>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div
|
||||
v-for="(course, eIndex) in exquisiteList"
|
||||
:key="'cc' + eIndex"
|
||||
@@ -232,7 +231,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--内容块-->
|
||||
<div class="modules-title xindex-main">
|
||||
<span class="modules-text">推荐课程</span>
|
||||
@@ -1309,7 +1308,7 @@ export default {
|
||||
return this.courseList.list.slice(3)
|
||||
},
|
||||
// 精品课展示
|
||||
exquisiteList() {
|
||||
exquisiteList() {
|
||||
return this.qusisityList.list.slice(0,3)
|
||||
},
|
||||
},
|
||||
@@ -1568,7 +1567,7 @@ export default {
|
||||
let course = {
|
||||
aid: this.userInfo.aid,
|
||||
}
|
||||
apiIndex.qualitylist(course).then((res) => {
|
||||
apiIndex.qualitylist(course).then((res) => {
|
||||
let courseIds = [];
|
||||
res.data.result.forEach((item) => {
|
||||
item.authorInfo = {
|
||||
@@ -2827,15 +2826,6 @@ export default {
|
||||
display: flex;
|
||||
|
||||
.modules-title {
|
||||
position: relative;
|
||||
.jin-zhe{
|
||||
width: 410px;
|
||||
height: 30px;
|
||||
background: #f7f7f9;
|
||||
position: absolute;
|
||||
left: 86px;
|
||||
|
||||
}
|
||||
.modules-text {
|
||||
height: 28px;
|
||||
font-size: 20px;
|
||||
@@ -3146,13 +3136,4 @@ export default {
|
||||
border: 1px solid #d9edf7;
|
||||
//overflow: hidden;
|
||||
}
|
||||
.jin-text{
|
||||
font-family: "Source Han Sans CN", "SourceHanSansCN", sans-serif !important;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
color: #3E87F5;
|
||||
// line-height: 29px;/
|
||||
text-align: justify;
|
||||
font-style: normal;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,61 +5,56 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from "vue-cookies";
|
||||
import apiLogin from "@/api/login.js";
|
||||
import { getToken, setToken } from "@/utils/token";
|
||||
export default {
|
||||
mounted() {
|
||||
this.toUrl = this.$route.query.returnUrl;
|
||||
let token = getToken();
|
||||
let $this = this;
|
||||
if (!token) {
|
||||
//console.log(token,'未获取token');
|
||||
setTimeout(function () {
|
||||
$this.curToken = getToken();
|
||||
if (!$this.curToken) {
|
||||
//console.log(token,'第二次未获取token');
|
||||
if (top !== window) {
|
||||
// 判断当前是否在iframe内
|
||||
top.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
window.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
import Cookies from 'vue-cookies'
|
||||
import apiLogin from '@/api/login.js'
|
||||
import { getToken,setToken } from '@/utils/token'
|
||||
export default{
|
||||
mounted(){
|
||||
this.toUrl=this.$route.query.returnUrl;
|
||||
let token=getToken();
|
||||
let $this=this;
|
||||
if(!token){
|
||||
//console.log(token,'未获取token');
|
||||
setTimeout(function(){
|
||||
$this.curToken=getToken();
|
||||
if(!$this.curToken){
|
||||
//console.log(token,'第二次未获取token');
|
||||
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
}else{
|
||||
$this.boeLogin();
|
||||
}
|
||||
// location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
$this.boeLogin();
|
||||
}
|
||||
}, 500);
|
||||
} else {
|
||||
this.curToken = token;
|
||||
this.boeLogin();
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curToken: "",
|
||||
toUrl: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
boeLogin() {
|
||||
apiLogin.boeLogin(this.curToken).then((rs) => {
|
||||
if (rs.status == 200) {
|
||||
//setToken(rs.result.access_token);
|
||||
localStorage.setItem(this.$xpage.constants.newLoginKey, 1);
|
||||
if (this.toUrl) {
|
||||
location.href = this.toUrl;
|
||||
} else {
|
||||
this.$router.push({ path: "/index" });
|
||||
}
|
||||
//this.$router.push({ path: "/index" })
|
||||
} else {
|
||||
this.$message.error("登录失败:" + rs.message);
|
||||
}
|
||||
});
|
||||
|
||||
},500);
|
||||
}else{
|
||||
this.curToken=token;
|
||||
this.boeLogin();
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
data(){
|
||||
return {
|
||||
curToken:'',
|
||||
toUrl:''
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
boeLogin(){
|
||||
apiLogin.boeLogin(this.curToken).then(rs=>{
|
||||
if(rs.status==200){
|
||||
//setToken(rs.result.access_token);
|
||||
localStorage.setItem(this.$xpage.constants.newLoginKey,1);
|
||||
if(this.toUrl){
|
||||
location.href=this.toUrl;
|
||||
}else{
|
||||
this.$router.push({ path: "/index" })
|
||||
}
|
||||
//this.$router.push({ path: "/index" })
|
||||
}else{
|
||||
this.$message.error("登录失败:"+rs.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -123,6 +123,16 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="sysCreateBy"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="sysCreateTime" width="230px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="审核人" prop="auditUser" width="130px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.auditUser || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核时间" prop="auditTime" width="230px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.auditTime || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否停用" width="130px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.enabled == true ? '启用' : '停用' }}
|
||||
|
||||
@@ -2,15 +2,18 @@
|
||||
<div>
|
||||
<!-- 最大化状态的弹窗 -->
|
||||
<el-dialog
|
||||
v-if="dialogVisible && windowState === 'maximized'"
|
||||
v-if="dialogVisible"
|
||||
:visible="true"
|
||||
width="800px"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="true"
|
||||
@close="onClose"
|
||||
class="case-expert-dialog"
|
||||
:modal="false"
|
||||
:append-to-body="true"
|
||||
:fullscreen="false"
|
||||
top="0"
|
||||
top="10vh"
|
||||
v-show="windowState === 'maximized'"
|
||||
v-resizeable
|
||||
v-draggable
|
||||
>
|
||||
@@ -33,7 +36,6 @@
|
||||
class="welcome-message"
|
||||
ref="messageContainer"
|
||||
@scroll="handleScroll"
|
||||
@wheel="handleWheel"
|
||||
>
|
||||
<div class="message-text" v-for="(item, index) in messageList" :key="index">
|
||||
<messages :messageData="item" :suggestions="suggestions" @getMinWindow="minimizeWindow"></messages>
|
||||
@@ -134,18 +136,10 @@ export default {
|
||||
const headerEl = dialogEl.querySelector('.dialog-title');
|
||||
if (!headerEl) return;
|
||||
|
||||
// 检查是否有保存的位置状态
|
||||
const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
if (savedPosition) {
|
||||
const { left, top } = JSON.parse(savedPosition);
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
} else {
|
||||
// 设置初始样式
|
||||
dialogEl.style.position = 'fixed';
|
||||
dialogEl.style.top = '100px';
|
||||
dialogEl.style.left = (window.innerWidth - dialogEl.offsetWidth) / 2 + 'px';
|
||||
}
|
||||
// 设置初始样式
|
||||
dialogEl.style.position = 'fixed';
|
||||
dialogEl.style.top = '100px';
|
||||
dialogEl.style.left = (window.innerWidth - dialogEl.offsetWidth) / 2 + 'px';
|
||||
dialogEl.style.margin = '0';
|
||||
|
||||
let isDragging = false;
|
||||
@@ -182,18 +176,15 @@ export default {
|
||||
|
||||
dialogEl.style.left = (startLeft + deltaX) + 'px';
|
||||
dialogEl.style.top = (startTop + deltaY) + 'px';
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
const stopDrag = () => {
|
||||
isDragging = false;
|
||||
|
||||
// 保存当前位置到 sessionStorage
|
||||
const currentPosition = {
|
||||
left: parseInt(dialogEl.style.left),
|
||||
top: parseInt(dialogEl.style.top)
|
||||
};
|
||||
// sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
|
||||
|
||||
// 移除全局事件监听
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
document.removeEventListener('mouseup', stopDrag);
|
||||
@@ -212,20 +203,10 @@ export default {
|
||||
const dialogEl = el.querySelector('.el-dialog');
|
||||
if (!dialogEl) return;
|
||||
|
||||
// 检查是否有保存的尺寸状态
|
||||
const savedSize = sessionStorage.getItem('aiCallDialogSize');
|
||||
if (savedSize) {
|
||||
const { width, height, left, top } = JSON.parse(savedSize);
|
||||
dialogEl.style.width = width + 'px';
|
||||
dialogEl.style.height = height + 'px';
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
} else {
|
||||
// 设置初始样式
|
||||
dialogEl.style.position = 'fixed';
|
||||
dialogEl.style.top = '100px';
|
||||
dialogEl.style.left = (window.innerWidth - dialogEl.offsetWidth) / 2 + 'px';
|
||||
}
|
||||
// 设置初始样式
|
||||
dialogEl.style.position = 'fixed';
|
||||
dialogEl.style.top = '100px';
|
||||
dialogEl.style.left = (window.innerWidth - dialogEl.offsetWidth) / 2 + 'px';
|
||||
|
||||
// 创建拖拽手柄
|
||||
const createHandle = (direction) => {
|
||||
@@ -354,93 +335,65 @@ export default {
|
||||
const deltaX = event.clientX - startX;
|
||||
const deltaY = event.clientY - startY;
|
||||
|
||||
let newWidth, newHeight, newLeft, newTop;
|
||||
|
||||
switch (resizeDirection) {
|
||||
case 'right':
|
||||
newWidth = Math.max(400, startWidth + deltaX);
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.width = Math.max(400, startWidth + deltaX) + 'px';
|
||||
break;
|
||||
case 'left':
|
||||
newWidth = Math.max(400, startWidth - deltaX);
|
||||
newLeft = startLeft + startWidth - newWidth;
|
||||
const newWidth = Math.max(400, startWidth - deltaX);
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.left = newLeft + 'px';
|
||||
dialogEl.style.left = (startLeft + startWidth - newWidth) + 'px';
|
||||
break;
|
||||
case 'bottom':
|
||||
newHeight = Math.max(600, startHeight + deltaY);
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
dialogEl.style.height = Math.max(600, startHeight + deltaY) + 'px';
|
||||
break;
|
||||
case 'top':
|
||||
// 当窗口高度达到最小值时,不再调整高度和位置
|
||||
if (startHeight - deltaY >= 600) {
|
||||
newHeight = startHeight - deltaY;
|
||||
newTop = startTop + deltaY;
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
dialogEl.style.top = newTop + 'px';
|
||||
dialogEl.style.height = (startHeight - deltaY) + 'px';
|
||||
dialogEl.style.top = (startTop + deltaY) + 'px';
|
||||
}
|
||||
break;
|
||||
case 'bottom-right':
|
||||
newWidth = Math.max(400, startWidth + deltaX);
|
||||
newHeight = Math.max(600, startHeight + deltaY);
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
dialogEl.style.width = Math.max(400, startWidth + deltaX) + 'px';
|
||||
dialogEl.style.height = Math.max(600, startHeight + deltaY) + 'px';
|
||||
break;
|
||||
case 'bottom-left':
|
||||
newWidth = Math.max(400, startWidth - deltaX);
|
||||
newHeight = Math.max(600, startHeight + deltaY);
|
||||
newLeft = startLeft + startWidth - newWidth;
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.left = newLeft + 'px';
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
const newWidthBL = Math.max(400, startWidth - deltaX);
|
||||
dialogEl.style.width = newWidthBL + 'px';
|
||||
dialogEl.style.left = (startLeft + startWidth - newWidthBL) + 'px';
|
||||
dialogEl.style.height = Math.max(600, startHeight + deltaY) + 'px';
|
||||
break;
|
||||
case 'top-right':
|
||||
// 当窗口高度达到最小值时,不再调整高度和位置
|
||||
if (startHeight - deltaY >= 600) {
|
||||
newHeight = startHeight - deltaY;
|
||||
newTop = startTop + deltaY;
|
||||
newWidth = Math.max(400, startWidth + deltaX);
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
dialogEl.style.top = newTop + 'px';
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.height = (startHeight - deltaY) + 'px';
|
||||
dialogEl.style.top = (startTop + deltaY) + 'px';
|
||||
}
|
||||
dialogEl.style.width = Math.max(400, startWidth + deltaX) + 'px';
|
||||
break;
|
||||
case 'top-left':
|
||||
// 当窗口高度达到最小值时,不再调整高度和位置
|
||||
if (startHeight - deltaY >= 600) {
|
||||
newHeight = startHeight - deltaY;
|
||||
newTop = startTop + deltaY;
|
||||
newWidth = Math.max(400, startWidth - deltaX);
|
||||
newLeft = startLeft + startWidth - newWidth;
|
||||
dialogEl.style.height = newHeight + 'px';
|
||||
dialogEl.style.top = newTop + 'px';
|
||||
dialogEl.style.width = newWidth + 'px';
|
||||
dialogEl.style.left = newLeft + 'px';
|
||||
dialogEl.style.height = (startHeight - deltaY) + 'px';
|
||||
dialogEl.style.top = (startTop + deltaY) + 'px';
|
||||
}
|
||||
const newWidthTL = Math.max(400, startWidth - deltaX);
|
||||
dialogEl.style.width = newWidthTL + 'px';
|
||||
dialogEl.style.left = (startLeft + startWidth - newWidthTL) + 'px';
|
||||
break;
|
||||
}
|
||||
|
||||
let doc = document.querySelector('.welcome-message')
|
||||
let sendBox = document.querySelector('.input-area-wrapper');
|
||||
// sendBox 的高度
|
||||
if (doc && sendBox) {
|
||||
doc.style.height = `calc(${dialogEl.style.height} - ${sendBox.offsetHeight}px - 120px)`;
|
||||
}
|
||||
doc.style.height = `calc(${dialogEl.style.height} - ${sendBox.offsetHeight}px - 120px)`;
|
||||
};
|
||||
|
||||
const stopResize = () => {
|
||||
isResizing = false;
|
||||
resizeDirection = '';
|
||||
|
||||
// 保存当前尺寸和位置到 sessionStorage
|
||||
const currentSize = {
|
||||
width: parseInt(dialogEl.style.width),
|
||||
height: parseInt(dialogEl.style.height),
|
||||
left: parseInt(dialogEl.style.left),
|
||||
top: parseInt(dialogEl.style.top)
|
||||
};
|
||||
sessionStorage.setItem('aiCallDialogSize', JSON.stringify(currentSize));
|
||||
|
||||
// 移除全局事件监听
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
document.removeEventListener('mouseup', stopResize);
|
||||
@@ -483,72 +436,26 @@ export default {
|
||||
}
|
||||
],
|
||||
suggestions:[],
|
||||
isAutoScroll: true, // 是否自动滚动
|
||||
// 添加一个标志位,用于标识组件是否已经初始化完成
|
||||
isComponentReady: false
|
||||
isAutoScroll: true // 是否自动滚动
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 组件挂载完成后,标记为已准备就绪
|
||||
this.$nextTick(() => {
|
||||
this.isComponentReady = true;
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
dialogVisible: {
|
||||
handler(newVal) {
|
||||
console.log('dialogVisible发生变化');
|
||||
console.log(newVal);
|
||||
console.log(this.windowState);
|
||||
if (newVal) {
|
||||
this.$nextTick(() => {
|
||||
// 获取对话框元素
|
||||
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
|
||||
if (dialogEl) {
|
||||
// 检查是否有保存的尺寸状态
|
||||
const savedSize = sessionStorage.getItem('aiCallDialogSize');
|
||||
if (savedSize) {
|
||||
const { width, height, left, top } = JSON.parse(savedSize);
|
||||
dialogEl.style.width = width + 'px';
|
||||
dialogEl.style.height = height + 'px';
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
}
|
||||
dialogVisible(newVal) {
|
||||
if(newVal){
|
||||
this.$nextTick(() => {
|
||||
let doc = document.querySelector('.welcome-message')
|
||||
let sendBox = document.querySelector('.input-area-wrapper');
|
||||
doc.style.height = `calc(600px - ${sendBox.offsetHeight}px - 120px)`;
|
||||
});
|
||||
}
|
||||
|
||||
// 检查是否有保存的位置状态
|
||||
// const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
// if (savedPosition) {
|
||||
// const { left, top } = JSON.parse(savedPosition);
|
||||
// dialogEl.style.left = left + 'px';
|
||||
// dialogEl.style.top = top + 'px';
|
||||
// }
|
||||
}
|
||||
|
||||
let doc = document.querySelector('.welcome-message')
|
||||
let sendBox = document.querySelector('.input-area-wrapper');
|
||||
// 只有在没有保存的尺寸状态时才使用默认值
|
||||
if (doc && sendBox) {
|
||||
const savedSize = sessionStorage.getItem('aiCallDialogSize');
|
||||
if (!savedSize) {
|
||||
doc.style.height = `calc(600px - ${sendBox.offsetHeight}px - 120px)`;
|
||||
} else {
|
||||
const { height } = JSON.parse(savedSize);
|
||||
doc.style.height = `calc(${height}px - ${sendBox.offsetHeight}px - 120px)`;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
// 移除之前的逻辑,因为现在通过事件机制处理状态恢复
|
||||
},
|
||||
messageList: {
|
||||
handler() {
|
||||
// 只有在组件准备就绪后才执行滚动操作
|
||||
if (this.isComponentReady) {
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom();
|
||||
});
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
@@ -566,9 +473,6 @@ closeMinimizedWindow() {
|
||||
},
|
||||
onClose() {
|
||||
console.log('关闭弹窗')
|
||||
// 清除保存的状态
|
||||
sessionStorage.removeItem('aiCallDialogSize');
|
||||
// sessionStorage.removeItem('aiCallDialogPosition');
|
||||
this.$emit('close')
|
||||
// 可以在这里执行其他逻辑
|
||||
},
|
||||
@@ -597,7 +501,6 @@ closeMinimizedWindow() {
|
||||
|
||||
// 处理加载状态
|
||||
handleLoading(status) {
|
||||
console.log('handleLoading---'+status);
|
||||
this.isLoading = status;
|
||||
},
|
||||
|
||||
@@ -619,9 +522,6 @@ closeMinimizedWindow() {
|
||||
},500)
|
||||
},
|
||||
startNewConversation() {
|
||||
// 重置对话时,先标记组件为未准备就绪状态
|
||||
this.isComponentReady = false;
|
||||
|
||||
this.messageList = [
|
||||
{
|
||||
isBot: true,
|
||||
@@ -633,11 +533,6 @@ closeMinimizedWindow() {
|
||||
];
|
||||
this.AIContent = '';
|
||||
this.isLoading = false;
|
||||
|
||||
// 在下一个 tick 中重新标记为准备就绪
|
||||
this.$nextTick(() => {
|
||||
this.isComponentReady = true;
|
||||
});
|
||||
},
|
||||
|
||||
// 处理滚动事件
|
||||
@@ -658,31 +553,6 @@ closeMinimizedWindow() {
|
||||
}
|
||||
},
|
||||
|
||||
// 处理鼠标滚轮事件
|
||||
handleWheel(event) {
|
||||
const element = this.$refs.messageContainer;
|
||||
if (!element) return;
|
||||
|
||||
// 阻止事件冒泡,防止滚动底层页面
|
||||
event.stopPropagation();
|
||||
|
||||
// 计算滚动方向和距离
|
||||
const delta = event.deltaY || event.detail || event.wheelDelta;
|
||||
|
||||
// 检查是否可以继续滚动
|
||||
if (delta < 0 && element.scrollTop === 0) {
|
||||
// 向上滚动且已在顶部,阻止默认行为
|
||||
event.preventDefault();
|
||||
} else if (delta > 0 && element.scrollHeight - element.scrollTop <= element.clientHeight) {
|
||||
// 向下滚动且已在底部,阻止默认行为
|
||||
event.preventDefault();
|
||||
} else {
|
||||
// 允许在容器内滚动
|
||||
element.scrollTop += delta;
|
||||
event.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
// 最小化窗口的点击事件处理方法
|
||||
onMinimizedWindowClick() {
|
||||
// 当点击最小化窗口时,如果dialogVisible为false,则通过事件通知父组件显示对话框
|
||||
@@ -697,9 +567,6 @@ closeMinimizedWindow() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-dialog__wrapper{
|
||||
position: unset!important;
|
||||
}
|
||||
.case-expert-dialog {
|
||||
::v-deep .el-dialog{
|
||||
background: url("./components/u762.svg") no-repeat ;
|
||||
@@ -708,8 +575,6 @@ closeMinimizedWindow() {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
pointer-events: auto;
|
||||
z-index: 2000;
|
||||
|
||||
//background-color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
@@ -776,7 +641,7 @@ closeMinimizedWindow() {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 10px;
|
||||
height: 400px;
|
||||
//height: 200px;
|
||||
//flex:1;
|
||||
overflow-y: auto;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
type="textarea"
|
||||
class="input-placeholder"
|
||||
placeholder="有问题,尽管问"
|
||||
@keyup.enter.native.prevent="handleSend"
|
||||
@keyup.enter.native="handleSend"
|
||||
:disabled="disabled"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
resize="none"
|
||||
@@ -56,14 +56,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSend(event) {
|
||||
// 阻止事件的默认行为和冒泡
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
console.log('preventDefault');
|
||||
}
|
||||
console.log('handleSend');
|
||||
handleSend() {
|
||||
if (!this.inputContent.trim() || this.disabled) return
|
||||
// 添加用户消息到列表
|
||||
const userMessage = {
|
||||
|
||||
@@ -30,13 +30,8 @@
|
||||
<!-- <div class="course-title-right"> -->
|
||||
<!-- <interactBar :readonly="!stuStusts || stuStusts==0" :type="1" :data="courseInfo" :comments="false" :views="false"></interactBar> -->
|
||||
<!-- </div> -->
|
||||
<!-- <div class="label-div">
|
||||
<el-tag class="label-item" effect="plain" v-for="(item,tagIdx) in tagArray" :key="tagIdx">{{item}}</el-tag>
|
||||
</div>-->
|
||||
<div class="label-div">
|
||||
<div v-for="(item, tagIdx) in tagArray" :key="tagIdx" class="keyword-tag">
|
||||
{{ item }}
|
||||
</div>
|
||||
<el-tag class="label-item" effect="plain" v-for="(item,tagIdx) in tagArray" :key="tagIdx">{{item}}</el-tag>
|
||||
</div>
|
||||
<div>
|
||||
<div class="study-count">{{courseInfo.studys}}人学习</div>
|
||||
@@ -425,7 +420,7 @@ export default {
|
||||
|
||||
.course-title{
|
||||
position: relative;
|
||||
height: auto;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
@@ -458,43 +453,18 @@ export default {
|
||||
padding: 24px 24px 5px 24px;
|
||||
// margin-right: 361px;
|
||||
.study-count {
|
||||
margin-top: 30px;
|
||||
margin-top: 10px;
|
||||
font-size: 16px;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
/*.label-div {
|
||||
margin: 5px 0;
|
||||
min-height: 20px;
|
||||
.label-item {
|
||||
padding: 0px 8px;
|
||||
margin-top: 5px;
|
||||
float: left;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
border-radius: 2px;
|
||||
margin-right: 8px;
|
||||
color: #2C68FF;
|
||||
height: 24px;
|
||||
background: rgba(44, 104, 255, 0.06);
|
||||
border: none; // 或者使用 border-color: transparent;
|
||||
}
|
||||
}*/
|
||||
.label-div {
|
||||
margin: 5px 0;
|
||||
min-height: 20px;
|
||||
|
||||
.keyword-tag {
|
||||
padding: 0px 10px;
|
||||
margin-top: 7px;
|
||||
float: left;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
border-radius: 2px;
|
||||
margin-right: 10px;
|
||||
color: #2C68FF;
|
||||
height: 24px;
|
||||
background: rgba(44, 104, 255, 0.06);
|
||||
.label-item {
|
||||
padding: 0 7px;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-rate__icon {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="couser-list-content" class="couser-list-content">
|
||||
<div class="course-banner">
|
||||
<portal-header current="course" textColor="#fff" :keywords="keyword" @emitInput="emitInput"
|
||||
@showClass="showClass"></portal-header>
|
||||
@showClass="showClass"></portal-header>
|
||||
</div>
|
||||
<div style="padding-top:30px">
|
||||
<div class="xcontent2">
|
||||
@@ -11,7 +11,7 @@
|
||||
<span v-if="navTitle.length">></span>
|
||||
<template v-if="navTitle.length">
|
||||
<div class="oneTitle" v-for="(item, index) in navTitle" :key="item.id"
|
||||
@click="handleOptionClick(item, index)">
|
||||
@click="handleOptionClick(item, index)">
|
||||
<span class="titleName"> {{ item.name }} </span>
|
||||
<span v-if="index !== navTitle.length - 1">></span>
|
||||
</div>
|
||||
@@ -35,15 +35,15 @@
|
||||
<div class="course-one" v-for="one in oneList" :key="one.id" @click.stop="handleOptionClick(one, 1, oneList)">
|
||||
<div class="course-one-content">{{ one.name }}</div>
|
||||
<div class="course-two" v-for="(twoList, twoIndex) in one.children" :key="twoList.id"
|
||||
@click.stop="handleOptionClick(twoList, 2, one.children)"
|
||||
:class="{ courseTwoActive: twoList.id == twoId || twoList.checked }" @mouseleave.stop="leaveIndex"
|
||||
@mouseenter.stop="changeIndex(twoList.id)">
|
||||
@click.stop="handleOptionClick(twoList, 2, one.children)"
|
||||
:class="{ courseTwoActive: twoList.id == twoId || twoList.checked }" @mouseleave.stop="leaveIndex"
|
||||
@mouseenter.stop="changeIndex(twoList.id)">
|
||||
<!-- 三级分类 -->
|
||||
<el-popover class="popover" popper-class='coursePopperClass' placement="right-start" width="536"
|
||||
:disabled="!twoList.children.length" :open-delay="0" :close-delay="0" trigger="hover"
|
||||
:visible-arrow="false" @hide="leaveIndex" @show="changeIndex(twoList.id)" transition="none">
|
||||
:disabled="!twoList.children.length" :open-delay="0" :close-delay="0" trigger="hover"
|
||||
:visible-arrow="false" @hide="leaveIndex" @show="changeIndex(twoList.id)" transition="none">
|
||||
<div class="course-two-content" slot="reference">{{
|
||||
twoList.name }}</div>-
|
||||
twoList.name }}</div>-
|
||||
<!-- 内容 -->
|
||||
<div class="course-three-box">
|
||||
<div class="course-three-box-title">
|
||||
@@ -51,8 +51,8 @@
|
||||
</div>
|
||||
<div style="padding: 0 40px;display: flex;flex-wrap: wrap;">
|
||||
<div :class="threeList.checked ? 'threeActive' : ''" v-for="threeList in twoList.children"
|
||||
:key="threeList.id" @click.stop="handleOptionClick(threeList, 3, twoList.children)"
|
||||
class="course-three">
|
||||
:key="threeList.id" @click.stop="handleOptionClick(threeList, 3, twoList.children)"
|
||||
class="course-three">
|
||||
<span>{{ threeList.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,85 +62,300 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="fixd-box">
|
||||
<!-- 好评榜 -->
|
||||
<!-- <div class="portal-ranking-list ranking-bg">
|
||||
<div class="ranking-title">好评榜</div>
|
||||
<ul class="ranking-data">
|
||||
<li class="list-info" v-for="(item, index) in scorelist" :key="index"
|
||||
style="cursor: pointer;margin-top:24px;line-height: 30px;display: flex;">
|
||||
<a style="display: inherit" @click="toCourseDetail(item)">
|
||||
<span class="portal-right-text blue-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/listblue01.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text blue-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/listblue02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text blue-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/listblue03.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 4">
|
||||
<img :src="`${webBaseUrl}/images/list05.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-title-desc title-line-ellipsis" v-if="item.images == ''"
|
||||
style="font-size: 14px;">{{ item.name }}</span>
|
||||
<span class="portal-title-desc" v-else style="font-size: 14px;">
|
||||
<span class="portal-images-title two-line-ellipsis">{{ item.name }}</span>
|
||||
</span>
|
||||
|
||||
<div class="list-active">
|
||||
<div class="list-content">
|
||||
<div class="list-img">
|
||||
<course-image :course="item" :text="false" width="108px" height="60px"></course-image>
|
||||
<span v-if="item.type < 21" class="course-type">录播</span>
|
||||
<span v-if="item.type == 30" class="course-type">线下课</span>
|
||||
<span v-if="item.type == 40" class="course-type">学习项目</span>
|
||||
</div>
|
||||
<div class="list-text">
|
||||
<h6 class="index-one-line-ellipsis">{{ item.name }}</h6>
|
||||
<span class="index-one-line-ellipsis">{{ item.publishTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-bottom">
|
||||
<couresinteract :type="1" :data="item"></couresinteract>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<!-- 人气榜 -->
|
||||
<!-- <div style="margin-top:26px" class="portal-ranking-list ranking-bg1">
|
||||
<div class="ranking-title">人气榜</div>
|
||||
<ul class="ranking-data">
|
||||
<li class="list-info" v-for="(item, index) in ankingList" :key="index"
|
||||
style="cursor: pointer;margin-top:24px;line-height: 30px;display: flex;">
|
||||
<a style="display: inherit" @click="toCourseDetail(item)">
|
||||
<span class="portal-right-text orange-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/list-01.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/list02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/list03.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 4">
|
||||
<img :src="`${webBaseUrl}/images/list05.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-title-desc title-line-ellipsis" v-if="item.images == ''"
|
||||
style="font-size: 14px;">{{ item.name }}</span>
|
||||
<span class="portal-title-desc" v-else style="font-size: 14px;">
|
||||
<span class="portal-images-title two-line-ellipsis">{{ item.name }}</span>
|
||||
</span>
|
||||
|
||||
<div class="list-active">
|
||||
<div class="list-content">
|
||||
<div class="list-img">
|
||||
<course-image :course="item" :text="false" width="108px" height="60px"></course-image>
|
||||
<span v-if="item.type < 21" class="course-type">录播</span>
|
||||
<span v-if="item.type == 30" class="course-type">线下课</span>
|
||||
<span v-if="item.type == 40" class="course-type">学习项目</span>
|
||||
</div>
|
||||
<div class="list-text">
|
||||
<h6 class="index-one-line-ellipsis">{{ item.name }}</h6>
|
||||
<span class="index-one-line-ellipsis">{{ item.publishTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-bottom">
|
||||
<couresinteract :type="1" :data="item"></couresinteract>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<!-- 热榜 -->
|
||||
<!-- <div style="margin-top:26px" class="portal-ranking-list ranking-bg2">
|
||||
<div class="ranking-title">热度榜</div>
|
||||
<ul class="ranking-data">
|
||||
<li class="list-info" v-for="(item, index) in hotList" :key="index"
|
||||
style="cursor: pointer;margin-top:24px;line-height: 30px;display: flex;">
|
||||
<a style="display: inherit" @click="toCourseDetail(item)">
|
||||
<span class="portal-right-text orange-one" v-if="index == 0">
|
||||
<img :src="`${webBaseUrl}/images/listred01 .png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-tow" v-if="index == 1">
|
||||
<img :src="`${webBaseUrl}/images/listred02.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text orange-three" v-if="index == 2">
|
||||
<img :src="`${webBaseUrl}/images/listred03.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 3">
|
||||
<img :src="`${webBaseUrl}/images/list04.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-right-text" v-if="index == 4">
|
||||
<img :src="`${webBaseUrl}/images/list05.png`" alt="">
|
||||
</span>
|
||||
<span class="portal-title-desc title-line-ellipsis list-lidex" v-if="item.images == ''"
|
||||
style="font-size: 14px;">{{ item.courseName }}</span>
|
||||
<span class="portal-title-desc " v-else style="font-size: 14px;">
|
||||
<span class="portal-images-title two-line-ellipsis">{{ item.courseName }}</span>
|
||||
</span>
|
||||
<div class="list-active">
|
||||
<div class="list-content">
|
||||
<div class="list-img">
|
||||
<course-image :course="item" :text="false" width="108px" height="60px"></course-image>
|
||||
<span v-if="item.type < 21" class="course-type">录播</span>
|
||||
<span v-if="item.type == 30" class="course-type">线下课</span>
|
||||
<span v-if="item.type == 40" class="course-type">学习项目</span>
|
||||
</div>
|
||||
<div class="list-text">
|
||||
<h6 class="index-one-line-ellipsis">{{ item.courseName }}</h6>
|
||||
<span class="index-one-line-ellipsis">{{ item.publishTime }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-bottom">
|
||||
<couresinteract :type="1" :data="item"></couresinteract>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧 -->
|
||||
<div class="xcontent2-main content-div">
|
||||
|
||||
<!-- 之前的 -->
|
||||
<!-- <div class="search-div" style="margin-right:36px">
|
||||
<div class="searchbar" style="padding-right: 40px;" v-if="stagList.length > 0">
|
||||
<span @click="handleClearTags" style="float: right;margin-top: 6px;margin-right: -20px;color: #858585;cursor: pointer;" title="清除查询条件"><i class="el-icon-close"></i> 清除</span>
|
||||
<div style="line-height: 30px;">
|
||||
<span class="item-title"> 搜索条件</span>
|
||||
<el-tag closable v-for="(tag, tagIdx) in stagList" :key="'t'+tagIdx" @close="stagClose(tag,tagIdx)">{{ tag.name }}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div style="margin-top:10px; display: flex;">
|
||||
<div style="line-height: 25px;padding-right: 10px;">
|
||||
<span class="item-title" style="padding-right: 5px;">授课方式:</span>
|
||||
</div>
|
||||
<div>
|
||||
<a @click="handleTypeAllClick(1)" class="option-item" :class="{'option-active':ctypeTagAll}">全部</a>
|
||||
<a @click="handleTypeClick(ctypeList[0],ctypeList)" class="option-item" :class="{'option-active':ctypeList[0].checked}">录播课</a>
|
||||
<a @click="handleTypeClick(ctypeList[1],ctypeList)" class="option-item" :class="{'option-active':ctypeList[1].checked}">线下课</a>
|
||||
<a class="option-border"> </a>
|
||||
<a @click="handleTypeClick(ctypeList[2],ctypeList)" class="option-item" :class="{'option-active':ctypeList[2].checked}">学习项目</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div style="line-height: 25px;margin-top:10px; display: flex;">
|
||||
<div class="search-item-type">
|
||||
<span class="item-title" style="padding-right: 5px;">一级分类:</span>
|
||||
</div>
|
||||
<div>
|
||||
<a @click="handleTypeAllClick(11)" class="option-item" :class="{'option-active':oneTagAll}">全部</a>
|
||||
<a v-for="one in oneList" @click="handleOptionClick(one,oneList,1)" class="option-item" :class="{'option-active':one.checked}">{{one.name}}</a>
|
||||
<a class="option-border"> </a>
|
||||
<a class="option-item">
|
||||
<span @click="uClassClick" class="Uxtext" style=""> U选小课堂
|
||||
<span class="uxicon">
|
||||
<svg-icon icon-class="hot" style="font-size:22px"></svg-icon>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item" v-if="twoList.length>0">
|
||||
<div style="line-height: 25px;margin-top:10px; display: flex;justify-content: flex-start;">
|
||||
<div class="search-item-type">
|
||||
<span class="item-title" style="padding-right: 5px;">二级分类:</span>
|
||||
</div>
|
||||
<div style="white-space: nowrap;">
|
||||
<a @click="handleTypeAllClick(12)" class="option-item" :class="{'option-active':twoTagAll}">全部</a>
|
||||
</div>
|
||||
<div>
|
||||
<a v-for="two in twoList" @click="handleOptionClick(two,twoList,2)" class="option-item" :class="{'option-active':two.checked}">{{two.name}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item" v-if="threeList.length>0">
|
||||
<div style="line-height: 25px;margin-top:10px; display: flex;justify-content: flex-start;">
|
||||
<div class="search-item-type">
|
||||
<span class="item-title" style="padding-right: 5px;">三级分类:</span>
|
||||
</div>
|
||||
<div style="white-space: nowrap;">
|
||||
<a @click="handleTypeAllClick(13)" class="option-item" :class="{'option-active':threeTagAll}">全部</a>
|
||||
</div>
|
||||
<div>
|
||||
<a v-for="three in threeList" :key="three.id" @click="handleOptionClick(three,threeList,3)" class="option-item" :class="{'option-active':three.checked}">{{three.name}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- 内容导航 -->
|
||||
<div class="topNav" v-if="!newData">
|
||||
<div class="search-div nav" style="flex: 1;height: auto;background: #fff;">
|
||||
<div class="nav-primary" style="gap: 15px;display: flex;margin-top: 20px;">
|
||||
<div @click="handleTypeAllClick(1)" class="option-item" style="position: relative;" :class="{ 'option-active': ctypeTagAll }">
|
||||
<a>全部</a>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[0], ctypeList)" class="option-item"
|
||||
:class="{ 'option-active': ctypeList[0].checked }">
|
||||
<a>录播课</a>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[1], ctypeList)" class="option-item"
|
||||
:class="{ 'option-active': ctypeList[1].checked }">
|
||||
<a>线下课</a>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[2], ctypeList)" class="option-item"
|
||||
:class="{ 'option-active': ctypeList[2].checked }">
|
||||
<a>学习项目</a>
|
||||
</div>
|
||||
<a class="option-item">
|
||||
<span @click="uClassClick" class="Uxtext" > U选小课堂
|
||||
<span class="uxicon">
|
||||
<svg-icon icon-class="hot" style="font-size:22px"></svg-icon>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<div class="search-div nav" style="height: 100px;flex: 1;">
|
||||
<div @click="handleTypeAllClick(1)" class="option-item" style="font-weight: bold;position: relative;margin-right: 20px;" :class="{ 'option-active': ctypeTagAll }">
|
||||
<a>全部</a>
|
||||
<span :class="ctypeTagAll ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[0], ctypeList)" class="option-item" style="font-weight: bold"
|
||||
:class="{ 'option-active': ctypeList[0].checked }">
|
||||
<a>录播课</a>
|
||||
<span :class="ctypeList[0].checked ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[1], ctypeList)" class="option-item" style="font-weight: bold"
|
||||
:class="{ 'option-active': ctypeList[1].checked }">
|
||||
<a>线下课</a>
|
||||
<span :class="ctypeList[1].checked ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
<div @click="handleTypeClick(ctypeList[2], ctypeList)" class="option-item" style="font-weight: bold"
|
||||
:class="{ 'option-active': ctypeList[2].checked }">
|
||||
<a>学习项目</a>
|
||||
<span :class="ctypeList[2].checked ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
<a class="option-item">
|
||||
<span @click="uClassClick" class="Uxtext" style="font-weight: bold"> U选小课堂
|
||||
<span class="uxicon">
|
||||
<svg-icon icon-class="hot" style="font-size:22px"></svg-icon>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<!-- 修改热点标签区域 -->
|
||||
<div style="margin:20px 0;flex: 1;">
|
||||
<div style="margin-top:10px;flex: 1;">
|
||||
<!-- <div class="search-item-type" style="padding-top: 2px; float: left;">
|
||||
<span class="item-title" style="padding-right: 5px;">热点标签:</span>
|
||||
</div>-->
|
||||
<!-- 修改热点标签容器,支持换行 -->
|
||||
<div>
|
||||
<div style="display: flex">
|
||||
<div
|
||||
class="option-item" style=" padding-top: 2px;"
|
||||
:class="{ 'option-active': isAllHotTagsSelected }"
|
||||
@click="handleClearHotTags"
|
||||
>
|
||||
<span>全部</span>
|
||||
</div>
|
||||
|
||||
<div class="fieldbox" style="padding-left: 15px;">
|
||||
<div
|
||||
class="option-item" style=" padding-top: 2px;"
|
||||
v-for="tag in hotTagsList"
|
||||
:key="tag.id"
|
||||
@click="handleTagClick(tag, hotTagsList,1)"
|
||||
:class="{ 'option-active': tag.checked }"
|
||||
>
|
||||
<span>{{tag.tagName}} </span>
|
||||
<!-- <span :class="tag.checked ? 'nav-bottbor' : ''"></span>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="hot-tags-wrapper">
|
||||
<div
|
||||
class="option-item" style="font-weight: bold; padding-top: 2px;"
|
||||
:class="{ 'option-active': isAllHotTagsSelected }"
|
||||
@click="handleClearHotTags"
|
||||
>
|
||||
<span>全部</span>
|
||||
<span :class="isAllHotTagsSelected ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="option-item" style="font-weight: bold; padding-top: 2px;"
|
||||
v-for="tag in hotTagsList"
|
||||
:key="tag.id"
|
||||
@click="handleTagClick(tag, hotTagsList,1)"
|
||||
:class="{ 'option-active': tag.checked }"
|
||||
>
|
||||
<span>{{tag.tagName}}</span>
|
||||
<span :class="tag.checked ? 'nav-bottbor' : ''"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div id="fixd-box" class="upload" style="margin-left: 26px;">
|
||||
<div v-if="identity == 2 || identity == 3 || identity == 5">
|
||||
<div class="portal-model-btn pointer" style="margin-bottom: 0px;height: 100px;line-height: 100px;"
|
||||
@click="toNeedCourse">
|
||||
<svg-icon style="margin-right: 10px;font-size: 24px;" icon-class="upCourse"></svg-icon>
|
||||
上传课程
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<!-- <div id="fixd-box" class="upload" style="margin-left: 26px;">
|
||||
<div v-if="identity == 2 || identity == 3 || identity == 5">
|
||||
<div class="portal-model-btn pointer" style="margin-bottom: 0px;height: 100px;line-height: 100px;"
|
||||
@click="toNeedCourse">
|
||||
<svg-icon style="margin-right: 10px;font-size: 24px;" icon-class="upCourse"></svg-icon>
|
||||
上传课程
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<!-- 清除 -->
|
||||
<div v-if="stagList.length > 0 && !newData" class="search-div" style="padding: 0">
|
||||
<div class="searchbar" style="display: flex;justify-content: space-between;">
|
||||
<div v-if="stagList.length > 0 && !newData" class="search-div" style="padding: 0;margin-bottom: 20px;">
|
||||
<div class="searchbar" style="background-color:#f6f7fb;display: flex;justify-content: space-between;">
|
||||
<div style="line-height: 30px;">
|
||||
<span class="item-title"> 搜索条件:</span>
|
||||
<el-tag closable v-for="(tag, tagIdx) in stagList" :key="'t' + tagIdx" @close="stagClose(tag, tagIdx)" >
|
||||
<el-tag closable v-for="(tag, tagIdx) in stagList" :key="'t' + tagIdx" @close="stagClose(tag, tagIdx)"
|
||||
:style="{ color: tag.type === 0 ? '#ff0000' : '' }">
|
||||
{{ tag.tagName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
@@ -155,11 +370,11 @@
|
||||
<div class="order-div" v-if="!newData">
|
||||
<span class="quyer-tag">
|
||||
<el-button type="text" class="order-class" @click="orderChange('studys')"
|
||||
:class="{ actice: course.orderField == 'studys' }">最热</el-button>
|
||||
:class="{ actice: course.orderField == 'studys' }">最热</el-button>
|
||||
<el-button type="text" class="order-class" @click="orderChange('publishTime')"
|
||||
:class="{ actice: course.orderField == 'publishTime' }">最新</el-button>
|
||||
:class="{ actice: course.orderField == 'publishTime' }">最新</el-button>
|
||||
<el-button type="text" class="order-class" @click="orderChange('score')"
|
||||
:class="{ actice: course.orderField == 'score' }">好评率</el-button>
|
||||
:class="{ actice: course.orderField == 'score' }">好评率</el-button>
|
||||
</span>
|
||||
<span class="order-count">
|
||||
共找到<span>{{ count }}</span>个结果
|
||||
@@ -182,17 +397,17 @@
|
||||
v-for="(tag, tagIndex) in cinfo.tagsList"
|
||||
:key="tagIndex"
|
||||
size="mini"
|
||||
type="info"
|
||||
style="margin: 2px 2px; border-radius: 2px;"
|
||||
type="info" style="margin: 2px 2px; border-radius: 2px;"
|
||||
:style="{ color: isTagMatched(tag) ? '#387DF7' : '#333333' }"
|
||||
>
|
||||
<span v-html="highlightTagKeyword(tag)"></span>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<!-- 关键字 -->
|
||||
<div class="keywordInfo-every">
|
||||
<div class="keywordInfo" v-for="(keyword, index) in cinfo.keywordsActive" :key="index">
|
||||
<el-tooltip popper-class="keywordInfo-class" :visible-arrow="false"
|
||||
:disabled="!keyword.showTitle">
|
||||
:disabled="!keyword.showTitle">
|
||||
<template #content>
|
||||
<span v-html="keyword.title"></span>
|
||||
</template>
|
||||
@@ -216,7 +431,7 @@
|
||||
<div class="course-info-score">
|
||||
<div style="display: flex;">
|
||||
<interactBar :type="1" nodeWidth="20px" :data="cinfo" :courseExclusive="true" :comments="false"
|
||||
:praises="false" :shares="false" :views="false"></interactBar>
|
||||
:praises="false" :shares="false" :views="false"></interactBar>
|
||||
<div v-if="cinfo.score">
|
||||
<span class="course-score-value">{{ toScore(cinfo.score) }}分</span>
|
||||
</div>
|
||||
@@ -251,13 +466,17 @@
|
||||
</template>
|
||||
<!-- 暂无数据 -->
|
||||
<div class="pagination-div">
|
||||
<!-- <span class="pag-text" @click="loadMore()"
|
||||
v-if="moreState == 1 && courseList.length >= course.pageSize">加载更多</span> -->
|
||||
<!-- <span class="pag-text-msg" v-if="moreState == 2">数据加载中</span> -->
|
||||
<!-- <span class="pag-text-msg" v-else-if="moreState == 3 && courseList.length > 0">没有更多数据了</span> -->
|
||||
<span class="notcoures" v-if="moreState == 3 && courseList.length == 0">
|
||||
<img :src="`${webBaseUrl}/images/nocouresimg.png`" alt="">
|
||||
<h5>暂无课程,请优先学习其它课程吧~</h5>
|
||||
</span>
|
||||
<div v-if="courseList.length > 0">
|
||||
<pagination :size="course.pageSize" :total="count" :page="course.pageIndex"
|
||||
layout="total, prev, pager, next, jumper" @change-page="currentChange"></pagination>
|
||||
layout="total, prev, pager, next, jumper" @change-page="currentChange"></pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -521,8 +740,7 @@ export default {
|
||||
searchRecords: [],
|
||||
hotList: [],
|
||||
totalPages: 1,
|
||||
localSessionKey: this.$xpage.constants.localCourseFiltersKey,
|
||||
// isAllHotTagsSelected: true,
|
||||
localSessionKey: this.$xpage.constants.localCourseFiltersKey
|
||||
};
|
||||
},
|
||||
// 受众需要每次刷新
|
||||
@@ -537,7 +755,7 @@ export default {
|
||||
}
|
||||
})
|
||||
//初始化:获取最新前10个热点标签
|
||||
apiCourseTag.getHotTagList(null).then(rs => {
|
||||
apiCourseTag.getHotTagList(null).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.hotTagsList = rs.result.map(tag => ({
|
||||
...tag,
|
||||
@@ -629,131 +847,6 @@ export default {
|
||||
// window.removeEventListener("scroll", this.handleScroll);
|
||||
},
|
||||
methods: {
|
||||
getSearchMode() {
|
||||
const hasKeyword = this.keyword && this.keyword.trim() !== '';
|
||||
|
||||
// 检查是否有导航标签被选中
|
||||
const hasNavigationTags = this.stagList.some(tag => {
|
||||
// 课程类型(1)、热点标签(14)、分类标签(11,12,13)
|
||||
return [1, 11, 12, 13, 14].includes(tag.type) && tag.checked;
|
||||
});
|
||||
|
||||
if (hasKeyword && hasNavigationTags) {
|
||||
return 'mixed'; // 混合模式:关键字 + 导航标签
|
||||
} else if (hasKeyword) {
|
||||
return 'keyword'; // 纯关键字搜索
|
||||
} else if (hasNavigationTags) {
|
||||
return 'navigation'; // 纯导航标签搜索
|
||||
} else {
|
||||
return 'none'; // 无搜索条件
|
||||
}
|
||||
},
|
||||
|
||||
// 高亮标签关键字
|
||||
highlightTagKeyword(tag) {
|
||||
const searchMode = this.getSearchMode();
|
||||
|
||||
switch (searchMode) {
|
||||
case 'keyword':
|
||||
return this.highlightPartialMatch(tag);
|
||||
case 'navigation':
|
||||
return this.highlightExactMatch(tag);
|
||||
case 'mixed':
|
||||
return this.highlightMixedMode(tag);
|
||||
default:
|
||||
return tag;
|
||||
}
|
||||
},
|
||||
|
||||
// 部分匹配高亮(纯关键字搜索模式)
|
||||
highlightPartialMatch(tag) {
|
||||
const searchKeywords = this.stagList
|
||||
.filter(searchTag => searchTag.type === 0) // 只处理关键字类型
|
||||
.map(searchTag => searchTag.tagName || searchTag.name)
|
||||
.filter(keyword => keyword && keyword.trim());
|
||||
|
||||
if (searchKeywords.length === 0) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
let highlightedTag = tag;
|
||||
|
||||
searchKeywords.forEach(keyword => {
|
||||
if (tag.includes(keyword)) {
|
||||
const regex = new RegExp(`(${this.escapeRegExp(keyword)})`, 'gi');
|
||||
highlightedTag = highlightedTag.replace(regex, '<span class="keyword-highlight">$1</span>');
|
||||
}
|
||||
});
|
||||
|
||||
return highlightedTag;
|
||||
},
|
||||
|
||||
// 完全匹配高亮(纯导航标签模式)
|
||||
highlightExactMatch(tag) {
|
||||
const isMatched = this.stagList.some(searchTag => {
|
||||
// 只检查导航标签类型
|
||||
if (searchTag.type === 0) return false;
|
||||
|
||||
const searchName = searchTag.tagName || searchTag.name;
|
||||
return searchName === tag;
|
||||
});
|
||||
|
||||
if (isMatched) {
|
||||
return `<span class="exact-match-highlight">${tag}</span>`;
|
||||
}
|
||||
|
||||
return tag;
|
||||
},
|
||||
|
||||
// 混合模式高亮(关键字 + 导航标签)
|
||||
highlightMixedMode(tag) {
|
||||
// 1. 先检查是否完全匹配导航标签
|
||||
const exactMatched = this.stagList.some(searchTag => {
|
||||
if (searchTag.type === 0) return false;
|
||||
|
||||
const searchName = searchTag.tagName || searchTag.name;
|
||||
return searchName === tag;
|
||||
});
|
||||
|
||||
// 2. 如果完全匹配导航标签,整个标签高亮
|
||||
if (exactMatched) {
|
||||
return `<span class="exact-match-highlight">${tag}</span>`;
|
||||
}
|
||||
|
||||
// 3. 否则检查是否包含关键字,进行部分高亮
|
||||
const searchKeywords = this.stagList
|
||||
.filter(searchTag => searchTag.type === 0)
|
||||
.map(searchTag => searchTag.tagName || searchTag.name)
|
||||
.filter(keyword => keyword && keyword.trim());
|
||||
|
||||
if (searchKeywords.length === 0) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
let highlightedTag = tag;
|
||||
let hasKeywordMatch = false;
|
||||
|
||||
searchKeywords.forEach(keyword => {
|
||||
if (tag.includes(keyword)) {
|
||||
const regex = new RegExp(`(${this.escapeRegExp(keyword)})`, 'gi');
|
||||
highlightedTag = highlightedTag.replace(regex, '<span class="keyword-highlight">$1</span>');
|
||||
hasKeywordMatch = true;
|
||||
}
|
||||
});
|
||||
|
||||
// 4. 如果有关键字匹配,返回部分高亮结果
|
||||
if (hasKeywordMatch) {
|
||||
return highlightedTag;
|
||||
}
|
||||
|
||||
// 5. 都不匹配,返回原标签
|
||||
return tag;
|
||||
},
|
||||
|
||||
// 辅助方法:转义正则表达式特殊字符
|
||||
escapeRegExp(string) {
|
||||
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
},
|
||||
|
||||
isTagMatched(tag) {
|
||||
// 检查stagList中是否有匹配的标签
|
||||
@@ -943,33 +1036,33 @@ export default {
|
||||
this.searchData(1);
|
||||
},
|
||||
// 清除
|
||||
handleClearTags() {
|
||||
//清空所有的条件
|
||||
this.keyword = '';
|
||||
this.ctypeList.forEach(item => {
|
||||
item.checked = false;
|
||||
});
|
||||
this.hotTagsList.forEach(item => {
|
||||
item.checked = false;
|
||||
});
|
||||
this.course.tags = ''; // 清空标签ID
|
||||
handleClearTags() {
|
||||
//清空所有的条件
|
||||
this.keyword = '';
|
||||
this.ctypeList.forEach(item => {
|
||||
item.checked = false;
|
||||
});
|
||||
this.hotTagsList.forEach(item => {
|
||||
item.checked = false;
|
||||
});
|
||||
this.course.tags = ''; // 清空标签ID
|
||||
|
||||
// 添加清除三级分类的逻辑
|
||||
this.oneList.forEach(one => {
|
||||
one.checked = false;
|
||||
one.children.forEach(two => {
|
||||
two.checked = false;
|
||||
two.children.forEach(three => {
|
||||
three.checked = false;
|
||||
});
|
||||
});
|
||||
// 添加清除三级分类的逻辑
|
||||
this.oneList.forEach(one => {
|
||||
one.checked = false;
|
||||
one.children.forEach(two => {
|
||||
two.checked = false;
|
||||
two.children.forEach(three => {
|
||||
three.checked = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 清空导航标题
|
||||
this.navTitle = [];
|
||||
// 清空导航标题
|
||||
this.navTitle = [];
|
||||
|
||||
this.searchData();
|
||||
},
|
||||
this.searchData();
|
||||
},
|
||||
// 导航切换(录播课,线下课,学习项目)
|
||||
handleTypeClick(item, list) {
|
||||
item.checked = !item.checked;
|
||||
@@ -983,7 +1076,6 @@ export default {
|
||||
},
|
||||
//点击标签
|
||||
handleTagClick(item, list,type) {
|
||||
|
||||
item.checked = !item.checked;
|
||||
|
||||
// 更新course.tags
|
||||
@@ -1488,7 +1580,7 @@ export default {
|
||||
if (item.teacher) {
|
||||
item.teacher = item.teacher.split(',').filter(itemValue => itemValue !== 'BOE教师').join(',');
|
||||
// if (dotIdx > 0) {
|
||||
// item.teacher = item.teacher.substring(0, dotIdx);
|
||||
// item.teacher = item.teacher.substring(0, dotIdx);
|
||||
// }
|
||||
}
|
||||
if (item.teacher && item.teacher == 'BOE教师') {
|
||||
@@ -1764,9 +1856,6 @@ export default {
|
||||
.topNav {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
height: auto;
|
||||
min-height: 80px;
|
||||
align-items: center;
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
@@ -1774,11 +1863,10 @@ export default {
|
||||
|
||||
.option-item {
|
||||
position: relative;
|
||||
margin: 0 15px;
|
||||
|
||||
.nav-bottbor {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
top: 130%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
@@ -2006,6 +2094,13 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.couderbox {
|
||||
// width: 5px;
|
||||
// padding: 0;
|
||||
// display: inline-block;
|
||||
// text-align: center;
|
||||
}
|
||||
|
||||
.coures-border {
|
||||
width: 2px;
|
||||
height: 15px;
|
||||
@@ -2142,7 +2237,7 @@ export default {
|
||||
right: 23.5%;
|
||||
// bottom: 26%;
|
||||
top: 0;
|
||||
height: 20px;
|
||||
height: 20;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
@@ -2238,8 +2333,8 @@ export default {
|
||||
margin-left: 15px;
|
||||
font-size: 14px;
|
||||
color: #3d3d3d;
|
||||
//cursor: pointer;
|
||||
//position: relative;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uxicon {
|
||||
@@ -2249,6 +2344,16 @@ export default {
|
||||
left: 98%;
|
||||
}
|
||||
|
||||
// .el-radio-button{
|
||||
// margin-right: 10px;
|
||||
// margin-bottom: 10px;
|
||||
|
||||
// .el-radio-button__inner{
|
||||
// background: #fff;
|
||||
// border: none;
|
||||
// height: 20px;
|
||||
// }
|
||||
// }
|
||||
::v-deep .el-radio-button__inner,
|
||||
.el-radio-group {
|
||||
vertical-align: top;
|
||||
@@ -2302,6 +2407,13 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.searchbar {
|
||||
background-color: #ffffff;
|
||||
// border: 1px solid #f3f3f3;
|
||||
// width: 900px;
|
||||
// padding: 5px 20px;
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
@@ -2350,12 +2462,9 @@ export default {
|
||||
}
|
||||
|
||||
.search-div {
|
||||
//background: #fff;
|
||||
background: #fff;
|
||||
padding: 10px 25px;
|
||||
border-radius: 8px;
|
||||
height: auto;
|
||||
min-height: 60px;
|
||||
|
||||
|
||||
::v-deep .el-input {
|
||||
width: 420px;
|
||||
@@ -2393,6 +2502,14 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
// .tip{
|
||||
// color:#999999;
|
||||
// font-size: 12px;
|
||||
// >span{
|
||||
// margin-right: 8px;
|
||||
// cursor: pointer;
|
||||
// }
|
||||
// }
|
||||
.search-item {
|
||||
// padding: 10px 0;
|
||||
}
|
||||
@@ -2435,6 +2552,30 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// .course-form {
|
||||
// width: 100%;
|
||||
// margin: 10px 0;
|
||||
// ::v-deep.el-button {
|
||||
// width: 100%;
|
||||
// color: #fff;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .right-box {
|
||||
// .add-btn {
|
||||
// width: 100%;
|
||||
// padding: 15px 0;
|
||||
// }
|
||||
// .ranking-card {
|
||||
// margin-top: 0px;
|
||||
// }
|
||||
|
||||
// .ranking-data {
|
||||
// margin: 10px 0;
|
||||
// color: #999999;
|
||||
// }
|
||||
// }]
|
||||
.search-item-type {
|
||||
line-height: 25px;
|
||||
padding-right: 10px;
|
||||
@@ -2447,8 +2588,7 @@ export default {
|
||||
color: #3d3d3d;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
//margin: 0px 15px;
|
||||
font-weight: normal;
|
||||
margin: 0px 15px;
|
||||
}
|
||||
|
||||
.option-border {
|
||||
@@ -2462,7 +2602,7 @@ export default {
|
||||
.option-active {
|
||||
color: #387DF7;
|
||||
}
|
||||
/* 项目简介 方法一:外部 CSS 类 */
|
||||
/* 项目简介 方法一:外部 CSS 类 */
|
||||
::v-deep.el-dialog {
|
||||
border-radius: 3% 3% 1% 1%;
|
||||
padding: 0;
|
||||
@@ -2488,13 +2628,12 @@ export default {
|
||||
padding: 0 !important;
|
||||
}
|
||||
/* ---end--- */
|
||||
/* ---标签管理 added by zhengsongbo on 2025-08-01--- */
|
||||
.search-div.nav {
|
||||
display: block;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.option-item {
|
||||
margin: 0px 5px;
|
||||
}
|
||||
@@ -2533,7 +2672,7 @@ a.custom2 {
|
||||
|
||||
.hot-tags-container {
|
||||
display: inline-block;
|
||||
//white-space: nowrap;
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
vertical-align: top;
|
||||
}
|
||||
@@ -2542,6 +2681,22 @@ a.custom2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 添加标签样式 */
|
||||
//.course-tags {
|
||||
// margin: 5px 0;
|
||||
// min-height: 20px;
|
||||
//}
|
||||
//.course-tags ::v-deep .el-tag {
|
||||
// color: #387DF7 !important;
|
||||
// border-color: #387DF7 !important;
|
||||
//}
|
||||
//.course-tags ::v-deep .el-tag .el-tag__close {
|
||||
// color: #387DF7 !important;
|
||||
//}
|
||||
//.course-tags ::v-deep .el-tag .el-tag__close:hover {
|
||||
// background-color: #387DF7 !important;
|
||||
// color: white !important;
|
||||
//}
|
||||
|
||||
.course-tag-item {
|
||||
color: #333333; // 默认深灰色
|
||||
@@ -2550,6 +2705,16 @@ a.custom2 {
|
||||
color: #387DF7 !important; // 匹配时的蓝色
|
||||
}
|
||||
|
||||
/* 添加热点标签容器样式,支持换行 */
|
||||
.hot-tags-wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
padding-top: 2px;
|
||||
//margin-left: 90px; /* 为"热点标签:"文本留出空间 */
|
||||
}
|
||||
|
||||
/* 调整option-item样式以适应换行布局 */
|
||||
.option-item {
|
||||
position: relative;
|
||||
@@ -2560,7 +2725,7 @@ a.custom2 {
|
||||
/* 保持原有的导航底部横线样式 */
|
||||
.nav-bottbor {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
top: 130%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
@@ -2580,78 +2745,5 @@ a.custom2 {
|
||||
gap: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.hot-tags-wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.course-tags {
|
||||
margin: 10px 0 0;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.course-tag-item {
|
||||
color: #333333;
|
||||
}
|
||||
.course-tag-item[style*="color: #387DF7"] {
|
||||
color: #387DF7 !important;
|
||||
}
|
||||
|
||||
|
||||
/* 关键字部分匹配高亮样式 */
|
||||
.keyword-highlight {
|
||||
color: #387DF7 !important;
|
||||
font-weight: bold;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
/* 导航标签完全匹配高亮样式 */
|
||||
.exact-match-highlight {
|
||||
color: #387DF7 !important;
|
||||
font-weight: bold;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
/* 混合模式下的特殊样式(可选) */
|
||||
.mixed-exact-highlight {
|
||||
color: #387DF7 !important;
|
||||
font-weight: bold;
|
||||
background-color: #f0f7ff !important;
|
||||
padding: 1px 3px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
/* 确保标签基础样式 */
|
||||
.course-tags ::v-deep .el-tag {
|
||||
color: #333333;
|
||||
background-color: #f4f4f5;
|
||||
border-color: #e9e9eb;
|
||||
}
|
||||
.course-tags ::v-deep .el-tag .keyword-highlight,
|
||||
.course-tags ::v-deep .el-tag .exact-match-highlight {
|
||||
color: #387DF7 !important;
|
||||
font-weight: bold;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.fieldbox {
|
||||
|
||||
display: flex;
|
||||
white-space: nowrap;
|
||||
flex-wrap: wrap;
|
||||
|
||||
div {
|
||||
margin: 0 15px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 25px;
|
||||
//color: #3d3d3d;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.fieldactive {
|
||||
color: #387DF7;
|
||||
}
|
||||
}
|
||||
/* ---end--- */
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user