main
han 5 months ago
parent 4c84136e21
commit 56a1dca602
  1. 1
      package.json
  2. 3
      src/views/pages/AI-Document-Correction/dialog.vue
  3. 1
      src/views/pages/AI-Document-Writing/dialog.vue
  4. 11
      src/views/pages/AI-Document-Writing/index.vue

@ -63,6 +63,7 @@
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"jsencrypt": "3.3.1",
"mammoth": "^1.9.1",
"min-dash": "3.5.2",
"nprogress": "0.2.0",
"qrcode.vue": "^1.7.0",

@ -306,7 +306,6 @@ export default {
this.closeConnection();
},
mounted() {
console.log(this.$route.params.data)
let params
if (this.$route.params.data) {
params = this.$route.params.data
@ -417,6 +416,8 @@ export default {
/** 生成 公文 */
async generateDoc() {
this.thinkState = false
this.editorState=false
this.generatedContent=""
try {
await this.$refs['formRef'].validate()
this.generatedContent = '';

@ -21,7 +21,6 @@
@onCreated="onCreated"
/>
<div class="v-edit-tool" v-if="DocumentState">
<div class="v-edit-tool-item down" @click="downLoadDoc"><i class="iconfont icon-down"></i></div>
<div class="v-edit-tool-item refresh" @click="refreshDoc"><i class="iconfont icon-refresh"></i></div>
</div>
</div>

@ -37,6 +37,7 @@ import FileUploadDrag from '@/components/FileUploadDrag'
import img01 from "@/assets/ai-test/img01.png"
import img02 from "@/assets/ai-test/img02.png"
import img03 from "@/assets/ai-test/img03.png"
import mammoth from "mammoth";
export default {
name: 'Index',
@ -71,12 +72,20 @@ export default {
]
},
/** 文件上传 **/
handleReferenceChange(file) {
async handleReferenceChange(file) {
this.checkState = true
this.file = file
const markdown = await this.convertDocxToMarkdown(file.raw);
console.log(markdown);
},
async convertDocxToMarkdown(file) {
const result = await mammoth.extractRawText({ arrayBuffer: file });
// Markdown
return result.value;
},
/** 页面跳转 **/
gotoPages() {
this.$router.push({name: 'DocumentWritingDialog', params: {fileId: this.file.url,fileName: this.file.name}});
}
}

Loading…
Cancel
Save