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. 27
      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. 846
      src/views/course/AddCurriculum.vue
  14. 112
      src/views/course/AddLink.vue
  15. 305
      src/views/course/Curriculum.vue
  16. 641
      src/views/course/assetConfig.vue
  17. 791
      src/views/course/courseconfig.vue
  18. 17
      src/views/data/Framework.vue
  19. 2
      src/views/order/AddOrder.vue
  20. 175
      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;
}
.mgb10 {
margin-bottom: 10px;
}
.move-enter-active,
.move-leave-active {
transition: opacity .5s;
@ -226,10 +230,6 @@ li {
margin-bottom: 20px;
}
.mgb20 {
margin-bottom: 20px;
}
#app .el-table thead{
color: #fff;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

@ -70,21 +70,21 @@ export default {
index: 'order',
title: '订单管理'
},
// {
// icon: 'el-icon-lx-emoji',
// index: 'configure',
// title: ''
// },
// {
// icon: 'el-icon-document-checked',
// index: 'curriculum',
// title: ''
// },
{
icon: 'el-icon-document-checked',
index: 'curriculum',
title: '课程管理'
},
{
icon: 'el-icon-notebook-2',
index: 'data',
title: '数据管理'
}
},
{
icon: 'el-icon-office-building',
index: 'configure',
title: '服务配置'
},
],
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.config.productionTip = false;
Vue.use(ElementUI);
Vue.use(ElementUI, { size: 'small' });

@ -4,8 +4,8 @@ import Router from 'vue-router';
Vue.use(Router);
let router = new Router({
mode: 'hash',
    base: process.env.BASE_URL,
mode: 'hash',
base: process.env.BASE_URL,
routes: [
{
path: '/',
@ -62,6 +62,16 @@ let router = new Router({
component: () => import( '../views/serve/AddConfigure.vue'),
meta: { title: '新增配置' }
},
{
path: '/projectList',
component: () => import( '../views/serve/projectList.vue'),
meta: { title: '项目管理' }
},
{
path: '/projectAdd',
component: () => import( '../views/serve/projectAdd.vue'),
meta: { title: '项目配置' }
},
{
path: '/curriculum',
component: () => import( '../views/course/Curriculum.vue'),
@ -72,6 +82,11 @@ let router = new Router({
component: () => import( '../views/course/AddCurriculum.vue'),
meta: { title: '新建课程' }
},
{
path: '/contentSettings',
component: () => import( '../views/course/courseconfig.vue'),
meta: { title: '内容设置' }
},
{
path: '/addlink',
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') {
next('/login');
} else {
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: '',
userLoginId: '',
userName: '',
roleId: '',
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:{
SET_SYSTEM_ID: (state, systemId) => {
state.lastSystemId = systemId
},
SET_PROJECT: (state, projectFields) => {
state.projectFields = projectFields
},
userAvatar(state,payload){
state.avatar = payload.avatar
},
@ -52,6 +67,7 @@ const store = new Vuex.Store({
schoolIdData (state, payload) {
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 {
upload:`${host}/nakadai/nakadai/oss/fileUpload`,// 上传文件-订单
logins: `${host}/users/users/user/login`, //登录
verification:`${host}/users/users/user/captcha`,// 验证码图片
bindPhoneOrEmail:`${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
sendPhoneOrEmailCode:`${host} /users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
// 订单管理
orderAdd:`${host}/nakadai/nakadai/order/add`,// 订单添加
orderDelete:`${host}/nakadai/nakadai/order/delete`,// 删除定单
@ -54,8 +55,8 @@ export default {
updatePersonCenter: `${host}/users/users/userAccount/updatePersonCenter`,
updateUserAvatars: `${host}/users/users/userAccount/updateUserAvatars`,
userInfo: `${host}/users/users/userAccount/userInfo`,
bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,
// bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,
// sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,
updateAccountEnable: `${host}/users/users/userAccount/updateAccountEnable`,
updateAccountAllEnable: `${host}/users/users/userAccount/updateAccountAllEnable`,
examinePassword: `${host}/users/users/userAccount/examinePassword`,
@ -74,23 +75,78 @@ export default {
queryCourseList: `${host}/liuwanr/order/queryCourseList`, //查询订单课程列表
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`, //删除服务配置
updateServiceConfig: `${host}/liuwanr/serviceConfig/updateServiceConfig`, //更新服务配置
addServiceConfig: `${host}/liuwanr/serviceConfig/addServiceConfig`, //添加服务配置
queryServiceConfig: `${host}/liuwanr/serviceConfig/queryServiceConfig`, //查询服务配置
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`, //查询省份
queryCity: `${host}/nakadai/nakadai/city/queryCity`, //查询城市
queryCourseDiscipline: `${host}/nakadai/nakadai/discipline/queryDiscipline`, //查询课程学科
queryCourseProfessionalClass: `${host}/nakadai/nakadai/professionalClass/queryProfessionalClass`, //查询专业类
queryCourseProfessional: `${host}/nakadai/nakadai/professional/queryProfessional`, //查询专业

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

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

File diff suppressed because it is too large Load Diff

@ -10,7 +10,8 @@
<span class="per_school">添加环节</span>
</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>
</el-card>
@ -29,10 +30,12 @@
<ul class="mgb20">
<li v-for="(item,index) in form.courseList" :key="index" class="flex-between">
<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-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
class="link_upload"
:headers="{token}"
@ -44,12 +47,15 @@
:limit="1"
:on-exceed="handleExceed"
: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-form-item>
</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>
</li>
</ul>
@ -62,68 +68,69 @@
</template>
<script>
export default {
data (){
export default {
data() {
return {
token: this.$store.state.loginToken,
form: {
courseList: [{
projectId: this.$store.state.systemId,
courseId : this.$store.state.courseId,
linkName: '',
fileLink: '',
courseId: this.$store.state.courseId,
linkName: "",
fileLink: "",
uploadList: []
}],
},
}]
}
};
},
mounted() {
this.getData()
this.getData();
},
methods: {
getData(){
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 = []
};
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) => {})
this.$set(e, "uploadList", arr);
});
this.form.courseList = res.message;
}).catch((res) => {
});
},
saveAdd(formName){
saveAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var arr = this.form.courseList.map(v=>{
var arr = this.form.courseList.map(v => {
var obj = {
...v
}
delete obj.uploadList
return obj
})
};
delete obj.uploadList;
return obj;
});
let data = {
courseLink: arr
}
this.$post(this.api.addCourseLink,data).then((res) => {
};
this.$post(this.api.addCourseLink, data).then((res) => {
this.$message.success("添加成功!");
this.goback()
this.goback();
}).catch((res) => {
})
});
}
})
});
},
addcourse(){
addcourse() {
this.form.courseList = this.form.courseList.concat({
projectId: this.$store.state.systemId,
courseId : this.$store.state.courseId,
linkName: '',
fileLink: '',
courseId: this.$store.state.courseId,
linkName: "",
fileLink: "",
uploadList: []
})
});
},
//
handleExceed(files, fileList) {
@ -133,7 +140,7 @@
},
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
this.form.courseList[idx].fileLink = response.message.fileUrl;
},
uploadError(err, file, fileList) {
this.$message({
@ -153,21 +160,22 @@
}
});
},
delCourse(index){
this.$confirm('确定要删除该课件吗?', '提示', {
type: 'warning'
delCourse(index) {
this.$confirm("确定要删除该课件吗?", "提示", {
type: "warning"
})
.then(() => {
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>
<style scoped>
@ -175,19 +183,21 @@
width: 30%;
} */
.courseware ul li{
.courseware ul li {
margin-top: 20px;
padding: 0 0 10px 0;
border-bottom: 1px dashed #eee;
}
.courseware ul li:first-child{
.courseware ul li:first-child {
margin-top: 0;
}
.courseware ul li:last-child{
.courseware ul li:last-child {
border-bottom: none;
}
.uploadTitle{
.uploadTitle {
height: 40px !important;
font-size: 16px;
}

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

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

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

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

Loading…
Cancel
Save