|
@@ -10,12 +10,13 @@ import moment from 'moment'
|
|
|
import { showToast,showDialog } from 'vant'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
|
-import {reportManageBtn} from '@/hooks/useAuthBtn'
|
|
|
+import {reportManageBtn,useAuthBtn} from '@/hooks/useAuthBtn'
|
|
|
import {usePublicSettingStore} from '@/store/modules/publicSetting'
|
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
|
const publicSettingStore = usePublicSettingStore()
|
|
|
|
|
|
const router=useRouter()
|
|
|
+const {checkAuthBtn} = useAuthBtn()
|
|
|
|
|
|
|
|
|
const {lastFocusPosition,initFroalaEditor}=useInitFroalaEditor()
|
|
@@ -210,6 +211,11 @@ async function handleReportOpt(type){
|
|
|
}
|
|
|
}else{
|
|
|
// 显示发布提示弹窗,提示推送客群
|
|
|
+ //判断是否有推送权限
|
|
|
+ if(!checkAuthBtn(reportManageBtn.reportManage_sendMsg)){
|
|
|
+ handleConfirmPublish(1)
|
|
|
+ return
|
|
|
+ }
|
|
|
showPublishPop.value=true
|
|
|
}
|
|
|
}
|
|
@@ -264,13 +270,30 @@ async function reportPublish(id){
|
|
|
const showDSFBTime=ref(false)
|
|
|
function onConfirmDSFBTime(time){
|
|
|
console.log(time);
|
|
|
+ const isAuthPushMsg=checkAuthBtn(reportManageBtn.reportManage_sendMsg)
|
|
|
+ console.log(isAuthPushMsg);
|
|
|
showDialog({
|
|
|
title: '提示',
|
|
|
- message:'是否发布定时报告,并推送模板消息?',
|
|
|
- confirmButtonText:'推送',
|
|
|
- cancelButtonText:'不推送',
|
|
|
+ message:isAuthPushMsg?'是否发布定时报告,并推送模板消息?':'是否发布定时报告',
|
|
|
+ confirmButtonText:isAuthPushMsg?'推送':'取消',
|
|
|
+ cancelButtonText:isAuthPushMsg?'不推送':'确定',
|
|
|
showCancelButton:true
|
|
|
}).then(()=>{
|
|
|
+ if(!isAuthPushMsg){
|
|
|
+ apiReport.reportPublishTimeSet({
|
|
|
+ ReportId:reportId,
|
|
|
+ PrePublishTime:time,
|
|
|
+ PreMsgSend:0
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ showToast('定时发布成功!')
|
|
|
+ setTimeout(() => {
|
|
|
+ router.back()
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
//推送
|
|
|
apiReport.reportPublishTimeSet({
|
|
|
ReportId:reportId,
|
|
@@ -285,6 +308,7 @@ function onConfirmDSFBTime(time){
|
|
|
}
|
|
|
})
|
|
|
}).catch(()=>{
|
|
|
+ if(!isAuthPushMsg) return
|
|
|
//不推送
|
|
|
apiReport.reportPublishTimeSet({
|
|
|
ReportId:reportId,
|