浏览代码

fix: 一些历史问题修复

Karsa 1 年之前
父节点
当前提交
9c2bf9c19c

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

@@ -1008,6 +1008,7 @@ export default {
     //自动保存PPT
     autoSave(){
       if(this.loopTimer) return 
+      if(!this.$route.query.id&&!this.pptId) return
       this.loopTimer = setInterval(()=>{
         const ppt_id = this.$route.query.id||this.pptId
         const {Title,ReportType,PptDate,BackgroundImg,BackIndex} = this.firstPage

+ 145 - 329
src/views/report_manage/editChapterReport.vue

@@ -61,33 +61,10 @@
           border: 1px solid #3464e0;
         "
       >
-        <div id="tabs">
-          <p
-            @click="tabsactive = '基础信息'"
-            :class="{ active: tabsactive == '基础信息' ? true : false }"
-          >
-            基础信息
-          </p>
-          <p
-            @click="tabsactive = '图表插入'"
-            :class="{ active: tabsactive == '图表插入' ? true : false }"
-          >
-            图表插入
-          </p>
-          <p
-            @click="tabsactive = 'MyETA批量插入'"
-            :class="{ active: tabsactive == 'MyETA批量插入' ? true : false }"
-          >
-            MyETA插入
-          </p>
-          <p
-            @click="tabsactive = '沙盘插入'"
-            :class="{ active: tabsactive == '沙盘插入' ? true : false }"
-          >
-            沙盘插入
-          </p>
-        </div>
-        <div
+        <el-tabs v-model="tabsactive">
+					<el-tab-pane :label="tab" :name="tab" v-for="tab in panelTabs" :key="tab"></el-tab-pane>
+				</el-tabs>
+				<div
           v-if="tabsactive == '基础信息'"
           style="height: calc(100vh - 280px); overflow-y: auto"
         >
@@ -185,115 +162,130 @@
             </el-form-item>
           </el-form>
         </div>
-        <div v-if="tabsactive == '图表插入'">
-          <el-input
-            placeholder="标题/子标题/作者"
-            v-model="key_word"
-            size="medium"
-            prefix-icon="el-icon-search"
-            @input="
-              () => {
-                search_page = 1;
-                $refs.chartListRef.scrollTop = 0;
-                getChartList(key_word);
-              }
-            "
-          >
-          </el-input>
-          <el-radio-group
-            v-model="chart_source"
-            @change="
-              () => {
-                search_page = 1;
-                $refs.chartListRef.scrollTop = 0;
-                getChartList('');
-              }
-            "
-            style="margin-top: 10px"
-          >
-            <el-radio :label="1">ETA图库</el-radio>
-            <el-radio :label="2">商品价格曲线</el-radio>
-            <el-radio :label="3">相关性图表</el-radio>
-            <el-radio :label="6">拟合方程曲线</el-radio>
-            <el-radio :label="7">统计特征</el-radio>
-          </el-radio-group>
-          <div style="margin: 10px 0">
-            <el-checkbox
-              v-model="isShowMe"
-              @change="
-                () => {
-                  search_page = 1;
-                  $refs.chartListRef.scrollTop = 0;
-                  getChartList(key_word);
-                }
-              "
-              >只看我的</el-checkbox
-            >
-          </div>
-          <div
-            ref="chartListRef"
-            style="
-              height: calc(100vh - 320px);
-              overflow-x: hidden;
-              overflow-y: auto;
-            "
-            v-infinite-scroll="loadReportHandle"
-            :infinite-scroll-immediate="false"
-          >
-            <div
-              v-for="(item, index) in chartlist"
-              :key="item.ChartInfoId"
-              class="liststy"
-              :style="item.Disabled && 'cursor: not-allowed;'"
-            >
-              <p class="color_primary">{{ item.ChartName }}</p>
-              <img
-                :src="item.ChartImage"
-                :id="'listnode' + index"
-                @click="insertHtml(item)"
-              />
-            </div>
-          </div>
-        </div>
-        <div v-if="tabsactive == '沙盘插入'">
-          <el-input
-            placeholder="沙盘名称/品种"
-            v-model="sandTabelQuery.Keyword"
-            size="medium"
-            prefix-icon="el-icon-search"
-          >
-          </el-input>
-          <div
-            id="sandTable-container"
-            ref="sandTable"
-            style="
-              height: calc(100vh - 320px);
-              overflow-x: hidden;
-              overflow-y: auto;
-            "
-            @scroll="sandTableHandleScroll"
-          >
-            <div
-              v-for="(item, index) in sandTableList"
-              :key="item.SandboxId"
-              class="liststy"
-            >
-              <p class="color_primary">{{ item.Name }}</p>
-              <img
-                :src="item.PicUrl"
-                :id="'sandTable' + index"
-                @click="insertHtml(item, 'image')"
-              />
-              <p class="source-identification">来源:弘则研究</p>
-            </div>
-            <div v-loading="sandTableLoading" class="loaded-text">
-              {{ loadedText }}
-            </div>
-          </div>
-        </div>
-        <div v-if="tabsactive == 'MyETA批量插入'">
-          <importMyChart @handleImportMyChart="handleImportMyChart" />
-        </div>
+				<div v-if="tabsactive == '图表插入'">
+					<el-input
+						placeholder="图表名称"
+						v-model="key_word"
+						size="medium"
+						prefix-icon="el-icon-search"
+						@input="() => {search_page=1;$refs.chartListRef.scrollTop = 0;getreportlist(key_word)}"
+					>
+					</el-input>
+					<el-radio-group v-model="chart_source" @change="() => {search_page=1;$refs.chartListRef.scrollTop = 0;getreportlist()}" style="margin-top: 10px;">
+						<el-radio :label="1">ETA图库</el-radio>
+						<el-radio :label="2">商品价格曲线</el-radio> 
+						<el-radio :label="3">相关性图表</el-radio>
+						<el-radio :label="6">拟合方程曲线</el-radio>
+						<el-radio :label="7">统计特征</el-radio>
+					</el-radio-group>
+					<div style="margin: 10px 0">
+						<el-checkbox v-model="isShowMe" @change="() => {search_page=1;$refs.chartListRef.scrollTop = 0;getreportlist(key_word)}">只看我的</el-checkbox>
+					</div>
+					<div
+						id="reportwin"
+						ref="chartListRef"
+						style="
+							height: calc(100vh - 370px);
+							overflow-x: hidden;
+							overflow-y: auto;
+						"
+						v-infinite-scroll="loadReportHandle"
+						:infinite-scroll-immediate="false"
+					>
+						<template v-if="newreportlist.length">
+							<div
+								v-for="(item, index) in newreportlist"
+								:key="item.ChartInfoId"
+								:style="item.Disabled && 'cursor: not-allowed;'"
+								class="liststy"
+							>
+								<p class="color_primary">{{ item.ChartName }}</p>
+								<img
+									:src="item.ChartImage"
+									:id="'listnode' + index"
+									@click="insertHtml(item)"
+								/>
+							</div>
+						</template>
+
+						<tableNoData text="暂无图表" size="mini" v-else/>
+					</div>
+
+				</div>
+				<div v-if="tabsactive == '沙盘插入'">
+					<el-input
+						placeholder="沙盘名称/品种"
+						v-model="sandTabelQuery.Keyword"
+						size="medium"
+						prefix-icon="el-icon-search"
+					>
+					</el-input>
+					<div
+						id="sandTable-container"
+						ref="sandTable"
+						style="
+							height: calc(100vh - 370px);
+							overflow-x: hidden;
+							overflow-y: auto;
+						"
+						@scroll="sandTableHandleScroll"
+					>
+						<template v-if="sandTableList.length">
+							<div
+								v-for="(item, index) in sandTableList"
+								:key="item.SandboxId"
+								class="liststy"
+							>
+								<p class="color_primary">{{ item.Name }}</p>
+								<img
+									:src="item.PicUrl"
+									:id="'sandTable' + index"
+									@click="insertHtml(item,'image')"
+								/>
+								<p class="source-identification">来源:弘则研究</p>
+							</div>
+						</template>
+						<tableNoData text="暂无数据" size="mini" v-else/>
+					</div>
+				</div>
+				<div v-if="tabsactive == '表格插入'">
+					<el-input
+						placeholder="表格名称"
+						v-model="sheetSearchObj.Keyword"
+						size="medium"
+						prefix-icon="el-icon-search"
+						@input="getSheetList"
+					>
+					</el-input>
+					<div
+						style="
+							height: calc(100vh - 370px);
+							overflow-x: hidden;
+							overflow-y: auto;
+						"
+					>
+						<template v-if="sheetSearchList.length">
+							<div
+								v-for="item in sheetSearchList"
+								:key="item.ExcelInfoId"
+								class="liststy"
+							>
+								<p class="color_primary">{{ item.ExcelName }}</p>
+								<img
+									:src="item.ExcelImage"
+									:id="'sheet' + item.ExcelInfoId"
+									style="object-fit: contain;height: 250px;"
+									@click="insertHtml(item,'sheet')"
+								/>
+							</div>
+						</template>
+
+						<tableNoData text="暂无数据" size="mini" v-else/>
+					</div>
+				</div>
+				<div v-if="tabsactive == 'MyETA批量插入'">
+					<importMyChart @handleImportMyChart="handleImportMyChart"/>
+				</div>
       </div>
     </div>
   </div>
@@ -320,10 +312,9 @@ import {
   fittingEquationInterface,
   statisticFeatureInterface,
 } from "@/api/modules/chartRelevanceApi";
-import VueFroala from "vue-froala-wysiwyg";
-import urlSlug from "url-slug";
 import http from "@/api/http.js";
 import mixinMsg from "./mixins/messagePush";
+import reportMixin from './mixins/reportMixin';
 import moment from "moment";
 import importMyChart from "./components/importMyChart.vue";
 let ALOSSINS = null; //阿里云上传实例
@@ -336,9 +327,8 @@ export default {
     to.matched[1].name = to.query.typename;
     next();
   },
-  mixins: [mixinMsg],
+  mixins: [mixinMsg,reportMixin],
   data() {
-    var that = this;
     return {
       //批量导入图表
       importChartNum: 0, //批量导入图表的数量 如果大于0则说明在加载
@@ -382,130 +372,13 @@ export default {
         ],
         addType: [{ required: true, message: "请选择", trigger: "change" }],
       },
-      editor: null,
       lastEditRange: null,
-      froalaConfig: {
-        toolbarButtons: [
-          "insertImage",
-          "insertVideo",
-          "insertLink",
-          "embedly",
-          "insertFile",
-          "textColor",
-          "bold",
-          "italic",
-          "underline",
-          "strikeThrough",
-          "subscript",
-          "superscript",
-          "fontFamily",
-          "fontSize",
-          "color",
-          "inlineClass",
-          "inlineStyle",
-          "paragraphStyle",
-          "lineHeight",
-          "paragraphFormat",
-          "align",
-          "formatOL",
-          "formatUL",
-          "outdent",
-          "indent",
-          "quote",
-          "insertTable",
-          "emoticons",
-          "fontAwesome",
-          "specialCharacters",
-          "insertHR",
-          "selectAll",
-          "clearFormatting",
-          "html",
-          "undo",
-          "redo",
-        ],
-        imageDefaultWidth: false,
-        imageInsertButtons: ["imageUpload", "imageByURL"],
-        height: 800,
-        fontSizeDefaultSelection: "16",
-        fontSize: ["12", "14", "16", "18", "20", "24", "28", "32", "36", "40"],
-        theme: "dark", //主题
-        placeholderText: "请输入内容",
-        language: "zh_cn", //国际化
-        imageUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
-        imagePaste: true,
-        imagePasteProcess: true,
-        imageResize: true,
-        videoUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
-        fileUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
-        toolbarSticky: false, //操作栏是否自动吸顶
-        imageEditButtons: [
-          "imageLink",
-          "imageAlign",
-          "imageInfo",
-          "imageRemove",
-        ],
-        quickInsertButtons: ["image", "table", "ul", "ol", "hr"], //快速插入项
-        toolbarVisibleWithoutSelection: true, //是否开启 不选中模式
-        saveInterval: 0,
-        /* saveParam: 'Content',
-					saveURL: process.env.VUE_APP_API_ROOT+'/report/saveReportContent',
-					saveMethod: 'POST',
-					saveParams: {}, */
-        events: {
-          initialized: function () {
-            //this.editor 定义在vue data 中
-            that.editor = this;
-          },
-          keyup: function (e, editor) {
-            //添加事件,在每次按键按下时,都记录一下最后停留位置
-            that.lastEditRange = getSelection().getRangeAt(0) || 0;
-          },
-          click: function (e, editor) {
-            //添加事件,在每次鼠标点击时,都记录一下最后停留位置
-            if (getSelection().type === "None") return;
-            that.lastEditRange = getSelection().getRangeAt(0) || 0;
-          },
-          //内容改变事件
-          contentChanged: function () {
-            console.log("cont-change");
-            that.ischange = true;
-            if (getSelection().type !== "None") {
-              that.lastEditRange = getSelection().getRangeAt(0) || 0;
-            }
-          },
-          //粘贴图片上传事件
-          "image.beforePasteUpload": function (img) {
-            //console.log('image.beforePasteUpload',img)
-            //暂停自动保存
-            that.autoSaveFlag = false;
-          },
-          //点击toolbar上传图片事件
-          "image.beforeUpload": function (imgs) {
-            //console.log('image.beforeUpload',imgs)
-            //暂停自动保存
-            that.autoSaveFlag = false;
-          },
-          "image.inserted": function ($img, response) {
-            //console.log('img-inserted',$img)
-            //开启自动保存
-            that.autoSaveFlag = true;
-          },
-          //如果上传图片出错,重置autoSaveFlag
-          "image.error": function (error, response) {
-            that.autoSaveFlag = true;
-          },
-        },
-        charCounterCount: false,
-      },
       reportloadding: false,
-      lastsavetime: "",
       timer: null,
       ischange: false,
-      isPublishloading: false,
 
       chapterTypeId: 0, //章节类型id
 
-      chart_source: 1,
       search_page: 1,
       search_page_sizes: 20,
       search_have_more: true,
@@ -517,17 +390,21 @@ export default {
   },
   mounted() {
     this.getreportdetail();
-    this.getChartList("");
-    // // $("#rightitems").css({minHeight:screen.height});
-    this.getSandTable();
+    this.getreportlist("");
+
+		this.getSandTable();
+		this.getSheetList();
     this.timer = setInterval(() => {
       this.autoSave();
     }, 6000);
+
+    window.addEventListener('message',this.reInitIframe)
   },
   updated() {
     $("#leftfroala").find("p").css({ fontSize: "16px" });
   },
   destroyed() {
+    window.removeEventListener('message',this.reInitIframe)
     if (this.timer) {
       clearInterval(this.timer);
     }
@@ -853,39 +730,6 @@ export default {
       this.isPublishloading = false;
     },
 
-    insertHtml(item, type = "html") {
-      //设置编辑器获取焦点
-      this.editor.events.focus();
-      // 获取选定对象
-      const selection = getSelection();
-      // 判断是否有最后光标对象存在
-      if (this.lastEditRange) {
-        // 存在最后光标对象,选定对象清除所有光标并添加最后光标还原之前的状态
-        selection.removeAllRanges();
-        selection.addRange(this.lastEditRange);
-      }
-      //插入内容
-      if (type === "image") {
-        this.$nextTick(() => {
-          this.editor.html.insert(
-            `<img style='width:100%' src='${item.PicUrl}' />`
-          );
-        });
-      } else {
-        if (item.Disabled)
-          return this.$message.warning("内部图表,不允许插入报告");
-
-        const LINK_CHART_URL = process.env.CHART_LINK;
-        this.$nextTick(() => {
-          this.editor.html.insert(
-            `<p style='text-align:left; margin-top:10px;'>
-							<iframe src='${LINK_CHART_URL}?code=${item.UniqueCode}' width='100%' height='350' style='border-width:0px; min-height:350px;'></iframe>
-						</p>`
-          );
-        });
-      }
-      this.lastEditRange = selection.getRangeAt(0);
-    },
     //批量插入我的图表
     handleImportMyChart(data) {
       //设置编辑器获取焦点
@@ -931,42 +775,6 @@ export default {
       });
     },
 
-    async getChartList(word) {
-      let params = {
-        Keyword: word || "",
-        CurrentIndex: this.search_page,
-        PageSize: this.search_page_sizes,
-        IsShowMe: this.isShowMe,
-      };
-
-      let res = null;
-      if (this.chart_source === 1) {
-        res = await dataBaseInterface.chartSearchByEs(params);
-      } else if (this.chart_source === 2) {
-        res = await futuresInterface.searchChart(params);
-      } else if (this.chart_source === 3) {
-        res = await chartRelevanceApi.searchChart(params);
-      } else if (this.chart_source === 6) {
-        res = await fittingEquationInterface.searchChart(params);
-      } else if (this.chart_source === 7) {
-        res = await statisticFeatureInterface.searchChart(params);
-      }
-
-      if (res.Ret !== 200) return;
-      res.Data.List = res.Data.List || [];
-      this.chartlist =
-        this.search_page === 1
-          ? res.Data.List
-          : [...this.chartlist, ...res.Data.List];
-      this.search_have_more = this.search_page < res.Data.Paging.Pages;
-    },
-
-    loadReportHandle() {
-      if (!this.search_have_more) return;
-      this.search_page++;
-      this.getChartList(this.key_word);
-    },
-
     // 获取沙盘图列表 分页
     getSandTable() {
       this.sandTableLoading = true;
@@ -1114,3 +922,11 @@ export default {
   }
 }
 </style>
+<style lang="scss">
+#editreport {
+	.el-tabs__nav-wrap::after {
+		height: 0;
+	}
+	.el-tabs__item { font-size: 16px; }
+}	
+</style>

+ 2 - 2
src/views/report_manage/reportEn/reportlist.vue

@@ -104,8 +104,8 @@
             <span v-else>{{ item.label }}</span>
           </template>	
 					<template slot-scope="{row}">
-							<span v-if="item.key==='Title'">
-								<span style="cursor:pointer; color:#4099ef;" @click="lookreportdtl(row)">{{row.Title}}</span>
+							<span v-if="item.key==='Title'" @click="lookreportdtl(row)">
+								<span style="cursor:pointer; color:#4099ef;">{{row.Title}}</span>
 							  <span style="cursor:pointer; color:#4099ef;" v-if="row.CreateTime">({{row.CreateTime.substring(5,7)}}{{row.CreateTime.substring(8,10)}})</span>
 							</span>
               <span v-else-if="item.key==='ClassifyNameFirst'">

+ 24 - 22
src/views/report_manage/reportlist.vue

@@ -119,29 +119,31 @@
             min-width="140"
           >
             <template slot-scope="scope">
-              <span
-                style="cursor: pointer; color: #4099ef"
-                @click="lookreportdtl(scope.row)"
+              <div @click="lookreportdtl(scope.row)">
+                <span
+                  style="cursor: pointer; color: #4099ef"
                 >{{ scope.row.Title }}</span
-              >
-              <span
-                style="cursor: pointer; color: #4099ef"
-                v-if="scope.row.MsgSendTime"
-                >({{ scope.row.MsgSendTime.substring(5, 7)
-                }}{{ scope.row.MsgSendTime.substring(8, 10) }})</span
-              >
-              <span
-                style="cursor: pointer; color: #4099ef"
-                v-else-if="scope.row.PublishTime"
-                >({{ scope.row.PublishTime.substring(5, 7)
-                }}{{ scope.row.PublishTime.substring(8, 10) }})</span
-              >
-              <span
-                style="cursor: pointer; color: #4099ef"
-                v-else-if="scope.row.CreateTime"
-                >({{ scope.row.CreateTime.substring(5, 7)
-                }}{{ scope.row.CreateTime.substring(8, 10) }})</span
-              >
+                >
+                <span
+                  style="cursor: pointer; color: #4099ef"
+                  v-if="scope.row.MsgSendTime"
+                  >({{ scope.row.MsgSendTime.substring(5, 7)
+                  }}{{ scope.row.MsgSendTime.substring(8, 10) }})</span
+                >
+                <span
+                  style="cursor: pointer; color: #4099ef"
+                  v-else-if="scope.row.PublishTime"
+                  >({{ scope.row.PublishTime.substring(5, 7)
+                  }}{{ scope.row.PublishTime.substring(8, 10) }})</span
+                >
+                <span
+                  style="cursor: pointer; color: #4099ef"
+                  v-else-if="scope.row.CreateTime"
+                  >({{ scope.row.CreateTime.substring(5, 7)
+                  }}{{ scope.row.CreateTime.substring(8, 10) }})</span
+                >
+
+              </div>
             </template>
           </el-table-column>
           <el-table-column