mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 05:46:45 +08:00
公告
This commit is contained in:
@@ -4,14 +4,14 @@
|
|||||||
<div class="noticeTitle">
|
<div class="noticeTitle">
|
||||||
<!-- <div class="notitle"><span class="titlespan">公告</span></div> -->
|
<!-- <div class="notitle"><span class="titlespan">公告</span></div> -->
|
||||||
<div class="switch">
|
<div class="switch">
|
||||||
<a-switch v-model:checked="noticeChecked" size="small" /><span
|
<a-switch v-model:checked="noticeChecked" @click="noticeFlag" size="small" /><span
|
||||||
style="margin-left: 16px"
|
style="margin-left: 16px"
|
||||||
>
|
>
|
||||||
开启
|
开启
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="noticeChecked">
|
<template v-if="noticeChecked">
|
||||||
<p>当前公告内容</p>
|
<p>当前公告内容:</p>
|
||||||
<!-- 预览 -->
|
<!-- 预览 -->
|
||||||
<template v-if="!editOn">
|
<template v-if="!editOn">
|
||||||
<div class="txt-content">
|
<div class="txt-content">
|
||||||
@@ -44,11 +44,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>s
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { reactive, toRefs, onMounted } from "vue";
|
import { reactive, toRefs, onMounted } from "vue";
|
||||||
import { getTask } from "../../api/indexTaskadd";
|
import { editProj, getTask } from "../../api/indexTaskadd";
|
||||||
// import { editProj } from "../../api/indexTaskadd";
|
// import { editProj } from "../../api/indexTaskadd";
|
||||||
import { publishNotice } from "../../api/indexNotice";
|
import { publishNotice } from "../../api/indexNotice";
|
||||||
import emitter from "../../utils/bus";
|
import emitter from "../../utils/bus";
|
||||||
@@ -62,7 +62,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
noticeChecked: true,
|
noticeChecked: false,
|
||||||
projectInfo: {},
|
projectInfo: {},
|
||||||
noticeContent1: "",
|
noticeContent1: "",
|
||||||
noticeContent: "",
|
noticeContent: "",
|
||||||
@@ -74,31 +74,42 @@ export default {
|
|||||||
state.projectInfo = res.data.data.projectInfo;
|
state.projectInfo = res.data.data.projectInfo;
|
||||||
state.noticeContent1 = state.projectInfo.notice;
|
state.noticeContent1 = state.projectInfo.notice;
|
||||||
state.noticeContent = state.projectInfo.notice;
|
state.noticeContent = state.projectInfo.notice;
|
||||||
|
state.noticeChecked = state.projectInfo.noticeFlag==0?false:true;
|
||||||
});
|
});
|
||||||
|
console.log("state.noticeChecked",state.noticeChecked);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEdit = () => {
|
const handleEdit = () => {
|
||||||
state.editOn = true;
|
state.editOn = true;
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
|
||||||
state.editOn = false;
|
state.editOn = false;
|
||||||
};
|
};
|
||||||
|
const noticeFlag =()=>{
|
||||||
|
//state.noticeChecked = !state.noticeChecked;
|
||||||
|
console.log("111",state.projectInfo);
|
||||||
|
state.projectInfo.noticeFlag = state.noticeChecked?1:0;
|
||||||
|
editProj(state.projectInfo).then((res)=>{
|
||||||
|
console.log("res",res.data.data.projectInfo);
|
||||||
|
}).catch((error)=>{
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
console.log("222",state.projectInfo);
|
||||||
|
}
|
||||||
const pubNotice = () => {
|
const pubNotice = () => {
|
||||||
if (state.noticeContent == "") {
|
if (state.noticeContent == "") {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入公告内容");
|
return message.warning("请输入公告内容");
|
||||||
} else {
|
} else {
|
||||||
let obj = {
|
let obj = {
|
||||||
// createId: state.projectInfo.createId,
|
notice: state.noticeContent1,
|
||||||
// createName: state.projectInfo.createName,
|
|
||||||
notice: state.noticeContent,
|
|
||||||
// noticeId: 0,
|
|
||||||
projectId: props.projectId,
|
projectId: props.projectId,
|
||||||
title: "",
|
title: "",
|
||||||
};
|
};
|
||||||
publishNotice(obj)
|
publishNotice(obj);//加入历史
|
||||||
.then((res) => {
|
state.projectInfo.notice =state.noticeContent;
|
||||||
|
editProj(state.projectInfo).then((res) => {
|
||||||
// console.log("res");
|
// console.log("res");
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
@@ -114,6 +125,8 @@ export default {
|
|||||||
message.warning("发布失败");
|
message.warning("发布失败");
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -125,6 +138,7 @@ export default {
|
|||||||
pubNotice,
|
pubNotice,
|
||||||
handleEdit,
|
handleEdit,
|
||||||
handleCancel,
|
handleCancel,
|
||||||
|
noticeFlag,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -283,24 +283,33 @@
|
|||||||
v-model:checked="checked"
|
v-model:checked="checked"
|
||||||
@click="changeopclo"
|
@click="changeopclo"
|
||||||
/>
|
/>
|
||||||
<div
|
<div v-if="(checked==true)"
|
||||||
class="opclo"
|
class="opclo">
|
||||||
:style="{ display: hideshow ? 'block' : 'none' }"
|
|
||||||
>
|
|
||||||
<span>关闭</span>
|
<span>关闭</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="(checked==false)"
|
||||||
class="opclo"
|
class="opclo" >
|
||||||
:style="{ display: hideshow ? 'none' : 'block' }"
|
|
||||||
>
|
|
||||||
<span>开启</span>
|
<span>开启</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="(checked==true)"
|
||||||
class="ntc_content"
|
class="ntc_content">
|
||||||
:style="{ display: hideshow ? 'block' : 'none' }"
|
<div class="ntcc_tit">当前公告内容:</div>
|
||||||
>
|
<div class="textarea">
|
||||||
<div class="ntcc_tit">公告内容</div>
|
{{noticeContent==""?"暂无公告":noticeContent}}
|
||||||
|
<div v-if="(editFlag == false)" class="btnarea" >
|
||||||
|
<div> </div>
|
||||||
|
<div class="area_btn" @click="editNotice">
|
||||||
|
|
||||||
|
<div class="btnText">编辑</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="(editFlag==true)">
|
||||||
|
<div> </div>
|
||||||
|
<div class="ntcc_tit" >编辑公告:</div>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="projectInfo.notice"
|
v-model:value="projectInfo.notice"
|
||||||
@@ -315,7 +324,8 @@
|
|||||||
<div class="btnText">发布</div>
|
<div class="btnText">发布</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -835,6 +845,8 @@ export default defineComponent({
|
|||||||
edit: true,
|
edit: true,
|
||||||
fileList:[],
|
fileList:[],
|
||||||
attachSwitch:true,
|
attachSwitch:true,
|
||||||
|
editFlag:false,
|
||||||
|
noticeContent:"",
|
||||||
// 共享文档列表
|
// 共享文档列表
|
||||||
docList: [
|
docList: [
|
||||||
{
|
{
|
||||||
@@ -852,29 +864,25 @@ export default defineComponent({
|
|||||||
],
|
],
|
||||||
isEdit: false, // 是否处于编辑状态
|
isEdit: false, // 是否处于编辑状态
|
||||||
// 基本信息
|
// 基本信息
|
||||||
projectInfo: {
|
projectInfo: {},
|
||||||
beginTime: null,
|
|
||||||
endTime: null,
|
|
||||||
name: null,
|
|
||||||
manager: null,
|
|
||||||
notice: null,
|
|
||||||
sourceBelongId: null,
|
|
||||||
remark: "",
|
|
||||||
courseSyncFlag: false,
|
|
||||||
level: null,
|
|
||||||
systemId: null,
|
|
||||||
boeFlag: false,
|
|
||||||
status: null,
|
|
||||||
picUrl: null,
|
|
||||||
noticeFlag: null,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const value = ref("");
|
const value = ref("");
|
||||||
const textnum = "150";
|
const textnum = "150";
|
||||||
const routered = useRouter();
|
const routered = useRouter();
|
||||||
const changeopclo = () => {
|
const changeopclo = () => {
|
||||||
state.hideshow = !state.hideshow;
|
state.projectInfo.noticeFlag = state.checked?1:0;
|
||||||
|
api
|
||||||
|
.templateEdit( state.projectInfo)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
const editNotice =()=>{
|
||||||
|
state.editFlag = true ;
|
||||||
|
}
|
||||||
const changecheck2 = () => {
|
const changecheck2 = () => {
|
||||||
state.checked2 = !state.checked2;
|
state.checked2 = !state.checked2;
|
||||||
};
|
};
|
||||||
@@ -937,25 +945,13 @@ export default defineComponent({
|
|||||||
|
|
||||||
state.taskSyllabus = [];
|
state.taskSyllabus = [];
|
||||||
console.log(res);
|
console.log(res);
|
||||||
state.projectInfo.name = res.data.data.projectTemplateInfo.name;
|
state.projectInfo = res.data.data.projectTemplateInfo;
|
||||||
state.projectInfo.beginTime = res.data.data.projectTemplateInfo.beginTime;
|
|
||||||
state.projectInfo.endTime = res.data.data.projectTemplateInfo.endTime;
|
state.noticeContent = state.projectInfo.notice;
|
||||||
state.projectInfo.manager = res.data.data.projectTemplateInfo.manager;
|
state.checked = state.projectInfo.noticeFlag==1?true:false;
|
||||||
state.projectInfo.notice = res.data.data.projectTemplateInfo.notice;
|
console.log("state.checked", state.checked);
|
||||||
state.projectInfo.sourceBelongId = res.data.data.projectTemplateInfo.sourceBelongId;
|
console.log("state.projectInfo",state.projectInfo);
|
||||||
state.projectInfo.managerId = res.data.data.projectTemplateInfo.managerId;
|
console.log("res.data.data.projectTemplateInfo",res.data.data.projectTemplateInfo);
|
||||||
state.projectInfo.remark = res.data.data.projectTemplateInfo.remark;
|
|
||||||
state.projectInfo.courseSyncFlag = res.data.data.projectTemplateInfo.courseSyncFlag;
|
|
||||||
state.projectInfo.level = res.data.data.projectTemplateInfo.level;
|
|
||||||
state.projectInfo.systemId = res.data.data.projectTemplateInfo.systemId;
|
|
||||||
state.projectInfo.boeFlag = res.data.data.projectTemplateInfo.boeFlag;
|
|
||||||
state.projectInfo.noticeFlag = res.data.data.projectTemplateInfo.noticeFlag;
|
|
||||||
state.projectInfo.remark = res.data.data.projectTemplateInfo.remark;
|
|
||||||
state.projectInfo.status = res.data.data.projectTemplateInfo.status;
|
|
||||||
state.projectInfo.picUrl = res.data.data.projectTemplateInfo.picUrl;
|
|
||||||
state.picUrl = res.data.data.projectTemplateInfo.picUrl;
|
|
||||||
state.projectInfo.attach = res.data.data.projectTemplateInfo.attach;
|
|
||||||
state.projectInfo.category = res.data.data.projectTemplateInfo.category;
|
|
||||||
try{
|
try{
|
||||||
state.fileList = JSON.parse(res.data.data.projectTemplateInfo.attach);
|
state.fileList = JSON.parse(res.data.data.projectTemplateInfo.attach);
|
||||||
}catch{
|
}catch{
|
||||||
@@ -988,29 +984,14 @@ export default defineComponent({
|
|||||||
|
|
||||||
// 发布公告
|
// 发布公告
|
||||||
const addNotice = () => {
|
const addNotice = () => {
|
||||||
console.log("ok====s");
|
// state.projectInfo.notice=
|
||||||
let obj = {
|
if(!state.projectInfo.notice){
|
||||||
name: state.projectInfo.name,
|
return message.warning("请输入公告内容");
|
||||||
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: state.projectInfo.attach,
|
|
||||||
};
|
|
||||||
console.log("obj======", obj);
|
|
||||||
api
|
api
|
||||||
.templateEdit(obj)
|
.templateEdit( state.projectInfo)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
state.noticeContent = state.projectInfo.notice;
|
||||||
message.success("公告发布成功");
|
message.success("公告发布成功");
|
||||||
console.log(res);
|
console.log(res);
|
||||||
})
|
})
|
||||||
@@ -1018,6 +999,7 @@ export default defineComponent({
|
|||||||
message.error("公告发布失败" + err);
|
message.error("公告发布失败" + err);
|
||||||
console.log(err);
|
console.log(err);
|
||||||
});
|
});
|
||||||
|
state.editFlag =false;
|
||||||
};
|
};
|
||||||
// 删除阶段
|
// 删除阶段
|
||||||
const stateDel = (id) => {
|
const stateDel = (id) => {
|
||||||
@@ -1288,7 +1270,8 @@ export default defineComponent({
|
|||||||
editRule,
|
editRule,
|
||||||
handleChange2,
|
handleChange2,
|
||||||
scoresum,
|
scoresum,
|
||||||
checkedClose
|
checkedClose,
|
||||||
|
editNotice
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -2217,6 +2200,7 @@ export default defineComponent({
|
|||||||
.ntc_content {
|
.ntc_content {
|
||||||
.ntcc_tit {
|
.ntcc_tit {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.textarea {
|
.textarea {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user