This commit is contained in:
njdaoyehu 2025-02-06 15:29:05 +08:00
parent 2d61e9a1a9
commit de169703ed
6 changed files with 16 additions and 34 deletions

View File

@ -82,5 +82,5 @@ export const count = (params?: TaskParams) =>
/**
*
*/
export const importImageOCR = (base64ImageString: any) =>
export const importByOCR = (base64ImageString: any) =>
defHttp.post<boolean>({ url: `${baseApi}/ocr`, data: base64ImageString });

View File

@ -14,9 +14,9 @@
<a-button type="primary" class="tool-button" :icon="h(MinusOutlined)" @click="zoomOut"/>
<span>{{ Math.round(zoomLevel * 100) }}%</span>
<a-button type="primary" class="tool-button" :icon="h(PlusOutlined)" @click="zoomIn" />
<a-button type="primary" style="border-radius: 8px; margin-left: 10px;" :icon="h(CloseOutlined)" @click="close"> </a-button>
</div>
<a-button type="primary" class="btn" v-show="captureButtonVisible" :style="captureButtonStyle" :icon="h(ScissorOutlined)" @click="captureSelection"> </a-button>
<a-button type="primary" class="btn-close" :style="closeButtonStyle" :icon="h(CloseOutlined)" @click="close"> </a-button>
</div>
</template>
<script>
@ -42,7 +42,6 @@
scrollPoint: null,
selectionStyle: null,
captureButtonStyle: null,
closeButtonStyle: null,
captureButtonVisible: false,
pdfData: undefined,
}
@ -74,9 +73,6 @@
x: 0,
y: 0
};
this.closeButtonStyle = {
top: '5px',
};
this.start = false;
this.selection = null;
this.startPoint = null;
@ -214,14 +210,6 @@
left: 0;
top: 0;
}
.btn-close {
position: absolute;
border-radius: 0;
left: 50%;
top: 5px;
transform: translateX(-50%);
}
}
.tool-box {
@ -230,7 +218,7 @@
right: 20px;
margin-right: 20px;
padding: 5px;
background: #ffffff;
background: rgba(45,119,243,0.5);
display: flex;
justify-content: space-around;
align-items: center;
@ -246,6 +234,7 @@
& > span {
padding-left: 10px;
padding-right: 10px;
color: #ffffff;
}
}
</style>

View File

@ -37,8 +37,6 @@
</div>
</template>
<script lang="ts" setup>
import { useGo } from '@/hooks/web/usePage';
import { usePermission } from '@/hooks/web/usePermission';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { isObject } from '@/utils/is';
import dayjs from 'dayjs';
@ -46,17 +44,12 @@
import { useDrawer } from '@/components/Drawer';
import DeviceDrawer from './drawer.vue';
import { columns, searchFormSchema } from './schema';
import { useMessage } from '@/hooks/web/useMessage';
import {SvgIcon} from "@/components/Icon";
import {h, onMounted} from "vue";
import {PlusOutlined} from "@ant-design/icons-vue";
const { createMessage } = useMessage();
const { hasPermission } = usePermission();
const go = useGo();
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerTable, { reload, setSelectedRowKeys }] = useTable({
const [registerTable, { reload }] = useTable({
api: (params) => DeviceApi.search(handleParams(params)),
columns,
formConfig: {
@ -82,7 +75,7 @@
WebViewService.setIsLoading(false).then(() => {});
});
const handleParams = (params) => {
const handleParams = (params: any) => {
const { pageNum, pageSize, field = 'id', order = 'descend', ...rest } = params;
const handledParams: any = {
pageNum,

View File

@ -69,7 +69,7 @@
</div>
</template>
<script lang="ts" setup>
import { usePermission } from '@/hooks/web/usePermission';
import { usePermission } from '@/hooks/web/usePermission';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { isObject } from '@/utils/is';
import dayjs from 'dayjs';
@ -226,7 +226,7 @@ import { usePermission } from '@/hooks/web/usePermission';
const handleCapture = (base64ImageString: any) => {
WebViewService.setIsLoading(true).then(() => {});
TaskApi.importImageOCR(base64ImageString).then((res: any) => {
TaskApi.importByOCR(base64ImageString).then((res: any) => {
const data = JSON.parse(res);
if (data.length === 0) return;
if (ocrData === null) {
@ -277,12 +277,12 @@ import { usePermission } from '@/hooks/web/usePermission';
};
});
const timer = ref(0)
const timer = ref<any>();
onMounted(()=> {
timer.value = setInterval(() => {
DeviceClientService.getDeviceConnected().then((d) => {
deviceConnectedList.value = d;
}, error => {
}, _ => {
WebViewService.setMessage("获取设备连接出错", "error").then(() => {});
});
}, 300);

View File

@ -39,7 +39,7 @@
</div>
</template>
<script lang="ts">
import {defineComponent, h, onMounted} from 'vue';
import {defineComponent, h, onMounted} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import * as UserApi from '/@/api/system/userApi';
import { useDrawer } from '/@/components/Drawer';
@ -103,9 +103,9 @@ import {defineComponent, h, onMounted} from 'vue';
reload();
}
// onMounted(() => {
// WebViewService.setIsLoading(false).then(() => {});
// });
onMounted(() => {
WebViewService.setIsLoading(false).then(() => {});
});
return {
registerTable,

4
types/index.d.ts vendored
View File

@ -28,5 +28,5 @@ declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
declare let AMap: any;
declare interface DeviceClientService {}
declare interface WebViewService {}
declare let DeviceClientService: any;
declare let WebViewService: any;