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

View File

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

View File

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

View File

@ -103,9 +103,9 @@ import {defineComponent, h, onMounted} from 'vue';
reload(); reload();
} }
// onMounted(() => { onMounted(() => {
// WebViewService.setIsLoading(false).then(() => {}); WebViewService.setIsLoading(false).then(() => {});
// }); });
return { return {
registerTable, 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 let AMap: any;
declare interface DeviceClientService {} declare let DeviceClientService: any;
declare interface WebViewService {} declare let WebViewService: any;