fix:修改开课时间搜索

This commit is contained in:
lixg
2022-12-09 14:22:39 +08:00
parent e99c9f1749
commit c853af3316
4 changed files with 172 additions and 119 deletions

View File

@@ -56,7 +56,10 @@
<div class="onerow">
<div class="taskmain">任务大纲</div>
<!-- <button class="btn" @click="showFaceIn">批量面授报名</button> -->
<router-link class="edit" :to="{ path: `/temTask`, query: { projectId: projectId } }">
<router-link
class="edit"
:to="{ path: `/temTask`, query: { projectId: projectId } }"
>
<img
class="editimg"
src="../../assets/images/projectadd/edit.png"
@@ -147,7 +150,9 @@
</div>
<div>
<div class="iconame">{{ item.course }}</div>
<div class="icontext">{{ item.name }}</div>
<div class="icontext" :title="item.name">
{{ item.name }}
</div>
</div>
</div>
<div class="type">
@@ -279,52 +284,47 @@
<div class="ntc_body">
<div class="ntc_switch">
<a-switch
size="small"
v-model:checked="checked"
@click="changeopclo"
size="small"
v-model:checked="checked"
@click="changeopclo"
/>
<div v-if="(checked==true)"
class="opclo">
<div v-if="checked == true" class="opclo">
<span>关闭</span>
</div>
<div v-if="(checked==false)"
class="opclo" >
<div v-if="checked == false" class="opclo">
<span>开启</span>
</div>
</div>
<div v-if="(checked==true)"
class="ntc_content">
<div class="ntcc_tit">当前公告内容</div>
<div v-if="checked == true" class="ntc_content">
<div class="ntcc_tit">当前公告内容</div>
<div class="textarea">
{{noticeContent==""?"暂无公告":noticeContent}}
<div v-if="(editFlag == false)" class="btnarea" >
{{ noticeContent == "" ? "暂无公告" : noticeContent }}
<div v-if="editFlag == false" class="btnarea">
<div>&nbsp;</div>
<div class="area_btn" @click="editNotice">
<div class="btnText">编辑</div>
</div>
</div>
</div>
<template v-if="(editFlag==true)">
<div>&nbsp;</div>
<div class="ntcc_tit" >编辑公告</div>
<div class="textarea">
<a-textarea
<template v-if="editFlag == true">
<div>&nbsp;</div>
<div class="ntcc_tit">编辑公告</div>
<div class="textarea">
<a-textarea
v-model:value="projectInfo.notice"
placeholder="公告信息最多输入150个字。"
:maxlength="textnum"
allow-clear
/>
<div class="btnarea">
<div>&nbsp;</div>
<div class="area_btn" @click="addNotice">
<div class="pub"></div>
<div class="btnText">发布</div>
/>
<div class="btnarea">
<div>&nbsp;</div>
<div class="area_btn" @click="addNotice">
<div class="pub"></div>
<div class="btnText">发布</div>
</div>
</div>
</div>
</div>
</template>
</div>
</div>
@@ -592,7 +592,10 @@
<div class="box"></div>
<div class="onetitle">上传共享文档</div>
<div class="oneedi">
<a-switch v-model:checked="attachSwitch" @change="checkedClose"></a-switch>
<a-switch
v-model:checked="attachSwitch"
@change="checkedClose"
></a-switch>
</div>
</div>
<div class="btnbox" style="margin: 20px">
@@ -844,8 +847,8 @@ export default defineComponent({
seven1: null,
seven2: null,
edit: true,
fileList:[],
attachSwitch:true,
fileList: [],
attachSwitch: true,
// 共享文档列表
docList: [
{
@@ -863,17 +866,17 @@ export default defineComponent({
],
isEdit: false, // 是否处于编辑状态
// 基本信息
projectInfo: { },
noticeContent:"",
editFlag:false,
projectInfo: {},
noticeContent: "",
editFlag: false,
});
const value = ref("");
const textnum = "150";
const routered = useRouter();
const changeopclo = () => {
state.projectInfo.noticeFlag = state.checked?1:0;
state.projectInfo.noticeFlag = state.checked ? 1 : 0;
api
.templateEdit( state.projectInfo)
.templateEdit(state.projectInfo)
.then((res) => {
console.log(res);
})
@@ -913,9 +916,9 @@ export default defineComponent({
state.isEdit = false;
getDetail();
};
const editNotice =()=>{
state.editFlag = true ;
}
const editNotice = () => {
state.editFlag = true;
};
const checkType = (type) => {
let typeRules = [
@@ -944,30 +947,39 @@ export default defineComponent({
api
.templateDetail(localStorage.getItem("projectTemplateId"))
.then((res) => {
console.log("get model list ----->", res, res.data.data.stageList);
console.log("get model list ----->", res, res.data.data.stageList);
state.taskSyllabus = [];
console.log(res);
state.projectInfo = res.data.data.projectTemplateInfo;
state.noticeContent = state.projectInfo.notice;
state.checked = state.projectInfo.noticeFlag==1?true:false;
console.log("res.data.data.projectTemplateInfo",res.data.data.projectTemplateInfo);
try{
state.fileList = JSON.parse(res.data.data.projectTemplateInfo.attach);
}catch{
state.noticeContent = state.projectInfo.notice;
state.checked = state.projectInfo.noticeFlag == 1 ? true : false;
console.log(
"res.data.data.projectTemplateInfo",
res.data.data.projectTemplateInfo
);
try {
state.fileList = JSON.parse(
res.data.data.projectTemplateInfo.attach
);
} catch {
state.fileList = [];
}
state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false
state.attachSwitch =
res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false;
let data = res.data.data.stageList;
console.log("data=====", data);
for (let i in data) {
console.log("what ------ > ", i, data);
if(data[i].taskList.length!==0){
state.taskSyllabus.push({ text: data[i].name?data[i].name:'无阶段任务', children: [] });
if (data[i].taskList.length !== 0) {
state.taskSyllabus.push({
text: data[i].name ? data[i].name : "无阶段任务",
children: [],
});
}
for (let j in data[i].taskList) {
state.taskSyllabus[i].children.push({
course: checkType(data[i].taskList[j].type),
@@ -987,14 +999,14 @@ export default defineComponent({
});
};
// 发布公告
const addNotice = () => {
// state.projectInfo.notice=
if(!state.projectInfo.notice){
return message.warning("请输入公告内容");
}
// 发布公告
const addNotice = () => {
// state.projectInfo.notice=
if (!state.projectInfo.notice) {
return message.warning("请输入公告内容");
}
api
.templateEdit( state.projectInfo)
.templateEdit(state.projectInfo)
.then((res) => {
state.noticeContent = state.projectInfo.notice;
message.success("公告发布成功");
@@ -1004,7 +1016,7 @@ export default defineComponent({
message.error("公告发布失败" + err);
console.log(err);
});
state.editFlag =false;
state.editFlag = false;
};
// 删除阶段
@@ -1043,7 +1055,6 @@ export default defineComponent({
});
};
// 新建或编辑阶段
const stateEdit = () => {
let obj = {
@@ -1124,23 +1135,23 @@ export default defineComponent({
let str = JSON.stringify(fileList);
console.log("str", str);
console.table({
name: state.projectInfo.name,
category: state.projectInfo.category,
picUrl: state.projectInfo.picUrl,
manager: state.projectInfo.manager,
managerId: state.projectInfo.managerId || 0,
sourceBelongId: state.projectInfo.sourceBelongId,
level: state.projectInfo.level,
systemId: state.projectInfo.systemId,
boeFlag: state.projectInfo.boeFlag ? 1 : 0,
courseSyncFlag: state.projectInfo.courseSyncFlag ? 1 : 0,
notice: state.projectInfo.notice,
noticeFlag: state.projectInfo.noticeFlag,
projectTemplateId: localStorage.getItem("projectTemplateId"),
remark: state.projectInfo.remark,
status: state.projectInfo.status,
attach: str,
});
name: state.projectInfo.name,
category: state.projectInfo.category,
picUrl: state.projectInfo.picUrl,
manager: state.projectInfo.manager,
managerId: state.projectInfo.managerId || 0,
sourceBelongId: state.projectInfo.sourceBelongId,
level: state.projectInfo.level,
systemId: state.projectInfo.systemId,
boeFlag: state.projectInfo.boeFlag ? 1 : 0,
courseSyncFlag: state.projectInfo.courseSyncFlag ? 1 : 0,
notice: state.projectInfo.notice,
noticeFlag: state.projectInfo.noticeFlag,
projectTemplateId: localStorage.getItem("projectTemplateId"),
remark: state.projectInfo.remark,
status: state.projectInfo.status,
attach: str,
});
//要编辑项目
api
.templateEdit({
@@ -1183,17 +1194,17 @@ export default defineComponent({
// 更新开关状态
api
.templateEdit({
sourceBelongId: state.projectInfo.sourceBelongId,
projectTemplateId: localStorage.getItem("projectTemplateId"),
attachSwitch: state.attachSwitch?1:-1
})
.then((res) => {
console.log("开关更新成功", res);
})
.catch((err) => {
console.log("开关更新失败", err);
});
.templateEdit({
sourceBelongId: state.projectInfo.sourceBelongId,
projectTemplateId: localStorage.getItem("projectTemplateId"),
attachSwitch: state.attachSwitch ? 1 : -1,
})
.then((res) => {
console.log("开关更新成功", res);
})
.catch((err) => {
console.log("开关更新失败", err);
});
};
//设置积分规则
@@ -1277,7 +1288,7 @@ export default defineComponent({
handleChange2,
scoresum,
checkedClose,
editNotice
editNotice,
};
},
});