mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
Compare commits
108 Commits
20250922-c
...
20251203-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63229eea7d | ||
|
|
12e91854fe | ||
|
|
3852a92ab3 | ||
|
|
56103bbdf6 | ||
|
|
d2f3b2d79c | ||
|
|
bf20eced9b | ||
|
|
8f2da1c736 | ||
|
|
322172edec | ||
|
|
c801dc8a3d | ||
|
|
838e704ab0 | ||
|
|
d3e891e5cc | ||
|
|
40ac85f1fe | ||
|
|
6ee8eaca00 | ||
|
|
d78cc1f97c | ||
|
|
2576174e95 | ||
|
|
7316215809 | ||
|
|
c5e794ef45 | ||
|
|
720cff1d1e | ||
| f3cc59d313 | |||
|
|
dc57becb0d | ||
|
|
a94d101853 | ||
|
|
426ed75bc3 | ||
|
|
7e8b807825 | ||
|
|
bf13c953be | ||
|
|
8d07122420 | ||
|
|
471a790010 | ||
|
|
d39e1e98ef | ||
|
|
a82a65da8e | ||
|
|
2070466786 | ||
|
|
57d9f9b483 | ||
|
|
1710e34f89 | ||
|
|
e292a57b20 | ||
|
|
88c83af460 | ||
|
|
a78bac9368 | ||
|
|
f121a2aaf9 | ||
|
|
8228b33cb0 | ||
|
|
702255d9d0 | ||
|
|
df3e246d25 | ||
|
|
1d20f11861 | ||
|
|
d5ec4c1833 | ||
|
|
89a9be76d4 | ||
|
|
73026b0ab5 | ||
|
|
9b11cc3f92 | ||
|
|
372a7c22ed | ||
|
|
2678d22302 | ||
| 914b80c374 | |||
| 58f517d2fb | |||
|
|
ef9e4a0f68 | ||
|
|
a2640771fb | ||
|
|
25cb97f462 | ||
|
|
51c3d29854 | ||
|
|
c49d69dede | ||
|
|
6a764dd698 | ||
|
|
af10b1fa32 | ||
|
|
782bcc31e5 | ||
|
|
7be0bdee6c | ||
|
|
f88a3a0b53 | ||
|
|
1a95852912 | ||
|
|
48ec56dcbc | ||
|
|
f5d865ccc3 | ||
|
|
25c2e673dc | ||
|
|
78cc822464 | ||
|
|
366f1dc45b | ||
|
|
4ee6697166 | ||
|
|
a54c642f4b | ||
|
|
6a77bd9dc4 | ||
|
|
8e51663b86 | ||
|
|
cbe7981abd | ||
|
|
1ad2816622 | ||
|
|
03b3c61c6b | ||
|
|
b3756280cf | ||
|
|
f34d2a6e94 | ||
|
|
65673561d8 | ||
|
|
4d5b462b61 | ||
|
|
055476c583 | ||
|
|
78f681b4cb | ||
|
|
520fb4ee5e | ||
|
|
ba7bfe5f11 | ||
|
|
86bcf06d87 | ||
|
|
3e1b545d2a | ||
|
|
3f028e5cd8 | ||
|
|
d94bcf96a1 | ||
|
|
36b739d139 | ||
|
|
2cbb379fa6 | ||
|
|
8bf7a8e8e7 | ||
|
|
4b92308d1d | ||
|
|
a25ea0c4ba | ||
|
|
e55aa09409 | ||
|
|
5a3b57bd1c | ||
|
|
6d4af3aa2d | ||
|
|
b8ba52731f | ||
|
|
5ebee96ce4 | ||
| 408d6a1612 | |||
|
|
581be5567f | ||
|
|
c9465492f4 | ||
|
|
2c630eac70 | ||
|
|
b18500bad7 | ||
|
|
5536fc06e1 | ||
|
|
18f3804536 | ||
|
|
7230bd18e8 | ||
| b1508ad226 | |||
| a9764bf2f8 | |||
|
|
fd10d99454 | ||
|
|
a51d87fbe8 | ||
|
|
2aa36c82ab | ||
|
|
0bba87cb3d | ||
|
|
98ba239494 | ||
|
|
df3b1d7162 |
@@ -440,6 +440,12 @@ const queryCrowd=function(query){
|
|||||||
const ids=function (data){
|
const ids=function (data){
|
||||||
return ajax.postJson('/xboe/m/course/manage/ids',data);
|
return ajax.postJson('/xboe/m/course/manage/ids',data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const saveTip = function() {
|
||||||
|
return ajax.postJson('/xboe/m/course/manage/saveTip');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
saveBase,
|
saveBase,
|
||||||
submitCourse,
|
submitCourse,
|
||||||
@@ -482,6 +488,7 @@ export default {
|
|||||||
exportCourseAudit,
|
exportCourseAudit,
|
||||||
exportCourse,
|
exportCourse,
|
||||||
queryCrowd,
|
queryCrowd,
|
||||||
ids
|
ids,
|
||||||
|
saveTip
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ const findList = function(data) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const saveUpload = function(data) {
|
const saveUpload = function(data) {
|
||||||
return ajax.post('/xboe/m/course/file/upload/save', data);
|
return ajax.post('/xboe/m/course/file/upload/save', data, {
|
||||||
|
timeout: 60000
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
64
src/api/modules/courseTag.js
Normal file
64
src/api/modules/courseTag.js
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/**课程标签模块的相关处理*/
|
||||||
|
import ajax from '@/utils/xajax.js'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询:标签列表
|
||||||
|
* @param {Object} query
|
||||||
|
*/
|
||||||
|
const portalPageList = function(query) {
|
||||||
|
return ajax.post('/xboe/m/coursetag/page', query);
|
||||||
|
}
|
||||||
|
|
||||||
|
//改变标签的公共属性
|
||||||
|
const changeTagPublic = function (row){
|
||||||
|
// 返回 Promise 的 API 调用
|
||||||
|
return ajax.post('/xboe/m/coursetag/changePublicStatus', {
|
||||||
|
id: row.id,
|
||||||
|
isPublic: row.isPublic
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//改变标签的热点属性
|
||||||
|
const changeTagHot = function (row){
|
||||||
|
// 返回 Promise 的 API 调用
|
||||||
|
return ajax.post('/xboe/m/coursetag/changeHotStatus', {
|
||||||
|
id: row.id,
|
||||||
|
isHot: row.isHot
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询指定id的标签关联的所有课程
|
||||||
|
const showCourseByTag = function (query){
|
||||||
|
return ajax.post('/xboe/m/coursetag/showCourseByTag', query);
|
||||||
|
}
|
||||||
|
|
||||||
|
//解除指定id的课程和某个标签之间的关联关系
|
||||||
|
const unbindCourseTagRelation = function (params){
|
||||||
|
return ajax.post('/xboe/m/coursetag/unbind', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑课程:标签模糊查询
|
||||||
|
const searchTags = function (params){
|
||||||
|
return ajax.post('/xboe/m/coursetag/searchTags', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑课程:创建标签(与当前课程关联)
|
||||||
|
const createTag = function (params){
|
||||||
|
return ajax.post('/xboe/m/coursetag/createTag', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取最新前10个热点标签
|
||||||
|
const getHotTagList = function (params){
|
||||||
|
return ajax.post('/xboe/m/coursetag/getHotTagList', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
portalPageList,
|
||||||
|
changeTagPublic,
|
||||||
|
changeTagHot,
|
||||||
|
showCourseByTag,
|
||||||
|
unbindCourseTagRelation,
|
||||||
|
searchTags,
|
||||||
|
createTag,
|
||||||
|
getHotTagList
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 46 KiB |
BIN
src/assets/images/project/title-bg.png
Normal file
BIN
src/assets/images/project/title-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -50,7 +50,7 @@
|
|||||||
<el-input-number v-model="duration" size="mini" :min="1" :max="100"></el-input-number>
|
<el-input-number v-model="duration" size="mini" :min="1" :max="100"></el-input-number>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-upload class="upload-demo" :headers="headers" :data="data" drag :action="uploadFileUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload">
|
<el-upload ref="uploadRef" class="upload-demo" :headers="headers" :data="data" drag :action="uploadFileUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
||||||
@@ -195,6 +195,7 @@
|
|||||||
// this.cware.content.content=result.filePath;
|
// this.cware.content.content=result.filePath;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
|
this.$refs.uploadRef.clearFiles();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -41,6 +41,43 @@
|
|||||||
<el-button @click="toInputCourse()" type="primary">确定</el-button>
|
<el-button @click="toInputCourse()" type="primary">确定</el-button>
|
||||||
</span> -->
|
</span> -->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 蒙层引导组件 -->
|
||||||
|
<div v-if="showGuidance" class="guidance-overlay" @click="closeGuidance">
|
||||||
|
<div class="guidance-content">
|
||||||
|
<div class="guidance-title"></div> <!--新功能引导-->
|
||||||
|
<div class="guidance-steps">
|
||||||
|
<div class="guidance-step" :class="{ active: currentStep === 1 }">
|
||||||
|
<div class="step-number"></div>
|
||||||
|
<div class="step-content">
|
||||||
|
<div class="step-title">用标签为课程精准定位,吸引更多学员!可从以下维度构思:</div>
|
||||||
|
<div class="step-desc" style="padding-left: 20px;">✨ 讲领域(如:品质管理)</div>
|
||||||
|
<div class="step-desc" style="padding-left: 20px;">✨ 教技能(如:沟通技巧)</div>
|
||||||
|
<div class="step-desc" style="padding-left: 20px;">✨ 涉内容(如:5W1H分析法)</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="guidance-step" :class="{ active: currentStep === 2 }">
|
||||||
|
<div class="step-number">2</div>
|
||||||
|
<div class="step-content">
|
||||||
|
<div class="step-title">添加课程标签</div>
|
||||||
|
<div class="step-desc">为课程添加相关标签,最多5个,便于搜索和分类,可回车创建新标签</div>
|
||||||
|
</div>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
<!-- <div class="guidance-actions">
|
||||||
|
<el-button @click="previousStep1" v-if="currentStep > 1">上一步</el-button>
|
||||||
|
<el-button type="primary" @click="nextStep">
|
||||||
|
{{ currentStep === 2 ? '完成' : '下一步' }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="closeGuidance">跳过引导</el-button>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 高亮指引元素 -->
|
||||||
|
<!-- <div v-if="showGuidance" class="highlight-element" :style="highlightStyle"></div>-->
|
||||||
|
|
||||||
|
|
||||||
<!--微课-->
|
<!--微课-->
|
||||||
<el-dialog v-if="weike.dlgShow" width="980px" :title="curCourseId == '' ? '新建课程' : '编辑课程'" :visible.sync="weike.dlgShow" :close-on-click-modal="false" custom-class="g-dialog" top="8vh">
|
<el-dialog v-if="weike.dlgShow" width="980px" :title="curCourseId == '' ? '新建课程' : '编辑课程'" :visible.sync="weike.dlgShow" :close-on-click-modal="false" custom-class="g-dialog" top="8vh">
|
||||||
<el-form label-width="100px" size="small" class="wei-from" style="min-height: 600px;">
|
<el-form label-width="100px" size="small" class="wei-from" style="min-height: 600px;">
|
||||||
@@ -71,8 +108,22 @@
|
|||||||
clearable
|
clearable
|
||||||
v-model="sysTypeList"
|
v-model="sysTypeList"
|
||||||
:props="{ value: 'id', label: 'name' }"
|
:props="{ value: 'id', label: 'name' }"
|
||||||
:options="sysTypeListMap"></el-cascader>
|
:options="sysTypeListMap"
|
||||||
|
@focus="onContentTypeFocus"
|
||||||
|
@change="onContentTypeChange">
|
||||||
|
</el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="标签" required class="guidance-highlight" data-step="1" style="display: flex" >
|
||||||
|
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList"
|
||||||
|
:initialTags="courseTags" @change="handleTagsChange"
|
||||||
|
@focus="onTagFocus" style="width: 95%;">
|
||||||
|
</courseTag>
|
||||||
|
<el-tooltip content="点击查看标签新功能引导" placement="top">
|
||||||
|
<i class="el-icon-question" style="color: #409EFF; cursor: pointer;" @click="handleTagHelp"></i>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="资源归属" required>
|
<el-form-item label="资源归属" required>
|
||||||
<el-input placeholder="请选择" v-model="orgName" >
|
<el-input placeholder="请选择" v-model="orgName" >
|
||||||
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
|
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
|
||||||
@@ -141,7 +192,6 @@
|
|||||||
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="1">PC端可见</el-radio>
|
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="1">PC端可见</el-radio>
|
||||||
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="2">移动端可见</el-radio>
|
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="2">移动端可见</el-radio>
|
||||||
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="3">多端可见</el-radio>
|
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" :label="3">多端可见</el-radio>
|
||||||
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" v-if="isPermission" :label="4">仅内网访问</el-radio>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="!weike.onlyRequired" label="课程来源">
|
<el-form-item v-if="!weike.onlyRequired" label="课程来源">
|
||||||
<el-radio-group v-model="courseInfo.source">
|
<el-radio-group v-model="courseInfo.source">
|
||||||
@@ -226,7 +276,9 @@
|
|||||||
clearable
|
clearable
|
||||||
v-model="sysTypeList"
|
v-model="sysTypeList"
|
||||||
:props="{ value: 'id', label: 'name' }"
|
:props="{ value: 'id', label: 'name' }"
|
||||||
:options="sysTypeListMap">
|
:options="sysTypeListMap"
|
||||||
|
@focus="onContentTypeFocus"
|
||||||
|
@change="onContentTypeChange">
|
||||||
</el-cascader>
|
</el-cascader>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -254,6 +306,16 @@
|
|||||||
</el-select> -->
|
</el-select> -->
|
||||||
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
|
<choice :teacherValue="teacherValues" @getTeacherList="getTeacherList"></choice>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="标签" required class="tag-from-item" data-step="1" >
|
||||||
|
<courseTag ref="courseTag" :courseId="curCourseId" :sysTypeList="sysTypeList"
|
||||||
|
:initialTags="courseTags" @change="handleTagsChange"
|
||||||
|
@focus="onTagFocus" >
|
||||||
|
</courseTag>
|
||||||
|
<el-tooltip content="点击查看标签新功能引导" placement="top">
|
||||||
|
<i class="el-icon-question" style="color: #409EFF; cursor: pointer;" @click="handleTagHelp"></i>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="关键字">
|
<el-form-item label="关键字">
|
||||||
<el-input v-model.trim="keywords" maxlength="100" @keyup.enter.native="changeKeywords" placeholder="请输入关键字"></el-input>
|
<el-input v-model.trim="keywords" maxlength="100" @keyup.enter.native="changeKeywords" placeholder="请输入关键字"></el-input>
|
||||||
<el-tag v-for="(tag,index) in tips" size="small" :key="index" closable type="info" @close="closeKeywordsTag(tag,index)">
|
<el-tag v-for="(tag,index) in tips" size="small" :key="index" closable type="info" @close="closeKeywordsTag(tag,index)">
|
||||||
@@ -306,7 +368,6 @@
|
|||||||
<el-radio v-model="courseInfo.device" :label="1">PC端可见</el-radio>
|
<el-radio v-model="courseInfo.device" :label="1">PC端可见</el-radio>
|
||||||
<el-radio v-model="courseInfo.device" :label="2">移动端可见</el-radio>
|
<el-radio v-model="courseInfo.device" :label="2">移动端可见</el-radio>
|
||||||
<el-radio v-model="courseInfo.device" :label="3">多端可见</el-radio>
|
<el-radio v-model="courseInfo.device" :label="3">多端可见</el-radio>
|
||||||
<el-radio style="margin-right: 10px;" v-model="courseInfo.device" v-if="isPermission" :label="4">仅内网访问</el-radio>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="10">
|
<el-col :span="10">
|
||||||
<el-form-item label="课程来源">
|
<el-form-item label="课程来源">
|
||||||
@@ -404,6 +465,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import courseTag from "@/components/Course/courseTag.vue";
|
||||||
import choice from '@/components/Course/choice.vue';
|
import choice from '@/components/Course/choice.vue';
|
||||||
import agreement from '@/components/Portal/agreement.vue';
|
import agreement from '@/components/Portal/agreement.vue';
|
||||||
import weikeContent from '@/components/Course/weikeContent.vue';
|
import weikeContent from '@/components/Course/weikeContent.vue';
|
||||||
@@ -420,6 +482,7 @@ import apiCourse from '../../api/modules/course.js';
|
|||||||
import apiCourseAudit from '../../api/modules/courseAudit.js';
|
import apiCourseAudit from '../../api/modules/courseAudit.js';
|
||||||
import apiOrg from '../../api/system/organiza.js';
|
import apiOrg from '../../api/system/organiza.js';
|
||||||
import apiUser from '../../api/system/user.js';
|
import apiUser from '../../api/system/user.js';
|
||||||
|
import apiCourseTag from '../../api/modules/courseTag.js';
|
||||||
import WxEditor from '@/components/Editor/index.vue';
|
import WxEditor from '@/components/Editor/index.vue';
|
||||||
import catalogSort from '@/components/Course/catalogSort.vue';
|
import catalogSort from '@/components/Course/catalogSort.vue';
|
||||||
import { courseType, getType } from '../../utils/tools.js';
|
import { courseType, getType } from '../../utils/tools.js';
|
||||||
@@ -428,7 +491,7 @@ import filecloud from '@/components/FileCloud/index.vue';
|
|||||||
import chooseOrg from '@/components/System/chooseOrg.vue';
|
import chooseOrg from '@/components/System/chooseOrg.vue';
|
||||||
export default {
|
export default {
|
||||||
props: {},
|
props: {},
|
||||||
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg},
|
components: { courseTag, weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
keywords:'',//关键字的定义
|
keywords:'',//关键字的定义
|
||||||
@@ -468,6 +531,7 @@ export default {
|
|||||||
orgName:'',
|
orgName:'',
|
||||||
orgNamePath:'',
|
orgNamePath:'',
|
||||||
orgKid:'',
|
orgKid:'',
|
||||||
|
courseTags:[],
|
||||||
courseInfo: {
|
courseInfo: {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
@@ -490,8 +554,6 @@ export default {
|
|||||||
refType:''
|
refType:''
|
||||||
},
|
},
|
||||||
visibleShow:false,
|
visibleShow:false,
|
||||||
isPermission:false,
|
|
||||||
dicts:[],
|
|
||||||
extendRefId:'',
|
extendRefId:'',
|
||||||
extendRefType:'',
|
extendRefType:'',
|
||||||
courseTeachers: [], //课程的老师
|
courseTeachers: [], //课程的老师
|
||||||
@@ -532,10 +594,12 @@ export default {
|
|||||||
},
|
},
|
||||||
rightTypeId: {},
|
rightTypeId: {},
|
||||||
catalogSortDialogShow: false,
|
catalogSortDialogShow: false,
|
||||||
selectedOrg: {
|
// 蒙层引导相关数据
|
||||||
orgId: null,
|
showGuidance: false,
|
||||||
name: ''
|
currentStep: 1,
|
||||||
}
|
highlightStyle: {},
|
||||||
|
guidanceElements: [],
|
||||||
|
isFirstCreate: false, // 标记是否为首次创建
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -560,18 +624,14 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
courseInfo: {
|
courseInfo: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal) {
|
||||||
//需要保存
|
//需要保存
|
||||||
this.requireSaveCourse = true;
|
this.requireSaveCourse = true;
|
||||||
|
|
||||||
console.log("--- watch比较 = ", oldVal.orgId, newVal.orgId);
|
|
||||||
this.checkOrgPermission(newVal.orgId);
|
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDictIds();
|
|
||||||
let extendFlag=this.$route.query.f; //是否是管理端过来的
|
let extendFlag=this.$route.query.f; //是否是管理端过来的
|
||||||
this.extendRefId=this.$route.query.refId;
|
this.extendRefId=this.$route.query.refId;
|
||||||
this.extendRefType=this.$route.query.refType;
|
this.extendRefType=this.$route.query.refType;
|
||||||
@@ -593,18 +653,8 @@ export default {
|
|||||||
this.loadUserGroup();
|
this.loadUserGroup();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检查机构权限
|
handleTagHelp(){
|
||||||
checkOrgPermission(orgId) {
|
this.checkAndShowGuidance();
|
||||||
console.log("--- 监测组织id orgId = ",orgId)
|
|
||||||
console.log("--- this.isPermission = ",this.isPermission)
|
|
||||||
console.log("--- device = ",this.courseInfo.device)
|
|
||||||
if (!orgId) {
|
|
||||||
this.isPermission = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("--- this.dicts = ",this.dicts)
|
|
||||||
this.isPermission = this.dicts.includes(orgId);
|
|
||||||
console.log("--- 监听结束 this.isPermission = ",this.isPermission)
|
|
||||||
},
|
},
|
||||||
// 关键字的更改
|
// 关键字的更改
|
||||||
changeKeywords(option){
|
changeKeywords(option){
|
||||||
@@ -617,6 +667,24 @@ export default {
|
|||||||
closeKeywordsTag(item,index){
|
closeKeywordsTag(item,index){
|
||||||
this.tips.splice(index, 1);
|
this.tips.splice(index, 1);
|
||||||
},
|
},
|
||||||
|
// 处理标签变化事件
|
||||||
|
handleTagsChange(tags) {
|
||||||
|
console.log("父组件:",tags)
|
||||||
|
// 限制最多5个标签
|
||||||
|
if (tags.length > 5) {
|
||||||
|
this.$message.warning('最多只能选择5个标签')
|
||||||
|
// 强制限制为5个
|
||||||
|
tags = tags.slice(0, 5);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let ids = "";
|
||||||
|
tags.forEach(tag=>{
|
||||||
|
console.log("父组件name : ",tag.tagName)
|
||||||
|
ids += tag.id + ',';
|
||||||
|
})
|
||||||
|
this.courseInfo.tags = ids;
|
||||||
|
this.$emit('change', tags.slice(0, 5)); // 确保传出数据也不超过5个
|
||||||
|
},
|
||||||
showChooseOrg(){
|
showChooseOrg(){
|
||||||
this.$refs.refChooseOrg.dlgShow = true;
|
this.$refs.refChooseOrg.dlgShow = true;
|
||||||
},
|
},
|
||||||
@@ -747,6 +815,7 @@ export default {
|
|||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
initShow(editData) {
|
initShow(editData) {
|
||||||
|
console.log('初始化显示内容============', editData)
|
||||||
//console.log(this.$refs.weikePanel,'this.$refs.weikePanel');
|
//console.log(this.$refs.weikePanel,'this.$refs.weikePanel');
|
||||||
//this.$refs.weikePanel.init();
|
//this.$refs.weikePanel.init();
|
||||||
//this.$refs.onlineCourse.resetData();
|
//this.$refs.onlineCourse.resetData();
|
||||||
@@ -794,6 +863,8 @@ export default {
|
|||||||
this.tips=[];
|
this.tips=[];
|
||||||
|
|
||||||
if (!editData) {
|
if (!editData) {
|
||||||
|
this.tips=[];
|
||||||
|
this.courseTags=[],
|
||||||
//console.log("新建课程?");
|
//console.log("新建课程?");
|
||||||
//以下为了保证初始化处理
|
//以下为了保证初始化处理
|
||||||
this.weikeReset = Math.round(Math.random()) + '';
|
this.weikeReset = Math.round(Math.random()) + '';
|
||||||
@@ -844,7 +915,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
resetCurCourseContent() {
|
resetCurCourseContent() {
|
||||||
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentName: '', contentRefId: '', courseId: this.courseInfo.id };
|
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentRefId: '', courseId: this.courseInfo.id };
|
||||||
},
|
},
|
||||||
// chooseCourseType(item, idx, open) {
|
// chooseCourseType(item, idx, open) {
|
||||||
// this.courseChooseId = item.id;
|
// this.courseChooseId = item.id;
|
||||||
@@ -890,16 +961,117 @@ export default {
|
|||||||
if (rs.status == 200) {
|
if (rs.status == 200) {
|
||||||
this.courseChooseShow = false;
|
this.courseChooseShow = false;
|
||||||
this.courseInfo = rs.result;
|
this.courseInfo = rs.result;
|
||||||
|
this.curCourseId = this.courseInfo.id
|
||||||
|
console.log('保存课程成功',this.curCourseId)
|
||||||
|
console.log('isTip ',this.courseInfo.isTip)
|
||||||
|
// if(this.courseInfo.isTip){
|
||||||
|
// // 检查是否为首次创建,显示引导
|
||||||
|
// this.checkAndShowGuidance();
|
||||||
|
// }
|
||||||
|
|
||||||
if (this.courseChooseId == 1) {
|
if (this.courseChooseId == 1) {
|
||||||
this.weike.dlgShow = true;
|
this.weike.dlgShow = true;
|
||||||
} else {
|
} else {
|
||||||
this.biaoke.dlgShow = true;
|
this.biaoke.dlgShow = true;
|
||||||
}
|
}
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.initTagComponent();
|
||||||
|
// // 如果显示引导,初始化高亮元素
|
||||||
|
// if (this.showGuidance) {
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.initGuidanceElements();
|
||||||
|
// this.highlightCurrentStep();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(rs.message);
|
this.$message.error(rs.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 检查并显示引导
|
||||||
|
checkAndShowGuidance() {
|
||||||
|
// 检查本地存储,判断是否为首次创建
|
||||||
|
// const hasShownGuidance = localStorage.getItem('course_creation_guidance_shown');
|
||||||
|
// if (!hasShownGuidance) {
|
||||||
|
this.showGuidance = true;
|
||||||
|
this.currentStep = 1;
|
||||||
|
this.isFirstCreate = true;
|
||||||
|
// 标记引导已显示
|
||||||
|
localStorage.setItem('course_creation_guidance_shown', 'true');
|
||||||
|
// apiCourse.saveTip();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
// 初始化引导元素
|
||||||
|
initGuidanceElements() {
|
||||||
|
this.guidanceElements = Array.from(document.querySelectorAll('.guidance-highlight'));
|
||||||
|
},
|
||||||
|
|
||||||
|
// 高亮当前步骤对应的元素
|
||||||
|
highlightCurrentStep() {
|
||||||
|
if (this.guidanceElements.length === 0) return;
|
||||||
|
|
||||||
|
const currentElement = this.guidanceElements[this.currentStep - 1];
|
||||||
|
if (currentElement) {
|
||||||
|
currentElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 下一步
|
||||||
|
nextStep() {
|
||||||
|
if (this.currentStep < 2) {
|
||||||
|
this.currentStep++;
|
||||||
|
this.highlightCurrentStep();
|
||||||
|
} else {
|
||||||
|
this.closeGuidance();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 上一步
|
||||||
|
previousStep1() {
|
||||||
|
if (this.currentStep > 1) {
|
||||||
|
this.currentStep--;
|
||||||
|
this.highlightCurrentStep();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 关闭引导
|
||||||
|
closeGuidance() {
|
||||||
|
this.showGuidance = false;
|
||||||
|
this.currentStep = 1;
|
||||||
|
this.highlightStyle = {};
|
||||||
|
},
|
||||||
|
// 内容分类获得焦点时的处理
|
||||||
|
onContentTypeFocus() {
|
||||||
|
if (this.showGuidance && this.currentStep === 1) {
|
||||||
|
this.currentStep = 2;
|
||||||
|
this.highlightCurrentStep();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 内容分类改变时的处理
|
||||||
|
onContentTypeChange() {
|
||||||
|
if (this.showGuidance && this.currentStep === 1) {
|
||||||
|
this.currentStep = 2;
|
||||||
|
this.highlightCurrentStep();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 标签获得焦点时的处理
|
||||||
|
onTagFocus() {
|
||||||
|
if (this.showGuidance && this.currentStep === 2) {
|
||||||
|
this.closeGuidance();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增初始化标签方法
|
||||||
|
initTagComponent() {
|
||||||
|
if (this.$refs.courseTag) {
|
||||||
|
// 确保组件已渲染后再调用搜索
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.courseTag.debouncedSearch('');
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
},
|
||||||
//上传课程图片处理
|
//上传课程图片处理
|
||||||
uploadCoverImgSuccess(res) {
|
uploadCoverImgSuccess(res) {
|
||||||
//console.log(res,'res');
|
//console.log(res,'res');
|
||||||
@@ -910,30 +1082,16 @@ export default {
|
|||||||
this.courseCoverurl = '';
|
this.courseCoverurl = '';
|
||||||
this.courseInfo.coverImg = '';
|
this.courseInfo.coverImg = '';
|
||||||
},
|
},
|
||||||
//获取字典信息
|
|
||||||
async getDictIds() {
|
|
||||||
console.log("--- 获取字典信息 1 = ", this.dicts);
|
|
||||||
try {
|
|
||||||
const response = await apiCourse.getDictIds(637, 1); // 确保返回 Promise
|
|
||||||
console.log("--- 获取字典信息 2 result= ", response);
|
|
||||||
|
|
||||||
if (response.status === 200) {
|
|
||||||
this.dicts = response.result.dicts; // 正确提取 dicts
|
|
||||||
console.log("--- 获取字典信息 3 = ", this.dicts);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("获取字典信息失败:", error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//获取课程信息
|
//获取课程信息
|
||||||
async getDetail(id) {
|
async getDetail(id) {
|
||||||
this.curCourseId = id;
|
this.curCourseId = id;
|
||||||
this.orgName='';
|
this.orgName='';
|
||||||
this.isPermission = false;
|
|
||||||
let $this = this;
|
let $this = this;
|
||||||
try {
|
try {
|
||||||
const { result, status } = await apiCourse.detail(id);
|
const { result, status } = await apiCourse.detail(id);
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
|
this.courseTags = result.tagList;
|
||||||
|
console.log('获取课程信息成功', this.courseTags);
|
||||||
//把数据附给三个对象
|
//把数据附给三个对象
|
||||||
if(result.course.visible==''){
|
if(result.course.visible==''){
|
||||||
result.course.visible=false;
|
result.course.visible=false;
|
||||||
@@ -947,10 +1105,7 @@ export default {
|
|||||||
this.contentInfo.list = result.contents;
|
this.contentInfo.list = result.contents;
|
||||||
this.sectionInfo.list = result.sections;
|
this.sectionInfo.list = result.sections;
|
||||||
this.courseTeachers = result.teachers; //课程的老师信息
|
this.courseTeachers = result.teachers; //课程的老师信息
|
||||||
this.isPermission = result.isPermission; //课程的老师信息
|
|
||||||
this.dicts = result.dicts; //课程的老师信息
|
|
||||||
console.log("--- 编辑查看 this.isPermission = ",this.isPermission)
|
|
||||||
console.log("--- 编辑查看 this.dicts = ",this.dicts)
|
|
||||||
if(!this.courseInfo.orgId){
|
if(!this.courseInfo.orgId){
|
||||||
//根据课程创建者获取机构id
|
//根据课程创建者获取机构id
|
||||||
apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{
|
apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{
|
||||||
@@ -1002,7 +1157,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resOwnerArray=[];
|
this.resOwnerArray=[];
|
||||||
if (result.course.resOwner1 == '') {
|
if (result.course.resOwner1 == '') {
|
||||||
this.resOwnerArray.push(result.course.resOwner1);
|
this.resOwnerArray.push(result.course.resOwner1);
|
||||||
@@ -1222,12 +1376,17 @@ export default {
|
|||||||
},
|
},
|
||||||
//保存课程信息并进入下一步
|
//保存课程信息并进入下一步
|
||||||
saveAndNext(btnType) {
|
saveAndNext(btnType) {
|
||||||
|
console.log("courseForm 保存课程信息 btnType = " + btnType);
|
||||||
//if(this.courseInfo.type)
|
//if(this.courseInfo.type)
|
||||||
//console.log(this.courseCrowds,'courseCrowds');
|
//console.log(this.courseCrowds,'courseCrowds');
|
||||||
//标签,多个,转化为逗号分隔的
|
//标签,多个,转化为逗号分隔的
|
||||||
if (this.showTags.length > 0) {
|
|
||||||
this.courseInfo.tags = this.showTags.join();
|
console.log("courseForm 保存课程信息 this.showTags = " + this.showTags);
|
||||||
}
|
console.log("courseForm 保存课程信息 this.courseInfo.tags = " + this.courseInfo.tags);
|
||||||
|
// if (this.showTags.length > 0) {
|
||||||
|
// this.courseInfo.tags = this.courseInfo.tags.join();
|
||||||
|
// }
|
||||||
|
// console.log("courseForm 保存课程信息 this.courseInfo.tags = " + this.courseInfo.tags);
|
||||||
this.courseInfo.keywords = this.tips.join(',') || ''
|
this.courseInfo.keywords = this.tips.join(',') || ''
|
||||||
//检查输入是否合法
|
//检查输入是否合法
|
||||||
//if(!this.requireSaveCourse){
|
//if(!this.requireSaveCourse){
|
||||||
@@ -1287,7 +1446,7 @@ export default {
|
|||||||
teachers: saveTeachers,
|
teachers: saveTeachers,
|
||||||
crowds:crowds
|
crowds:crowds
|
||||||
};
|
};
|
||||||
//console.log(postData);
|
console.log(postData);
|
||||||
//this.btnLoading=false;
|
//this.btnLoading=false;
|
||||||
apiCourse
|
apiCourse
|
||||||
.saveBase(postData)
|
.saveBase(postData)
|
||||||
@@ -1410,6 +1569,9 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
submitCourse() {
|
submitCourse() {
|
||||||
|
console.log("courseForm 课程提交审核 this.showTags = " + this.showTags);
|
||||||
|
console.log("courseForm 课程提交审核 this.courseInfo.tags = " + this.courseInfo.tags);
|
||||||
|
|
||||||
if(this.biaoke.dlgShow && !this.unsavedContent()){
|
if(this.biaoke.dlgShow && !this.unsavedContent()){
|
||||||
this.$message.error('您有未保存的内容,请先保存');
|
this.$message.error('您有未保存的内容,请先保存');
|
||||||
return;
|
return;
|
||||||
@@ -1447,7 +1609,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.showTags.length > 0) {
|
if (this.showTags.length > 0) {
|
||||||
this.courseInfo.tags = this.showTags.join();
|
// this.courseInfo.tags = this.showTags.join();
|
||||||
}
|
}
|
||||||
if (this.sysTypeList.length < 1) {
|
if (this.sysTypeList.length < 1) {
|
||||||
this.$message.error('请选择内容分类');
|
this.$message.error('请选择内容分类');
|
||||||
@@ -1807,4 +1969,126 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 蒙层样式 */
|
||||||
|
.guidance-overlay {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
z-index: 9999;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-content {
|
||||||
|
position: fixed;
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 24px;
|
||||||
|
max-width: 500px;
|
||||||
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
||||||
|
z-index: 10000;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-title {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-steps {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-step {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
opacity: 0.5;
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-step.active {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-number {
|
||||||
|
//width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
//background: #409EFF;
|
||||||
|
color: white;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-title {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-desc {
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.guidance-actions {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 高亮元素样式 */
|
||||||
|
.highlight-element {
|
||||||
|
position: fixed;
|
||||||
|
border: 2px solid #409EFF;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 15px rgba(64, 158, 255, 0.5);
|
||||||
|
z-index: 9998;
|
||||||
|
pointer-events: none;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 被高亮元素的样式 */
|
||||||
|
.guidance-highlight {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10001;
|
||||||
|
}
|
||||||
|
//.el-form-item__content {
|
||||||
|
// display: flex;
|
||||||
|
// width: 80%;
|
||||||
|
// .tag-container {
|
||||||
|
// width: 95%;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
.tag-from-item .el-form-item__content {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
display: flex;
|
||||||
|
//align-items: center;
|
||||||
|
.tag-container {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.guidance-highlight .el-form-item__content {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
display: flex;
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
400
src/components/Course/courseTag.vue
Normal file
400
src/components/Course/courseTag.vue
Normal file
@@ -0,0 +1,400 @@
|
|||||||
|
<template>
|
||||||
|
<div class="tag-container" @click="handleContainerClick">
|
||||||
|
<el-select style="width: 100%;"
|
||||||
|
v-model="selectedTags"
|
||||||
|
multiple
|
||||||
|
filterable
|
||||||
|
value-key="id"
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
:remote-method="debouncedSearch"
|
||||||
|
:loading="loading"
|
||||||
|
:placeholder="'回车创建新标签'"
|
||||||
|
:no-data-text="'无此标签,按回车键创建'"
|
||||||
|
@remove-tag="handleTagRemove"
|
||||||
|
@change="handleSelectionChange"
|
||||||
|
@keyup.enter.native="handleEnterKey"
|
||||||
|
@keyup.delete.native="handleDeleteKey"
|
||||||
|
@focus="handleFocus"
|
||||||
|
ref="tagSelect"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in searchResults"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.tagName"
|
||||||
|
:value="item"
|
||||||
|
:disabled="isTagDisabled(item)"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<!-- 添加标签计数显示 -->
|
||||||
|
<div class="tag-count">
|
||||||
|
{{ selectedTags.length }}/5
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { debounce } from 'lodash'
|
||||||
|
import apiCourseTag from '@/api/modules/courseTag.js'
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
courseId:{
|
||||||
|
type:String,
|
||||||
|
require:true,
|
||||||
|
},
|
||||||
|
sysTypeList:{
|
||||||
|
type:Array,
|
||||||
|
require:true,
|
||||||
|
default: []
|
||||||
|
},
|
||||||
|
maxTags: {
|
||||||
|
type: Number,
|
||||||
|
default: 5
|
||||||
|
},
|
||||||
|
// 添加:接收初始标签数据的props
|
||||||
|
initialTags: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectedTags: [],
|
||||||
|
searchResults: [],
|
||||||
|
loading: false,
|
||||||
|
tagMap: new Map(),
|
||||||
|
inputBuffer: '',
|
||||||
|
params: {},
|
||||||
|
tag: {},
|
||||||
|
// 添加临时存储用于回滚
|
||||||
|
previousTags: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
displayTags() {
|
||||||
|
return this.selectedTags.map(tag =>
|
||||||
|
typeof tag === 'object' ? tag : this.tagMap.get(tag)
|
||||||
|
).filter(Boolean)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.debouncedSearch = debounce(this.doSearch, 500)
|
||||||
|
console.log("----------sysTypeList.length---------->"+this.sysTypeList.length)
|
||||||
|
console.log("----------sysTypeList.length---------->"+(this.sysTypeList.length===0))
|
||||||
|
},
|
||||||
|
// 添加:挂载时初始化标签数据
|
||||||
|
mounted() {
|
||||||
|
if (this.initialTags && this.initialTags.length > 0) {
|
||||||
|
this.selectedTags = this.initialTags;
|
||||||
|
this.searchResults = this.initialTags;
|
||||||
|
// 将初始标签添加到tagMap中,确保删除功能正常
|
||||||
|
this.initialTags.forEach(tag => {
|
||||||
|
if (tag.id) {
|
||||||
|
this.tagMap.set(tag.id, tag);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听课程ID变化,重置所有状态
|
||||||
|
courseId(newVal) {
|
||||||
|
this.resetTagState();
|
||||||
|
},
|
||||||
|
// 监听初始标签变化,重新加载
|
||||||
|
initialTags(newVal) {
|
||||||
|
this.selectedTags = newVal || [];
|
||||||
|
this.searchResults = newVal || [];
|
||||||
|
this.tagMap.clear(); // 清空旧缓存
|
||||||
|
newVal.forEach(tag => {
|
||||||
|
if (tag.id) this.tagMap.set(tag.id, tag);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听分类变化,重新加载搜索结果
|
||||||
|
sysTypeList: {
|
||||||
|
handler() {
|
||||||
|
// 只有在已选择分类且有焦点时才重新加载
|
||||||
|
if (this.sysTypeList.length > 0 && this.$refs.tagSelect && this.$refs.tagSelect.visible) {
|
||||||
|
this.doSearch('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 新增:检查标签是否应该被禁用
|
||||||
|
isTagDisabled(tag) {
|
||||||
|
// 如果标签已经被选中,不应该禁用(允许取消选择)
|
||||||
|
const isSelected = this.selectedTags.some(selectedTag => selectedTag.id === tag.id);
|
||||||
|
if (isSelected) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 如果标签未被选中且已达到最大数量,则禁用
|
||||||
|
return this.selectedTags.length >= this.maxTags;
|
||||||
|
},
|
||||||
|
// 新增:处理输入框获得焦点事件
|
||||||
|
async handleFocus() {
|
||||||
|
this.previousTags = [...this.selectedTags];
|
||||||
|
// 当输入框获得焦点时,加载默认的搜索结果
|
||||||
|
if (this.sysTypeList.length > 0) {
|
||||||
|
await this.doSearch('');
|
||||||
|
}
|
||||||
|
this.$emit('focus');
|
||||||
|
},
|
||||||
|
handleContainerClick() {
|
||||||
|
// 容器点击时也触发焦点事件
|
||||||
|
this.$emit('focus');
|
||||||
|
},
|
||||||
|
// 新增:重置标签状态的方法
|
||||||
|
resetTagState() {
|
||||||
|
this.selectedTags = [];
|
||||||
|
this.searchResults = [];
|
||||||
|
this.tagMap.clear();
|
||||||
|
this.loading = false;
|
||||||
|
this.params = {};
|
||||||
|
},
|
||||||
|
handleTagRemove(tagId) {
|
||||||
|
this.selectedTags = this.selectedTags.filter(id => id !== tagId)
|
||||||
|
this.$emit('change', this.displayTags)
|
||||||
|
this.clearInput();
|
||||||
|
},
|
||||||
|
removeTag(tagId) {
|
||||||
|
this.handleTagRemove(tagId)
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增:处理删除键事件
|
||||||
|
handleDeleteKey(event) {
|
||||||
|
// 如果输入框内容为空,不执行任何搜索
|
||||||
|
if (!event.target.value.trim()) {
|
||||||
|
this.searchResults = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//按回车键,创建新标签
|
||||||
|
handleEnterKey(event) {
|
||||||
|
const inputVal = event.target.value?.trim()
|
||||||
|
if (!inputVal) return;
|
||||||
|
// 检查是否与已选择的标签重复
|
||||||
|
const isDuplicate = this.selectedTags.some(tag => tag.tagName === inputVal);
|
||||||
|
if (isDuplicate) {
|
||||||
|
this.$message.warning('该标签已存在,无需重复创建');
|
||||||
|
event.target.value = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!isDuplicate && inputVal && this.selectedTags.length < this.maxTags) {
|
||||||
|
this.createNewTag(event.target.value.trim())
|
||||||
|
this.clearInput();
|
||||||
|
} else if (this.selectedTags.length >= this.maxTags) {
|
||||||
|
this.$message.warning('最多只能添加5个标签')
|
||||||
|
this.clearInput();
|
||||||
|
} else {
|
||||||
|
this.clearInput();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增:处理选择变化事件
|
||||||
|
handleSelectionChange(newValues) {
|
||||||
|
|
||||||
|
// 检查每个标签对象是否完整
|
||||||
|
newValues.forEach((tag, index) => {
|
||||||
|
if (!tag.tagName) {
|
||||||
|
console.error(`第${index}个标签缺少tagName:`, tag);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 检查数量限制
|
||||||
|
if (newValues.length > this.maxTags) {
|
||||||
|
this.$message.warning(`最多只能选择${this.maxTags}个标签`);
|
||||||
|
// 回滚到之前的状态
|
||||||
|
this.selectedTags = [...this.previousTags];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新前保存当前状态
|
||||||
|
this.previousTags = [...newValues];
|
||||||
|
this.$emit('change', this.displayTags);
|
||||||
|
|
||||||
|
this.clearInput();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.tagSelect.visible = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
clearInput() {
|
||||||
|
if (this.$refs.tagSelect) {
|
||||||
|
const input = this.$refs.tagSelect.$refs.input;
|
||||||
|
if (input) {
|
||||||
|
input.value = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//创建新标签
|
||||||
|
async createNewTag(tagName) {
|
||||||
|
// 标签不能超过八个字
|
||||||
|
if (tagName.length > 8) {
|
||||||
|
this.$message.error('标签不能超过8个字')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 检查标签是否在下拉框中已存在
|
||||||
|
const isExistInSearch = this.searchResults.some(tag => tag.tagName === tagName);
|
||||||
|
if (isExistInSearch) {
|
||||||
|
this.$message.warning('已存在此标签,请选择');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 首先检查是否与已选择的标签重复
|
||||||
|
const isDuplicate = this.selectedTags.some(tag => tag.tagName === tagName);
|
||||||
|
if (isDuplicate) {
|
||||||
|
this.$message.warning('该标签已存在,无需重复创建');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 标签格式验证:仅支持中文、英文、数字、下划线、中横线
|
||||||
|
const tagPattern = /^[\u4e00-\u9fa5a-zA-Z0-9_-]+$/;
|
||||||
|
if (!tagPattern.test(tagName)) {
|
||||||
|
this.$message.error('标签名称仅支持中文、英文、数字、下划线(_)和中横线(-),不支持空格、点和特殊字符');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加标签数量限制检查
|
||||||
|
if (this.selectedTags.length >= this.maxTags) {
|
||||||
|
this.$message.warning('最多只能添加5个标签')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
this.params.courseId = this.courseId;
|
||||||
|
this.params.tagName = tagName;
|
||||||
|
// 分类
|
||||||
|
if (this.sysTypeList.length > 0) {
|
||||||
|
this.params.sysType1 = this.sysTypeList[0]; //一级的id
|
||||||
|
}
|
||||||
|
if (this.sysTypeList.length > 1) {
|
||||||
|
this.params.sysType2 = this.sysTypeList[1]; //二级的id
|
||||||
|
}
|
||||||
|
if (this.sysTypeList.length > 2) {
|
||||||
|
this.params.sysType3 = this.sysTypeList[2]; //三级的id
|
||||||
|
}
|
||||||
|
const {result:newTag} = await apiCourseTag.createTag(this.params)
|
||||||
|
this.$message.success('标签创建成功',newTag);
|
||||||
|
|
||||||
|
this.selectedTags = [...this.selectedTags, newTag];
|
||||||
|
// 更新搜索结果的逻辑保持不变
|
||||||
|
this.searchResults = [newTag, ...this.searchResults];
|
||||||
|
this.tagMap.set(newTag.id, newTag)
|
||||||
|
this.$emit('change', this.displayTags)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// 强制重新设置selectedTags来触发更新
|
||||||
|
const tempTags = [...this.selectedTags];
|
||||||
|
this.selectedTags = [];
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.selectedTags = tempTags;
|
||||||
|
});
|
||||||
|
this.$refs.tagSelect.visible = false;
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 修改doSearch方法,添加搜索结果为空时的提示
|
||||||
|
async doSearch(query) {
|
||||||
|
// 不再在空查询时清空搜索结果
|
||||||
|
// if (!query.trim()) {
|
||||||
|
// this.searchResults = []
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
console.log("---- doSearch ------ query = " + query )
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
// 获取 typeId:取 sysTypeList 最后一个有效的值
|
||||||
|
const typeId = this.sysTypeList.length > 2 ? this.sysTypeList[2] :
|
||||||
|
this.sysTypeList.length > 1 ? this.sysTypeList[1] :
|
||||||
|
this.sysTypeList.length > 0 ? this.sysTypeList[0] : null;
|
||||||
|
console.log("---- doSearch searchTags ------ query = " + query + " , typeId = " + typeId )
|
||||||
|
const {result:tags} = await apiCourseTag.searchTags({tagName:query,typeId:typeId})
|
||||||
|
console.log("-- searchTags 查询结果 tags = " + tags )
|
||||||
|
|
||||||
|
tags.forEach(item => {
|
||||||
|
this.tagMap.set(item.id, item)
|
||||||
|
})
|
||||||
|
this.searchResults = tags
|
||||||
|
// 当搜索结果为空时,提示用户可以按回车键创建标签
|
||||||
|
if (tags.length === 0) {
|
||||||
|
// this.$message.info('无此标签,按回车键创建')
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tag-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.tag-preview {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
.el-tag {
|
||||||
|
margin-right: 6px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 添加标签计数样式 */
|
||||||
|
.tag-count {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 47%;
|
||||||
|
transform: translateY(-40%);
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
background: white;
|
||||||
|
padding: 0 5px;
|
||||||
|
pointer-events: none;
|
||||||
|
/* 添加高度限制 */
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px; /* 垂直居中文字 */
|
||||||
|
box-sizing: border-box; /* 确保padding包含在height内 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
::v-deep(.el-select__tags) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
::v-deep(.el-tag) {
|
||||||
|
flex: 0 0 calc(50% - 8px);
|
||||||
|
max-width: calc(50% - 8px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
::v-deep(.el-tag) {
|
||||||
|
flex: 1 1 auto; /* 自动调整宽度 */
|
||||||
|
min-width: 30%; /* 设置最小宽度 */
|
||||||
|
max-width: 48%; /* 设置最大宽度,留出边距 */
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep(.el-select__input) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 60px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,53 +3,108 @@
|
|||||||
<div class="portal-top" :style="{ color: textColor }">
|
<div class="portal-top" :style="{ color: textColor }">
|
||||||
<div class="portal-top-left">
|
<div class="portal-top-left">
|
||||||
<div class="portal-top-logo">
|
<div class="portal-top-logo">
|
||||||
<img src="../assets/logo/logo-white.png" v-if="textColor == '#fff' || textColor == '#ffffff'" style="width:160px;height: 27px;" />
|
<img
|
||||||
<img src="../assets/logo/logo.png" v-else style="width:160px;height: 27px;" />
|
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>
|
||||||
<div class="portal-top-nav" v-if="userInfo.role === 1">
|
<div class="portal-top-nav" v-if="userInfo.role === 1">
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'index' ? activeNav : ''">
|
<div
|
||||||
<router-link to="/index" >首页
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'index' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<router-link to="/index"
|
||||||
|
>首页
|
||||||
<div :class="current == 'index' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'index' ? 'nav-bottbor' : ''"></div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'course' ? activeNav : ''">
|
<div
|
||||||
<a @click="handleChangeCourse">课程
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'course' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<a @click="handleChangeCourse"
|
||||||
|
>课程
|
||||||
<div :class="current == 'course' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'course' ? 'nav-bottbor' : ''"></div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'case' ? activeNav : ''">
|
<div
|
||||||
<router-link to="/case">案例
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'case' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<router-link to="/case"
|
||||||
|
>案例
|
||||||
<div :class="current == 'case' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'case' ? 'nav-bottbor' : ''"></div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'article' ? activeNav : ''">
|
<div
|
||||||
<router-link to="/article">文章
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'article' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<router-link to="/article"
|
||||||
|
>文章
|
||||||
<div :class="current == 'article' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'article' ? 'nav-bottbor' : ''"></div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'qa' ? activeNav : ''">
|
<div
|
||||||
<router-link to="/qa" >问答
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'qa' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<router-link to="/qa"
|
||||||
|
>问答
|
||||||
<div :class="current == 'qa' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'qa' ? 'nav-bottbor' : ''"></div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav">
|
<div class="top-nav">
|
||||||
<el-dropdown placement="bottom" @command="handleCommand">
|
<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-menu slot="dropdown">
|
||||||
<el-dropdown-item command="zero">热点论坛</el-dropdown-item>
|
<el-dropdown-item command="zero">热点论坛</el-dropdown-item>
|
||||||
<el-dropdown-item command="one" divided>BOE系列公开课</el-dropdown-item>
|
<el-dropdown-item command="one" divided
|
||||||
<el-dropdown-item command="two" divided>Grow180</el-dropdown-item>
|
>BOE系列公开课</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="two" divided
|
||||||
<el-dropdown-item command="five" divided>社招新员工</el-dropdown-item>
|
>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="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-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-nav">
|
<div class="top-nav">
|
||||||
<el-dropdown placement="bottom" @command="handleContributor">
|
<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-menu slot="dropdown">
|
||||||
<el-dropdown-item command="three">2024</el-dropdown-item>
|
<el-dropdown-item command="three">2024</el-dropdown-item>
|
||||||
<el-dropdown-item command="one" divided>2023</el-dropdown-item>
|
<el-dropdown-item command="one" divided>2023</el-dropdown-item>
|
||||||
@@ -58,18 +113,40 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="top-nav" :style="{color:textColor}" :class="current == 'follow' ? activeNav : ''">
|
<div
|
||||||
<router-link to="/follow">我的关注
|
class="top-nav"
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
:class="current == 'follow' ? activeNav : ''"
|
||||||
|
>
|
||||||
|
<router-link to="/follow"
|
||||||
|
>我的关注
|
||||||
<div :class="current == 'follow' ? 'nav-bottbor' : ''"></div>
|
<div :class="current == 'follow' ? 'nav-bottbor' : ''"></div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portal-top-right">
|
<div class="portal-top-right">
|
||||||
<div v-if="goSearch !=10 && userInfo.role === 1" style="position: relative;">
|
<div
|
||||||
<el-input class="portal-input" v-show="!hideSearch" placeholder="搜索全部" style="border-radius: 20px !important; " @keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword" >
|
v-if="goSearch != 10 && userInfo.role === 1"
|
||||||
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px; border-radius:20px !important;" slot="prepend" placeholder="请选择">
|
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="1"></el-option>
|
||||||
<el-option label="案例" value="2"></el-option>
|
<el-option label="案例" value="2"></el-option>
|
||||||
<el-option label="文章" value="3"></el-option>
|
<el-option label="文章" value="3"></el-option>
|
||||||
@@ -77,7 +154,14 @@
|
|||||||
<!-- <el-option label="专区" value="5"></el-option> -->
|
<!-- <el-option label="专区" value="5"></el-option> -->
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-input>
|
</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>
|
||||||
|
|
||||||
<div class="person-action">
|
<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 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> -->
|
<!-- <el-link type="primary" @click="logout()" icon="el-icon-switch-button" :underline="false">退出</el-link> -->
|
||||||
<div class="person-action-item">
|
<div class="person-action-item">
|
||||||
<el-badge class="person-action-index" :value="userMsg" :hidden="userMsg == 0">
|
<el-badge
|
||||||
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
|
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"> -->
|
<!-- <el-link type="primary" :href="`${webBaseUrl}/message/center/index`" :underline="false"> -->
|
||||||
<router-link to="/message/center/index">
|
<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>
|
</router-link>
|
||||||
<!-- </el-link> -->
|
<!-- </el-link> -->
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -100,39 +198,93 @@
|
|||||||
<el-dropdown class="person-action-index">
|
<el-dropdown class="person-action-index">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
<span :style="{ color: textColor }">学员</span>
|
<span :style="{ color: textColor }">学员</span>
|
||||||
<i :style="{color:textColor}" class="el-icon-arrow-down el-icon--right"></i>
|
<i
|
||||||
|
:style="{ color: textColor }"
|
||||||
|
class="el-icon-arrow-down el-icon--right"
|
||||||
|
></i>
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item><router-link to="/index">学员</router-link></el-dropdown-item>
|
<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>
|
><router-link to="/index">学员</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
|
||||||
|
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-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="person-action-item">
|
<div class="person-action-item">
|
||||||
<el-dropdown>
|
<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 class="person-action-index">
|
||||||
<div v-if="userInfo.avatar !== ''" class="user-avatar">
|
<div v-if="userInfo.avatar !== ''" class="user-avatar">
|
||||||
<img :src="userInfo.avatar" style="width: 35px;height: 35px;"/>
|
<img
|
||||||
|
:src="userInfo.avatar"
|
||||||
|
style="width: 35px; height: 35px"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="uavatar">
|
<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-if="sex === 1">
|
||||||
<div v-else><img src="../../public/images/Avatarwoman.png" alt="" style="width: 30px;height: 30px;"></div>
|
<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>
|
</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>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<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 @click.native="setCurIdentity(1)"
|
||||||
<el-dropdown-item><router-link :to="'/home/'+userInfo.aid">个人主页</router-link></el-dropdown-item>
|
><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-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="person-action-item">
|
<div class="person-action-item">
|
||||||
|
<div
|
||||||
<div class="person-action-index pointer" :style="{color:textColor}" @click="logout()">
|
class="person-action-index pointer"
|
||||||
<svg-icon style="margin-right: 4px;font-size:16px;" icon-class="white-out"></svg-icon>登出
|
:style="{ color: textColor }"
|
||||||
|
@click="logout()"
|
||||||
|
>
|
||||||
|
<svg-icon
|
||||||
|
style="margin-right: 4px; font-size: 16px"
|
||||||
|
icon-class="white-out"
|
||||||
|
></svg-icon
|
||||||
|
>登出
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -142,18 +294,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions } from 'vuex';
|
import { mapGetters, mapActions } from "vuex";
|
||||||
import apiMessage from '@/api/system/message.js';
|
import apiMessage from "@/api/system/message.js";
|
||||||
import popup from '@/components/AlertPopup.vue';
|
import popup from "@/components/AlertPopup.vue";
|
||||||
import yearMedal from '@/components/Popup/China2023.vue';
|
import yearMedal from "@/components/Popup/China2023.vue";
|
||||||
import apiBoeCourse from '@/api/boe/course.js';
|
import apiBoeCourse from "@/api/boe/course.js";
|
||||||
import { userAvatarText } from "@/utils/tools.js";
|
import { userAvatarText } from "@/utils/tools.js";
|
||||||
import apiCase from "@/api/modules/cases.js";
|
import apiCase from "@/api/modules/cases.js";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
current: {
|
current: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: "",
|
||||||
},
|
},
|
||||||
hideSearch: {
|
hideSearch: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -161,7 +313,7 @@ export default {
|
|||||||
},
|
},
|
||||||
textColor: {
|
textColor: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: "",
|
||||||
},
|
},
|
||||||
goSearch: {
|
goSearch: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -169,63 +321,78 @@ export default {
|
|||||||
},
|
},
|
||||||
keywords: {
|
keywords: {
|
||||||
type: String,
|
type: String,
|
||||||
default:''
|
default: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: { popup, yearMedal },
|
components: { popup, yearMedal },
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo','curIdentity', 'userMsg','identity','studyTaskCount']),
|
...mapGetters([
|
||||||
|
"userInfo",
|
||||||
|
"curIdentity",
|
||||||
|
"userMsg",
|
||||||
|
"identity",
|
||||||
|
"studyTaskCount",
|
||||||
|
]),
|
||||||
|
|
||||||
avatarText() {
|
avatarText() {
|
||||||
return userAvatarText(this.userInfo.name);
|
return userAvatarText(this.userInfo.name);
|
||||||
},
|
},
|
||||||
activeNav() {
|
activeNav() {
|
||||||
return {
|
return {
|
||||||
'top-nav-active-blue': this.textColor=='#000000',
|
"top-nav-active-blue": this.textColor == "#000000",
|
||||||
'top-nav-active-white': this.textColor=='#fff' || this.textColor=='#ffffff',
|
"top-nav-active-white":
|
||||||
}
|
this.textColor == "#fff" || this.textColor == "#ffffff",
|
||||||
}
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
keywords(newval) {
|
keywords(newval) {
|
||||||
console.log(newval, 9999);
|
console.log(newval, 9999);
|
||||||
if(this.findType == '1'){
|
if (this.findType == "1") {
|
||||||
this.keyword = newval
|
this.keyword = newval;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"$route.query.keyword": {
|
||||||
|
handler(newval) {
|
||||||
|
if (newval && this.current == "case") {
|
||||||
|
this.keyword = newval;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
popupConfig: {},
|
popupConfig: {},
|
||||||
ctx: process.env.VUE_APP_PUBLIC_PATH,
|
ctx: process.env.VUE_APP_PUBLIC_PATH,
|
||||||
managerPath: process.env.VUE_APP_MANAGER_PATH,
|
managerPath: process.env.VUE_APP_MANAGER_PATH,
|
||||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||||
findType: '1',
|
findType: "1",
|
||||||
keyword: '',
|
keyword: "",
|
||||||
isTiao: false,
|
isTiao: false,
|
||||||
sex:'',
|
sex: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.sex = this.userInfo.sex;
|
this.sex = this.userInfo.sex;
|
||||||
this.$store.dispatch('refrashMsg');
|
this.$store.dispatch("refrashMsg");
|
||||||
this.loadBoeData();
|
this.loadBoeData();
|
||||||
// console.log('this.userInfo::',this.userInfo)
|
// console.log('this.userInfo::',this.userInfo)
|
||||||
//this.loadPopupConfig();
|
//this.loadPopupConfig();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChangeCourse() {
|
handleChangeCourse() {
|
||||||
const paths = ["/course","/qualityCourse"]
|
const paths = ["/course", "/qualityCourse"];
|
||||||
// 如果是 课程 和 精品课程, 那么就不再重定向
|
// 如果是 课程 和 精品课程, 那么就不再重定向
|
||||||
const needReload = paths.findIndex(e=> e === this.$route.path) === -1
|
const needReload = paths.findIndex((e) => e === this.$route.path) === -1;
|
||||||
if (needReload) this.$router.push({path: paths[0]})
|
if (needReload) this.$router.push({ path: paths[0] });
|
||||||
},
|
},
|
||||||
|
|
||||||
setCurIdentity(iden) {
|
setCurIdentity(iden) {
|
||||||
this.$store.dispatch('SetCurIdentity',iden);
|
this.$store.dispatch("SetCurIdentity", iden);
|
||||||
},
|
},
|
||||||
tomy() {
|
tomy() {
|
||||||
console.log('lll')
|
console.log("lll");
|
||||||
},
|
},
|
||||||
loadBoeData() {
|
loadBoeData() {
|
||||||
if (this.studyTaskCount > 0) {
|
if (this.studyTaskCount > 0) {
|
||||||
@@ -253,13 +420,13 @@ export default {
|
|||||||
let obj = {
|
let obj = {
|
||||||
one: urlPre + "/web/contributornew/index",
|
one: urlPre + "/web/contributornew/index",
|
||||||
two: urlPre + "/web/contributor/index",
|
two: urlPre + "/web/contributor/index",
|
||||||
three: urlPre + "/web/contributor_2024/index"
|
three: urlPre + "/web/contributor_2024/index",
|
||||||
};
|
};
|
||||||
window.open(obj[val]);
|
window.open(obj[val]);
|
||||||
},
|
},
|
||||||
handleCommand(val) {
|
handleCommand(val) {
|
||||||
if (val === "four") {
|
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)
|
// this.$emit('showClass',true)
|
||||||
} else {
|
} else {
|
||||||
let urlPre = window.location.protocol + "//" + window.location.host;
|
let urlPre = window.location.protocol + "//" + window.location.host;
|
||||||
@@ -272,64 +439,82 @@ export default {
|
|||||||
// four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
|
// four: 'https://m.qingxuetang.com/x/?appId=qxtcorp306130',
|
||||||
five: urlPre + "/boe/new-employee/index.html",
|
five: urlPre + "/boe/new-employee/index.html",
|
||||||
six: urlPre + "/web/contributor/index",
|
six: urlPre + "/web/contributor/index",
|
||||||
seven: this.webBaseUrl + '/grateful/index'
|
seven: this.webBaseUrl + "/grateful/index",
|
||||||
};
|
};
|
||||||
window.open(obj[val]);
|
window.open(obj[val]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleUcCommand(val) {
|
handleUcCommand(val) {
|
||||||
if (val == 'uc') {
|
if (val == "uc") {
|
||||||
window.location.href = `${this.webBaseUrl}${this.isTiao ? '/uc/study/task' : '/uc/study/courses'}`;
|
window.location.href = `${this.webBaseUrl}${
|
||||||
} else if (val == 'logout') {
|
this.isTiao ? "/uc/study/task" : "/uc/study/courses"
|
||||||
|
}`;
|
||||||
|
} else if (val == "logout") {
|
||||||
this.logout();
|
this.logout();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchJump() {
|
searchJump() {
|
||||||
this.$emit('type1', '')
|
this.$emit("type1", "");
|
||||||
if(this.current == 'index') {
|
if (this.current == "index") {
|
||||||
if (this.findType == '1') {
|
if (this.findType == "1") {
|
||||||
if(this.keyword==''){return;}
|
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}`);
|
//window.open(`${this.webBaseUrl}/course?keyword=${this.keyword}`);
|
||||||
} else if (this.findType == '2') {
|
} else if (this.findType == "2") {
|
||||||
if(this.keyword==''){return;}
|
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}`);
|
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||||
} else if (this.findType == '3') {
|
} else if (this.findType == "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}`);
|
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||||
} else if (this.findType == '4') {
|
} else if (this.findType == "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}`);
|
//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}`);
|
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$emit('emitInput',this.keyword)
|
this.$emit("emitInput", this.keyword);
|
||||||
if (this.goSearch == 1) {
|
if (this.goSearch == 1) {
|
||||||
if(this.keyword==''){return;}
|
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) {
|
} else if (this.goSearch == 2) {
|
||||||
if(this.keyword==''){return;}
|
if (this.keyword == "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 案例
|
// 案例
|
||||||
// location.href=`${this.webBaseUrl}/case?keyword=${this.keyword}`;
|
// 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}`);
|
//window.open(`${this.webBaseUrl}/case?keyword=${this.keyword}`);
|
||||||
} else if (this.goSearch == 3) {
|
} 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}`);
|
//window.open(`${this.webBaseUrl}/article?keyword=${this.keyword}`);
|
||||||
} else if (this.goSearch == 4) {
|
} 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}`);
|
//window.open(`${this.webBaseUrl}/qa?keyword=${this.keyword}`);
|
||||||
@@ -338,17 +523,20 @@ export default {
|
|||||||
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
window.open(`${this.webBaseUrl}/zone?keyword=${this.keyword}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$confirm('您确定要退出系统吗?', '提示', {
|
this.$confirm("您确定要退出系统吗?", "提示", {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: "取消",
|
||||||
type: 'warning'
|
type: "warning",
|
||||||
}).then(() => {
|
})
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
.then(() => {
|
||||||
|
this.$store.dispatch("LogOut").then(() => {
|
||||||
//location.href = this.webBaseUrl + '/login';
|
//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;
|
location.href = process.env.VUE_APP_LOGIN_URL;
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -356,21 +544,20 @@ export default {
|
|||||||
},
|
},
|
||||||
//获取未读消息数量
|
//获取未读消息数量
|
||||||
getMsgNum() {
|
getMsgNum() {
|
||||||
apiMessage.isRead().then(res => {
|
apiMessage.isRead().then((res) => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.msgNum = res.result;
|
this.msgNum = res.result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped rel="stylesheet/scss" lang="scss">
|
<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;
|
background-color: #fff !important;
|
||||||
color: #0059FF !important;
|
color: #0059ff !important;
|
||||||
}
|
}
|
||||||
::v-deep.el-dropdown-menu {
|
::v-deep.el-dropdown-menu {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -383,21 +570,25 @@ text-align: center;
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.top-nav-active-blue {
|
.top-nav-active-blue {
|
||||||
color: #387DF7;
|
color: #387df7;
|
||||||
a{color:#387DF7;}
|
a {
|
||||||
|
color: #387df7;
|
||||||
|
}
|
||||||
div {
|
div {
|
||||||
width: 75%;
|
width: 75%;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
top: 75%;
|
top: 75%;
|
||||||
left: 13%;
|
left: 13%;
|
||||||
background: #387DF7;
|
background: #387df7;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.top-nav-active-white {
|
.top-nav-active-white {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
a{color:#fff;}
|
a {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
div {
|
div {
|
||||||
width: 75%;
|
width: 75%;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
@@ -440,7 +631,6 @@ text-align: center;
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.portal-top-logo {
|
.portal-top-logo {
|
||||||
|
|
||||||
}
|
}
|
||||||
.portal-top-nav {
|
.portal-top-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -542,7 +732,6 @@ text-align: center;
|
|||||||
::v-deep .el-badge {
|
::v-deep .el-badge {
|
||||||
.el-badge__content {
|
.el-badge__content {
|
||||||
top: 0px;
|
top: 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,7 +752,6 @@ text-align: center;
|
|||||||
}
|
}
|
||||||
::v-deep .el-badge {
|
::v-deep .el-badge {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
::v-deep .el-link.el-link--primary:hover {
|
::v-deep .el-link.el-link--primary:hover {
|
||||||
color: #588afc;
|
color: #588afc;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<script setup>
|
<script>
|
||||||
import {getCertificationProcess} from "@/api/modules/lecturer";
|
import {getCertificationProcess} from "@/api/modules/lecturer";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ export const iframes=[
|
|||||||
{title:'查看受众', path:'/iframe/ugroup/view',hidden:false,component:'manage/AudienceView'},
|
{title:'查看受众', path:'/iframe/ugroup/view',hidden:false,component:'manage/AudienceView'},
|
||||||
{title:'问答管理', path:'/iframe/qa/manages',hidden:false,component:'qa/ManageList'},
|
{title:'问答管理', path:'/iframe/qa/manages',hidden:false,component:'qa/ManageList'},
|
||||||
{title:'待审核课程', path:'/iframe/course/noapproved',hidden:false,component:'examine/NotApproved'},
|
{title:'待审核课程', path:'/iframe/course/noapproved',hidden:false,component:'examine/NotApproved'},
|
||||||
{title:'已审核课程', path:'/iframe/course/reviewed',hidden:false,component:'examine/Reviewed'}
|
{title:'已审核课程', path:'/iframe/course/reviewed',hidden:false,component:'examine/Reviewed'},
|
||||||
|
{title:'标签管理', path:'/iframe/tag/manages',hidden:false,component:'tag/TagManageList'},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="line-height: 30px;">
|
<div style="line-height: 30px;">
|
||||||
<div>请在当前面板选择需要上传的课件</div>
|
<div>请在当前面板选择需要上传的课件</div>
|
||||||
<div style="">提示:课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。如果上传zip文件必须是scorm标准打包文件</div>
|
<div style="">提示:课件大小超过1G时,无法上传,请先压缩视频,或剪切成多个再上传。视频码率需在1.5Mb/s及以下,帧数需在30帧及以下。如果上传zip文件必须是scorm标准打包文件</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="display: flex;line-height: 30px;padding: 5px 0px;">
|
<div style="display: flex;line-height: 30px;padding: 5px 0px;">
|
||||||
@@ -484,7 +484,10 @@ export default {
|
|||||||
this.form.device = 2;
|
this.form.device = 2;
|
||||||
}
|
}
|
||||||
// 时长,秒与分钟的转化
|
// 时长,秒与分钟的转化
|
||||||
//if(this.form.)
|
if (this.form.minute) {
|
||||||
|
this.form.duration = this.form.minute * 60;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { status,message} = await coueseFile.batchUpdate([this.form]);
|
const { status,message} = await coueseFile.batchUpdate([this.form]);
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -30,13 +30,19 @@
|
|||||||
<!-- <div class="course-title-right"> -->
|
<!-- <div class="course-title-right"> -->
|
||||||
<!-- <interactBar :readonly="!stuStusts || stuStusts==0" :type="1" :data="courseInfo" :comments="false" :views="false"></interactBar> -->
|
<!-- <interactBar :readonly="!stuStusts || stuStusts==0" :type="1" :data="courseInfo" :comments="false" :views="false"></interactBar> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
<!-- <div class="label-div">
|
||||||
|
<el-tag class="label-item" effect="plain" v-for="(item,tagIdx) in tagArray" :key="tagIdx">{{item}}</el-tag>
|
||||||
|
</div>-->
|
||||||
|
<div class="label-div">
|
||||||
|
<div v-for="(item, tagIdx) in tagArray" :key="tagIdx" class="keyword-tag">
|
||||||
|
{{ item }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="study-count">{{courseInfo.studys}}人学习</div>
|
<div class="study-count">{{courseInfo.studys}}人学习</div>
|
||||||
<!-- <div><span style="font-size:20px;color:#ff8e00">{{courseInfo.score ? courseInfo.score.toFixed(1) : 0}}</span><span style="font-size:12px;color:#ff8e00">分</span></div> -->
|
<!-- <div><span style="font-size:20px;color:#ff8e00">{{courseInfo.score ? courseInfo.score.toFixed(1) : 0}}</span><span style="font-size:12px;color:#ff8e00">分</span></div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="label-div">
|
|
||||||
<el-tag class="label-item" effect="plain" v-for="(item,tagIdx) in tagArray" :key="tagIdx">{{item}}</el-tag>
|
|
||||||
</div>
|
|
||||||
<!-- <div style="width:160px;height:50px"> -->
|
<!-- <div style="width:160px;height:50px"> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<!-- <div class="label-div">
|
<!-- <div class="label-div">
|
||||||
@@ -419,7 +425,7 @@ export default {
|
|||||||
|
|
||||||
.course-title{
|
.course-title{
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 90px;
|
height: auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.title {
|
.title {
|
||||||
@@ -452,18 +458,43 @@ export default {
|
|||||||
padding: 24px 24px 5px 24px;
|
padding: 24px 24px 5px 24px;
|
||||||
// margin-right: 361px;
|
// margin-right: 361px;
|
||||||
.study-count {
|
.study-count {
|
||||||
margin-top: 10px;
|
margin-top: 30px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #444444;
|
color: #444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label-div {
|
/*.label-div {
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
min-height: 20px;
|
min-height: 20px;
|
||||||
.label-item {
|
.label-item {
|
||||||
padding: 0 7px;
|
padding: 0px 8px;
|
||||||
|
margin-top: 5px;
|
||||||
|
float: left;
|
||||||
|
line-height: 24px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 2px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-bottom: 0px;
|
color: #2C68FF;
|
||||||
|
height: 24px;
|
||||||
|
background: rgba(44, 104, 255, 0.06);
|
||||||
|
border: none; // 或者使用 border-color: transparent;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
.label-div {
|
||||||
|
margin: 5px 0;
|
||||||
|
min-height: 20px;
|
||||||
|
|
||||||
|
.keyword-tag {
|
||||||
|
padding: 0px 10px;
|
||||||
|
margin-top: 7px;
|
||||||
|
float: left;
|
||||||
|
line-height: 24px;
|
||||||
|
font-size: 12px;
|
||||||
|
border-radius: 2px;
|
||||||
|
margin-right: 10px;
|
||||||
|
color: #2C68FF;
|
||||||
|
height: 24px;
|
||||||
|
background: rgba(44, 104, 255, 0.06);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::v-deep .el-rate__icon {
|
::v-deep .el-rate__icon {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -480,6 +480,7 @@
|
|||||||
defaultMaxTime:1800, //非音频默认最大时间
|
defaultMaxTime:1800, //非音频默认最大时间
|
||||||
warn:"测试内容",
|
warn:"测试内容",
|
||||||
warnTitle:"测试标题",
|
warnTitle:"测试标题",
|
||||||
|
isFinishingStudyItem: false, // 防止重复调用完成状态更新接口
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -1684,12 +1685,17 @@
|
|||||||
//这种可能没有,不过这里也是为了万中那个1
|
//这种可能没有,不过这里也是为了万中那个1
|
||||||
!this.tentative && this.saveStudyInfo();
|
!this.tentative && this.saveStudyInfo();
|
||||||
} else {
|
} else {
|
||||||
|
// 如果正在处理完成请求,则直接返回,避免重复调用
|
||||||
|
if (this.isFinishingStudyItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
itemId: this.contentData.studyItemId,
|
itemId: this.contentData.studyItemId,
|
||||||
studyId: this.studyId,
|
studyId: this.studyId,
|
||||||
courseId: this.courseId,
|
courseId: this.courseId,
|
||||||
cnum: this.totalContent
|
cnum: this.totalContent
|
||||||
}
|
}
|
||||||
|
this.isFinishingStudyItem = true; // 设置标志位
|
||||||
apiVideoStudy.finishStudyItem(params).then(res => {
|
apiVideoStudy.finishStudyItem(params).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.contentData.status = 9;
|
this.contentData.status = 9;
|
||||||
@@ -1697,6 +1703,10 @@
|
|||||||
} else {
|
} else {
|
||||||
console.log("记录完成学习失败:" + res.message + "," + res.error);
|
console.log("记录完成学习失败:" + res.message + "," + res.error);
|
||||||
}
|
}
|
||||||
|
this.isFinishingStudyItem = false; // 重置标志位
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("记录完成学习出错:", error);
|
||||||
|
this.isFinishingStudyItem = false; // 出错时也重置标志位
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1960,16 +1970,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.player-box {
|
.player-box {
|
||||||
position: relative;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
height: 187px;
|
height: 187px;
|
||||||
background: rgba(74, 74, 74, .5);
|
background: rgba(74, 74, 74, .8);
|
||||||
border-radius: 33px;
|
border-radius: 33px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
top: 50%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
.player-praise {
|
.player-praise {
|
||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
|
|||||||
389
src/views/tag/TagManageList.vue
Normal file
389
src/views/tag/TagManageList.vue
Normal file
@@ -0,0 +1,389 @@
|
|||||||
|
<template>
|
||||||
|
<div class="u-page" style="padding-right:32px">
|
||||||
|
<div style="width: 100%; margin-left: 12px;padding: 2px 0px 10px 12px;background-color: white">
|
||||||
|
<el-form :inline="true" style="margin-left: 12px;" :model="pageData" class="demo-form-inline">
|
||||||
|
<el-form-item label="标签ID:" label-width="60px">
|
||||||
|
<el-input id="tag-id" placeholder="请输入标签ID" v-model="pageData.id" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="标签名称:" label-width="80px">
|
||||||
|
<el-input id="tag-id" placeholder="请输入标签名称" v-model="pageData.tagName" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="热点标签:" label-width="80px">
|
||||||
|
<el-select v-model="pageData.isHot" style="width: 120px;" clearable placeholder="请选择状态">
|
||||||
|
<el-option label="开启" value="true"></el-option>
|
||||||
|
<el-option label="关闭" value="false"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="getsearch" icon="el-icon-search" type="primary">查询</el-button>
|
||||||
|
<!-- 添加重置按钮 -->
|
||||||
|
<el-button @click="resetSearch" icon="el-icon-refresh">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div style="padding: 5px 0px 2px 12px;">
|
||||||
|
<!-- <el-checkbox label="前台公共显示"></el-checkbox>-->
|
||||||
|
<!-- <el-checkbox label="热点标签展示"></el-checkbox>-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="width: 100%; margin-left: 12px;padding: 2px 0px 10px 12px;background-color: white">
|
||||||
|
<el-table style="width: 96%; margin:2px 32px 10px 12px;" :data="pageData.list" border stripe
|
||||||
|
:header-cell-style="{ background: '#E9F0FF' }"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column type="selection" width="80px"></el-table-column>
|
||||||
|
<el-table-column label="标签ID" width="200px" prop="id"></el-table-column>
|
||||||
|
<el-table-column label="标签名称" width="235px" prop="tagName"></el-table-column>
|
||||||
|
<el-table-column label="已关联课程" width="220px"
|
||||||
|
prop="useCount"
|
||||||
|
sortable="custom"
|
||||||
|
:sort-orders="['descending', 'ascending']"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<a v-if="scope.row.useCount > 0"
|
||||||
|
@click="showCourseByTag(`${scope.row.id}`)"
|
||||||
|
style="font-weight:bold; color: #409EFF; text-decoration: underline;">
|
||||||
|
{{ scope.row.useCount }}
|
||||||
|
</a>
|
||||||
|
<span style="font-weight:bold; color: #409EFF; text-decoration: underline;" v-else>0</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="前台公共显示" width="220px" prop="isPublic">
|
||||||
|
<template #default="scope"><!-- 开关状态会直接修改 pageData.list 中的数据 -->
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.isPublic"
|
||||||
|
:disabled="scope.row.isHot==1?true:false"
|
||||||
|
@change="handlePublicChange(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="热点标签展示" width="220px" prop="isHot">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.isHot"
|
||||||
|
:disabled="scope.row.isPublic==0?true:false"
|
||||||
|
@change="handleHotChange(scope.row)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div v-if="pageData.list.length > 0" style="text-align: center;margin-top: 50px;">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="pageData.pageIndex"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageData.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 标签关联课程弹窗 -->
|
||||||
|
<el-dialog custom-class="g-dialog" title="关联课程"
|
||||||
|
width="850px" top="20px"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:modal-append-to-body="true"
|
||||||
|
:append-to-body="true">
|
||||||
|
<div class="dialog-content-container">
|
||||||
|
<el-table
|
||||||
|
:data="pageData.list2"
|
||||||
|
border stripe style="width: 100%"
|
||||||
|
:header-cell-style="{ background: '#E9F0FF' }"
|
||||||
|
@sort-change="handleSortChange2">
|
||||||
|
<el-table-column label="序号" width="60px" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.$index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="关联课程名称" width="200px" prop="courseName"></el-table-column>
|
||||||
|
<el-table-column label="关联课程ID" width="100px" prop="courseId"></el-table-column>
|
||||||
|
<el-table-column label="关联人" width="80px" prop="sysCreateBy"></el-table-column>
|
||||||
|
<el-table-column label="关联时间" width="110px" prop="sysCreateTime"
|
||||||
|
:formatter="dateFormat" sortable="custom"
|
||||||
|
:sort-orders="['descending', 'ascending']"></el-table-column>
|
||||||
|
<el-table-column label="本课程绑定的其他标签" width="200px" prop="otherTags"></el-table-column>
|
||||||
|
<el-table-column label="操作" width="60px">
|
||||||
|
<template #default="scope">
|
||||||
|
<a @click="unbindCurrentTag(scope.row)"
|
||||||
|
style="font-weight:bold; color: #409EFF;">
|
||||||
|
解绑
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<div v-if="pageData.list2.length > 0" class="pagination-container">
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
@size-change="handleSizeChange2"
|
||||||
|
@current-change="handleCurrentChange2"
|
||||||
|
:current-page="pageData.pageIndex2"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageData.pageSize2"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total2">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import apiCourseTag from '@/api/modules/courseTag.js'
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
export default {
|
||||||
|
name: 'courseTagItems',
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo'])
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageData: {
|
||||||
|
pageIndex: 1,
|
||||||
|
pageIndex2: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
pageSize2: 10,
|
||||||
|
list:[],
|
||||||
|
list2:[],
|
||||||
|
orderField: null,
|
||||||
|
orderAsc: null,
|
||||||
|
orderField2: null,
|
||||||
|
orderAsc2: null,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
total2: 0,
|
||||||
|
dialogVisible: false,
|
||||||
|
tagId: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCourseTagList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
//重置搜索条件
|
||||||
|
resetSearch() {
|
||||||
|
this.pageData.id = '';
|
||||||
|
this.pageData.tagName = '';
|
||||||
|
this.pageData.isHot = '';
|
||||||
|
this.pageData.pageIndex = 1;
|
||||||
|
this.getCourseTagList(); // 重置后重新加载列表
|
||||||
|
},
|
||||||
|
|
||||||
|
//初始化:课程标签列表
|
||||||
|
getsearch(){
|
||||||
|
this.pageData.pageIndex = 1;
|
||||||
|
this.getCourseTagList()
|
||||||
|
},
|
||||||
|
|
||||||
|
//课程标签列表:排序
|
||||||
|
handleSortChange({ prop, order }) {
|
||||||
|
this.pageData.orderField = prop; // 当前排序字段
|
||||||
|
this.pageData.orderAsc = order === 'ascending'; // 排序方向
|
||||||
|
this.getCourseTagList(); // 重新获取数据
|
||||||
|
},
|
||||||
|
|
||||||
|
//TODO:课程标签列表:监听选中项变化(批量的设置标签公共显示|热点标签)
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.selectedRows = selection; // 更新选中的行数据
|
||||||
|
},
|
||||||
|
|
||||||
|
//课程标签列表:获取课程标签列表数据
|
||||||
|
getCourseTagList() {
|
||||||
|
const { pageIndex, pageSize, orderField, orderAsc } = this.pageData
|
||||||
|
let query = { pageIndex, pageSize, orderField, orderAsc}
|
||||||
|
//拼接查询条件
|
||||||
|
if (this.pageData.id) {
|
||||||
|
const { id } = this.pageData
|
||||||
|
query.id = id
|
||||||
|
}
|
||||||
|
if (this.pageData.tagName) {
|
||||||
|
const { tagName } = this.pageData
|
||||||
|
query.tagName = tagName
|
||||||
|
}
|
||||||
|
if (this.pageData.isHot) {
|
||||||
|
const { isHot } = this.pageData
|
||||||
|
query.isHot = isHot
|
||||||
|
}
|
||||||
|
apiCourseTag.portalPageList(query).then((res) => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.total = res.result.count
|
||||||
|
this.pageData.list = res.result.list
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.$message.error('获取数据失败')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//课程标签列表:改变标签的公共属性
|
||||||
|
async handlePublicChange(row) {
|
||||||
|
// 保存原始状态用于回滚
|
||||||
|
const originalStatus = row.isPublic;
|
||||||
|
try {
|
||||||
|
// 调用 API 更新状态
|
||||||
|
await apiCourseTag.changeTagPublic(row);
|
||||||
|
this.$message.success('更新成功');
|
||||||
|
} catch (error) {
|
||||||
|
// 发生错误时回滚状态
|
||||||
|
row.isPublic = originalStatus;
|
||||||
|
this.$message.error('更新失败:' + error.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//课程标签列表:改变标签的热点属性
|
||||||
|
async handleHotChange(row) {
|
||||||
|
const isPublic=row.isPublic;
|
||||||
|
// 保存原始状态用于回滚
|
||||||
|
const originalStatus = row.isHot;
|
||||||
|
try {
|
||||||
|
// 调用 API 更新状态
|
||||||
|
await apiCourseTag.changeTagHot(row).then((res)=>{
|
||||||
|
if (res.status == 200){
|
||||||
|
this.$message.success(res.message);
|
||||||
|
}else {
|
||||||
|
row.isHot=false;
|
||||||
|
this.$message.warning(res.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
// 发生错误时回滚状态
|
||||||
|
row.isHot = originalStatus;
|
||||||
|
this.$message.error('更新失败:' + error.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//课程标签列表:改变条数的回调
|
||||||
|
handleSizeChange(value) {
|
||||||
|
this.pageData.pageIndex = 1;
|
||||||
|
this.pageData.pageSize = value;
|
||||||
|
this.getCourseTagList();
|
||||||
|
},
|
||||||
|
//课程标签列表:改变页数的回调
|
||||||
|
handleCurrentChange(value) {
|
||||||
|
this.pageData.pageIndex = value;
|
||||||
|
this.getCourseTagList();
|
||||||
|
},
|
||||||
|
|
||||||
|
//标签关联的所有课程弹出框:显示指定标签id关联的课程列表
|
||||||
|
showCourseByTag(tagId) {
|
||||||
|
this.tagId=tagId;
|
||||||
|
this.getCourseOfTagList(tagId);
|
||||||
|
this.dialogVisible=true;
|
||||||
|
},
|
||||||
|
|
||||||
|
//分页查询指定标签关联的所有课程
|
||||||
|
getCourseOfTagList(){
|
||||||
|
const { pageIndex2:pageIndex, pageSize2:pageSize, orderField2:orderField, orderAsc2:orderAsc } = this.pageData
|
||||||
|
let query = { pageIndex, pageSize, orderField, orderAsc }
|
||||||
|
//拼接查询条件
|
||||||
|
if (this.tagId) {
|
||||||
|
query.id = this.tagId
|
||||||
|
apiCourseTag.showCourseByTag(query).then((res) => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.total2 = res.result.count
|
||||||
|
this.pageData.list2 = res.result.list
|
||||||
|
if (this.total2==0){
|
||||||
|
this.dialogVisible=false
|
||||||
|
this.getCourseTagList(); // 重新获取课程标签列表数据
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.$message.error('获取数据失败')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//标签关联课程列表:排序
|
||||||
|
handleSortChange2({ prop, order }) {
|
||||||
|
this.pageData.orderField2 = prop; // 当前排序字段
|
||||||
|
this.pageData.orderAsc2 = order === 'ascending'; // 排序方向
|
||||||
|
this.getCourseOfTagList(); // 重新获取数据
|
||||||
|
},
|
||||||
|
|
||||||
|
//标签关联的所有课程列表:改变条数的回调
|
||||||
|
handleSizeChange2(value) {
|
||||||
|
this.pageData.pageIndex2= 1;
|
||||||
|
this.pageData.pageSize2 = value;
|
||||||
|
this.getCourseOfTagList();
|
||||||
|
},
|
||||||
|
//标签关联的所有课程列表:改变页数的回调
|
||||||
|
handleCurrentChange2(value) {
|
||||||
|
this.pageData.pageIndex2 = value;
|
||||||
|
this.getCourseOfTagList();
|
||||||
|
},
|
||||||
|
//关联时间格式化
|
||||||
|
dateFormat(row, column) {
|
||||||
|
return row[column.property] ?
|
||||||
|
moment(row[column.property]).format('YYYY-MM-DD') : '';
|
||||||
|
},
|
||||||
|
|
||||||
|
//解除指定课程和当前标签的关联关系
|
||||||
|
unbindCurrentTag (row) {
|
||||||
|
let id = row.id;
|
||||||
|
let tagId = this.tagId;
|
||||||
|
let courseId = row.courseId;
|
||||||
|
//拼接查询条件
|
||||||
|
if (tagId && courseId) {
|
||||||
|
let params = { id, tagId, courseId }
|
||||||
|
apiCourseTag.unbindCourseTagRelation(params).then((res) => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
//刷新列表
|
||||||
|
this.getCourseOfTagList(this.tagId);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.$message.error('解绑失败!')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.demo-form-inline {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10px; /* 间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-form-inline .el-form-item {
|
||||||
|
margin-bottom: 0; /* 消除默认底部间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-content-container {
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.g-dialog .el-dialog__header {
|
||||||
|
background-color: #409EFF;
|
||||||
|
padding: 15px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.g-dialog .el-dialog__title {
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.g-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user