添加传参方法

This commit is contained in:
宋文超
2022-11-17 16:26:17 +08:00
parent 429e8339c9
commit 5bd067c4d0
13 changed files with 1724 additions and 1491 deletions

View File

@@ -9,15 +9,14 @@
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}活动</div>
<div class="headerTitle">{{edit?'编辑':'添加'}}活动</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main_left"> <div class="main_left">
<div class="main_item"> <div class="main_item">
<div class="signbox"> <div class="signbox">
@@ -72,7 +71,7 @@
</div> </div>
<div class="main_item"> <div class="main_item">
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
@@ -214,11 +213,11 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="updateActivityInfo">确定</button> <button class="btn2" @click="updateActivityInfo">确定</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
@@ -226,9 +225,9 @@
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, ref } from "vue";
import * as api from "../../api/indexActivity"; import * as api from "../../api/indexActivity";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
import { RouterEditTask } from "@/api/indexTask" import { RouterEditTask } from "@/api/indexTask";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import dayjs from 'dayjs'; import dayjs from "dayjs";
const rowSelection = ref({ const rowSelection = ref({
checkStrictly: false, checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
@@ -258,7 +257,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -274,15 +274,18 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
EditWorkId: { // 要编辑的workId EditWorkId: {
// 要编辑的workId
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -293,7 +296,7 @@ export default {
isactive: { isactive: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
//console.log("学习路径",props.isStudiscuss); //console.log("学习路径",props.isStudiscuss);
@@ -322,35 +325,46 @@ export default {
state.textV1 = ""; state.textV1 = "";
state.textV2 = ""; state.textV2 = "";
state.time = ""; state.time = "";
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const queryActive = () => { const queryActive = () => {
console.log("props.EditActiveId======",props.EditActiveId,props.chooseStageId,props.routerTaskId); console.log(
api.getActivity(props.EditActiveId).then(res => { "props.EditActiveId======",
console.log('获取讨论信息成功',res.data.data.standardSettings) props.EditActiveId,
props.chooseStageId,
props.routerTaskId
);
api
.getActivity(props.EditActiveId)
.then((res) => {
console.log("获取讨论信息成功", res.data.data.standardSettings);
//更新讨论信息 //更新讨论信息
state.inputV1 = res.data.data.activityName; state.inputV1 = res.data.data.activityName;
state.textV1 = res.data.data.activityNotice; state.textV1 = res.data.data.activityNotice;
state.textV2 = res.data.data.activityExplain; state.textV2 = res.data.data.activityExplain;
state.inputV2 = res.data.data.activityDuration; state.inputV2 = res.data.data.activityDuration;
state.inputV3 = res.data.data.activityAddress; state.inputV3 = res.data.data.activityAddress;
state.inputV5 = res.data.data.afterSignIn; state.inputV5 = res.data.data.afterSignIn;
state.inputV6 =res.data.data.signOutTime; state.inputV6 = res.data.data.signOutTime;
state.inputV4 = res.data.data.beforeSignIn; state.inputV4 = res.data.data.beforeSignIn;
state.radioV1 = Number(res.data.data.standardSettings); state.radioV1 = Number(res.data.data.standardSettings);
state.time = [dayjs(res.data.data.activityStartTime, "YYYY-MM-DD"), dayjs(res.data.data.activityEndTime, "YYYY-MM-DD")] state.time = [
}).catch(err=>{ dayjs(res.data.data.activityStartTime, "YYYY-MM-DD"),
console.log('获取讨论信息失败',err) dayjs(res.data.data.activityEndTime, "YYYY-MM-DD"),
];
}) })
} .catch((err) => {
console.log("获取讨论信息失败", err);
});
};
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
if(bool && props.edit){ if (bool && props.edit) {
queryActive(); queryActive();
} }
}; };
const cloradio1 = (value) => { const cloradio1 = (value) => {
if (value != "") { if (value != "") {
@@ -358,107 +372,107 @@ export default {
} }
}; };
const updateTask = (res) => { const updateTask = (res) => {
if(props.isLevel == 1 ){ if (props.isLevel == 1) {
RouterEditTask({ RouterEditTask({
chapterId:props.isactive, chapterId: props.isactive,
courseId: res.data.data.activityId, courseId: res.data.data.activityId,
duration: res.data.data.activityDuration, duration: res.data.data.activityDuration,
name: res.data.data.activityName, name: res.data.data.activityName,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId ||0, routerTaskId: props.routerTaskId || 0,
type: 9, type: 9,
}).then(res => { })
console.log("新增关卡任务成功",res); .then((res) => {
console.log("新增关卡任务成功", res);
}).catch(err => {
console.log("新增关卡任务失败",err);
}) })
}else if(props.isLevel==2){ .catch((err) => {
apiTask.addTask({ console.log("新增关卡任务失败", err);
});
} else if (props.isLevel == 2) {
apiTask
.addTask({
courseId: res.data.data.activityId, courseId: res.data.data.activityId,
duration: res.data.data.activityDuration, duration: res.data.data.activityDuration,
name: res.data.data.activityName, name: res.data.data.activityName,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId ||0, projectTaskId: props.projectTaskId || 0,
stageId:props.chooseStageId, stageId: props.chooseStageId,
type: 9, type: 9,
}).then((res)=> {
console.log("更新任务列表成功",res);
}) })
.catch((err)=> { .then((res) => {
console.log("更新任务列表失败",err); console.log("更新任务列表成功", res);
}) })
}else if(props.isLevel == 3){ .catch((err) => {
console.log("更新任务列表失败", err);
});
} else if (props.isLevel == 3) {
console.log("模板库更新更新任务列表"); console.log("模板库更新更新任务列表");
} }
} };
//创建活动 //创建活动
const updateActivityInfo = () => { const updateActivityInfo = () => {
if(!state.inputV1){ if (!state.inputV1) {
message.destroy(); message.destroy();
return message.warning("请输入活动名称"); return message.warning("请输入活动名称");
} }
if(!state.textV1){ if (!state.textV1) {
message.destroy(); message.destroy();
return message.warning("请输入活动公告"); return message.warning("请输入活动公告");
} }
if(!state.time){ if (!state.time) {
message.destroy(); message.destroy();
return message.warning("请输入活动时间"); return message.warning("请输入活动时间");
} }
if(!state.inputV2){ if (!state.inputV2) {
message.destroy(); message.destroy();
return message.warning("请输入活动时长"); return message.warning("请输入活动时长");
} }
if(!state.inputV3){ if (!state.inputV3) {
message.destroy(); message.destroy();
return message.warning("请输入活动地址"); return message.warning("请输入活动地址");
} }
let obj = { let obj = {
activityAddress: state.inputV3, //活动地址 activityAddress: state.inputV3, //活动地址
activityDuration: state.inputV2, //活动时长 activityDuration: state.inputV2, //活动时长
activityExplain: state.textV2, //活动说明 activityExplain: state.textV2, //活动说明
activityEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), //活动结束时间 activityEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), //活动结束时间
activityId: props.edit?props.EditActiveId:0, //活动ID activityId: props.edit ? props.EditActiveId : 0, //活动ID
activityName: state.inputV1, //活动名称 activityName: state.inputV1, //活动名称
activityNotice: state.textV1, //活动公告 activityNotice: state.textV1, //活动公告
activityStartTime:dayjs(state.time[0]).format("YYYY-MM-DD"),//活动开始时间 activityStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"), //活动开始时间
activityTag: "", //活动逻辑删除标识 activityTag: "", //活动逻辑删除标识
afterSignIn: state.inputV5, //活动开始后多少分钟签到 afterSignIn: state.inputV5, //活动开始后多少分钟签到
beforeSignIn: state.inputV4, //活动开始前多少分钟签到 beforeSignIn: state.inputV4, //活动开始前多少分钟签到
signOutTime: state.inputV6, //签退开始时间 signOutTime: state.inputV6, //签退开始时间
standardSettings: state.radioV1, //标准设置 standardSettings: state.radioV1, //标准设置
}; };
if(props.edit){ if (props.edit) {
//更新编辑活动信息 //更新编辑活动信息
api api
.updateActivity(obj) .updateActivity(obj)
.then((res) => { .then((res) => {
closeDrawer(); closeDrawer();
updateTask(res); updateTask(res);
ctx.emit("changeData", false); ctx.emit("changeData", false);
}) })
.catch((err) => { .catch((err) => {
console.log("更新失败",err); console.log("更新失败", err);
}) });
}else{ } else {
//新建活动信息 //新建活动信息
api api
.createActivity(obj) .createActivity(obj)
.then((res) => { .then((res) => {
message.success("创建成功"); message.success("创建成功");
closeDrawer(); closeDrawer();
updateTask(res); updateTask(res);
ctx.emit("changeData", false); ctx.emit("changeData", false);
}) })
.catch((err) => { .catch((err) => {
console.log("创建失败",err); console.log("创建失败", err);
}) });
} }
}; };
return { return {
@@ -505,7 +519,7 @@ export default {
border-radius: 8px; border-radius: 8px;
} }
.main_left { .main_left {
margin-top:32px; margin-top: 32px;
padding-right: 30px; padding-right: 30px;
flex: 1; flex: 1;
border-right: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8;

View File

@@ -40,28 +40,37 @@
<div class="search"></div> <div class="search"></div>
<div class="btnText">重置</div> <div class="btnText">重置</div>
</div> </div>
</div> </div>
</div> </div>
<div class="main_table"> <div class="main_table">
<a-table class="ant-table-striped" :row-class-name=" <a-table
(_record, index) => (index % 2 === 1 ? 'table-striped' : null) class="ant-table-striped"
" :row-selection="rowSelection" :columns="tableDataFunc()" :data-source="tableData" :row-class-name="
:loading="tableDataTotal === -1 ? true : false" expandRowByClick="true" this.getMilitaryDeployment() (_record, index) => (index % 2 === 1 ? 'table-striped' : null)
@expand="expandTable" :pagination="false" filterMultiple:false "
:row-selection="rowSelection"
:columns="tableDataFunc()"
:data-source="tableData"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
this.getMilitaryDeployment()
@expand="expandTable"
:pagination="false"
filterMultiple:false
/> />
<div class="pa"> <div class="pa">
<a-pagination <a-pagination
showSizeChanger="true" showSizeChanger="true"
showQuickJumper="true" showQuickJumper="true"
hideOnSinglePage="true" hideOnSinglePage="true"
:pageSize="pageSize" :pageSize="pageSize"
:current="currentPage" :current="currentPage"
:total="tableDataTotal" :total="tableDataTotal"
class="pagination" class="pagination"
@change="handelChangePage" @change="handelChangePage"
/> />
</div> </div>
</div> </div>
</div> </div>
<div class="main_btns"> <div class="main_btns">
@@ -90,7 +99,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -106,11 +116,13 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -121,14 +133,15 @@ export default {
isactive: { isactive: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
tableData: [ tableData: [
{ {
key: "1", key: "1",
title: "基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555", title:
"基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555",
name: "李玉冰", name: "李玉冰",
time: "2022-10-31 23:12:00", time: "2022-10-31 23:12:00",
}, },
@@ -136,7 +149,7 @@ export default {
currentPage: 1, currentPage: 1,
tableDataTotal: 0, tableDataTotal: 0,
pageSize: 10, pageSize: 10,
inputV1: '', inputV1: "",
time: undefined, time: undefined,
assessmentId: null, assessmentId: null,
assessmentName: "", assessmentName: "",
@@ -144,6 +157,8 @@ export default {
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addcaseVisible", false); ctx.emit("update:addcaseVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
@@ -179,7 +194,13 @@ export default {
const rowSelection = { const rowSelection = {
onSelect: (selectedRows, selected, selectedRowKeys) => { onSelect: (selectedRows, selected, selectedRowKeys) => {
console.log( console.log(
"selectedRowKeys", selectedRowKeys, "selectedRows", selectedRows, "selected", selected); "selectedRowKeys",
selectedRowKeys,
"selectedRows",
selectedRows,
"selected",
selected
);
console.log(selectedRows.assessmentId); console.log(selectedRows.assessmentId);
state.assessmentId = selectedRows.assessmentId; state.assessmentId = selectedRows.assessmentId;
state.assessmentName = selectedRows.name; state.assessmentName = selectedRows.name;
@@ -228,8 +249,8 @@ export default {
}); });
}; };
const updateTask = () => { const updateTask = () => {
console.log("jinlaile=================", state.assessmentName) console.log("jinlaile=================", state.assessmentName);
if (props.isLevel==1) { if (props.isLevel == 1) {
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: state.assessmentId, courseId: state.assessmentId,
@@ -240,7 +261,7 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log(res, 11111); console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
state.addLoading = false; state.addLoading = false;
@@ -248,7 +269,7 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err, 1111); console.log(err, 1111);
}); });
} else if(props.isLevel==2){ } else if (props.isLevel == 2) {
console.log("=========projectTaskId", props.projectTaskId); console.log("=========projectTaskId", props.projectTaskId);
apiTask apiTask
.addTask({ .addTask({
@@ -267,10 +288,10 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err, 111111); console.log(err, 111111);
}); });
}else if(props.isLevel==3){ } else if (props.isLevel == 3) {
console.log("模板库"); console.log("模板库");
} }
} };
//重置案例信息 //重置案例信息
const resetCase = () => { const resetCase = () => {
state.inputV1 = ""; state.inputV1 = "";
@@ -297,181 +318,181 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addcaseDrawer { .addcaseDrawer {
.drawerMain { .drawerMain {
.header { .header {
height: 73px; height: 73px;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
}
.contentMain {
.main_items {
margin-top: 32px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; margin-bottom: 12px;
flex-shrink: 0; flex-wrap: wrap;
.headerTitle { .mi_ipts {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
}
.contentMain {
.main_items {
margin-top:32px;
display: flex; display: flex;
justify-content: space-between; margin-bottom: 20px;
margin-bottom: 12px; .mii_ipt {
flex-wrap: wrap;
.mi_ipts {
display: flex; display: flex;
margin-bottom: 20px; align-items: center;
.mii_ipt { margin-right: 24px;
display: flex; .ipt_name {
align-items: center; white-space: nowrap;
margin-right: 24px;
.ipt_name {
white-space: nowrap;
}
}
}
.mi_btns {
display: flex;
margin-left: 38px;
margin-bottom: 20px;
cursor: pointer;
.btn {
padding: 0px 26px 0px 26px;
height: 38px;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-left: 14px;
flex-shrink: 0;
.search {
background-size: 100%;
}
.btnText {
font-size: 14px;
font-weight: 400;
line-height: 36px;
margin-left: 5px;
}
}
.btn1 {
background: rgb(64, 158, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/search0.png");
}
.btnText {
color: rgb(255, 255, 255);
}
}
.btn2 {
background: rgb(255, 255, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/reset1.png");
}
.btnText {
color: rgb(64, 158, 255);
}
}
.btn1:hover {
background: rgb(255, 255, 255);
.search {
background-image: url("@/assets/images/courseManage/search1.png");
}
.btnText {
color: #388be1;
}
}
.btn2:hover {
background: rgba(64, 158, 255, 1);
.search {
background-image: url("@/assets/images/courseManage/reset0.png");
}
.btnText {
color: #ffffff;
}
} }
} }
} }
.main_table { .mi_btns {
position: relative; display: flex;
padding-bottom: 80px; margin-left: 38px;
.classify { margin-bottom: 20px;
margin-left: 10px !important; cursor: pointer;
padding-left: 9px !important; .btn {
padding: 0px 26px 0px 26px;
height: 38px;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-left: 14px;
flex-shrink: 0;
.search {
background-size: 100%;
} }
.ant-checkbox-wrapper { .btnText {
align-items: center; font-size: 14px;
margin-top: -2px; font-weight: 400;
} line-height: 36px;
.ant-table-selection-column { margin-left: 5px;
padding: 0px !important;
padding-left:15px !important;
}
.ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
// height: 20px;
// background-color: red;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
} }
} }
.btn1 {
background: rgb(64, 158, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/search0.png");
}
.btnText {
color: rgb(255, 255, 255);
}
}
.btn2 {
background: rgb(255, 255, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/reset1.png");
}
.btnText {
color: rgb(64, 158, 255);
}
}
.btn1:hover {
background: rgb(255, 255, 255);
.search {
background-image: url("@/assets/images/courseManage/search1.png");
}
.btnText {
color: #388be1;
}
}
.btn2:hover {
background: rgba(64, 158, 255, 1);
.search {
background-image: url("@/assets/images/courseManage/reset0.png");
}
.btnText {
color: #ffffff;
}
}
}
} }
.main_table {
.main_btns { position: relative;
height: 72px; padding-bottom: 80px;
width: 100%; .classify {
bottom: 0; margin-left: 10px !important;
left: 0; padding-left: 9px !important;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
} }
.btn2 { .ant-checkbox-wrapper {
cursor: pointer; align-items: center;
width: 100px; margin-top: -2px;
height: 40px; }
background: #4ea6ff; .ant-table-selection-column {
border-radius: 8px; padding: 0px !important;
border: 0; padding-left: 15px !important;
margin-left: 15px; }
color: #fff; .ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
// height: 20px;
// background-color: red;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
} }
} }
} }
.main_btns {
height: 72px;
width: 100%;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
}
}
} }
}
</style> </style>

View File

@@ -174,6 +174,7 @@ export default {
state.inputV1 = ""; state.inputV1 = "";
state.textV1 = ""; state.textV1 = "";
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
// ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId); localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive); localStorage.setItem("chapterId", props.isactive);
}; };

View File

@@ -9,7 +9,7 @@
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">{{edit?'编辑':'添加'}}测评</div> <div class="headerTitle">{{ edit ? "编辑" : "添加" }}测评</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@@ -48,16 +48,18 @@
<span style="margin-right: 3px">选择测评</span> <span style="margin-right: 3px">选择测评</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button class="checkEval" @click="showEvalDrawer">选择测评</button> <button class="checkEval" @click="showEvalDrawer">
选择测评
</button>
</div> </div>
<div> <div>
<div><EvList <div>
v-model:EvalListVisible="EvalListVisible" <EvList
v-model:evaluationTypeId="evaluationTypeId" v-model:EvalListVisible="EvalListVisible"
v-model:evaluationTypeName="evaluationTypeName" v-model:evaluationTypeId="evaluationTypeId"
/> v-model:evaluationTypeName="evaluationTypeName"
</div> />
</div>
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -78,8 +80,12 @@
<span style="margin-right: 3px">测评说明</span> <span style="margin-right: 3px">测评说明</span>
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="description" placeholder="请输入测评说明" style="width:424px; height: 120px;" allowClear/> <a-textarea
v-model:value="description"
placeholder="请输入测评说明"
style="width: 424px; height: 120px"
allowClear
/>
</div> </div>
</div> </div>
</div> </div>
@@ -102,11 +108,11 @@ import * as api from "../../api/indexEval";
import * as apitaskadd from "../../api/indexTaskadd"; import * as apitaskadd from "../../api/indexTaskadd";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { RouterEditTask } from "@/api/indexTask"; import { RouterEditTask } from "@/api/indexTask";
import dayjs from 'dayjs'; import dayjs from "dayjs";
// const router = useRouter(); // const router = useRouter();
export default { export default {
name: "AddEval", name: "AddEval",
components: { components: {
EvList, EvList,
}, },
props: { props: {
@@ -118,7 +124,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -134,11 +141,13 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -157,10 +166,10 @@ export default {
inputV2: "", inputV2: "",
time: undefined, time: undefined,
EvalId: null, EvalId: null,
evaluationTypeId:null, evaluationTypeId: null,
evaluationTypeName:"", evaluationTypeName: "",
description:"", description: "",
EvalListVisible:false, EvalListVisible: false,
// addLoading:false, // addLoading:false,
}); });
@@ -169,67 +178,72 @@ export default {
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
state.inputV1 = ""; state.inputV1 = "";
state.inputV2 = ""; state.inputV2 = "";
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
if(props.edit && bool){ if (props.edit && bool) {
queryEval(); queryEval();
} }
}; };
const showEvalDrawer = () =>{ const showEvalDrawer = () => {
state.EvalListVisible = true; state.EvalListVisible = true;
console.log("进来了吗"); console.log("进来了吗");
}; };
const queryEval = () =>{ const queryEval = () => {
api api
.queryEvaluationDetailById({evaluationId:props.evaluationId}) .queryEvaluationDetailById({ evaluationId: props.evaluationId })
.then((res) => { .then((res) => {
console.log("调用项目添加接口后", res.data.data); console.log("调用项目添加接口后", res.data.data);
state.inputV1 = res.data.data.evaluationName; state.inputV1 = res.data.data.evaluationName;
state.time = [dayjs(res.data.data.evaluationStartTime, "YYYY-MM-DD"), dayjs(res.data.data.evaluationEndTime, "YYYY-MM-DD")]; state.time = [
state.evaluationTypeId = res.data.data.evaluationTypeId; dayjs(res.data.data.evaluationStartTime, "YYYY-MM-DD"),
state.evaluationTypeName =res.data.data.evaluationTypeName; dayjs(res.data.data.evaluationEndTime, "YYYY-MM-DD"),
//state.description = ];
state.evaluationTypeId = res.data.data.evaluationTypeId;
state.evaluationTypeName = res.data.data.evaluationTypeName;
//state.description =
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
} };
const updateTask = (res)=>{ const updateTask = (res) => {
if(props.isLevel ==1){ if (props.isLevel == 1) {
apitaskadd apitaskadd
.addTask({ .addTask({
courseId: res.data.data.evaluationId, courseId: res.data.data.evaluationId,
name: res.data.data.evaluationName, name: res.data.data.evaluationName,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId, stageId: props.chooseStageId,
type: 10, type: 10,
}) })
.then((res) => { .then((res) => {
console.log("调用项目添加接口后", res.data); console.log("调用项目添加接口后", res.data);
})
}) .catch((err) => {
.catch((err) => { console.log(err);
console.log(err); });
}); } else if (props.isLevel == 2) {
}else if(props.isLevel ==2){
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: res.data.data.evaluationId, courseId: res.data.data.evaluationId,
name: res.data.data.evaluationName, name: res.data.data.evaluationName,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId || 0, routerTaskId: props.routerTaskId || 0,
type: 10, type: 10,
}).then((res) => { })
console.log("调用项目添加接口后", res.data); .then((res) => {
console.log("调用项目添加接口后", res.data);
}).catch((err) => { })
console.log(err); .catch((err) => {
}); console.log(err);
}else if(props.isLevel ==3){ });
console.log("模板库任务") } else if (props.isLevel == 3) {
console.log("模板库任务");
} }
} };
//创建或编辑测评信息 //创建或编辑测评信息
const createEvalText = () => { const createEvalText = () => {
if (!state.inputV1) { if (!state.inputV1) {
@@ -248,36 +262,36 @@ export default {
let obj = { let obj = {
evaluationName: state.inputV1, evaluationName: state.inputV1,
evaluationEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), evaluationEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"),
evaluationId: props.edit?props.evaluationId:0, evaluationId: props.edit ? props.evaluationId : 0,
evaluationStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"), evaluationStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"),
evaluationTypeId:state.evaluationTypeId, evaluationTypeId: state.evaluationTypeId,
evaluationTypeName:state.evaluationTypeName, evaluationTypeName: state.evaluationTypeName,
//state.description //state.description
}; };
if(props.edit){ if (props.edit) {
api api
.createEvaluation(obj) .createEvaluation(obj)
.then((res) => { .then((res) => {
updateTask(res); updateTask(res);
message.success("创建成功"); message.success("创建成功");
closeDrawer(); closeDrawer();
ctx.emit("changeData", false); ctx.emit("changeData", false);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}else{ } else {
api api
.updateEvaluation(obj) .updateEvaluation(obj)
.then((res) => { .then((res) => {
updateTask(res); updateTask(res);
message.success("创建成功"); message.success("创建成功");
closeDrawer(); closeDrawer();
ctx.emit("changeData", false); ctx.emit("changeData", false);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
} }
}; };
@@ -318,7 +332,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.main_left { .main_left {
margin-top:32px; margin-top: 32px;
padding-right: 30px; padding-right: 30px;
flex: 1; flex: 1;
border-right: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8;

View File

@@ -384,6 +384,8 @@ export default {
ctx.emit("update:addfaceteachVisible", false); ctx.emit("update:addfaceteachVisible", false);
state.radioV1 = ""; state.radioV1 = "";
state.radioV2 = ""; state.radioV2 = "";
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);

View File

@@ -279,6 +279,9 @@ export default {
formState.choosedTime = ""; formState.choosedTime = "";
ctx.emit("update:addhomeworkVisible", false); ctx.emit("update:addhomeworkVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
if (props.addhomeworkVisible && props.edit) { if (props.addhomeworkVisible && props.edit) {
@@ -288,38 +291,35 @@ export default {
console.log("state", bool); console.log("state", bool);
}; };
// 新增任务 // 新增任务
const updteHomeWork = () => { const updteHomeWork = () => {
let obj = { let obj = {
submitEndTime: dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"), submitEndTime: dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
submitStartTime: dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"), submitStartTime: dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
workEnclosureAddress: "", workEnclosureAddress: "",
workId: props.edit?props.EditWorkId:0, workId: props.edit ? props.EditWorkId : 0,
workName: formState.workName, workName: formState.workName,
workRequirement: formState.workRequirement, workRequirement: formState.workRequirement,
}; };
if(props.edit){ if (props.edit) {
updateWorkTaskUsing(obj) updateWorkTaskUsing(obj)
.then((res) => { .then((res) => {
updateTask(res); updateTask(res);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
message.error(`添加失败${err}`); message.error(`添加失败${err}`);
}); });
}else{ } else {
createWorkTask(obj) createWorkTask(obj)
.then((res) => { .then((res) => {
updateTask(res); updateTask(res);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
message.error(`添加失败${err}`); message.error(`添加失败${err}`);
}); });
} }
}; };
// 查询任务 // 查询任务
@@ -345,50 +345,48 @@ export default {
}; };
// 新增编辑或新增项目任务 // 新增编辑或新增项目任务
const updateTask = (res) => { const updateTask = (res) => {
if(props.isLevel==1 ){ if (props.isLevel == 1) {
let editObj1 = { let editObj1 = {
chapterId: props.isactive, chapterId: props.isactive,
courseId: res.data.data.workId, courseId: res.data.data.workId,
name: res.data.data.workName, name: res.data.data.workName,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId || 0, routerTaskId: props.routerTaskId || 0,
type: 4, type: 4,
}; };
RouterEditTask(editObj1) RouterEditTask(editObj1)
.then(() => { .then(() => {
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`); message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
state.addLoading = false; state.addLoading = false;
}) })
.catch(() => { .catch(() => {
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`); message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
}); });
}else if(props.isLevel==2){ } else if (props.isLevel == 2) {
let editObj = { let editObj = {
courseId: res.data.data.workId, courseId: res.data.data.workId,
name:res.data.data.workName, name: res.data.data.workName,
projectId: props.edit?props.projectId:0, projectId: props.edit ? props.projectId : 0,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId, stageId: props.chooseStageId,
type: 4, type: 4,
}; };
ProjectEditTask(editObj) ProjectEditTask(editObj)
.then(() => { .then(() => {
message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`); message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
state.addLoading = false; state.addLoading = false;
}) })
.catch(() => { .catch(() => {
message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`); message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`);
}); });
}else if(props.isLevel==3){ } else if (props.isLevel == 3) {
console.log("模板库更新更新任务列表"); console.log("模板库更新更新任务列表");
} }
}; };
return { return {
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
@@ -440,7 +438,7 @@ export default {
padding-right: 30px; padding-right: 30px;
flex: 1; flex: 1;
border-right: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8;
margin-top:32px; margin-top: 32px;
.main_item { .main_item {
display: flex; display: flex;

View File

@@ -18,51 +18,61 @@
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main"> <div class="main">
<div class="main_left"> <div class="main_left">
<div class="main_notice"> <div class="main_notice">
<div class="mntc_left"> <div class="mntc_left">
<div class="notice_icon"></div> <div class="notice_icon"></div>
<div v-if="assessment==null"> <div v-if="assessment == null">
<span class="title">已选择 <span class ="data">0</span> </span> <span class="title"
</div> >已选择 <span class="data">0</span> </span
<div v-else> >
<span class="title">已选择 <span class ="data">1</span> ;</span> </div>
<span class="title">名称 <span class ="data">{{assessment.name}}</span> </span> <div v-else>
<span class="title">题数 <span class ="data">{{assessment.num}}</span> </span> <span class="title"
<span class="title">创建人 <span class ="data">{{assessment.creator}}</span> </span> >已选择 <span class="data">1</span> ;</span
<span class="title">创建时间 <span class ="data">{{assessment.time}}</span> </span> >
</div> <span class="title"
</div> >名称 <span class="data">{{ assessment.name }}</span>
</span>
</div> <span class="title"
<div class="main_item"> >题数 <span class="data">{{ assessment.num }}</span>
<div class="fi_input"> </span>
<span class="title"
<div class="btns" @click="checkAssDrawer"> >创建人 <span class="data">{{ assessment.creator }}</span>
<div class="search"></div> </span>
<div class="btnText">选择评估</div> <span class="title"
<div class="main_item2"> >创建时间 <span class="data">{{ assessment.time }}</span>
<AssessmentList </span>
v-model:assessmentVisible="assessmentVisible" </div>
@checkedAss="getCheckedAss"/> </div>
</div> </div>
<div class="main_item">
<div class="fi_input">
<div class="btns" @click="checkAssDrawer">
<div class="search"></div>
<div class="btnText">选择评估</div>
<div class="main_item2">
<AssessmentList
v-model:assessmentVisible="assessmentVisible"
@checkedAss="getCheckedAss"
/>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="updateTask">确定</button>
</div>
</div> </div>
</div> </div>
<div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2" @click="updateTask">确定</button>
</div>
</div> </div>
</div>
</div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs} from "vue"; import { reactive, toRefs } from "vue";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import AssessmentList from "./ AssessmentList.vue"; import AssessmentList from "./ AssessmentList.vue";
@@ -81,7 +91,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -97,12 +108,14 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -114,7 +127,6 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -123,79 +135,79 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
tableDataTotal: 0, tableDataTotal: 0,
tableData: [ tableData: [],
], assessmentId: null,
assessmentId:null, assessmentName: "",
assessmentName:"", assessment: null,
assessment:null, assessmentVisible: false,
assessmentVisible:false,
}); });
const getCheckedAss = (ass) =>{ const getCheckedAss = (ass) => {
state.assessment = ass state.assessment = ass;
console.log("checed===",state.assessment); console.log("checed===", state.assessment);
} };
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addinvistVisible", false); ctx.emit("update:addinvistVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
state.inputV1 = ""; state.inputV1 = "";
// ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const checkAssDrawer =() =>{ const checkAssDrawer = () => {
state.assessmentVisible = true; state.assessmentVisible = true;
} };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
state.assessmentId=null; state.assessmentId = null;
state.assessmentName=""; state.assessmentName = "";
state.assessment=null; state.assessment = null;
}; };
const updateTask =()=>{ const updateTask = () => {
if(state.assessment==null){ if (state.assessment == null) {
return message.warning("请选择评估"); return message.warning("请选择评估");
} }
if(props.isLevel ==1){ if (props.isLevel == 1) {
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: state.assessment.assessmentId, courseId: state.assessment.assessmentId,
name:state.assessment.name, name: state.assessment.name,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId || 0, routerTaskId: props.routerTaskId || 0,
type: 11, type: 11,
}) })
.then((res) => { .then((res) => {
console.log(res, 11111); console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
state.addLoading = false; state.addLoading = false;
}) })
.catch((err) => { .catch((err) => {
console.log(err, 1111); console.log(err, 1111);
}); });
}else if(props.isLevel ==2){ } else if (props.isLevel == 2) {
apiTask apiTask
.addTask({ .addTask({
courseId: state.assessment.assessmentId, courseId: state.assessment.assessmentId,
name:state.assessment.name, name: state.assessment.name,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId, stageId: props.chooseStageId,
type: 11, type: 11,
}) })
.then((res) => { .then((res) => {
console.log("调用项目添加接口后111", res.data, 11111); console.log("调用项目添加接口后111", res.data, 11111);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
console.log(err, 111111); console.log(err, 111111);
}); });
}else if(props.isLevel == 3){ } else if (props.isLevel == 3) {
console.log("模板库更新更新任务列表"); console.log("模板库更新更新任务列表");
} }
} };
return { return {
...toRefs(state), ...toRefs(state),
@@ -232,107 +244,104 @@ export default {
.contentMain { .contentMain {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.main{ .main {
width:100%; width: 100%;
.main_left { .main_left {
padding-right: 30px; padding-right: 30px;
margin-top:32px; margin-top: 32px;
.main_item { .main_item {
display: flex;
align-items: center;
margin-bottom: 64px;
.fi_input {
margin-right: 20px;
}
.btns {
margin-right: 20px;
padding: 0px 26px 0px 26px;
height: 38px;
background: #409eff;
border-radius: 8px;
//border: 1px solid rgba(64, 158, 255, 1);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; margin-bottom: 64px;
margin-right: 14px; .fi_input {
flex-shrink: 0; margin-right: 20px;
cursor: pointer;
.search {
width: 15px;
height: 17px;
background-image: url("../../assets/images/courseManage/search0.png");
background-size: 100% 100%;
} }
.btnText { .btns {
font-size: 14px; margin-right: 20px;
font-weight: 400; padding: 0px 26px 0px 26px;
color: #ffffff; height: 38px;
line-height: 36px; background: #409eff;
margin-left: 5px; border-radius: 8px;
//border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
flex-shrink: 0;
cursor: pointer;
.search {
width: 15px;
height: 17px;
background-image: url("../../assets/images/courseManage/search0.png");
background-size: 100% 100%;
}
.btnText {
font-size: 14px;
font-weight: 400;
color: #ffffff;
line-height: 36px;
margin-left: 5px;
}
}
.btnsn {
padding: 0px 26px 0px 26px;
height: 38px;
background: #ffffff;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-right: 14px;
flex-shrink: 0;
cursor: pointer;
.search {
width: 16px;
height: 18px;
background-image: url("../../assets/images/courseManage/reset1.png");
background-size: 100% 100%;
}
.btnText {
font-size: 14px;
font-weight: 400;
color: #409eff;
line-height: 36px;
margin-left: 5px;
}
} }
} }
.btnsn { .main_notice {
padding: 0px 26px 0px 26px;
height: 38px;
background: #ffffff;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: center; margin-bottom: 32px;
margin-right: 14px; height: 40px;
flex-shrink: 0; background-color: #e9f6fe;
cursor: pointer; .mntc_left {
.search { display: flex;
width: 16px; align-items: center;
height: 18px; .title {
background-image: url("../../assets/images/courseManage/reset1.png"); color: rgba(0, 0, 0, 0.65);
background-size: 100% 100%; margin-right: 17px;
}
.data {
color: #388be1;
}
.notice_icon {
width: 14px;
height: 14px;
margin-right: 9px;
margin-left: 9px;
background-image: url(@/assets/images/coursewareManage/gan.png);
background-size: 100% 100%;
}
} }
.btnText { .mntc_right {
font-size: 14px; cursor: pointer;
font-weight: 400;
color: #409eff;
line-height: 36px;
margin-left: 5px;
} }
} }
} }
.main_notice {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32px;
height: 40px;
background-color: #e9f6fe;
.mntc_left {
display: flex;
align-items: center;
.title{
color: rgba(0, 0, 0, 0.65);
margin-right: 17px
}
.data{
color: #388be1
}
.notice_icon {
width: 14px;
height: 14px;
margin-right: 9px;
margin-left: 9px;
background-image: url(@/assets/images/coursewareManage/gan.png);
background-size: 100% 100%;
}
}
.mntc_right {
cursor: pointer;
}
}
} }
}
} }
.main_btns { .main_btns {
height: 72px; height: 72px;

View File

@@ -445,6 +445,9 @@ export default {
state.textV1 = ""; state.textV1 = "";
state.switchC1 = ""; state.switchC1 = "";
state.imageUrl = ""; state.imageUrl = "";
ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("props.edit===================", props.edit, bool); console.log("props.edit===================", props.edit, bool);

View File

@@ -59,10 +59,10 @@
<div class="mntc_left"> <div class="mntc_left">
<div class="notice_icon"></div> <div class="notice_icon"></div>
<span style="color: rgba(0, 0, 0, 0.65); margin-right: 17px" <span style="color: rgba(0, 0, 0, 0.65); margin-right: 17px"
>已选择 <span style="color: #388be1">{{RowsNum}}</span> </span >已选择 <span style="color: #388be1">{{ RowsNum }}</span> </span
> >
<span style="color: rgba(0, 0, 0, 0.65)" <span style="color: rgba(0, 0, 0, 0.65)"
>列表选项总计<span>{{tableDataTotal}}</span> </span >列表选项总计<span>{{ tableDataTotal }}</span> </span
> >
</div> </div>
<div class="mntc_right"> <div class="mntc_right">
@@ -79,24 +79,24 @@
:columns="tableDataFunc()" :columns="tableDataFunc()"
:data-source="tableData" :data-source="tableData"
:loading="tableDataTotal === -1 ? true : false" :loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true" expandRowByClick="true"
this.getMilitaryDeployment() this.getMilitaryDeployment()
@expand="expandTable" @expand="expandTable"
:pagination="false" :pagination="false"
filterMultiple:false filterMultiple:false
/> />
<div class="pa"> <div class="pa">
<a-pagination <a-pagination
showSizeChanger="true" showSizeChanger="true"
showQuickJumper="true" showQuickJumper="true"
hideOnSinglePage="true" hideOnSinglePage="true"
:pageSize="pageSize" :pageSize="pageSize"
:current="currentPage" :current="currentPage"
:total="tableDataTotal" :total="tableDataTotal"
class="pagination" class="pagination"
@change="handelChangePage" @change="handelChangePage"
/> />
</div> </div>
</div> </div>
</div> </div>
<div class="main_btns"> <div class="main_btns">
@@ -124,7 +124,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -140,11 +141,13 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -155,20 +158,20 @@ export default {
isactive: { isactive: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
inputV1:"", inputV1: "",
options1 : [ options1: [
{ {
value: "value1", value: "value1",
label: "未完成", label: "未完成",
}, },
], ],
time: undefined, time: undefined,
assessmentId:null, assessmentId: null,
assessmentName:"", assessmentName: "",
RowsNum: 0, RowsNum: 0,
tableData: [], tableData: [],
currentPage: 1, currentPage: 1,
@@ -178,6 +181,9 @@ export default {
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addonlineVisible", false); ctx.emit("update:addonlineVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
// ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
@@ -199,7 +205,8 @@ export default {
width: "100px", width: "100px",
align: "left", align: "left",
className: "classify", className: "classify",
}, { },
{
title: "内容分类", title: "内容分类",
dataIndex: "content", dataIndex: "content",
key: "content", key: "content",
@@ -235,19 +242,25 @@ export default {
onSelectAll: (selected) => { onSelectAll: (selected) => {
console.log(selected); console.log(selected);
if (selected == true) { if (selected == true) {
state.RowsNum = state.tableDataTotal state.RowsNum = state.tableDataTotal;
} else { } else {
state.RowsNum = 0 state.RowsNum = 0;
} }
}, },
onSelect: (selectedRows, selected, selectedRowKeys) => { onSelect: (selectedRows, selected, selectedRowKeys) => {
console.log( console.log(
"selectedRowKeys", selectedRowKeys, "selectedRows", selectedRows, "selected", selected); "selectedRowKeys",
selectedRowKeys,
"selectedRows",
selectedRows,
"selected",
selected
);
console.log(selectedRows.assessmentId); console.log(selectedRows.assessmentId);
if (selected == true) { if (selected == true) {
state.RowsNum++ state.RowsNum++;
} else { } else {
state.RowsNum-- state.RowsNum--;
} }
state.assessmentId = selectedRows.assessmentId; state.assessmentId = selectedRows.assessmentId;
state.assessmentName = selectedRows.name; state.assessmentName = selectedRows.name;
@@ -295,49 +308,49 @@ export default {
// state.createLoading = false; // state.createLoading = false;
}); });
}; };
const updateTask =()=>{ const updateTask = () => {
if(props.isLevel ==1){ if (props.isLevel == 1) {
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: state.assessmentId, courseId: state.assessmentId,
name: state.assessmentName, name: state.assessmentName,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId || 0, routerTaskId: props.routerTaskId || 0,
type: 1, type: 1,
}) })
.then((res) => { .then((res) => {
console.log(res, 11111); console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
state.addLoading = false; state.addLoading = false;
}) })
.catch((err) => { .catch((err) => {
console.log(err, 1111); console.log(err, 1111);
}); });
}else if(props.isLevel ==2){ } else if (props.isLevel == 2) {
console.log("=========projectTaskId",props.projectTaskId); console.log("=========projectTaskId", props.projectTaskId);
apiTask apiTask
.addTask({ .addTask({
courseId: state.assessmentId, courseId: state.assessmentId,
name: state.assessmentName, name: state.assessmentName,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId, stageId: props.chooseStageId,
type: 1, type: 1,
}) })
.then((res) => { .then((res) => {
console.log("调用项目添加接口后111", res.data, 11111); console.log("调用项目添加接口后111", res.data, 11111);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
console.log(err, 111111); console.log(err, 111111);
}); });
}else if(props.isLevel ==3){ } else if (props.isLevel == 3) {
console.log(""); console.log("");
} }
} };
//重置在线信息 //重置在线信息
const resetOnline = () => { const resetOnline = () => {
state.inputV1 = ""; state.inputV1 = "";
@@ -367,201 +380,201 @@ export default {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addonlineDrawer { .addonlineDrawer {
.drawerMain { .drawerMain {
.header { .header {
height: 73px; height: 73px;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
flex-shrink: 0;
.headerTitle {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-left: 24px;
}
}
.contentMain {
padding-right: 12px;
.main_items {
display: flex;
justify-content: space-between;
margin-top: 32px;
margin-bottom: 12px;
flex-wrap: wrap;
.mi_ipts {
display: flex;
margin-bottom: 20px;
.mii_ipt {
display: flex;
align-items: center;
margin-right: 24px;
.ipt_name {
white-space: nowrap;
}
}
}
.mi_btns {
display: flex;
margin-left: 38px;
margin-bottom: 20px;
cursor: pointer;
.btn {
padding: 0px 26px 0px 26px;
height: 38px;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-left: 14px;
flex-shrink: 0;
.search {
background-size: 100%;
}
.btnText {
font-size: 14px;
font-weight: 400;
line-height: 36px;
margin-left: 5px;
}
}
.btn1 {
background: rgb(64, 158, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/search0.png");
}
.btnText {
color: rgb(255, 255, 255);
}
}
.btn2 {
background: rgb(255, 255, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/reset1.png");
}
.btnText {
color: rgb(64, 158, 255);
}
}
.btn1:hover {
background: rgb(255, 255, 255);
.search {
background-image: url("@/assets/images/courseManage/search1.png");
}
.btnText {
color: #388be1;
}
}
.btn2:hover {
background: rgba(64, 158, 255, 1);
.search {
background-image: url("@/assets/images/courseManage/reset0.png");
}
.btnText {
color: #ffffff;
}
}
}
}
.main_notice {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-shrink: 0; margin-bottom: 32px;
.headerTitle { height: 40px;
font-size: 18px; background-color: #e9f6fe;
font-weight: 600; .mntc_left {
color: #333333;
line-height: 25px;
margin-left: 24px;
}
}
.contentMain {
padding-right: 12px;
.main_items {
display: flex; display: flex;
justify-content: space-between;
margin-top: 32px;
margin-bottom: 12px;
flex-wrap: wrap;
.mi_ipts {
display: flex;
margin-bottom: 20px;
.mii_ipt {
display: flex;
align-items: center;
margin-right: 24px;
.ipt_name {
white-space: nowrap;
}
}
}
.mi_btns {
display: flex;
margin-left: 38px;
margin-bottom: 20px;
cursor: pointer;
.btn {
padding: 0px 26px 0px 26px;
height: 38px;
border-radius: 8px;
border: 1px solid rgba(64, 158, 255, 1);
display: flex;
align-items: center;
justify-content: center;
margin-left: 14px;
flex-shrink: 0;
.search {
background-size: 100%;
}
.btnText {
font-size: 14px;
font-weight: 400;
line-height: 36px;
margin-left: 5px;
}
}
.btn1 {
background: rgb(64, 158, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/search0.png");
}
.btnText {
color: rgb(255, 255, 255);
}
}
.btn2 {
background: rgb(255, 255, 255);
.search {
width: 15px;
height: 17px;
background-image: url("@/assets/images/coursewareManage/reset1.png");
}
.btnText {
color: rgb(64, 158, 255);
}
}
.btn1:hover {
background: rgb(255, 255, 255);
.search {
background-image: url("@/assets/images/courseManage/search1.png");
}
.btnText {
color: #388be1;
}
}
.btn2:hover {
background: rgba(64, 158, 255, 1);
.search {
background-image: url("@/assets/images/courseManage/reset0.png");
}
.btnText {
color: #ffffff;
}
}
}
}
.main_notice {
display: flex;
justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 32px; .notice_icon {
height: 40px; width: 14px;
background-color: #e9f6fe; height: 14px;
.mntc_left { margin-right: 9px;
display: flex; margin-left: 9px;
align-items: center; background-image: url(@/assets/images/coursewareManage/gan.png);
.notice_icon { background-size: 100% 100%;
width: 14px;
height: 14px;
margin-right: 9px;
margin-left: 9px;
background-image: url(@/assets/images/coursewareManage/gan.png);
background-size: 100% 100%;
}
}
.mntc_right {
cursor: pointer;
} }
} }
.main_table { .mntc_right {
position: relative; cursor: pointer;
padding-bottom: 80px; }
.classify {
margin-left: 10px !important;
padding-left: 9px !important;
}
.ant-checkbox-wrapper {
align-items: center;
margin-top: -2px;
}
.ant-table-selection-column {
padding: 0px !important;
padding-left: 60px !important;
}
.ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
// height: 20px;
// background-color: red;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
}
}
} }
.main_table {
.main_btns { position: relative;
height: 72px; padding-bottom: 80px;
width: 100%; .classify {
bottom: 0; margin-left: 10px !important;
left: 0; padding-left: 9px !important;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
} }
.btn2 { .ant-checkbox-wrapper {
cursor: pointer; align-items: center;
width: 100px; margin-top: -2px;
height: 40px; }
background: #4ea6ff; .ant-table-selection-column {
border-radius: 8px; padding: 0px !important;
border: 0; padding-left: 60px !important;
margin-left: 15px; }
color: #fff; .ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
// height: 20px;
// background-color: red;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
} }
} }
} }
.main_btns {
height: 72px;
width: 100%;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
.btn1 {
width: 100px;
height: 40px;
border: 1px solid #4ea6ff;
border-radius: 8px;
color: #4ea6ff;
background-color: #fff;
cursor: pointer;
}
.btn2 {
cursor: pointer;
width: 100px;
height: 40px;
background: #4ea6ff;
border-radius: 8px;
border: 0;
margin-left: 15px;
color: #fff;
}
}
}
} }
</style> </style>

View File

@@ -8,68 +8,76 @@
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">{{edit ? '编辑' : '添加' }}外链</div> <div class="headerTitle">{{ edit ? "编辑" : "添加" }}外链</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<a-form ref="formRef" name="custom-validation" :model="state" :rules="rules" v-bind="layout" <a-form
@finish="handleFinish" @validate="handleValidate" @finishFailed="handleFinishFailed"> ref="formRef"
<div class="contentMain"> name="custom-validation"
<div class="main_left"> :model="state"
<div class="main_item"> :rules="rules"
<div class="signbox"> v-bind="layout"
<div class="sign"> @finish="handleFinish"
<img @validate="handleValidate"
src="@/assets/images/coursewareManage/asterisk.png" @finishFailed="handleFinishFailed"
alt="" >
<div class="contentMain">
<div class="main_left">
<div class="main_item">
<div class="signbox">
<div class="sign">
<img
src="@/assets/images/coursewareManage/asterisk.png"
alt=""
/>
</div>
<span style="margin-right: 3px">外链名称</span>
</div>
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 424px; height: 32px"
placeholder="请输入外链名称"
maxlength="20"
/> />
</div> </div>
<span style="margin-right: 3px">外链名称</span>
</div> </div>
<div class="btnbox"> <div class="main_item">
<a-input <div class="signbox">
v-model:value="inputV1" <div class="sign">
style="width: 424px; height: 32px" <img
placeholder="请输入外链名称" src="@/assets/images/coursewareManage/asterisk.png"
maxlength="20" alt=""
/> />
</div> </div>
</div> <span style="margin-right: 3px">链接</span>
<div class="main_item"> </div>
<div class="signbox"> <div class="btnbox">
<div class="sign"> <a-input
<img v-model:value="inputV2"
src="@/assets/images/coursewareManage/asterisk.png" style="width: 424px; height: 32px"
alt="" placeholder="请输入链接"
/> />
</div> </div>
<span style="margin-right: 3px">链接</span>
</div> </div>
<div class="btnbox"> <div class="main_item2">
<a-input <div class="signbox">
v-model:value="inputV2" <span style="margin-right: 3px">外链说明</span>
style="width: 424px; height: 32px" </div>
placeholder="请输入链接" <div class="textarea">
/> <a-textarea
</div> v-model:value="textV1"
</div> placeholder="请输入外链说明"
<div class="main_item2"> allow-clear
<div class="signbox"> />
<span style="margin-right: 3px">外链说明</span> </div>
</div>
<div class="textarea">
<a-textarea
v-model:value="textV1"
placeholder="请输入外链说明"
allow-clear
/>
</div> </div>
</div> </div>
</div> </div>
</div>
</a-form> </a-form>
<div class="main_btns"> <div class="main_btns">
<button class="btn1" @click="closeDrawer">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
@@ -114,7 +122,8 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
edit: { // 是否为编辑 edit: {
// 是否为编辑
type: Boolean, type: Boolean,
default: null, default: null,
}, },
@@ -130,12 +139,14 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Number, type: Number,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -146,8 +157,7 @@ export default {
isactive: { isactive: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -164,115 +174,120 @@ export default {
state.inputV2 = ""; state.inputV2 = "";
state.inputV1 = ""; state.inputV1 = "";
state.textV1 = ""; state.textV1 = "";
// ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
if(props.edit){ if (props.edit) {
queryRef(); queryRef();
} }
}; };
const handleFinish = values => { const handleFinish = (values) => {
console.log(values); console.log(values);
//updateRef(props.EditRefId) //updateRef(props.EditRefId)
}; };
const handleFinishFailed = errors => { const handleFinishFailed = (errors) => {
console.log(errors); console.log(errors);
// message.error("handleFinishFailed"); // message.error("handleFinishFailed");
}; };
const updateTask =(res)=>{ const updateTask = (res) => {
if (props.isLevel == 1) {
if(props.isLevel ==1){
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: res.data.data.linkId, courseId: res.data.data.linkId,
name: res.data.data.linkName, name: res.data.data.linkName,
routerId: props.routerId, routerId: props.routerId,
routerTaskId: props.routerTaskId || 0, routerTaskId: props.routerTaskId || 0,
type: 7, type: 7,
}) })
.then((res) => { .then((res) => {
console.log(res, 11111); console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
state.addLoading = false; state.addLoading = false;
}) })
.catch((err) => { .catch((err) => {
console.log(err, 1111); console.log(err, 1111);
}); });
}else if(props.isLevel ==2){ } else if (props.isLevel == 2) {
apiTask apiTask
.addTask({ .addTask({
courseId:res.data.data.linkId, courseId: res.data.data.linkId,
name: res.data.data.linkName, name: res.data.data.linkName,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId, stageId: props.chooseStageId,
type: 7, type: 7,
}) })
.then((res) => { .then((res) => {
console.log("调用项目添加接口后111", res.data, 11111); console.log("调用项目添加接口后111", res.data, 11111);
ctx.emit("changeData", false); ctx.emit("changeData", false);
closeDrawer(); closeDrawer();
}) })
.catch((err) => { .catch((err) => {
console.log(err, 111111); console.log(err, 111111);
}); });
}else if(props.isLevel ==3){ } else if (props.isLevel == 3) {
console.log(""); console.log("");
} }
} };
//创建外链 //创建外链
const updateRef = () => { const updateRef = () => {
if (!state.inputV1) return message.warning("请输入外链名称"); if (!state.inputV1) return message.warning("请输入外链名称");
if (!state.inputV2){ if (!state.inputV2) {
return message.warning("请输入链接"); return message.warning("请输入链接");
}else{ } else {
const reg = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/; const reg =
if ((!reg.test(state.inputV2)) && state.inputV2 != '') { /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
if (!reg.test(state.inputV2) && state.inputV2 != "") {
return message.warning("请输入合法的链接地址"); return message.warning("请输入合法的链接地址");
} }
} }
let obj = { let obj = {
linkAddress: state.inputV2, linkAddress: state.inputV2,
linkDescription: state.textV1, linkDescription: state.textV1,
linkId:props.edit?props.EditRefId:0, linkId: props.edit ? props.EditRefId : 0,
linkName: state.inputV1, linkName: state.inputV1,
}; };
console.log("编辑的id========",props.EditRefId) console.log("编辑的id========", props.EditRefId);
if(props.edit){ if (props.edit) {
api api
.updateLinks(obj) .updateLinks(obj)
.then((res) => { .then((res) => {
message.success("编辑成功"); message.success("编辑成功");
updateTask(res); updateTask(res);
}).catch((err) => console.log(err)); })
}else{ .catch((err) => console.log(err));
} else {
api api
.createExternalChain(obj) .createExternalChain(obj)
.then((res) => { .then((res) => {
message.success("提交成功"); message.success("提交成功");
updateTask(res); updateTask(res);
}).catch((err) => console.log(err)); })
.catch((err) => console.log(err));
} }
}; };
// 查询任务 // 查询任务
const queryRef = () => { const queryRef = () => {
let d =props.EditRefId ; let d = props.EditRefId;
api api
.getLink({linkId:d}).then((res) => { .getLink({ linkId: d })
// console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD")); .then((res) => {
state.inputV1 = res.data.data.linkName; // console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD"));
state.inputV2 =res.data.data.linkAddress; state.inputV1 = res.data.data.linkName;
state.textV1 =res.data.data.linkDescription; state.inputV2 = res.data.data.linkAddress;
console.log("查询成功=====inputv1",state.inputV1); state.textV1 = res.data.data.linkDescription;
}).catch(() => { console.log("查询成功=====inputv1", state.inputV1);
message.error(`查询失败`) })
}) .catch(() => {
message.error(`查询失败`);
});
}; };
return { return {
...toRefs(state), ...toRefs(state),
@@ -314,7 +329,7 @@ export default {
padding-right: 30px; padding-right: 30px;
flex: 1; flex: 1;
border-right: 1px solid #e8e8e8; border-right: 1px solid #e8e8e8;
margin-top:32px; margin-top: 32px;
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;

File diff suppressed because it is too large Load Diff

View File

@@ -135,17 +135,17 @@
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
<a-drawer <a-drawer
v-model:visible="voteDrawerShow" v-model:visible="voteDrawerShow"
class="custom-class" class="custom-class"
title="创建投票" title="创建投票"
placement="right" placement="right"
@after-visible-change="afterVoteVisibleChange" @after-visible-change="afterVoteVisibleChange"
> >
<p>Some contents...</p> <p>Some contents...</p>
<p>Some contents...</p> <p>Some contents...</p>
<p>Some contents...</p> <p>Some contents...</p>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
@@ -159,10 +159,13 @@ export default {
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
voteDrawerShow:false, voteDrawerShow: false,
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addvoteVisible", false); ctx.emit("update:addvoteVisible", false);
ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
@@ -175,10 +178,8 @@ export default {
const showVoteDrawer = () => { const showVoteDrawer = () => {
state.voteDrawerShow = true; state.voteDrawerShow = true;
}
const afterVoteVisibleChange = () => {
}; };
const afterVoteVisibleChange = () => {};
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
@@ -186,7 +187,7 @@ export default {
closeDrawer, closeDrawer,
// change, // change,
showVoteDrawer, showVoteDrawer,
afterVoteVisibleChange afterVoteVisibleChange,
}; };
}, },
}; };

View File

@@ -65,7 +65,7 @@
</button> </button>
<div :style="{ display: creVote ? 'block' : 'none' }"> <div :style="{ display: creVote ? 'block' : 'none' }">
<div class="fileTigan"> <div class="fileTigan">
<span style="color: #388be1">{{ballotName}}</span> <span style="color: #388be1">{{ ballotName }}</span>
<div class="delBox" @click="dleVoteStem()"></div> <div class="delBox" @click="dleVoteStem()"></div>
</div> </div>
</div> </div>
@@ -128,7 +128,7 @@
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs} from "vue"; import { reactive, toRefs } from "vue";
import CreVote from "./CreVote.vue"; import CreVote from "./CreVote.vue";
import * as api from "../../api/indexVote"; import * as api from "../../api/indexVote";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -136,7 +136,6 @@ import { RouterEditTask } from "@/api/indexTask";
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as apiTask from "../../api/indexTaskadd"; import * as apiTask from "../../api/indexTaskadd";
export default { export default {
name: "AddVote", name: "AddVote",
components: { components: {
@@ -167,11 +166,13 @@ export default {
type: Number, type: Number,
default: 0, default: 0,
}, },
isLevel: { // 是否是关卡页面触发 isLevel: {
// 是否是关卡页面触发
type: Boolean, type: Boolean,
default: null, default: null,
}, },
projectTaskId: { // 要编辑的projectId projectTaskId: {
// 要编辑的projectId
type: Number, type: Number,
default: null, default: null,
}, },
@@ -182,9 +183,7 @@ export default {
isactive: { isactive: {
type: Number, type: Number,
default: null, default: null,
} },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -192,37 +191,40 @@ export default {
textV1: "", textV1: "",
crevotevisible: false, crevotevisible: false,
time: undefined, time: undefined,
startTime:"", startTime: "",
endTime:"", endTime: "",
basevote: "", basevote: "",
ascriptionId: "", ascriptionId: "",
voteStemId: null, voteStemId: null,
voteId:"", voteId: "",
voteStemName:"", voteStemName: "",
ballotName: "", ballotName: "",
editStem: false, //编辑状态 editStem: false, //编辑状态
ballotId: 0, //题干id ballotId: 0, //题干id
optionId: "", //删除修改选项id optionId: "", //删除修改选项id
}); });
const closeDrawer = () => { const closeDrawer = () => {
state.inputV1 = "", (state.inputV1 = ""),
state.textV1 = "", (state.textV1 = ""),
state.time = undefined, (state.time = undefined),
state.basevote = "", (state.basevote = ""),
ctx.emit("update:addvoteVisible", false); ctx.emit("update:addvoteVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
queryVoteInfo(); queryVoteInfo();
}; };
const showDrawerCreVote = () => { const showDrawerCreVote = () => {
state.crevotevisible = true; state.crevotevisible = true;
}; };
const getStemId = (data) => { const getStemId = (data) => {
state.ballotName = data.ballotName; state.ballotName = data.ballotName;
state.ballotId =data.ballotId; state.ballotId = data.ballotId;
} };
const delBox = () => { const delBox = () => {
state.creVote = false; state.creVote = false;
@@ -231,19 +233,18 @@ export default {
//删除题干信息接口 //删除题干信息接口
const dleVoteStem = () => { const dleVoteStem = () => {
let objdelstem = { let objdelstem = {
voteStemId:state.voteStemId voteStemId: state.voteStemId,
} };
api.deleteVoteStem(objdelstem) api.deleteVoteStem(objdelstem).then((res) => {
.then((res) => { console.log("删除题干信息成功", res);
console.log('删除题干信息成功', res) message.success("删除题干信息成功");
message.success('删除题干信息成功') delBox();
delBox() });
}) };
}
//根据投票id获取投票信息 //根据投票id获取投票信息
const queryVoteInfo = ()=>{ const queryVoteInfo = () => {
/** /**
let obj = { let obj = {
voteId:props.voteId voteId:props.voteId
} }
@@ -261,10 +262,9 @@ export default {
console.log('获取投票信息失败',err); console.log('获取投票信息失败',err);
}) })
**/ **/
};
} const updateToTask = (res) => {
const updateToTask =(res)=>{ if (props.isLevel) {
if(props.isLevel){
RouterEditTask({ RouterEditTask({
chapterId: props.isactive, chapterId: props.isactive,
courseId: res.data.data.voteId, courseId: res.data.data.voteId,
@@ -275,17 +275,17 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log(res, 11111); console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`) message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
ctx.emit("changeData", false); ctx.emit("changeData", false);
state.addLoading = false; state.addLoading = false;
}) })
.catch((err) => { .catch((err) => {
console.log(err, 1111); console.log(err, 1111);
}); });
}else{ } else {
apiTask apiTask
.addTask({ .addTask({
courseId:res.data.data.voteId, courseId: res.data.data.voteId,
name: res.data.data.voteName, name: res.data.data.voteName,
projectId: props.projectId, projectId: props.projectId,
projectTaskId: props.projectTaskId || 0, projectTaskId: props.projectTaskId || 0,
@@ -300,7 +300,7 @@ export default {
console.log(err, 111111); console.log(err, 111111);
}); });
} }
} };
//修改投票信息接口 //修改投票信息接口
const updateVoteInfo = () => { const updateVoteInfo = () => {
if (!state.inputV1) { if (!state.inputV1) {
@@ -311,48 +311,47 @@ export default {
if (state.basevote == "") { if (state.basevote == "") {
state.basevote = 1; state.basevote = 1;
} }
if(state.time != undefined){ if (state.time != undefined) {
state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD"); state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD");
state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD"); state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD");
} }
let obj = { let obj = {
voteId: props.edit?state.voteId : 0, voteId: props.edit ? state.voteId : 0,
voteName: state.inputV1, voteName: state.inputV1,
voteStartTime: state.startTime, voteStartTime: state.startTime,
voteEndTime: state.endTime, voteEndTime: state.endTime,
ballotId: state.ballotId, ballotId: state.ballotId,
baseVote: state.basevote, baseVote: state.basevote,
voteExplain: state.textV1, voteExplain: state.textV1,
createUser:0, createUser: 0,
updateUser:0, updateUser: 0,
voteTag:"", voteTag: "",
} };
if(props.edit){ if (props.edit) {
api api
.editVote(obj) .editVote(obj)
.then((res) => { .then((res) => {
updateToTask(res); updateToTask(res);
closeDrawer(); closeDrawer();
console.log('修改投票信息成功', res); console.log("修改投票信息成功", res);
}) })
.catch((err) => { .catch((err) => {
console.log('修改投票信息失败', err); console.log("修改投票信息失败", err);
}) });
}else{ } else {
api api
.createVote(obj) .createVote(obj)
.then((res) => { .then((res) => {
updateToTask(res); updateToTask(res);
closeDrawer(); closeDrawer();
console.log('创建投票信息成功', res); console.log("创建投票信息成功", res);
}) })
.catch((err) => { .catch((err) => {
console.log('创建投票信息失败', err); console.log("创建投票信息失败", err);
}) });
} }
};
}
return { return {
...toRefs(state), ...toRefs(state),
showDrawerCreVote, showDrawerCreVote,
@@ -363,7 +362,6 @@ export default {
dleVoteStem, dleVoteStem,
updateVoteInfo, updateVoteInfo,
delBox, delBox,
}; };
}, },
}; };