提交 5af7db42 编写于 作者: guangjun.yang's avatar guangjun.yang

自定义课程

上级 def33f99
......@@ -36,6 +36,7 @@
"vue-infinite-scroll": "^2.0.2",
"vue-router": "^2.1.1",
"vue-ueditor-wrap": "^2.4.1",
"vuedraggable": "^2.23.2",
"vuex": "^2.0.0"
},
"devDependencies": {
......
<template>
<div class="course-list-wrapper">
<ul class="course-header">
<li class="title">
<span class="main">全部课程</span>
<span class="sub">单个项目最多只能选择30个课程</span>
</li>
<li class="order">
<div class="num" @click="toggleOrder">
<span>学习人数</span>
<img v-show="isRise" src="../../../assets/custom/icon/icon-rise.png" alt />
<img v-show="!isRise" src="../../../assets/custom/icon/icon-drop.png" alt />
</div>
<div class="cart-wrapper">
<div class="cart" @click="toggleCart">
<span>已选课程</span>
<img src="../../../assets/custom/icon/icon-cart.png" alt />
<div class="count">
<span>{{cartList.length}}</span>
</div>
</div>
<div v-show="isShowCart" class="curt-position">
<ShoppingCart @close="toggleCart"></ShoppingCart>
</div>
</div>
</li>
</ul>
<div class="list-wrapper">
<ul class="list">
<li
class="course"
v-for="(item, index) in courseList.list"
:key="index"
@click="toggleChecked(item)"
>
<div class="img">
<img src="../../../assets/custom/test.png" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName}}</span><span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="true" class="exam-num">5场考试</span>
</div>
<div class="cost">
<span class="no">免费</span>
<span class="num">{{item.joinNum}}人已学</span>
</div>
</div>
<img v-show="item.checked" class="course-selected" src="../../../assets/custom/icon/icon-selected.png" alt />
</li>
</ul>
</div>
<div class="page-wrapper">
<el-pagination
background
:current-page="searchParam.pageNo"
:page-sizes="[10, 30, 50, 100]"
:page-size="searchParam.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="courseList.totalRows"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
</div>
<!-- 弹框提示 -->
<dialog-componet :dialogObj="dialogObj"></dialog-componet>
</div>
</template>
<script>
import ShoppingCart from '@/components/education/custom/shopping-cart'
import dialog from "@/components/education/custom/dialog";
import { mapGetters, mapActions } from 'vuex'
export default {
data() {
return {
isRise: true,
isShowCart: false,
dialogObj: {
title: '课程数量已达上限',
visible: false,
message: '单个项目最多只能选择30个课程',
// tip: '单个项目最多只能选择30个课程',
hideMsg: '我知道了'
}
};
},
computed: {
...mapGetters(['cartList', 'courseList', 'searchParam'])
},
components: {
ShoppingCart,
dialogComponet: dialog,
},
methods: {
...mapActions(['setCartList', 'setSeachParam']),
toggleOrder() {
this.isRise = !this.isRise;
let dir = this.isRise ? 1 : 2;
this.searchParam.dir = dir;
this.setSeachParam(this.searchParam);
},
toggleCart() {
this.isShowCart = !this.isShowCart;
},
// 选择当前分页个数
handleSizeChange(val) {
this.searchParam.pageSize = val;
this.setSeachParam(this.searchParam);
},
// 选择当前分页
handleCurrentChange(val) {
this.searchParam.pageNo = val;
this.setSeachParam(this.searchParam);
},
// 选择课程(并要处理过滤,删除等)
toggleChecked(item) {
item.checked = !item.checked;
if(item.checked) {
if(this.cartList.length >= 30) {
item.checked = !item.checked;
this.dialogObj.visible = true;
return;
}
this.cartList.push(item);
} else {
let delItemIndex = this.cartList.findIndex( course => {
return course.courseId == item.courseId;
})
this.cartList.splice(delItemIndex, 1);
}
},
}
};
</script>
<style lang="less" scoped>
.course-list-wrapper {
padding: 0 30px;
min-width: 1180px;
max-width: 1600px;
.course-header {
display: flex;
flex-direction: row;
height: 78px;
// line-height: 78px;
align-items: center;
margin-right: 30px;
justify-content: space-between;
.title {
.main {
margin-right: 6px;
font-size: 18px;
font-weight: 600;
color: #000;
}
.sub {
font-size: 14px;
font-weight: 400;
color: #676869;
}
}
.order {
display: flex;
flex-direction: row;
align-items: center;
font-size: 14px;
color: #333333;
img {
position: relative;
top: 2px;
width: 14px;
height: 14px;
}
.num {
margin-right: 30px;
}
.cart-wrapper {
position: relative;
.cart {
position: relative;
.count {
position: absolute;
height: 20px;
top: -8px;
right: -12px;
display: inline-block;
span {
font-size: 12px;
padding: 2px;
background: red;
border-radius: 10px;
color: #fff;
}
}
}
.curt-position {
background: #fff;
position: absolute;
top: 30px;
right: 0px;
z-index: 100;
}
}
}
}
.list-wrapper {
height: 500px;
overflow: auto;
.list {
display: flex;
flex-direction: row;
// justify-content: space-between;
justify-content: flex-start;
flex-wrap: wrap;
padding-bottom: 30px;
// min-height: 1200px;
// max-height: 1200px;
overflow-y: auto;
.course {
cursor: pointer;
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: row;
height: 120px;
width: 527px;
padding: 15px;
margin-bottom: 10px;
margin-right: 10px;
border-radius: 4px;
border: 1px solid rgba(228, 231, 237, 1);
.img {
position: relative;
top: 0;
left: 0;
width: 160px;
height: 90px;
margin-right: 15px;
img {
width: 160px;
height: 90px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
.title {
position: relative;
top: -3px;
left: 0;
font-size: 16px;
font-weight: 600;
color: #373839;
}
.chapter {
font-size: 14px;
font-weight: 400;
color: #999999;
.section-num::before, .exam-num::before {
content: '';
position: relative;
top: 2.5px;
left: 0;
display: inline-block;
height: 14px;
line-height: 14px;
margin: 0 10px;
width: 1px;
background: #999999;
}
}
.cost {
position: absolute;
left: 0;
bottom: -5px;
.no {
font-size: 18px;
font-weight: 600;
margin-right: 4px;
color: #d82b2b;
}
.num {
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
}
.course-selected {
position: absolute;
right: 0;
bottom: 0;
width: 44px;
height: 44px;
}
}
}
}
.page-wrapper {
float: right;
margin: 10px 0;
margin-right: 230px;
}
}
</style>
\ No newline at end of file
......@@ -2,14 +2,14 @@
<div class="custom-select-wrapper">
<div class="department-label">
<span
v-for="(item, index) in dataList"
v-for="(item, index) in allLabelList"
:key="index"
class="item"
:class="{checked: item.checked}"
@click="selectLabel(index)"
>
<span class="split" :class="{acitve: item.checked}"></span>
{{item.name}}
<span class="split"></span>
</span>
</div>
......@@ -20,10 +20,13 @@
<span class="name active">全部</span>
</div>
<div class="check-list">
<el-checkbox-group v-model="checkList" @change="handleClassChange">
<el-checkbox v-for="(item, index) in courseLevel" :label="item.name" :key="index">{{item.name}}</el-checkbox>
<el-checkbox
v-for="(item, index) in subLabelList"
:label="item.id"
:key="index"
>{{item.name}}</el-checkbox>
</el-checkbox-group>
<!-- <el-checkbox-group v-model="checkList">
......@@ -53,17 +56,17 @@
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
</el-checkbox-group> -->
</el-checkbox-group>-->
</div>
<div class="right"></div>
</div>
</div>
<!-- 课程等级 -->
<div class="course-level">
<span class="title">课程等级</span>
<span
<span
class="item"
v-for="(item, index) in courseLevel"
v-for="(item, index) in courseLevel"
:key="index"
@click="selectLevel(index)"
>
......@@ -73,12 +76,12 @@
<div class="button-wrapper">
<el-button class="add-button" size="small" type="primary">查 询</el-button>
<el-button class="add-button" size="small">重 置</el-button>
<el-button class="add-button" plain size="small">重 置</el-button>
</div>
</div>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
export default {
data() {
return {
......@@ -88,7 +91,7 @@ export default {
{ name: "中级", value: 2, checked: false },
{ name: "高级", value: 3, checked: false }
],
checkList: []
checkList: [431, 441]
};
},
props: {
......@@ -152,12 +155,19 @@ export default {
}
}
},
computed: {
...mapGetters(['allLabelList', 'subLabelList'])
},
components: {},
methods: {
...mapActions(['setSubLabelList']),
selectLabel(index) {
this.dataList.forEach(element => {
this.allLabelList.forEach(element => {
element.checked = false;
});
this.dataList[index].checked = true;
this.allLabelList[index].checked = true;
let subLabelList = this.allLabelList[index].subList;
this.setSubLabelList(subLabelList);
},
selectLevel(index) {
this.courseLevel.forEach(element => {
......@@ -168,7 +178,7 @@ export default {
handleClassChange() {
// let checkedCount = value.length;
// this.checkAll = checkedCount === this.cities.length;
// this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
// this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
}
}
};
......@@ -183,6 +193,7 @@ export default {
border-bottom: 2px solid #449284;
border-radius: 6px 6px 0px 0px;
.item {
cursor: pointer;
position: relative;
z-index: 1;
display: inline-block;
......@@ -198,16 +209,21 @@ export default {
border-radius: 6px 0px 0px 0px;
}
}
// .split {
// position: absolute;
// top: 4px;
// right: 0px;
// z-index: 2;
// display: inline-block;
// height: 20px;
// width: 1px;
// background: #C7C8C9;
// }
.split {
position: absolute;
top: 14px;
left: 0px;
z-index: 2;
display: inline-block;
height: 20px;
width: 1px;
background: #c7c8c9;
}
.item:nth-child(1) > .split,
.item.checked + .item > .split,
.split.acitve {
display: none;
}
}
}
.course-level {
......@@ -218,13 +234,14 @@ export default {
line-height: 56px;
padding-left: 20px;
// margin: 16px 0 16px 20px;
border-bottom: 1px dotted #E4E7ED;
border-bottom: 1px dotted #e4e7ed;
.title {
display: inline-block;
padding: 0 10px;
color: #999999;
}
.item {
cursor: pointer;
display: inline-block;
margin: 0 5px;
color: #333333;
......@@ -233,13 +250,12 @@ export default {
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius:2px;
border-radius: 2px;
&.active {
color: #fff;
background: #449284;
}
}
}
}
......@@ -250,7 +266,7 @@ export default {
padding: 10px 0;
padding-left: 20px;
// margin: 16px 0 16px 20px;
border-bottom: 1px dashed #E4E7ED;
border-bottom: 1px dashed #e4e7ed;
.title {
height: 56px;
line-height: 56px;
......@@ -259,6 +275,7 @@ export default {
color: #999999;
}
.item {
cursor: pointer;
height: 56px;
line-height: 56px;
display: inline-block;
......@@ -269,17 +286,16 @@ export default {
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius:2px;
border-radius: 2px;
margin-right: 16px;
&.active {
color: #fff;
background: #449284;
}
}
}
.check-list {
margin-top: 14px;;
margin-top: 14px;
margin-right: 80px;
flex: 1;
}
......
此差异已折叠。
<template>
<div class="dialog">
<el-dialog
:title="dialogObj.title"
:show-close=false
:visible.sync="dialogObj.visible"
:close-on-click-modal="false"
width="600px"
center>
<p style="text-align: center;">{{dialogObj.message}}</p>
<p class="tip" v-if="dialogObj.tip">{{dialogObj.tip}}</p>
<span slot="footer" class="dialog-footer">
<el-button @click="confirm" v-if="dialogObj.confirmMsg">{{dialogObj.confirmMsg}}</el-button>
<el-button type="primary" @click="hide" v-if="dialogObj.hideMsg">{{dialogObj.hideMsg}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
dialogObj: {
type: Object,
default: () => {
return null;
}
}
},
data() {
return {
}
},
created() {},
methods: {
confirm() {
this.$emit('confirm');
},
hide() {
// this.$emit('hide');
this.dialogObj.visible = false;
}
}
}
</script>
<style lang="scss" scoped>
.tip {
margin-top: 20px;
text-align: center;
color: #C0C0C0;
}
</style>
<template>
<div class="select-course-wrapper">
<div class="top-line"></div>
<CustomSelect></CustomSelect>
<CourseSelect></CourseSelect>
<div class="top-line" style="margin-top: 70px;"></div>
<CourseList></CourseList>
</div>
</template>
<script>
import CustomSelect from '@/components/education/custom/custom-select'
import CourseSelect from '@/components/education/custom/course-select'
import CourseList from '@/components/education/custom/course-list'
export default {
data() {
return {
......@@ -14,7 +16,8 @@ export default {
}
},
components: {
CustomSelect
CourseSelect,
CourseList,
}
}
</script>
......
<template>
<div class="cart-list-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<img @click="close" src="../../../assets/custom/icon/close.png" alt />
</div>
<ul class="cart-list">
<li
class="cart-course"
v-for="item in cartList"
:key="item.courseId"
>
<div class="img">
<img src="../../../assets/custom/test.png" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<span class="cost">免费</span>
</div>
<div class="delete" @click="deleteCart(item)">
<img src="../../../assets/custom/icon/icon-delete.png" alt />
</div>
</li>
</ul>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {};
},
computed: {
...mapGetters(["cartList", 'courseList'])
},
methods: {
close() {
this.$emit("close");
},
deleteCart(item) {
// 先删除够物车中的课程
let delItemIndex = this.cartList.findIndex( course => {
return course.courseId == item.courseId;
})
this.cartList.splice(delItemIndex, 1);
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
let courseIndex = this.courseList.list.findIndex( course => {
return course.courseId == item.courseId;
})
if(courseIndex >= 0) {
this.courseList.list[courseIndex].checked = false;
}
}
}
};
</script>
<style lang="less" scoped>
.cart-list-wrapper {
font-family: PingFang SC !important;
width: 440px;
height: 550px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.cart-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 50px;
line-height: 50px;
padding: 0 15px;
font-size: 18px;
font-weight: 700;
color: #000000;
background: #f9f9f9;
img {
width: 15px;
height: 15px;
}
}
// .list {
// padding: 15px;
// height: 480px;
// overflow: auto;
// }
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
// flex-wrap: wrap;
height: 490px;
overflow: auto;
.cart-course {
position: relative;
display: flex;
flex-direction: row;
// height: 83px;
width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 410px;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120;
height: 68px;
margin-right: 15px;
img {
width: 120;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -7px;
left: 0;
font-size: 16px;
font-weight: 600;
color: #373839;
}
.cost {
position: absolute;
bottom: -7px;
left: 0;
font-size: 18px;
font-weight: 600;
margin-right: 4px;
color: #d82b2b;
}
}
.delete {
width: 35px;
img {
cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
}
</style>
\ No newline at end of file
const customStore = {
// namespaced: true,
state: {
searchParam: {
orderBy: 2,
dir: 1,
grade: 0,
pageNo: 1,
pageSize: 10,
labelIdList: []
},
cartList: [],
courseList: [],
allLabelList: [],
subLabelList: [],
},
mutations: {
SET_SEARCH_PARAM: (state, searchParam) => {
state.searchParam = searchParam;
},
SET_CART_LIST: (state, cartList) => {
state.cartList = cartList;
},
SET_COURSE_LIST: (state, courseList) => {
state.courseList = courseList;
},
SET_ALL_LABEL_LIST: (state, allLabelList) => {
state.allLabelList = allLabelList;
},
SET_SUB_LABEL_LIST: (state, subLabelList) => {
state.subLabelList = subLabelList;
},
},
actions: {
setSeachParam({ commit }, searchParam) {
commit('SET_SEARCH_PARAM', searchParam);
},
setCartList({ commit }, cartList) {
commit('SET_CART_LIST', cartList);
},
setCourseList({ commit }, courseList) {
commit('SET_COURSE_LIST', courseList);
},
setAllLabelList({ commit }, allLabelList) {
commit('SET_ALL_LABEL_LIST', allLabelList);
},
setSubLabelList({ commit }, subLabelList) {
commit('SET_SUB_LABEL_LIST', subLabelList);
},
}
}
export default customStore;
\ No newline at end of file
const getters = {
searchParam: state => state.customStore.searchParam,
cartList: state => state.customStore.cartList,
courseList: state => state.customStore.courseList,
allLabelList: state => state.customStore.allLabelList,
subLabelList: state => state.customStore.subLabelList,
}
export default getters
import education from './education/getters'
import custom from './custom/getters'
import { containObject } from '../utils/utils'
const getters = containObject(education)
// import { containObject } from '../utils/utils'
// let getters = containObject(education)
const getters = Object.assign(education, custom)
export default getters
\ No newline at end of file
......@@ -9,7 +9,8 @@ import patientsDiagnose from './patientsManage/patientsDiagnose';
// cme
import cmeStore from './cme/cmeStore';
// custom
import customStore from './custom/customStore';
Vue.use(Vuex)
......@@ -19,6 +20,7 @@ export default new Vuex.Store({
...followModules,
patientsDiagnose,
cmeStore,
customStore
},
getters
})
......
......@@ -138,3 +138,27 @@
border-color: #449284;
}
}
.custom-select-wrapper {
// .el-button:focus, .el-button:hover {
// color: #449284;
// border-color: #449284;
// // background-color: #449284;
// }
.el-button.is-plain, .el-button.is-plain {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button.is-plain:focus, .el-button.is-plain:hover {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button--mini, .el-button--small {
font-size: 14px;
border-radius: 3px;
}
}
......@@ -413,9 +413,9 @@ const vueFilter = {
} else if (value == 2) {
return '未上架';
} else if (value == 300) {
return '审核中';
return '审核中';
} else if (value == 3) {
return '待审核';
return '待审核';
} else if (value == 4) {
return '已上架';
} else if (value == 5) {
......@@ -437,6 +437,14 @@ const vueFilter = {
} else {
return value
}
}
},
// 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...)
shortName: (value, length = 24, append = '...') => {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
}
},
}
export default vueFilter
\ No newline at end of file
import axios from 'axios';
// 对象的合并
export const containObject = function(...obj1) {
let obj = Object.assign(...obj1)
return obj
}
// export const containObject = function(...obj1) {
// let obj = Object.assign(...obj1)
// return obj
// }
// 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){
......
......@@ -27,15 +27,15 @@
<template-list @checkFn="checkFn"></template-list>
</div> -->
<!-- 模板列表 -->
<!-- 选择课程 -->
<div v-if="active == 0" class="tpl-main">
<!-- <template-list @checkFn="checkFn"></template-list> -->
<selectCourse ></selectCourse>
<SelectCourseComp></SelectCourseComp>
</div>
<!-- 填写项目信息-->
<template-message
ref="templateMessage"
<!-- <template-message -->
<custom-baseinfo
ref="CustomBaseinfo"
v-if="active == 1"
:openTemplateId="openTemplateId"
:projectId="projectId"
......@@ -61,24 +61,44 @@
<dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet>
<dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet>
<!-- <draggable v-model="myArray">
<transition-group>
<div v-for="element in myArray" :key="element.id">
{{element.name}}
</div>
</transition-group>
</draggable> -->
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import templateMessage from "../../components/education/template/templateMessage";
import selectTemplate from "../../components/education/template/selectTemplate";
import selectRegion from "../../components/education/template/selectRegion";
import setOrganization from "../../components/education/template/setOrganization";
// import templateList from "../../components/education/template/templateList";
import selectCourse from "../../components/education/custom/select-course";
import dialog from "../../components/education/template/dialog";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
// import CustomBaseinfo from "@/components/education/template/CustomBaseinfo";
import CustomBaseinfo from "@/components/education/custom/custom-baseinfo";
import selectTemplate from "@/components/education/template/selectTemplate";
import selectRegion from "@/components/education/template/selectRegion";
import setOrganization from "@/components/education/template/setOrganization";
import SelectCourseComp from "@/components/education/custom/select-course-comp";
import dialog from "@/components/education/template/dialog";
import { openLoading, closeLoading, resizeHeight } from "@/utils/utils";
import draggable from 'vuedraggable'
import { mapGetters, mapActions } from 'vuex'
let vm = null;
export default {
data() {
return {
myArray: [
{id: 1, name: '教培项目1'},
{id: 1, name: '教培项目2'},
{id: 1, name: '教培项目3'},
{id: 1, name: '教培项目4'},
{id: 1, name: '教培项目5'},
{id: 1, name: '教培项目6'},
{id: 1, name: '教培项目7'},
],
curmbFirst: "教培项目",
curmbSecond: "项目管理",
jumPathThird: 'edit-custom',
......@@ -140,20 +160,31 @@ export default {
confirmMsg: '取消',
hideMsg: '确定发布'
},
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
status4Flag: 0,//0表示没有上过架,1表示上过架
isPreview: 0 // 1表示是查看信息
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
status4Flag: 0, //0表示没有上过架,1表示上过架
isPreview: 0, // 1表示是查看信息
}
},
computed: {
...mapGetters(['searchParam'])
},
watch: {
searchParam: {
handler(val) {
this.getCourseList(val);
},
deep: true
}
},
components: {
BreadCrumb,
templateMessage,
CustomBaseinfo,
selectTemplate,
selectRegion,
setOrganization,
// templateList,
dialogComponet:dialog,
selectCourse
SelectCourseComp,
draggable
},
created() {
vm = this;
......@@ -161,9 +192,68 @@ export default {
vm.isPreviewFn();
},
mounted() {
commonUtil.resizeHeight();
resizeHeight();
this.getLabelList();
this.getCourseList(this.searchParam);
},
methods: {
...mapActions(['setCourseList', 'setAllLabelList', 'setSubLabelList']),
getLabelList() {
vm.GET("/contents/diseases/labelList", {}).then(res => {
if (res.code == "000000") {
// 先将所有的标签添加checked字段
let labelList = res.data;
let allSubList = [];
labelList.forEach( (item, index) => {
item.checked = false;
item.subList.forEach( (sub, subIndex) => {
if(subIndex == 0) {
sub.id = `subid-${index}`;
}
sub.parentIndex = index;
sub.checked = false;
if(index == 0) {
allSubList.push(sub);
} else if(sub.id != 0){
allSubList.push(sub);
}
})
})
allSubList[0].checked = true;
// allSubList[0].id = 'parentid-0'; // 一级的“全部”标签的id
// 添加一级的“全部”标签,并构建其子标签
labelList.unshift({
name: '全部',
checked: true,
subList: allSubList
})
this.setAllLabelList(labelList);
this.setSubLabelList(allSubList);
}
});
},
// (根据条件)查询课程
getCourseList(searchParam) {
// let param = {
// orderBy: 2,
// grade: 0,
// pageNo: 1,
// pageSize: 10,
// orderBy: 2,
// labelIdList: [441, 442]
// }
vm.GET("/contents/diseases/courseListForPortal", searchParam).then(res => {
if (res.code == "000000") {
let courseList = res.data;
courseList.list.forEach( (item) => {
item.checked = false;
});
this.setCourseList(courseList);
}
});
},
// 判断是否为编辑状态
isEditorFn(){
if(vm.$route.query.projectId) {
......@@ -194,7 +284,7 @@ export default {
return;
}
// 调用项目信息中的下一步操作
vm.$refs.templateMessage.nextStep();
vm.$refs.CustomBaseinfo.nextStep();
return;
}
},
......@@ -206,7 +296,7 @@ export default {
// 暂存
save() {
if (vm.active == 1) {
vm.$refs.templateMessage.save();
vm.$refs.CustomBaseinfo.save();
} else if (vm.active == 2) {
vm.regionComplete();
}
......@@ -305,6 +395,7 @@ export default {
vm.canNext = true;
vm.openTemplateId = id;
},
//选中模板后点击下一步时检测(机构和进行中的项目)
checkSelectTemplate() {
openLoading(vm);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册