jwyu 10 månader sedan
förälder
incheckning
c452cfa8d9

+ 4 - 2
src/components/chart/chartDetailHandlesWrap.vue

@@ -23,7 +23,7 @@
         ><i class="el-icon-refresh" style="margin-left: 0" />&nbsp;{{$t('Edb.detail_refresh_btn')}}
       </span>
     </li>
-    <li class="span-item" v-if="['/commordityChartBase','/crossVarietyChartList'].includes($route.path)">
+    <li class="span-item" v-if="['/commordityChartBase','/crossVarietyChartList','/rangeAnalysis'].includes($route.path)">
       <span @click="saveChartHandle">
         <i class="el-icon-collection" />&nbsp;{{$t('Chart.chart_save_btn')}}
       </span>
@@ -57,7 +57,7 @@
         src="~@/assets/img/chart_m/WeChat.jpg"
       />&nbsp;{{$t('Chart.chart_copywx')}}
     </li>
-    <li v-if="isShowBtn('enNameSetting')"
+    <li v-if="isShowBtn('enNameSetting')&&!['/rangeAnalysis'].includes($route.path)"
         class="span-item copy" @click="openLangInfoDia">
       <img
         style="width: 16px; vertical-align: middle"
@@ -196,6 +196,8 @@ export default {
             }
             
         }
+        // 区间分析
+        else if(path==='/rangeAnalysis') return crossVarietyBtnMap[btn]
 
         return false
     }

+ 103 - 1
src/views/intervalAnalysis/list.vue

@@ -326,6 +326,8 @@
               />
             </el-col>
           </el-row>
+          <!-- 指标列表 -->
+					<edbTableSection :tableData="tableData"/>
         </div>
         <!-- 列表 -->
         <chartListTableWrap
@@ -359,6 +361,15 @@
       :data="saveOtherChartInfo"
       @ensure="getTreeData"
     />
+
+    <!-- 加入我的图库弹窗 -->
+    <addMyClassifyDia
+      :isAddMyDialog="isAddMyChart"
+      :add_id="add_chart_id"
+      :add_ids="add_ids"
+      @cancel="isAddMyChart = false"
+      @addSuccess="addMySuccess"
+    />
   </div>
 </template>
 
@@ -373,6 +384,7 @@ import setEnNameDia from '@/views/dataEntry_manage/components/setEnNameDia.vue'
 import { chartSetMixin } from '@/views/dataEntry_manage/mixins/chartPublic';
 import { copyOtherOptions } from '@/utils/defaultOptions';
 import setLangInfoDia from '@/views/dataEntry_manage/components/setLangInfo.vue'
+import edbTableSection from '@/views/chartRelevance_manage/crossVarietyAnalysis/components/edbTableSection.vue';
 export default {
   components: {
     openDialog,
@@ -380,9 +392,17 @@ export default {
     addMyClassifyDia,
     SaveChartOther,
     setEnNameDia,
-    setLangInfoDia
+    setLangInfoDia,
+    edbTableSection
   },
   mixins: [leftMixin, chartSetMixin],
+  computed:{
+    /* 分享地址 */
+    linkUrl() {
+      const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
+      return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`
+    }
+  },
   data() {
     return {
       showData: false,
@@ -414,6 +434,10 @@ export default {
       isShowSaveOther: false,//另存为
       saveOtherChartInfo: {},
 
+      isAddMyChart: false, //加入图库弹窗
+      add_chart_id: 0, //要加入的图表
+			add_ids:[],//加入时已有的分类
+
     };
   },
   methods: {
@@ -501,6 +525,7 @@ export default {
       this.listFinished = false
       this.chart_page = 1
       this.chartList = []
+      this.chart_total=0
       this.getPublicList()
     },
 
@@ -576,6 +601,83 @@ export default {
         }
       })
     },
+
+    /* 加入我的图库 */
+    addMychartHandle(item) {
+      this.add_chart_id = item.ChartInfoId;
+      //已有的分类ids
+      this.add_ids = item.MyChartClassifyId
+        ? item.MyChartClassifyId.split(",").map((item) => Number(item))
+        : [];
+      this.isAddMyChart = true;
+    },
+
+    /* 加入我的图库成功 */
+    addMySuccess(params) {
+      this.isAddMyChart = false;
+
+      /* 判断是详情还是图库列表 */
+      if (this.select_id) {
+        this.chartInfo.IsAdd = true;
+        this.chartInfo.MyChartId = params.MyChartInfoId;
+        this.chartInfo.MyChartClassifyId = params.MyChartClassifyId;
+      }
+    },
+
+    copyChartHandle:_.debounce(function(type){
+      let chartsName = this.currentLang=='zh'?this.chartInfo.ChartName:this.chartInfo.ChartNameEn
+      let { heightNum, widthNum , newTitle , dynamic_copyOptions} = this.dynamicWidthAndHeight(type,this.chartInfo.ChartType,chartsName,1)
+      const chartType = 'seasonLegend';
+      // 英文转SVG设置变动
+      if(this.currentLang == 'en'){
+        // 如果竖轴坐标单位为'英文单位',表示客户没填,转成svg时置为空
+        this.$refs.chartRef.chart.options.yAxis.forEach(it => {
+          if(it.title.text == '英文单位') it.title.text='' 
+        });
+      }
+      let svg = this.$refs.chartRef.chart.getSVG({
+        chart:{
+          width:widthNum,
+          height:heightNum,
+          backgroundColor:"rgba(255, 255, 255, 0)",
+        },
+        title: {
+          text: newTitle,
+          margin: 10,
+          style: {
+            fontSize: '18px'
+          }
+        },
+        legend:{
+          ...copyOtherOptions[chartType],
+          ...dynamic_copyOptions[chartType]
+          }
+      });
+      this.copyBlobItem(widthNum,heightNum,svg,type);
+    },500),
+
+    copyChartConfirm(type) {
+      type !== "url" && this.copyChartHandle(type);
+      
+      type == "url" && this.shareUrl();
+    },
+
+    /* 分享图表 */
+    shareUrl() {
+      var clipboard = new this.Clipboard(".shareLink");
+      clipboard.on("success", (e) => {
+        console.log(e);
+        this.$message.success(/* "复制链接成功" */this.$t('Chart.OptMsg.copy_link_success'));
+        e.clearSelection(); // 释放内存
+        clipboard.destroy();
+      });
+      // // 浏览器不支持
+      clipboard.on("error", (e) => {
+        this.$message.warning(/* "浏览器暂不支持" */this.$t('MsgPrompt.browser_not_support'));
+        // 释放内存
+        clipboard.destroy();
+      });
+    },
   },
   mounted() {
 

+ 1 - 13
src/views/intervalAnalysis/mixin/leftMixin.js

@@ -42,8 +42,7 @@ export default {
     select_classify(newval) {
       if (this.$refs.chartListWrap) this.$refs.chartListWrap.$refs.listRef.scrollTop = 0;
       if (newval) {
-        this.chart_page = 1;
-        this.getPublicList();
+        this.handleInitList()
       }
     },
 
@@ -488,17 +487,6 @@ export default {
 			return canDrop
     },
 
-    /* 加载更多 */
-		loadMoreHandle: _.throttle(function() {
-			let scrollTop = this.$refs.chartListWrap.$refs.listRef.scrollTop;
-      let clientHeight = this.$refs.chartListWrap.$refs.listRef.clientHeight;
-      let scrollHeight = this.$refs.chartListWrap.$refs.listRef.scrollHeight;
-			if(scrollTop + clientHeight >= scrollHeight-10 && this.publicHaveMove){
-				this.chart_page++;
-				this.getPublicList();
-			}
-		},300),
-
     /* 重绘右侧区域宽度 */
     reloadRightWid() {
       let total_wid = $('.data-sheet-main')[0].offsetWidth;