Bläddra i källkod

智能研报添加sheet顶部拼个标题

Karsa 10 månader sedan
förälder
incheckning
ee875119a0

+ 2 - 1
src/views/classify_manage/classifylistV2.vue

@@ -14,6 +14,7 @@
                 </div>
             </div>
             <div style="display:flex;padding:10px;gap:10px">
+                <el-button type="primary" @click="transferReport">分类报告转移</el-button>
                 <!-- 添加分类 -->
                 <el-button 
                     type="primary"
@@ -58,7 +59,7 @@
                     <div class="opt-box">
                         <!-- 章节设置 -->
                         <span class="editsty" 
-                            v-if="['晨报','周报'].includes(data.ClassifyName)" 
+                            v-if="!data.Child" 
                             @click="chapterSetting(data)" 
                             v-permission="permissionBtn.classifyBtn.classifyList_cnClassify_chapterSetting">
                             {{ $t('ReportManage.CategoryList.section_settings') }}

+ 213 - 12
src/views/report_manage/reportV2/components/chapterEditWrapper.vue

@@ -48,17 +48,16 @@
                   style="width: 14px; height: 14px; margin-right: 8px"
                 />
                 
-                <el-dropdown trigger="click">
+                <el-dropdown trigger="click" @command="handleChapterItem">
                   <span class="el-dropdown-link">
                     <i class="el-icon-more"></i>
                   </span>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item>基础信息</el-dropdown-item>
-                    <el-dropdown-item>编辑</el-dropdown-item>
-                    <el-dropdown-item>删除</el-dropdown-item>
-                    <el-dropdown-item>添加标签</el-dropdown-item>
-                    <el-dropdown-item>上传录音</el-dropdown-item>
-                    <el-dropdown-item>微信分享</el-dropdown-item>
+                    <el-dropdown-item :command="{type:'beseInfo',item}">基础信息</el-dropdown-item>
+                    <el-dropdown-item :command="{type:'del',item}">删除</el-dropdown-item>
+                    <el-dropdown-item :command="{type:'adTag',item}">添加标签</el-dropdown-item>
+                    <el-dropdown-item :command="{type:'upAudio',item}">上传录音</el-dropdown-item>
+                    <el-dropdown-item :command="{type:'wxShare',item}">微信分享</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
               </div>
@@ -69,17 +68,127 @@
     </div>
 
     <!-- 添加章节弹窗 -->
-    <mDialog>
-      <div slot="footer">
+    <m-dialog
+      title="添加章节" 
+      :show.sync="isOpenChapterDia" 
+      width="650px"
+      @close="isOpenChapterDia=false"
+    >
+      <div class="chapter-dialog-main">
+        <el-form 
+          :model="chapterInfo" 
+          :rules="chapterRules" 
+          ref="formRef" 
+          label-position="left"
+          hide-required-asterisk
+          label-width="120px"
+        >
+          <el-form-item prop="chapterName" label="章节名称">
+              <el-input
+                type="text" 
+                v-model="chapterInfo.chapterName"
+                style="width:350px;"
+                placeholder="请输入章节名称"
+              />
+          </el-form-item>
+          <el-form-item prop="editors" label="关联品种">
+              <template slot="label">
+                  <el-tooltip class="item" effect="dark" :content="$t('ReportManage.CategoryList.related_variety_hint')">
+                      <div>
+                          <span>{{ $t('ReportManage.CategoryList.related_variety') }}</span>
+                          <i class="el-icon-info"></i>
+                      </div>
+                  </el-tooltip>
+              </template>
 
+              <el-cascader
+                  :options="reportVarietyOpts" 
+                  v-model="chapterInfo.varietys" 
+                  placeholder="请选择关联品种"
+                  collapse-tags
+                  :show-all-levels="false"
+                  :props="{
+                    value:'PermissionId',
+                    label:'PermissionName',
+                    children:'Child',
+                    multiple: true,
+                    emitPath:false
+                  }" 
+                  style="width:350px;"
+                  clearable
+              ></el-cascader>
+          </el-form-item>
+          <el-form-item prop="editors" label="编辑人">
+            <el-cascader
+              v-model="chapterInfo.editors"
+              :options="userOpts"
+              :show-all-levels="false"
+              collapse-tags
+              filterable
+              :props="{
+                value:'ItemId',
+                label:'ItemName',
+                children:'Children',
+                emitPath: false,
+                multiple: true
+              }"
+              clearable
+              placeholder="请选择编辑人"
+              style="width:350px;"
+            />
+
+          </el-form-item>
+        </el-form>
+      </div>
+      <div slot="footer" style="margin-top: 20px;">
+        <el-button
+          @click="isOpenChapterDia=false"
+          style="width: 132px; height: 40px"
+        ><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
+        <el-button
+          @click="handleSaveChapter"
+          type="primary"
+          style="width: 132px; height: 40px"
+        ><!-- 保存 -->{{$t('Dialog.confirm_save_btn')}}</el-button>
       </div>
 
-    </mDialog>
+    </m-dialog>
+
+    <!-- 添加标签弹窗 -->
+    <m-dialog
+      :show.sync="isOpenChapterTag"
+      :title="$t('ReportManage.ReportList.set_tags_title')"
+      width="400px"
+    >
+        <div class="edit-tag-wrap">
+            <span>{{chapterInfo.title}}</span>
+            <el-select
+              v-model="chapterInfo.tags"
+              filterable
+              allow-create
+              default-first-option
+              :placeholder="$t('ReportManage.ReportList.select_ipt_pld')">
+              <el-option
+                  v-for="item in tagOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+              </el-option>
+            </el-select>
+            <div style="margin:30px 0;text-align:center">
+                <el-button type="primary" plain @click="isOpenChapterTag=false">{{$t('Dialog.cancel_btn')}}</el-button>
+                <el-button type="primary" @click="handleSaveChapterTag">{{$t('Dialog.confirm_btn')}}</el-button>
+            </div>
+        </div>
+      </m-dialog>
+
   </div>
 </template>
 <script>
 import draggable from 'vuedraggable';
 import mDialog from '@/components/mDialog.vue';
+import {reportVarietyInterence} from '@/api/modules/reportVariety';
+import { dataAuthInterface,chapterTrendTagList } from '@/api/api.js';
 export default {
   components: { draggable,mDialog },
   data() {
@@ -117,15 +226,100 @@ export default {
 
       startIndex: 0,
       preIndex: 0,
-      nextIndex: 0
+      nextIndex: 0,
+
+      /* 章节弹窗 */
+      isOpenChapterDia: false,
+      reportVarietyOpts: [],
+      userOpts: [],
+      chapterInfo: {
+        varietys:[],
+        editors:[],
+        chapterName:'',
+        tags: []
+      },
+      chapterRules: {
+        chapterName: [{
+          required:true,message:'章节名称不能为空',trigger:'blur'
+        }],
+        editors: [{
+          required:true,message:'编辑人不能为空',trigger:'blur'
+        }],
+      },
+
+      /* 标签弹窗 */
+      isOpenChapterTag: false,
+      tagOptions: []
     }
   },
   mounted(){
-
+    this.getReportVarietyList();
+    this.getUserList();
+    this.getChapterTrendTagList();
   },
   methods:{
     openAddChapter() {
+      this.isOpenChapterDia = true;
+      
+    },
+
+    /* 保存章节编辑 */
+    handleSaveChapter() {
+      
+    },
 
+    /* 章节操作 */
+    handleChapterItem({type,item}) {
+      console.log(type,item)
+      switch(type) {
+        case 'beseInfo': 
+          this.openAddChapter(item);
+          break
+        case 'del':
+          break
+        case 'adTag': 
+          this.openAddChapterTag()
+          break
+        case 'upAudio': 
+          break
+        case 'wxShare':
+          break
+      }
+    },
+
+
+    openAddChapterTag() {
+      this.isOpenChapterTag = true;
+    },
+    /* 保存关联章节标签 */
+    handleSaveChapterTag() {
+      
+    },
+
+     // 获取品种数据
+    async getReportVarietyList(){
+      const res = await reportVarietyInterence.filterVarietyOpts();
+      if(res.Ret !== 200) return
+      
+      this.reportVarietyOpts=res.Data||[]
+    },
+
+    /* 获取用户列表 */
+    async getUserList() {
+      const res = await dataAuthInterface.userSearch();
+      if (res.Ret !== 200) return
+
+      this.userOpts = res.Data || []
+    },
+
+     //获取章节标签数据(仅在获取章节列表成功后获取一次)
+    async getChapterTrendTagList(){
+        const res=await chapterTrendTagList()
+        if(res.Ret!==200) return
+        
+        let arr=res.Data||[]
+
+        this.tagOptions=arr.map(item=>({value:item.KeyWord,label:item.KeyWord}))
     },
 
     /* 拖动开始 记录位置 */
@@ -210,3 +404,10 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+.chapter-dialog-main {
+  .el-cascader .el-input {
+    width: 100%;
+  }
+}
+</style>

+ 1 - 1
src/views/report_manage/reportV2/normalReport/mixins/reportMixin.js

@@ -313,7 +313,7 @@ export default {
       const { height, code } = e.data;
       let iframeDom = document.getElementsByClassName(`iframe${code}`);
       iframeDom.forEach((ele) => {
-        ele.height = `${height+1}px`;
+        ele.height = `${height}px`;
       });
     },
 

+ 2 - 1
src/views/report_manage/reportV2/smartReport/components/ETASheet.vue

@@ -61,7 +61,8 @@ export default {
             const obj={
                 compId:4,
                 compType:'sheet',
-                content:`${LINK_URL}?code=${item.UniqueCode}&fromScene=1`
+                content:`${LINK_URL}?code=${item.UniqueCode}&fromScene=1`,
+                title: item.ExcelName
             }
             return JSON.stringify(obj)
         },

+ 6 - 0
src/views/report_manage/reportV2/smartReport/components/SheetComp.vue

@@ -3,6 +3,12 @@
         class="report-comp-item sheet-comp"
         style="width:100%;overflow: hidden;"
     >
+        <div 
+            style="padding-left:10px;font-size:17px" 
+            contenteditable="true" 
+            v-html="compData.titleText"
+            v-if="compData.titleText"
+        ></div>
         <iframe :class="id" :src="compData.content" width="100%" style="border-width:0px;"></iframe>
     </div>
 </template>

+ 5 - 4
src/views/report_manage/reportV2/smartReport/editReport.vue

@@ -466,7 +466,7 @@ export default {
 
         // 跳转预览
         handlePreviewReport(){
-            const htmlStr=document.getElementById('report-html-content').outerHTML;
+            const htmlStr=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
             sessionStorage.setItem('smartReportContent', htmlStr);
             sessionStorage.setItem('smartReportContentBg', this.bgColor);
 			let { href } = this.$router.resolve({ 
@@ -523,7 +523,7 @@ export default {
             let iframeDom = document.getElementsByClassName(`iframe${code}`);
             // console.log(iframeDom);
             iframeDom.forEach((ele) => {
-                ele.height = `${height + 1}px`;
+                ele.height = `${height}px`;
             });
         },
 
@@ -556,6 +556,7 @@ export default {
                 compType:compData.compType,
                 id:this.getCompId(compData.compType),
                 content:compData.content||'',
+                titleText: compData.compId===4?compData.title:'',
                 style:compData.compType==='chart'?'height:350px':'',
                 child:[]
             }
@@ -771,7 +772,7 @@ export default {
 
         // 编辑保存报告
         handleReportEdit(e){
-            const html=document.getElementById('report-html-content').outerHTML;
+            const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
             const params={
                 SmartReportId:Number(this.$route.query.id)||0,
                 ...e,
@@ -913,7 +914,7 @@ export default {
         
         // 自动/存草稿保存内容
         handleSaveContent({isAutoSave}){
-            const html=document.getElementById('report-html-content').outerHTML;
+            const html=document.getElementById('report-html-content').outerHTML.replace(/contenteditable="true"/g,'contenteditable="false"');
             return new Promise((resolve,reject)=>{
                 const id=this.$route.query.id||0
                 if(!id) return

+ 1 - 1
src/views/system_manage/etaBaseConfig.vue

@@ -651,7 +651,7 @@ export default {
             sectionType:1,//1通用设置 2资源库
 
             reportFromType: [
-                { type:'smartReport',label: /* '智能研报' */ this.$t('SystemManage.BaseConfig.report_type1') },
+                // { type:'smartReport',label: /* '智能研报' */ this.$t('SystemManage.BaseConfig.report_type1') },
                 { type:'report',label: /* '研报列表' */this.$t('SystemManage.BaseConfig.report_type2') },
                 { type:'enReport',label: /* '英文研报' */this.$t('SystemManage.BaseConfig.report_type3') },
             ],