更新页面
This commit is contained in:
@ -29,7 +29,7 @@
|
||||
<div class="flex align-center just-between">
|
||||
<h1>文件文本提取工具</h1>
|
||||
<span title="刷新" class="pointer" >
|
||||
<el-icon color="#0072ff" size="30px" @click="initPage"><RefreshRight /></el-icon>
|
||||
<el-icon color="#0072ff" size="30px" @click="frashJs"><RefreshRight /></el-icon>
|
||||
<el-icon color="#23c044" size="14px" v-if="hasLoadingJS"><CircleCheckFilled /></el-icon>
|
||||
<el-icon color="#e60e0e" size="14px" v-if="!hasLoadingJS"><CircleCloseFilled /></el-icon>
|
||||
</span>
|
||||
@ -37,7 +37,7 @@
|
||||
<p>上传文件提取文本内容(支持 .png, .jpg )</p>
|
||||
<div class="container flex" style="height: 248px;">
|
||||
<div class="mr10">
|
||||
<el-upload class="upload-demo" accept=".png,.jpg" action="abc" :auto-upload="false" :on-change="onHandleChange" :show-file-list="false">
|
||||
<el-upload class="upload-demo" accept=".png,.jpg,jpeg" action="abc" :auto-upload="false" :on-change="onHandleChange" :show-file-list="false">
|
||||
<el-button size="medium" type="primary">上传图片</el-button>
|
||||
</el-upload>
|
||||
<p id="file-info">{{ files.name || '未选择文件' }} </p>
|
||||
@ -102,7 +102,7 @@ watch(()=>props.modelValue,val=>{
|
||||
|
||||
|
||||
const initDemo = () =>{
|
||||
if(hasLoadingJS.value == null || hasLoadingJS.value == 2) initPage();
|
||||
if(hasLoadingJS.value == null) initPage();
|
||||
nextTick(() => {
|
||||
const fileInput = document.getElementById("file-input");
|
||||
const fileInfo = document.getElementById("file-info");
|
||||
@ -242,6 +242,10 @@ const initPage = async () => {
|
||||
loading.value = false;
|
||||
hasLoadingJS.value = 2;
|
||||
}
|
||||
}
|
||||
const frashJs = () =>{
|
||||
if(hasLoadingJS.value == 1) return;
|
||||
initPage()
|
||||
}
|
||||
/**
|
||||
*@Descripttion:图片上传事件
|
||||
@ -272,9 +276,7 @@ const getRecognize = async () => {
|
||||
|
||||
// 切换标签
|
||||
const changeRadio = (val) =>{
|
||||
if(val == '图片解析') {
|
||||
if(hasLoadingJS.value == 2) initPage();
|
||||
}
|
||||
if(val == '图片解析') if(hasLoadingJS.value == 2) initPage();
|
||||
const resultDiv = document.getElementById("result");
|
||||
resultDiv.textContent = "请先上传文件...";
|
||||
const fileInfo = document.getElementById("file-info");
|
||||
|
Reference in New Issue
Block a user