shanbinzhang 1 month ago
parent
commit
8ccadb2375

+ 9 - 0
src/routes/modules/oldRoutes.js

@@ -311,6 +311,15 @@ export default [
         meta:{
           name_en:"Report Center"
         }
+      },
+
+      {
+        path: 'reportPushList',
+        name:'推送管理',
+        component: () => import("@/views/report_manage/pushMessageList.vue"),
+        meta:{
+          name_en:"Push Manage"
+        }
       }
     ],
   },

+ 6 - 0
src/utils/buttonConfig.js

@@ -43,6 +43,10 @@ export const reportManageBtn={
     reportMange_chapter_share: 'reportMange:chapter:share',//章节分享
     reportMange_chapter_editTag: 'reportMange:chapter:editTag',//章节添加标签
     reportMange_history: 'reportManage:history',//历史记录
+
+    reportPush_setView: 'reportPush:setView',
+    reportPush_recordView: 'reportPush:setView',
+    reportPush_setBtn: 'reportPush:setBtn',
 }
 /*
  *--------智能研报列表----------- 
@@ -197,6 +201,8 @@ export const pptPermission ={
     ppt_setShare:'ppt:setShare',//设置共享
     ppt_visible:'ppt:visible',//可见权限
     ppt_history:'ppt:history',//添加我的目录
+
+    ppt_sendMsg:'ppt:sendMsg',//推送消息/已推送消息
 }
 /*
 *--------英文PPT---------- 

+ 1 - 0
src/views/ppt_manage/newVersion/pptCatalog.vue

@@ -432,6 +432,7 @@ export default {
           'download':checkPermissionBtn(pptPermission.ppt_download)&&((item.State===6&&item.ReportSource===2) || item.ReportSource===1),
           'edit':checkPermissionBtn(pptPermission.ppt_save)&&item.HasAuth&&(([3,5].includes(item.State)&&item.ReportSource===2) || item.ReportSource===1),
           'delete':checkPermissionBtn(pptPermission.ppt_del)&&item.ReportSource===1&&item.AdminId===this.RoleId,
+          'push': [2,6].includes(item.State)
       }
 
       return toolList.filter((i)=>btnAuthMap[i.key]) 

+ 94 - 0
src/views/report_manage/components/reportReceiveSet.vue

@@ -0,0 +1,94 @@
+<template>
+  <div class="content-box">
+    <el-tree
+      :data="list"
+      node-key="Id"
+      :props="{
+          label: 'ClassifyName',
+          children: 'Child'
+      }"
+      check-strictly
+      :empty-text="$t('Common.no_classify_msg')"
+      draggable
+      indent='76'
+      :allow-drop="canDropHandle"
+      @node-drop="dropOverHandle"
+    >
+      <div
+        class="classify-item-wrap"
+        slot-scope="{ data }"
+      >
+                  <div>
+                      <span 
+                          :class="['tag', data.Enabled==1?'open':'close']" 
+                          @click.stop="handleEnableSet(data)">
+                          {{data.Enabled==1?$t('Common.enable'):$t('Common.disable')}}
+                      </span>
+                      <span>{{data.ClassifyName}}</span>
+                  </div>
+        
+                  <div class="opt-box">
+                      <!-- 章节设置 -->
+                      <span class="editsty" 
+                          v-if="(!data.Child||(data.Child&&!data.Child.length)) && data.ClassifyType===1" 
+                          @click="handleSetUser(data)"
+                      >
+                        配置人员
+                      </span>
+                  </div>
+      </div>
+    </el-tree>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      list: []
+    }
+  },
+  mounted(){
+
+  },
+  methods:{
+
+  },
+}
+</script>
+<style scoped lang='scss'>
+.content-box{
+    padding: 20px;
+    margin-top: 20px;
+    height: calc(100vh - 260px);
+    overflow-y: auto;
+    background-color: #FFFFFF;
+    .classify-item-wrap{
+        flex: 1;
+        padding-right: 20px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        .tag{
+            display: inline-block;
+            min-width: 76px;
+            line-height: 30px;
+            text-align: center;
+            &.open{
+                background-color: #ECF2FE;
+                color: #0052D9;
+            }
+            &.close{
+                background-color: #0052D9;
+                color: #fff;
+            }
+        }
+        .opt-box{
+            .icon-drag,.icon-set{
+                width: 16px;
+                height: 16px;
+                margin-left: 10px;
+            }
+        }
+    } 
+}
+</style>

+ 141 - 0
src/views/report_manage/components/repotPushRecord.vue

@@ -0,0 +1,141 @@
+<template>
+  <div>
+    <div class="filter-cont">
+      <el-cascader
+          @change="filterChange"
+          :options="classifyOptions"
+          v-model="filterForm.classifyIds"
+          :props="{
+            value: 'Id',
+            label: 'ClassifyName',
+            children: 'Child'
+          }"
+          clearable
+          :placeholder="$t('ReportManage.smart_type_filtering')"
+          style="width:240px;"
+      ></el-cascader>
+
+      <el-select
+        v-model="filterForm.reportType"
+        style="width: 240px"
+      >
+        <el-option label="报告" value="report"/>
+        <el-option label="PPT" value="ppt"/>
+      </el-select>
+
+      <el-select
+        v-model="filterForm.pushStatus"
+        style="width: 240px"
+      >
+        <el-option 
+          :label="status.label" 
+          :value="status.value" 
+          v-for="status in pushStatusOptions" 
+          :key="status.key"
+        />
+      </el-select>
+    </div>
+
+    <el-table
+      :data="list"
+      ref="tableRef"
+      highlight-current-row
+      border
+    >
+      <el-table-column
+        v-for="item in tableColums"
+        :key="item.label"
+        :label="item.label"
+        :width="item.widthsty"
+        :min-width="item.minwidthsty"
+        align="center"
+      >
+        <template slot-scope="scope">
+            
+          <span>{{ scope.row[item.key] }}</span>
+        </template>
+      </el-table-column>
+      <div slot="empty">
+        <tableNoData text="暂无记录" size="mini"/>
+      </div>
+    </el-table>
+
+    <div style="height:35px;margin: 20px 0;">
+      <m-page
+        :page_no="filterForm.pageNo"
+        :pageSize="filterForm.pageSize"
+        :total="total"
+        @handleCurrentChange="pageChange"
+      />
+    </div>
+  </div>
+</template>
+<script>
+import {
+  classifylist
+} from '@/api/modules/reportV2.js';
+import mPage from '@/components/mPage.vue'
+export default {
+  components: { mPage },
+  data() {
+    return {
+      filterForm: {
+
+      },
+      pushStatusOptions: [
+        { label: '推送成功',value: 1 },
+        { label: '推送失败',value: 2 },
+      ],
+
+      tableColums: [
+        { label:'报告标题',key:'Title' },
+        { label:'报告分类',key:'Classify' },
+        { label:'报告类型',key:'Type' },
+        { label:'操作人',key:'' },
+        { label:'接收人',key:'' },
+        { label:'推送状态',key:'' },
+        { label:'操作时间',key:'ModifyTime' },
+      ],
+
+      list: [],
+      total: 0,
+      pageSize: 10,
+      pageNo: 1
+    }
+  },
+  mounted(){
+
+  },
+  methods:{
+    pageChange(page) {
+      this.pageNo = page;
+      this.getList()
+    },
+
+    filterChange() {
+      this.pageChange(1)
+    },
+
+    getList() {
+      
+    },
+
+     getclassifylist() {
+      //获取分类列表
+      let params = { CurrentIndex: 0, PageSize: 1000, KeyWord: "",ClassifyType:1 };
+
+      classifylist(params).then((res) => {
+        if (res.Ret == 200 && Array.isArray(res.Data.List)) {
+          this.classifyOptions = res.Data.List||[];
+          
+        }
+      });
+    },
+  },
+}
+</script>
+<style scoped lang='scss'>
+.filter-cont {
+  margin-bottom: 10px;
+}
+</style>

+ 71 - 0
src/views/report_manage/pushMessageList.vue

@@ -0,0 +1,71 @@
+<template>
+  <div class="report-push-page">
+    <div class="top">
+      <div 
+        :class="['tab-item',{ 'act': item.key===defaultTab }]" 
+        v-for="item in tabs" 
+        :key="item.key"
+        @click="defaultTab=item.key"
+      >
+        {{item.label}}
+      </div>
+    </div>
+
+    <div class="main">
+      <components
+        :is="defaultTab==='record'?'repotPushRecord':'reportReceiveSet'"
+      />
+    </div>
+  </div>
+</template>
+<script>
+import repotPushRecord from './components/repotPushRecord.vue'
+import reportReceiveSet from './components/reportReceiveSet.vue'
+export default {
+  components: { repotPushRecord,reportReceiveSet },
+  data() {
+    return {
+      defaultTab: 'record',
+      tabs: [
+        { label: '推送记录', key:'record' },
+        { label: '接收人员配置', key:'set' },
+      ]
+    }
+  },
+  mounted(){
+    
+  },
+  methods:{
+
+  },
+}
+</script>
+<style scoped lang='scss'>
+* {
+  box-sizing: border-box;
+}
+.report-push-page {
+  padding: 20px;
+  height: calc(100vh - 120px);
+  overflow-y: auto;
+  background-color: #FFFFFF;
+
+  .top {
+    display: flex;
+    gap: 20px;
+    .tab-item {
+      border-bottom: 2px solid transparent;
+      font-size: 16px;
+      padding-bottom: 5px;
+      &.act {
+        color: #0052D9;
+        border-color: #0052D9;
+      }
+    }
+  }
+
+  .main {
+    margin-top: 20px;
+  }
+}
+</style>

+ 13 - 9
src/views/report_manage/reportV2/list.vue

@@ -545,7 +545,7 @@ export default {
         {label:"撤销",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_cancelPublish'),States:[4,5,6],text:'ReportManage.smart_btn.withdraw'},
         {label:"下载Pdf",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_exportPdf'),States:[2,6],text:'ReportManage.smart_btn.download_pdf'},
         {label:"下载长图",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_exportImg'),States:[2,6],text:'ReportManage.smart_btn.download_long_image'},
-        // {label:"推送消息",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_sendMsg'),States:[2,6],text:'ReportManage.smart_push_notification_btn'},
+        {label:"推送消息",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_sendMsg'),States:[2,6],text:'ReportManage.smart_push_notification_btn'},
         // {label:"已推送消息",permission:this.permissionBtn.isShowBtn('reportManageBtn','reportManage_sendMsg'),States:[2,6],text:'ReportManage.smart_notification_pushed'},
       ],
 
@@ -943,14 +943,18 @@ export default {
     },
 
     // 推送消息(同时推送模板消息和客群消息)
-    messageSend(item) {
-      reportMessageSend({ ReportId: item.Id }).then((res) => {
-        if (res.Ret === 200) {
-          this.$message.success(this.$t('ReportManage.smart_msg.push_success'));
-          item.MsgIsSend = 1;
-          item.MsgSendTime = res.Data.MsgSendTime;
-        }
-      });
+    async messageSend(item) {
+      await this.$confirm('报告将被推送到订阅号,无法撤回,确定推送吗?','提示',{
+        type: 'warning'
+      })
+
+      const res = await reportMessageSend({ ReportId: item.Id })
+
+      if (res.Ret === 200) {
+        this.$message.success(this.$t('ReportManage.smart_msg.push_success'));
+        item.MsgIsSend = 1;
+        item.MsgSendTime = res.Data.MsgSendTime;
+      }
     },
 
     //操作