mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
添加传参方法
This commit is contained in:
@@ -9,15 +9,14 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
|
||||
<div class="headerTitle">{{edit?'编辑':'添加'}}活动</div>
|
||||
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}活动</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
@@ -72,7 +71,7 @@
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
@@ -214,11 +213,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="updateActivityInfo">确定</button>
|
||||
</div>
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="updateActivityInfo">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
@@ -226,9 +225,9 @@
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import * as api from "../../api/indexActivity";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { RouterEditTask } from "@/api/indexTask"
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
import { message } from "ant-design-vue";
|
||||
import dayjs from 'dayjs';
|
||||
import dayjs from "dayjs";
|
||||
const rowSelection = ref({
|
||||
checkStrictly: false,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
@@ -258,7 +257,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -274,15 +274,18 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
EditWorkId: { // 要编辑的workId
|
||||
EditWorkId: {
|
||||
// 要编辑的workId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -293,7 +296,7 @@ export default {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
//console.log("学习路径",props.isStudiscuss);
|
||||
@@ -322,35 +325,46 @@ export default {
|
||||
state.textV1 = "";
|
||||
state.textV2 = "";
|
||||
state.time = "";
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const queryActive = () => {
|
||||
console.log("props.EditActiveId======",props.EditActiveId,props.chooseStageId,props.routerTaskId);
|
||||
api.getActivity(props.EditActiveId).then(res => {
|
||||
console.log('获取讨论信息成功',res.data.data.standardSettings)
|
||||
|
||||
console.log(
|
||||
"props.EditActiveId======",
|
||||
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.textV2 = res.data.data.activityExplain;
|
||||
state.inputV2 = res.data.data.activityDuration;
|
||||
state.inputV3 = res.data.data.activityAddress;
|
||||
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.radioV1 = Number(res.data.data.standardSettings);
|
||||
|
||||
state.time = [dayjs(res.data.data.activityStartTime, "YYYY-MM-DD"), dayjs(res.data.data.activityEndTime, "YYYY-MM-DD")]
|
||||
}).catch(err=>{
|
||||
console.log('获取讨论信息失败',err)
|
||||
|
||||
state.time = [
|
||||
dayjs(res.data.data.activityStartTime, "YYYY-MM-DD"),
|
||||
dayjs(res.data.data.activityEndTime, "YYYY-MM-DD"),
|
||||
];
|
||||
})
|
||||
}
|
||||
.catch((err) => {
|
||||
console.log("获取讨论信息失败", err);
|
||||
});
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
if(bool && props.edit){
|
||||
if (bool && props.edit) {
|
||||
queryActive();
|
||||
}
|
||||
|
||||
};
|
||||
const cloradio1 = (value) => {
|
||||
if (value != "") {
|
||||
@@ -358,109 +372,109 @@ export default {
|
||||
}
|
||||
};
|
||||
const updateTask = (res) => {
|
||||
if(props.isLevel == 1 ){
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
chapterId:props.isactive,
|
||||
courseId: res.data.data.activityId,
|
||||
duration: res.data.data.activityDuration,
|
||||
name: res.data.data.activityName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId ||0,
|
||||
type: 9,
|
||||
}).then(res => {
|
||||
console.log("新增关卡任务成功",res);
|
||||
|
||||
}).catch(err => {
|
||||
console.log("新增关卡任务失败",err);
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.activityId,
|
||||
duration: res.data.data.activityDuration,
|
||||
name: res.data.data.activityName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 9,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("新增关卡任务成功", res);
|
||||
})
|
||||
}else if(props.isLevel==2){
|
||||
apiTask.addTask({
|
||||
.catch((err) => {
|
||||
console.log("新增关卡任务失败", err);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: res.data.data.activityId,
|
||||
duration: res.data.data.activityDuration,
|
||||
name: res.data.data.activityName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId ||0,
|
||||
stageId:props.chooseStageId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 9,
|
||||
}).then((res)=> {
|
||||
console.log("更新任务列表成功",res);
|
||||
|
||||
})
|
||||
.catch((err)=> {
|
||||
console.log("更新任务列表失败",err);
|
||||
.then((res) => {
|
||||
console.log("更新任务列表成功", res);
|
||||
})
|
||||
}else if(props.isLevel == 3){
|
||||
.catch((err) => {
|
||||
console.log("更新任务列表失败", err);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("模板库更新更新任务列表");
|
||||
}
|
||||
}
|
||||
};
|
||||
//创建活动
|
||||
const updateActivityInfo = () => {
|
||||
if(!state.inputV1){
|
||||
if (!state.inputV1) {
|
||||
message.destroy();
|
||||
return message.warning("请输入活动名称");
|
||||
}
|
||||
if(!state.textV1){
|
||||
}
|
||||
if (!state.textV1) {
|
||||
message.destroy();
|
||||
return message.warning("请输入活动公告");
|
||||
}
|
||||
if(!state.time){
|
||||
}
|
||||
if (!state.time) {
|
||||
message.destroy();
|
||||
return message.warning("请输入活动时间");
|
||||
}
|
||||
if(!state.inputV2){
|
||||
}
|
||||
if (!state.inputV2) {
|
||||
message.destroy();
|
||||
return message.warning("请输入活动时长");
|
||||
}
|
||||
if(!state.inputV3){
|
||||
}
|
||||
if (!state.inputV3) {
|
||||
message.destroy();
|
||||
return message.warning("请输入活动地址");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let obj = {
|
||||
activityAddress: state.inputV3, //活动地址
|
||||
activityDuration: state.inputV2, //活动时长
|
||||
activityExplain: state.textV2, //活动说明
|
||||
activityEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), //活动结束时间
|
||||
activityId: props.edit?props.EditActiveId:0, //活动ID
|
||||
activityName: state.inputV1, //活动名称
|
||||
activityNotice: state.textV1, //活动公告
|
||||
activityStartTime:dayjs(state.time[0]).format("YYYY-MM-DD"),//活动开始时间
|
||||
activityTag: "", //活动逻辑删除标识
|
||||
afterSignIn: state.inputV5, //活动开始后多少分钟签到
|
||||
beforeSignIn: state.inputV4, //活动开始前多少分钟签到
|
||||
signOutTime: state.inputV6, //签退开始时间
|
||||
standardSettings: state.radioV1, //标准设置
|
||||
|
||||
activityAddress: state.inputV3, //活动地址
|
||||
activityDuration: state.inputV2, //活动时长
|
||||
activityExplain: state.textV2, //活动说明
|
||||
activityEndTime: dayjs(state.time[1]).format("YYYY-MM-DD"), //活动结束时间
|
||||
activityId: props.edit ? props.EditActiveId : 0, //活动ID
|
||||
activityName: state.inputV1, //活动名称
|
||||
activityNotice: state.textV1, //活动公告
|
||||
activityStartTime: dayjs(state.time[0]).format("YYYY-MM-DD"), //活动开始时间
|
||||
activityTag: "", //活动逻辑删除标识
|
||||
afterSignIn: state.inputV5, //活动开始后多少分钟签到
|
||||
beforeSignIn: state.inputV4, //活动开始前多少分钟签到
|
||||
signOutTime: state.inputV6, //签退开始时间
|
||||
standardSettings: state.radioV1, //标准设置
|
||||
};
|
||||
if(props.edit){
|
||||
if (props.edit) {
|
||||
//更新编辑活动信息
|
||||
api
|
||||
.updateActivity(obj)
|
||||
.then((res) => {
|
||||
closeDrawer();
|
||||
updateTask(res);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("更新失败",err);
|
||||
})
|
||||
}else{
|
||||
.updateActivity(obj)
|
||||
.then((res) => {
|
||||
closeDrawer();
|
||||
updateTask(res);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("更新失败", err);
|
||||
});
|
||||
} else {
|
||||
//新建活动信息
|
||||
api
|
||||
.createActivity(obj)
|
||||
.then((res) => {
|
||||
.createActivity(obj)
|
||||
.then((res) => {
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
updateTask(res);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败",err);
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建失败", err);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
@@ -505,7 +519,7 @@ export default {
|
||||
border-radius: 8px;
|
||||
}
|
||||
.main_left {
|
||||
margin-top:32px;
|
||||
margin-top: 32px;
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="header">
|
||||
<div v-if="edit" class="headerTitle">编辑案例</div>
|
||||
<div v-else class="headerTitle">添加案例</div>
|
||||
<img
|
||||
@@ -40,28 +40,37 @@
|
||||
<div class="search"></div>
|
||||
<div class="btnText">重置</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_table">
|
||||
<a-table class="ant-table-striped" :row-class-name="
|
||||
(_record, index) => (index % 2 === 1 ? 'table-striped' : null)
|
||||
" :row-selection="rowSelection" :columns="tableDataFunc()" :data-source="tableData"
|
||||
:loading="tableDataTotal === -1 ? true : false" expandRowByClick="true" this.getMilitaryDeployment()
|
||||
@expand="expandTable" :pagination="false" filterMultiple:false
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_table">
|
||||
<a-table
|
||||
class="ant-table-striped"
|
||||
:row-class-name="
|
||||
(_record, index) => (index % 2 === 1 ? 'table-striped' : null)
|
||||
"
|
||||
: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">
|
||||
<a-pagination
|
||||
showSizeChanger="true"
|
||||
showQuickJumper="true"
|
||||
hideOnSinglePage="true"
|
||||
:pageSize="pageSize"
|
||||
:current="currentPage"
|
||||
:total="tableDataTotal"
|
||||
class="pagination"
|
||||
@change="handelChangePage"
|
||||
/>
|
||||
</div>
|
||||
<a-pagination
|
||||
showSizeChanger="true"
|
||||
showQuickJumper="true"
|
||||
hideOnSinglePage="true"
|
||||
:pageSize="pageSize"
|
||||
:current="currentPage"
|
||||
:total="tableDataTotal"
|
||||
class="pagination"
|
||||
@change="handelChangePage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
@@ -90,7 +99,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -106,11 +116,13 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -121,14 +133,15 @@ export default {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
tableData: [
|
||||
{
|
||||
key: "1",
|
||||
title: "基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555",
|
||||
title:
|
||||
"基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555",
|
||||
name: "李玉冰",
|
||||
time: "2022-10-31 23:12:00",
|
||||
},
|
||||
@@ -136,7 +149,7 @@ export default {
|
||||
currentPage: 1,
|
||||
tableDataTotal: 0,
|
||||
pageSize: 10,
|
||||
inputV1: '',
|
||||
inputV1: "",
|
||||
time: undefined,
|
||||
assessmentId: null,
|
||||
assessmentName: "",
|
||||
@@ -144,6 +157,8 @@ export default {
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addcaseVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
@@ -179,7 +194,13 @@ export default {
|
||||
const rowSelection = {
|
||||
onSelect: (selectedRows, selected, selectedRowKeys) => {
|
||||
console.log(
|
||||
"selectedRowKeys", selectedRowKeys, "selectedRows", selectedRows, "selected", selected);
|
||||
"selectedRowKeys",
|
||||
selectedRowKeys,
|
||||
"selectedRows",
|
||||
selectedRows,
|
||||
"selected",
|
||||
selected
|
||||
);
|
||||
console.log(selectedRows.assessmentId);
|
||||
state.assessmentId = selectedRows.assessmentId;
|
||||
state.assessmentName = selectedRows.name;
|
||||
@@ -228,8 +249,8 @@ export default {
|
||||
});
|
||||
};
|
||||
const updateTask = () => {
|
||||
console.log("jinlaile=================", state.assessmentName)
|
||||
if (props.isLevel==1) {
|
||||
console.log("jinlaile=================", state.assessmentName);
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessmentId,
|
||||
@@ -240,7 +261,7 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
@@ -248,7 +269,7 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
} else if(props.isLevel==2){
|
||||
} else if (props.isLevel == 2) {
|
||||
console.log("=========projectTaskId", props.projectTaskId);
|
||||
apiTask
|
||||
.addTask({
|
||||
@@ -267,10 +288,10 @@ export default {
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
}else if(props.isLevel==3){
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("模板库");
|
||||
}
|
||||
}
|
||||
};
|
||||
//重置案例信息
|
||||
const resetCase = () => {
|
||||
state.inputV1 = "";
|
||||
@@ -297,181 +318,181 @@ export default {
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addcaseDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addcaseDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
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;
|
||||
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;
|
||||
margin-bottom: 12px;
|
||||
flex-wrap: wrap;
|
||||
.mi_ipts {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
flex-wrap: wrap;
|
||||
.mi_ipts {
|
||||
margin-bottom: 20px;
|
||||
.mii_ipt {
|
||||
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;
|
||||
}
|
||||
align-items: center;
|
||||
margin-right: 24px;
|
||||
.ipt_name {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
.classify {
|
||||
margin-left: 10px !important;
|
||||
padding-left: 9px !important;
|
||||
.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%;
|
||||
}
|
||||
.ant-checkbox-wrapper {
|
||||
align-items: center;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.ant-table-selection-column {
|
||||
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;
|
||||
.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_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;
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
.classify {
|
||||
margin-left: 10px !important;
|
||||
padding-left: 9px !important;
|
||||
}
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
.ant-checkbox-wrapper {
|
||||
align-items: center;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.ant-table-selection-column {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
@@ -174,6 +174,7 @@ export default {
|
||||
state.inputV1 = "";
|
||||
state.textV1 = "";
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
// ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{edit?'编辑':'添加'}}测评</div>
|
||||
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}测评</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -48,16 +48,18 @@
|
||||
<span style="margin-right: 3px">选择测评:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<button class="checkEval" @click="showEvalDrawer">选择测评</button>
|
||||
<button class="checkEval" @click="showEvalDrawer">
|
||||
选择测评
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<div><EvList
|
||||
v-model:EvalListVisible="EvalListVisible"
|
||||
v-model:evaluationTypeId="evaluationTypeId"
|
||||
v-model:evaluationTypeName="evaluationTypeName"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<EvList
|
||||
v-model:EvalListVisible="EvalListVisible"
|
||||
v-model:evaluationTypeId="evaluationTypeId"
|
||||
v-model:evaluationTypeName="evaluationTypeName"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
@@ -78,8 +80,12 @@
|
||||
<span style="margin-right: 3px">测评说明:</span>
|
||||
</div>
|
||||
<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>
|
||||
@@ -102,11 +108,11 @@ import * as api from "../../api/indexEval";
|
||||
import * as apitaskadd from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
import dayjs from 'dayjs';
|
||||
import dayjs from "dayjs";
|
||||
// const router = useRouter();
|
||||
export default {
|
||||
name: "AddEval",
|
||||
components: {
|
||||
components: {
|
||||
EvList,
|
||||
},
|
||||
props: {
|
||||
@@ -118,7 +124,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -134,11 +141,13 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -157,10 +166,10 @@ export default {
|
||||
inputV2: "",
|
||||
time: undefined,
|
||||
EvalId: null,
|
||||
evaluationTypeId:null,
|
||||
evaluationTypeName:"",
|
||||
description:"",
|
||||
EvalListVisible:false,
|
||||
evaluationTypeId: null,
|
||||
evaluationTypeName: "",
|
||||
description: "",
|
||||
EvalListVisible: false,
|
||||
// addLoading:false,
|
||||
});
|
||||
|
||||
@@ -169,67 +178,72 @@ export default {
|
||||
ctx.emit("update:edit", false);
|
||||
state.inputV1 = "";
|
||||
state.inputV2 = "";
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
if(props.edit && bool){
|
||||
if (props.edit && bool) {
|
||||
queryEval();
|
||||
}
|
||||
};
|
||||
const showEvalDrawer = () =>{
|
||||
const showEvalDrawer = () => {
|
||||
state.EvalListVisible = true;
|
||||
console.log("进来了吗");
|
||||
};
|
||||
const queryEval = () =>{
|
||||
const queryEval = () => {
|
||||
api
|
||||
.queryEvaluationDetailById({evaluationId:props.evaluationId})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data.data);
|
||||
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.evaluationTypeId = res.data.data.evaluationTypeId;
|
||||
state.evaluationTypeName =res.data.data.evaluationTypeName;
|
||||
//state.description =
|
||||
.queryEvaluationDetailById({ evaluationId: props.evaluationId })
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data.data);
|
||||
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.evaluationTypeId = res.data.data.evaluationTypeId;
|
||||
state.evaluationTypeName = res.data.data.evaluationTypeName;
|
||||
//state.description =
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
const updateTask = (res)=>{
|
||||
if(props.isLevel ==1){
|
||||
};
|
||||
const updateTask = (res) => {
|
||||
if (props.isLevel == 1) {
|
||||
apitaskadd
|
||||
.addTask({
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 10,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}else if(props.isLevel ==2){
|
||||
.addTask({
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 10,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 10,
|
||||
}).then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}else if(props.isLevel ==3){
|
||||
console.log("模板库任务")
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.evaluationId,
|
||||
name: res.data.data.evaluationName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 10,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后", res.data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("模板库任务");
|
||||
}
|
||||
}
|
||||
};
|
||||
//创建或编辑测评信息
|
||||
const createEvalText = () => {
|
||||
if (!state.inputV1) {
|
||||
@@ -248,36 +262,36 @@ export default {
|
||||
let obj = {
|
||||
evaluationName: state.inputV1,
|
||||
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"),
|
||||
evaluationTypeId:state.evaluationTypeId,
|
||||
evaluationTypeName:state.evaluationTypeName,
|
||||
evaluationTypeId: state.evaluationTypeId,
|
||||
evaluationTypeName: state.evaluationTypeName,
|
||||
//state.description
|
||||
};
|
||||
if(props.edit){
|
||||
if (props.edit) {
|
||||
api
|
||||
.createEvaluation(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}else{
|
||||
.createEvaluation(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else {
|
||||
api
|
||||
.updateEvaluation(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
.updateEvaluation(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
message.success("创建成功");
|
||||
closeDrawer();
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -318,7 +332,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.main_left {
|
||||
margin-top:32px;
|
||||
margin-top: 32px;
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
@@ -384,6 +384,8 @@ export default {
|
||||
ctx.emit("update:addfaceteachVisible", false);
|
||||
state.radioV1 = "";
|
||||
state.radioV2 = "";
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
|
||||
@@ -279,6 +279,9 @@ export default {
|
||||
formState.choosedTime = "";
|
||||
ctx.emit("update:addhomeworkVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
if (props.addhomeworkVisible && props.edit) {
|
||||
@@ -288,38 +291,35 @@ export default {
|
||||
console.log("state", bool);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 新增任务
|
||||
const updteHomeWork = () => {
|
||||
let obj = {
|
||||
submitEndTime: dayjs(formState.choosedTime[1]).format("YYYY-MM-DD"),
|
||||
submitStartTime: dayjs(formState.choosedTime[0]).format("YYYY-MM-DD"),
|
||||
workEnclosureAddress: "",
|
||||
workId: props.edit?props.EditWorkId:0,
|
||||
workId: props.edit ? props.EditWorkId : 0,
|
||||
workName: formState.workName,
|
||||
workRequirement: formState.workRequirement,
|
||||
};
|
||||
if(props.edit){
|
||||
if (props.edit) {
|
||||
updateWorkTaskUsing(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`添加失败${err}`);
|
||||
});
|
||||
}else{
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`添加失败${err}`);
|
||||
});
|
||||
} else {
|
||||
createWorkTask(obj)
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`添加失败${err}`);
|
||||
});
|
||||
.then((res) => {
|
||||
updateTask(res);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(`添加失败${err}`);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 查询任务
|
||||
@@ -345,50 +345,48 @@ export default {
|
||||
};
|
||||
// 新增编辑或新增项目任务
|
||||
const updateTask = (res) => {
|
||||
if(props.isLevel==1 ){
|
||||
if (props.isLevel == 1) {
|
||||
let editObj1 = {
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.workId,
|
||||
name: res.data.data.workName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 4,
|
||||
};
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.workId,
|
||||
name: res.data.data.workName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 4,
|
||||
};
|
||||
|
||||
RouterEditTask(editObj1)
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
}else if(props.isLevel==2){
|
||||
RouterEditTask(editObj1)
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
let editObj = {
|
||||
courseId: res.data.data.workId,
|
||||
name:res.data.data.workName,
|
||||
projectId: props.edit?props.projectId:0,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 4,
|
||||
};
|
||||
ProjectEditTask(editObj)
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
}else if(props.isLevel==3){
|
||||
courseId: res.data.data.workId,
|
||||
name: res.data.data.workName,
|
||||
projectId: props.edit ? props.projectId : 0,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 4,
|
||||
};
|
||||
ProjectEditTask(editObj)
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}阶段任务失败`);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("模板库更新更新任务列表");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
afterVisibleChange,
|
||||
closeDrawer,
|
||||
@@ -440,7 +438,7 @@ export default {
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
margin-top:32px;
|
||||
margin-top: 32px;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
|
||||
@@ -18,51 +18,61 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main">
|
||||
<div class="main_left">
|
||||
<div class="main_notice">
|
||||
<div class="mntc_left">
|
||||
<div class="notice_icon"></div>
|
||||
<div v-if="assessment==null">
|
||||
<span class="title">已选择 <span class ="data">0</span> 条</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span class="title">已选择 <span class ="data">1</span> 条;</span>
|
||||
<span class="title">名称: <span class ="data">{{assessment.name}}</span> </span>
|
||||
<span class="title">题数: <span class ="data">{{assessment.num}}</span> </span>
|
||||
<span class="title">创建人: <span class ="data">{{assessment.creator}}</span> </span>
|
||||
<span class="title">创建时间: <span class ="data">{{assessment.time}}</span> </span>
|
||||
</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 class="main">
|
||||
<div class="main_left">
|
||||
<div class="main_notice">
|
||||
<div class="mntc_left">
|
||||
<div class="notice_icon"></div>
|
||||
<div v-if="assessment == null">
|
||||
<span class="title"
|
||||
>已选择 <span class="data">0</span> 条</span
|
||||
>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span class="title"
|
||||
>已选择 <span class="data">1</span> 条;</span
|
||||
>
|
||||
<span class="title"
|
||||
>名称: <span class="data">{{ assessment.name }}</span>
|
||||
</span>
|
||||
<span class="title"
|
||||
>题数: <span class="data">{{ assessment.num }}</span>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建人: <span class="data">{{ assessment.creator }}</span>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建时间: <span class="data">{{ assessment.time }}</span>
|
||||
</span>
|
||||
</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 class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="updateTask">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="updateTask">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs} from "vue";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
import { message } from "ant-design-vue";
|
||||
import AssessmentList from "./ AssessmentList.vue";
|
||||
@@ -81,7 +91,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -97,12 +108,14 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -114,7 +127,6 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
@@ -123,79 +135,79 @@ export default {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
tableDataTotal: 0,
|
||||
tableData: [
|
||||
],
|
||||
assessmentId:null,
|
||||
assessmentName:"",
|
||||
assessment:null,
|
||||
assessmentVisible:false,
|
||||
|
||||
tableData: [],
|
||||
assessmentId: null,
|
||||
assessmentName: "",
|
||||
assessment: null,
|
||||
assessmentVisible: false,
|
||||
});
|
||||
const getCheckedAss = (ass) =>{
|
||||
state.assessment = ass
|
||||
console.log("checed===",state.assessment);
|
||||
}
|
||||
const getCheckedAss = (ass) => {
|
||||
state.assessment = ass;
|
||||
console.log("checed===", state.assessment);
|
||||
};
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addinvistVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
state.inputV1 = "";
|
||||
// ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const checkAssDrawer =() =>{
|
||||
const checkAssDrawer = () => {
|
||||
state.assessmentVisible = true;
|
||||
}
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
state.assessmentId=null;
|
||||
state.assessmentName="";
|
||||
state.assessment=null;
|
||||
state.assessmentId = null;
|
||||
state.assessmentName = "";
|
||||
state.assessment = null;
|
||||
};
|
||||
|
||||
const updateTask =()=>{
|
||||
if(state.assessment==null){
|
||||
const updateTask = () => {
|
||||
if (state.assessment == null) {
|
||||
return message.warning("请选择评估");
|
||||
}
|
||||
if(props.isLevel ==1){
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessment.assessmentId,
|
||||
name:state.assessment.name,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
}else if(props.isLevel ==2){
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessment.assessmentId,
|
||||
name: state.assessment.name,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: state.assessment.assessmentId,
|
||||
name:state.assessment.name,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
}else if(props.isLevel == 3){
|
||||
.addTask({
|
||||
courseId: state.assessment.assessmentId,
|
||||
name: state.assessment.name,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 11,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("模板库更新更新任务列表");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
@@ -232,107 +244,104 @@ export default {
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.main{
|
||||
width:100%;
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
margin-top:32px;
|
||||
.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);
|
||||
.main {
|
||||
width: 100%;
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
margin-top: 32px;
|
||||
.main_item {
|
||||
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%;
|
||||
margin-bottom: 64px;
|
||||
.fi_input {
|
||||
margin-right: 20px;
|
||||
}
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
.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;
|
||||
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 {
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
.main_notice {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
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%;
|
||||
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%;
|
||||
}
|
||||
}
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #409eff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
.mntc_right {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.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 {
|
||||
height: 72px;
|
||||
|
||||
@@ -445,6 +445,9 @@ export default {
|
||||
state.textV1 = "";
|
||||
state.switchC1 = "";
|
||||
state.imageUrl = "";
|
||||
ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("props.edit===================", props.edit, bool);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="header">
|
||||
<div v-if="edit" class="headerTitle">编辑在线</div>
|
||||
<div v-else class="headerTitle">添加在线</div>
|
||||
<img
|
||||
@@ -59,10 +59,10 @@
|
||||
<div class="mntc_left">
|
||||
<div class="notice_icon"></div>
|
||||
<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>{{tableDataTotal}}</span> 条</span
|
||||
>列表选项总计:<span>{{ tableDataTotal }}</span> 条</span
|
||||
>
|
||||
</div>
|
||||
<div class="mntc_right">
|
||||
@@ -79,24 +79,24 @@
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="tableData"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
expandRowByClick="true"
|
||||
this.getMilitaryDeployment()
|
||||
@expand="expandTable"
|
||||
expandRowByClick="true"
|
||||
this.getMilitaryDeployment()
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
filterMultiple:false
|
||||
filterMultiple:false
|
||||
/>
|
||||
<div class="pa">
|
||||
<a-pagination
|
||||
showSizeChanger="true"
|
||||
showQuickJumper="true"
|
||||
hideOnSinglePage="true"
|
||||
:pageSize="pageSize"
|
||||
:current="currentPage"
|
||||
:total="tableDataTotal"
|
||||
class="pagination"
|
||||
@change="handelChangePage"
|
||||
/>
|
||||
</div>
|
||||
<a-pagination
|
||||
showSizeChanger="true"
|
||||
showQuickJumper="true"
|
||||
hideOnSinglePage="true"
|
||||
:pageSize="pageSize"
|
||||
:current="currentPage"
|
||||
:total="tableDataTotal"
|
||||
class="pagination"
|
||||
@change="handelChangePage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
@@ -124,7 +124,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -140,11 +141,13 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -155,20 +158,20 @@ export default {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
inputV1:"",
|
||||
options1 : [
|
||||
inputV1: "",
|
||||
options1: [
|
||||
{
|
||||
value: "value1",
|
||||
label: "未完成",
|
||||
},
|
||||
],
|
||||
time: undefined,
|
||||
assessmentId:null,
|
||||
assessmentName:"",
|
||||
assessmentId: null,
|
||||
assessmentName: "",
|
||||
RowsNum: 0,
|
||||
tableData: [],
|
||||
currentPage: 1,
|
||||
@@ -178,6 +181,9 @@ export default {
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addonlineVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
// ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
@@ -199,7 +205,8 @@ export default {
|
||||
width: "100px",
|
||||
align: "left",
|
||||
className: "classify",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
title: "内容分类",
|
||||
dataIndex: "content",
|
||||
key: "content",
|
||||
@@ -235,19 +242,25 @@ export default {
|
||||
onSelectAll: (selected) => {
|
||||
console.log(selected);
|
||||
if (selected == true) {
|
||||
state.RowsNum = state.tableDataTotal
|
||||
state.RowsNum = state.tableDataTotal;
|
||||
} else {
|
||||
state.RowsNum = 0
|
||||
state.RowsNum = 0;
|
||||
}
|
||||
},
|
||||
onSelect: (selectedRows, selected, selectedRowKeys) => {
|
||||
console.log(
|
||||
"selectedRowKeys", selectedRowKeys, "selectedRows", selectedRows, "selected", selected);
|
||||
"selectedRowKeys",
|
||||
selectedRowKeys,
|
||||
"selectedRows",
|
||||
selectedRows,
|
||||
"selected",
|
||||
selected
|
||||
);
|
||||
console.log(selectedRows.assessmentId);
|
||||
if (selected == true) {
|
||||
state.RowsNum++
|
||||
state.RowsNum++;
|
||||
} else {
|
||||
state.RowsNum--
|
||||
state.RowsNum--;
|
||||
}
|
||||
state.assessmentId = selectedRows.assessmentId;
|
||||
state.assessmentName = selectedRows.name;
|
||||
@@ -295,49 +308,49 @@ export default {
|
||||
// state.createLoading = false;
|
||||
});
|
||||
};
|
||||
const updateTask =()=>{
|
||||
if(props.isLevel ==1){
|
||||
const updateTask = () => {
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
}else if(props.isLevel ==2){
|
||||
console.log("=========projectTaskId",props.projectTaskId);
|
||||
chapterId: props.isactive,
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
console.log("=========projectTaskId", props.projectTaskId);
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
}else if(props.isLevel ==3){
|
||||
.addTask({
|
||||
courseId: state.assessmentId,
|
||||
name: state.assessmentName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 1,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("");
|
||||
}
|
||||
}
|
||||
};
|
||||
//重置在线信息
|
||||
const resetOnline = () => {
|
||||
state.inputV1 = "";
|
||||
@@ -367,201 +380,201 @@ export default {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
.addonlineDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
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;
|
||||
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 {
|
||||
margin-bottom: 32px;
|
||||
height: 40px;
|
||||
background-color: #e9f6fe;
|
||||
.mntc_left {
|
||||
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;
|
||||
margin-bottom: 32px;
|
||||
height: 40px;
|
||||
background-color: #e9f6fe;
|
||||
.mntc_left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.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;
|
||||
.notice_icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 9px;
|
||||
margin-left: 9px;
|
||||
background-image: url(@/assets/images/coursewareManage/gan.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.main_table {
|
||||
position: relative;
|
||||
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;
|
||||
}
|
||||
}
|
||||
.mntc_right {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
.classify {
|
||||
margin-left: 10px !important;
|
||||
padding-left: 9px !important;
|
||||
}
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
.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_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>
|
||||
@@ -8,68 +8,76 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{edit ? '编辑' : '添加' }}外链</div>
|
||||
<div class="headerTitle">{{ edit ? "编辑" : "添加" }}外链</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<a-form ref="formRef" name="custom-validation" :model="state" :rules="rules" v-bind="layout"
|
||||
@finish="handleFinish" @validate="handleValidate" @finishFailed="handleFinishFailed">
|
||||
<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=""
|
||||
<a-form
|
||||
ref="formRef"
|
||||
name="custom-validation"
|
||||
:model="state"
|
||||
:rules="rules"
|
||||
v-bind="layout"
|
||||
@finish="handleFinish"
|
||||
@validate="handleValidate"
|
||||
@finishFailed="handleFinishFailed"
|
||||
>
|
||||
<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>
|
||||
<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>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
<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="inputV2"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入链接"
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">链接:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="inputV2"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入链接"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">外链说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="textV1"
|
||||
placeholder="请输入外链说明"
|
||||
allow-clear
|
||||
/>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">外链说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="textV1"
|
||||
placeholder="请输入外链说明"
|
||||
allow-clear
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-form>
|
||||
<div class="main_btns">
|
||||
<button class="btn1" @click="closeDrawer">取消</button>
|
||||
@@ -114,7 +122,8 @@ export default {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
edit: { // 是否为编辑
|
||||
edit: {
|
||||
// 是否为编辑
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
@@ -130,12 +139,14 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -146,8 +157,7 @@ export default {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
@@ -164,115 +174,120 @@ export default {
|
||||
state.inputV2 = "";
|
||||
state.inputV1 = "";
|
||||
state.textV1 = "";
|
||||
// ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
|
||||
if(props.edit){
|
||||
|
||||
if (props.edit) {
|
||||
queryRef();
|
||||
}
|
||||
|
||||
};
|
||||
const handleFinish = values => {
|
||||
const handleFinish = (values) => {
|
||||
console.log(values);
|
||||
//updateRef(props.EditRefId)
|
||||
};
|
||||
const handleFinishFailed = errors => {
|
||||
const handleFinishFailed = (errors) => {
|
||||
console.log(errors);
|
||||
// message.error("handleFinishFailed");
|
||||
};
|
||||
const updateTask =(res)=>{
|
||||
|
||||
if(props.isLevel ==1){
|
||||
const updateTask = (res) => {
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.linkId,
|
||||
name: res.data.data.linkName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 7,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
}else if(props.isLevel ==2){
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.linkId,
|
||||
name: res.data.data.linkName,
|
||||
routerId: props.routerId,
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 7,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
} else if (props.isLevel == 2) {
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId:res.data.data.linkId,
|
||||
name: res.data.data.linkName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 7,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
}else if(props.isLevel ==3){
|
||||
.addTask({
|
||||
courseId: res.data.data.linkId,
|
||||
name: res.data.data.linkName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
stageId: props.chooseStageId,
|
||||
type: 7,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
} else if (props.isLevel == 3) {
|
||||
console.log("");
|
||||
}
|
||||
}
|
||||
};
|
||||
//创建外链
|
||||
const updateRef = () => {
|
||||
if (!state.inputV1) return message.warning("请输入外链名称");
|
||||
if (!state.inputV2){
|
||||
if (!state.inputV2) {
|
||||
return message.warning("请输入链接");
|
||||
}else{
|
||||
const reg = /(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
||||
if ((!reg.test(state.inputV2)) && state.inputV2 != '') {
|
||||
} else {
|
||||
const reg =
|
||||
/(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
||||
if (!reg.test(state.inputV2) && state.inputV2 != "") {
|
||||
return message.warning("请输入合法的链接地址");
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
linkAddress: state.inputV2,
|
||||
linkDescription: state.textV1,
|
||||
linkId:props.edit?props.EditRefId:0,
|
||||
linkName: state.inputV1,
|
||||
linkId: props.edit ? props.EditRefId : 0,
|
||||
linkName: state.inputV1,
|
||||
};
|
||||
console.log("编辑的id========",props.EditRefId)
|
||||
if(props.edit){
|
||||
console.log("编辑的id========", props.EditRefId);
|
||||
if (props.edit) {
|
||||
api
|
||||
.updateLinks(obj)
|
||||
.then((res) => {
|
||||
message.success("编辑成功");
|
||||
updateTask(res);
|
||||
}).catch((err) => console.log(err));
|
||||
}else{
|
||||
.updateLinks(obj)
|
||||
.then((res) => {
|
||||
message.success("编辑成功");
|
||||
updateTask(res);
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
} else {
|
||||
api
|
||||
.createExternalChain(obj)
|
||||
.then((res) => {
|
||||
message.success("提交成功");
|
||||
updateTask(res);
|
||||
}).catch((err) => console.log(err));
|
||||
.createExternalChain(obj)
|
||||
.then((res) => {
|
||||
message.success("提交成功");
|
||||
updateTask(res);
|
||||
})
|
||||
.catch((err) => console.log(err));
|
||||
}
|
||||
|
||||
};
|
||||
// 查询任务
|
||||
// 查询任务
|
||||
const queryRef = () => {
|
||||
let d =props.EditRefId ;
|
||||
let d = props.EditRefId;
|
||||
api
|
||||
.getLink({linkId:d}).then((res) => {
|
||||
// console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD"));
|
||||
state.inputV1 = res.data.data.linkName;
|
||||
state.inputV2 =res.data.data.linkAddress;
|
||||
state.textV1 =res.data.data.linkDescription;
|
||||
console.log("查询成功=====inputv1",state.inputV1);
|
||||
}).catch(() => {
|
||||
message.error(`查询失败`)
|
||||
})
|
||||
.getLink({ linkId: d })
|
||||
.then((res) => {
|
||||
// console.log(dayjs(res.data.data.submitStartTime).format("YYYY-MM-DD"));
|
||||
state.inputV1 = res.data.data.linkName;
|
||||
state.inputV2 = res.data.data.linkAddress;
|
||||
state.textV1 = res.data.data.linkDescription;
|
||||
console.log("查询成功=====inputv1", state.inputV1);
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`查询失败`);
|
||||
});
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
@@ -314,7 +329,7 @@ export default {
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
margin-top:32px;
|
||||
margin-top: 32px;
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -135,17 +135,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<a-drawer
|
||||
v-model:visible="voteDrawerShow"
|
||||
class="custom-class"
|
||||
title="创建投票"
|
||||
placement="right"
|
||||
@after-visible-change="afterVoteVisibleChange"
|
||||
>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
</a-drawer>
|
||||
<a-drawer
|
||||
v-model:visible="voteDrawerShow"
|
||||
class="custom-class"
|
||||
title="创建投票"
|
||||
placement="right"
|
||||
@after-visible-change="afterVoteVisibleChange"
|
||||
>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
<p>Some contents...</p>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
@@ -159,10 +159,13 @@ export default {
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
voteDrawerShow:false,
|
||||
voteDrawerShow: false,
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
|
||||
const afterVisibleChange = (bool) => {
|
||||
@@ -175,10 +178,8 @@ export default {
|
||||
|
||||
const showVoteDrawer = () => {
|
||||
state.voteDrawerShow = true;
|
||||
}
|
||||
const afterVoteVisibleChange = () => {
|
||||
|
||||
};
|
||||
const afterVoteVisibleChange = () => {};
|
||||
return {
|
||||
...toRefs(state),
|
||||
afterVisibleChange,
|
||||
@@ -186,7 +187,7 @@ export default {
|
||||
closeDrawer,
|
||||
// change,
|
||||
showVoteDrawer,
|
||||
afterVoteVisibleChange
|
||||
afterVoteVisibleChange,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</button>
|
||||
<div :style="{ display: creVote ? 'block' : 'none' }">
|
||||
<div class="fileTigan">
|
||||
<span style="color: #388be1">{{ballotName}}</span>
|
||||
<span style="color: #388be1">{{ ballotName }}</span>
|
||||
<div class="delBox" @click="dleVoteStem()"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -128,7 +128,7 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs} from "vue";
|
||||
import { reactive, toRefs } from "vue";
|
||||
import CreVote from "./CreVote.vue";
|
||||
import * as api from "../../api/indexVote";
|
||||
import { message } from "ant-design-vue";
|
||||
@@ -136,7 +136,6 @@ import { RouterEditTask } from "@/api/indexTask";
|
||||
import dayjs from "dayjs";
|
||||
import * as apiTask from "../../api/indexTaskadd";
|
||||
|
||||
|
||||
export default {
|
||||
name: "AddVote",
|
||||
components: {
|
||||
@@ -167,11 +166,13 @@ export default {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
isLevel: { // 是否是关卡页面触发
|
||||
isLevel: {
|
||||
// 是否是关卡页面触发
|
||||
type: Boolean,
|
||||
default: null,
|
||||
},
|
||||
projectTaskId: { // 要编辑的projectId
|
||||
projectTaskId: {
|
||||
// 要编辑的projectId
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
@@ -182,9 +183,7 @@ export default {
|
||||
isactive: {
|
||||
type: Number,
|
||||
default: null,
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
@@ -192,37 +191,40 @@ export default {
|
||||
textV1: "",
|
||||
crevotevisible: false,
|
||||
time: undefined,
|
||||
startTime:"",
|
||||
endTime:"",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
basevote: "",
|
||||
ascriptionId: "",
|
||||
voteStemId: null,
|
||||
voteId:"",
|
||||
voteStemName:"",
|
||||
voteId: "",
|
||||
voteStemName: "",
|
||||
ballotName: "",
|
||||
editStem: false, //编辑状态
|
||||
editStem: false, //编辑状态
|
||||
ballotId: 0, //题干id
|
||||
optionId: "", //删除,修改选项id
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
state.inputV1 = "",
|
||||
state.textV1 = "",
|
||||
state.time = undefined,
|
||||
state.basevote = "",
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
(state.inputV1 = ""),
|
||||
(state.textV1 = ""),
|
||||
(state.time = undefined),
|
||||
(state.basevote = ""),
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
ctx.emit("changeData", false);
|
||||
localStorage.setItem("stageId", props.chooseStageId);
|
||||
localStorage.setItem("chapterId", props.isactive);
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
console.log("state", bool);
|
||||
queryVoteInfo();
|
||||
queryVoteInfo();
|
||||
};
|
||||
const showDrawerCreVote = () => {
|
||||
state.crevotevisible = true;
|
||||
};
|
||||
const getStemId = (data) => {
|
||||
state.ballotName = data.ballotName;
|
||||
state.ballotId =data.ballotId;
|
||||
}
|
||||
state.ballotId = data.ballotId;
|
||||
};
|
||||
|
||||
const delBox = () => {
|
||||
state.creVote = false;
|
||||
@@ -231,19 +233,18 @@ export default {
|
||||
//删除题干信息接口
|
||||
const dleVoteStem = () => {
|
||||
let objdelstem = {
|
||||
voteStemId:state.voteStemId
|
||||
}
|
||||
api.deleteVoteStem(objdelstem)
|
||||
.then((res) => {
|
||||
console.log('删除题干信息成功', res)
|
||||
message.success('删除题干信息成功')
|
||||
delBox()
|
||||
})
|
||||
}
|
||||
voteStemId: state.voteStemId,
|
||||
};
|
||||
api.deleteVoteStem(objdelstem).then((res) => {
|
||||
console.log("删除题干信息成功", res);
|
||||
message.success("删除题干信息成功");
|
||||
delBox();
|
||||
});
|
||||
};
|
||||
|
||||
//根据投票id获取投票信息
|
||||
const queryVoteInfo = ()=>{
|
||||
/**
|
||||
const queryVoteInfo = () => {
|
||||
/**
|
||||
let obj = {
|
||||
voteId:props.voteId
|
||||
}
|
||||
@@ -261,10 +262,9 @@ export default {
|
||||
console.log('获取投票信息失败',err);
|
||||
})
|
||||
**/
|
||||
|
||||
}
|
||||
const updateToTask =(res)=>{
|
||||
if(props.isLevel){
|
||||
};
|
||||
const updateToTask = (res) => {
|
||||
if (props.isLevel) {
|
||||
RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.data.data.voteId,
|
||||
@@ -275,17 +275,17 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res, 11111);
|
||||
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
ctx.emit("changeData", false);
|
||||
state.addLoading = false;
|
||||
state.addLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 1111);
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
apiTask
|
||||
.addTask({
|
||||
courseId:res.data.data.voteId,
|
||||
courseId: res.data.data.voteId,
|
||||
name: res.data.data.voteName,
|
||||
projectId: props.projectId,
|
||||
projectTaskId: props.projectTaskId || 0,
|
||||
@@ -294,13 +294,13 @@ export default {
|
||||
})
|
||||
.then((res) => {
|
||||
console.log("调用项目添加接口后111", res.data, 11111);
|
||||
ctx.emit("changeData", false);
|
||||
ctx.emit("changeData", false);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, 111111);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
//修改投票信息接口
|
||||
const updateVoteInfo = () => {
|
||||
if (!state.inputV1) {
|
||||
@@ -311,48 +311,47 @@ export default {
|
||||
if (state.basevote == "") {
|
||||
state.basevote = 1;
|
||||
}
|
||||
if(state.time != undefined){
|
||||
if (state.time != undefined) {
|
||||
state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD");
|
||||
state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD");
|
||||
}
|
||||
|
||||
let obj = {
|
||||
voteId: props.edit?state.voteId : 0,
|
||||
voteId: props.edit ? state.voteId : 0,
|
||||
voteName: state.inputV1,
|
||||
voteStartTime: state.startTime,
|
||||
voteEndTime: state.endTime,
|
||||
ballotId: state.ballotId,
|
||||
baseVote: state.basevote,
|
||||
voteExplain: state.textV1,
|
||||
createUser:0,
|
||||
updateUser:0,
|
||||
voteTag:"",
|
||||
}
|
||||
if(props.edit){
|
||||
voteExplain: state.textV1,
|
||||
createUser: 0,
|
||||
updateUser: 0,
|
||||
voteTag: "",
|
||||
};
|
||||
if (props.edit) {
|
||||
api
|
||||
.editVote(obj)
|
||||
.then((res) => {
|
||||
updateToTask(res);
|
||||
closeDrawer();
|
||||
console.log('修改投票信息成功', res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('修改投票信息失败', err);
|
||||
})
|
||||
}else{
|
||||
.editVote(obj)
|
||||
.then((res) => {
|
||||
updateToTask(res);
|
||||
closeDrawer();
|
||||
console.log("修改投票信息成功", res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("修改投票信息失败", err);
|
||||
});
|
||||
} else {
|
||||
api
|
||||
.createVote(obj)
|
||||
.then((res) => {
|
||||
updateToTask(res);
|
||||
closeDrawer();
|
||||
console.log('创建投票信息成功', res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log('创建投票信息失败', err);
|
||||
})
|
||||
.createVote(obj)
|
||||
.then((res) => {
|
||||
updateToTask(res);
|
||||
closeDrawer();
|
||||
console.log("创建投票信息成功", res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("创建投票信息失败", err);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
showDrawerCreVote,
|
||||
@@ -363,7 +362,6 @@ export default {
|
||||
dleVoteStem,
|
||||
updateVoteInfo,
|
||||
delBox,
|
||||
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user