Commit 13eb67b1 authored by erichsieh's avatar erichsieh

refactor: 更新lib

parent 701af2f5
Pipeline #4638 passed with stage
in 12 seconds
{
"name": "@purplevin/component",
"version": "0.1.22",
"version": "0.1.23",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@purplevin/component",
"version": "0.1.22",
"version": "0.1.23",
"dependencies": {
"axios": "^0.27.2",
"core-js": "^3.6.5",
......@@ -6342,7 +6342,7 @@
},
"node_modules/file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz",
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
},
"node_modules/file-uri-to-path": {
......@@ -19537,7 +19537,7 @@
},
"file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/file-saver/-/file-saver-2.0.5.tgz",
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA=="
},
"file-uri-to-path": {
......
{
"name": "@purplevin/component",
"version": "0.1.22",
"version": "0.1.23",
"private": false,
"main": "lib/index.umd.min.js",
"scripts": {
......
<template>
<div>
<div>
<h3>word抓取图片</h3>
<el-alert title="此功能将协助您将word内的图片进行抓取" type="info" />
<br>
......@@ -7,19 +7,9 @@
<el-row>
<el-col :span="16">
<el-form-item label="文档" prop="file">
<el-upload
ref="upload"
class="upload-demo"
drag
:limit="1"
:file-list="fileList"
:action="uploadURL"
:on-change="handelFileChange"
:on-remove="handleFileRemove"
:on-exceed="handleExceed"
:auto-upload="false"
accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
>
<el-upload ref="upload" class="upload-demo" drag :limit="1" :file-list="fileList" :action="uploadURL"
:on-change="handelFileChange" :on-remove="handleFileRemove" :on-exceed="handleExceed" :auto-upload="false"
accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document">
<i class="el-icon-upload" />
<div class="el-upload__text">
将文件拖到此处,或<em>点击上传</em>
......@@ -27,7 +17,7 @@
</el-upload>
</el-form-item>
<el-form-item label="最大宽度:">
<el-input v-model="form.MaxWidthCm" style="width:358px" ></el-input>
<el-input v-model="form.MaxWidthCm" style="width:358px"></el-input>
</el-form-item>
<el-form-item label="最大高度:">
<el-input v-model="form.MaxHeightCm" style="width:358px"></el-input>
......@@ -40,25 +30,20 @@
</el-row>
<el-row>
<el-col :span="12" :offset="10">
<el-button
style="margin-left: 10px"
size="small"
type="success"
@click="submitUpload"
>
<el-button style="margin-left: 10px" size="small" type="success" @click="submitUpload">
下载档案
</el-button>
</el-col>
</el-row>
</el-form>
</div>
</div>
</template>
<script>
import {fetchWordPic} from "@api/convertApi"
import { fetchWordPic } from "@api/convertApi"
import { saveAs } from 'file-saver'
export default {
name: 'GrabPic',
data: function() {
name: 'GrabPic',
data: function () {
return {
form: {
MaxWidthCm: '',
......@@ -69,13 +54,13 @@ data: function() {
uploadURL: 'Aspose/GetWordAllPic',
fileList: []
}
},
props:{
baseUrl:{
},
props: {
baseUrl: {
type: String
}
},
methods: {
},
methods: {
// 上传到服务器
async submitUpload() {
if (this.fileList.length <= 0) {
......@@ -88,8 +73,8 @@ methods: {
formData.append('MaxWidthCm', this.form.MaxWidthCm)
formData.append('MaxHeightCm', this.form.MaxHeightCm)
formData.append('Dpi', this.form.Dpi)
await fetchWordPic(this.baseUrl,formData).
then(res=>{
await fetchWordPic(this.baseUrl, formData).
then(res => {
const blob = new Blob([res])
saveAs(blob, `${this.fileList[0].name}.zip`)
this.$message({
......@@ -178,6 +163,6 @@ methods: {
this.$refs['rebateUpload'].handleStart(files[0])// 选择文件后的赋值方法
}
}
}
}
</script>
\ No newline at end of file
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