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

修改与查看

上级 f16572db
...@@ -21,33 +21,39 @@ ...@@ -21,33 +21,39 @@
</div> </div>
<div v-show="isShowCart" class="curt-position"> <div v-show="isShowCart" class="curt-position">
<ShoppingCart @close="toggleCart"></ShoppingCart> <ShoppingCart @close="toggleCart"></ShoppingCart>
</div> </div>
</div> </div>
</li> </li>
</ul> </ul>
<div class="list-wrapper"> <div class="list-wrapper">
<ul class="list"> <ul class="list">
<li <li
class="course" class="course"
v-for="(item, index) in courseList.list" v-for="(item, index) in courseList.list"
:key="index" :key="index"
@click="toggleChecked(item)" @click="toggleChecked(item)"
> >
<div class="img"> <div class="img">
<img src="../../../assets/custom/test.png" alt /> <img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span> <span class="level">{{item.typeStr}}</span>
</div> </div>
<div class="detail"> <div class="detail">
<span class="title">{{item.courseName | shortName}}</span> <span class="title">{{item.courseName | shortName}}</span>
<div class="chapter"> <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> <span>{{item.docName | shortName(5)}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span>
<span v-if="item.testCount" class="exam-num">{{item.testCount}}场考试</span>
</div> </div>
<div class="cost"> <div class="cost">
<span class="no">免费</span> <span class="no">免费</span>
<span class="num">{{item.joinNum}}人已学</span> <span class="num">{{item.joinNum}}人已学</span>
</div> </div>
</div> </div>
<img v-show="item.checked" class="course-selected" src="../../../assets/custom/icon/icon-selected.png" alt /> <img
v-show="item.checked"
class="course-selected"
src="../../../assets/custom/icon/icon-selected.png"
/>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -62,82 +68,80 @@ ...@@ -62,82 +68,80 @@
:total="courseList.totalRows" :total="courseList.totalRows"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
></el-pagination> ></el-pagination>
</div> </div>
<!-- 弹框提示 --> <!-- 弹框提示 -->
<dialog-componet :dialogObj="dialogObj"></dialog-componet> <dialog-componet :dialogObj="dialogObj"></dialog-componet>
</div> </div>
</template> </template>
<script> <script>
import ShoppingCart from '@/components/education/custom/shopping-cart' import ShoppingCart from "@/components/education/custom/shopping-cart";
import dialog from "@/components/education/custom/dialog"; import dialog from "@/components/education/custom/dialog";
import { mapGetters, mapActions } from 'vuex' import { mapGetters, mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
isRise: true, isRise: true,
isShowCart: false, isShowCart: false,
dialogObj: { dialogObj: {
title: '课程数量已达上限', title: "课程数量已达上限",
visible: false, visible: false,
message: '单个项目最多只能选择30个课程', message: "单个项目最多只能选择30个课程",
// tip: '单个项目最多只能选择30个课程', tip: "",
hideMsg: '我知道了' hideMsg: "我知道了"
} }
}; };
}, },
computed: { computed: {
...mapGetters(['cartList', 'courseList', 'searchParam']) ...mapGetters(["cartList", "courseList", "searchParam"])
}, },
components: { components: {
ShoppingCart, ShoppingCart,
dialogComponet: dialog, dialogComponet: dialog
}, },
methods: { methods: {
...mapActions(['setCartList', 'setSeachParam']), ...mapActions(["setCartList", "setSearchParam"]),
toggleOrder() { toggleOrder() {
this.isRise = !this.isRise; this.isRise = !this.isRise;
let dir = this.isRise ? 1 : 2; let dir = this.isRise ? 1 : 2;
this.searchParam.dir = dir; this.searchParam.dir = dir;
this.setSeachParam(this.searchParam); this.setSearchParam(this.searchParam);
}, },
toggleCart() { toggleCart() {
this.isShowCart = !this.isShowCart; this.isShowCart = !this.isShowCart;
}, },
// 选择当前分页个数 // 选择当前分页个数
handleSizeChange(val) { handleSizeChange(val) {
this.searchParam.pageSize = val; this.searchParam.pageSize = val;
this.setSeachParam(this.searchParam); this.setSearchParam(this.searchParam);
}, },
// 选择当前分页 // 选择当前分页
handleCurrentChange(val) { handleCurrentChange(val) {
this.searchParam.pageNo = val; this.searchParam.pageNo = val;
this.setSeachParam(this.searchParam); this.setSearchParam(this.searchParam);
}, },
// 选择课程(并要处理过滤,删除等) // 选择课程(并要处理过滤,删除等)
toggleChecked(item) { toggleChecked(item) {
item.checked = !item.checked; item.checked = !item.checked;
if(item.checked) { if (item.checked) {
if(this.cartList.length >= 30) { if (this.cartList.length >= 30) {
item.checked = !item.checked; item.checked = !item.checked;
this.dialogObj.visible = true; this.dialogObj.visible = true;
return; return;
} }
this.cartList.push(item); this.cartList.push(item);
} else { } else {
let delItemIndex = this.cartList.findIndex( course => { let delItemIndex = this.cartList.findIndex(course => {
return course.courseId == item.courseId; return course.courseId == item.courseId;
}) });
this.cartList.splice(delItemIndex, 1); this.cartList.splice(delItemIndex, 1);
} }
this.setCartList(this.cartList); this.setCartList(this.cartList);
this.$forceUpdate(); this.$forceUpdate();
}, }
} }
}; };
</script> </script>
...@@ -193,6 +197,9 @@ export default { ...@@ -193,6 +197,9 @@ export default {
right: -12px; right: -12px;
display: inline-block; display: inline-block;
span { span {
display: inline-block;
min-width: 18px;
text-align: center;
font-size: 12px; font-size: 12px;
padding: 2px; padding: 2px;
background: red; background: red;
...@@ -209,7 +216,6 @@ export default { ...@@ -209,7 +216,6 @@ export default {
z-index: 100; z-index: 100;
} }
} }
} }
} }
.list-wrapper { .list-wrapper {
...@@ -218,14 +224,12 @@ export default { ...@@ -218,14 +224,12 @@ export default {
.list { .list {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
// justify-content: space-between;
justify-content: flex-start; justify-content: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
padding-bottom: 30px; padding-bottom: 30px;
// min-height: 1200px;
// max-height: 1200px;
overflow-y: auto; overflow-y: auto;
.course { .course {
user-select: none;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
top: 0; top: 0;
...@@ -284,8 +288,9 @@ export default { ...@@ -284,8 +288,9 @@ export default {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #999999; color: #999999;
.section-num::before, .exam-num::before { .section-num::before,
content: ''; .exam-num::before {
content: "";
position: relative; position: relative;
top: 2.5px; top: 2.5px;
left: 0; left: 0;
...@@ -329,6 +334,5 @@ export default { ...@@ -329,6 +334,5 @@ export default {
margin: 10px 0; margin: 10px 0;
margin-right: 230px; margin-right: 230px;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -5,13 +5,9 @@ ...@@ -5,13 +5,9 @@
<img @click="close" src="../../../assets/custom/icon/close.png" alt /> <img @click="close" src="../../../assets/custom/icon/close.png" alt />
</div> </div>
<ul class="cart-list"> <ul class="cart-list">
<li <li class="cart-course" v-for="item in cartList" :key="item.courseId">
class="cart-course"
v-for="item in cartList"
:key="item.courseId"
>
<div class="img"> <div class="img">
<img src="../../../assets/custom/test.png" alt /> <img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span> <span class="level">{{item.typeStr}}</span>
</div> </div>
<div class="detail"> <div class="detail">
...@@ -32,7 +28,7 @@ export default { ...@@ -32,7 +28,7 @@ export default {
return {}; return {};
}, },
computed: { computed: {
...mapGetters(["cartList", 'courseList']) ...mapGetters(["cartList", "courseList"])
}, },
methods: { methods: {
close() { close() {
...@@ -40,15 +36,15 @@ export default { ...@@ -40,15 +36,15 @@ export default {
}, },
deleteCart(item) { deleteCart(item) {
// 先删除够物车中的课程 // 先删除够物车中的课程
let delItemIndex = this.cartList.findIndex( course => { let delItemIndex = this.cartList.findIndex(course => {
return course.courseId == item.courseId; return course.courseId == item.courseId;
}) });
this.cartList.splice(delItemIndex, 1); this.cartList.splice(delItemIndex, 1);
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态 // 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
let courseIndex = this.courseList.list.findIndex( course => { let courseIndex = this.courseList.list.findIndex(course => {
return course.courseId == item.courseId; return course.courseId == item.courseId;
}) });
if(courseIndex >= 0) { if (courseIndex >= 0) {
this.courseList.list[courseIndex].checked = false; this.courseList.list[courseIndex].checked = false;
} }
} }
...@@ -80,23 +76,17 @@ export default { ...@@ -80,23 +76,17 @@ export default {
height: 15px; height: 15px;
} }
} }
// .list {
// padding: 15px;
// height: 480px;
// overflow: auto;
// }
.cart-list { .cart-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
// flex-wrap: wrap;
height: 490px; height: 490px;
overflow: auto; overflow: auto;
.cart-course { .cart-course {
user-select: none;
position: relative; position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
// height: 83px;
width: 410px; width: 410px;
margin: 15px; margin: 15px;
align-items: center; align-items: center;
...@@ -115,11 +105,11 @@ export default { ...@@ -115,11 +105,11 @@ export default {
position: relative; position: relative;
top: 0; top: 0;
left: 0; left: 0;
width: 120; width: 120px;
height: 68px; height: 68px;
margin-right: 15px; margin-right: 15px;
img { img {
width: 120; width: 120px;
height: 68px; height: 68px;
border-radius: 4px; border-radius: 4px;
} }
......
...@@ -5,18 +5,36 @@ ...@@ -5,18 +5,36 @@
<span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span> <span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span>
</div> </div>
<!-- <draggable v-model="myArray" class="cart-list"> --> <div v-if="isPreview == 1" class="cart-list">
<draggable class="cart-list" v-model="cartList"> <div class="cart-course is-preview" v-for="(item, index) in cartList" :key="index">
<div class="cart-course" v-for="item in cartList" :key="item.courseId">
<div class="img"> <div class="img">
<img src="../../../assets/custom/test.png" alt /> <img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName | shortName(5)}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="true" class="exam-num">{{item.testCount}}场考试</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</div>
<draggable v-if="isPreview != 1" class="cart-list" v-model="cartList">
<div class="cart-course" v-for="(item, index) in cartList" :key="index">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span> <span class="level">{{item.typeStr}}</span>
</div> </div>
<div class="detail"> <div class="detail">
<span class="title">{{item.courseName | shortName}}</span> <span class="title">{{item.courseName | shortName}}</span>
<div class="chapter"> <div class="chapter">
<span>{{item.docName}}</span> <span>{{item.docName}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span> <span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="item.testCount" class="exam-num">{{item.testCount}}场考试</span>
</div> </div>
</div> </div>
<div class="handler"> <div class="handler">
...@@ -27,21 +45,20 @@ ...@@ -27,21 +45,20 @@
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
export default { export default {
data() { data() {
return {}; return {};
}, },
props: {
isPreview: String
},
computed: { computed: {
// ...mapGetters(["cartList"]),
cartList: { cartList: {
get() { get() {
console.log('get()');
return this.$store.state.customStore.cartList; return this.$store.state.customStore.cartList;
}, },
set(value) { set(value) {
console.log('set(value)', value);
this.$store.dispatch("setCartList", value); this.$store.dispatch("setCartList", value);
} }
} }
...@@ -55,12 +72,25 @@ export default { ...@@ -55,12 +72,25 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.sorted-cart-wrapper { .sorted-cart-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
font-family: PingFang SC !important; font-family: PingFang SC !important;
width: 440px; width: 480px;
height: 790px; height: 790px;
background: #fff; background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15); box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px; border-radius: 4px;
.mask {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 440px;
height: 790px;
// background: ;
}
.cart-header { .cart-header {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -95,17 +125,20 @@ export default { ...@@ -95,17 +125,20 @@ export default {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
width: 410px; // width: 410px;
margin: 15px; margin: 15px;
align-items: center; align-items: center;
border-radius: 4px; border-radius: 4px;
&.is-preview {
cursor: default;
}
&::after { &::after {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: -15px; bottom: -15px;
z-index: 1; z-index: 1;
content: ""; content: "";
width: 410px; width: 100%;
height: 1px; height: 1px;
background: #e4e7ed; background: #e4e7ed;
} }
...@@ -113,11 +146,11 @@ export default { ...@@ -113,11 +146,11 @@ export default {
position: relative; position: relative;
top: 0; top: 0;
left: 0; left: 0;
width: 120; width: 120px;
height: 68px; height: 68px;
margin-right: 15px; margin-right: 15px;
img { img {
width: 120; width: 120px;
height: 68px; height: 68px;
border-radius: 4px; border-radius: 4px;
} }
...@@ -153,7 +186,7 @@ export default { ...@@ -153,7 +186,7 @@ export default {
} }
.chapter { .chapter {
position: absolute; position: absolute;
bottom: -16px; bottom: -15px;
left: 0; left: 0;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
......
...@@ -32,7 +32,7 @@ const customStore = { ...@@ -32,7 +32,7 @@ const customStore = {
}, },
}, },
actions: { actions: {
setSeachParam({ commit }, searchParam) { setSearchParam({ commit }, searchParam) {
commit('SET_SEARCH_PARAM', searchParam); commit('SET_SEARCH_PARAM', searchParam);
}, },
setCartList({ commit }, cartList) { setCartList({ commit }, cartList) {
......
此差异已折叠。
...@@ -10,18 +10,6 @@ ...@@ -10,18 +10,6 @@
<el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input> <el-input v-model="formInline.projectName" size="small" placeholder="请输入项目名称"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="8">
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.duringTime"
size="small"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="项目时间:"> <el-form-item label="项目时间:">
<el-date-picker <el-date-picker
...@@ -43,19 +31,6 @@ ...@@ -43,19 +31,6 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="4">
<el-form-item label="~">
<el-date-picker
v-model="formInline.projectEndtime"
size="small"
type="datetime"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions1"
default-time="23:59:59"
></el-date-picker>
</el-form-item>
</el-col>-->
<el-col :span="4" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="4" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchList">查询</el-button> <el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
...@@ -96,7 +71,7 @@ ...@@ -96,7 +71,7 @@
<span <span
@click="previewTemplate(scope.row, 1)" @click="previewTemplate(scope.row, 1)"
style="color:rgb(2, 130, 132);cursor:pointer;" style="color:rgb(2, 130, 132);cursor:pointer;"
v-if="scope.row.projectType == 3 v-if="(scope.row.projectType == 3 || scope.row.projectType == 4)
&& (scope.row.level == 'L1' || scope.row.level == 'L2') " && (scope.row.level == 'L1' || scope.row.level == 'L2') "
>{{scope.row.projectName}}</span> >{{scope.row.projectName}}</span>
<span v-else>{{scope.row.projectName}}</span> <span v-else>{{scope.row.projectName}}</span>
...@@ -106,13 +81,6 @@ ...@@ -106,13 +81,6 @@
<el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column> <el-table-column prop="projectLeader" label="项目负责人" align="center"></el-table-column>
<el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column> <el-table-column prop="projectTypeValue" label="项目类型" align="center"></el-table-column>
<el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column> <el-table-column prop="createdTime" label="创建时间" width="100" align="center"></el-table-column>
<!-- <el-table-column
prop="projectIntro"
label="项目简介"
align="center"
min-width="100"
show-overflow-tooltip
></el-table-column>-->
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center"> <el-table-column prop="projectStatus" label="状态" align="center">
...@@ -518,9 +486,15 @@ export default { ...@@ -518,9 +486,15 @@ export default {
}, },
previewTemplate(row, isPreview) { previewTemplate(row, isPreview) {
this.$router.push( if (row.projectType == 3) {
`template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}` this.$router.push(
); `template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}`
);
} else if (row.projectType == 4) {
this.$router.push(
`edit-custom?projectId=${row.id}&projectType=3&isPreview=${isPreview}`
);
}
}, },
// handleCreateProject(isPreview) { // handleCreateProject(isPreview) {
...@@ -735,7 +709,6 @@ export default { ...@@ -735,7 +709,6 @@ export default {
this.formInline.pageNo this.formInline.pageNo
); );
} else if (row.projectType === 4) { } else if (row.projectType === 4) {
debugger
this.$router.push( this.$router.push(
"edit-custom?projectType=4&projectId=" + "edit-custom?projectType=4&projectId=" +
projectId + projectId +
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册