浏览代码

Merge branch 'master' of http://60.205.254.193:3000/GCLS/GCLS_Page_TC

natasha 2 年之前
父节点
当前提交
53c67cb60b
共有 1 个文件被更改,包括 73 次插入7 次删除
  1. 73 7
      src/views/Textanalysis/index.vue

+ 73 - 7
src/views/Textanalysis/index.vue

@@ -262,7 +262,9 @@
               <div>
                 <span
                   >音节难度
-                  {{ difficulty.pinyinDifficulty }}
+                  <span style="margin-left: 5px">
+                    {{ difficulty.pinyinDifficulty }}
+                  </span>
                 </span>
                 <span class="line"></span>
                 <span>{{ base.pinyinCount }} / {{ base.pinyinTextCount }}</span>
@@ -274,7 +276,9 @@
               <div>
                 <span
                   >汉字难度
-                  {{ difficulty.wordDifficulty }}
+                  <span style="margin-left: 5px">
+                    {{ difficulty.wordDifficulty }}
+                  </span>
                 </span>
                 <span class="line"></span>
                 <span>{{ base.wordCount }} / {{ base.wordTextCount }}</span>
@@ -284,7 +288,12 @@
                 <span class="line"></span>
               </div>
               <div>
-                <span>词汇难度{{ difficulty.vocabularyDifficulty }}</span>
+                <span
+                  >词汇难度
+                  <span style="margin-left: 5px">
+                    {{ difficulty.vocabularyDifficulty }}
+                  </span>
+                </span>
                 <span class="line"></span>
                 <span
                   >{{ base.vocabularyCount }} /
@@ -445,6 +454,10 @@
         </div>
       </div>
     </div>
+    <div
+      id="echarts_none"
+      style="width: 592px; height: 568px; display: none"
+    ></div>
   </div>
 </template>
   
@@ -467,7 +480,7 @@ export default {
   data() {
     return {
       ratioShow: false,
-      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";","、"],
+      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";", "、"],
       loading: false,
       LeftLoading: false,
       wordFontsize: 20, // 汉字字号初始值
@@ -512,6 +525,7 @@ export default {
       headerText: "wordCount",
       xifen: false,
       myChart: null,
+      myChart_none: null,
       currentTBdata: {},
       currentcolorValue: [],
       subjectWords: null,
@@ -650,12 +664,11 @@ export default {
     },
     downLoadEcharts() {
       let chartsCanvas = document
-        .getElementById("main_echarts")
+        .getElementById("echarts_none")
         .querySelectorAll("canvas")[0];
-      chartsCanvas.style.background = "#fff";
       let picInfo = chartsCanvas.toDataURL({
         type: "png",
-        pixelRatio: 1.5, // 放大两倍下载。解决生成图片在移动端模糊问题
+        pixelRatio: 1, // 放大两倍下载。解决生成图片在移动端模糊问题
         backgroundColor: "#fff",
         excludeComponents: ["toolbox"], // 导出时忽略toolbox组件
       }); // 获取到的是一串base64信息
@@ -955,6 +968,8 @@ export default {
 
         var chartDom = document.getElementById(id);
         this.myChart = echarts.init(chartDom);
+        var chartDom_none = document.getElementById("echarts_none");
+        this.myChart_none = echarts.init(chartDom_none);
         var option = null;
         let color1 = [
           "#35776B",
@@ -982,6 +997,18 @@ export default {
           });
           option = {
             color: this.xifen ? color2 : color1,
+            xAxis: {
+              show: false, //不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
+              axisTick: {
+                show: false, //不显示坐标轴刻度线
+              },
+              axisLine: {
+                show: false, //不显示坐标轴线
+              },
+              axisLabel: {
+                show: false, //不显示坐标轴上的文字
+              },
+            },
             series: [
               {
                 name: "Access From",
@@ -1167,6 +1194,45 @@ export default {
           };
         }
         option && this.myChart.setOption(option);
+        if (type == "饼状图") {
+          this.myChart_none.setOption({
+            color: this.xifen ? color2 : color1,
+            xAxis: {
+              show: false, //不显示坐标轴线、坐标轴刻度线和坐标轴上的文字
+              axisTick: {
+                show: false, //不显示坐标轴刻度线
+              },
+              axisLine: {
+                show: false, //不显示坐标轴线
+              },
+              axisLabel: {
+                show: false, //不显示坐标轴上的文字
+              },
+            },
+            series: [
+              {
+                name: "Access From",
+                type: "pie",
+                radius: ["40%", "60%"],
+                data: newdata,
+                itemStyle: {
+                  borderColor: "#fff",
+                  borderWidth: 2,
+                },
+                emphasis: {
+                  itemStyle: {
+                    shadowBlur: 10,
+                    shadowOffsetX: 0,
+                    shadowColor: "rgba(0, 0, 0, 0.5)",
+                  },
+                },
+              },
+            ],
+          });
+        } else {
+          option && this.myChart_none.setOption(option);
+        }
+
         let that = this;
         // 默认展示第一个
         for (let key in that.leftList[0]) {