mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 21:06:42 +08:00
Compare commits
44 Commits
251114-fea
...
fix_1127
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f403efa9a | ||
|
|
7a1f9e6815 | ||
|
|
2a6707517b | ||
|
|
7c37a766f1 | ||
|
|
cb555a91f7 | ||
|
|
c5c49222e8 | ||
|
|
bef42d5c24 | ||
|
|
bd0f372dc6 | ||
|
|
5670120cae | ||
|
|
e629d127ab | ||
|
|
909a70643f | ||
|
|
3c19a7550c | ||
|
|
8bed676851 | ||
|
|
9dbb5e2d89 | ||
|
|
738add6f18 | ||
|
|
a7763057c4 | ||
|
|
421e2b2c51 | ||
|
|
12e91854fe | ||
|
|
3852a92ab3 | ||
|
|
56103bbdf6 | ||
|
|
d2f3b2d79c | ||
|
|
4e1940b36f | ||
|
|
3e344a8374 | ||
|
|
82598dd5e0 | ||
|
|
da72c156e9 | ||
|
|
f731bb425f | ||
|
|
8c2f128578 | ||
|
|
f16c6eb157 | ||
|
|
6016e00ae8 | ||
|
|
7155976f31 | ||
|
|
4ca01ba233 | ||
|
|
7368fa7a8c | ||
|
|
d09cbfac5f | ||
|
|
fd903d0974 | ||
|
|
42885e0d61 | ||
|
|
0b3b9ad082 | ||
|
|
38fe538e4e | ||
|
|
052ab0be6f | ||
|
|
4c453e3974 | ||
|
|
47dde458de | ||
|
|
6ad28a4940 | ||
|
|
3701605f7a | ||
|
|
b021be2f6f | ||
|
|
11e34ca335 |
12
src/App.vue
12
src/App.vue
@@ -87,4 +87,16 @@
|
||||
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>
|
||||
@@ -19,52 +19,57 @@ 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({
|
||||
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 => {
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
if (getToken() && !isToken) {
|
||||
config.headers[TokenName] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
//Message({message: msg, type: 'error'});
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -84,22 +89,22 @@ const formRequest=axios.create({
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request=formRequest.request;
|
||||
const request = formRequest.request;
|
||||
|
||||
/**
|
||||
* get请求 ,只有url
|
||||
*/
|
||||
const get = function(baseURL,url){
|
||||
const get = function (baseURL, url) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,60 +113,60 @@ 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'}
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(baseURL,url,data){
|
||||
const postForm = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url,
|
||||
data,
|
||||
method: 'post',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
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'},
|
||||
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'},
|
||||
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'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -170,33 +175,33 @@ 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'}
|
||||
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'},
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
tokenName:TokenName,
|
||||
tokenName: TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
|
||||
@@ -28,3 +28,9 @@ export function getChatMessages(conversationId) {
|
||||
export function showCaseAiEntrance() {
|
||||
return ajax.get('/xboe/m/boe/case/ai/show-entrance')
|
||||
}
|
||||
export function likeMsg(data) {
|
||||
return ajax.postJson('/xboe/m/boe/case/ai/likeMsg',data)
|
||||
}
|
||||
export function msgFeedback(data) {
|
||||
return ajax.postJson('/xboe/m/boe/case/ai/msgFeedback',data)
|
||||
}
|
||||
|
||||
@@ -19,56 +19,61 @@ 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({
|
||||
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 => {
|
||||
})
|
||||
//发送json对象的拦截器
|
||||
formRequest.interceptors.request.use(config => {
|
||||
//是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
let curToken=getToken();
|
||||
let curToken = getToken();
|
||||
//curToken='eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzIzMTE2MTIsImV4cCI6MTY3MjMxODgxMiwiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.a4f41376e994c5fcd3ab537ce17572ef4c633863f87785cf7b6ffa353e2ed51c';
|
||||
if (curToken && !isToken) {
|
||||
config.headers[TokenName] = curToken // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
}, error => {
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
//console.log(res);
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} else {
|
||||
//Message({message: res.data.message, type: 'error'});
|
||||
//console.log('err' + res.data.error);
|
||||
return res.data
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
error => {
|
||||
console.log('err',error)
|
||||
console.log('err', error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "网络异常,请稍后重试";
|
||||
@@ -86,22 +91,22 @@ const formRequest=axios.create({
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* request请求,可以自定义参数
|
||||
*/
|
||||
const request=formRequest.request;
|
||||
const request = formRequest.request;
|
||||
|
||||
/**
|
||||
* get请求 ,只有url
|
||||
*/
|
||||
const get = function(baseURL,url){
|
||||
const get = function (baseURL, url) {
|
||||
return request({
|
||||
baseURL,
|
||||
url: url,
|
||||
method: 'get',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -110,48 +115,48 @@ 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'}
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
//post请求
|
||||
const postForm=function(baseURL,url,data){
|
||||
const postForm = function (baseURL, url, data) {
|
||||
return request({
|
||||
baseURL,
|
||||
url,
|
||||
data,
|
||||
method: 'post',
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'}
|
||||
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'},
|
||||
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'},
|
||||
data: postData,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -160,33 +165,33 @@ 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'}
|
||||
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'},
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
tokenName:TokenName,
|
||||
tokenName: TokenName,
|
||||
request,
|
||||
get,
|
||||
post,
|
||||
|
||||
@@ -18,13 +18,13 @@ 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'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
@@ -47,27 +47,32 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code1 = res.data.status || 200;
|
||||
const code=parseInt(code1);
|
||||
if(code===200){
|
||||
const code = parseInt(code1);
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
//return res.data;
|
||||
}else{
|
||||
} 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;
|
||||
@@ -91,8 +96,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BOE_BASE_API,
|
||||
//超时
|
||||
@@ -112,25 +117,30 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //对方是字符串,所以这里不要使用三个等号
|
||||
} else {
|
||||
if (code == 6001) { //对方是字符串,所以这里不要使用三个等号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -154,44 +164,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//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 {
|
||||
|
||||
@@ -17,12 +17,12 @@ 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'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
@@ -45,25 +45,30 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -86,8 +91,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_CESOURCE_BASE_API,
|
||||
//超时
|
||||
@@ -107,24 +112,29 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -147,44 +157,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//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 {
|
||||
|
||||
@@ -17,12 +17,12 @@ 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'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
@@ -45,25 +45,30 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -86,8 +91,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_STAT_BASE_API,
|
||||
//超时
|
||||
@@ -107,24 +112,29 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code === 401){
|
||||
} else {
|
||||
if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = this.webBaseUrl + ReLoginUrl;
|
||||
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'});
|
||||
} else if (code === 403) {
|
||||
var msg = '当前操作没有权限';
|
||||
Message({ message: msg, type: 'error' });
|
||||
return Promise.reject(new Error(msg))
|
||||
}else{
|
||||
} 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;
|
||||
@@ -147,44 +157,44 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//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 {
|
||||
|
||||
1
src/assets/images/case/cai-yes.svg
Normal file
1
src/assets/images/case/cai-yes.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161872024" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2317" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M256 504.021333c0 39.765333-32.213333 71.978667-72.021333 71.978667H136.021333A71.936 71.936 0 0 1 64 503.978667V136.021333c0-39.808 32.213333-72.021333 72.021333-72.021333h47.957334C223.786667 64 256 96.213333 256 136.021333v367.957334z m701.184 45.866667c-6.698667 26.112-21.077333 46.592-46.976 55.722667a131.925333 131.925333 0 0 1-41.813333 6.570666c-75.306667 0.597333-150.613333 0.213333-225.877334 0.213334-9.728 0-10.026667 0.597333-8.533333 9.898666 4.693333 27.52 8.618667 55.125333 14.037333 82.389334 7.253333 37.034667 8.192 73.813333-4.138666 109.696-11.093333 32.341333-23.68 64.213333-35.797334 96.213333-6.784 18.090667-18.176 31.317333-36.48 38.912-34.517333 14.506667-68.608 14.208-101.717333-2.986667-21.077333-11.093333-33.493333-28.714667-32.768-53.802666 0.981333-35.413333 1.194667-70.826667 2.688-106.24a58.026667 58.026667 0 0 0-7.808-32.554667c-27.306667-46.933333-47.104-83.413333-75.605333-129.621333-5.290667-8.533333-21.376-24.789333-28.288-32.085334-20.394667-21.504-30.890667-35.498667-31.018667-59.093333-0.085333-85.930667-0.298667-275.029333-0.682667-396.8a71.936 71.936 0 0 1 72.106667-72.234667c105.173333 0.128 296.277333 0.298667 389.973333 0.298667 22.4 0 44.416 1.408 66.005334 8.405333 42.794667 13.994667 69.717333 47.189333 73.088 91.989334 1.322667 17.024 0.512 33.92-5.546667 50.346666-0.938667 2.261333 0.554667 6.272 2.261333 8.576 16.896 22.613333 27.008 47.616 25.173334 76.117334-0.554667 9.813333-3.669333 19.584-6.656 29.098666-1.621333 5.12-1.621333 8.490667 1.877333 12.8 16.128 20.181333 25.898667 43.178667 25.130667 69.162667-0.426667 12.330667-4.906667 24.405333-7.253334 36.608-0.554667 2.901333-0.981333 7.210667 0.64 9.002667 13.781333 15.402667 21.504 33.621333 25.514667 53.717333a5.546667 5.546667 0 0 0 1.365333 2.005333v28.288a258.005333 258.005333 0 0 0-2.901333 9.386667z" fill="#000000" opacity=".65" p-id="2318"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
1
src/assets/images/case/cai.svg
Normal file
1
src/assets/images/case/cai.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161849864" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5624" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M960 543.573333v-43.946666l-3.882667-5.12a138.24 138.24 0 0 0-19.712-44.586667c2.816-9.6 4.394667-19.541333 4.906667-29.610667 0.768-26.794667-6.912-52.48-23.125333-76.629333 2.304-7.893333 3.84-16.085333 4.394666-24.32 1.834667-28.672-5.802667-56.576-22.698666-83.072 3.2-15.104 4.010667-30.592 2.602666-45.909333-4.181333-55.466667-38.784-99.2-92.373333-116.778667-25.728-8.405333-50.773333-9.813333-72.021333-9.813333h-93.866667c-33.237333 0-66.944 0.213333-100.693333 0.213333-53.034667 0-106.325333-0.213333-159.232-0.213333h-1.109334 0.128-247.296c-39.808 0-72.021333 32.213333-72.021333 72.021333v368c0 39.808 32.213333 71.978667 72.021333 71.978667H249.173333s55.893333 6.4 82.346667 48.512c18.346667 29.312 36.053333 60.202667 53.12 90.026666l22.016 38.058667c1.792 2.986667 2.602667 6.4 2.218667 9.898667-0.896 20.736-1.28 41.6-1.706667 61.696-0.213333 11.946667-0.512 24.234667-0.810667 36.224-0.981333 36.181333 16.810667 65.706667 49.92 83.114666a140.8 140.8 0 0 0 65.792 16.469334c19.498667 0 39.253333-4.096 58.88-12.288 25.514667-10.666667 43.52-29.781333 53.717334-56.789334l8.96-23.594666c8.234667-21.333333 16.64-43.434667 24.234666-65.621334 12.288-35.712 13.909333-74.88 5.12-119.808-2.602667-13.397333-4.906667-26.794667-7.125333-40.789333h21.589333l64.128 0.085333c29.184 0 58.666667 0 87.893334-0.170666h0.810666c16.768 0 33.493333-2.730667 49.493334-8.106667 23.594667-8.405333 54.272-28.416 66.56-76.714667l1.237333-4.010666 0.853333-2.986667 1.536-5.376z m-712.021333-39.594666H136.021333V135.978667h112.042667v368z m640 28.8c0 1.536-0.981333 3.541333-1.578667 5.632-4.608 18.090667-12.501333 23.466667-20.394667 26.368-8.405333 2.816-17.066667 4.224-25.898666 4.224h-0.426667l-0.469333-0.085334-0.512-0.128c-31.018667 0.213333-61.482667 0.298667-87.296 0.298667h-32.298667l-31.786667-0.085333h-106.24l13.653334 83.626666c2.56 15.872 4.864 29.354667 7.552 43.093334 6.314667 32.170667 5.546667 59.093333-2.474667 82.474666-6.997333 20.181333-14.421333 39.808-23.424 63.317334-3.072 7.978667-6.101333 16.085333-9.088 23.978666-3.584 9.6-8.106667 13.098667-14.08 15.701334-10.709333 4.522667-21.12 6.698667-31.146667 6.698666-11.093333 0-21.674667-2.688-32.384-8.277333a24.661333 24.661333 0 0 1-9.386666-7.68c-0.512-0.853333-2.133333-3.413333-1.92-9.642667 0.341333-11.52 0.64-22.997333 0.853333-36.778666v-1.706667c0.384-18.773333 0.768-38.314667 1.450667-57.173333a86.954667 86.954667 0 0 0-11.904-50.346667c-2.56-4.394667-5.077333-8.874667-7.68-13.269333-4.608-8.021333-9.386667-16.213333-13.909334-24.234667l-0.085333-0.085333-0.085333-0.085334-0.725334-1.109333c-17.194667-29.994667-34.986667-61.013333-53.674666-91.008l-0.128-0.213333-0.085334-0.170667c-16.64-26.325333-41.088-47.701333-71.509333-62.421333l-0.597333-387.712h63.914666c55.68 0 111.872 0.341333 159.402667 0.341333 16.981333 0 33.962667-0.128 50.773333-0.128 16.725333 0 33.28-0.213333 49.92-0.213333h93.866667c16.213333 0 33.536 0.938667 49.706667 6.229333 13.013333 4.181333 23.296 11.306667 30.634666 20.48 7.168 9.130667 11.264 20.224 12.288 33.28v0.64l0.085334 0.597333c0.810667 8.192 0.298667 16.298667-1.408 24.32l-0.768 3.413334h-8.704 8.704l-5.333334 25.173333 15.786667 25.002667c8.533333 13.397333 12.330667 26.282667 11.648 39.381333-0.213333 2.986667-0.853333 5.973333-1.621333 8.917333l-9.514667 32.298667 18.816 27.989333c7.594667 11.306667 11.093333 22.016 10.922667 33.493334-0.298667 4.266667-1.024 8.618667-2.218667 12.714666l-9.301333 32.426667 18.901333 27.861333c4.394667 6.4 7.509333 13.482667 9.301333 21.12l1.877334 7.765334v13.696z" fill="#000000" opacity=".65" p-id="5625"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
1
src/assets/images/case/zan-yes.svg
Normal file
1
src/assets/images/case/zan-yes.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161882076" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2499" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M184.021333 448H136.021333c-39.808 0-72.021333 32.213333-72.021333 72.021333v367.957334c0 39.808 32.213333 72.021333 72.021333 72.021333h47.957334C223.786667 960 256 927.786667 256 887.978667v-368c0-39.765333-32.213333-71.978667-72.021333-71.978667z m773.162667 26.112c-6.698667-26.112-21.077333-46.592-46.976-55.722667a131.925333 131.925333 0 0 0-41.813333-6.570666c-75.306667-0.597333-150.613333-0.213333-225.877334-0.213334-9.728 0-10.026667-0.597333-8.533333-9.898666 4.693333-27.52 8.618667-55.125333 14.037333-82.389334 7.253333-37.034667 8.192-73.813333-4.138666-109.738666-11.093333-32.298667-23.68-64.170667-35.797334-96.170667-6.784-18.090667-18.176-31.317333-36.48-38.912-34.517333-14.506667-68.608-14.208-101.717333 2.986667-21.077333 11.093333-33.493333 28.714667-32.768 53.802666 0.981333 35.413333 1.194667 70.826667 2.688 106.24a58.026667 58.026667 0 0 1-7.808 32.554667c-27.306667 46.933333-47.104 83.413333-75.605333 129.621333-5.290667 8.533333-21.376 24.789333-28.288 32.085334-20.394667 21.504-30.890667 35.498667-31.018667 59.093333-0.085333 85.930667-0.298667 275.029333-0.682667 396.8a71.936 71.936 0 0 0 72.106667 72.234667c105.173333-0.128 296.277333-0.298667 389.973333-0.298667 22.4 0 44.416-1.408 66.005334-8.405333 42.794667-13.994667 69.717333-47.232 73.088-92.032 1.322667-16.981333 0.512-33.877333-5.546667-50.261334-0.938667-2.304 0.554667-6.314667 2.261333-8.618666 16.896-22.613333 27.008-47.616 25.173334-76.117334-0.554667-9.813333-3.669333-19.584-6.656-29.098666-1.621333-5.12-1.621333-8.490667 1.877333-12.8 16.128-20.181333 25.898667-43.178667 25.130667-69.162667-0.426667-12.330667-4.906667-24.405333-7.253334-36.608-0.554667-2.901333-0.981333-7.210667 0.64-9.002667 13.781333-15.402667 21.504-33.621333 25.514667-53.717333a5.546667 5.546667 0 0 1 1.365333-2.005333v-28.288c-0.981333-3.114667-2.005333-6.186667-2.901333-9.386667z" fill="#000000" opacity=".65" p-id="2500"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
1
src/assets/images/case/zan.svg
Normal file
1
src/assets/images/case/zan.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1765161839692" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5444" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M958.378667 475.093333l-0.853334-2.986666c-0.512-1.621333-1.024-2.986667-1.237333-4.010667-12.288-48.384-43.008-68.394667-66.56-76.714667a154.666667 154.666667 0 0 0-49.493333-8.106666h-0.853334c-29.184-0.170667-58.581333-0.170667-87.893333-0.170667l-64.085333 0.085333h-21.589334c2.304-13.994667 4.48-27.392 7.082667-40.789333 8.789333-44.885333 7.210667-84.096-5.12-119.808-7.594667-22.186667-16.085333-44.288-24.192-65.578667l-8.96-23.594666c-10.112-27.008-28.245333-46.08-53.76-56.832a141.056 141.056 0 0 0-124.586667 3.882666c-33.066667 17.322667-50.858667 46.848-49.877333 83.114667 0.298667 12.032 0.597333 24.32 0.810667 36.224 0.426667 20.181333 0.768 41.088 1.706666 61.696a16.426667 16.426667 0 0 1-2.218666 9.898667c-7.296 12.714667-14.805333 25.514667-22.016 38.101333-17.066667 29.781333-34.773333 60.714667-53.077334 90.026667C305.066667 441.6 249.173333 448 249.173333 448H135.978667c-39.765333 0-71.978667 32.213333-71.978667 72.021333v367.957334c0 39.808 32.213333 72.021333 71.978667 72.021333h247.338666-0.128 1.109334c52.821333 0 106.24-0.213333 159.189333-0.213333 33.792 0 67.498667 0.213333 100.693333 0.213333H738.133333c21.205333 0 46.293333-1.408 72.021334-9.813333 53.589333-17.493333 88.192-61.184 92.373333-116.778667a157.269333 157.269333 0 0 0-2.56-45.909333c16.896-26.410667 24.490667-54.314667 22.656-83.114667a118.101333 118.101333 0 0 0-4.394667-24.32c16.128-23.978667 23.808-49.664 23.125334-76.544a135.594667 135.594667 0 0 0-4.906667-29.610667c9.216-13.610667 15.914667-28.586667 19.712-44.629333l3.882667-5.12v-43.946667l-1.621334-5.12z m-710.4 412.928H136.021333v-368h112.042667v367.957334z m640-383.232l-1.877334 7.808a64.426667 64.426667 0 0 1-9.301333 21.12l-18.901333 27.861334 9.301333 32.426666c1.194667 4.096 1.92 8.405333 2.218667 12.714667 0.170667 11.52-3.328 22.186667-10.922667 33.493333l-18.773333 27.989334 9.472 32.298666a38.698667 38.698667 0 0 1 1.621333 8.917334c0.682667 13.184-2.986667 26.069333-11.605333 39.381333l-15.786667 25.002667 5.290667 25.173333h-8.704 8.704l0.768 3.413333c1.706667 8.021333 2.218667 16.213333 1.408 24.32l-0.085334 0.597334v0.597333c-1.024 13.013333-5.12 24.192-12.288 33.28a63.018667 63.018667 0 0 1-30.634666 20.48c-16.085333 5.333333-33.365333 6.229333-49.664 6.229333H644.266667c-16.512 0-33.109333-0.213333-49.92-0.213333l-50.773334-0.085333c-47.616 0-103.68 0.298667-159.402666 0.298666H320.298667l0.810666-387.712c30.378667-14.762667 54.869333-36.096 71.509334-62.378666l0.085333-0.213334 0.085333-0.170666c18.730667-30.037333 36.522667-61.013333 53.717334-91.008l0.682666-1.109334 0.128-0.085333 0.085334-0.128c4.48-7.893333 9.301333-16.213333 13.909333-24.192 2.56-4.48 5.205333-8.917333 7.68-13.312 9.002667-15.274667 13.098667-32.682667 11.946667-50.304-0.853333-18.901333-1.237333-38.4-1.536-57.173333v-1.706667c-0.298667-13.696-0.512-25.301333-0.810667-36.821333-0.213333-6.058667 1.408-8.661333 1.92-9.6a23.253333 23.253333 0 0 1 9.386667-7.68c10.666667-5.589333 21.333333-8.32 32.426666-8.32 9.856 0 20.394667 2.304 31.061334 6.741333 5.973333 2.474667 10.496 5.973333 14.08 15.658667 3.029333 7.936 6.144 16 9.130666 24.021333 9.002667 23.466667 16.384 43.093333 23.424 63.317333 7.978667 23.381333 8.874667 50.346667 2.474667 82.474667a1376.853333 1376.853333 0 0 0-7.594667 43.093333l-13.781333 83.712h106.197333c10.496 0 21.077333 0 31.786667-0.085333h32.298667c25.813333 0 56.32 0 87.296 0.298667l0.512-0.128 0.469333-0.085334h0.426667c8.789333 0 17.493333 1.493333 25.898666 4.181334 7.893333 2.901333 15.786667 8.32 20.394667 26.453333 0.512 2.048 1.621333 3.968 1.621333 5.546667v13.653333z" fill="#000000" opacity=".65" p-id="5445"></path></svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
94
src/components/LanServiceChecker.vue
Normal file
94
src/components/LanServiceChecker.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'LanServiceChecker',
|
||||
props: {
|
||||
errorMsg: {
|
||||
type: String,
|
||||
default: '十分抱歉,您当前的网络环境不符合观看要求。为了保障课程信息的安全,您需要接入公司内网才能观看。'
|
||||
},
|
||||
// 控制是否显示
|
||||
value: {type: Boolean, default: false}
|
||||
},
|
||||
created() {
|
||||
this.lanServiceCheck()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
syncValue(val) {
|
||||
this.loading = false
|
||||
this.$emit('update:value', val)
|
||||
},
|
||||
/**局域网检测*/
|
||||
lanServiceCheck() {
|
||||
this.loading = true
|
||||
|
||||
// 使用 AbortController 来控制超时
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(() => {
|
||||
controller.abort();
|
||||
this.syncValue(true);
|
||||
}, 1000);
|
||||
|
||||
// 拼接随机参数(时间戳+随机数,确保URL唯一,防止缓存)
|
||||
const url = `${window.location.protocol}//uapi.boe.com.cn/500.html?t=${Date.now()}${Math.random()}`;
|
||||
|
||||
// 使用 fetch 发送 HEAD 请求
|
||||
fetch(url, {
|
||||
method: 'HEAD',
|
||||
signal: controller.signal
|
||||
})
|
||||
.then(response => {
|
||||
clearTimeout(timeoutId);
|
||||
this.syncValue(!response.ok)
|
||||
})
|
||||
.catch(error => {
|
||||
clearTimeout(timeoutId);
|
||||
if (error.name !== 'AbortError') {
|
||||
this.syncValue(true)
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="lan-checker-container">
|
||||
<div>
|
||||
<span>{{ errorMsg }}</span>
|
||||
</div>
|
||||
<div class="check-btn" @click="lanServiceCheck">
|
||||
<el-button v-loading="loading" type="primary">重新检测</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.lan-checker-container {
|
||||
height: 100%;
|
||||
|
||||
& > div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.error-msg {
|
||||
margin-top: 40px;
|
||||
font-weight: 700;
|
||||
font-size: 22px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.check-btn {
|
||||
margin-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,55 +1,110 @@
|
||||
<template>
|
||||
<div class="portal-header">
|
||||
<div class="portal-top" :style="{color:textColor}">
|
||||
<div class="portal-top" :style="{ color: textColor }">
|
||||
<div class="portal-top-left">
|
||||
<div class="portal-top-logo">
|
||||
<img src="../assets/logo/logo-white.png" v-if="textColor == '#fff' || textColor == '#ffffff'" style="width:160px;height: 27px;" />
|
||||
<img src="../assets/logo/logo.png" v-else style="width:160px;height: 27px;" />
|
||||
<img
|
||||
src="../assets/logo/logo-white.png"
|
||||
v-if="textColor == '#fff' || textColor == '#ffffff'"
|
||||
style="width: 160px; height: 27px"
|
||||
/>
|
||||
<img
|
||||
src="../assets/logo/logo.png"
|
||||
v-else
|
||||
style="width: 160px; height: 27px"
|
||||
/>
|
||||
</div>
|
||||
<div class="portal-top-nav" v-if="userInfo.role === 1">
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'index' ? activeNav : ''">
|
||||
<router-link to="/index" >首页
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'index' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/index"
|
||||
>首页
|
||||
<div :class="current == 'index' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'course' ? activeNav : ''">
|
||||
<a @click="handleChangeCourse">课程
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'course' ? activeNav : ''"
|
||||
>
|
||||
<a @click="handleChangeCourse"
|
||||
>课程
|
||||
<div :class="current == 'course' ? 'nav-bottbor' : ''"></div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'case' ? activeNav : ''">
|
||||
<router-link to="/case">案例
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'case' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/case"
|
||||
>案例
|
||||
<div :class="current == 'case' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'article' ? activeNav : ''">
|
||||
<router-link to="/article">文章
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'article' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/article"
|
||||
>文章
|
||||
<div :class="current == 'article' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'qa' ? activeNav : ''">
|
||||
<router-link to="/qa" >问答
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'qa' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/qa"
|
||||
>问答
|
||||
<div :class="current == 'qa' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="top-nav">
|
||||
<el-dropdown placement="bottom" @command="handleCommand">
|
||||
<span class="el-dropdown-link" style="font-size:16px;cursor: pointer;" :style="{color:textColor}">专区</span>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size: 16px; cursor: pointer"
|
||||
:style="{ color: textColor }"
|
||||
>专区</span
|
||||
>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="zero">热点论坛</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided>BOE系列公开课</el-dropdown-item>
|
||||
<el-dropdown-item command="two" divided>Grow180</el-dropdown-item>
|
||||
<el-dropdown-item command="three" divided>管理者进阶</el-dropdown-item>
|
||||
<el-dropdown-item command="four" divided>U选小课堂</el-dropdown-item>
|
||||
<el-dropdown-item command="five" divided>社招新员工</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided
|
||||
>BOE系列公开课</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="two" divided
|
||||
>Grow180</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="three" divided
|
||||
>管理者进阶</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="four" divided
|
||||
>U选小课堂</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item command="five" divided
|
||||
>社招新员工</el-dropdown-item
|
||||
>
|
||||
<!-- <el-dropdown-item command="six" divided>贡献者专区</el-dropdown-item> -->
|
||||
<el-dropdown-item command="seven" divided>教师专区</el-dropdown-item>
|
||||
<el-dropdown-item command="seven" divided
|
||||
>教师专区</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="top-nav">
|
||||
<el-dropdown placement="bottom" @command="handleContributor">
|
||||
<span class="el-dropdown-link" style="font-size:16px;cursor: pointer;" :style="{color:textColor}">贡献者大会</span>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size: 16px; cursor: pointer"
|
||||
:style="{ color: textColor }"
|
||||
>贡献者大会</span
|
||||
>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="three">2024</el-dropdown-item>
|
||||
<el-dropdown-item command="one" divided>2023</el-dropdown-item>
|
||||
@@ -58,18 +113,40 @@
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'follow' ? activeNav : ''">
|
||||
<router-link to="/follow">我的关注
|
||||
<div
|
||||
class="top-nav"
|
||||
:style="{ color: textColor }"
|
||||
:class="current == 'follow' ? activeNav : ''"
|
||||
>
|
||||
<router-link to="/follow"
|
||||
>我的关注
|
||||
<div :class="current == 'follow' ? 'nav-bottbor' : ''"></div>
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portal-top-right">
|
||||
<div v-if="goSearch !=10 && userInfo.role === 1" style="position: relative;">
|
||||
<el-input class="portal-input" v-show="!hideSearch" placeholder="搜索全部" style="border-radius: 20px !important; " @keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword" >
|
||||
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px; border-radius:20px !important;" slot="prepend" placeholder="请选择">
|
||||
<div
|
||||
v-if="goSearch != 10 && userInfo.role === 1"
|
||||
style="position: relative"
|
||||
>
|
||||
<el-input
|
||||
class="portal-input"
|
||||
v-show="!hideSearch"
|
||||
placeholder="搜索全部"
|
||||
style="border-radius: 20px !important"
|
||||
@keyup.enter.native="searchJump()"
|
||||
clearable
|
||||
maxlength="50"
|
||||
v-model="keyword"
|
||||
>
|
||||
<el-select
|
||||
v-if="current == 'index'"
|
||||
v-model="findType"
|
||||
style="width: 75px; border-radius: 20px !important"
|
||||
slot="prepend"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option label="课程" value="1"></el-option>
|
||||
<el-option label="案例" value="2"></el-option>
|
||||
<el-option label="文章" value="3"></el-option>
|
||||
@@ -77,7 +154,14 @@
|
||||
<!-- <el-option label="专区" value="5"></el-option> -->
|
||||
</el-select>
|
||||
</el-input>
|
||||
<el-button v-show="!hideSearch" class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
||||
<el-button
|
||||
v-show="!hideSearch"
|
||||
class="sear-but"
|
||||
@click="searchJump()"
|
||||
type="primary"
|
||||
size="mini"
|
||||
>搜索</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="person-action">
|
||||
@@ -86,11 +170,25 @@
|
||||
<el-link v-else class="person-action-index" type="primary" style="margin-right:10px; color:#fff;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link> -->
|
||||
<!-- <el-link type="primary" @click="logout()" icon="el-icon-switch-button" :underline="false">退出</el-link> -->
|
||||
<div class="person-action-item">
|
||||
<el-badge class="person-action-index" :value="userMsg" :hidden="userMsg == 0">
|
||||
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<el-badge
|
||||
class="person-action-index"
|
||||
:value="userMsg"
|
||||
:hidden="userMsg == 0"
|
||||
>
|
||||
<el-tooltip
|
||||
content="消息"
|
||||
placement="bottom"
|
||||
effect="light"
|
||||
:visible-arrow="false"
|
||||
popper-class="text-tooltip"
|
||||
>
|
||||
<!-- <el-link type="primary" :href="`${webBaseUrl}/message/center/index`" :underline="false"> -->
|
||||
<router-link to="/message/center/index">
|
||||
<svg-icon :style="{color:textColor}" style="margin-right: 0;font-size:22px;" icon-class="messfff"></svg-icon>
|
||||
<svg-icon
|
||||
:style="{ color: textColor }"
|
||||
style="margin-right: 0; font-size: 22px"
|
||||
icon-class="messfff"
|
||||
></svg-icon>
|
||||
</router-link>
|
||||
<!-- </el-link> -->
|
||||
</el-tooltip>
|
||||
@@ -99,40 +197,94 @@
|
||||
<div class="person-action-item">
|
||||
<el-dropdown class="person-action-index">
|
||||
<span class="el-dropdown-link">
|
||||
<span :style="{color:textColor}">学员</span>
|
||||
<i :style="{color:textColor}" class="el-icon-arrow-down el-icon--right"></i>
|
||||
<span :style="{ color: textColor }">学员</span>
|
||||
<i
|
||||
:style="{ color: textColor }"
|
||||
class="el-icon-arrow-down el-icon--right"
|
||||
></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item><router-link to="/index">学员</router-link></el-dropdown-item>
|
||||
<el-dropdown-item v-if="identity == 2 || identity == 5" @click.native="setCurIdentity(2)"><router-link to="/need/waitaudit">教师</router-link></el-dropdown-item>
|
||||
<el-dropdown-item v-if="identity == 3 || identity == 5" ><a :href="managerPath+'/learningpath'">管理员</a></el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
><router-link to="/index">学员</router-link></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
v-if="identity == 2 || identity == 5"
|
||||
@click.native="setCurIdentity(2)"
|
||||
><router-link to="/need/waitaudit"
|
||||
>教师</router-link
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item v-if="identity == 3 || identity == 5"
|
||||
><a :href="managerPath + '/learningpath'"
|
||||
>管理员</a
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="person-action-item">
|
||||
<el-dropdown>
|
||||
<div class="el-dropdown-link" style="display:flex" :style="{color:textColor}">
|
||||
<div
|
||||
class="el-dropdown-link"
|
||||
style="display: flex"
|
||||
:style="{ color: textColor }"
|
||||
>
|
||||
<div class="person-action-index">
|
||||
<div v-if="userInfo.avatar !== '' " class="user-avatar">
|
||||
<img :src="userInfo.avatar" style="width: 35px;height: 35px;"/>
|
||||
<div v-if="userInfo.avatar !== ''" class="user-avatar">
|
||||
<img
|
||||
:src="userInfo.avatar"
|
||||
style="width: 35px; height: 35px"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="uavatar">
|
||||
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt="" style="width: 30px;height: 30px;"></div>
|
||||
<div v-else><img src="../../public/images/Avatarwoman.png" alt="" style="width: 30px;height: 30px;"></div>
|
||||
<div v-if="sex === 1">
|
||||
<img
|
||||
src="../../public/images/Avatarman.png"
|
||||
alt=""
|
||||
style="width: 30px; height: 30px"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<img
|
||||
src="../../public/images/Avatarwoman.png"
|
||||
alt=""
|
||||
style="width: 30px; height: 30px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-weight: 400;font-size: 16px; margin-top: 8px;">{{userInfo.name}}</div>
|
||||
</div>
|
||||
<div style="font-weight: 400; font-size: 16px; margin-top: 8px">
|
||||
{{ userInfo.name }}
|
||||
</div>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="setCurIdentity(1)"><a :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`">个人中心</a></el-dropdown-item>
|
||||
<el-dropdown-item><router-link :to="'/home/'+userInfo.aid">个人主页</router-link></el-dropdown-item>
|
||||
<el-dropdown-item @click.native="setCurIdentity(1)"
|
||||
><a
|
||||
:href="`${webBaseUrl}${
|
||||
isTiao ? '/uc/study/task' : '/uc/study/courses'
|
||||
}`"
|
||||
>个人中心</a
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
><router-link :to="'/home/' + userInfo.aid"
|
||||
>个人主页</router-link
|
||||
></el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="person-action-item">
|
||||
|
||||
<div class="person-action-index pointer" :style="{color:textColor}" @click="logout()">
|
||||
<svg-icon style="margin-right: 4px;font-size:16px;" icon-class="white-out"></svg-icon>登出
|
||||
<div
|
||||
class="person-action-index pointer"
|
||||
:style="{ color: textColor }"
|
||||
@click="logout()"
|
||||
>
|
||||
<svg-icon
|
||||
style="margin-right: 4px; font-size: 16px"
|
||||
icon-class="white-out"
|
||||
></svg-icon
|
||||
>登出
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,95 +294,110 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import apiMessage from '@/api/system/message.js';
|
||||
import popup from '@/components/AlertPopup.vue';
|
||||
import yearMedal from '@/components/Popup/China2023.vue';
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import {userAvatarText} from "@/utils/tools.js";
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
import apiMessage from "@/api/system/message.js";
|
||||
import popup from "@/components/AlertPopup.vue";
|
||||
import yearMedal from "@/components/Popup/China2023.vue";
|
||||
import apiBoeCourse from "@/api/boe/course.js";
|
||||
import { userAvatarText } from "@/utils/tools.js";
|
||||
import apiCase from "@/api/modules/cases.js";
|
||||
export default {
|
||||
props: {
|
||||
current: {
|
||||
type: String,
|
||||
default: '',
|
||||
default: "",
|
||||
},
|
||||
hideSearch:{
|
||||
hideSearch: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
textColor:{
|
||||
textColor: {
|
||||
type: String,
|
||||
default: '',
|
||||
default: "",
|
||||
},
|
||||
goSearch:{
|
||||
goSearch: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
keywords:{
|
||||
type:String,
|
||||
default:''
|
||||
keywords: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
components:{popup,yearMedal},
|
||||
components: { popup, yearMedal },
|
||||
computed: {
|
||||
...mapGetters(['userInfo','curIdentity', 'userMsg','identity','studyTaskCount']),
|
||||
...mapGetters([
|
||||
"userInfo",
|
||||
"curIdentity",
|
||||
"userMsg",
|
||||
"identity",
|
||||
"studyTaskCount",
|
||||
]),
|
||||
|
||||
avatarText(){
|
||||
avatarText() {
|
||||
return userAvatarText(this.userInfo.name);
|
||||
},
|
||||
activeNav(){
|
||||
activeNav() {
|
||||
return {
|
||||
'top-nav-active-blue': this.textColor=='#000000',
|
||||
'top-nav-active-white': this.textColor=='#fff' || this.textColor=='#ffffff',
|
||||
}
|
||||
"top-nav-active-blue": this.textColor == "#000000",
|
||||
"top-nav-active-white":
|
||||
this.textColor == "#fff" || this.textColor == "#ffffff",
|
||||
};
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
keywords(newval) {
|
||||
console.log(newval, 9999);
|
||||
if (this.findType == "1") {
|
||||
this.keyword = newval;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
keywords(newval){
|
||||
console.log(newval,9999);
|
||||
if(this.findType == '1'){
|
||||
this.keyword = newval
|
||||
}
|
||||
"$route.query.keyword": {
|
||||
handler(newval) {
|
||||
if (newval && this.current == "case") {
|
||||
this.keyword = newval;
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
popupConfig:{},
|
||||
ctx:process.env.VUE_APP_PUBLIC_PATH,
|
||||
managerPath:process.env.VUE_APP_MANAGER_PATH,
|
||||
popupConfig: {},
|
||||
ctx: process.env.VUE_APP_PUBLIC_PATH,
|
||||
managerPath: process.env.VUE_APP_MANAGER_PATH,
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
findType: '1',
|
||||
keyword: '',
|
||||
findType: "1",
|
||||
keyword: "",
|
||||
isTiao: false,
|
||||
sex:'',
|
||||
sex: "",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.sex = this.userInfo.sex;
|
||||
this.$store.dispatch('refrashMsg');
|
||||
this.$store.dispatch("refrashMsg");
|
||||
this.loadBoeData();
|
||||
// console.log('this.userInfo::',this.userInfo)
|
||||
//this.loadPopupConfig();
|
||||
},
|
||||
methods: {
|
||||
handleChangeCourse() {
|
||||
const paths = ["/course","/qualityCourse"]
|
||||
const paths = ["/course", "/qualityCourse"];
|
||||
// 如果是 课程 和 精品课程, 那么就不再重定向
|
||||
const needReload = paths.findIndex(e=> e === this.$route.path) === -1
|
||||
if (needReload) this.$router.push({path: paths[0]})
|
||||
const needReload = paths.findIndex((e) => e === this.$route.path) === -1;
|
||||
if (needReload) this.$router.push({ path: paths[0] });
|
||||
},
|
||||
|
||||
setCurIdentity(iden){
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
setCurIdentity(iden) {
|
||||
this.$store.dispatch("SetCurIdentity", iden);
|
||||
},
|
||||
tomy(){
|
||||
console.log('lll')
|
||||
tomy() {
|
||||
console.log("lll");
|
||||
},
|
||||
loadBoeData() {
|
||||
if(this.studyTaskCount>0){
|
||||
if (this.studyTaskCount > 0) {
|
||||
this.isTiao = true;
|
||||
}else{
|
||||
} else {
|
||||
this.isTiao = false;
|
||||
}
|
||||
// let params = {
|
||||
@@ -248,18 +415,18 @@ export default {
|
||||
// }
|
||||
// });
|
||||
},
|
||||
handleContributor(val){
|
||||
handleContributor(val) {
|
||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||
let obj = {
|
||||
one: urlPre + "/web/contributornew/index",
|
||||
two: urlPre + "/web/contributor/index",
|
||||
three: urlPre + "/web/contributor_2024/index"
|
||||
three: urlPre + "/web/contributor_2024/index",
|
||||
};
|
||||
window.open(obj[val]);
|
||||
},
|
||||
handleCommand(val) {
|
||||
if (val === "four") {
|
||||
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130")
|
||||
window.open("https://m.qingxuetang.com/x/?appId=qxtcorp306130");
|
||||
// this.$emit('showClass',true)
|
||||
} else {
|
||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||
@@ -272,83 +439,104 @@ export default {
|
||||
// four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
|
||||
five: urlPre + "/boe/new-employee/index.html",
|
||||
six: urlPre + "/web/contributor/index",
|
||||
seven: this.webBaseUrl + '/grateful/index'
|
||||
seven: this.webBaseUrl + "/grateful/index",
|
||||
};
|
||||
window.open(obj[val]);
|
||||
}
|
||||
},
|
||||
handleUcCommand(val) {
|
||||
if (val == 'uc') {
|
||||
window.location.href = `${this.webBaseUrl}${this.isTiao ? '/uc/study/task' : '/uc/study/courses'}`;
|
||||
} else if (val == 'logout') {
|
||||
if (val == "uc") {
|
||||
window.location.href = `${this.webBaseUrl}${
|
||||
this.isTiao ? "/uc/study/task" : "/uc/study/courses"
|
||||
}`;
|
||||
} else if (val == "logout") {
|
||||
this.logout();
|
||||
}
|
||||
},
|
||||
searchJump() {
|
||||
this.$emit('type1', '')
|
||||
if(this.current == 'index') {
|
||||
if (this.findType == '1') {
|
||||
if(this.keyword==''){return;}
|
||||
this.$emit("type1", "");
|
||||
if (this.current == "index") {
|
||||
if (this.findType == "1") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 课程
|
||||
location.href=`${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/course?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '2') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "2") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 案例
|
||||
location.href=`${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '3') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "3") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
//文章
|
||||
location.href=`${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '4') {
|
||||
if(this.keyword==''){return;}
|
||||
} else if (this.findType == "4") {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 问答
|
||||
location.href=`${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/qa?keyword=${this.keyword}`);
|
||||
} else if (this.findType == '5') {
|
||||
} else if (this.findType == "5") {
|
||||
// 专区,专区要单独的写,因为不是一个系统呀
|
||||
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||
}
|
||||
} else {
|
||||
this.$emit('emitInput',this.keyword)
|
||||
if(this.goSearch == 1) {
|
||||
if(this.keyword==''){return;}
|
||||
} else {
|
||||
this.$emit("emitInput", this.keyword);
|
||||
if (this.goSearch == 1) {
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 课程
|
||||
location.href=`${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/course?keyword=${this.keyword}`;
|
||||
} else if (this.goSearch == 2) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 案例
|
||||
// location.href=`${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
||||
this.$router.push(`/case?keyword=${this.keyword}`)
|
||||
this.$router.push(`/case?keyword=${this.keyword}`);
|
||||
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 3) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
//文章
|
||||
location.href=`${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/article?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 4) {
|
||||
if(this.keyword==''){return;}
|
||||
if (this.keyword == "") {
|
||||
return;
|
||||
}
|
||||
// 问答
|
||||
location.href=`${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
location.href = `${this.webBaseUrl}/qa?keyword=${this.keyword}`;
|
||||
//window.open(`${this.webBaseUrl}/qa?keyword=${this.keyword}`);
|
||||
} else if (this.goSearch == 5) {
|
||||
// 专区,专区要单独的写,因为不是一个系统呀
|
||||
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
this.$confirm('您确定要退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$confirm("您确定要退出系统吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch("LogOut").then(() => {
|
||||
//location.href = this.webBaseUrl + '/login';
|
||||
sessionStorage.setItem('dialog_session_show'+this.userInfo.aid,null); // 清除兴趣采集的"关闭"缓存
|
||||
sessionStorage.setItem(
|
||||
"dialog_session_show" + this.userInfo.aid,
|
||||
null
|
||||
); // 清除兴趣采集的"关闭"缓存
|
||||
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
});
|
||||
})
|
||||
@@ -356,49 +544,52 @@ export default {
|
||||
},
|
||||
//获取未读消息数量
|
||||
getMsgNum() {
|
||||
apiMessage.isRead().then(res => {
|
||||
apiMessage.isRead().then((res) => {
|
||||
if (res.status == 200) {
|
||||
this.msgNum = res.result;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
|
||||
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover{
|
||||
::v-deep .el-dropdown-menu__item:not(.is-disabled):hover {
|
||||
background-color: #fff !important;
|
||||
color: #0059FF !important;
|
||||
color: #0059ff !important;
|
||||
}
|
||||
::v-deep.el-dropdown-menu {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
border: none !important;
|
||||
}
|
||||
//定义消息的图标的样式,按ui,未完成
|
||||
.msg-icon{
|
||||
font-size:16px;
|
||||
background-color:#fff;
|
||||
border-radius:50%;
|
||||
//定义消息的图标的样式,按ui,未完成
|
||||
.msg-icon {
|
||||
font-size: 16px;
|
||||
background-color: #fff;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.top-nav-active-blue{
|
||||
color: #387DF7;
|
||||
a{color:#387DF7;}
|
||||
div{
|
||||
.top-nav-active-blue {
|
||||
color: #387df7;
|
||||
a {
|
||||
color: #387df7;
|
||||
}
|
||||
div {
|
||||
width: 75%;
|
||||
height: 4px;
|
||||
top: 75%;
|
||||
left: 13%;
|
||||
background: #387DF7;
|
||||
background: #387df7;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
.top-nav-active-white{
|
||||
.top-nav-active-white {
|
||||
color: #fff;
|
||||
a{color:#fff;}
|
||||
div{
|
||||
a {
|
||||
color: #fff;
|
||||
}
|
||||
div {
|
||||
width: 75%;
|
||||
height: 4px;
|
||||
top: 75%;
|
||||
@@ -409,15 +600,15 @@ text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.sear-but{
|
||||
.sear-but {
|
||||
position: absolute;
|
||||
bottom: 10%;
|
||||
right: 5px;
|
||||
}
|
||||
::v-deep .el-input__inner{
|
||||
::v-deep .el-input__inner {
|
||||
border-radius: 6px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
::v-deep .el-badge__content.is-fixed {
|
||||
right: 10px;
|
||||
}
|
||||
@@ -426,42 +617,41 @@ text-align: center;
|
||||
// margin: 0 87px;
|
||||
height: 72px;
|
||||
display: flex;
|
||||
background: rgba(255,255,255,0.1);
|
||||
border: 1px solid rgba(61,61,61,0.15);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(61, 61, 61, 0.15);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
.portal-top{
|
||||
.portal-top {
|
||||
width: 100%;
|
||||
margin: 0px 40px;
|
||||
display: flex;
|
||||
justify-content:space-between;
|
||||
.portal-top-left{
|
||||
justify-content: space-between;
|
||||
.portal-top-left {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
.portal-top-logo{
|
||||
|
||||
.portal-top-logo {
|
||||
}
|
||||
.portal-top-nav{
|
||||
.portal-top-nav {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
.portal-top-right{
|
||||
flex:1;
|
||||
.portal-top-right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
//width: 1050px;
|
||||
.person-action{
|
||||
.person-action {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin-left: 10px;
|
||||
|
||||
.person-action-index{
|
||||
.person-action-index {
|
||||
//margin-left: 40px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
@@ -476,20 +666,20 @@ text-align: center;
|
||||
// // right: 48px;
|
||||
// // }
|
||||
// }
|
||||
::v-deep.el-avatar{
|
||||
::v-deep.el-avatar {
|
||||
margin-right: 8px;
|
||||
img{
|
||||
img {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.el-button{
|
||||
.el-button {
|
||||
margin-left: 15px;
|
||||
margin-top: 1px;
|
||||
// font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.top-nav {
|
||||
@@ -499,42 +689,42 @@ text-align: center;
|
||||
color: #000000;
|
||||
line-height: 72px;
|
||||
padding: 0px 10px;
|
||||
white-space:nowrap;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
//此处理应该移到单独的一个样式中比较好
|
||||
|
||||
@media screen and (max-width: 1366px){
|
||||
@media screen and (max-width: 1366px) {
|
||||
.top-nav {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1680px) and (min-width:1367px){
|
||||
@media screen and (max-width: 1680px) and (min-width: 1367px) {
|
||||
.top-nav {
|
||||
padding: 0px 15px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 30px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1920px) and (min-width: 1681px){
|
||||
@media screen and (max-width: 1920px) and (min-width: 1681px) {
|
||||
.top-nav {
|
||||
padding: 0px 30px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1921px){
|
||||
@media screen and (min-width: 1921px) {
|
||||
.top-nav {
|
||||
padding: 0px 40px;
|
||||
}
|
||||
.person-action-item{
|
||||
.person-action-item {
|
||||
margin-left: 45px;
|
||||
}
|
||||
}
|
||||
@@ -542,7 +732,6 @@ text-align: center;
|
||||
::v-deep .el-badge {
|
||||
.el-badge__content {
|
||||
top: 0px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +742,7 @@ text-align: center;
|
||||
// border: 1px solid #333333;
|
||||
border-radius: 0 20px 20px 0;
|
||||
border-left: none;
|
||||
background: rgba(255,255,255,0.12);
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.message-count a {
|
||||
@@ -563,7 +752,6 @@ text-align: center;
|
||||
}
|
||||
::v-deep .el-badge {
|
||||
margin-top: 0 !important;
|
||||
|
||||
}
|
||||
::v-deep .el-link.el-link--primary:hover {
|
||||
color: #588afc;
|
||||
@@ -572,10 +760,10 @@ text-align: center;
|
||||
cursor: pointer;
|
||||
color: #000000;
|
||||
}
|
||||
.uavatar{
|
||||
div{
|
||||
.uavatar {
|
||||
div {
|
||||
border-radius: 50%;
|
||||
img{
|
||||
img {
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@@ -587,11 +775,11 @@ text-align: center;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.user-avatar{
|
||||
}
|
||||
.user-avatar {
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
img{
|
||||
img {
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@@ -603,5 +791,5 @@ text-align: center;
|
||||
font-size: 14px;
|
||||
margin-right: 8px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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,21 +28,21 @@ 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) {
|
||||
@@ -56,17 +56,17 @@ router.beforeEach((to, from, next) => {
|
||||
store.dispatch('resOwner/loadResOwners');
|
||||
store.dispatch('sysType/loadSysTypes');
|
||||
|
||||
store.commit('app/SET_INITDATA',true);
|
||||
store.commit('app/SET_INITDATA', true);
|
||||
//routers数据先使用固定的,以后在初始化接口中返回
|
||||
let myRouters=routers();
|
||||
store.dispatch('GenerateRoutes',{routers:myRouters}).then(accessRoutes=>{
|
||||
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);
|
||||
store.commit('app/SET_INITDATA', false);
|
||||
//如果初始化错误,就不再执行了,不然会一直循环下去
|
||||
next({ path: '/500' })
|
||||
//NProgress.done();
|
||||
@@ -78,7 +78,7 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
}
|
||||
//next();
|
||||
}else{
|
||||
} else {
|
||||
|
||||
//next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
//设置之前的路径
|
||||
@@ -86,7 +86,12 @@ router.beforeEach((to, from, next) => {
|
||||
//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);
|
||||
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()
|
||||
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ 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'},
|
||||
const jsonRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
@@ -48,36 +48,56 @@ jsonRequest.interceptors.request.use(config => {
|
||||
jsonRequest.interceptors.response.use(res => {
|
||||
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
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'});
|
||||
} 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{
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// 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;
|
||||
@@ -101,8 +121,8 @@ jsonRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//用于普通的发送请求
|
||||
const formRequest=axios.create({
|
||||
headers:{'Content-Type':'application/x-www-form-urlencoded'},
|
||||
const formRequest = axios.create({
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
//超时
|
||||
@@ -122,35 +142,55 @@ formRequest.interceptors.request.use(config => {
|
||||
});
|
||||
formRequest.interceptors.response.use(res => {
|
||||
const code = res.data.status || 200;
|
||||
if(code===200){
|
||||
if (code === 200) {
|
||||
return res.data
|
||||
}else{
|
||||
if(code == 6001){ //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
} else {
|
||||
if (code == 6001) { //针对于老系统的处理,因为老系统是字符串,所以这里不使用三等于号
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 401){
|
||||
} else if (code === 401) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// location.href = ReLoginUrl;
|
||||
})
|
||||
}else if(code === 402){
|
||||
} else if (code === 402) {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
location.href = ReLoginUrl;
|
||||
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'});
|
||||
} 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{
|
||||
} else if (code === 302) {
|
||||
if (top !== window) { // 判断当前是否在iframe内
|
||||
top.location.href = ReLoginUrl;
|
||||
} else {
|
||||
window.location.href = ReLoginUrl;
|
||||
}
|
||||
// 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;
|
||||
@@ -174,48 +214,48 @@ formRequest.interceptors.response.use(res => {
|
||||
)
|
||||
|
||||
//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 {
|
||||
|
||||
@@ -163,11 +163,12 @@
|
||||
<!-- 精品课模块 -->
|
||||
<div class="xcontent2-main">
|
||||
<div class="modules-title xindex-main" v-if="this.qusisityList.list.length > 0">
|
||||
<!-- <span class="modules-text" style="color: #3D86F4;">精品课</span> -->
|
||||
<!-- <span class="jin-text">精品课</span> -->
|
||||
<div class="jin-zhe"></div>
|
||||
<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>
|
||||
@@ -2826,6 +2827,15 @@ 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;
|
||||
@@ -3136,4 +3146,13 @@ 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,56 +5,61 @@
|
||||
</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){
|
||||
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){
|
||||
setTimeout(function () {
|
||||
$this.curToken = getToken();
|
||||
if (!$this.curToken) {
|
||||
//console.log(token,'第二次未获取token');
|
||||
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
}else{
|
||||
if (top !== window) {
|
||||
// 判断当前是否在iframe内
|
||||
top.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
window.location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
}
|
||||
// location.href = process.env.VUE_APP_LOGIN_URL;
|
||||
} else {
|
||||
$this.boeLogin();
|
||||
}
|
||||
|
||||
},500);
|
||||
}else{
|
||||
this.curToken=token;
|
||||
}, 500);
|
||||
} else {
|
||||
this.curToken = token;
|
||||
this.boeLogin();
|
||||
}
|
||||
},
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
curToken:'',
|
||||
toUrl:''
|
||||
}
|
||||
curToken: "",
|
||||
toUrl: "",
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
boeLogin(){
|
||||
apiLogin.boeLogin(this.curToken).then(rs=>{
|
||||
if(rs.status==200){
|
||||
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" })
|
||||
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);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error("登录失败:" + rs.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -134,7 +134,10 @@
|
||||
<div>
|
||||
<div style="line-height: 30px;">
|
||||
<div>请在当前面板选择需要上传的课件</div>
|
||||
<div style="">提示:课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。如果上传zip文件必须是scorm标准打包文件</div>
|
||||
<div style="">提示:<br>
|
||||
1、课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。<br>
|
||||
2、视频码率需在1.5Mb/s及以下,帧数需在30帧及以下。<br>
|
||||
3、如果上传zip文件必须是scorm标准打包文件。</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display: flex;line-height: 30px;padding: 5px 0px;">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-container>
|
||||
<el-header style="height:70px;padding: 12px 20px 10px 20px;" >
|
||||
<el-row>
|
||||
<!-- <el-col :span="4">
|
||||
<el-col :span="4">
|
||||
<el-cascader
|
||||
:options="resOwnerListMap"
|
||||
v-model="params.ownership"
|
||||
@@ -11,7 +11,7 @@
|
||||
clearable
|
||||
:props="resourceProps">
|
||||
</el-cascader>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-select v-model="params.type" clearable placeholder="类型" >
|
||||
<el-option v-for="item in optionsList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
||||
@@ -47,13 +47,13 @@
|
||||
<span class="previewStyle" @click="viewTopic(scope.row)">{{ scope.row.title }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="resSysId" label="资源归属" width="240px" show-overflow-tooltip>
|
||||
<el-table-column prop="resSysId" label="资源归属" width="240px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{resOwnerName(scope.row.resOwner1)}}</span>
|
||||
<span v-if="scope.row.resOwner2 != ''">/{{resOwnerName(scope.row.resOwner2)}}</span>
|
||||
<span v-if="scope.row.resOwner3 != ''">/{{resOwnerName(scope.row.resOwner3)}}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="类型" width="70px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.type == 1 ? "单选" : scope.row.type == 2 ? "多选" : scope.row.type == 3 ? "判断题" : "" }}
|
||||
@@ -92,9 +92,9 @@
|
||||
<div style="padding-top: 10px; overflow: auto">
|
||||
<div>
|
||||
<el-form size="mini" label-width="80px" :model="question" ref="questionForm" :rules="questionRules">
|
||||
<!-- <el-form-item label="资源归属">
|
||||
<el-form-item label="资源归属">
|
||||
<el-cascader v-model="ownership" :options="resOwnerListMap" :props="resourceProps"></el-cascader>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="题干" prop="title">
|
||||
<el-col :span="15">
|
||||
<el-input class="inputclass" type="textarea" :rows="5" maxlength="500" show-word-limit v-model="question.title" placeholder="请输入题干"></el-input>
|
||||
@@ -180,9 +180,9 @@
|
||||
<div style="padding-top: 10px; overflow: auto">
|
||||
<div>
|
||||
<el-form size="mini" label-width="80px" :model="question" ref="questionForm" :rules="questionRules">
|
||||
<!-- <el-form-item label="资源归属">
|
||||
<el-form-item label="资源归属">
|
||||
<el-cascader v-model="ownership" :options="resOwnerListMap" :props="resourceProps" ></el-cascader>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="题干" prop="title">
|
||||
<el-col :span="15">
|
||||
<el-input class="inputclass" type="textarea" :rows="5" maxlength="500" show-word-limit v-model="question.title" placeholder="请输入题干"></el-input>
|
||||
|
||||
@@ -2,42 +2,54 @@
|
||||
<div>
|
||||
<!-- 最大化状态的弹窗 -->
|
||||
<el-dialog
|
||||
v-show=" windowState === 'maximized'"
|
||||
v-if="dialogVisible"
|
||||
v-if="dialogVisible && windowState === 'maximized'"
|
||||
:visible="true"
|
||||
:close-on-click-modal="false"
|
||||
:show-close="true"
|
||||
@close="onClose"
|
||||
class="case-expert-dialog"
|
||||
:modal="false"
|
||||
:append-to-body="true"
|
||||
:fullscreen="false"
|
||||
top="10vh"
|
||||
:fullscreen="dialogFullscreen"
|
||||
top="0"
|
||||
v-resizeable
|
||||
v-draggable
|
||||
>
|
||||
<!-- 标题 -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<span>案例专家</span>
|
||||
<div class="window-control-btn">
|
||||
<el-button
|
||||
style="color:#96999f"
|
||||
style="color:#96999f;margin-right: 6px;"
|
||||
type="text"
|
||||
class="window-control-btn"
|
||||
@click="minimizeWindow"
|
||||
>
|
||||
<i class="el-icon-minus"></i>
|
||||
</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
style="color:#96999f;"
|
||||
>
|
||||
<img v-if="!dialogFullscreen" @click="onbigWindowClick" :src="openImg" alt="" style="width: 17px">
|
||||
<i v-else @click="onRestoreWindowClick" class="el-icon-copy-document"></i>
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content-wrapper" v-show="isLan">
|
||||
<lan-service-checker :value.sync="isLan"/>
|
||||
</div>
|
||||
<!-- 内容区域 -->
|
||||
<div class="content-wrapper">
|
||||
<div class="content-wrapper" v-show="!isLan" >
|
||||
<div
|
||||
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>
|
||||
<messages :messageData="item" @update:messageData="val=> $set(messageList, index, val)" :suggestions="suggestions" @getMinWindow="minimizeWindow" :isFirstMessage="item.isFirstMessage"></messages>
|
||||
</div>
|
||||
<div class="message-suggestions" v-if="messageList.length > 0 && messageList[messageList.length-1].textCompleted">
|
||||
<div class="suggestion-item" v-for="(item, index) in suggestions" :key="index">
|
||||
@@ -113,6 +125,7 @@ import { mapState } from 'vuex'
|
||||
import messages from './components/messages.vue'
|
||||
import sendMessage from './components/sendMessage.vue'
|
||||
import openImg from './components/open.png'
|
||||
import LanServiceChecker from "@/components/LanServiceChecker.vue";
|
||||
export default {
|
||||
name: 'CaseExpertDialog',
|
||||
props: {
|
||||
@@ -122,6 +135,7 @@ export default {
|
||||
}
|
||||
},
|
||||
components: {
|
||||
LanServiceChecker,
|
||||
messages,
|
||||
sendMessage
|
||||
},
|
||||
@@ -154,13 +168,19 @@ export default {
|
||||
let startY = 0;
|
||||
let startLeft = 0;
|
||||
let startTop = 0;
|
||||
|
||||
const startDrag = (event) => {
|
||||
// 只有在标题栏上按下鼠标才开始拖动
|
||||
if (event.target.closest('.resize-handle')) {
|
||||
return; // 如果点击的是resize-handle,则不触发拖动
|
||||
}
|
||||
|
||||
if (event.target.closest('.window-control-btn')) {
|
||||
return; // 如果点击的是控制按钮,则不触发拖动
|
||||
}
|
||||
// 全屏状态下拖动为正常弹窗大小
|
||||
if (vnode.context.dialogFullscreen) {
|
||||
vnode.context.onRestoreWindowClick();
|
||||
return;
|
||||
}
|
||||
isDragging = true;
|
||||
startX = event.clientX;
|
||||
startY = event.clientY;
|
||||
@@ -187,14 +207,12 @@ export default {
|
||||
|
||||
const stopDrag = () => {
|
||||
isDragging = false;
|
||||
|
||||
// 保存当前位置到 sessionStorage
|
||||
const currentPosition = {
|
||||
left: parseInt(dialogEl.style.left),
|
||||
top: parseInt(dialogEl.style.top)
|
||||
};
|
||||
sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
|
||||
|
||||
// sessionStorage.setItem('aiCallDialogPosition', JSON.stringify(currentPosition));
|
||||
// 移除全局事件监听
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
document.removeEventListener('mouseup', stopDrag);
|
||||
@@ -469,6 +487,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogFullscreen:false,
|
||||
isLan: true,
|
||||
openImg,
|
||||
AIContent: '',
|
||||
isLoading: false,
|
||||
@@ -476,6 +496,7 @@ export default {
|
||||
messageList: [
|
||||
{
|
||||
typing:true,
|
||||
isFirstMessage: true, // 添加 isFirstMessage 属性不展示赞 踩
|
||||
isBot: true, // 是否为机器人
|
||||
text: `<p><b>您好!我是京东方案例智能问答助手,随时为您服务。</b></p>
|
||||
<p>我可以帮您快速查找和解读平台内的各类案例内容。只需输入您想了解的问题或关键词,我会从案例库中精准匹配相关信息,并提供清晰的解答。每条回答都会附上来源链接,方便您随时查阅原始案例全文。</p>
|
||||
@@ -498,6 +519,9 @@ export default {
|
||||
watch: {
|
||||
dialogVisible: {
|
||||
handler(newVal) {
|
||||
console.log('dialogVisible发生变化');
|
||||
console.log(newVal);
|
||||
console.log(this.windowState);
|
||||
if (newVal) {
|
||||
this.$nextTick(() => {
|
||||
// 获取对话框元素
|
||||
@@ -514,12 +538,12 @@ export default {
|
||||
}
|
||||
|
||||
// 检查是否有保存的位置状态
|
||||
const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
if (savedPosition) {
|
||||
const { left, top } = JSON.parse(savedPosition);
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
}
|
||||
// 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')
|
||||
@@ -552,6 +576,90 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onbigWindowClick() {
|
||||
console.log('放大');
|
||||
// 保存当前非全屏状态的尺寸和位置(仅当当前不是全屏状态时)
|
||||
if (!this.dialogFullscreen) {
|
||||
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
|
||||
if (dialogEl) {
|
||||
const normalSize = {
|
||||
width: parseInt(dialogEl.style.width) || dialogEl.offsetWidth,
|
||||
height: parseInt(dialogEl.style.height) || dialogEl.offsetHeight,
|
||||
left: parseInt(dialogEl.style.left) || dialogEl.offsetLeft,
|
||||
top: parseInt(dialogEl.style.top) || dialogEl.offsetTop
|
||||
};
|
||||
sessionStorage.setItem('aiCallDialogNormalSize', JSON.stringify(normalSize));
|
||||
}
|
||||
}
|
||||
|
||||
// 设置全屏状态
|
||||
this.dialogFullscreen = true;
|
||||
|
||||
// 设置全屏尺寸和位置
|
||||
this.$nextTick(() => {
|
||||
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
|
||||
if (dialogEl) {
|
||||
dialogEl.style.width = '100vw';
|
||||
dialogEl.style.height = '100vh';
|
||||
dialogEl.style.left = '0px';
|
||||
dialogEl.style.top = '0px';
|
||||
|
||||
// 更新消息容器高度
|
||||
const messageContainer = document.querySelector('.welcome-message');
|
||||
const inputArea = document.querySelector('.input-area-wrapper');
|
||||
if (messageContainer && inputArea) {
|
||||
messageContainer.style.height = `calc(100vh - ${inputArea.offsetHeight}px - 120px)`;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onRestoreWindowClick(){
|
||||
console.log('缩小');
|
||||
this.dialogFullscreen = false;
|
||||
|
||||
this.$nextTick(() => {
|
||||
const dialogEl = document.querySelector('.case-expert-dialog .el-dialog');
|
||||
if (dialogEl) {
|
||||
// 从 sessionStorage 中获取保存的正常窗口尺寸和位置
|
||||
const savedNormalSize = sessionStorage.getItem('aiCallDialogNormalSize');
|
||||
const savedSize = sessionStorage.getItem('aiCallDialogSize');
|
||||
const savedPosition = sessionStorage.getItem('aiCallDialogPosition');
|
||||
|
||||
if (savedNormalSize) {
|
||||
// 使用之前保存的正常尺寸
|
||||
const { width, height, left, top } = JSON.parse(savedNormalSize);
|
||||
dialogEl.style.width = width + 'px';
|
||||
dialogEl.style.height = height + 'px';
|
||||
dialogEl.style.left = left + 'px';
|
||||
dialogEl.style.top = top + 'px';
|
||||
} else 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.width = '800px';
|
||||
dialogEl.style.height = '600px';
|
||||
dialogEl.style.left = (window.innerWidth - 800) / 2 + 'px';
|
||||
dialogEl.style.top = '100px';
|
||||
}
|
||||
|
||||
// 应用相应的消息容器高度
|
||||
this.$nextTick(() => {
|
||||
const messageContainer = document.querySelector('.welcome-message');
|
||||
const inputArea = document.querySelector('.input-area-wrapper');
|
||||
if (messageContainer && inputArea) {
|
||||
const dialogHeight = dialogEl.style.height || '600px';
|
||||
messageContainer.style.height = `calc(${dialogHeight} - ${inputArea.offsetHeight}px - 120px)`;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// / 关闭最小化窗口
|
||||
closeMinimizedWindow() {
|
||||
this.$store.commit('app/SET_SHOW_AI_CALL_MINIMIZED', false);
|
||||
@@ -566,12 +674,15 @@ closeMinimizedWindow() {
|
||||
console.log('关闭弹窗')
|
||||
// 清除保存的状态
|
||||
sessionStorage.removeItem('aiCallDialogSize');
|
||||
sessionStorage.removeItem('aiCallDialogPosition');
|
||||
// sessionStorage.removeItem('aiCallDialogPosition');
|
||||
this.$emit('close')
|
||||
this.dialogFullscreen=false
|
||||
// 可以在这里执行其他逻辑
|
||||
},
|
||||
|
||||
minimizeWindow() {
|
||||
console.log(131);
|
||||
|
||||
this.windowState = 'minimized';
|
||||
this.$store.commit('app/SET_SHOW_AI_CALL_MINIMIZED', true);
|
||||
},
|
||||
@@ -595,6 +706,7 @@ closeMinimizedWindow() {
|
||||
|
||||
// 处理加载状态
|
||||
handleLoading(status) {
|
||||
console.log('handleLoading---'+status);
|
||||
this.isLoading = status;
|
||||
},
|
||||
|
||||
@@ -622,6 +734,7 @@ closeMinimizedWindow() {
|
||||
this.messageList = [
|
||||
{
|
||||
isBot: true,
|
||||
isFirstMessage: true,
|
||||
text: `<p><b>您好!我是京东方案例智能问答助手,随时为您服务。</b></p>
|
||||
<p>我可以帮您快速查找和解读平台内的各类案例内容。只需输入您想了解的问题或关键词,我会从案例库中精准匹配相关信息,并提供清晰的解答。每条回答都会附上来源链接,方便您随时查阅原始案例全文。</p>
|
||||
<p>我还会根据您的提问,智能推荐相关延伸问题,助您更高效地探索知识、解决问题。</p>
|
||||
@@ -655,6 +768,31 @@ 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,则通过事件通知父组件显示对话框
|
||||
@@ -669,6 +807,9 @@ 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 ;
|
||||
@@ -677,6 +818,8 @@ closeMinimizedWindow() {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
pointer-events: auto;
|
||||
z-index: 2000;
|
||||
|
||||
//background-color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
@@ -710,6 +853,7 @@ closeMinimizedWindow() {
|
||||
font-size: 18px;
|
||||
padding: 5px 10px;
|
||||
color: #333; /* 黑色图标 */
|
||||
margin-top: -13px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,6 +881,8 @@ closeMinimizedWindow() {
|
||||
//margin-bottom: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
|
||||
.welcome-message {
|
||||
display: flex;
|
||||
@@ -870,4 +1016,13 @@ closeMinimizedWindow() {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.case-expert-dialog {
|
||||
::v-deep .el-dialog.fullscreen {
|
||||
border-radius: 0;
|
||||
|
||||
.el-dialog__body {
|
||||
height: calc(100vh - 120px); // 减去标题栏高度
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,15 +6,13 @@
|
||||
<div v-if="messageData.thinkText" class="bot-think" v-katex:auto v-html="md.render(messageData.thinkText)"></div>
|
||||
|
||||
<!-- 主要回复内容 -->
|
||||
<div
|
||||
ref="contentContainer"
|
||||
class="message-content"
|
||||
v-katex:auto
|
||||
v-html="md.render(displayText)"
|
||||
></div>
|
||||
<div ref="contentContainer" class="message-content" v-katex:auto v-html="md.render(displayText)">
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 引用案例 -->
|
||||
<div v-if="messageData.caseRefers && messageData.caseRefers.length > 0 && messageData.textCompleted" class="case-refers">
|
||||
<div v-if="messageData.caseRefers && messageData.caseRefers.length > 0 && messageData.textCompleted"
|
||||
class="case-refers">
|
||||
<div class="case-refers-title">
|
||||
<span><i class="iconfont icon-think"></i> 引用案例</span>
|
||||
<span v-if="shouldShowMoreButton" class="more" @click="toggleShowAllCaseRefers">
|
||||
@@ -22,11 +20,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="case-refers-list">
|
||||
<div
|
||||
v-for="item in displayedCaseRefers"
|
||||
:key="item.caseId"
|
||||
class="case-refers-item"
|
||||
>
|
||||
<div v-for="item in displayedCaseRefers" :key="item.caseId" class="case-refers-item">
|
||||
<div class="case-refers-item-title">
|
||||
<a @click="toUrl(item)" class="title">{{ item.title }}</a>
|
||||
<span class="case-refers-item-timer">{{ item.uploadTime }}</span>
|
||||
@@ -43,27 +37,54 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 赞/踩图标区域 - 仅在文本加载完成后显示 -->
|
||||
<div v-if="showFeedbackIcons && !isFirstMessage" style="margin-top: 8px;">
|
||||
<el-tooltip class="item" effect="dark" content="点赞" placement="bottom">
|
||||
<!-- 修改为根据 isLike 值判断状态,使用 == 而不是 === -->
|
||||
<img :src="messageData.isLike == 1 ? require('@/assets/images/case/zan-yes.svg') : require('@/assets/images/case/zan.svg')"
|
||||
@click="toggleStar(1)" alt="zan" class="zan_img">
|
||||
</el-tooltip>
|
||||
<el-popover placement="bottom" trigger="manual" v-model="caiDialogShow">
|
||||
<div class="feedback-class">
|
||||
<span>反馈</span>
|
||||
<i class="el-icon-close" @click="caiDialogShow = false"></i>
|
||||
</div>
|
||||
<div style="margin-top: 15px;">
|
||||
<span class="tag-class" v-for="(item, index) in tagList" :key="index" @click="handleTag(item)">{{
|
||||
item.name}}</span>
|
||||
</div>
|
||||
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="feedbackText" style="margin-top: 10px;">
|
||||
</el-input>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button style="margin-top: 10px;" type="primary" size="mini" @click="handleSure">确定</el-button>
|
||||
</div>
|
||||
<!-- 修改为根据 isLike 值判断状态,使用 == 而不是 === -->
|
||||
<img slot="reference"
|
||||
:src="messageData.isLike == -1 ? require('@/assets/images/case/cai-yes.svg') : require('@/assets/images/case/cai.svg')"
|
||||
@click="toggleStar(-1)" alt="cai" class="zan_img" style="margin-left:10px">
|
||||
</el-popover>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 用户消息 -->
|
||||
<div v-else class="user-message">
|
||||
<div class="message-text" v-html="messageData.text"></div>
|
||||
</div>
|
||||
|
||||
<!-- 推荐问题 -->
|
||||
<!-- <div v-if="suggestions && suggestions.length > 0" class="suggestions">-->
|
||||
<!-- <div class="suggestions-title">💡 推荐问题</div>-->
|
||||
<!-- <div class="suggestions-list">-->
|
||||
<!-- <button-->
|
||||
<!-- v-for="(item, index) in suggestions"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- class="suggestions-item"-->
|
||||
<!-- @click="$emit('suggestion-click', item)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ item }}-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="suggestions && suggestions.length > 0" class="suggestions">-->
|
||||
<!-- <div class="suggestions-title">💡 推荐问题</div>-->
|
||||
<!-- <div class="suggestions-list">-->
|
||||
<!-- <button-->
|
||||
<!-- v-for="(item, index) in suggestions"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- class="suggestions-item"-->
|
||||
<!-- @click="$emit('suggestion-click', item)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ item }}-->
|
||||
<!-- </button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -73,6 +94,7 @@ import highlight from 'markdown-it-highlightjs';
|
||||
import 'highlight.js/styles/a11y-dark.css';
|
||||
import markdownItMermaid from 'markdown-it-mermaid';
|
||||
import mermaid from 'mermaid';
|
||||
import { likeMsg, msgFeedback } from '@/api/boe/aiChat.js'
|
||||
|
||||
// 初始化 Mermaid
|
||||
mermaid.initialize({ startOnLoad: false });
|
||||
@@ -97,6 +119,11 @@ export default {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 添加 isFirstMessage 属性来标识是否为第一条消息
|
||||
isFirstMessage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -105,6 +132,16 @@ export default {
|
||||
typingTimer: null,
|
||||
typingSpeed: 30, // 毫秒/字符
|
||||
showAllCaseRefers: false,
|
||||
caiDialogShow: false,
|
||||
tagList: [
|
||||
{ name: '回答不准确' },
|
||||
{ name: '逻辑不清晰' },
|
||||
{ name: '内容不完整' },
|
||||
{ name: '其他' },
|
||||
],
|
||||
feedbackText: '',
|
||||
showFeedbackIcons: false // 新增:控制赞/踩图标显示
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -123,6 +160,7 @@ export default {
|
||||
handler(newVal) {
|
||||
if (!newVal) {
|
||||
this.displayText = '';
|
||||
this.showFeedbackIcons = false; // 隐藏图标
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -130,15 +168,72 @@ export default {
|
||||
// this.startTyping(newVal); // 启动打字机效果/**/
|
||||
|
||||
this.displayText = newVal || ''
|
||||
// 文本加载完成后显示图标
|
||||
this.$nextTick(() => {
|
||||
this.showFeedbackIcons = true;
|
||||
});
|
||||
} else {
|
||||
this.displayText = this.md.render(newVal);
|
||||
this.$nextTick(this.renderMermaid); // 直接渲染 Mermaid
|
||||
this.$nextTick(() => {
|
||||
this.showFeedbackIcons = true; // 显示图标
|
||||
this.renderMermaid();
|
||||
});
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleStar(type) {
|
||||
// type: 1 表示赞,-1 表示踩,0 表示取消
|
||||
let newIsLike = 0;
|
||||
if (type === 1 && this.messageData.isLike == 1) {
|
||||
newIsLike = 0;
|
||||
} else if (type === -1 && this.messageData.isLike == -1) {
|
||||
newIsLike = 0;
|
||||
this.caiDialogShow = false;
|
||||
} else {
|
||||
newIsLike = type;
|
||||
if (type === -1) {
|
||||
this.caiDialogShow = true;
|
||||
} else {
|
||||
this.caiDialogShow = false;
|
||||
}
|
||||
}
|
||||
let params = {
|
||||
docId: this.messageData.docId,
|
||||
likeStatus: newIsLike === 0 ? '0' : newIsLike.toString(),
|
||||
}
|
||||
|
||||
likeMsg(params).then(res => {
|
||||
if(res.status ==200){
|
||||
// 更新状态
|
||||
this.$set(this.messageData, 'isLike', newIsLike)
|
||||
this.$emit('update:messageData', this.messageData)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
// 标签选择
|
||||
handleTag(item) {
|
||||
this.feedbackText = item.name
|
||||
},
|
||||
// 确定
|
||||
handleSure() {
|
||||
let params = {
|
||||
docId: this.messageData.docId,
|
||||
feedback: this.feedbackText
|
||||
}
|
||||
msgFeedback(params).then(res => {
|
||||
console.log(res);
|
||||
if(res.status ==200){
|
||||
this.$message.success('反馈成功')
|
||||
this.caiDialogShow = false
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
toUrl(item) {
|
||||
this.$router.push({
|
||||
path: '/case/detail',
|
||||
@@ -166,6 +261,7 @@ export default {
|
||||
} else {
|
||||
clearInterval(this.typingTimer);
|
||||
this.typingTimer = null;
|
||||
this.showFeedbackIcons = true; // 打字完成后显示图标
|
||||
this.$nextTick(this.renderMermaid); // 渲染 Mermaid 图表
|
||||
}
|
||||
}, this.typingSpeed);
|
||||
@@ -207,14 +303,16 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .mermaid{
|
||||
::v-deep .mermaid {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
::v-deep svg[id^="mermaid-"]{
|
||||
|
||||
::v-deep svg[id^="mermaid-"] {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.messages {
|
||||
width: 100%;
|
||||
word-wrap: break-word;
|
||||
@@ -378,7 +476,7 @@ export default {
|
||||
color: #577ee1;
|
||||
}
|
||||
|
||||
span + span {
|
||||
span+span {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
@@ -420,4 +518,32 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zan_img {
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
.feedback-class {
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
i {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-class {
|
||||
background: #f2f2f2;
|
||||
border-radius: 5px;
|
||||
padding: 3px 6px;
|
||||
color: #555;
|
||||
margin-left: 13px;
|
||||
font-size: 13px !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tag-class:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,15 +1,8 @@
|
||||
<template>
|
||||
<div class="input-area">
|
||||
<el-input
|
||||
v-model="inputContent"
|
||||
type="textarea"
|
||||
class="input-placeholder"
|
||||
placeholder="有问题,尽管问"
|
||||
@keyup.enter.native="handleSend"
|
||||
:disabled="disabled"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
resize="none"
|
||||
></el-input>
|
||||
<el-input v-model="inputContent" type="textarea" class="input-placeholder" placeholder="有问题,尽管问"
|
||||
@keyup.enter.native.prevent="handleSend" :disabled="disabled" :autosize="{ minRows: 2, maxRows: 4 }"
|
||||
resize="none"></el-input>
|
||||
<div class="action-buttons">
|
||||
<el-button type="primary" size="small" class="start-btn" @click="handleNewConversation">
|
||||
+ 开启新对话
|
||||
@@ -56,7 +49,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSend() {
|
||||
handleSend(event) {
|
||||
// 阻止事件的默认行为和冒泡
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
console.log('preventDefault');
|
||||
}
|
||||
console.log('handleSend');
|
||||
if (!this.inputContent.trim() || this.disabled) return
|
||||
// 添加用户消息到列表
|
||||
const userMessage = {
|
||||
@@ -80,9 +80,10 @@ export default {
|
||||
callAIChat(question) {
|
||||
// 创建新的AI消息对象
|
||||
const aiMessage = {
|
||||
docId: '',
|
||||
isBot: true,
|
||||
text: '',
|
||||
status:null,
|
||||
status: null,
|
||||
thinkText: '',
|
||||
caseRefers: [], // 添加caseRefers字段
|
||||
textCompleted: false // 添加文字处理完成状态,默认为false
|
||||
@@ -95,14 +96,14 @@ export default {
|
||||
query: question
|
||||
};
|
||||
// 创建POST请求
|
||||
fetch('/systemapi/xboe/m/boe/case/ai/chat',{
|
||||
fetch('/systemapi/xboe/m/boe/case/ai/chat', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"accept": "text/event-stream",
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
}).then(r=>{
|
||||
}).then(r => {
|
||||
return r
|
||||
}).then(response => {
|
||||
// 处理流式响应
|
||||
@@ -260,8 +261,8 @@ export default {
|
||||
// 累积内容并使用打字机效果更新显示
|
||||
accumulatedContent += content;
|
||||
// 如果thinkText已经显示完整,则继续使用打字机效果显示内容
|
||||
if( aiMessage.hasThink){
|
||||
if(aiMessage.thinkText.length >=accumulatedThinkContent.length){
|
||||
if (aiMessage.hasThink) {
|
||||
if (aiMessage.thinkText.length >= accumulatedThinkContent.length) {
|
||||
typeText(aiMessage, accumulatedContent);
|
||||
}
|
||||
} else {
|
||||
@@ -296,6 +297,23 @@ export default {
|
||||
this.$emit('update-message', aiMessage);
|
||||
}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
if (jsonData.docId) {
|
||||
aiMessage.docId = jsonData.docId
|
||||
this.$emit('update-message', aiMessage);
|
||||
}
|
||||
console.log(jsonData)
|
||||
break
|
||||
default:
|
||||
if (jsonData.docId) {
|
||||
aiMessage.docId = jsonData.docId
|
||||
this.$emit('update-message', aiMessage);
|
||||
}
|
||||
break
|
||||
|
||||
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('解析SSE数据错误:', error);
|
||||
|
||||
@@ -2590,7 +2590,7 @@ a.custom2 {
|
||||
}
|
||||
|
||||
.course-tags {
|
||||
margin: 5px 0;
|
||||
margin: 10px 0 0;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -2477,6 +2477,10 @@ export default {
|
||||
background-color: #f4f4f5;
|
||||
border-color: #e9e9eb;
|
||||
}
|
||||
.course-tags {
|
||||
margin: 10px 0 0;
|
||||
min-height: 20px;
|
||||
}
|
||||
.course-tags ::v-deep .el-tag .keyword-highlight,
|
||||
.course-tags ::v-deep .el-tag .exact-match-highlight {
|
||||
color: #387DF7 !important;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user