发布公告

This commit is contained in:
zhangyc
2022-12-07 22:53:59 +08:00
parent 27e4c68e91
commit 18ae75da41

View File

@@ -11,11 +11,11 @@
</span>
</div>
<template v-if="noticeChecked">
<p>公告内容</p>
<p>当前公告内容</p>
<!-- 预览 -->
<template v-if="!editOn">
<div class="txt-content">
{{ noticeContent ? noticeContent : "暂无公告" }}
{{ noticeContent1 ? noticeContent1 : "暂无公告" }}
</div>
<div class="btn-content">
<a-button type="primary" @click="handleEdit">编辑</a-button>
@@ -23,13 +23,12 @@
</template>
<!-- 编辑 -->
<template v-if="editOn">
<div class="txt-contain">
<span>预览</span>
<div class="txt-content">
{{ noticeContent }}
{{ noticeContent1 ? noticeContent1 : "暂无公告" }}
</div>
</div>
<p>编辑</p>
<p>编辑新公告</p>
<a-textarea
v-model:value="noticeContent"
:maxlength="150"
@@ -65,14 +64,15 @@ export default {
const state = reactive({
noticeChecked: true,
projectInfo: {},
noticeContent1: "",
noticeContent: "",
editOn: false,
});
const getTaskInfo = () => {
getTask({ projectId: props.projectId }).then((res) => {
console.log("公告获取项目", res.data.data.projectInfo);
state.projectInfo = res.data.data.projectInfo;
state.noticeContent1 = state.projectInfo.notice;
state.noticeContent = state.projectInfo.notice;
});
};
@@ -104,7 +104,7 @@ export default {
if (res.data.code === 200) {
message.destroy();
message.success("发布成功", res);
state.noticeContent = res.data.data.notice;
state.noticeContent1 = res.data.data.notice==""?"暂无公告":res.data.data.notice;
handleCancel();
emitter.emit("setNotice", false);
}