Browse Source

词云问题解决。

qinpeng 2 years ago
parent
commit
261e9a5ce9
2 changed files with 12 additions and 15 deletions
  1. 1 1
      public/ciyun/js/cloud.min.js
  2. 11 14
      src/views/Textanalysis/index.vue

+ 1 - 1
public/ciyun/js/cloud.min.js

@@ -457,7 +457,7 @@ function changeSize(key, arr) {
 	let size = null;
 	if (arr.length > 0) {
 		arr.forEach(item => {
-			if (item.text == key) {
+			if (item.word == key) {
 				size = item.fontSize
 			}
 		})

+ 11 - 14
src/views/Textanalysis/index.vue

@@ -304,7 +304,7 @@
                         :key="indexsss + 'word'"
                         :class="['word']"
                       >
-                        <div
+                        <span
                           v-if="pinyinShow"
                           :class="['pinyin']"
                           :style="{
@@ -313,9 +313,9 @@
                           }"
                         >
                           {{ word.pinyin }}
-                        </div>
-                        <!-- <br v-if="pinyinShow" /> -->
-                        <div
+                        </span>
+                        <br v-if="pinyinShow" />
+                        <span
                           class="hanzi"
                           :style="{
                             fontSize: wordFontsize + 'px',
@@ -356,7 +356,7 @@
                           }"
                         >
                           {{ word.word }}
-                        </div>
+                        </span>
                       </span>
                     </template>
                     <template v-else>
@@ -365,7 +365,7 @@
                         v-for="(word, indexsss) in itemss.text"
                         :key="indexsss + 'word'"
                       >
-                        <div
+                        <span
                           v-if="pinyinShow"
                           :class="['pinyin']"
                           :style="{
@@ -374,9 +374,9 @@
                           }"
                         >
                           {{ word.pinyin }}
-                        </div>
-                        <!-- <br v-if="pinyinShow" /> -->
-                        <div
+                        </span>
+                        <br v-if="pinyinShow" />
+                        <span
                           class="hanzi"
                           :style="{
                             fontSize: wordFontsize + 'px',
@@ -417,7 +417,7 @@
                           }"
                         >
                           {{ word.word }}
-                        </div>
+                        </span>
                       </span>
                     </template>
                   </span>
@@ -543,9 +543,6 @@ export default {
   .sentence {
     margin-bottom: 8px;
   }
-  .word{
-    float:left;
-  }
   .pinyin {
     color: rgba(255, 255, 255, 0.5);
     text-align: center;
@@ -573,6 +570,7 @@ export default {
   </div>
   </body>
   </html>`;
+      console.log(cxzcxz);
       let converted = htmlDocx.asBlob(content);
       FileSaver.saveAs(converted, "文章.docx");
     },
@@ -1602,7 +1600,6 @@ export default {
                     text-align: center;
                   }
                   .pinyin {
-                    display: inline-block;
                     min-height: 12px;
                     color: rgba(255, 255, 255, 0.5);
                     text-align: center;