mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage
This commit is contained in:
@@ -501,12 +501,13 @@
|
||||
margin-right: 25px;
|
||||
cursor: pointer;
|
||||
"
|
||||
@click="decideType(element.lei, element.courseId)"
|
||||
>
|
||||
编辑
|
||||
</span>
|
||||
<span
|
||||
style="color: #4ea6ff; cursor: pointer"
|
||||
@click="showDelete(element.id)"
|
||||
@click="showDeleteModal(element.id)"
|
||||
>
|
||||
删除
|
||||
</span>
|
||||
@@ -516,22 +517,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
|
||||
<!-- <a-table
|
||||
style="border: 1px solid #f2f6fe"
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="tableData"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
expandRowByClick="true"
|
||||
@expand="expandTable"
|
||||
:customRow="handleClickRow"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
columnWidth: 30,
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
/> -->
|
||||
</div>
|
||||
<!-- 无数据样式 -->
|
||||
<div class="notable" :style="{ display: stm_hs ? 'block' : 'none' }">
|
||||
@@ -780,9 +765,16 @@
|
||||
<add-live
|
||||
v-model:addliveVisible="addlivevisible"
|
||||
v-model:isStudy="isStudy"
|
||||
v-model:isactive="isactive"
|
||||
v-model:routerId="routerId"
|
||||
/>
|
||||
<!-- 添加外链抽屉 -->
|
||||
<add-ref v-model:addrefVisible="addrefvisible" v-model:isStudy="isStudy" />
|
||||
<add-ref
|
||||
v-model:addrefVisible="addrefvisible"
|
||||
v-model:isStudy="isStudy"
|
||||
v-model:isactive="isactive"
|
||||
v-model:routerId="routerId"
|
||||
/>
|
||||
<!-- 是否确认删除任务弹窗 -->
|
||||
<!-- 确认删除阶段弹窗 -->
|
||||
<a-modal
|
||||
@@ -831,9 +823,10 @@ import AddVote from "../../components/drawers/AddVote.vue";
|
||||
import AddLive from "../../components/drawers/AddLive.vue";
|
||||
import AddRef from "../../components/drawers/AddRef.vue";
|
||||
import * as api from "../../api/indexLevel";
|
||||
import { GetRouterDetail, RouterDeleteTask } from "../../api/indexTask";
|
||||
import { GetRouterDetail } from "../../api/indexTask";
|
||||
import { message } from "ant-design-vue";
|
||||
import { storage } from "../../api/storage";
|
||||
import { deleteStudyTask } from "../../api/indexStudy";
|
||||
import draggable from "vuedraggable";
|
||||
export default {
|
||||
name: "LevelAddDetail",
|
||||
@@ -863,6 +856,10 @@ export default {
|
||||
name: "默认关卡",
|
||||
},
|
||||
],
|
||||
isRefEdit: 1, //外链编辑
|
||||
isLiveEdit: 1, //直播编辑
|
||||
EditRefId: null, //要编辑的外链的id
|
||||
EditLiveId: null, //要编辑的直播的id
|
||||
tableData: [
|
||||
{
|
||||
key: 1,
|
||||
@@ -1178,6 +1175,7 @@ export default {
|
||||
cretime: element.duration,
|
||||
checked1: element.flag,
|
||||
routerTaskId: element.routerTaskId,
|
||||
courseId: element.courseId,
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
@@ -1220,135 +1218,128 @@ export default {
|
||||
const showImpStu = () => {
|
||||
state.AddImpStuvisible = true;
|
||||
};
|
||||
const tableDataFunc = () => {
|
||||
const columns = [
|
||||
{
|
||||
title: "类型",
|
||||
dataIndex: "state",
|
||||
// width: "30%",
|
||||
key: "state",
|
||||
width: 60,
|
||||
align: "left",
|
||||
className: "classify",
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: (text) => {
|
||||
// console.log(text.record.checked1);
|
||||
return (
|
||||
<div class="racona">
|
||||
<div
|
||||
class="img"
|
||||
style={{ cursor: "pointer" }}
|
||||
onClick={() => {
|
||||
console.log("点击了");
|
||||
}}
|
||||
></div>
|
||||
<span> {text.record.lei}</span>
|
||||
|
||||
{/**
|
||||
<div class="img"></div>
|
||||
<a-checkbox class="ch" checked={text.record.checkedd}>
|
||||
{text.record.lei}
|
||||
</a-checkbox>
|
||||
*/}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "任务名称",
|
||||
dataIndex: "creater",
|
||||
// width: "30%",
|
||||
key: "creater",
|
||||
width: 200,
|
||||
align: "center",
|
||||
className: "h",
|
||||
},
|
||||
{
|
||||
title: "必修/选修",
|
||||
dataIndex: "pubtime",
|
||||
key: "pubtime",
|
||||
// width: 100,
|
||||
align: "center",
|
||||
className: "h",
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: (text) => {
|
||||
// console.log(text.record.checked1);
|
||||
return (
|
||||
<div class="opat">
|
||||
<div class="opacationt clearfix">
|
||||
<a-switch
|
||||
style="margin-left:-50px;margin-top:3px"
|
||||
checked={text.record.checked1}
|
||||
size="small"
|
||||
active-color="red"
|
||||
onClick={() => {
|
||||
console.log("点击了");
|
||||
text.record.checked1 = !text.record.checked1;
|
||||
}}
|
||||
/>
|
||||
<div class="showt clearfix">
|
||||
<div
|
||||
class="bi"
|
||||
style={
|
||||
text.record.checked1 ? "z-index:999" : "z-index:998"
|
||||
}
|
||||
>
|
||||
必修
|
||||
</div>
|
||||
<div class="xuan">选修</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "时长",
|
||||
dataIndex: "cretime",
|
||||
key: "cretime",
|
||||
// width: 100,
|
||||
align: "center",
|
||||
className: "h",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
className: "h",
|
||||
dataIndex: "opacation",
|
||||
key: "opacation",
|
||||
// width: 100,
|
||||
align: "center",
|
||||
scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
customRender: (e) => {
|
||||
return (
|
||||
<div class="opa">
|
||||
<div class="opacation">
|
||||
<span
|
||||
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
|
||||
onClick={() => {
|
||||
console.log("编辑id", e.record.routerTaskId);
|
||||
console.log("编辑类型", e.record.lei);
|
||||
state.editID = e.record.routerTaskId;
|
||||
//state.addhomeworkvisible = true;
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</span>
|
||||
<span
|
||||
style="color:#4EA6FF;cursor:pointer"
|
||||
onClick={() => {
|
||||
showDeleteModal(e.record.routerTaskId);
|
||||
}}
|
||||
>
|
||||
删除
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
return columns;
|
||||
};
|
||||
// const tableDataFunc = () => {
|
||||
// const columns = [
|
||||
// {
|
||||
// title: "类型",
|
||||
// dataIndex: "state",
|
||||
// // width: "30%",
|
||||
// key: "state",
|
||||
// width: 60,
|
||||
// align: "left",
|
||||
// className: "classify",
|
||||
// scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
// customRender: (text) => {
|
||||
// // console.log(text.record.checked1);
|
||||
// return (
|
||||
// <div class="racona">
|
||||
// <div
|
||||
// class="img"
|
||||
// style={{ cursor: "pointer" }}
|
||||
// onClick={() => {
|
||||
// console.log("点击了");
|
||||
// }}
|
||||
// ></div>
|
||||
// <span> {text.record.lei}</span>
|
||||
// </div>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: "任务名称",
|
||||
// dataIndex: "creater",
|
||||
// // width: "30%",
|
||||
// key: "creater",
|
||||
// width: 200,
|
||||
// align: "center",
|
||||
// className: "h",
|
||||
// },
|
||||
// {
|
||||
// title: "必修/选修",
|
||||
// dataIndex: "pubtime",
|
||||
// key: "pubtime",
|
||||
// // width: 100,
|
||||
// align: "center",
|
||||
// className: "h",
|
||||
// scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
// customRender: (text) => {
|
||||
// // console.log(text.record.checked1);
|
||||
// return (
|
||||
// <div class="opat">
|
||||
// <div class="opacationt clearfix">
|
||||
// <a-switch
|
||||
// style="margin-left:-50px;margin-top:3px"
|
||||
// checked={text.record.checked1}
|
||||
// size="small"
|
||||
// active-color="red"
|
||||
// onClick={() => {
|
||||
// console.log("点击了");
|
||||
// text.record.checked1 = !text.record.checked1;
|
||||
// }}
|
||||
// />
|
||||
// <div class="showt clearfix">
|
||||
// <div
|
||||
// class="bi"
|
||||
// style={
|
||||
// text.record.checked1 ? "z-index:999" : "z-index:998"
|
||||
// }
|
||||
// >
|
||||
// 必修
|
||||
// </div>
|
||||
// <div class="xuan">选修</div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// title: "时长",
|
||||
// dataIndex: "cretime",
|
||||
// key: "cretime",
|
||||
// // width: 100,
|
||||
// align: "center",
|
||||
// className: "h",
|
||||
// },
|
||||
// {
|
||||
// title: "操作",
|
||||
// className: "h",
|
||||
// dataIndex: "opacation",
|
||||
// key: "opacation",
|
||||
// // width: 100,
|
||||
// align: "center",
|
||||
// scopedSlots: { customRender: "action" }, //引入的插槽
|
||||
// customRender: (e) => {
|
||||
// return (
|
||||
// <div class="opa">
|
||||
// <div class="opacation">
|
||||
// <span
|
||||
// style="color:#4EA6FF;margin-right:25px;cursor:pointer"
|
||||
// onClick={() => {
|
||||
// console.log("编辑id", e.record.routerTaskId);
|
||||
// console.log("编辑类型", e.record.lei);
|
||||
// state.editID = e.record.routerTaskId;
|
||||
// //state.addhomeworkvisible = true;
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </span>
|
||||
// <span
|
||||
// style="color:#4EA6FF;cursor:pointer"
|
||||
// onClick={() => {
|
||||
// showDeleteModal(e.record.routerTaskId);
|
||||
// }}
|
||||
// >
|
||||
// 删除
|
||||
// </span>
|
||||
// </div>
|
||||
// </div>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
// ];
|
||||
// return columns;
|
||||
// };
|
||||
const checkType = (index) => {
|
||||
let typeRules = [
|
||||
"",
|
||||
@@ -1383,13 +1374,6 @@ export default {
|
||||
return (
|
||||
<div class="racona">
|
||||
<span> {text.record.name}</span>
|
||||
|
||||
{/**
|
||||
<div class="img"></div>
|
||||
<a-checkbox class="ch" checked={text.record.checkedd}>
|
||||
{text.record.lei}
|
||||
</a-checkbox>
|
||||
*/}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
@@ -1560,9 +1544,9 @@ export default {
|
||||
});
|
||||
const changebgc = (chapterId) => {
|
||||
state.isactive = chapterId;
|
||||
state.selectRow = [] //选择行
|
||||
state.selectAll = 0 //0:未选择,1:全选,2:部分选择
|
||||
dataAssignment(chapterId);
|
||||
state.selectRow = []; //选择行
|
||||
state.selectAll = 0; //0:未选择,1:全选,2:部分选择
|
||||
dataAssignment(chapterId);
|
||||
};
|
||||
const gqxy_hShow = () => {
|
||||
state.gqxy_hs = !state.gqxy_hs;
|
||||
@@ -1576,6 +1560,7 @@ export default {
|
||||
};
|
||||
const showDeleteModal = (id) => {
|
||||
state.deleteID = id;
|
||||
console.log(id);
|
||||
state.deleteModal = true;
|
||||
};
|
||||
const closeConfirm = () => {
|
||||
@@ -1584,14 +1569,17 @@ export default {
|
||||
state.editID = "";
|
||||
};
|
||||
const deleteLevelTask = () => {
|
||||
RouterDeleteTask(state.listChoosedId)
|
||||
.then((res) => {
|
||||
console.log(`删除成功${res}`);
|
||||
message.success("删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(`删除失败${err}`);
|
||||
});
|
||||
deleteStudyTask({ routerTaskIds: state.deleteID }).then((res) =>
|
||||
console.log("删除成功", res)
|
||||
);
|
||||
// RouterDeleteTask(state.listChoosedId)
|
||||
// .then((res) => {
|
||||
// console.log(`删除成功${res}`);
|
||||
// message.success("删除成功");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(`删除失败${err}`);
|
||||
// });
|
||||
};
|
||||
|
||||
const showDrawerAddLive = () => {
|
||||
@@ -1665,44 +1653,65 @@ export default {
|
||||
//批量删除任务
|
||||
const deletecTaskAll = () => {
|
||||
let arr = state.selectRow;
|
||||
console.log("选择的行信息",arr);
|
||||
arr.map( value => {
|
||||
console.log("选择的行信息", arr);
|
||||
arr.map((value) => {
|
||||
let obj = {
|
||||
routerTaskIds: value,
|
||||
}
|
||||
console.log("value",value);
|
||||
};
|
||||
console.log("value", value);
|
||||
api
|
||||
.deleteTask(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
message.destroy();
|
||||
message.success("批量删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
})
|
||||
}
|
||||
.deleteTask(obj)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
message.destroy();
|
||||
message.success("批量删除成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
//移动任务到关卡
|
||||
const moveTask = () => {
|
||||
let obj = {
|
||||
chapterId: state.isactive,
|
||||
routerTaskIdList: state.selectRow,
|
||||
}
|
||||
};
|
||||
api
|
||||
.moveTask(obj)
|
||||
.then((res) => {
|
||||
console.log("移动成功",res);
|
||||
message.destroy();
|
||||
message.success("移动成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("移动失败",err);
|
||||
})
|
||||
}
|
||||
.moveTask(obj)
|
||||
.then((res) => {
|
||||
console.log("移动成功", res);
|
||||
message.destroy();
|
||||
message.success("移动成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("移动失败", err);
|
||||
});
|
||||
};
|
||||
//打开编辑外链的弹窗
|
||||
const showEditRefDrawer = (id) => {
|
||||
state.addrefvisible = true;
|
||||
state.isRefEdit = 2;
|
||||
state.EditRefId = id;
|
||||
};
|
||||
//打开编辑直播的弹窗
|
||||
const showEditLiveDrawer = (id) => {
|
||||
state.addlivevisible = true;
|
||||
state.isLiveEdit = 2;
|
||||
state.EditLiveId = id;
|
||||
};
|
||||
//编辑的按钮
|
||||
const decideType = (type, id) => {
|
||||
console.log(type, id);
|
||||
if (type == "外链") {
|
||||
showEditRefDrawer(id);
|
||||
} else if (type == "直播") {
|
||||
showEditLiveDrawer(id);
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
tableDataFunc,
|
||||
// tableDataFunc,
|
||||
tableDataFunc2,
|
||||
showDrawer,
|
||||
closeDrawer,
|
||||
@@ -1737,6 +1746,10 @@ export default {
|
||||
changeRow,
|
||||
deletecTaskAll,
|
||||
moveTask,
|
||||
showDeleteModal,
|
||||
showEditRefDrawer,
|
||||
showEditLiveDrawer,
|
||||
decideType,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user