|
@@ -7,6 +7,7 @@ import moment from 'moment';
|
|
import { showToast,showDialog } from 'vant';
|
|
import { showToast,showDialog } from 'vant';
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
|
|
+import EditBaseInfo from './components/EidtBaseInfo.vue'
|
|
|
|
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const { width, height } = useWindowSize()
|
|
const { width, height } = useWindowSize()
|
|
@@ -15,13 +16,22 @@ const { width, height } = useWindowSize()
|
|
const route=useRoute()
|
|
const route=useRoute()
|
|
const router=useRouter()
|
|
const router=useRouter()
|
|
|
|
|
|
|
|
+//基础信息
|
|
|
|
+const showBaseInfoPop=ref(false)
|
|
|
|
+//更新基本信息
|
|
|
|
+function handleUpdateBaseInfo(e){
|
|
|
|
+ reportInfo.value.Title=e.title
|
|
|
|
+ reportInfo.value.Author=e.author
|
|
|
|
+ reportInfo.value.CreateTime=e.createtime
|
|
|
|
+ showBaseInfoPop.value=false
|
|
|
|
+}
|
|
|
|
+
|
|
// 获取报告详情
|
|
// 获取报告详情
|
|
let reportInfo=ref(null)
|
|
let reportInfo=ref(null)
|
|
async function getReportDetail(){
|
|
async function getReportDetail(){
|
|
const res=await apiReport.getReportDetail({ReportId:Number(route.query.id)})
|
|
const res=await apiReport.getReportDetail({ReportId:Number(route.query.id)})
|
|
if(res.Ret===200){
|
|
if(res.Ret===200){
|
|
reportInfo.value=res.Data
|
|
reportInfo.value=res.Data
|
|
- currentDate.value=moment(res.Data.CreateTime).format('YYYY-MM-DD').split('-')
|
|
|
|
document.title=res.Data.ClassifyNameFirst
|
|
document.title=res.Data.ClassifyNameFirst
|
|
}
|
|
}
|
|
getChapterList()
|
|
getChapterList()
|
|
@@ -93,14 +103,6 @@ function goChapterDetail(item){
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-// 修改报告时间
|
|
|
|
-const showDate=ref(false)
|
|
|
|
-const currentDate=ref([])
|
|
|
|
-function handleConfirmDateChange(e){
|
|
|
|
- reportInfo.value.CreateTime=e.selectedValues.join('-')
|
|
|
|
- showDate.value=false
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
|
|
// 保存报告信息
|
|
// 保存报告信息
|
|
async function handleSaveReportInfo(){
|
|
async function handleSaveReportInfo(){
|
|
@@ -152,7 +154,7 @@ async function handlePublishReport(){
|
|
|
|
|
|
if(reportInfo.value.ClassifyNameFirst==='周报'){
|
|
if(reportInfo.value.ClassifyNameFirst==='周报'){
|
|
showToast('发布成功')
|
|
showToast('发布成功')
|
|
- getReportDetail()
|
|
|
|
|
|
+ router.back()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 晨报
|
|
// 晨报
|
|
@@ -172,11 +174,11 @@ async function handlePublishReport(){
|
|
const pushRes=await apiReport.reportMessageSend({ReportId:Number(reportInfo.value.Id)})
|
|
const pushRes=await apiReport.reportMessageSend({ReportId:Number(reportInfo.value.Id)})
|
|
if(pushRes.Ret===200){
|
|
if(pushRes.Ret===200){
|
|
showToast('推送成功')
|
|
showToast('推送成功')
|
|
- getReportDetail()
|
|
|
|
|
|
+ router.back()
|
|
}
|
|
}
|
|
}).catch(()=>{
|
|
}).catch(()=>{
|
|
showToast('发布成功')
|
|
showToast('发布成功')
|
|
- getReportDetail()
|
|
|
|
|
|
+ router.back()
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
@@ -191,35 +193,15 @@ async function handlePublishReport(){
|
|
const pushRes=await apiReport.reportMessageSend({ReportId:Number(reportInfo.value.Id)})
|
|
const pushRes=await apiReport.reportMessageSend({ReportId:Number(reportInfo.value.Id)})
|
|
if(pushRes.Ret===200){
|
|
if(pushRes.Ret===200){
|
|
showToast('推送成功')
|
|
showToast('推送成功')
|
|
- getReportDetail()
|
|
|
|
|
|
+ router.back()
|
|
}
|
|
}
|
|
}).catch(()=>{
|
|
}).catch(()=>{
|
|
showToast('发布成功')
|
|
showToast('发布成功')
|
|
- getReportDetail()
|
|
|
|
|
|
+ router.back()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-// 推送消息
|
|
|
|
-function handleSendMsg(){
|
|
|
|
- apiReport.reportMessageSend({ReportId:Number(reportInfo.value.Id)}).then(res=>{
|
|
|
|
- if(res.Ret===200){
|
|
|
|
- showToast('推送成功')
|
|
|
|
- getReportDetail()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 取消发布
|
|
|
|
-function handlePublishCancel(){
|
|
|
|
- apiReport.reportPublishCancle({ReportIds:Number(reportInfo.value.Id)}).then(res=>{
|
|
|
|
- if(res.Ret===200){
|
|
|
|
- showToast('取消发布成功')
|
|
|
|
- getReportDetail()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// 显示海报
|
|
// 显示海报
|
|
const showChapterItemPoster=ref(false)
|
|
const showChapterItemPoster=ref(false)
|
|
const chapterItemPosterInfo=ref(null)
|
|
const chapterItemPosterInfo=ref(null)
|
|
@@ -241,45 +223,10 @@ async function handleShowPoster(item){
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="report-chapterlist-page" v-if="reportInfo">
|
|
<div class="report-chapterlist-page" v-if="reportInfo">
|
|
- <div class="top-form-wrap">
|
|
|
|
- <div class="form-item">
|
|
|
|
- <span class="label">报告类型</span>
|
|
|
|
- <span class="con" style="color:#999">{{reportInfo.ClassifyNameFirst}}</span>
|
|
|
|
- </div>
|
|
|
|
- <div :class="['form-item', reportInfo.State==1&&'edit-box']">
|
|
|
|
- <span class="label">报告标题</span>
|
|
|
|
- <input class="con" type="text" placeholder="请输入标题" v-model="reportInfo.Title" v-if="reportInfo.State==1">
|
|
|
|
- <span class="con" style="color:#999" v-else>{{reportInfo.Title}}</span>
|
|
|
|
- </div>
|
|
|
|
- <div :class="['form-item', reportInfo.State==1&&'calendar-box']">
|
|
|
|
- <span class="label">发布时间</span>
|
|
|
|
- <span class="con" @click="showDate=true" v-if="reportInfo.State==1">{{moment(reportInfo.CreateTime).format('YYYY-MM-DD')}}</span>
|
|
|
|
- <span class="con" style="color:#999" v-else>{{moment(reportInfo.CreateTime).format('YYYY-MM-DD')}}</span>
|
|
|
|
- </div>
|
|
|
|
- <div :class="['form-item', reportInfo.State==1&&'edit-box']">
|
|
|
|
- <span class="label">作者</span>
|
|
|
|
- <input class="con" type="text" placeholder="请输入作者" v-model="reportInfo.Author" v-if="reportInfo.State==1">
|
|
|
|
- <span class="con" style="color:#999" v-else>{{reportInfo.Author}}</span>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ <van-cell title="基础信息" is-link @click="showBaseInfoPop=true"/>
|
|
<div class="chapter-list-wrap">
|
|
<div class="chapter-list-wrap">
|
|
<div class="top-box">
|
|
<div class="top-box">
|
|
<span class="list-lable">章节列表</span>
|
|
<span class="list-lable">章节列表</span>
|
|
- <!-- 未发布 -->
|
|
|
|
- <div v-if="reportInfo.State==1">
|
|
|
|
- <!-- 保存 -->
|
|
|
|
- <img @click="handleSaveReportInfo" class="btn" src="@/assets/imgs/report/icon_save.png" alt="" style="margin-right:20px">
|
|
|
|
- <!-- 发布 -->
|
|
|
|
- <img @click="handlePublishValid" class="btn" src="@/assets/imgs/report/icon_publish2.png" alt="">
|
|
|
|
- </div>
|
|
|
|
- <!-- 已发布 -->
|
|
|
|
- <div v-if="reportInfo.State==2">
|
|
|
|
- <!-- 推送消息 -->
|
|
|
|
- <img v-if="reportInfo.MsgIsSend==0" @click="handleSendMsg" class="btn" src="@/assets/imgs/report/icon_sendmsg.png" alt="推送消息" style="margin-right:20px">
|
|
|
|
- <!-- 取消发布 -->
|
|
|
|
- <img @click="handlePublishCancel" class="btn" src="@/assets/imgs/report/icon_publish_cancel.png" alt="取消发布">
|
|
|
|
- </div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<ul class="chapter-list">
|
|
<ul class="chapter-list">
|
|
@@ -290,12 +237,10 @@ async function handleShowPoster(item){
|
|
</div>
|
|
</div>
|
|
<div class="content">
|
|
<div class="content">
|
|
<div class="title">{{item.TypeName}}</div>
|
|
<div class="title">{{item.TypeName}}</div>
|
|
- <div
|
|
|
|
- v-if="reportInfo.ClassifyNameFirst=='周报'"
|
|
|
|
- :class="['audio-status',item.VideoUrl&&item.VideoKind==1?'audio-status-success':'']"
|
|
|
|
- >{{item.VideoUrl&&item.VideoKind==1?'已传录音':'未传录音'}}</div>
|
|
|
|
|
|
+ <div class="tag-text" v-if="item.Trend">#{{item.Trend}}</div>
|
|
<div class="time">{{item.ModifyTime}}</div>
|
|
<div class="time">{{item.ModifyTime}}</div>
|
|
-
|
|
|
|
|
|
+ <!-- 上传了音频icon -->
|
|
|
|
+ <img class="audio-icon" src="@/assets/imgs/report/icon_audio.png" alt="" v-if="reportInfo.ClassifyNameFirst=='周报'&&item.VideoUrl&&item.VideoKind==1">
|
|
<div :class="['status',item.PublishState!=1&&'status-success']">{{item.PublishState==1?'未发布':'已发布'}}</div>
|
|
<div :class="['status',item.PublishState!=1&&'status-success']">{{item.PublishState==1?'未发布':'已发布'}}</div>
|
|
<img @click.stop="handleShowTrendTag(item)" class="icon icon-tag" src="@/assets/imgs/report/icon_tag.png" alt="">
|
|
<img @click.stop="handleShowTrendTag(item)" class="icon icon-tag" src="@/assets/imgs/report/icon_tag.png" alt="">
|
|
<img v-if="item.PublishState==2" @click.stop="handleShowPoster(item)" class="icon icon-wx" src="@/assets/imgs/report/icon_wx.png" alt="">
|
|
<img v-if="item.PublishState==2" @click.stop="handleShowPoster(item)" class="icon icon-wx" src="@/assets/imgs/report/icon_wx.png" alt="">
|
|
@@ -303,8 +248,27 @@ async function handleShowPoster(item){
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ <div class="bot-btns">
|
|
|
|
+ <van-button class="bot-btn" type="default" @click="handlePublishValid">发布</van-button>
|
|
|
|
+ <van-button class="bot-btn" type="primary" @click="handleSaveReportInfo">保存</van-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <!-- 基础信息 -->
|
|
|
|
+ <van-popup
|
|
|
|
+ v-model:show="showBaseInfoPop"
|
|
|
|
+ position="bottom"
|
|
|
|
+ :style="{height:'100%'}"
|
|
|
|
+ >
|
|
|
|
+ <EditBaseInfo
|
|
|
|
+ v-if="showBaseInfoPop"
|
|
|
|
+ :defaultData="reportInfo"
|
|
|
|
+ @close="showBaseInfoPop=false"
|
|
|
|
+ @confirm="handleUpdateBaseInfo"
|
|
|
|
+ />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
<!-- 选择标签 -->
|
|
<!-- 选择标签 -->
|
|
<van-popup
|
|
<van-popup
|
|
v-model:show="showTagPop"
|
|
v-model:show="showTagPop"
|
|
@@ -322,21 +286,6 @@ async function handleShowPoster(item){
|
|
/>
|
|
/>
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
|
|
- <!-- 修改时间 -->
|
|
|
|
- <van-popup
|
|
|
|
- v-model:show="showDate"
|
|
|
|
- round
|
|
|
|
- :position="width>650?'center':'bottom'"
|
|
|
|
- :style="width>650?{ width: '400px'}:''"
|
|
|
|
- >
|
|
|
|
- <van-date-picker
|
|
|
|
- v-model="currentDate"
|
|
|
|
- title="选择日期"
|
|
|
|
- @confirm="handleConfirmDateChange"
|
|
|
|
- @cancel="showDate=false"
|
|
|
|
- />
|
|
|
|
- </van-popup>
|
|
|
|
-
|
|
|
|
<!-- 海报 -->
|
|
<!-- 海报 -->
|
|
<van-popup
|
|
<van-popup
|
|
v-model:show="showChapterItemPoster"
|
|
v-model:show="showChapterItemPoster"
|
|
@@ -352,62 +301,29 @@ async function handleShowPoster(item){
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.top-form-wrap{
|
|
|
|
- padding: 32px 32px 0 32px;
|
|
|
|
- .form-item{
|
|
|
|
|
|
+.report-chapterlist-page{
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ .bot-btns{
|
|
|
|
+ padding: 20px 0;
|
|
display: flex;
|
|
display: flex;
|
|
- align-items: center;
|
|
|
|
- padding: 32px 0px;
|
|
|
|
- font-size: 32px;
|
|
|
|
- border-bottom: 1px solid $border-color;
|
|
|
|
- .label{
|
|
|
|
- color: #000;
|
|
|
|
- display: inline-block;
|
|
|
|
- width: 194px;
|
|
|
|
- }
|
|
|
|
- .con{
|
|
|
|
- flex: 1;
|
|
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .bot-btn{
|
|
|
|
+ width: 315px;
|
|
|
|
+ margin: 0 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .edit-box::after{
|
|
|
|
- content: '';
|
|
|
|
- display: block;
|
|
|
|
- width: 48px;
|
|
|
|
- height: 48px;
|
|
|
|
- background-image: url('@/assets/imgs/report/icon_edit.png');
|
|
|
|
- background-size: cover;
|
|
|
|
- background-repeat: no-repeat;
|
|
|
|
- }
|
|
|
|
- .calendar-box::after{
|
|
|
|
- content: '';
|
|
|
|
- display: block;
|
|
|
|
- width: 48px;
|
|
|
|
- height: 48px;
|
|
|
|
- background-image: url('@/assets/imgs/report/icon_calendar.png');
|
|
|
|
- background-size: cover;
|
|
|
|
- background-repeat: no-repeat;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
.chapter-list-wrap{
|
|
.chapter-list-wrap{
|
|
- border-top: 10px solid #F2F6FA;
|
|
|
|
- padding: 60px 34px;
|
|
|
|
- .top-box{
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- align-items: center;
|
|
|
|
- margin-bottom: 55px;
|
|
|
|
- .btn{
|
|
|
|
- width: 70px;
|
|
|
|
- height: 70px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ flex: 1;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ padding: 60px $page-padding;
|
|
.list-lable{
|
|
.list-lable{
|
|
display: block;
|
|
display: block;
|
|
- font-weight: 600;
|
|
|
|
font-size: 32px;
|
|
font-size: 32px;
|
|
|
|
+ margin-bottom: 30px;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -450,15 +366,18 @@ async function handleShowPoster(item){
|
|
.title{
|
|
.title{
|
|
font-size: 32px;
|
|
font-size: 32px;
|
|
font-weight: 600;
|
|
font-weight: 600;
|
|
|
|
+ padding-right: 160px;
|
|
}
|
|
}
|
|
.time{
|
|
.time{
|
|
color: $font-grey;
|
|
color: $font-grey;
|
|
}
|
|
}
|
|
- .audio-status{
|
|
|
|
- color: $font-grey_999;
|
|
|
|
- &.audio-status-success{
|
|
|
|
- color: $font-success;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ .audio-icon{
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 36px;
|
|
|
|
+ height: 36px;
|
|
|
|
+ top: 0;
|
|
|
|
+ right: 100px;
|
|
}
|
|
}
|
|
|
|
|
|
.status{
|
|
.status{
|
|
@@ -513,25 +432,13 @@ async function handleShowPoster(item){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.report-baseinfo-wrap{
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ background-color: $page-bg-grey;
|
|
|
|
+}
|
|
|
|
+
|
|
@media screen and (min-width:$media-width){
|
|
@media screen and (min-width:$media-width){
|
|
- .top-form-wrap{
|
|
|
|
- padding: 16px 30px;
|
|
|
|
- .form-item{
|
|
|
|
- padding: 16px 0;
|
|
|
|
- font-size: 16px;
|
|
|
|
- .label{
|
|
|
|
- width: 100px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .edit-box::after{
|
|
|
|
- width: 24px;
|
|
|
|
- height: 24px;
|
|
|
|
- }
|
|
|
|
- .calendar-box::after{
|
|
|
|
- width: 24px;
|
|
|
|
- height: 24px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
.chapter-list-wrap{
|
|
.chapter-list-wrap{
|
|
border: none;
|
|
border: none;
|
|
padding: 30px;
|
|
padding: 30px;
|