fix:修改添加作业接口判断

This commit is contained in:
lixg
2022-12-20 15:59:23 +08:00
parent e1e0622296
commit 22356826b8
7 changed files with 289 additions and 257 deletions

View File

@@ -179,41 +179,7 @@ function throttle(fn, delay = 200) {
};
}
//把token存到cookie
//name 字段名 value 字段值 perpetual 有效期
const setCookie = (name, value, perpetual) => {
console.log('存储token到cookie')
let exdate = new Date()
exdate.setDate(perpetual * 24 * 60 * 60 * 1000) //exdate.setDate(exdate.getDate() + 365)
document.cookie = `${name}=${value};expires=${exdate.toGMTString()};path=/`
//永久有效
//document.cookie = name + '=' + value + ';expires=' + 'Fri, 31 Dec 9999 23:59:59 GMT'
}
//获取cookie数据
//先写一个方法
function getCookie(name) {
return document.cookie?.split(";").find(e => e.includes(name)).replace(`${name}=`, '') || ''
//1.获取cookie字符串
// const cookies = document.cookie;
// console.log('cookies',cookies)
// //通过;来分割字符串
// const cookie = cookies.split(";");
// // console.log('cookie', cookie)
// //遍历,使键值对匹配上
// for (var i = 0; i < cookie.length; i++) {
// var arr = cookie[i].split("token=");
// // console.log('arr', arr)
// console.log('name', name)
// // if (arr[0] == name) {
// // console.log('arr[1]', arr[1])
// // return arr[1];
// // }
// // console.log('arr[1]', arr[1])
// return arr[1]
// }
// return "";
}
//滚动加载信息
@@ -288,8 +254,7 @@ export {
getWeek,
autoComma,
formatNumber,
setCookie,
getCookie,
scrollLoad,
changeOwnership,
commonData,

View File

@@ -122,6 +122,20 @@ export default {
},
];
}
if (
n.indexOf("/projectadd?projectId") !== -1 ||
n.indexOf("/ProjectAdd?projectId") !== -1
) {
state.list = [
{
name: "项目",
href: "/projectmanage",
},
{
name: "编辑项目",
},
];
}
if (n.indexOf("/taskpage") !== -1 || n.indexOf("/TaskPage") !== -1) {
state.list = [
{

View File

@@ -127,6 +127,16 @@ export default {
localStorage.removeItem("pathmapPic");
localStorage.removeItem("projectClass");
localStorage.removeItem("projectPic");
localStorage.removeItem("routerId");
localStorage.removeItem("selectedKeys");
localStorage.removeItem("openKeys");
localStorage.removeItem("stageId");
localStorage.removeItem("openpages");
localStorage.removeItem("memberInitInfo");
localStorage.removeItem("projectId");
localStorage.removeItem("projectTemplateId");
localStorage.removeItem("orgtreeList");
window.open("https://u-pre.boe.com/web/", "_self");
};
return {

View File

@@ -31,12 +31,12 @@
<div class="btnbox">
<a-form-item has-feedback label="作业名称" name="workName">
<a-input
v-model:value="formState.workName"
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入作业名称"
autocomplete="off"
show-count :maxlength="20"
show-count
:maxlength="20"
/>
</a-form-item>
</div>
@@ -47,7 +47,7 @@
<a-form-item has-feedback label="提交时间" name="choosedTime">
<a-range-picker
show-time
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
v-model:value="formState.choosedTime"
format="YYYY/MM/DD HH:mm"
:placeholder="[' 开始时间', ' 结束时间']"
@@ -58,16 +58,16 @@
<div class="main_item2">
<a-form-item has-feedback label="作业要求" name="workRequirement">
<div class="textarea">
<a-textarea
v-model:value="formState.workRequirement"
placeholder="请输入作业要求"
autocomplete="off"
allow-clear
:rows="6"
show-count :maxlength="200"
/></div>
show-count
:maxlength="200"
/>
</div>
</a-form-item>
</div>
<div class="main_item">
@@ -159,7 +159,7 @@ export default {
type: Number,
default: null,
},
workName:{
workName: {
type: String,
default: null,
},
@@ -256,16 +256,39 @@ export default {
const resetForm = () => {
// formRef.value.resetFields();
formState.workName = ''
formState.workRequirement = ''
formState.choosedTime = []
formState.workName = "";
formState.workRequirement = "";
formState.choosedTime = [];
};
const handleValidate = (...args) => {
console.log(args);
};
const beforeUpload = (file) => {
console.log("file", file);
const isJpgOrPng =
file.name.indexOf(".pdf") === -1 &&
file.name.indexOf(".ppt") === -1 &&
file.name.indexOf(".pptx") === -1 &&
file.name.indexOf(".doc") === -1 &&
file.name.indexOf(".docx") === -1 &&
file.name.indexOf(".xls") === -1 &&
file.name.indexOf(".xlsx") === -1 &&
file.name.indexOf(".jpg") === -1 &&
file.name.indexOf(".jpeg") === -1 &&
file.name.indexOf(".png") === -1 &&
file.name.indexOf(".gif") === -1 &&
file.name.indexOf(".zip") === -1;
// console.log("isJpgOrPng", isJpgOrPng);
return isJpgOrPng;
};
const handleChange = (info) => {
console.log("info", info);
const isfileformat = beforeUpload(info.file);
if (isfileformat) {
fileList.value = [];
message.destroy();
return message.error("请上传正确格式附件");
}
if (info.file.status !== "uploading") {
console.log(info.file, info.fileList);
// state.workEnclosureAddress = info.fileList[0].response.data;
@@ -315,11 +338,11 @@ export default {
// 重置表单选项
const afterVisibleChange = () => {
console.log('11223344', props.EditWorkId)
console.log("11223344", props.EditWorkId);
if (props.EditWorkId > 0) {
state.EditWorkId = props.EditWorkId;
queryWork();
}else{
} else {
formRef.value.resetFields();
resetForm();
}
@@ -328,8 +351,12 @@ export default {
// 新增任务
const updteHomeWork = () => {
let obj = {
submitEndTime: dayjs(formState.choosedTime[1]).format("YYYY-MM-DD HH:mm"),
submitStartTime: dayjs(formState.choosedTime[0]).format("YYYY-MM-DD HH:mm"),
submitEndTime: dayjs(formState.choosedTime[1]).format(
"YYYY-MM-DD HH:mm"
),
submitStartTime: dayjs(formState.choosedTime[0]).format(
"YYYY-MM-DD HH:mm"
),
workEnclosureAddress: state.workEnclosureAddress
? state.workEnclosureAddress
: "",
@@ -339,7 +366,7 @@ export default {
};
if (props.EditWorkId > 0) {
updateWorkTaskUsing(obj)
.then(async(res) => {
.then(async (res) => {
// console.log("添加成功", res);
await updateTask(res);
ctx.emit("changeData", false);
@@ -351,7 +378,7 @@ export default {
});
} else {
createWorkTask(obj)
.then(async(res) => {
.then(async (res) => {
console.log("添加成功", res);
await updateTask(res);
ctx.emit("changeData", false);
@@ -369,12 +396,12 @@ export default {
state.addLoading = true;
queryWorkDetailById({ workId: props.EditWorkId })
.then((res) => {
console.log(res)
try{
fileList.value = JSON.parse(res.data.data.workEnclosureAddress)
}catch(e){
console.log(e)
fileList.value = []
console.log(res);
try {
fileList.value = JSON.parse(res.data.data.workEnclosureAddress);
} catch (e) {
console.log(e);
fileList.value = [];
}
formState.workName = res.data.data.workName;
formState.workRequirement = res.data.data.workRequirement;
@@ -394,7 +421,7 @@ export default {
state.EditWorkId = res.data.data.workId;
} else {
if (props.isLevel == 1) {
if(!props.isactive){
if (!props.isactive) {
message.destroy();
return message.warning("请先选中关卡");
}

View File

@@ -32,7 +32,7 @@
<div class="btnbox">
<a-input
v-model:value="inputV1"
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入直播名称"
:maxlength="20"
/>
@@ -51,7 +51,7 @@
<div class="btnbox">
<a-input
v-model:value="inputV4"
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入直播链接"
:maxlength="100"
/>
@@ -71,7 +71,7 @@
<div class="btnbox">
<a-range-picker
show-time
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
v-model:value="time"
format="YYYY/MM/DD HH:mm"
:placeholder="[' 开始时间', ' 结束时间']"
@@ -93,7 +93,7 @@
:min="0"
:max="300"
:precision="0"
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
v-model:value="inputV2"
></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span>
@@ -109,7 +109,7 @@
</div>
<span style="margin-right: 3px">授课老师</span>
</div>
<div class="select" style="width: 400px;" >
<div class="select" style="width: 400px">
<ProjectManager
v-model:value="memberValue.value"
v-model:name="memberValue.label"
@@ -148,8 +148,11 @@
</div>
</a-upload>
<div class="i_bottom">
<div class="tip"> <span style="color: #999999; margin-left: 8px">支持图片格式为jpg/jpeg/png 图片最大为2MB</span></div>
<div class="tip">
<span style="color: #999999; margin-left: 8px"
>支持图片格式为jpg/jpeg/png 图片最大为2MB</span
>
</div>
</div>
</div>
</div>
@@ -191,7 +194,7 @@
<div class="btnbox">
<a-input
v-model:value="inputV5"
style="width: 400px; height: 40px; border-radius: 8px;"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入回放链接"
:maxlength="100"
/>
@@ -199,7 +202,6 @@
</div>
</div>
<div class="main_item2">
<div class="signbox">
<span style="margin-right: 3px">直播说明</span>
@@ -216,7 +218,6 @@
</div>
</div>
<div class="main_item2">
<div class="signbox">
<span style="margin-right: 3px">考勤设置</span>
@@ -242,7 +243,9 @@
"
v-model:value="inputV6"
></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟允许签到</span>
<span style="color: #999999; margin-left: 8px"
>分钟允许签到</span
>
</div>
<div class="timerbox">
<span>直播开始后</span>
@@ -258,7 +261,9 @@
"
v-model:value="inputV7"
></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟允许签到</span>
<span style="color: #999999; margin-left: 8px"
>分钟允许签到</span
>
</div>
</div>
<!-- <div class="qdqtbox">
@@ -286,7 +291,7 @@
</div> -->
</div>
</div>
<!--
<!--
<div class="main_item">
<div class="signbox">
<span style="margin-right: 3px">完成标准设置</span>
@@ -347,13 +352,11 @@
/>
</div>
</div>
<div class="main_item" style="height:30px;">
<div class="main_item" style="height: 30px">
<div class="signbox">
<span style="margin-right: 3px"></span>
</div>
<div class="btnbox">
</div>
<div class="btnbox"></div>
</div>
</div>
</div>
@@ -473,7 +476,7 @@ export default {
switchC1: "",
checkedC1: false,
checkedC2: false,
liveNotice :null,
liveNotice: null,
assessmentId: null,
obj: {}, //要传的obj数据
assessment: [], //评估信息
@@ -503,9 +506,9 @@ export default {
state.needEval = false;
state.switchC2 = false;
state.assessmentId = null;
state.liveNotice =null;
state.liveTeacherId=null;
state.memberValue={};
state.liveNotice = null;
state.liveTeacherId = null;
state.memberValue = {};
ctx.emit("changeData", false);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
@@ -565,8 +568,10 @@ export default {
value: res.data.data.liveTeacherId || "",
label: res.data.data.liveTeacherName || "",
};
queryAppraiseDetailById({assessmentId:res.data.data.assessmentId}).then((res)=>{
state.assessmentName =res.data.data.assessmentName;
queryAppraiseDetailById({
assessmentId: res.data.data.assessmentId,
}).then((res) => {
state.assessmentName = res.data.data.assessmentName;
});
})
.catch(() => {
@@ -584,6 +589,7 @@ export default {
console.log("info", info);
return;
}
if (info.file.status === "done") {
// Get this url from response in real world.
getBase64(info.file.originFileObj, (base64Url) => {
@@ -600,7 +606,7 @@ export default {
};
const updateTask = (res) => {
if (props.isLevel == 1) {
if(!props.isactive){
if (!props.isactive) {
message.destroy();
return message.warning("请先选中关卡");
}
@@ -718,7 +724,7 @@ export default {
liveEndTime: endTime,
liveStartTime: startTime,
liveExplain: state.textV1,
liveNotice:state.liveNotice,
liveNotice: state.liveNotice,
liveFlag: "",
liveId: props.edit ? Number(props.EditLiveId) : 0,
liveLink: state.inputV4,
@@ -1017,7 +1023,6 @@ export default {
}
.setbox {
flex-wrap: wrap;
margin-top: 10px;
margin-bottom: 6px;

View File

@@ -1,6 +1,10 @@
<template>
<div>
<a-row type="flex" gutter="12" style="padding-left: 20px">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col>
<a-form-item title="姓名:" @click="getStuList">
<a-input
@@ -23,12 +27,15 @@
<a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset"
>重置
</a-button
>
</a-button>
</a-col>
</a-row>
<a-row type="flex" gutter="12" style="padding-left: 20px">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col :span="1.5">
<CommonStudent
:type="type"
@@ -97,8 +104,8 @@
</div>
</template>
<script setup>
import {computed, defineProps, onMounted, ref, watch} from "vue";
import {delStudentList, getStuPage} from "@/api/index1";
import { computed, defineProps, onMounted, ref, watch } from "vue";
import { delStudentList, getStuPage } from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent";
const props = defineProps({
@@ -135,7 +142,7 @@ const tablecolumns = ref([
title: "部门",
dataIndex: "studentDepartName",
key: "studentDepartName",
width: "20%",
width: "15%",
align: "center",
className: "h",
ellipsis: true,
@@ -144,19 +151,19 @@ const tablecolumns = ref([
title: "加入方式",
dataIndex: "source",
key: "source",
width: "20%",
width: 100,
align: "center",
customRender: ({record: {source}}) =>
({1: "快速添加", 2: "组织", 3: "受众"}[source]),
customRender: ({ record: { source } }) =>
({ 1: "快速添加", 2: "组织", 3: "受众" }[source]),
},
...props.columns,
{
title: "操作",
dataIndex: "operation",
key: "operation",
width: "25%",
width: "20%",
align: "center",
slots: {customRender: "action"},
slots: { customRender: "action" },
},
]);
const tableParam = ref({
@@ -185,9 +192,9 @@ onMounted(() => {
});
watch(props, () => {
tableParam.value.pid= props.id
tableParam.value.pid = props.id;
getStuList();
})
});
function onStuSelectChange(e) {
stuSelectKeys.value = e;
@@ -216,8 +223,7 @@ function getStuList() {
});
}
function reset() {
}
function reset() {}
function bathDel() {
stuSelectKeys.value &&

View File

@@ -506,7 +506,12 @@
</div>
</a-tab-pane>
<a-tab-pane key="3" tab="学员管理" force-render>
<TableStudent :type="2" :id="routerId" :stage="stage"></TableStudent>
<TableStudent
:type="2"
:id="routerId"
:stage="stage"
:columns="tableDataFunc()"
></TableStudent>
</a-tab-pane>
<!--1211注释 待开放
<a-tab-pane key="4" tab="设置">
@@ -1332,49 +1337,49 @@ export default {
const tableDataFunc = () => {
const columns = [
{
title: "姓名",
dataIndex: "name",
// width: "30%",
key: "name",
width: 110,
align: "left",
className: "classify",
scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => {
// console.log(text.record.checked1);
return (
<div class="racona">
<span> {text.record.name}</span>
{/**
<div class="img"></div>
<a-checkbox class="ch" checked={text.record.checkedd}>
{text.record.lei}
</a-checkbox>
*/}
</div>
);
},
},
{
title: "部门",
dataIndex: "com",
// width: "30%",
key: "com",
width: 110,
align: "center",
className: "h",
},
// {
// title: "岗位",
// dataIndex: "gang",
// key: "gang",
// title: "姓名",
// dataIndex: "name",
// // width: "30%",
// key: "name",
// width: 110,
// align: "left",
// className: "classify",
// scopedSlots: { customRender: "action" }, //引入的插槽
// customRender: (text) => {
// // console.log(text.record.checked1);
// return (
// <div class="racona">
// <span> {text.record.name}</span>
// {/**
// <div class="img"></div>
// <a-checkbox class="ch" checked={text.record.checkedd}>
// {text.record.lei}
// </a-checkbox>
// */}
// </div>
// );
// },
// },
// {
// title: "部门",
// dataIndex: "com",
// // width: "30%",
// key: "com",
// width: 110,
// align: "center",
// className: "h",
// },
// // {
// // title: "岗位",
// // dataIndex: "gang",
// // key: "gang",
// // width: 110,
// // align: "center",
// // className: "h",
// // },
{
title: "当前关卡",
dataIndex: "cur",
@@ -1391,64 +1396,64 @@ export default {
align: "center",
className: "h",
},
{
title: "开始时间",
dataIndex: "time",
key: "time",
width: 120,
align: "center",
className: "h",
},
{
title: "操作",
className: "h",
dataIndex: "opacation",
key: "opacation",
width: 140,
align: "center",
fixed: "right",
scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => {
return (
<div class="opa">
<div class="opacation">
{/**
2022-11-30注释 后面放开
<span
onClick={() => {
showCheckStu(text.record.studentId);
state.Seevisible = true;
}}
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
>
查看
</span>
*/}
{/**
2022-11-30注释 后面放开
<span
onClick={() => {
state.visiblene = true;
console.log(text.record.cur);
}}
style="color:#4EA6FF;margin-right:25px;cursor:pointer"
>
调整
</span>
*/}
<span
style="color:#4EA6FF;cursor:pointer"
onClick={() => {
delConfirm(text.record.studentId);
}}
>
删除
</span>
</div>
</div>
);
},
},
// {
// title: "开始时间",
// dataIndex: "time",
// key: "time",
// width: 120,
// align: "center",
// className: "h",
// },
// {
// title: "操作",
// className: "h",
// dataIndex: "opacation",
// key: "opacation",
// width: 140,
// align: "center",
// fixed: "right",
// scopedSlots: { customRender: "action" }, //引入的插槽
// customRender: (text) => {
// return (
// <div class="opa">
// <div class="opacation">
// {/**
// 2022-11-30注释 后面放开
// <span
// onClick={() => {
// showCheckStu(text.record.studentId);
// state.Seevisible = true;
// }}
// style="color:#4EA6FF;margin-right:25px;cursor:pointer"
// >
// 查看
// </span>
// */}
// {/**
// 2022-11-30注释 后面放开
// <span
// onClick={() => {
// state.visiblene = true;
// console.log(text.record.cur);
// }}
// style="color:#4EA6FF;margin-right:25px;cursor:pointer"
// >
// 调整
// </span>
// */}
// <span
// style="color:#4EA6FF;cursor:pointer"
// onClick={() => {
// delConfirm(text.record.studentId);
// }}
// >
// 删除
// </span>
// </div>
// </div>
// );
// },
// },
];
return columns;
};