u
This commit is contained in:
1 parent
26721a142e
commit
840d33ef3b
32 files changed
+2068
-590
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 8.5 KiB |
@@ -3,10 +3,17 @@ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { loadTianDiTu } from '@/utils/tdl-loader'
|
||||
import { useUserStore } from './store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
// const userStore = useUserStore()
|
||||
|
||||
onLaunch(() => {
|
||||
userStore.requireLogin()
|
||||
// userStore.requireLogin()
|
||||
})
|
||||
|
||||
onLoad(async (options) => {
|
||||
// options 会包含 orgid 和 bid
|
||||
const { orgid, bid } = options
|
||||
|
||||
console.log(options)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"vueVersion": "3",
|
||||
"h5": {
|
||||
"router": {
|
||||
"base": "/g3cdjtd-app/"
|
||||
"base": "/g3ocr-app/"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
<!-- <script setup lang="ts">
|
||||
import type { UploadFile, UploadFileItem } from 'sard-uniapp'
|
||||
import { dialog, isImageUrl, isVideoUrl, toast } from 'sard-uniapp'
|
||||
import { aliyunpluploadApi, delSubRecordApi, loaddataAttachApi } from '@/request/api'
|
||||
@@ -159,4 +159,17 @@ function onRemove(index: number, item: UploadFileItem) {
|
||||
.file {
|
||||
padding: 36rpx;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class=""></view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
@@ -56,36 +56,11 @@ async function onSubmit() {
|
||||
icon: 'success',
|
||||
})
|
||||
|
||||
uni.switchTab({
|
||||
uni.navigateTo({
|
||||
// url: '/pages-sub/upload/index',
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
}
|
||||
|
||||
// if (!res?.data) {
|
||||
// toast.fail('登录失败,请检查账号密码')
|
||||
// return
|
||||
// }
|
||||
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// orgid: formModel.orgid,
|
||||
// userid: formModel.userid,
|
||||
// token: res.data,
|
||||
// }
|
||||
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// username,
|
||||
// }
|
||||
|
||||
// uni.showToast({
|
||||
// title: '登录成功',
|
||||
// icon: 'success',
|
||||
// })
|
||||
|
||||
// uni.switchTab({
|
||||
// url: '/pages/home/index',
|
||||
// })
|
||||
}
|
||||
catch (err: any) {
|
||||
// 表单验证错误
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import type { FieldValidateError, FormExpose, FormRules } from 'sard-uniapp'
|
||||
import { getWindowInfo, toast } from 'sard-uniapp'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { loaddataApi, saveobjtApi } from '@/request/api'
|
||||
import { loadDataApi, updatePasswordApi } from '@/request/api'
|
||||
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -33,46 +34,12 @@ async function onSubmit() {
|
||||
|
||||
submitLoading.value = true
|
||||
|
||||
const searchcondition = `b_id = '${userStore.userInfo.userid}' AND ISNULL(b_password, '') = ISNULL('${formModel.oldPassword}', '')`
|
||||
|
||||
const searchRes = await loaddataApi({
|
||||
viewname: 'v_mini_loginid',
|
||||
searchcondition: `${searchcondition}`,
|
||||
orderfield: 'b_id',
|
||||
soption: '',
|
||||
const saveobjtRes = await updatePasswordApi({
|
||||
oldPassword: formModel.oldPassword,
|
||||
newPassword: formModel.newPassword,
|
||||
})
|
||||
|
||||
if (!searchRes.data || searchRes.data.length === 0) {
|
||||
toast.fail('旧密码错误,请重新输入')
|
||||
return
|
||||
}
|
||||
|
||||
const updateObj = {
|
||||
b_id: userStore.userInfo.userid,
|
||||
b_password: formModel.newPassword,
|
||||
}
|
||||
|
||||
const tables = []
|
||||
const insertValues = []
|
||||
const updateValues = []
|
||||
const delValues = []
|
||||
const keys = []
|
||||
|
||||
tables.push('b_truck')
|
||||
insertValues.push('[]')
|
||||
updateValues.push(JSON.stringify([updateObj]))
|
||||
delValues.push('[]')
|
||||
keys.push('b_id')
|
||||
|
||||
const saveobjtRes = await saveobjtApi({
|
||||
tables,
|
||||
insertValues,
|
||||
delValues,
|
||||
updateValues,
|
||||
keys,
|
||||
})
|
||||
|
||||
if (saveobjtRes.data === 'OK') {
|
||||
if (saveobjtRes.success) {
|
||||
toast.success('密码修改成功,请重新登录')
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -210,7 +210,7 @@ async function handleConfirm() {
|
||||
b_container_no: form.value.containerNo,
|
||||
b_container_img: form.value.containerImageUrl,
|
||||
b_ocr_no: form.value.ocrNo,
|
||||
b_ocr_score: form.value.ocrScore,
|
||||
b_ocr_score: form.value.ocrScore || 0.00,
|
||||
}
|
||||
|
||||
const fileInserts = []
|
||||
|
||||
@@ -76,7 +76,7 @@ function deleteAliyunFiles() {
|
||||
/>
|
||||
</view>
|
||||
<view v-if="userStore.isLogined" class="grid-container">
|
||||
<sar-grid :columns="2" gap="24rpx">
|
||||
<sar-grid :columns="1" gap="24rpx">
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/upload/index')"
|
||||
>
|
||||
@@ -86,10 +86,6 @@ function deleteAliyunFiles() {
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
</sar-grid>
|
||||
|
||||
<sar-button @click="deleteAliyunFiles">
|
||||
删除附件
|
||||
</sar-button>
|
||||
</view>
|
||||
<sar-result v-else status="warning" title="尚未登陆" style="margin-top: 32rpx;">
|
||||
<sar-button
|
||||
|
||||
@@ -72,3 +72,23 @@ export function saveObjectApi(params: SaveObjectParams[]) {
|
||||
export function getUniqueIdApi() {
|
||||
return httpPost<number>('/data/getUniqueId')
|
||||
}
|
||||
|
||||
interface LoadDataParams {
|
||||
viewName: string
|
||||
searchCondition: string
|
||||
orderField: string
|
||||
searchColumns: string[]
|
||||
}
|
||||
|
||||
export function loadDataApi(params: LoadDataParams) {
|
||||
return httpPost<any[]>('/data/loadData', params)
|
||||
}
|
||||
|
||||
interface UpdatePasswordParams {
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
export function updatePasswordApi(params: UpdatePasswordParams) {
|
||||
return httpPost(`/auth/updatePassword`, params)
|
||||
}
|
||||
@@ -18,7 +18,7 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
// H5:用 request 请求,带时间戳保证最新
|
||||
const timestamp = Date.now()
|
||||
uni.request({
|
||||
url: `/g3cdjtd-app/static/db.json?t=${timestamp}`,
|
||||
url: `/g3ocr-app/static/db.json?t=${timestamp}`,
|
||||
method: 'GET',
|
||||
success: r => res(r.data as Record<string, string>),
|
||||
fail: err => rej(err),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"g3hd": "http://127.0.0.1:8085/api"
|
||||
// "g3hd": "http://ser369.g3soft.cn:80/api",
|
||||
"g3hd": "http://192.168.1.137:80/api"
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>集装箱录入</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
|
||||
<body class="bg-gray-100">
|
||||
|
||||
<!-- 顶部 -->
|
||||
<div class="bg-white shadow-sm px-4 py-3 text-lg font-semibold">
|
||||
集装箱录入
|
||||
</div>
|
||||
|
||||
<div class="p-4 space-y-4">
|
||||
|
||||
<!-- Step 1 -->
|
||||
<div class="bg-white rounded-2xl shadow p-4 space-y-4">
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-6 h-6 rounded-full bg-blue-500 text-white text-sm flex items-center justify-center">
|
||||
1
|
||||
</div>
|
||||
<div class="font-medium text-gray-800">
|
||||
集装箱识别
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 输入框 -->
|
||||
<div>
|
||||
<label class="text-sm text-gray-500">集装箱号</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入或识别集装箱号"
|
||||
class="w-full mt-1 border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 拍照 -->
|
||||
<div class="flex gap-3">
|
||||
<div class="flex-1 border-2 border-dashed rounded-xl h-28 flex flex-col items-center justify-center text-gray-400">
|
||||
📷
|
||||
<div class="text-xs mt-1">拍照识别</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 border-2 border-dashed rounded-xl h-28 flex flex-col items-center justify-center text-gray-400">
|
||||
🖼
|
||||
<div class="text-xs mt-1">相册上传</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- OCR结果 -->
|
||||
<div class="bg-gray-50 rounded-lg p-3 text-sm text-gray-600">
|
||||
OCR识别结果:<span class="text-gray-400">暂无</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Step 2 -->
|
||||
<div class="bg-white rounded-2xl shadow p-4 space-y-4">
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-6 h-6 rounded-full bg-green-500 text-white text-sm flex items-center justify-center">
|
||||
2
|
||||
</div>
|
||||
<div class="font-medium text-gray-800">
|
||||
其他照片录入
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 图片列表 -->
|
||||
<div class="grid grid-cols-3 gap-3">
|
||||
|
||||
<!-- 已上传 -->
|
||||
<div class="relative">
|
||||
<div class="h-24 bg-gray-200 rounded-lg"></div>
|
||||
<div class="absolute top-1 right-1 bg-black/50 text-white text-xs px-1 rounded">
|
||||
✓
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传按钮 -->
|
||||
<div class="h-24 border-2 border-dashed rounded-lg flex flex-col items-center justify-center text-gray-400">
|
||||
➕
|
||||
<div class="text-xs mt-1">添加</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 说明 -->
|
||||
<div class="text-xs text-gray-400">
|
||||
可上传箱体、封条、货物等相关照片
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<div class="fixed bottom-0 left-0 right-0 bg-white border-t p-3">
|
||||
<button class="w-full bg-blue-500 text-white py-3 rounded-xl text-lg">
|
||||
提交
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,18 +0,0 @@
|
||||
from paddleocr import PaddleOCR
|
||||
# 初始化 PaddleOCR 实例
|
||||
ocr = PaddleOCR(
|
||||
use_doc_orientation_classify=False,
|
||||
use_doc_unwarping=False,
|
||||
use_textline_orientation=False,
|
||||
text_det_limit_side_len=736, # 设置图像边长限制
|
||||
)
|
||||
|
||||
# 对示例图像执行 OCR 推理
|
||||
result = ocr.predict(
|
||||
input="./8B457A96D0F016EAB6EB6D24AD70406C.jpg")
|
||||
|
||||
# 可视化结果并保存 json 结果
|
||||
for res in result:
|
||||
res.print()
|
||||
res.save_to_img("output")
|
||||
res.save_to_json("output")
|
||||
Reference in new issue
Block a user