liyongli пре 1 година
родитељ
комит
002cbbcfed
1 измењених фајлова са 23 додато и 2 уклоњено
  1. 23 2
      src/view/onlineText.vue

+ 23 - 2
src/view/onlineText.vue

@@ -1,7 +1,6 @@
 <template>
   <div>
     <Head />
-
     <div class="edito">
       <div
         class="onlineTextMain"
@@ -27,7 +26,15 @@
             <el-button
               class="clearError"
               type="primary"
-              style="float: right; margin-top: 0.3em; margin-right: 0.5em"
+              style="float: right; margin-top: 0.3em; margin-right: 0.5em; padding: 0 1.8em;"
+              @click="exportFun"
+            >
+              导出
+            </el-button>
+            <el-button
+              class="clearError"
+              type="primary"
+              style="float: right; margin-top: 0.3em; margin-right: 0em"
               @click="clearError"
               :icon="Delete"
             >
@@ -647,6 +654,20 @@ function changeTabAll() {
     tabSelect[i] = t;
   }
 }
+
+// 导出word
+function exportFun() {
+  /**
+   * wps: kswps
+   * docx: msword
+   */
+  let blob = new Blob([`<body>${rawText.value}</body>`], { type: 'application/kswps' });
+  let url = URL.createObjectURL(blob);
+  let link = document.createElement('a');
+  link.setAttribute('href', url);
+  link.setAttribute('download', `智能校对.doc`);
+  link.click();
+}
 </script>
 
 <style scoped>