Commit 40b615d1 by zhanghou

集成docx-preview插件

parent c3b0ac4d
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,6 +14,7 @@
"bignumber.js": "^9.0.1",
"cluster": "^0.7.7",
"core-js": "^3.6.4",
"docx-preview": "^0.1.15",
"echarts": "^5.2.2",
"element-ui": "^2.13.2",
"es6-promise": "^4.2.8",
......
......@@ -476,6 +476,7 @@
</template>
</el-dialog>
</template>
<div ref="file"></div>
</div>
</template>
<script>
......@@ -483,6 +484,7 @@ import commonProcess from "~/mixin/commonProcess";
import Api from "~/service/Api";
import Utils from "~/utils/index";
import DocUtils from "~/utils/DocUtils";
let docx = require("docx-preview");
export default {
inject: ['root'],
props: ["model", "codes"],
......@@ -614,6 +616,7 @@ export default {
u8arr[length] = bstr.charCodeAt(length); // 返回在指定的位置的字符的 Unicode 编码
}
let blob = new Blob([u8arr])
docx.renderAsync(blob, this.$refs.file);
let hrefUrl = window.URL.createObjectURL(blob)
let a = document.createElement('a')
a.href = hrefUrl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment