提交 1cc74a7a 编写于 作者: guangjun.yang's avatar guangjun.yang

解决部分bug等

上级 8e2d6544
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
height: 78px; height: 78px;
// line-height: 78px; // line-height: 78px;
align-items: center; align-items: center;
margin-right: 30px; margin-right: 100px;
justify-content: space-between; justify-content: space-between;
.title { .title {
.main { .main {
......
<template>
<div class="custom-select-wrapper">
<div class="department-label">
<span
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>
</div>
<!-- 课程分类 -->
<div class="course-class">
<div class="title">课程分类</div>
<div class="item">
<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 subLabelList"
:label="item.id"
:key="index"
>{{item.name}}</el-checkbox>
</el-checkbox-group>
<!-- <el-checkbox-group v-model="checkList">
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox>
</el-checkbox-group>-->
</div>
<div class="right"></div>
</div>
<!-- 课程等级 -->
<div class="course-level">
<span class="title">课程等级</span>
<span
class="item"
v-for="(item, index) in courseLevel"
:key="index"
@click="selectLevel(index)"
>
<span class="name" :class="{active: item.checked}">{{item.name}}</span>
</span>
</div>
<div class="button-wrapper">
<el-button class="add-button" size="small" type="primary">查 询</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 {
courseLevel: [
{ name: "全部", value: 0, checked: true },
{ name: "初级", value: 1, checked: false },
{ name: "中级", value: 2, checked: false },
{ name: "高级", value: 3, checked: false }
],
checkList: [431, 441]
};
},
props: {
dataList: {
type: Array,
default: () => {
return [
{
name: "全部",
checked: true
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
},
{
name: "内科",
checked: false
},
{
name: "神经科",
checked: false
},
{
name: "肿瘤科",
checked: false
},
{
name: "妇产科",
checked: false
}
];
}
}
},
computed: {
...mapGetters(['allLabelList', 'subLabelList'])
},
components: {},
methods: {
...mapActions(['setSubLabelList']),
selectLabel(index) {
this.allLabelList.forEach(element => {
element.checked = false;
});
this.allLabelList[index].checked = true;
let subLabelList = this.allLabelList[index].subList;
this.setSubLabelList(subLabelList);
},
selectLevel(index) {
this.courseLevel.forEach(element => {
element.checked = false;
});
this.courseLevel[index].checked = true;
},
handleClassChange() {
// let checkedCount = value.length;
// this.checkAll = checkedCount === this.cities.length;
// this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
}
}
};
</script>
<style lang="less" scoped>
.custom-select-wrapper {
.department-label {
display: flex;
flex-direction: row;
height: 48px;
line-height: 48px;
border-bottom: 2px solid #449284;
border-radius: 6px 6px 0px 0px;
.item {
cursor: pointer;
position: relative;
z-index: 1;
display: inline-block;
padding: 0 22px;
font-size: 16px;
color: #666666;
&.checked {
color: #fff;
z-index: 3;
background: #449284;
}
&:first-child {
border-radius: 6px 0px 0px 0px;
}
}
.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 {
display: flex;
flex-direction: row;
box-sizing: content-box;
height: 56px;
line-height: 56px;
padding-left: 20px;
// margin: 16px 0 16px 20px;
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;
.name {
height: 26px;
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius: 2px;
&.active {
color: #fff;
background: #449284;
}
}
}
}
.course-class {
display: flex;
flex-direction: row;
box-sizing: content-box;
padding: 10px 0;
padding-left: 20px;
// margin: 16px 0 16px 20px;
border-bottom: 1px dashed #e4e7ed;
.title {
height: 56px;
line-height: 56px;
display: inline-block;
padding: 0 10px;
color: #999999;
}
.item {
cursor: pointer;
height: 56px;
line-height: 56px;
display: inline-block;
margin: 0 5px;
color: #333333;
.name {
height: 26px;
line-height: 26px;
display: inline-block;
padding: 0px 10px;
border-radius: 2px;
margin-right: 16px;
&.active {
color: #fff;
background: #449284;
}
}
}
.check-list {
margin-top: 14px;
margin-right: 80px;
flex: 1;
}
.el-checkbox {
height: 30px;
line-height: 30px;
}
}
.button-wrapper {
margin-top: 20px;
margin-right: 50px;
// height: 60px;
// line-height: 60px;
.add-button {
float: right;
margin: 0 10px;
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="custom-select-wrapper"> <div class="custom-select-wrapper" style="width: 1300px;overflow:auto;">
<div class="department-label"> <div class="department-label">
<span <span
v-for="(item, index) in allLabelList" v-for="(item, index) in allLabelList"
...@@ -16,18 +17,30 @@ ...@@ -16,18 +17,30 @@
<!-- 课程分类 --> <!-- 课程分类 -->
<div class="course-class"> <div class="course-class">
<div class="title">课程分类</div> <div class="title">课程分类</div>
<div class="item"> <div class="item" @click="selectSubLabel(subLabelList[0])">
<span class="name active">全部</span> <span class="name" :class="{'active': subLabelList[0].checked}">全部</span>
</div> </div>
<ul class="check-list">
<div class="check-list"> <!-- <el-checkbox-group v-model="checkList" @change="handleClassChange">
<el-checkbox-group v-model="checkList" @change="handleClassChange">
<el-checkbox <el-checkbox
v-for="(item, index) in subLabelList" v-for="(item, index) in subLabelList.slice(1)"
:label="item.id" :label="item.id"
:key="index" :key="index"
@change="selectSubLabel(item)"
>{{item.name}}</el-checkbox> >{{item.name}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group> -->
<li
class="sub-item"
:class="{'active': item.checked}"
v-for="(item, index) in subLabelList.slice(1)"
:key="index"
@click="selectSubLabel(item)"
>
<img v-show="item.checked" src="../../../assets/custom/icon/label-sel.png" alt />
<img v-show="!item.checked" src="../../../assets/custom/icon/label-sel-no.png" alt />
{{item.name}}
</li>
</ul>
<!-- <el-checkbox-group v-model="checkList"> <!-- <el-checkbox-group v-model="checkList">
<el-checkbox label="复选框 A"></el-checkbox> <el-checkbox label="复选框 A"></el-checkbox>
...@@ -57,7 +70,6 @@ ...@@ -57,7 +70,6 @@
<el-checkbox label="禁用"></el-checkbox> <el-checkbox label="禁用"></el-checkbox>
<el-checkbox label="选中且禁用"></el-checkbox> <el-checkbox label="选中且禁用"></el-checkbox>
</el-checkbox-group>--> </el-checkbox-group>-->
</div>
<div class="right"></div> <div class="right"></div>
</div> </div>
...@@ -75,8 +87,8 @@ ...@@ -75,8 +87,8 @@
</div> </div>
<div class="button-wrapper"> <div class="button-wrapper">
<el-button class="add-button" size="small" type="primary">查 询</el-button>
<el-button class="add-button" plain size="small">重 置</el-button> <el-button class="add-button" plain size="small">重 置</el-button>
<el-button class="add-button" size="small" type="primary">查 询</el-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -169,6 +181,12 @@ export default { ...@@ -169,6 +181,12 @@ export default {
let subLabelList = this.allLabelList[index].subList; let subLabelList = this.allLabelList[index].subList;
this.setSubLabelList(subLabelList); this.setSubLabelList(subLabelList);
}, },
// 选择二级
selectSubLabel(item) {
console.log(item);
item.checked = !item.checked;
this.$forceUpdate();
},
selectLevel(index) { selectLevel(index) {
this.courseLevel.forEach(element => { this.courseLevel.forEach(element => {
element.checked = false; element.checked = false;
...@@ -295,9 +313,31 @@ export default { ...@@ -295,9 +313,31 @@ export default {
} }
} }
.check-list { .check-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 14px; margin-top: 14px;
margin-right: 80px; margin-right: 80px;
flex: 1; flex: 1;
.sub-item {
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #333333;
margin-right: 30px;
img {
width: 16px;
height: 16px;
margin-right: 5px;
}
&.active {
color: #449284;
}
}
} }
.el-checkbox { .el-checkbox {
height: 30px; height: 30px;
...@@ -305,13 +345,10 @@ export default { ...@@ -305,13 +345,10 @@ export default {
} }
} }
.button-wrapper { .button-wrapper {
display: flex;
flex-direction: row;
justify-content: flex-end;
margin-top: 20px; margin-top: 20px;
margin-right: 50px; margin-right: 50px;
// height: 60px;
// line-height: 60px;
.add-button {
float: right;
margin: 0 10px;
}
} }
</style> </style>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-col> </el-col>
<el-col :span="10" class="curt-position-wrapper"> <el-col :span="10" class="curt-position-wrapper">
<div class="curt-position"> <div class="curt-position">
<SortedCart :isPreview="isPreview"></SortedCart> <SortedCart :isPreview="isPreview" :projectStatus="projectStatus"></SortedCart>
</div> </div>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -358,6 +358,7 @@ export default { ...@@ -358,6 +358,7 @@ export default {
hideMsg: "重新选择" hideMsg: "重新选择"
}, },
isPreview: 0, isPreview: 0,
projectStatus: 0,
attachInfo: { attachInfo: {
attachMap: { attachMap: {
1: [], 1: [],
...@@ -383,6 +384,8 @@ export default { ...@@ -383,6 +384,8 @@ export default {
created() { created() {
vm = this; vm = this;
vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0; vm.isPreview = vm.$route.query.isPreview ? vm.$route.query.isPreview : 0;
this.projectStatus = vm.$route.query.projectStatus;
// 编辑时 // 编辑时
if (vm.editor) { if (vm.editor) {
vm.disabled = false; vm.disabled = false;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="select-course-wrapper"> <div class="select-course-wrapper">
<div class="top-line"></div> <div class="top-line"></div>
<CourseSelect></CourseSelect> <CourseSelect></CourseSelect>
<div class="top-line" style="margin-top: 70px;"></div> <div class="top-line" style="margin-top: 20px;"></div>
<CourseList></CourseList> <CourseList></CourseList>
</div> </div>
</template> </template>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span> <span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span>
</div> </div>
<div v-if="isPreview == 1" class="cart-list"> <div v-if="isPreview == 1 || projectStatus == 1" class="cart-list">
<div class="cart-course is-preview" v-for="(item, index) in cartList" :key="index"> <div class="cart-course is-preview" v-for="(item, index) in cartList" :key="index">
<div class="img"> <div class="img">
<img :src="item.courseImageUrl" alt /> <img :src="item.courseImageUrl" alt />
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
</div> </div>
<draggable v-if="isPreview != 1" class="cart-list" v-model="cartList"> <draggable v-if="isPreview != 1 && projectStatus != 1" class="cart-list" v-model="cartList">
<div class="cart-course" v-for="(item, index) in cartList" :key="index"> <div class="cart-course" v-for="(item, index) in cartList" :key="index">
<div class="img"> <div class="img">
<img :src="item.courseImageUrl" alt /> <img :src="item.courseImageUrl" alt />
...@@ -51,7 +51,8 @@ export default { ...@@ -51,7 +51,8 @@ export default {
return {}; return {};
}, },
props: { props: {
isPreview: String | Number isPreview: String | Number,
projectStatus: String | Number,
}, },
computed: { computed: {
cartList: { cartList: {
......
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
}); });
}, },
// // 获取所有标签(一级及二级),交做相应处理
getLabelList() { getLabelList() {
vm.GET("contents/diseases/labelList", {}).then(res => { vm.GET("contents/diseases/labelList", {}).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
...@@ -242,20 +242,21 @@ export default { ...@@ -242,20 +242,21 @@ export default {
labelList.forEach((item, index) => { labelList.forEach((item, index) => {
item.checked = false; item.checked = false;
item.subList.forEach((sub, subIndex) => { item.subList.forEach((sub, subIndex) => {
if (subIndex == 0) {
sub.id = `subid-${index}`;
}
sub.parentIndex = index; sub.parentIndex = index;
sub.checked = false; sub.checked = false;
if (index == 0) { if (subIndex == 0) {
allSubList.push(sub); sub.id = `subid-${index}`; // 将二级中的“全部”id改为可以识别的
} else if (sub.id != 0) { } else {
allSubList.push(sub); allSubList.push(sub);
} }
}); });
}); });
allSubList[0].checked = true; // 构建其子标签
// allSubList[0].id = 'parentid-0'; // 一级的“全部”标签的id allSubList.unshift({
name: "全部",
checked: false,
id: 'parentid-0'
});
// 添加一级的“全部”标签,并构建其子标签 // 添加一级的“全部”标签,并构建其子标签
labelList.unshift({ labelList.unshift({
name: "全部", name: "全部",
......
...@@ -53,15 +53,16 @@ ...@@ -53,15 +53,16 @@
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
<el-form v-if="isRoleOfOuter" :model="formInline" class="demo-form-inline">
<el-form-item> <el-form :model="formInline" class="demo-form-inline">
<el-button <el-form-item >
<el-button v-show="isRoleOfOuter && idType == 2"
class="add-button" class="add-button"
size="small" size="small"
type="primary" type="primary"
@click="toEditCustomPage()" @click="toEditCustomPage()"
>创建自定义项目</el-button> >创建自定义项目</el-button>
<el-button class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button> <el-button v-show="isRoleOfOuter" class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table class="item-table" :data="tableData" style="width: 100%"> <el-table class="item-table" :data="tableData" style="width: 100%">
...@@ -711,11 +712,8 @@ export default { ...@@ -711,11 +712,8 @@ export default {
} else if (row.projectType === 4) { } else if (row.projectType === 4) {
this.$router.push( this.$router.push(
"edit-custom?projectType=4&projectId=" + "edit-custom?projectType=4&projectId=" +
projectId + projectId + "&level=" + level + "&pageNum=" + this.formInline.pageNo +
"&level=" + "&projectStatus=" + row.projectStatus
level +
"&pageNum=" +
this.formInline.pageNo
); );
} }
} else if (type === 7) { } else if (type === 7) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册