yujialong 3 years ago
parent 4c4f705af9
commit 47f6976255
  1. 8
      src/assets/css/main.css
  2. BIN
      src/assets/img/upload.png
  3. 22
      src/components/Sidebar.vue
  4. 206
      src/components/quill/index.vue
  5. 16
      src/components/quill/options.js
  6. 2
      src/main.js
  7. 29
      src/router/index.js
  8. 34
      src/setting.js
  9. 20
      src/store/index.js
  10. 88
      src/utils/api.js
  11. 4
      src/utils/core.js
  12. 28
      src/views/Login.vue
  13. 972
      src/views/course/AddCurriculum.vue
  14. 230
      src/views/course/AddLink.vue
  15. 313
      src/views/course/Curriculum.vue
  16. 697
      src/views/course/assetConfig.vue
  17. 1171
      src/views/course/courseconfig.vue
  18. 17
      src/views/data/Framework.vue
  19. 2
      src/views/order/AddOrder.vue
  20. 185
      src/views/serve/Configure.vue
  21. 661
      src/views/serve/projectAdd.vue
  22. 372
      src/views/serve/projectList.vue
  23. 1
      src/views/setting/Person.vue

@ -93,6 +93,10 @@ li {
margin-bottom: 20px; margin-bottom: 20px;
} }
.mgb10 {
margin-bottom: 10px;
}
.move-enter-active, .move-enter-active,
.move-leave-active { .move-leave-active {
transition: opacity .5s; transition: opacity .5s;
@ -226,10 +230,6 @@ li {
margin-bottom: 20px; margin-bottom: 20px;
} }
.mgb20 {
margin-bottom: 20px;
}
#app .el-table thead{ #app .el-table thead{
color: #fff; color: #fff;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

@ -70,21 +70,21 @@ export default {
index: 'order', index: 'order',
title: '订单管理' title: '订单管理'
}, },
// { {
// icon: 'el-icon-lx-emoji', icon: 'el-icon-document-checked',
// index: 'configure', index: 'curriculum',
// title: '' title: '课程管理'
// }, },
// {
// icon: 'el-icon-document-checked',
// index: 'curriculum',
// title: ''
// },
{ {
icon: 'el-icon-notebook-2', icon: 'el-icon-notebook-2',
index: 'data', index: 'data',
title: '数据管理' title: '数据管理'
} },
{
icon: 'el-icon-office-building',
index: 'configure',
title: '服务配置'
},
], ],
onRoutes:'customer' onRoutes:'customer'
}; };

@ -0,0 +1,206 @@
<template>
<div class="quill" ref="quill" :class="classes">
<div ref="editor" :style="styles" v-loading="loading"></div>
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none">
<el-button class="editorUpload" size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>
<script>
import Quill from 'quill';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options'
export default {
name: 'quill',
props: {
value: {
type: String,
default: ''
},
readonly: {
type: Boolean,
default:false
},
toTop: {
type: Boolean,
default:true
},
border: {
type: Boolean,
default:false
},
height: {
type: Number
},
minHeight: {
type: Number
},
/*
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏
*/
elseRead:{
type:String,default:'false'
}
},
data () {
return {
Quill: null,
currentValue: '',
options: {
theme: 'snow',
bounds: document.body,
debug: 'warn',
modules: {
toolbar: {
container: toolbarOptions,
handlers: {
'image': function (value) {
if (value) {
// iview
document.querySelector('.editorUpload').click()
} else {
this.Quill.format('image', false);
}
}
}
}
},
placeholder: '',
readOnly: this.readonly
},
loading: false
}
},
computed: {
classes () {
return [
{
'quill-no-border': !this.border
}
];
},
styles () {
let style = {};
if (this.minHeight) {
style.minHeight = `${this.minHeight}px`;
}
if (this.height) {
style.height = `${this.height}px`;
}
return style;
},
},
watch: {
value: {
handler (val) {
if (val !== this.currentValue) {
this.currentValue = val;
if (this.Quill) {
this.Quill.pasteHTML(this.value);
}
}
},
immediate: true
}
},
created(){
},
mounted () {
this.init();
//
if(this.elseRead==='true'){
let children = this.$refs.quill.children[0].style
children.padding = '0'
children.overflow = 'hidden'
children.height = '0'
children.borderTop = '0'
}
},
beforeDestroy () {
//
this.Quill = null;
},
methods: {
init () {
const editor = this.$refs.editor;
//
this.Quill = new Quill(editor, this.options);
//
this.Quill.pasteHTML(this.currentValue);
if(this.toTop){
this.$nextTick(() => {
window.scrollTo(0,0)
})
}
//
this.Quill.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText();
const quill = this.Quill;
//
this.currentValue = html;
// v-model
this.$emit('input', html);
//
this.$emit('on-change', { html, text, quill });
});
// quill
this.Quill.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
this.Quill.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
this.Quill.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
},
beforeUpload(file){
this.loading = true
},
editorUploadSuccess (res) {
//
let quill = this.Quill
//
if (res.data.filesResult.fileUrl) {
//
let length = quill.getSelection().index;
// res
quill.insertEmbed(length, 'image', res.data.filesResult.fileUrl)
//
quill.setSelection(length + 1)
} else {
this.$message.success('图片插入失败')
}
this.loading = false
},
}
}
</script>
<style lang="scss" scoped>
.quill-no-border{
.ql-toolbar.ql-snow{
border: none;
border-bottom: 1px solid #e8eaec;
}
.ql-container.ql-snow{
border: none;
}
}
.else{
.ql-toolbar.ql-snow{
height: 0;
overflow: hidden;
padding: 0;
border-top: 0;
}
}
</style>

@ -0,0 +1,16 @@
export default [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean'],
['link', 'image', 'video']
]

@ -40,7 +40,7 @@ Vue.prototype.encodeString = encodeString;
Vue.prototype.formatDate = formatDate; Vue.prototype.formatDate = formatDate;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(ElementUI); Vue.use(ElementUI, { size: 'small' });

@ -3,9 +3,9 @@ import Router from 'vue-router';
Vue.use(Router); Vue.use(Router);
let router = new Router({ let router = new Router({
mode: 'hash', mode: 'hash',
    base: process.env.BASE_URL, base: process.env.BASE_URL,
routes: [ routes: [
{ {
path: '/', path: '/',
@ -62,6 +62,16 @@ let router = new Router({
component: () => import( '../views/serve/AddConfigure.vue'), component: () => import( '../views/serve/AddConfigure.vue'),
meta: { title: '新增配置' } meta: { title: '新增配置' }
}, },
{
path: '/projectList',
component: () => import( '../views/serve/projectList.vue'),
meta: { title: '项目管理' }
},
{
path: '/projectAdd',
component: () => import( '../views/serve/projectAdd.vue'),
meta: { title: '项目配置' }
},
{ {
path: '/curriculum', path: '/curriculum',
component: () => import( '../views/course/Curriculum.vue'), component: () => import( '../views/course/Curriculum.vue'),
@ -72,6 +82,11 @@ let router = new Router({
component: () => import( '../views/course/AddCurriculum.vue'), component: () => import( '../views/course/AddCurriculum.vue'),
meta: { title: '新建课程' } meta: { title: '新建课程' }
}, },
{
path: '/contentSettings',
component: () => import( '../views/course/courseconfig.vue'),
meta: { title: '内容设置' }
},
{ {
path: '/addlink', path: '/addlink',
component: () => import( '../views/course/AddLink.vue'), component: () => import( '../views/course/AddLink.vue'),
@ -116,15 +131,15 @@ let router = new Router({
] ]
}); });
router.beforeEach(function(to,from,next){ router.beforeEach(function(to, from, next) {
// 根据路由元信息设置文档标题 // 根据路由元信息设置文档标题
window.document.title = to.meta.title || '中台' window.document.title = to.meta.title || '中台';
//使用钩子函数对路由进行权限跳转 //使用钩子函数对路由进行权限跳转
if (!sessionStorage.getItem('token') && to.path !== '/login') { if (!sessionStorage.getItem('token') && to.path !== '/login') {
next('/login'); next('/login');
} else { } else {
next(); next();
} }
}) });
export default router export default router;

@ -0,0 +1,34 @@
/**
* 业务配置
* */
const url = location.host;
const isDev = process.env.NODE_ENV === 'development'; // 开发环境
const isTest = url.includes('10.196.131.73'); //测试服
const isPro = url.includes('120.78.127.12'); //正式服
let jumpPath = "";
let host = "";
if (isDev) {
jumpPath = "http://192.168.31.154:8087/";
// host = 'http://192.168.31.216:9000'// 榕
host = 'http://192.168.31.125:9000'// 坤
// host = 'http://192.168.31.137:9000'// 陈赓
} else if (isTest) {
jumpPath = "";
host = "http://39.108.250.202:9000";
} else if (isPro) {
jumpPath = "";
host = "";
}
const Setting = {
/**
* 基础配置
* */
jumpPath, // 跳转路径前缀
host, // 请求路径前缀
};
export default Setting;

@ -14,11 +14,26 @@ const store = new Vuex.Store({
orderId: '', orderId: '',
userLoginId: '', userLoginId: '',
userName: '', userName: '',
roleId: '',
loginToken: '', loginToken: '',
schoolId: '' schoolId: '',
lastSystemId: null,
projectFields: {},
},
actions: {
setSystemId({ state,commit },systemId) {
commit('SET_SYSTEM_ID',systemId)
},
setProject({ state,commit },projectFields) {
commit('SET_PROJECT',projectFields)
},
}, },
mutations:{ mutations:{
SET_SYSTEM_ID: (state, systemId) => {
state.lastSystemId = systemId
},
SET_PROJECT: (state, projectFields) => {
state.projectFields = projectFields
},
userAvatar(state,payload){ userAvatar(state,payload){
state.avatar = payload.avatar state.avatar = payload.avatar
}, },
@ -52,6 +67,7 @@ const store = new Vuex.Store({
schoolIdData (state, payload) { schoolIdData (state, payload) {
state.schoolId = payload.schoolId state.schoolId = payload.schoolId
}, },
} }
}); });

@ -1,15 +1,16 @@
import Setting from '@/setting';
// let host = Setting.host;
let uploadURL = "http://8.134.8.197:8001";
let host = "http://192.168.31.151:9000"; // 榕
let host = 'http://39.108.250.202:9000'
let host1 = 'http://192.168.31.216:9000'//榕
let host2 = 'http://192.168.31.125:9000'//林
// let host = 'http://192.168.31.137:9000'// 陈赓
export default { export default {
upload:`${host}/nakadai/nakadai/oss/fileUpload`,// 上传文件-订单
logins: `${host}/users/users/user/login`, //登录 logins: `${host}/users/users/user/login`, //登录
verification:`${host}/users/users/user/captcha`,// 验证码图片 verification:`${host}/users/users/user/captcha`,// 验证码图片
bindPhoneOrEmail:`${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 bindPhoneOrEmail:`${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
sendPhoneOrEmailCode:`${host} /users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 sendPhoneOrEmailCode:`${host} /users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
// 订单管理 // 订单管理
orderAdd:`${host}/nakadai/nakadai/order/add`,// 订单添加 orderAdd:`${host}/nakadai/nakadai/order/add`,// 订单添加
orderDelete:`${host}/nakadai/nakadai/order/delete`,// 删除定单 orderDelete:`${host}/nakadai/nakadai/order/delete`,// 删除定单
@ -54,8 +55,8 @@ export default {
updatePersonCenter: `${host}/users/users/userAccount/updatePersonCenter`, updatePersonCenter: `${host}/users/users/userAccount/updatePersonCenter`,
updateUserAvatars: `${host}/users/users/userAccount/updateUserAvatars`, updateUserAvatars: `${host}/users/users/userAccount/updateUserAvatars`,
userInfo: `${host}/users/users/userAccount/userInfo`, userInfo: `${host}/users/users/userAccount/userInfo`,
bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`, // bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`, // sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,
updateAccountEnable: `${host}/users/users/userAccount/updateAccountEnable`, updateAccountEnable: `${host}/users/users/userAccount/updateAccountEnable`,
updateAccountAllEnable: `${host}/users/users/userAccount/updateAccountAllEnable`, updateAccountAllEnable: `${host}/users/users/userAccount/updateAccountAllEnable`,
examinePassword: `${host}/users/users/userAccount/examinePassword`, examinePassword: `${host}/users/users/userAccount/examinePassword`,
@ -74,23 +75,78 @@ export default {
queryCourseList: `${host}/liuwanr/order/queryCourseList`, //查询订单课程列表 queryCourseList: `${host}/liuwanr/order/queryCourseList`, //查询订单课程列表
isDeliverGoods: `${host}/liuwanr/order/isDeliverGoods`, //是否上架课程 isDeliverGoods: `${host}/liuwanr/order/isDeliverGoods`, //是否上架课程
deleteCourse: `${host}/liuwanr/course/deleteCourse`, //删除课程 //服务配置
updateCourse: `${host}/liuwanr/course/updateCourse`, //更新课程
addCourse: `${host}/liuwanr/course/addCourse`, //添加课程
queryCourse: `${host}/liuwanr/course/queryCourse`, //查询课程
queryCourseDetails: `${host}/liuwanr/course/queryCourseDetails`, //查询课程详情
isShelves: `${host}/liuwanr/course/isShelves`, //是否上架课程
queryCourseNameIsExists: `${host}/liuwanr/course/queryCourseNameIsExists`, //查询课程名称是否存在
deleteServiceConfig: `${host}/liuwanr/serviceConfig/deleteServiceConfig`, //删除服务配置 deleteServiceConfig: `${host}/liuwanr/serviceConfig/deleteServiceConfig`, //删除服务配置
updateServiceConfig: `${host}/liuwanr/serviceConfig/updateServiceConfig`, //更新服务配置 updateServiceConfig: `${host}/liuwanr/serviceConfig/updateServiceConfig`, //更新服务配置
addServiceConfig: `${host}/liuwanr/serviceConfig/addServiceConfig`, //添加服务配置 addServiceConfig: `${host}/liuwanr/serviceConfig/addServiceConfig`, //添加服务配置
queryServiceConfig: `${host}/liuwanr/serviceConfig/queryServiceConfig`, //查询服务配置
queryServiceConfigDetails: `${host}/liuwanr/serviceConfig/queryServiceConfigDetails`, //查询服务配置详情 queryServiceConfigDetails: `${host}/liuwanr/serviceConfig/queryServiceConfigDetails`, //查询服务配置详情
queryServiceConfig: `${host}/nakadai/serviceConfiguration/getAllService`, //查询服务配置
// 项目管理
avgValues: `${host}/occupationlab/projectManage/avgValues`, // 平均分分配值
deleteProjectManage: `${host}/occupationlab/projectManage/deleteProjectManage`, // 新增项目管理
getProjectBySystemId: `${host}/occupationlab/projectManage/getProjectBySystemId`, // 根据系统id获取全部项目
queryNameIsExist: `${host}/occupationlab/projectManage/queryNameIsExist`, // 新增/编辑项目管理名称判重
queryProjectManage: `${host}/occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选)
updateIsOpen: `${host}/occupationlab/projectManage/updateIsOpen`, // 更新开启状态
getProjectDetail: `${host}/occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情
addProjectManage: `${host}/occupationlab/projectManage/addProjectManage`, // 新增项目管理
updateProjectManage: `${host}/occupationlab/projectManage/updateProjectManage`, // 修改项目管理
copyProjectManage: `${host}/occupationlab/projectManage/copyProjectManage`, // 复制项目管理
// 判分点
getBcJudgmentPoint: `${host}/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `${host}/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
// 课程管理三级联查
courseDiscipline: `${host}/nakadai/nakadai/subject/courseDiscipline`, //课程学科类别
courseProfessionalClass: `${host}/nakadai/nakadai/subject/courseProfessionalClass`, //课程专业类
courseProfessional: `${host}/nakadai/nakadai/subject/courseProfessional`, //课程专业
//课程管理
curriculumList: `${host}/nakadai/nakadai/curriculum/curriculumList`, //课程列表
createCurriculum: `${host}/nakadai/nakadai/curriculum/createCurriculum`, //创建课程
curriculumDetail: `${host}/nakadai/nakadai/curriculum/curriculumDetail`, //课程详情
modifyCourse: `${host}/nakadai/nakadai/curriculum/modifyCourse`, //编辑课程
delCourse: `${host}/nakadai/nakadai/curriculum/delCourse`, //单个、批量删除课程
isShelves: `${host}/nakadai/nakadai/curriculum/isShelves`, //上下架课程
getInternalProjectBySystemId: `${host}/occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目
// 课程章节管理
addChapter: `${host}/nakadai/curriculum/chapter/addChapter`, //添加章节
editChapter: `${host}/nakadai/curriculum/chapter/editChapter`, //修改章节
deleteChapter: `${host}/nakadai/curriculum/chapter/deleteChapter`, //根据id删除章节
queryChaptersAndSubsections: `${host}/nakadai/curriculum/chapter/queryChaptersAndSubsections`, //根据课程id查询章节小节,树状结构
reorder: `${host}/nakadai/curriculum/chapter/reorder`, //编辑排序
// 课程小节管理
addSubsection: `${host}/nakadai/curriculum/subsection/addSubsection`, //添加小节
deleteSubsection: `${host}/nakadai/curriculum/subsection/deleteSubsection`, //根据id删除小节
editSubsection: `${host}/nakadai/curriculum/subsection/editSubsection`, //修改小节
getSubsection: `${host}/nakadai/curriculum/subsection/getSubsection`, //根据小节id获取预览文件地址
// 阿里云文件/视频管理
fileDeletion: `${host}/nakadai/nakadai/oss/fileDeletion`, // 删除OSS文件
fileupload: `${host}/nakadai/nakadai/oss/fileUpload`, // 文件上传
getPlayAuth: `${host}/nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证
queryProvince: `${host}/nakadai/nakadai/province/queryProvince`, //查询省份 queryProvince: `${host}/nakadai/nakadai/province/queryProvince`, //查询省份
queryCity: `${host}/nakadai/nakadai/city/queryCity`, //查询城市 queryCity: `${host}/nakadai/nakadai/city/queryCity`, //查询城市
queryCourseDiscipline: `${host}/nakadai/nakadai/discipline/queryDiscipline`, //查询课程学科 queryCourseDiscipline: `${host}/nakadai/nakadai/discipline/queryDiscipline`, //查询课程学科
queryCourseProfessionalClass: `${host}/nakadai/nakadai/professionalClass/queryProfessionalClass`, //查询专业类 queryCourseProfessionalClass: `${host}/nakadai/nakadai/professionalClass/queryProfessionalClass`, //查询专业类
queryCourseProfessional: `${host}/nakadai/nakadai/professional/queryProfessional`, //查询专业 queryCourseProfessional: `${host}/nakadai/nakadai/professional/queryProfessional`, //查询专业

@ -66,8 +66,8 @@ function systemAttributionStatus (sts) {
function courseTypeStatus (sts) { function courseTypeStatus (sts) {
const status = { const status = {
'1': '实训课程', '0': '实训课程',
'2': '理论课程' '1': '理论课程'
} }
return status[sts] || '未知状态' return status[sts] || '未知状态'
} }

@ -32,7 +32,7 @@
@keyup.enter.native="submitForm()" @keyup.enter.native="submitForm()"
> >
</el-input> </el-input>
<img style="cursor: pointer;" @click="blur" :src="verificationIMG" class="verification" alt=""> <img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;"> <div style="width:100%;display:flex;justify-content: flex-end;">
@ -62,7 +62,7 @@
@keyup.enter.native="submitForm('phone')" @keyup.enter.native="submitForm('phone')"
> >
</el-input> </el-input>
<img style="cursor: pointer;" @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt=""> <img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;"> <div style="width:100%;display:flex;justify-content: flex-end;">
@ -308,7 +308,7 @@ export default {
top: 50px; top: 50px;
transform: translate(-50%,0); transform: translate(-50%,0);
} }
.ms-login { /deep/ .ms-login {
position: relative; position: relative;
width: 1200px; width: 1200px;
height: calc(92vh - 60px); height: calc(92vh - 60px);
@ -316,6 +316,20 @@ export default {
background-image: url(../assets/img/login-input.png); background-image: url(../assets/img/login-input.png);
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36);
overflow: hidden; overflow: hidden;
.el-input__inner {
height: 80px;
line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.verification{
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
cursor: pointer;
}
} }
.title{ .title{
font-size: 16px; font-size: 16px;
@ -389,13 +403,7 @@ img{
width:80px; width:80px;
margin-right: 30px; margin-right: 30px;
} }
.verification{
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
}
.el-menu-demo{ .el-menu-demo{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

File diff suppressed because it is too large Load Diff

@ -10,9 +10,10 @@
<span class="per_school">添加环节</span> <span class="per_school">添加环节</span>
</div> </div>
<div> <div>
<el-button type="primary" size="small" round class="mag" @click="saveAdd('form')">确定</el-button> <el-button type="primary" size="small" round class="mag" @click="saveAdd('form')">确定
</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
@ -29,10 +30,12 @@
<ul class="mgb20"> <ul class="mgb20">
<li v-for="(item,index) in form.courseList" :key="index" class="flex-between"> <li v-for="(item,index) in form.courseList" :key="index" class="flex-between">
<div style="width: 50%;"> <div style="width: 50%;">
<el-form-item label="环节名称" :prop="'courseList.' + index + '.linkName'" :rules="{required: true, message: '请输入项目课件', trigger: 'blur'}"> <el-form-item label="环节名称" :prop="'courseList.' + index + '.linkName'"
:rules="{required: true, message: '请输入项目课件', trigger: 'blur'}">
<el-input placeholder="请输入项目课件" v-model="item.linkName"></el-input> <el-input placeholder="请输入项目课件" v-model="item.linkName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资源添加" :prop="'courseList.' + index + '.fileLink'" :rules="{required: true, message: '请添加文件', trigger: 'blur'}"> <el-form-item label="资源添加" :prop="'courseList.' + index + '.fileLink'"
:rules="{required: true, message: '请添加文件', trigger: 'blur'}">
<el-upload <el-upload
class="link_upload" class="link_upload"
:headers="{token}" :headers="{token}"
@ -44,17 +47,20 @@
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:file-list="item.uploadList"> :file-list="item.uploadList">
<el-button size="medium" type="primary" icon="el-icon-upload" class="uploadTitle">点击上传</el-button> <el-button size="medium" type="primary" icon="el-icon-upload"
class="uploadTitle">点击上传
</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
<el-button size="medium" type="primary" @click="delCourse(index)">删除课件</el-button> <el-button size="medium" type="primary" @click="delCourse(index)">删除课件
</el-button>
</div> </div>
</li> </li>
</ul> </ul>
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
@ -62,112 +68,114 @@
</template> </template>
<script> <script>
export default { export default {
data (){ data() {
return { return {
token: this.$store.state.loginToken, token: this.$store.state.loginToken,
form: { form: {
courseList: [{ courseList: [{
projectId: this.$store.state.systemId, projectId: this.$store.state.systemId,
courseId : this.$store.state.courseId, courseId: this.$store.state.courseId,
linkName: '', linkName: "",
fileLink: '', fileLink: "",
uploadList: [] uploadList: []
}], }]
},
} }
};
},
mounted() {
this.getData();
},
methods: {
getData() {
let data = {
projectId: this.form.courseList[0].projectId,
courseId: this.form.courseList[0].courseId
};
this.$get(this.api.queryLinkDetails, data).then((res) => {
res.message.map(e => {
var arr = [];
arr.push({ name: e.linkName, url: e.fileLink });
this.$set(e, "uploadList", arr);
});
this.form.courseList = res.message;
}).catch((res) => {
});
}, },
mounted() { saveAdd(formName) {
this.getData() this.$refs[formName].validate((valid) => {
if (valid) {
var arr = this.form.courseList.map(v => {
var obj = {
...v
};
delete obj.uploadList;
return obj;
});
let data = {
courseLink: arr
};
this.$post(this.api.addCourseLink, data).then((res) => {
this.$message.success("添加成功!");
this.goback();
}).catch((res) => {
});
}
});
}, },
methods: { addcourse() {
getData(){ this.form.courseList = this.form.courseList.concat({
let data = { projectId: this.$store.state.systemId,
projectId: this.form.courseList[0].projectId, courseId: this.$store.state.courseId,
courseId: this.form.courseList[0].courseId linkName: "",
fileLink: "",
uploadList: []
});
},
//
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(response, file, fileList, idx) {
this.form.courseList[idx].uploadList.push({ name: file.name, url: response.message.fileUrl });
this.form.courseList[idx].fileLink = response.message.fileUrl;
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList, idx) {
let uploadList = this.form.courseList[idx].uploadList;
uploadList.forEach((item, index) => {
if (file.name == item.name) {
uploadList.splice(index, 1);
} }
this.$get(this.api.queryLinkDetails,data).then((res) => { });
res.message.map(e =>{ },
var arr = [] delCourse(index) {
arr.push({ name: e.linkName, url: e.fileLink }); this.$confirm("确定要删除该课件吗?", "提示", {
this.$set(e,"uploadList",arr) type: "warning"
}) })
this.form.courseList = res.message
}).catch((res) => {})
},
saveAdd(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
var arr = this.form.courseList.map(v=>{
var obj = {
...v
}
delete obj.uploadList
return obj
})
let data = {
courseLink: arr
}
this.$post(this.api.addCourseLink,data).then((res) => {
this.$message.success("添加成功!");
this.goback()
}).catch((res) => {
})
}
})
},
addcourse(){
this.form.courseList = this.form.courseList.concat({
projectId: this.$store.state.systemId,
courseId : this.$store.state.courseId,
linkName: '',
fileLink: '',
uploadList: []
})
},
//
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(response, file, fileList, idx) {
this.form.courseList[idx].uploadList.push({ name: file.name, url: response.message.fileUrl });
this.form.courseList[idx].fileLink = response.message.fileUrl
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList, idx) {
let uploadList = this.form.courseList[idx].uploadList;
uploadList.forEach((item, index) => {
if (file.name == item.name) {
uploadList.splice(index, 1);
}
});
},
delCourse(index){
this.$confirm('确定要删除该课件吗?', '提示', {
type: 'warning'
})
.then(() => { .then(() => {
this.form.courseList.splice(index, 1); this.form.courseList.splice(index, 1);
this.$message.success('删除成功'); this.$message.success("删除成功");
}) })
.catch(() => {}); .catch(() => {
}, });
goback(){ },
this.$router.go(-1) goback() {
} this.$router.go(-1);
} }
} }
};
</script> </script>
<style scoped> <style scoped>
@ -175,20 +183,22 @@
width: 30%; width: 30%;
} */ } */
.courseware ul li{ .courseware ul li {
margin-top: 20px; margin-top: 20px;
padding: 0 0 10px 0; padding: 0 0 10px 0;
border-bottom: 1px dashed #eee; border-bottom: 1px dashed #eee;
} }
.courseware ul li:first-child{
.courseware ul li:first-child {
margin-top: 0; margin-top: 0;
} }
.courseware ul li:last-child{ .courseware ul li:last-child {
border-bottom: none; border-bottom: none;
} }
.uploadTitle{
height: 40px !important; .uploadTitle {
font-size: 16px; height: 40px !important;
font-size: 16px;
} }
</style> </style>

@ -12,42 +12,55 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="5"> <el-col :span="5">
<el-form-item label="学科类别"> <el-form-item label="学科类别">
<el-select v-model="form.subjectType" clearable placeholder="请选择学科类别" @change="getProfessionalClass()" @clear="clearClass()"> <el-select v-model="form.categoryId" clearable
<el-option v-for="(item,index) in subjectList" :key="index" :label="item.disciplineName" :value="item.disciplineId"></el-option> @change="getProfessionalClass()" @clear="clearClass()">
<el-option v-for="(item,index) in subjectList" :key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="专业类"> <el-form-item label="专业类">
<el-select v-model="form.professionalClass" clearable placeholder="请选择专业类" <el-select v-model="form.professionalCategoryId" clearable
:disabled="form.subjectType ? false : true" @change="getProfessional()" @clear="clearProfess()"> :disabled="form.categoryId ? false : true"
<el-option v-for="(item,index) in ProfessionalClassList" :key="index" :label="item.professionalClassName" :value="item.professionalClassId"></el-option> @change="getProfessional()" @clear="clearProfess()">
<el-option v-for="(item,index) in ProfessionalClassList" :key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="专业"> <el-form-item label="专业">
<el-select v-model="form.professional" clearable placeholder="请选择专业" <el-select v-model="form.professionalId" clearable
:disabled="form.professionalClass ? false : true" @change="getData()"> :disabled="form.professionalCategoryId ? false : true"
<el-option v-for="(item,index) in ProfessionalList" :key="index" :label="item.professionalName" :value="item.professionalId"></el-option> @change="getData()">
<el-option v-for="(item,index) in ProfessionalList" :key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-form-item label="课程类型"> <el-form-item label="课程类别">
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData()"> <el-select v-model="form.curriculumType" clearable
<el-option v-for="(item,index) in CourseTypeList" :key="index" :label="item.name" :value="item.value"></el-option> @change="getData()">
<el-option label="理论课程" :value="0"></el-option>
<el-option label="实训课程" :value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item> <el-form-item>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="form.CustomerSearch" clearable @keyup.enter.native="onSearch"></el-input> <el-input placeholder="请输入课程名称" prefix-icon="el-icon-search"
v-model="form.curriculumName" clearable
@keyup.enter.native="onSearch"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</div> </div>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -59,47 +72,49 @@
<span>课程列表</span> <span>课程列表</span>
</div> </div>
<div> <div>
<el-button type="primary" size="small" round class="mag" @click="addcourse">新建课程</el-button> <el-button type="primary" round class="mag" @click="addcourse">新建课程</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> <el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table v-loading="loading" :data="courseData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table v-loading="loading" :data="courseData" class="table" stripe header-align="center"
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="selection" width="55" align="center"
</el-table-column> :reserve-selection="true"></el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
</el-table-column> <el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
<el-table-column prop="courseType" label="课程类型" align="center"> <el-table-column prop="curriculumType" label="课程类型" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="配置的实训应用" align="center"> <el-table-column label="配置的实训应用" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="ellipsis">{{scope.row.systemName}}</span> <span class="ellipsis">{{ scope.row.sysName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseHours" label="订单量量" align="center"> <el-table-column prop="orderVolume" label="订单量" align="center"></el-table-column>
</el-table-column> <el-table-column prop="expectedCourse" label="预计课时" align="center"></el-table-column>
<el-table-column prop="courseHours" label="预计课时" align="center">
</el-table-column>
<el-table-column label="上架/下架" align="center"> <el-table-column label="上架/下架" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.isShelves" v-model="scope.row.isEnable"
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
@change="changeSwitch(scope.row)"> @change="changeSwitch($event, scope.row)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="config(scope.row)">内容设置</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> <el-pagination background @current-change="handleCurrentChange" :current-page="pageNo"
</el-pagination> layout="total, prev, pager, next" :total="totals"></el-pagination>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -109,183 +124,169 @@
<script> <script>
export default { export default {
name: 'customer', name: "customer",
data() { data() {
return { return {
name: localStorage.getItem('ms_username'), courseTypeStatus: {
courseData:[ 0: "理论课程",
{} 1: "实训课程"
], },
name: localStorage.getItem("ms_username"),
courseData: [],
form: { form: {
courseType: '', categoryId: "",
subjectType: '', professionalCategoryId: "",
professionalClass: '', professionalId: "",
professional: '', curriculumType: "",
CustomerSearch: '', curriculumName: ""
}, },
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
totals: 1, totals: 1,
subjectList: [], subjectList: [], //
ProfessionalClassList: [], ProfessionalClassList: [], //
ProfessionalList: [], ProfessionalList: [], //
multipleSelection: [], multipleSelection: [],
CourseTypeList: [{ loading: false
name: '实训课程',
value: 1
},
{
name: '理论课程',
value: 2
}],
loading: false
}; };
}, },
mounted() { mounted() {
this.getSubject() this.getSubject();
this.getData() this.getData();
}, },
methods: { methods: {
getRowKeys(row) {
return row.cid;
},
//
getData() { getData() {
let data = { let data = {
courseType: this.form.courseType, ...this.form,
disciplineId: this.form.subjectType, pageNum: this.pageNo,
professionalClassId: this.form.professionalClass, pageSize: this.pageSize
professionalId: this.form.professional, };
searchContent: this.form.CustomerSearch, this.$post(this.api.curriculumList, data).then(res => {
pageNo: this.pageNo, this.courseData = res.page.records;
pageSize: this.pageSize, this.totals = res.page.total;
} this.loading = false;
// this.$get(this.api.queryCourse,data).then(res => { }).catch(err => {
// res.message.rows.forEach(e => { });
// e.courseType = this.courseTypeStatus(e.courseType)
// e.courseHours = this.hoursStatus(e.courseHours)
// })
// this.courseData = res.message.rows
// this.totals = res.message.total
// this.loading = false
// }).catch(res => {});
}, },
// //
getSubject(){ getSubject() {
// this.$get(this.api.queryCourseDiscipline).then(res => { this.$get(this.api.courseDiscipline).then(res => {
// this.subjectList = res.message this.subjectList = res.list;
// }).catch(res => {}); }).catch(err => {
});
}, },
// //
clearClass(){ clearClass() {
this.form.professionalClass = '', this.form.professionalCategoryId = "",
this.form.professional = '' this.form.professionalId = "";
}, },
// //
getProfessionalClass(){ getProfessionalClass() {
this.clearClass() this.clearClass();
this.getProfessionalClassData() this.getProfessionalClassData();
this.pageNo = 1 this.pageNo = 1;
this.getData() this.getData();
}, },
getProfessionalClassData(){ getProfessionalClassData() {
let data = { let data = {
disciplineId: this.form.subjectType disciplineId: this.form.categoryId
} };
this.$get(this.api.queryCourseProfessionalClass,data).then(res => { this.$get(this.api.courseProfessionalClass, data).then(res => {
this.ProfessionalClassList = res.message this.ProfessionalClassList = res.list;
}).catch(res => {}); }).catch(err => {
});
}, },
// //
clearProfess(){ clearProfess() {
this.form.professional = '' this.form.professionalId = "";
}, },
// //
getProfessional(){ getProfessional() {
this.clearProfess() this.clearProfess();
this.getProfessionalData() this.getProfessionalData();
this.pageNo = 1 this.pageNo = 1;
this.getData() this.getData();
}, },
getProfessionalData(){ getProfessionalData() {
let data = { let data = {
professionalClassId: this.form.professionalClass professionalClassId: this.form.professionalCategoryId
} };
this.$get(this.api.queryCourseProfessional,data).then(res => { this.$get(this.api.courseProfessional, data).then(res => {
this.ProfessionalList = res.message this.ProfessionalList = res.list;
}).catch(res => {}); }).catch(err => {
});
}, },
addcourse(){ //
this.$store.commit("courseData", { course_id : ''}); addcourse() {
this.$router.push('/addcurriculum'); this.$router.push("/addcurriculum");
}, },
edit(row){ //
this.$store.commit("courseData", { course_id : row.courseId}); edit(row) {
this.$router.push('/addcurriculum'); this.$router.push(`/addcurriculum?cid=${row.cid}`);
}, },
//
config(row) {
this.$router.push(`/contentSettings?cid=${row.cid}`);
},
//
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) }).then(() => {
.then(() => { this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
let result = row.courseId this.getData();
var arr = [] this.$message.success("删除成功");
arr.push(result) }).catch(err => {});
let data = arr }).catch(() => {});
this.$post(this.api.deleteCourse,data).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}, },
//
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
getRowKeys(row) {
return row.courseId;
},
// //
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length) {
let arr = this.multipleSelection this.$confirm("确定要删除吗?", "提示", {
let result = arr.map(e => e.courseId) type: "warning"
this.$confirm('确定要删除吗?', '提示', { }).then(() => {
type: 'warning' let ids = this.multipleSelection.map(i => i.cid);
}) this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
.then(() => { this.getData();
let data = result this.$message.success("删除成功");
this.$post(this.api.deleteCourse,data).then(res => { }).catch(err => {});
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {}); }).catch(() => {});
}else{ } else {
this.$message.error('请先选择课程 !'); this.$message.warning("请先选择课程 !");
} }
}, },
//
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.getData(); this.getData();
}, },
onSearch(){ //
this.pageNo = 1 onSearch() {
this.getData() this.pageNo = 1;
this.getData();
}, },
// //
changeSwitch (row) { changeSwitch(value, row) {
let data = { this.$post(`${this.api.isShelves}?cid=${row.cid}&isEnable=${value}`).then((res) => {
courseId: row.courseId, this.getData();
isShelves: row.isShelves this.$message.success("修改上下架状态成功!");
} }).catch((res) => {
// this.$post(this.api.isShelves,data).then((res) => { })
// this.getData(); }
// this.$message.success("");
// }).catch((res) => {
// })
},
} }
}; };
</script> </script>
<style scoped> <style scoped>
.mag{ .mag {
margin-right: 20px; margin-right: 20px;
} }
</style> </style>

@ -15,20 +15,28 @@
</template> </template>
</div> </div>
</div> </div>
<div class="page-content"> <div class="page-content">
<div class="m-b-20" v-for="(chapter,index) in chapters" :key="chapter.id"> <div class="m-b-20" v-for="(chapter,index) in chapters" :key="chapter.id">
<div class="flex j-between a-center m-b-10"> <div class="flex j-between a-center m-b-10">
<div>{{chapter.name}}</div> <div>{{ chapter.name }}</div>
<div> <div>
<template v-if="!sorting"> <template v-if="!sorting">
<el-button class="action-btn" type="primary" size="small" round v-throttle @click="editChapter(chapter)">修改章节名称</el-button> <el-button class="action-btn" type="primary" size="small" round v-throttle
<el-button class="action-btn" type="primary" size="small" round v-throttle @click="addSection(chapter.id)">添加小节</el-button> @click="editChapter(chapter)">修改章节名称
<el-button class="action-btn" type="primary" size="small" round v-throttle @click="delChapter(chapter.id)">删除</el-button> </el-button>
<el-button class="action-btn" type="primary" size="small" round v-throttle
@click="addSection(chapter.id)">添加小节
</el-button>
<el-button class="action-btn" type="primary" size="small" round v-throttle
@click="delChapter(chapter.id)">删除
</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" :class="{disabled: index == 0}" style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i> <i class="el-icon-top sort-icon" :class="{disabled: index == 0}"
<i class="el-icon-bottom sort-icon" :class="{disabled: index == chapters.length-1}" @click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i> style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i>
<i class="el-icon-bottom sort-icon" :class="{disabled: index == chapters.length-1}"
@click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i>
</template> </template>
</div> </div>
</div> </div>
@ -38,7 +46,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="fileType" label="资源类型" align="center"> <el-table-column prop="fileType" label="资源类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{transferType(scope.row.fileType)}} {{ transferType(scope.row.fileType) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="300">
@ -46,19 +54,25 @@
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="text" @click="preview(scope.row)">查看</el-button> <el-button type="text" @click="preview(scope.row)">查看</el-button>
<el-button type="text" @click="delSection(scope.row)">删除</el-button> <el-button type="text" @click="delSection(scope.row)">删除</el-button>
<el-button type="text" @click="editSectionName(scope.row,chapter.id)">修改小节名称</el-button> <el-button type="text" @click="editSectionName(scope.row,chapter.id)">修改小节名称
</el-button>
<el-button type="text" @click="switchFile(scope.row,chapter.id)">更换文件</el-button> <el-button type="text" @click="switchFile(scope.row,chapter.id)">更换文件</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" :class="{disabled: scope.$index == 0}" style="margin-right: 5px" @click="sortSection(index,'up',scope.$index == 0,scope.$index)"></i> <i class="el-icon-top sort-icon" :class="{disabled: scope.$index == 0}"
<i class="el-icon-bottom sort-icon" :class="{disabled: scope.$index == chapter.subsectionList.length-1}" @click="sortSection(index,'down',scope.$index == chapter.subsectionList.length-1,scope.$index)"></i> style="margin-right: 5px"
@click="sortSection(index,'up',scope.$index == 0,scope.$index)"></i>
<i class="el-icon-bottom sort-icon"
:class="{disabled: scope.$index == chapter.subsectionList.length-1}"
@click="sortSection(index,'down',scope.$index == chapter.subsectionList.length-1,scope.$index)"></i>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="24%" :close-on-click-modal="false"> <el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="24%"
:close-on-click-modal="false">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input> <el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input>
@ -70,7 +84,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="24%" @close="closeSection" :close-on-click-modal="false"> <el-dialog title="添加小节" :visible.sync="sectionVisible" width="24%" @close="closeSection"
:close-on-click-modal="false">
<el-form label-width="80px"> <el-form label-width="80px">
<el-form-item label="资源添加"> <el-form-item label="资源添加">
<el-upload <el-upload
@ -84,7 +99,7 @@
:action="this.api.fileupload" :action="this.api.fileupload"
:file-list="uploadList" :file-list="uploadList"
name="file" name="file"
> >
<el-button size="small"> 上传资源</el-button> <el-button size="small"> 上传资源</el-button>
<!-- <img src="../assets/img/upload.png" alt=""> --> <!-- <img src="../assets/img/upload.png" alt=""> -->
</el-upload> </el-upload>
@ -99,7 +114,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="更换文件" :visible.sync="switchVisible" width="28%" :close-on-click-modal="false" @close="closeSwitch"> <el-dialog title="更换文件" :visible.sync="switchVisible" width="28%" :close-on-click-modal="false"
@close="closeSwitch">
<div style="text-align: center"> <div style="text-align: center">
<el-upload <el-upload
:before-upload="beforeUpload" :before-upload="beforeUpload"
@ -135,18 +151,25 @@
</span> </span>
</el-dialog> </el-dialog>
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{active: previewImg}" style="z-index: 2000"> <div v-show="previewImg" class="el-image-viewer__wrapper" :class="{active: previewImg}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i class="el-icon-circle-close" style="color: #fff"></i></span> <span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<img :src="previewImg" class="el-image-viewer__img" style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;"> <img :src="previewImg" class="el-image-viewer__img"
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
</div> </div>
</div> </div>
<div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}" style="z-index: 2000"> <div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" :class="{'doc-close': isWord}" :style="{top: isWord ? '50px' : '5px'}" @click="closeIframe"><i class="el-icon-circle-close" style="color: #fff"></i></span> <span class="el-image-viewer__btn el-image-viewer__close" :class="{'doc-close': isWord}"
:style="{top: isWord ? '50px' : '5px'}" @click="closeIframe"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> <iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc"
frameborder="0"></iframe>
<template v-if="showMask"> <template v-if="showMask">
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div> <div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div> <div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
@ -154,16 +177,19 @@
<template v-if="showMask1"> <template v-if="showMask1">
<div class="word-mask1" style="width: 200px;height: 50px;"></div> <div class="word-mask1" style="width: 200px;height: 50px;"></div>
<div class="word-mask" style="height: 40px;top: 48px;"></div> <div class="word-mask" style="height: 40px;top: 48px;"></div>
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div> <div class="word-mask2"
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template> </template>
<template v-if="showMask2 && iframeSrc"> <template v-if="showMask2 && iframeSrc">
<div class="excel-mask1" style="height: 48px;"></div> <div class="excel-mask1" style="height: 48px;"></div>
</template> </template>
</div> </div>
</div> </div>
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}" style="z-index: 2000"> <div v-show="playAuth" class="el-image-viewer__wrapper" :class="{active: playAuth}"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i class="el-icon-circle-close" style="color: #fff"></i></span> <span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="player" id="player"></div> <div class="player" id="player"></div>
</div> </div>
@ -173,35 +199,35 @@
</div> </div>
</template> </template>
<script> <script>
import { Loading } from 'element-ui'; import { Loading } from "element-ui";
// import pdf from '../../components/pdf.vue' // import pdf from '../../components/pdf.vue'
// import breadcrumb from '@/components/breadcrumb' // import breadcrumb from '@/components/breadcrumb'
export default { export default {
data() { data() {
return { return {
id: '', id: "",
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
chapters: [], chapters: [],
sorting: false, sorting: false,
uploading: false, uploading: false,
uploadList: [], uploadList: [],
chapterVisible: false, chapterVisible: false,
chapterId: '', chapterId: "",
chapterName: '', chapterName: "",
sectionVisible: false, sectionVisible: false,
sectionName: '', sectionName: "",
sectionId: '', sectionId: "",
switchVisible: false, switchVisible: false,
sectionNameVisible: false, sectionNameVisible: false,
fileId: '', fileId: "",
fileName: '', fileName: "",
fileUrl: '', fileUrl: "",
originalFileName: '', originalFileName: "",
fileType: '', fileType: "",
playAuth: '', playAuth: "",
player: null, player: null,
previewImg: '', previewImg: "",
iframeSrc: '', iframeSrc: "",
curFile: {}, curFile: {},
isAddSection: false, isAddSection: false,
isWord: false, isWord: false,
@ -212,18 +238,18 @@ export default {
showMask2: false, showMask2: false,
loadIns: null, loadIns: null,
pdfVisible: false, pdfVisible: false,
pdfSrc: '', pdfSrc: "",
previewing: false previewing: false
}; };
}, },
components: { components: {
// pdf, // pdf,
// breadcrumb // breadcrumb
}, },
mounted() { mounted() {
this.insertScript() this.insertScript();
this.id = this.$route.query.id this.id = this.$route.query.id;
this.id && this.getData() this.id && this.getData();
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL); history.pushState(null, null, document.URL);
window.addEventListener("popstate", this.goBack, false); window.addEventListener("popstate", this.goBack, false);
@ -235,74 +261,74 @@ export default {
methods: { methods: {
getData() { getData() {
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`)
.then(res => { .then(res => {
this.chapters = res.data.chapterList this.chapters = res.data.chapterList;
}) })
.catch(err => { .catch(err => {
}); });
}, },
goBack(){ goBack() {
if(this.previewing){ if (this.previewing) {
this.closeIframe() this.closeIframe();
}else{ } else {
history.back() history.back();
} }
}, },
iframeOnload(){ iframeOnload() {
document.querySelector('#fileIframe').onload = e => { document.querySelector("#fileIframe").onload = e => {
if(this.isPPT){ if (this.isPPT) {
this.showMask = true this.showMask = true;
}else{ } else {
this.showMask = false this.showMask = false;
} }
if(this.isWord){ if (this.isWord) {
this.showMask1 = true this.showMask1 = true;
}else{ } else {
this.showMask1 = false this.showMask1 = false;
} }
if(this.isExcel){ if (this.isExcel) {
this.showMask2 = true this.showMask2 = true;
}else{ } else {
this.showMask2 = false this.showMask2 = false;
} }
this.loadIns.close() this.loadIns.close();
} };
}, },
insertScript(){ insertScript() {
const linkTag = document.createElement('link'); const linkTag = document.createElement("link");
linkTag.rel = 'stylesheet'; linkTag.rel = "stylesheet";
linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css'; linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
document.body.appendChild(linkTag); document.body.appendChild(linkTag);
const scriptTag = document.createElement('script'); const scriptTag = document.createElement("script");
scriptTag.type = 'text/javascript'; scriptTag.type = "text/javascript";
scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'; scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
document.body.appendChild(scriptTag); document.body.appendChild(scriptTag);
}, },
// //
beforeUpload(file){ beforeUpload(file) {
let type = this.transferType(file.name.substring(file.name.lastIndexOf('.') + 1)) let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1));
if(type != '视频' && type != '图片' && type != 'pdf' && (file.size / 1024 / 1024) > 10){ if (type != "视频" && type != "图片" && type != "pdf" && (file.size / 1024 / 1024) > 10) {
this.errorMsg('请上传10M以内的文件') this.errorMsg("请上传10M以内的文件");
return false return false;
} }
this.uploading = true this.uploading = true;
this.originalFileName = file.name this.originalFileName = file.name;
if(this.isAddSection) this.sectionName = file.name.substring(0,file.name.lastIndexOf(".")) if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = file.name.substring(file.name.lastIndexOf('.')+1) this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.warningMsg( this.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploading = false this.uploading = false;
this.fileId = res.data.filesResult.fileId this.fileId = res.data.filesResult.fileId;
this.fileType = res.data.filesResult.fileType this.fileType = res.data.filesResult.fileType;
this.fileUrl = res.data.filesResult.fileUrl this.fileUrl = res.data.filesResult.fileUrl;
this.fileName = res.data.filesResult.ossFileName this.fileName = res.data.filesResult.ossFileName;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -312,112 +338,115 @@ export default {
}); });
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
if((file.size / 1024 / 1024) < 10){ if ((file.size / 1024 / 1024) < 10) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
} }
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.uploadList = fileList this.uploadList = fileList;
}, },
uploadSure(){ uploadSure() {
this.importVisible = false this.importVisible = false;
this.pageNo = 1 this.pageNo = 1;
this.staffGradeId = '' this.staffGradeId = "";
this.keyword = '' this.keyword = "";
this.getTeacher() this.getTeacher();
}, },
goback() { goback() {
this.$router.push('course') this.$router.push("course");
}, },
transferType(ext){ transferType(ext) {
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return '图片' if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return '视频' if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext return ext;
}, },
addChapter(){ addChapter() {
this.chapterName = '' this.chapterName = "";
this.chapterId = '' this.chapterId = "";
this.chapterVisible = true this.chapterVisible = true;
}, },
sort(){ sort() {
this.sorting = true this.sorting = true;
}, },
cancelSort(){ cancelSort() {
this.sorting = false this.sorting = false;
}, },
saveSort(){ saveSort() {
this.chapters.forEach((n,k) => { this.chapters.forEach((n, k) => {
n.sort = k+1 n.sort = k + 1;
n.subsectionList.forEach((j,i) => { n.subsectionList.forEach((j, i) => {
j.sort = i+1 j.sort = i + 1;
}) });
}) });
let data = { let data = {
chapterVOList: this.chapters chapterVOList: this.chapters
} };
this.$post(this.api.reorder,data).then(res => { this.$post(this.api.reorder, data).then(res => {
this.sorting = false this.sorting = false;
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
}, });
editChapter(item){ },
this.chapterId = item.id editChapter(item) {
this.chapterName = item.name this.chapterId = item.id;
this.chapterVisible = true this.chapterName = item.name;
}, this.chapterVisible = true;
delChapter(id){ },
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { delChapter(id) {
type: 'warning' this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
}) type: "warning"
.then(() => {
this.$del(`${this.api.deleteChapter}/${id}`).then(res => {
this.successMsg('删除成功');
this.getData()
}).catch(res => {});
}) })
.catch(() => {}); .then(() => {
}, this.$del(`${this.api.deleteChapter}/${id}`).then(res => {
closeSection(){ this.successMsg("删除成功");
this.isAddSection = false this.getData();
}, }).catch(res => {
addSection(id){ });
this.chapterId = id })
this.sectionName = '' .catch(() => {
this.fileUrl = '' });
this.uploadList = [] },
this.sectionId = '' closeSection() {
this.isAddSection = true this.isAddSection = false;
this.sectionVisible = true },
}, addSection(id) {
chapterSubmit(){ this.chapterId = id;
if(!this.chapterName) return this.warningMsg('请填写章节名称') this.sectionName = "";
this.fileUrl = "";
this.uploadList = [];
this.sectionId = "";
this.isAddSection = true;
this.sectionVisible = true;
},
chapterSubmit() {
if (!this.chapterName) return this.warningMsg("请填写章节名称");
let data = { let data = {
courseId: this.id, courseId: this.id,
name: this.chapterName name: this.chapterName
} };
if(this.chapterId){ if (this.chapterId) {
data.id = this.chapterId data.id = this.chapterId;
this.$put(this.api.editChapter, data).then(res => { this.$put(this.api.editChapter, data).then(res => {
this.successMsg('修改成功'); this.successMsg("修改成功");
this.chapterVisible = false this.chapterVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}else{ } else {
this.$post(this.api.addChapter, data).then(res => { this.$post(this.api.addChapter, data).then(res => {
this.successMsg('添加成功'); this.successMsg("添加成功");
this.chapterVisible = false this.chapterVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
sectionSubmit(){ sectionSubmit() {
if(!this.sectionName) return this.warningMsg('请填写小节名称') if (!this.sectionName) return this.warningMsg("请填写小节名称");
if(this.uploading) return this.warningMsg('资源正在上传中,请稍候') if (this.uploading) return this.warningMsg("资源正在上传中,请稍候");
if(!this.fileUrl && !this.fileId) return this.warningMsg('请上传资源') if (!this.fileUrl && !this.fileId) return this.warningMsg("请上传资源");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
courseId: this.id, courseId: this.id,
@ -428,96 +457,97 @@ export default {
fileName: this.fileName, fileName: this.fileName,
fileType: this.fileType, fileType: this.fileType,
originalFileName: this.originalFileName originalFileName: this.originalFileName
} };
this.$post(this.api.addSubsection, data).then(res => { this.$post(this.api.addSubsection, data).then(res => {
this.successMsg('添加成功'); this.successMsg("添加成功");
this.sectionVisible = false this.sectionVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}, },
closeSwitch(){ closeSwitch() {
this.fileId = '' this.fileId = "";
this.fileName = '' this.fileName = "";
this.fileType = '' this.fileType = "";
this.fileUrl = '' this.fileUrl = "";
this.sectionId = '' this.sectionId = "";
}, },
preview(row){ preview(row) {
if(this.transferType(row.fileType) == '视频'){ if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth this.playAuth = res.data.playAuth;
if(this.player){ if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId,this.playAuth) this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
}else{ } else {
this.player = new Aliplayer({ this.player = new Aliplayer({
id: 'player', id: "player",
width: '100%', width: "100%",
autoplay: false, autoplay: false,
vid : row.fileId, vid: row.fileId,
playauth : this.playAuth, playauth: this.playAuth,
encryptType:1, // encryptType: 1 //
}) });
} }
}).catch(res => {}) }).catch(res => {
}else if(this.transferType(row.fileType) == '图片'){ });
this.previewImg = row.fileUrl } else if (this.transferType(row.fileType) == "图片") {
}else if(row.fileType == 'pdf'){ this.previewImg = row.fileUrl;
this.pdfSrc = row.fileUrl } else if (row.fileType == "pdf") {
this.pdfVisible = true this.pdfSrc = row.fileUrl;
}else{ this.pdfVisible = true;
} else {
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { this.$get(`${this.api.getSubsection}/${row.id}`).then(res => {
this.previewing = true this.previewing = true;
this.loadIns = Loading.service() this.loadIns = Loading.service();
this.$route.fullPath.includes('#file') || history.pushState({file: true},'文件预览','#' + this.$route.fullPath + '#file') this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file");
if(row.fileType == 'pptx'){ if (row.fileType == "pptx") {
this.isPPT = true this.isPPT = true;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
}else if(row.fileType == 'doc' || row.fileType == 'docx'){ } else if (row.fileType == "doc" || row.fileType == "docx") {
this.isPPT = false this.isPPT = false;
this.isWord = true this.isWord = true;
this.isExcel = false this.isExcel = false;
}else if(row.fileType == 'xls' || row.fileType == 'xlsx'){ } else if (row.fileType == "xls" || row.fileType == "xlsx") {
this.isExcel = true this.isExcel = true;
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
}else{ } else {
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
} }
this.iframeSrc = res.data.previewUrl this.iframeSrc = res.data.previewUrl;
this.$nextTick(() => { this.$nextTick(() => {
this.iframeOnload() this.iframeOnload();
}) });
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
editSectionName(row,chapterId){ editSectionName(row, chapterId) {
this.chapterId = chapterId this.chapterId = chapterId;
this.sectionId = row.id this.sectionId = row.id;
this.sectionName = row.name this.sectionName = row.name;
this.sectionNameVisible = true this.sectionNameVisible = true;
}, },
switchFile(row,chapterId,sectionId){ switchFile(row, chapterId, sectionId) {
this.uploadList = [] this.uploadList = [];
this.curFile = { this.curFile = {
fileId: row.fileId, fileId: row.fileId,
fileName: row.fileName, fileName: row.fileName,
fileType: row.fileType, fileType: row.fileType,
fileUrl: row.fileUrl, fileUrl: row.fileUrl
} };
this.chapterId = chapterId this.chapterId = chapterId;
this.sectionId = row.id this.sectionId = row.id;
this.sectionName = row.sectionName this.sectionName = row.sectionName;
this.switchVisible = true this.switchVisible = true;
}, },
switchSubmitFile(){ switchSubmitFile() {
let data = { let data = {
id: this.sectionId, id: this.sectionId,
courseId: this.id, courseId: this.id,
@ -528,144 +558,156 @@ export default {
fileType: this.fileType, fileType: this.fileType,
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
originalFileName: this.originalFileName originalFileName: this.originalFileName
} };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
this.successMsg('更换成功'); this.successMsg("更换成功");
this.switchVisible = false this.switchVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}, },
switchSubmit(){ switchSubmit() {
if(this.uploading) return this.warningMsg('资源正在上传中,请稍候') if (this.uploading) return this.warningMsg("资源正在上传中,请稍候");
if(!this.fileUrl && !this.fileId) return this.warningMsg('请上传资源') if (!this.fileUrl && !this.fileId) return this.warningMsg("请上传资源");
if(this.transferType(this.curFile.fileType) == '视频'){ if (this.transferType(this.curFile.fileType) == "视频") {
let data = { let data = {
videoIdList: [this.sectionId] videoIdList: [this.sectionId]
} };
this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => { this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => {
this.switchSubmitFile() this.switchSubmitFile();
}).catch(res => {}); }).catch(res => {
}else{ });
} else {
this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => {
this.switchSubmitFile() this.switchSubmitFile();
}).catch(res => {}); }).catch(res => {
});
} }
}, },
delSection(row) { delSection(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
this.successMsg('删除成功'); this.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
}) });
.catch(() => {}); })
}, .catch(() => {
sortChapter(row,type,disabled,index){ });
if(!disabled){ },
if(type == 'up'){ sortChapter(row, type, disabled, index) {
let tempItem = this.chapters.splice(index - 1,1)[0] if (!disabled) {
this.chapters.splice(index,0,tempItem) if (type == "up") {
}else{ let tempItem = this.chapters.splice(index - 1, 1)[0];
let tempItem = this.chapters.splice(index + 1,1)[0] this.chapters.splice(index, 0, tempItem);
this.chapters.splice(index,0,tempItem) } else {
let tempItem = this.chapters.splice(index + 1, 1)[0];
this.chapters.splice(index, 0, tempItem);
} }
} }
}, },
sortSection(chapterIndex,type,disabled,index){ sortSection(chapterIndex, type, disabled, index) {
if(!disabled){ if (!disabled) {
let list = this.chapters[chapterIndex].subsectionList let list = this.chapters[chapterIndex].subsectionList;
if(type == 'up'){ if (type == "up") {
let tempItem = list.splice(index - 1,1)[0] let tempItem = list.splice(index - 1, 1)[0];
list.splice(index,0,tempItem) list.splice(index, 0, tempItem);
}else{ } else {
let tempItem = list.splice(index + 1,1)[0] let tempItem = list.splice(index + 1, 1)[0];
list.splice(index,0,tempItem) list.splice(index, 0, tempItem);
} }
this.chapters[chapterIndex].subsectionList = list this.chapters[chapterIndex].subsectionList = list;
} }
}, },
sectionNameSubmit(){ sectionNameSubmit() {
if(!this.sectionName) return this.warningMsg('请填写小节名称') if (!this.sectionName) return this.warningMsg("请填写小节名称");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
courseId: this.id, courseId: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName name: this.sectionName
} };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
this.successMsg('修改成功'); this.successMsg("修改成功");
this.sectionNameVisible = false this.sectionNameVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
},
closePlayer(){
this.playAuth = ''
this.player.pause()
}, },
closeIframe(){ closePlayer() {
this.iframeSrc = '' this.playAuth = "";
this.showMask = false this.player.pause();
this.showMask1 = false
this.showMask2 = false
this.previewing = false
}, },
closeIframe() {
this.iframeSrc = "";
this.showMask = false;
this.showMask1 = false;
this.showMask2 = false;
this.previewing = false;
}
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.btns{ .btns {
position: absolute; position: absolute;
top: 12px; top: 12px;
right: 24px; right: 24px;
.el-button{
.el-button {
font-size: 14px; font-size: 14px;
} }
} }
.sort-icon{
.sort-icon {
font-size: 24px; font-size: 24px;
cursor: pointer; cursor: pointer;
&.disabled{
&.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed cursor: not-allowed
} }
} }
.el-image-viewer__wrapper{
.el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform .5s; transition: transform .5s;
&.active{ &.active {
transform: translateY(0) transform: translateY(0)
} }
} }
.el-image-viewer__close{
.el-image-viewer__close {
z-index: 10000; z-index: 10000;
top: 15px; top: 15px;
right: 15px; right: 15px;
&.doc-close{
i{ &.doc-close {
i {
color: #000 !important; color: #000 !important;
} }
} }
} }
.player{
.player {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%,-50%); transform: translate(-50%, -50%);
width: 1200px !important; width: 1200px !important;
height: 600px !important; height: 600px !important;
} }
.fileIframe{
.fileIframe {
z-index: 1; z-index: 1;
position: absolute; position: absolute;
top: 0; top: 0;
@ -675,31 +717,36 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.mask{
.mask {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
background-color: rgb(57,58,61); background-color: rgb(57, 58, 61);
} }
.word-mask{
.word-mask {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
right: 0; right: 0;
width: 100%; width: 100%;
background-color: rgb(243,242,241); background-color: rgb(243, 242, 241);
} }
.word-mask1{
.word-mask1 {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
top: 0; top: 0;
right: 0; right: 0;
background-color: #2b579a; background-color: #2b579a;
} }
.word-mask2{
.word-mask2 {
z-index: 1000; z-index: 1000;
position: fixed; position: fixed;
background-color: transparent; background-color: transparent;
} }
.excel-mask1{
.excel-mask1 {
z-index: 9; z-index: 9;
position: absolute; position: absolute;
top: 0; top: 0;

File diff suppressed because it is too large Load Diff

@ -60,7 +60,22 @@
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false"> <el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;"> <el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
<div style="overflow:auto;height: 558px;width:330px;padding:15px;background:#fff" ref="typeTreeWrap" @scroll="loadType"> <div style="overflow:auto;height: 558px;width:330px;padding:15px;background:#fff" ref="typeTreeWrap" @scroll="loadType">
<el-tree ref="typeTree" :data="importTypeList" node-key="id" accordion :default-expanded-keys="defaultTypeActive" :default-checked-keys="defaultTypeChecked" :current-node-key="curId" show-checkbox :props="defaultProps" highlight-current @node-click="importTypeClick" @node-expand="importTypeExpand"></el-tree> <el-tree
ref="typeTree"
:data="importTypeList"
node-key="id"
accordion
:default-expanded-keys="defaultTypeActive"
:default-checked-keys="defaultTypeChecked"
:current-node-key="curId"
show-checkbox
:props="defaultProps"
highlight-current
@node-click="importTypeClick"
@node-expand="importTypeExpand"
>
</el-tree>
</div> </div>
<el-main style="padding-top: 0;padding-bottom: 0;"> <el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover"> <el-card shadow="hover">

@ -340,7 +340,7 @@
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="api.upload" :action="api.fileupload"
:file-list="uploadList" :file-list="uploadList"
> >
<el-button size="medium" type="plain" class="uploadTitle">上传</el-button> <el-button size="medium" type="plain" class="uploadTitle">上传</el-button>

@ -13,27 +13,32 @@
<div> <div>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="系统归属"> <el-form-item label="系统归属">
<el-select v-model="systemAttribution" clearable placeholder="请选择系统归属" @change="getSystem()"> <el-select v-model="systemAttribution" clearable placeholder="请选择系统归属"
<el-option v-for="(item,index) in systemList" :key="index" :label="item.name" :value="item.value"></el-option> @change="initData">
<el-option v-for="(item,index) in systemBelongList" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="系统类型"> <el-form-item label="系统类型">
<el-select v-model="systemType" clearable placeholder="请选择系统类型" @change="getSystem()"> <el-select v-model="systemType" clearable placeholder="请选择系统类型"
<el-option v-for="(item,index) in systemTypeList" :key="index" :label="item.name" :value="item.value"></el-option> @change="initData">
<el-option v-for="(item,index) in systemTypeList" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</div> </div>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model="systemSearch" clearable @change="getSystem()"></el-input> <el-input placeholder="请输入系统名称" prefix-icon="el-icon-search"
v-model.trim="systemSearch" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</div> </div>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -47,13 +52,21 @@
<!-- <el-table-column type="selection" width="55" align="center"></el-table-column> --> <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"> <el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
</el-table-column> <el-table-column prop="type" label="系统类型" align="center">
<el-table-column prop="systemType" label="系统类型" align="center"> <template slot-scope="scope">
{{ systemTypeKeys[scope.row.type] }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="systemAttribution" label="系统归属" align="center"> <el-table-column prop="belong" label="系统归属" align="center">
<template slot-scope="scope">
{{ systemBelongKeys[scope.row.belong] }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="systemStatus" label="系统状态" align="center"> <el-table-column prop="state" label="系统状态" align="center">
<template slot-scope="scope">
{{ systemStatusKeys[scope.row.state] }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="项目系统" align="center"> <el-table-column prop="payamount" label="项目系统" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -65,14 +78,17 @@
<el-button type="text" @click="getIntoJudgement(scope.row)">进入</el-button> <el-button type="text" @click="getIntoJudgement(scope.row)">进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
<!--
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button> <el-button type="text" @click="edit(scope.row)">编辑</el-button>
</template> </template>
</el-table-column> </el-table-column>
-->
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" layout="total, prev, pager, next" :total="totals"> <el-pagination background @current-change="handleCurrentChange"
layout="total, prev, pager, next" :total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -82,96 +98,113 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
token: btoa(this.$store.state.loginToken), token: btoa(sessionStorage.getItem('token')),
systemAttribution: '', systemAttribution: "",
systemType: '', systemType: "",
systemSearch: '', systemSearch: "",
systemData:[], searchTimer: null,
systemData: [],
totals: 1, totals: 1,
systemList: [{ systemBelongList: [
name: '外部产品', {
value: 1 label: "外部产品",
value: 0
},
{
label: "内部系统",
value: 1
}
],
systemBelongKeys: {
0: '外部产品',
1: '内部系统'
}, },
{ systemTypeList: [
name: '内部系统', {
value: 2 label: "编程类",
}], value: 0
systemTypeList: [{ },
name: '工具', {
value: 1 label: "流程类",
value: 1
}
],
systemTypeKeys: {
0: '编程类',
1: '流程类'
}, },
{ systemStatusKeys: {
name: '实训', 0: '进行中',
value: 2 1: '默认'
}, },
{
name: '网站',
value: 3
}],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}; };
}, },
watch: {
systemSearch: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() { mounted() {
this.getSystem() this.getData();
}, },
methods: { methods: {
getSystem(){ initData() {
this.pageNum = 1;
this.getData();
},
getData() {
let data = { let data = {
systemAttribution: this.systemAttribution, belong: this.systemAttribution,
systemType: this.systemType, type: this.systemType,
searchContent: this.systemSearch, systemName: this.systemSearch,
pageNo: this.pageNo, pageNum: this.pageNo,
pageSize: this.pageSize pageSize: this.pageSize
} };
this.$get(this.api.queryServiceConfig,data).then(res => { this.$post(this.api.queryServiceConfig, data).then(res => {
res.message.rows.forEach(e => { this.systemData = res.serviceList.records;
e.systemType = this.systemTypeStatus(e.systemType) this.totals = res.serviceList.total;
e.systemAttribution = this.systemAttributionStatus(e.systemAttribution) }).catch(res => {
e.systemStatus = this.systemStatus(e.systemStatus) });
})
this.systemData = res.message.rows
this.totals = res.message.total
}).catch(res => {});
}, },
handleCurrentChange(){}, handleCurrentChange(val) {
edit(row){ this.pageNo = val;
this.$store.commit("configData", { config_id : row.systemId}); this.getData();
this.$router.push('/addconfigure');
}, },
getIntoProject(row){ edit(row) {
if(process.env.NODE_ENV === 'development'){ this.$store.commit("configData", { config_id: row.systemId });
location.href = `http://192.168.31.154:8088/#/?userId=${this.userId}&systemId=${row.systemId}&systemName=${row.systemName}&token=${this.token}` this.$router.push("/addconfigure");
}else{
location.href = `http://39.108.250.202/Projectmanagement/#/?userId=${this.userId}&systemId=${row.systemId}&systemName=${row.systemName}&token=${this.token}`
}
}, },
getIntoJudgement(row){ getIntoProject(row) {
if(process.env.NODE_ENV === 'development'){ this.$router.push(`/projectList/?systemId=${row.systemId}&show=1`)
location.href = `http://192.168.31.154:8087/#?systemId=${row.systemId}&userId=${this.userId}&systemName=${row.systemName}&token=${this.token}&referrer=${btoa(location.href)}` },
}else{ getIntoJudgement(row) {
location.href = `http://39.108.250.202/Score/#?systemId=${row.systemId}&userId=${this.userId}&systemName=${row.systemName}&token=${this.token}&referrer=${btoa(location.href)}` location.href = `${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
}, },
 setCookie(name, value) { setCookie(name, value) {
      if (value) { if (value) {
        var days = 1; // var days = 1;//
        var exp = new Date(); var exp = new Date();
        exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000); exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
        // Cookie, toGMTString //Cookie,toGMTString
        document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString+";path=/;"; document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString + ";path=/;";
      } }
    }, }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.mag{ .mag {
margin-right: 20px; margin-right: 20px;
} }
</style> </style>

@ -0,0 +1,661 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<el-page-header @back="goBack" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button v-if="!projectId" type="success" size="small" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" size="small" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>课程信息</span>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="80px">
<div style="display: flex">
<el-form-item label="项目名称">
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="项目权限">
<el-select :disabled="isDetail" v-model="projectManage.permissions" placeholder="请选择">
<el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
</el-select>
</el-form-item>
</div>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>实验目标</span>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>案例描述</span>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验任务</span>
</div>
<div>
<el-button :disabled="isDetail" type="primary" @click="toJudgePoint('home')">进入判分点</el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<div class="mgb20 flex-between">
<div class="flex-center">
<div class="m-r-20" style="color: #f00">项目总分值100</div>
<!-- <div>权重&emsp;<div class="dib"><el-input></el-input></div></div> -->
</div>
<div>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button>
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button>
<span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div>
</div>
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button>
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<el-table
ref="projectJudgementTable"
:data="projectJudgmentData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionProjectJudgment"
row-key="judgmentId"
>
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="id" label="序号" width="80" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="判分指标" align="center"></el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="排序" align="center">
<template slot-scope="scope">
<el-button
:disabled="isDetail"
v-show="scope.$index > 0"
type="text"
icon="el-icon-top"
@click="handleMoveUp(scope.$index)"
style="font-size: 24px"
></el-button>
<el-button
:disabled="isDetail"
v-show="(scope.$index+1) < projectJudgmentData.length"
type="text"
icon="el-icon-bottom"
@click="handleMoveDown(scope.$index)"
style="font-size: 24px"
></el-button>
</template>
</el-table-column>
<el-table-column label="实验要求" align="center">
<template slot-scope="scope">
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" />
</template>
</el-table-column>
<el-table-column label="操作" width="140" align="center">
<template slot-scope="scope">
<el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="score" label="分数" align="center">
<template slot-scope="scope">
<!--type="number"-->
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>案例描述</span>
</div>
<div>
启用
<el-switch :disabled="isDetail" :active-value="0" :inactive-value="1" v-model="projectManage.hintOpen"></el-switch>
</div>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="0">
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
</el-col>
</el-row>
<!--选择判分点对话框-->
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
<div class="text-right m-b-10">
<div>
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" clearable></el-input>
</div>
</div>
<el-table
:data="judgementData"
ref="judgementTable"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionJudgment"
:row-key="rowKey"
>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="id" label="序号" align="center" width="100">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini" @click="toJudgePoint('view', scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addJudgment"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import quill from "@/components/quill";
export default {
components: {
quill
},
data() {
return {
host: Setting.apiBaseURL,
projectId: this.$route.query.projectId,
systemList: Setting.systemList,
token: btoa(sessionStorage.getItem('token')),
isDetail: Boolean(this.$route.query.show),
projectManage: {
founder: 0, // (0 1)
projectName: "", //
permissions: 0, // (0 1 2)
schoolId: Setting.schoolId,
systemId: this.$route.query.systemId, // id
hintOpen: 0, // (0 1 0)
experimentHint: "", //
experimentTarget: "", //
experimentDescription: "", //
state: 0, // (0稿 1)
isOpen: 0, // (0 1 0)
isDel: 0 // (0 1 0)
},
projectJudgmentData: [], //()
selectedProjectJudgment: [], //
dialogVisible: false, //
judgementpointsquery: "", //
judgementData: [], //
selectedJudgment: [], //
rowKey: "", // Key
projectNameRepeat: false, //
flag: false, //
avgValuelist: [], //
searchTimer: null,
isToPoint: false //
};
},
computed: {
lastSystemId() {
return this.$store.state.lastSystemId;
},
projectFields() {
return this.$store.state.projectFields;
},
handDistributionScore: function() {
//100
let score = 0;
this.projectJudgmentData.forEach(e => {
score += parseInt(e.score);
});
if (isNaN(score)) {
return 0;
}
if (score > 100) {
this.$message.warning("分配的数值已超过100");
}
return score;
}
},
watch: {
projectJudgmentData: {
handler(newValue) {
console.log("newValue:", newValue);
},
deep: true
},
judgementpointsquery(n) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.handleQueryJudgment();
}, 500);
}
},
created() {
console.log(this.projectManage.systemId, "this.projectManage.systemId", this.lastSystemId);
},
mounted() {
if (this.$route.query.projectId) {
this.projectId = this.$route.query.projectId;
this.getInfoData();
}
//
if (JSON.stringify(this.projectFields) != '{}') {
let { projectManage, projectJudgmentData } = this.projectFields;
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData;
}
},
beforeDestroy() {
if (!this.isToPoint) {
this.$store.dispatch('setProject',{});
}
},
methods: {
goBack() { //
if (this.isDetail) {
this.$router.back();
} else {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
}).then(() => {
this.$router.back();
}).catch(() => {
});
}
},
getInfoData() { //
if (!this.isToPoint) {
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}&schoolId=${this.projectManage.schoolId}`).then(res => {
if (res.status === 200) {
let { projectManage, projectJudgmentVos } = res;
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentVos;
} else {
this.$message.warning(res.message);
}
}).catch(err => {
console.log(err);
});
}
},
projectNameExistis() { //
if (this.projectManage.projectName) {
this.$post(this.api.queryNameIsExist, { projectName: this.projectManage.projectName }).then(res => {
if (res.status === 200) {
this.projectNameRepeat = false;
} else {
this.projectNameRepeat = true;
}
}).catch(err => {
this.projectNameRepeat = true;
});
} else {
this.projectNameRepeat = false;
}
},
systemChange() { //
if (this.projectJudgmentData.length) {
this.$confirm("更换系统会清空实验任务,确认更换?", "提示", {
type: "warning"
}).then(() => {
this.projectJudgmentData = [];
this.$store.dispatch('setSystemId',this.projectManage.systemId);
}).catch(() => {
this.projectManage.systemId = this.lastSystemId;
console.log(this.lastSystemId, "this.lastSystemId");
});
}
},
judgmentRelease() { //
let {
projectName,
experimentTarget,
experimentDescription,
experimentHint,
hintOpen
} = this.projectManage;
if (!projectName) {
this.$message.warning("请输入项目名称");
return false;
}
if (this.projectNameRepeat) {
this.$message.warning("该项目名称已存在");
return false;
}
if (!experimentTarget) {
this.$message.warning("请输入实验目标");
return false;
}
if (!experimentDescription) {
this.$message.warning("请输入案例描述");
return false;
}
if (this.projectJudgmentData.length == 0) {
this.$message.warning("请添加判分点");
return false;
}
if (this.handDistributionScore < 100) {
this.$message.warning("判分点分数未满100");
return false;
}
if (this.handDistributionScore > 100) {
this.$message.warning("判分点分数已超过100");
return false;
}
if (!experimentHint && hintOpen) {
this.$message.warning("请输入实验提示");
return false;
}
return true;
},
handleSubmit(state) { //
if (!this.judgmentRelease()) { //
return;
}
this.$store.dispatch('setSystemId',this.projectManage.systemId)
this.projectManage.state = state;
let tempArr = this.projectJudgmentData.map(i => {
let obj = {
projectId: this.projectId ? this.projectId : "",
judgmentId: i.judgmentId,
score: i.score
};
return obj;
});
let params = {
projectManage: this.projectManage,
projectJudgmentList: tempArr
};
let { systemId } = this.projectManage;
if (this.projectId) {
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else {
//
this.updateProject(params);
}
} else {
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else {
//
this.addProject(params);
}
}
},
updateProject(params) { //
this.$post(`${this.api.updateProjectManage}`, params).then(res => {
if (res.status === 200) {
this.$message.success("更新实验项目成功");
this.$router.back();
}
}).catch(err => {
console.log(err);
});
},
addProject(params) { //
this.$post(`${this.api.addProjectManage}`, params).then(res => {
if (res.status === 200) {
this.$message.success("添加实验项目成功");
this.$router.back();
}
}).catch(err => {
console.log(err);
});
},
manualDistributionScore() { //
},
avgDistributionScore() {
//
if (this.projectJudgmentData.length) {
this.$get(this.api.avgValues, {
number: this.projectJudgmentData.length
}).then(res => {
if (res.status === 200 && res.data) {
this.projectJudgmentData = this.projectJudgmentData.map((item, index) => {
item.score = res.data[index];
return item;
});
}
});
}
},
handleMoveUp(index) { //
let x = index;
let y = index + 1;
this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1]));
},
handleMoveDown(index) { //
let x = index + 1;
let y = index + 2;
this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1]));
},
scoreChange(row, index) { //
this.projectJudgmentData.splice(index, 1, row);
},
delJudgePoint(index) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.projectJudgmentData.splice(index, 1);
}).catch(() => {
});
},
handleSelectionProjectJudgment(val) {
this.selectedProjectJudgment = val;
},
batchDeleteProjectJudgment() { //
if (this.selectedProjectJudgment.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
// this.projectJudgmentData.splice(index, 1);
let list = this.projectJudgmentData;
let result = [];
list.map(i => {
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.projectJudgmentData = result;
}).catch(() => {
});
} else {
this.$message.warning("请选择判分点");
}
},
handleQueryJudgment() { //
let { systemId } = this.projectManage;
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.judgementTable.clearSelection();
});
let params = {
name: this.judgementpointsquery,
pageNum: 1,
pageSize: 10000,
systemId
};
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else if (systemId == 11) {
// ()
this.rowKey = "lcId";
this.getProcessClassData(params);
} else {
//
this.rowKey = "bcId";
this.getProgrammingClassData(params);
}
},
getProcessClassData(params) { //
this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => {
if (res.status === 200) {
let list = res.message.records;
let result = [];
list.map(i => {
i.judgmentId = i.lcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.judgementData = result;
}
}).catch(err => {
console.log(err);
});
},
getProgrammingClassData(params) { //
this.$post(this.api.getBcJudgmentPoint, params).then(res => {
if (res.status === 200) {
let list = res.message.records;
let result = [];
list.map(i => {
i.judgmentId = i.bcId;
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.judgementData = result;
}
}).catch(err => {
console.log(err);
});
},
handleSelectionJudgment(val) { //
this.selectedJudgment = val;
},
addJudgment() { //
if (this.selectedJudgment.length) {
this.dialogVisible = false;
let tempArr = this.selectedJudgment.map(i => {
i.score = 0;
return i;
});
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr);
this.$nextTick(() => {
this.$refs.projectJudgementTable.clearSelection();
});
} else {
this.$message.warning("请选择判分点");
}
},
handleCacheData() { //
this.isToPoint = true;
this.$store.dispatch('setProject',{ projectManage: this.projectManage, projectJudgmentData: this.projectJudgmentData });
},
toJudgePoint(type, row) { //
this.handleCacheData();
// let host = this.host;
let host = "http://192.168.31.154:8087/"; //
let { systemId } = this.projectManage;
let href = "";
if (type === "view") {
//
if (systemId == 2) {
href = `${host}jdTrials/#/programOption?id=${row.judgmentPointsId}`;
} else if (systemId == 3) {
href = `${host}jdTrials/#/programOptions?id=${row.judgmentPointsId}`;
} else if (systemId == 11) {
//
href = `${host}jdTrials/#/Transaction?isView=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} else {
// python
href = `${host}jdTrials/#/program?isView=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
} else if (type === "edit") {
//
if (systemId == 2) {
href = `${host}jdTrials/#/programOption?id=${row.judgmentPointsId}`;
} else if (systemId == 3) {
href = `${host}jdTrials/#/programOptions?id=${row.judgmentPointsId}`;
} else if (systemId == 11) {
//
href = `${host}jdTrials/#/Transaction?isEdit=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} else {
// python
href = `${host}jdTrials/#/program?isEdit=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
} else if (type === 'home') {
if (systemId == 2 || systemId == 3) {
href = `${host}jdTrials/#/list`;
} else {
//
href = `${host}#/?systemId=${systemId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
}
location.href = href;
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .readonly .ql-toolbar {
height: 0;
padding: 0;
border-bottom: 0;
}
</style>

@ -0,0 +1,372 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card v-if="showBack" shadow="hover" class="mgb20">
<el-page-header content="实验项目管理" @back="goBack"></el-page-header>
</el-card>
</el-col>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
<el-form-item label="创建人">
<el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人"
@change="initData">
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="状态">
<el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="权限">
<el-select size="small" v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in permissionsList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</el-card>
</el-col>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>项目列表</span>
</div>
<div>
<el-button type="primary" round @click="add" class="mag">新增项目</el-button>
<el-button type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column>
<el-table-column prop="founder" label="创建人" align="center">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.row.projectId)">
删除
</el-button>
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-model="scope.row.ztOpen"
:active-text="scope.row.ztOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff(scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</el-card>
</el-col>
</el-row>
<!--复制对话框-->
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false">
<el-form>
<el-form-item>
<!--前端不用做名称判重了@change='projectNameExistis'-->
<el-input placeholder="请输入项目名称" v-model="projectName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="copyVisible = false"> </el-button>
<el-button type="primary" @click="copySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
export default {
data() {
return {
showBack: Boolean(this.$route.query.show),
systemId: this.$route.query.systemId,
queryData: {
platformId: 3, // :1 :3
founder: 0, // (0: 1:)
state: "", // (0:稿 1:)
permissions: "", // (0: 1: 2:)
},
keyword: '',
status: '',
listData: [],
total: 0,
permissionsList: [
{
value: '',
label: '不限'
},
{
value: 0,
label: '练习'
},
{
value: 1,
label: '考核'
},
{
value: 2,
label: '竞赛'
}
],
permissionsKeys: {
0: '练习',
1: '考核',
2: '竞赛'
},
founderList: [
{
value: 0,
label: '系统'
},
{
value: 1,
label: '老师'
}
],
founderKeys: {
0: '系统',
1: '老师'
},
stateList: [
{
value: '',
label: '不限'
},
{
value: 0,
label: '草稿箱'
},
{
value: 1,
label: '已发布'
}
],
stateKeys: {
0: '草稿箱',
1: '已发布'
},
page: 1,
pageSize: 10,
multipleSelection: [],
copyVisible: false,
projectName: '',
currentRow: {}, //
listDataAll: []
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getData();
},
methods: {
getData() {
let data = {
...this.queryData,
projectName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
};
this.$post(this.api.queryProjectManage, data).then(res => {
let { status, data } = res;
if (status === 200 && data) {
this.listData = data.records;
this.total = data.total;
}
}).catch(err => {
console.log(err);
});
},
initData() {
this.page = 1;
this.getData();
},
handleCurrentChange(val) { //
this.page = val;
this.getData();
},
add() { //
this.$router.push(`/projectAdd?systemId=${this.systemId}`);
},
edit(row) { //
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}`);
},
handleSelectionChange(val) { //
this.multipleSelection = val;
},
delAllData() { //
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.projectId
});
let strIds = ids.toString();
this.handleDelete(strIds);
} else {
this.$message.error("请先选择项目");
}
},
handleDelete(ids) { //
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) {
this.$message.success("删除成功");
this.getData();
} else {
this.$message.error(res.message);
}
}).catch(err => {
console.log(err);
});
}).catch(() => {
this.$message.info('已取消删除');
});
},
switchOff(row) { //
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) {
this.$message.success('更新启用状态成功');
this.getData();
} else {
this.$message.error(res.message);
}
}).catch(err => {
console.log(err);
});
},
projectNameExistis() { //
if (this.projectName) {
this.$post(this.api.queryNameIsExist, { projectName: this.projectName }).then(res => {
if (res.status === 200) {
this.projectNameRepeat = false;
} else {
this.projectNameRepeat = true;
}
}).catch(err => {
this.projectNameRepeat = true;
});
} else {
this.projectNameRepeat = false;
}
},
copyData(projectId) { // id
this.copyVisible = true;
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => {
if (res.status === 200) {
this.projectName = res.projectManage.projectName;
this.currentRow = {
projectManage: res.projectManage,
projectJudgmentList: res.projectJudgmentVos
}
}
}).catch(err => {
console.log(err);
});
},
copySubmit() {
if (!this.projectName) {
this.$message.warning("请输入项目名称");
return;
}
;
if (this.projectNameRepeat) {
this.$message.warning("该项目名称已存在");
return;
}
this.currentRow.projectManage.projectName = this.projectName;
this.currentRow.projectManage.projectId = "";
this.currentRow.projectJudgmentList.forEach(i => {
i.projectId = "";
});
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => {
if (res.status === 200) {
this.initData();
this.$message.success("复制实验项目成功");
this.copyVisible = false;
} else {
this.$message.error(res.message);
}
}).catch(err => {
console.log(err);
});
},
goBack() { //
this.$router.back();
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -432,7 +432,6 @@ export default {
label: '中国' label: '中国'
} }
], ],
form: {},
occupationList: [{ occupationList: [{
value: 1, value: 1,
label: '学生' label: '学生'

Loading…
Cancel
Save