mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 06:46:46 +08:00
'学习路径-关卡/任务拖动排序'
This commit is contained in:
@@ -26,16 +26,31 @@
|
||||
<a-popover placement="topLeft" trigger="click">
|
||||
<template #content>
|
||||
<div style="width: 130px">
|
||||
{{ element.remark ? element.remark : "暂无说明" }}
|
||||
<div>
|
||||
{{ element.remark ? element.remark : "暂无说明" }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #title>
|
||||
<span>关卡说明</span>
|
||||
<!-- <span style="float:right">
|
||||
{{ element.status === 0 ? '草稿' : element.status === 1 ? '已发布' : '' }}
|
||||
</span> -->
|
||||
</template>
|
||||
<div class="script">
|
||||
<span style="font-size: 12px; color: #ffffff">说明</span>
|
||||
<div style="display:flex;justify-content: flex-start;margin-right: 8px;">
|
||||
<div class="script">
|
||||
<span style="font-size: 12px; color: #ffffff">说明</span>
|
||||
</div>
|
||||
<!-- <div class="script">
|
||||
<span style="font-size: 12px; color: #ffffff">{{
|
||||
element.status === 0 ? '草稿' : element.status
|
||||
=== 1 ? '已发布' : ''
|
||||
}}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</a-popover>
|
||||
|
||||
<div class="imgIcon" @click="showModal(element)"></div>
|
||||
</div>
|
||||
<div class="boxs_right">
|
||||
@@ -387,7 +402,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="boom" :style="{ minHeight: level.length > 6 ? ((level.length - 6) * 106 + 512) + 'px' : 512 + 'px' }">
|
||||
<div class="boom"
|
||||
:style="{ minHeight: level.length > 6 ? ((level.length - 6) * 106 + 512) + 'px' : 512 + 'px' }">
|
||||
<div class="boomcen">
|
||||
<div class="title">
|
||||
<div class="tit_left">
|
||||
@@ -444,6 +460,7 @@
|
||||
<div style="width: 120px; text-align: center">任务名称</div>
|
||||
<div style="width: 120px; text-align: center">必修/选修</div>
|
||||
<div style="width: 87px; text-align: center">时长</div>
|
||||
<div style="width: 87px; text-align: center">状态</div>
|
||||
<div style="width: 120px; text-align: center; margin-right: 20px">
|
||||
操作
|
||||
</div>
|
||||
@@ -517,6 +534,10 @@
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div style="width: 87px; text-align: center">
|
||||
{{ element.status === 0 ? '草稿' : element.status === 1 ? '已发布' : '' }}
|
||||
</div>
|
||||
<div style="
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
@@ -840,7 +861,7 @@ import AddRef from "../../components/drawers/AddRef.vue";
|
||||
import AddProject from "../../components/drawers/AddProject.vue";
|
||||
import AddFaceteach from "../../components/drawers/AddFaceteach.vue";
|
||||
import * as api from "../../api/indexLevel";
|
||||
import { GetRouterDetail,changeChapterSort , changeTasklistSort} from "../../api/indexTask";
|
||||
import { GetRouterDetail, changeChapterSort, changeTasklistSort } from "../../api/indexTask";
|
||||
import { message } from "ant-design-vue";
|
||||
import { storage } from "../../api/storage";
|
||||
import { deleteStudyTask } from "../../api/indexStudy";
|
||||
@@ -1115,16 +1136,16 @@ export default {
|
||||
});
|
||||
};
|
||||
// 关卡拖动排序
|
||||
const changeSort = ()=>{
|
||||
const sortArr = state.level.map(s=>s.sort).sort((a,b)=> Number(a)-Number(b))
|
||||
state.level.map((s,i)=>{
|
||||
const changeSort = () => {
|
||||
const sortArr = state.level.map(s => s.sort).sort((a, b) => Number(a) - Number(b))
|
||||
state.level.map((s, i) => {
|
||||
s.sort = sortArr[i]
|
||||
return s
|
||||
})
|
||||
|
||||
changeChapterSort(state.level).then((res)=>{
|
||||
changeChapterSort(state.level).then((res) => {
|
||||
console.log(res)
|
||||
if(res.data.code===200){
|
||||
if (res.data.code === 200) {
|
||||
message.success('关卡顺序已修改')
|
||||
}
|
||||
// getDetail()
|
||||
@@ -1132,20 +1153,20 @@ export default {
|
||||
}
|
||||
|
||||
// 任务拖动排序
|
||||
const onEnd = ()=>{
|
||||
const sortArr = state.tableData.map(s=>s.sort).sort((a,b)=> Number(a)-Number(b))
|
||||
state.tableData.map((s,i)=>{
|
||||
const onEnd = () => {
|
||||
const sortArr = state.tableData.map(s => s.sort).sort((a, b) => Number(a) - Number(b))
|
||||
state.tableData.map((s, i) => {
|
||||
s.sort = sortArr[i]
|
||||
return s
|
||||
})
|
||||
changeTasklistSort(state.tableData).then(res=>{
|
||||
})
|
||||
changeTasklistSort(state.tableData).then(res => {
|
||||
console.log(res)
|
||||
if(res.data.code===200){
|
||||
if (res.data.code === 200) {
|
||||
message.success('任务顺序已修改')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//在线抽屉
|
||||
const showDrawerAddOnline = (id, eleId) => {
|
||||
state.addonlinevisible = true;
|
||||
@@ -2368,11 +2389,11 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 56px;
|
||||
width: 46px;
|
||||
height: 24px;
|
||||
background: #ffb64e;
|
||||
border-radius: 6px;
|
||||
margin-right: 12px;
|
||||
margin-right: 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user