This commit is contained in:
lcw
2025-12-05 21:36:34 +08:00
parent 64ab9fc44c
commit b39387c4ed
97 changed files with 3342 additions and 298 deletions

View File

@ -319,15 +319,19 @@ const uploadFile = (file) =>{
// 刷新js
// 全局变量用于跟踪OCR模型是否已经初始化
let ocrModelInitialized = false;
// 只初始化一次OCR模型
const frashJs = async () =>{
if(!imgIsLoad){
if(!ocrModelInitialized){
try {
await ocr.init();// 模型初始化
imgIsLoad = true;
ocrModelInitialized = true;
proxy.$message({ type: "success", message: "加载成功" });
} catch (err) {
proxy.$message({ type: "error", message: "加载失败,请刷新页面" });
imgIsLoad = false;
ocrModelInitialized = false;
}
}
}

View File

@ -5,7 +5,7 @@
<!-- input表单 input-->
<MOSTY.Other v-if="item.type == 'input'" width="100%" clearable v-model="listQuery[item.prop]" :placeholder="`请输入${item.label}`" :disabled="item.disabled" :readonly="item.readonly" />
<el-input v-model="listQuery[item.prop]" v-else-if="item.type == 'textarea'" type="textarea" :rows="3" :placeholder="`请输入${item.label}`" :disabled="item.disabled" />
<el-input v-model="listQuery[item.prop]" v-else-if="item.type == 'textarea'" type="textarea" :rows="item.rows || 3" :placeholder="`请输入${item.label}`" :disabled="item.disabled" />
<!-- 数值 inputNumber-->
<el-input type="number" v-model="listQuery[item.prop]" v-else-if="item.type == 'inputNumber'" :placeholder="`请输入${item.label}`" :disabled="item.disabled" />
<!-- 数值 number-->

View File

@ -1,16 +1,25 @@
<template>
<div style="width: 100%" :class="getConfiger.showSelectType === 'radio' ? 'tabBoxRadio' : ''">
<!-- hasChildren要在tableData中定义表示当前行有没有下一级 children要在tableData中定义表示下一级的数据-->
<el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange"
:row-key="getConfiger.rowKey" :border="getConfiger.border" :default-expand-all="getConfiger.defaultExpandAll"
:stripe="getConfiger.stripe" :height="tableHeight" v-loading="tableConfiger.loading" :lazy="getConfiger.lazy"
:load="load" :tree-props="treePros" style="width: 100%" :header-cell-class-name="() => 'HeadBgColor'"
:highlight-current-row="getConfiger.showSelectType === 'radio'"
:row-style="{ height: getConfiger.rowHeight === 'auto' ? getConfiger.rowHeight : getConfiger.rowHeight + 'px' }">
:row-style="(row, index) => getRowStyle(row, index)"
:row-class-name="(row, index) => getRowClassName(row, index)">
<!-- 修改v-if条件让showSelectType为null时也能显示选择列默认为复选框 -->
<el-table-column style="width: 55px" type="selection" width="55" v-if="getConfiger.showSelectType !='null'" :class="getConfiger.showSelectType === 'radio' ? 'tabBoxRadio' : ''" />
<el-table-column style="width: 55px" type="selection" width="55" v-if="getConfiger.showSelectType != 'null'"
:class="getConfiger.showSelectType === 'radio' ? 'tabBoxRadio' : ''" />
<el-table-column type="expand" v-if="expand">
<template #default="props">
<slot name="expand" :props="props.row"></slot>
</template>
</el-table-column>
<el-table-column type="index" label="序号" v-if="getConfiger.showIndex" width="60" :align="getConfiger?.align" />
<el-table-column v-for="(item, index) in tableColumn" :align="getConfiger?.align" :prop="item.prop" :key="index"
@ -18,7 +27,6 @@
:show-overflow-tooltip="item.showOverflowTooltip || false" :sortable="item.sortable || false">
<!-- 使用自定义 -->
<template v-if="item.showSolt" #default="scope">
<slot :name="item.prop" v-bind="scope"></slot>
</template>
<!-- 默认 -->
@ -72,6 +80,18 @@ const props = defineProps({
fixed: {
type: String,
default: "right"
},
expand: {
type: Boolean,
default: false
},
rowStyle: {
type: Function,
default: null
},
rowClassName: {
type: Function,
default: null
}
});
// 可选的时候选择的数据
@ -133,6 +153,30 @@ const load = (date, treeNode, resolve) => {
]);
}, 1000);
};
// 获取行样式
const getRowStyle = (row, index) => {
// 基础行高样式
const baseStyle = { height: getConfiger.rowHeight === 'auto' ? getConfiger.rowHeight : getConfiger.rowHeight + 'px' };
// 如果有自定义行样式函数,合并样式
if (props.rowStyle) {
const customStyle = props.rowStyle(row, index);
return { ...baseStyle, ...customStyle };
}
return baseStyle;
};
// 获取行类名
const getRowClassName = (row, index) => {
// 如果有自定义行类名函数,使用它
if (props.rowClassName) {
return props.rowClassName(row, index);
}
return '';
};
// 设置默认选中(在调用的父页面要确保 tableData传出来了如果延迟传过来默认选中不会生效
function setDefaultChoose() {
nextTick(() => {
@ -160,5 +204,4 @@ function setDefaultChoose() {
.tabBoxRadio .el-table__header-wrapper .el-checkbox {
display: none;
}
</style>

View File

@ -118,6 +118,10 @@ onMounted(() => {
emitter.on("handleClick", () => {
idEntityCard.value = getItem('idEntityCard')
handleClick()
// 清除旧定时器,避免多个定时器同时运行
if (intTime.value) {
clearInterval(intTime.value)
}
intTime.value = setInterval(() => {
handleClick()
}, 60000)