更新页面
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");
|
||||
|
@ -20,6 +20,7 @@ import { COMPONENT_WIDTH } from "@/constant";
|
||||
import { qcckPost, qcckGet, qcckFlvGet } from "@/api/qcckApi.js";
|
||||
import { ref, defineProps, defineEmits, defineExpose, computed, onMounted, watch } from "vue";
|
||||
import { selectDeptPage } from "@/api/user-manage";
|
||||
import { tr } from "element-plus/es/locale.mjs";
|
||||
const props = defineProps({
|
||||
//获取组件传值
|
||||
placeholder: {
|
||||
@ -41,9 +42,13 @@ const props = defineProps({
|
||||
width: {
|
||||
default: COMPONENT_WIDTH,
|
||||
type: String
|
||||
},
|
||||
isAll:{
|
||||
default: false,
|
||||
type: Boolean
|
||||
}
|
||||
});
|
||||
const modelShow = ref(false);
|
||||
const firstLoad = ref(true)
|
||||
const oldmodelValue = ref([]);
|
||||
const listQuery = ref({
|
||||
deptname: "",
|
||||
@ -61,7 +66,12 @@ const endProps = {
|
||||
lazy: true,
|
||||
lazyLoad(node, resolve) {
|
||||
listQuery.value.parentid = node.data.id;
|
||||
selectDeptPage(listQuery.value).then((res) => {
|
||||
let params = { ...listQuery.value };
|
||||
if(props.isAll && firstLoad.value) {
|
||||
params.parentid = 1;
|
||||
firstLoad.value = false;
|
||||
}
|
||||
selectDeptPage(params).then((res) => {
|
||||
depList.value = depList.value.concat(res)
|
||||
//处理部门是否包含下级
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
@ -73,7 +83,11 @@ const endProps = {
|
||||
};
|
||||
const tableData = ref([]);
|
||||
const getSysMenuTree = async () => {
|
||||
const res = await selectDeptPage(listQuery.value);
|
||||
let params = { ...listQuery.value }
|
||||
if(props.isAll) params.parentid = 1;
|
||||
console.log('初始化-----');
|
||||
|
||||
const res = await selectDeptPage(params);
|
||||
tableData.value = res;
|
||||
depList.value = res
|
||||
};
|
||||
|
@ -67,6 +67,7 @@
|
||||
<MOSTY.Department
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
:isAll="item.isAll"
|
||||
@getDepValue="getdep($event,item.depMc)"
|
||||
v-model="listQuery[item.prop]"
|
||||
:placeholder="listQuery[item.depMc] ? listQuery[item.depMc]:'请选择'"
|
||||
|
Reference in New Issue
Block a user