|
@@ -2,6 +2,7 @@
|
|
|
import {ref} from 'vue'
|
|
|
import { useRoute } from "vue-router";
|
|
|
import apiReport from '@/api/report'
|
|
|
+import ReportPublishPop from './components/ReportPublishPop.vue'
|
|
|
import { showToast,showDialog } from 'vant';
|
|
|
|
|
|
const route=useRoute()
|
|
@@ -20,49 +21,6 @@ getReportDetail()
|
|
|
|
|
|
// 发布报告
|
|
|
const showPublishPop=ref(false)
|
|
|
-// 确认发布报告
|
|
|
-// type 1 仅发布 2发布且推送
|
|
|
-function handleConfirmPublish(type){
|
|
|
- apiReport.reportPublish({
|
|
|
- ReportIds:route.query.id
|
|
|
- }).then(res=>{
|
|
|
- if(res.Ret==200){
|
|
|
- if(type===2){
|
|
|
- handleReportMessageSend(true)
|
|
|
- }else{
|
|
|
- if(res.Data){
|
|
|
- showDialog({
|
|
|
- title: '发布提示',
|
|
|
- message: res.Data,
|
|
|
- }).then(()=>{
|
|
|
-
|
|
|
- })
|
|
|
- }else{
|
|
|
- showToast('发布成功')
|
|
|
- }
|
|
|
- showPublishPop.value=false
|
|
|
- getReportDetail()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-// 推送消息
|
|
|
-function handleReportMessageSend(publish){
|
|
|
- apiReport.reportMessageSend({
|
|
|
- ReportId:Number(route.query.id)
|
|
|
- }).then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- if(publish){
|
|
|
- showToast('发布且推送成功')
|
|
|
- }else{
|
|
|
- showToast('推送成功')
|
|
|
- }
|
|
|
- getReportDetail()
|
|
|
- showPublishPop.value=false
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
|
|
|
// 取消发布
|
|
|
function handleReportPublishCancle(){
|
|
@@ -79,24 +37,73 @@ function handleReportPublishCancle(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 发布弹窗关闭
|
|
|
+function handlePublishPopClose(refresh){
|
|
|
+ if(refresh){
|
|
|
+ getReportDetail()
|
|
|
+ }
|
|
|
+ showPublishPop.value=false
|
|
|
+}
|
|
|
+
|
|
|
+// 删除报告
|
|
|
+function handleDelReport(){
|
|
|
+ showDialog({
|
|
|
+ title: '提示',
|
|
|
+ message: '删除操作不可恢复,确认删除吗?',
|
|
|
+ showCancelButton:true
|
|
|
+ }).then(() => {
|
|
|
+ // on close
|
|
|
+ apiReport.reportDel({ReportIds:Number(route.query.id)}).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ showToast('删除成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ window.close()
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(()=>{})
|
|
|
+}
|
|
|
+
|
|
|
+// 推送消息
|
|
|
+function handleReportSendMsg(){
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="report-detail-page" v-if="reportInfo">
|
|
|
- <template v-if="reportInfo.State===1">
|
|
|
- <van-button type="primary" @click="showPublishPop=true">发布</van-button>
|
|
|
- <van-button type="primary">删除</van-button>
|
|
|
- </template>
|
|
|
- <template v-if="reportInfo.State===2">
|
|
|
- <van-button type="primary" @click="handleReportPublishCancle">取消发布</van-button>
|
|
|
- <van-button type="primary" @click="handleReportMessageSend">推送消息</van-button>
|
|
|
- </template>
|
|
|
-
|
|
|
- <span>第{{reportInfo.Stage}}期/{{reportInfo.Frequency}}</span>
|
|
|
- <div>{{reportInfo.Title}}</div>
|
|
|
- <div><span>{{reportInfo.Author}}</span><span>{{reportInfo.PublishTime}}</span></div>
|
|
|
- <div>{{reportInfo.Abstract}}</div>
|
|
|
- <div v-html="reportInfo.Content"></div>
|
|
|
+ <div class="top-stage-box">
|
|
|
+ <span class="stage">第{{reportInfo.Stage}}期 / {{reportInfo.Frequency}}</span>
|
|
|
+ <template v-if="reportInfo.State===1">
|
|
|
+ <!-- 删除 -->
|
|
|
+ <div class="btn-item" @click="handleDelReport">
|
|
|
+ <img src="@/assets/imgs/icon_del.png" alt="">
|
|
|
+ </div>
|
|
|
+ <!-- 发布 -->
|
|
|
+ <div class="btn-item" @click="showPublishPop=true">
|
|
|
+ <img src="@/assets/imgs/report/icon_publish.png" alt="">
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="reportInfo.State===2">
|
|
|
+ <!-- 推送消息 -->
|
|
|
+ <div class="btn-item" @click="handleReportSendMsg">
|
|
|
+ <img src="@/assets/imgs/icon_publish.png" alt="">
|
|
|
+ </div>
|
|
|
+ <!-- 取消发布 -->
|
|
|
+ <div class="btn-item" @click="showPublishPop=true">
|
|
|
+ <img src="@/assets/imgs/report/icon_publish.png" alt="">
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <h1 class="report-title">{{reportInfo.Title}}</h1>
|
|
|
+ <div class="auth-box">
|
|
|
+ <span>{{reportInfo.Author}}</span>
|
|
|
+ <span>{{reportInfo.PublishTime}}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="report-abstract">{{reportInfo.Abstract}}</div>
|
|
|
+ <div class="report-html-wrap" v-html="reportInfo.Content"></div>
|
|
|
</div>
|
|
|
<!-- 报告发布弹窗 -->
|
|
|
<van-popup
|
|
@@ -104,18 +111,57 @@ function handleReportPublishCancle(){
|
|
|
position="center"
|
|
|
round
|
|
|
>
|
|
|
- <div class="publish-report-pop-box">
|
|
|
- <div>发布提示</div>
|
|
|
- <p>是否发布报告,且推送模板消息和客户群?</p>
|
|
|
- <div>
|
|
|
- <van-button square type="primary" text="取消发布" @click="showPublishPop=false"/>
|
|
|
- <van-button square type="primary" text="仅发布" @click="handleConfirmPublish(1)"/>
|
|
|
- <van-button square type="primary" text="发布&推送" @click="handleConfirmPublish(2)"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <ReportPublishPop :reportId="$route.query.id" @close="handlePublishPopClose"/>
|
|
|
</van-popup>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-
|
|
|
+.report-detail-page{
|
|
|
+ padding: 30px 34px;
|
|
|
+ .report-title{
|
|
|
+ margin: 30px 0;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 42px;
|
|
|
+ line-height: 56px;
|
|
|
+ }
|
|
|
+ .auth-box{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: $font-grey;
|
|
|
+ font-size: 36px;
|
|
|
+ padding-bottom: 40px;
|
|
|
+ border-bottom: 1px solid $border-color;
|
|
|
+ }
|
|
|
+ .report-abstract{
|
|
|
+ font-size: 34px;
|
|
|
+ line-height: 54px;
|
|
|
+ margin: 40px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.top-stage-box{
|
|
|
+ .stage{
|
|
|
+ display: inline-block;
|
|
|
+ background-color: #F2F3FF;
|
|
|
+ border-radius: 8px;
|
|
|
+ height: 72px;
|
|
|
+ line-height: 72px;
|
|
|
+ padding: 0 20px;
|
|
|
+ font-size: 28px;
|
|
|
+ }
|
|
|
+ .btn-item{
|
|
|
+ float: right;
|
|
|
+ width: 70px;
|
|
|
+ height: 70px;
|
|
|
+ border-radius: 50%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ background-color: #F2F3FF;
|
|
|
+ margin-left: 40px;
|
|
|
+ img{
|
|
|
+ width: 48px;
|
|
|
+ height: 48px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|