解决dialog显示问题

main
A 2022-07-13 18:35:54 +08:00
parent 29ce65fc05
commit 81f3c50a58
1 changed files with 31 additions and 18 deletions

View File

@ -55,7 +55,7 @@
</div> </div>
<div style="margin: 0 30px 30px 30px;height: 700px; <div style="margin: 0 30px 30px 30px;height: 700px;
display: flex;flex-direction: row;justify-content: space-between;align-items: stretch"> display: flex;flex-direction: row;justify-content: space-between;align-items: stretch">
<div style="min-width: 60%; display: flex;flex-direction: column"> <div style="width: 60%; display: flex;flex-direction: column">
<div style="margin: 0 10px 0 10px; <div style="margin: 0 10px 0 10px;
display: flex;flex-direction: row;justify-content: space-between"> display: flex;flex-direction: row;justify-content: space-between">
<p style="font-family: 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">详细信息</p> <p style="font-family: 'Segoe UI',sans-serif;font-size: 20px;font-weight: bold;color: #606266">详细信息</p>
@ -146,7 +146,7 @@
</div> </div>
</div> </div>
<div style="flex: 1;margin-left: 30px;display: flex;flex-direction: column;"> <div style="min-width: 40%;flex: 1;margin-left: 30px;display: flex;flex-direction: column;">
<div> <div>
<p class="p-title" style="margin-left: 10px;width: 40%;float: left;">公告</p> <p class="p-title" style="margin-left: 10px;width: 40%;float: left;">公告</p>
@ -164,7 +164,7 @@
<div style="width:100%;height:10%;float:left;"> <div style="width:100%;height:10%;float:left;">
<p @click="gbGgBosShow()" <p @click="gbGgBosShow()"
style="width:20%;height:100%;float:left;color: #606266;line-height: 250%;cursor: pointer;"> &lt;&nbsp;返回</p> style="width:20%;height:100%;float:left;color: #606266;line-height: 250%;cursor: pointer;"> &lt;&nbsp;返回</p>
<div style="width:60%;height:100%;float:left;line-height: 250%;text-align: center;"> <div style="min-width:60%;height:100%;float:left;line-height: 250%;text-align: center;">
<h3>{{ findGgInfoContent.announcementTitle }} </h3></div> <h3>{{ findGgInfoContent.announcementTitle }} </h3></div>
<div @click="showDelbox(findGgInfoContent.announcementId)" <div @click="showDelbox(findGgInfoContent.announcementId)"
style="width:20%;height:100%;float:right;color: #409EFF;line-height: 250%;text-align: center;cursor: pointer;"> style="width:20%;height:100%;float:right;color: #409EFF;line-height: 250%;text-align: center;cursor: pointer;">
@ -186,12 +186,20 @@
<div v-if="!findGgBoxShow"> <div v-if="!findGgBoxShow">
<el-timeline> <el-timeline>
<el-timeline-item timestamp="" placement="top" v-for="(item, index) in ggList" :key="index"> <el-timeline-item timestamp="" placement="top" v-for="(item, index) in ggList" :key="index">
<el-row :gutter="12">
<el-card @click="findggInfo(item.announcementId)"> <el-card @click="findggInfo(item.announcementId)">
<h3 <h3
style="white-space: nowrap;text-overflow: ellipsis;-o-text-overflow: ellipsis; overflow: hidden;width:524px;cursor: pointer;"> style="white-space: nowrap;text-overflow: ellipsis;-o-text-overflow: ellipsis; overflow: hidden;width:524px;cursor: pointer;height:100%">
{{ item.announcementTitle }}</h3> {{ item.announcementTitle }}</h3>
<p> {{ item.announcementPublisherName }} 发布于 {{ item.announcementPublishTime }}</p> <p> {{ item.announcementPublisherName }} 发布于 {{ item.announcementPublishTime }}</p>
</el-card> </el-card>
</el-row>
<!-- <el-card @click="findggInfo(item.announcementId)">
<h3
style="white-space: nowrap;text-overflow: ellipsis;-o-text-overflow: ellipsis; overflow: hidden;width:524px;cursor: pointer;height:100%">
{{ item.announcementTitle }}</h3>
<p> {{ item.announcementPublisherName }} 发布于 {{ item.announcementPublishTime }}</p>
</el-card> -->
</el-timeline-item> </el-timeline-item>
</el-timeline> </el-timeline>
</div> </div>
@ -219,14 +227,14 @@
@edited="onEdited"/> @edited="onEdited"/>
<!-- 新增公告框开始 --> <!-- 新增公告框开始 -->
<el-dialog title="添加项目公告" v-model="centerDialogVisible" width="40%" center> <el-dialog title="添加项目公告" :model-value="centerDialogVisible" @close="centerDialogVisible = false" width="40%" center>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="messageForm" :rules="rules" label-width="100px">
<el-form-item label="标题" prop="addggbttxt"> <el-form-item label="标题" prop="addggbttxt">
<el-input type="text" placeholder="请输入项目公告标题" v-model="form.addggbttxt" maxlength="45" show-word-limit> <el-input type="text" placeholder="请输入项目公告标题" v-model="messageForm.addggbttxt" maxlength="45" show-word-limit>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="内容" prop="addggtextarea"> <el-form-item label="内容" prop="addggtextarea">
<el-input type="textarea" placeholder="请输入项目公告内容" v-model="form.addggtextarea" maxlength="1000" show-word-limit <el-input type="textarea" placeholder="请输入项目公告内容" v-model="messageForm.addggtextarea" maxlength="1000" show-word-limit
:rows="10"> :rows="10">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -244,7 +252,7 @@
<!-- 删除公告 --> <!-- 删除公告 -->
<el-dialog <el-dialog
title="提示" title="提示"
v-model="dialogVisible" :model-value="dialogVisible"
width="30%" width="30%"
:before-close="handleClose"> :before-close="handleClose">
<div>确认删除该公告?</div> <div>确认删除该公告?</div>
@ -312,7 +320,7 @@ export default {
// //
centerDialogVisible: false, centerDialogVisible: false,
form: { messageForm: {
addggbttxt:"", addggbttxt:"",
addggtextarea:'', addggtextarea:'',
}, },
@ -444,7 +452,7 @@ export default {
that.findGgBoxShow = true; that.findGgBoxShow = true;
let data = response.data.data; let data = response.data.data;
console.log(data); console.log(data);
data.announcementPublishTime = that.formatDate(data.announcementPublishTime) data.announcementPublishTime = that.formatAnnouncementDate(data.announcementPublishTime)
that.findGgInfoContent = data; that.findGgInfoContent = data;
} }
}) })
@ -463,13 +471,13 @@ export default {
if (valid) { if (valid) {
console.log('submit') console.log('submit')
let {...form} = this.form // let {...form} = messageForm
request({ request({
url: `project/${projectId}/announcement`, url: `project/${projectId}/announcement`,
method: 'post', method: 'post',
data: { data: {
announcementContent: that.form.addggtextarea, announcementContent: that.messageForm.addggtextarea,
announcementTitle: that.form.addggbttxt, announcementTitle: that.messageForm.addggbttxt,
} }
}).then((response) => { }).then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
@ -511,7 +519,7 @@ export default {
let data = response.data.data; let data = response.data.data;
console.log("公告"); console.log("公告");
data.records.forEach(item => { data.records.forEach(item => {
item.announcementPublishTime = that.formatDate(item.announcementPublishTime) item.announcementPublishTime = that.formatAnnouncementDate(item.announcementPublishTime)
}) })
that.ggList = data.records that.ggList = data.records
console.log(that.ggList); console.log(that.ggList);
@ -543,6 +551,11 @@ export default {
return moment(date * 1000).format("yyyy年MM月DD日") return moment(date * 1000).format("yyyy年MM月DD日")
return '无' return '无'
}, },
formatAnnouncementDate(date) {
if (date)
return moment(date * 1000).format("yyyy年MM月DD日 HH:mm")
return '无'
},
getProjectInfo() { getProjectInfo() {
const that = this const that = this
request({ request({