u
This commit is contained in:
1 parent
6c20d0c80d
commit
4aaa93df7d
66 files changed
+4375
-1311
No files matched your search
@@ -6,7 +6,7 @@ import { useUserStore } from './store'
|
||||
const userStore = useUserStore()
|
||||
|
||||
onLaunch(() => {
|
||||
// userStore.requireLogin()
|
||||
userStore.requireLogin()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
@@ -18,7 +18,7 @@ onUnmounted(() => {
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #f7f7f8;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { FieldValidateError, FormExpose, FormRules } from 'sard-uniapp'
|
||||
import { getWindowInfo, toast } from 'sard-uniapp'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { loaddataApi, loginApi } from '@/request/api'
|
||||
import { loginApi } from '@/request/api'
|
||||
import { useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -12,7 +12,7 @@ const startOffset = ref(getWindowInfo().statusBarHeight + 60)
|
||||
const _loading = ref(false)
|
||||
|
||||
const formModel = reactive({
|
||||
orgid: userStore.userInfo.orgid,
|
||||
orgid: 'g3hd',
|
||||
userid: userStore.userInfo.userid,
|
||||
password: '',
|
||||
})
|
||||
@@ -42,47 +42,50 @@ async function onSubmit() {
|
||||
password: formModel.password,
|
||||
})
|
||||
|
||||
if (!res?.data) {
|
||||
toast.fail('登录失败,请检查账号密码')
|
||||
return
|
||||
}
|
||||
|
||||
userStore.userInfo = {
|
||||
...userStore.userInfo,
|
||||
orgid: formModel.orgid,
|
||||
userid: formModel.userid,
|
||||
token: res.data,
|
||||
}
|
||||
|
||||
let username = ''
|
||||
try {
|
||||
const userRes = await loaddataApi({
|
||||
viewname: 'v_b_truck',
|
||||
soption: '',
|
||||
orderfield: '',
|
||||
searchcondition: `b_id = '${formModel.userid}'`,
|
||||
})
|
||||
if (userRes?.data?.length > 0) {
|
||||
username = userRes.data[0].v_worker_name || ''
|
||||
if (res.success) {
|
||||
userStore.userInfo = {
|
||||
...userStore.userInfo,
|
||||
orgid: formModel.orgid,
|
||||
userid: formModel.userid,
|
||||
token: res.data.token,
|
||||
username: res.data.username,
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.warn('获取用户信息失败', err)
|
||||
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success',
|
||||
})
|
||||
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
}
|
||||
|
||||
userStore.userInfo = {
|
||||
...userStore.userInfo,
|
||||
username,
|
||||
}
|
||||
// if (!res?.data) {
|
||||
// toast.fail('登录失败,请检查账号密码')
|
||||
// return
|
||||
// }
|
||||
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success',
|
||||
})
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// orgid: formModel.orgid,
|
||||
// userid: formModel.userid,
|
||||
// token: res.data,
|
||||
// }
|
||||
|
||||
uni.switchTab({
|
||||
url: '/pages/home/index',
|
||||
})
|
||||
// userStore.userInfo = {
|
||||
// ...userStore.userInfo,
|
||||
// username,
|
||||
// }
|
||||
|
||||
// uni.showToast({
|
||||
// title: '登录成功',
|
||||
// icon: 'success',
|
||||
// })
|
||||
|
||||
// uni.switchTab({
|
||||
// url: '/pages/home/index',
|
||||
// })
|
||||
}
|
||||
catch (err: any) {
|
||||
// 表单验证错误
|
||||
@@ -91,7 +94,6 @@ async function onSubmit() {
|
||||
}
|
||||
else {
|
||||
console.error(err)
|
||||
toast.fail(err.message || '登录异常')
|
||||
}
|
||||
}
|
||||
finally {
|
||||
@@ -122,7 +124,7 @@ async function onSubmit() {
|
||||
</view>
|
||||
|
||||
<view class="form-list">
|
||||
<sar-form-item-plain name="orgid">
|
||||
<!-- <sar-form-item-plain name="orgid">
|
||||
<view class="form-label">
|
||||
<text>机构码</text>
|
||||
</view>
|
||||
@@ -137,7 +139,7 @@ async function onSubmit() {
|
||||
</template>
|
||||
</sar-input>
|
||||
</view>
|
||||
</sar-form-item-plain>
|
||||
</sar-form-item-plain> -->
|
||||
<sar-form-item-plain name="userid">
|
||||
<view class="form-label">
|
||||
账号
|
||||
|
||||
@@ -1,49 +1,322 @@
|
||||
<script lang="ts" setup>
|
||||
import { toast } from 'sard-uniapp'
|
||||
import { deleteAliyunFileApi, recognizeOcrBoxApi } from '@/request/api'
|
||||
import { imageCompress, uploadFileToAliyun } from '@/utils/file'
|
||||
|
||||
const boxImage = ref('')
|
||||
|
||||
const ocrFinish = ref(false)
|
||||
const isError = ref(false)
|
||||
const ocrScore = ref('0.00')
|
||||
|
||||
const form = ref({
|
||||
boxNumber: '',
|
||||
boxImageUrl: '',
|
||||
})
|
||||
|
||||
function handleChooseBox() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
success: (res) => {
|
||||
if (Array.isArray(res.tempFiles) && res.tempFiles.length > 0) {
|
||||
const tempFile: any = res.tempFiles[0]
|
||||
|
||||
boxImage.value = tempFile.path
|
||||
|
||||
imageCompress(tempFile.path).then((compressRes) => {
|
||||
uploadFileToAliyun(compressRes.path, tempFile.name, 'image').then((res) => {
|
||||
if (res.url) {
|
||||
form.value.boxImageUrl = res.url
|
||||
|
||||
ocrFinish.value = false
|
||||
|
||||
toast.loading('OCR识别中,请稍等 . . .', {
|
||||
overlay: true,
|
||||
transparent: false,
|
||||
})
|
||||
|
||||
recognizeOcrBoxApi({
|
||||
fileUrl: form.value.boxImageUrl,
|
||||
}).then((ocrRes) => {
|
||||
if (ocrRes.success) {
|
||||
toast.success('识别成功,请检查箱号是否正确')
|
||||
|
||||
const score = Number(ocrRes?.data?.score ?? 0)
|
||||
ocrScore.value = `${(Math.floor(score * 10000) / 100).toFixed(2)}%`
|
||||
|
||||
form.value.boxNumber = ocrRes.data.boxNumber
|
||||
|
||||
isError.value = false
|
||||
}
|
||||
}).catch(() => {
|
||||
isError.value = true
|
||||
}).finally(() => {
|
||||
ocrFinish.value = true
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function handleDeleteBoxImage() {
|
||||
if (!form.value.boxImageUrl) {
|
||||
boxImage.value = ''
|
||||
form.value.boxImageUrl = ''
|
||||
form.value.boxNumber = ''
|
||||
return
|
||||
}
|
||||
|
||||
toast.loading('正在删除中 . . .', {
|
||||
overlay: true,
|
||||
transparent: false,
|
||||
})
|
||||
|
||||
console.log(form.value.boxImageUrl)
|
||||
|
||||
deleteAliyunFileApi(form.value.boxImageUrl).then((res) => {
|
||||
if (res.success) {
|
||||
boxImage.value = ''
|
||||
form.value.boxImageUrl = ''
|
||||
form.value.boxNumber = ''
|
||||
|
||||
toast.success('删除成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="item">
|
||||
<sar-tag theme="primary" mark size="large">
|
||||
1、集装箱照片
|
||||
</sar-tag>
|
||||
<view class="g3-container">
|
||||
<view class="g3-content">
|
||||
<view class="step">
|
||||
<view class="step-header">
|
||||
<sar-tag theme="primary" mark="right" size="large">
|
||||
1、集装箱号识别(OCR自动识别)
|
||||
</sar-tag>
|
||||
</view>
|
||||
|
||||
<view
|
||||
style="padding: 32rpx;"
|
||||
>
|
||||
<sar-input
|
||||
placeholder="请输入"
|
||||
/>
|
||||
<view class="step-content box">
|
||||
<view v-if="ocrFinish" class="header ">
|
||||
<sar-alert
|
||||
v-if="!isError"
|
||||
type="success"
|
||||
show-icon
|
||||
closable
|
||||
:root-style="{
|
||||
width: '100%',
|
||||
}"
|
||||
>
|
||||
识别成功,请检查箱号是否正确!
|
||||
<view>
|
||||
准确率:{{ ocrScore }}
|
||||
</view>
|
||||
</sar-alert>
|
||||
<sar-alert
|
||||
v-else
|
||||
type="danger"
|
||||
show-icon
|
||||
closable
|
||||
:root-style="{
|
||||
width: '100%',
|
||||
}"
|
||||
>
|
||||
识别失败,请检查手动填写集装箱号
|
||||
</sar-alert>
|
||||
</view>
|
||||
|
||||
<view />
|
||||
<view class="box-main">
|
||||
<view v-if="!boxImage" class="box-placeholder" @click="handleChooseBox">
|
||||
<sar-icon name="image" size="56rpx" color="#999" />
|
||||
<text class="placeholder-text">
|
||||
上传箱号图片,自动识别箱号
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view v-else class="box-image">
|
||||
<wd-img
|
||||
:src="boxImage"
|
||||
width="100%"
|
||||
height="100%"
|
||||
:enable-preview="true"
|
||||
/>
|
||||
|
||||
<view class="delete-btn" @click="handleDeleteBoxImage()">
|
||||
<sar-icon name="close" size="20rpx" color="#fff" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="box-input">
|
||||
<view class="header">
|
||||
<view>集装箱号</view>
|
||||
<view class="format">
|
||||
格式: 4字母 + 7数字
|
||||
</view>
|
||||
</view>
|
||||
<sar-input
|
||||
v-model="form.boxNumber"
|
||||
placeholder="请输入箱号"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="step">
|
||||
<view class="step-header">
|
||||
<sar-tag theme="primary" mark="right" size="large">
|
||||
2、其它照片录入
|
||||
</sar-tag>
|
||||
</view>
|
||||
<view class="step-content">
|
||||
<sar-upload />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<sar-tag theme="primary" mark size="large">
|
||||
2、装货照片
|
||||
</sar-tag>
|
||||
</view>
|
||||
|
||||
<view class="actions">
|
||||
<sar-button round>
|
||||
确定提交
|
||||
</sar-button>
|
||||
<view class="g3-footer">
|
||||
<view class="footer-main">
|
||||
<view class="submit-btn">
|
||||
确认上传
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
.g3-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.item {
|
||||
padding: 16rpx 0rpx;
|
||||
height: 100%;
|
||||
|
||||
.g3-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 16rpx 0rpx;
|
||||
}
|
||||
|
||||
.g3-footer {
|
||||
width: 100%;
|
||||
|
||||
.footer-main {
|
||||
padding: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.actions {
|
||||
padding: 36rpx;
|
||||
margin-top: 32rpx;
|
||||
.step {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.step-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.step-content {
|
||||
padding: 0rpx 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.box-main {
|
||||
height: 326rpx;
|
||||
border: 1px dashed #ddd;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.box-placeholder {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
background-color: #ecedee;
|
||||
|
||||
.placeholder-text {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.box-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
.delete-btn {
|
||||
position: absolute;
|
||||
top: 12rpx;
|
||||
right: 12rpx;
|
||||
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
|
||||
color: #fff;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
||||
|
||||
.box-input {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 12rpx;
|
||||
width: 100%;
|
||||
.format {
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
height: 72rpx;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
border-radius: 999px;
|
||||
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #3a6ee8, #5c8df6);
|
||||
box-shadow: 0 6rpx 12rpx rgba(58, 110, 232, 0.18);
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.submit-btn:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0 3rpx 6rpx rgba(58, 110, 232, 0.15);
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
"globalStyle": {
|
||||
"navigationStyle": "default",
|
||||
"navigationBarTitleText": "App",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarBackgroundColor": "#f8f8f8",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useUserStore } from '@/store'
|
||||
const userStore = useUserStore()
|
||||
|
||||
onShow(() => {
|
||||
// userStore.requireLogin()
|
||||
userStore.requireLogin()
|
||||
})
|
||||
|
||||
function handleLoginOut() {
|
||||
@@ -94,7 +94,11 @@ const avatarText = computed(() => {
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f1f5f9;
|
||||
}
|
||||
.account-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useUserStore } from '@/store'
|
||||
const userStore = useUserStore()
|
||||
|
||||
onShow(() => {
|
||||
// userStore.requireLogin()
|
||||
userStore.requireLogin()
|
||||
})
|
||||
|
||||
const swiperCurrent = ref(0)
|
||||
@@ -67,51 +67,11 @@ function toLinkUrl(url) {
|
||||
<view v-if="userStore.isLogined" class="grid-container">
|
||||
<sar-grid :columns="2" gap="24rpx">
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/waybill/index')"
|
||||
@click="toLinkUrl('/pages-sub/upload/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/waybill.png" />
|
||||
<text>在途运单</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/waybill-history/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/HistoricalWaybill.png" />
|
||||
<text>历史运单</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/yewu-yingfu/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/MyExpenses.png" />
|
||||
<text>业务应付</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/feiyong-baoxiao/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/ExpensesClaimIndex.png" />
|
||||
<text>费用报销</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/jiayou/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/refuelling.png" />
|
||||
<text>加油管理</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
<sar-grid-item
|
||||
@click="toLinkUrl('/pages-sub/cheliang-weixiu/index')"
|
||||
>
|
||||
<view class="grid-item">
|
||||
<image src="/static/images/home/CheliangWeixiu.png" />
|
||||
<text>车辆维修</text>
|
||||
<text>集装箱装货采集</text>
|
||||
</view>
|
||||
</sar-grid-item>
|
||||
</sar-grid>
|
||||
@@ -127,6 +87,10 @@ function toLinkUrl(url) {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #f1f5f9;
|
||||
}
|
||||
|
||||
.swiper-container {
|
||||
position: relative;
|
||||
.swiper {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import request from './index'
|
||||
import { httpPost } from './index'
|
||||
|
||||
const aliyunBucket = import.meta.env.VITE_ALIYUN_BUCKET
|
||||
|
||||
interface LoginParams {
|
||||
orgid: string
|
||||
@@ -7,99 +9,15 @@ interface LoginParams {
|
||||
}
|
||||
|
||||
export function loginApi(params: LoginParams) {
|
||||
return request.postForm('/login.jsp', params)
|
||||
}
|
||||
|
||||
interface GetAutocompleteDataParams {
|
||||
q: string
|
||||
page: number
|
||||
limit: number
|
||||
viewname: string
|
||||
field1: string
|
||||
field2: string
|
||||
userid?: string
|
||||
}
|
||||
|
||||
export function getAutocompleteDataApi(params: GetAutocompleteDataParams) {
|
||||
return request.postForm('/getAutocompleteData.jsp', params)
|
||||
}
|
||||
|
||||
interface GetAutocompleteDataExParams {
|
||||
q: string
|
||||
page: number
|
||||
limit: number
|
||||
viewname: string
|
||||
field1: string
|
||||
field2: string
|
||||
searchcondition: string
|
||||
userid?: string
|
||||
}
|
||||
|
||||
export function getAutocompleteDataExApi(params: GetAutocompleteDataExParams) {
|
||||
return request.postForm('/getAutocompleteDataEx.jsp', params)
|
||||
}
|
||||
|
||||
interface SaveobjtParams {
|
||||
tables: any
|
||||
insertValues: any
|
||||
delValues: any
|
||||
updateValues: any
|
||||
keys: any
|
||||
}
|
||||
|
||||
export function saveobjtApi(params: SaveobjtParams) {
|
||||
return request.postForm('/saveobjt.jsp', params)
|
||||
}
|
||||
|
||||
interface SavesubtableParams {
|
||||
subtable: any
|
||||
subinsertvalue: any
|
||||
subdelvalue: any
|
||||
subupdatevalue: any
|
||||
father: any
|
||||
}
|
||||
export function savesubtableApi(params: SavesubtableParams) {
|
||||
return request.postForm('/savesubtable.jsp', params)
|
||||
}
|
||||
|
||||
interface SearchdataParams {
|
||||
viewname: string
|
||||
searchcondition: string
|
||||
orderfield: string
|
||||
limit?: number
|
||||
}
|
||||
export function searchdataApi(params: SearchdataParams) {
|
||||
return request.postForm('/searchdata.jsp', params)
|
||||
}
|
||||
|
||||
interface SearchdatapageindexParams {
|
||||
viewname: string
|
||||
searchcondition: string
|
||||
userid: string
|
||||
orderfield: string
|
||||
page: number
|
||||
rows: number
|
||||
}
|
||||
|
||||
export function searchdatapageindexApi(params: SearchdatapageindexParams) {
|
||||
return request.postForm(`/searchdatapageindex.jsp`, params)
|
||||
}
|
||||
interface DelSubRecordParams {
|
||||
id: string
|
||||
module: string
|
||||
bucketName: string
|
||||
}
|
||||
export function delSubRecordApi(params: DelSubRecordParams) {
|
||||
return request.postForm('/DelSubRecord.jsp', params)
|
||||
return httpPost('/auth/login', params)
|
||||
}
|
||||
|
||||
interface GetaliyunkeyParams {
|
||||
orgid: string
|
||||
bucket: string
|
||||
}
|
||||
|
||||
export function getaliyunkeyApi(params: GetaliyunkeyParams) {
|
||||
return request.postForm(`/getaliyunkey.jsp`, params)
|
||||
return httpPost('/file/getAliyunKey', params)
|
||||
}
|
||||
|
||||
interface AliyunpluploadParams {
|
||||
@@ -112,82 +30,20 @@ interface AliyunpluploadParams {
|
||||
mx_cate_id: string
|
||||
}
|
||||
export function aliyunpluploadApi(params: AliyunpluploadParams) {
|
||||
return request.postForm(`/aliyunplupload.jsp`, params)
|
||||
return httpPost(`/file/insert`, params)
|
||||
}
|
||||
|
||||
interface LoaddatabysqlParams {
|
||||
sql: string
|
||||
orderfield: string
|
||||
soption: string
|
||||
}
|
||||
export function loaddatabysqlApi(params: LoaddatabysqlParams) {
|
||||
return request.postForm('/loaddatabysql.jsp', params)
|
||||
}
|
||||
interface GetfieldvaluebyidParams {
|
||||
viewname: string
|
||||
desfield: string
|
||||
idfield: string
|
||||
idvalue: string
|
||||
}
|
||||
export function getfieldvaluebyidApi(params: GetfieldvaluebyidParams) {
|
||||
return request.postForm('/getfieldvaluebyid.jsp', params)
|
||||
interface OcrBoxRequest {
|
||||
fileUrl: string
|
||||
}
|
||||
|
||||
interface GetdefaultdataParams {
|
||||
viewname: string
|
||||
}
|
||||
export function getdefaultdataApi(params: GetdefaultdataParams) {
|
||||
return request.postForm('/getdefaultdata.jsp', params)
|
||||
export function recognizeOcrBoxApi(params: OcrBoxRequest) {
|
||||
return httpPost(`/ocr/box`, params)
|
||||
}
|
||||
|
||||
interface GetautoidParams {
|
||||
moduleid: string
|
||||
userid: string
|
||||
}
|
||||
export function getautoidApi(params: GetautoidParams) {
|
||||
return request.postForm('/getautoid.jsp', params)
|
||||
}
|
||||
interface LoaddataParams {
|
||||
soption: string
|
||||
orderfield: string
|
||||
viewname: string
|
||||
searchcondition: string
|
||||
}
|
||||
export function loaddataApi(params: LoaddataParams) {
|
||||
return request.postForm('/loaddata.jsp', params)
|
||||
}
|
||||
|
||||
interface SaveLogParams {
|
||||
mainTable: string
|
||||
strMainUpdate: string
|
||||
strMainDelete: string
|
||||
subTable: string
|
||||
strSubUpdate: string
|
||||
strSubDelete: string
|
||||
recordID: string
|
||||
subID: string
|
||||
Modifyb: string
|
||||
Modifyh: string
|
||||
}
|
||||
export function saveLogApi(params: SaveLogParams) {
|
||||
return request.postForm('/saveLog.jsp', params)
|
||||
}
|
||||
|
||||
interface LoaddataAttachParams {
|
||||
soption: string
|
||||
orderfield: string
|
||||
viewname: string
|
||||
searchcondition: string
|
||||
}
|
||||
|
||||
export function loaddataAttachApi(params: LoaddataAttachParams) {
|
||||
return request.postForm('/loaddata_attach.jsp', params)
|
||||
}
|
||||
|
||||
interface DelObjParams {
|
||||
id: string
|
||||
module: string
|
||||
}
|
||||
export function delObjApi(params: DelObjParams) {
|
||||
return request.postForm('/DelObj.jsp', params)
|
||||
export function deleteAliyunFileApi(fileUrl) {
|
||||
return httpPost(`/file/deleteAliyunFile`, {
|
||||
bucketName: aliyunBucket,
|
||||
mx_mapfilename: fileUrl,
|
||||
})
|
||||
}
|
||||
@@ -103,6 +103,7 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
}
|
||||
|
||||
let data: IResData<T>
|
||||
|
||||
try {
|
||||
// 解析最外层响应
|
||||
data = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
|
||||
@@ -119,13 +120,14 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
console.log(`解析响应JSON失败:${err}`)
|
||||
toast.fail('响应数据解析失败')
|
||||
return reject(new Error('响应数据解析失败'))
|
||||
}
|
||||
|
||||
if (data.code === 200) {
|
||||
data.success = true
|
||||
|
||||
resolve(data)
|
||||
}
|
||||
else {
|
||||
@@ -134,7 +136,7 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
}
|
||||
|
||||
// 登录失效处理
|
||||
if (data.code === 600) {
|
||||
if (data.code === 401) {
|
||||
uni.showToast({ title: '请重新登录', icon: 'none' })
|
||||
|
||||
const pages = getCurrentPages()
|
||||
@@ -150,7 +152,6 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
fail: (err) => {
|
||||
if (aborted)
|
||||
return reject(new Error('请求已取消'))
|
||||
console.log(err)
|
||||
toast.fail('网络请求失败,请联系管理人员')
|
||||
|
||||
reject(new Error(err.errMsg || '网络请求失败'))
|
||||
@@ -171,6 +172,7 @@ function request<T = any>(option: UniApp.RequestOptions): Promise<IResData<T>> &
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
function parseFormUrlencoded(str: string) {
|
||||
return str.split('&').reduce((acc, pair) => {
|
||||
const [key, value] = pair.split('=')
|
||||
@@ -244,4 +246,17 @@ request.postForm = <T = any>(url: string, data?: any, option?: UniApp.RequestOpt
|
||||
})
|
||||
}
|
||||
|
||||
export function httpPost<T = any>(url: string, data?: any, option?: UniApp.RequestOptions) {
|
||||
return request<T>({
|
||||
method: 'POST',
|
||||
url,
|
||||
data,
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
...(option?.header || {}),
|
||||
},
|
||||
...option,
|
||||
})
|
||||
}
|
||||
|
||||
export default request
|
||||
@@ -8,21 +8,21 @@ export const navigateToInterceptor = {
|
||||
invoke(args: UniApp.NavigateToOptions) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
// // 白名单直接放行
|
||||
// if (whiteList.some(path => args.url.startsWith(path))) {
|
||||
// if (args.url === '/pages-sub/login/index') {
|
||||
// userStore.reset()
|
||||
// }
|
||||
// 白名单直接放行
|
||||
if (whiteList.some(path => args.url.startsWith(path))) {
|
||||
if (args.url === '/pages-sub/login/index') {
|
||||
userStore.reset()
|
||||
}
|
||||
|
||||
// return args
|
||||
// }
|
||||
return args
|
||||
}
|
||||
|
||||
// // 调用 requireLogin,如果未登录,会自动提示并跳转
|
||||
// const ok = userStore.requireLogin()
|
||||
// 调用 requireLogin,如果未登录,会自动提示并跳转
|
||||
const ok = userStore.requireLogin()
|
||||
|
||||
// if (!ok) {
|
||||
// return false // 阻止路由跳转
|
||||
// }
|
||||
if (!ok) {
|
||||
return false // 阻止路由跳转
|
||||
}
|
||||
|
||||
return args // 已登录则放行
|
||||
},
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"g3cd": "http://192.168.1.137:8083/g3cdjtd-server/h5"
|
||||
"g3hd": "http://192.168.1.137:8084/api"
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* Project id 5092914 */
|
||||
font-family: 'iconfont'; /* Project id 5142758 */
|
||||
src:
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAk8AAsAAAAAEIAAAAjtAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACETAqRfI9EATYCJAMwC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gBbtL3ML2v+WwQ3+HI77+TV5iv15sBArAxdZ5xTwf4duF+xT30OQ6Kqu51pJ8QmHeET+muWOPfhH4y32SZ+lRFj3r85SkgCJQw1QuDSLtbwbGAL6gMVlEvj0WNw9oMQhCqE9oN0pBwhSt4Ek5hlQpDKxlr8GhnK/gSVVAD4bRQcLeMR+5iojCNZ6NNNkYrDMKsFUP9EVD7ms+BczE0T0oOrnK+8wYO5jEx67oYjVNsdO3+5Ph95HnXJs0UjViKTDXs9WbVKZ2KmrjCBeylobzTKSicH2Ldmf94mueMiC4l8+M0Zo6tpApS8gviNBqE1LmvLYDQnireY4o4pOuz1CwP5QFrVUXdKiuTkrTYeSdKhH+7KipNJv6TY6se3aJYe4hZBK0w3T8gf2Qrbjev62BY7BCbUEcVVK8i8RNt6uPrmhEeEywxhX/kuYl92S6oU6zDswT2KuN3BK8hwdhbWFuFSCMFv20fwtF8a8yjMW7LZaagqIzGp1WWkpeGyTVTRzBYInpQAA')
|
||||
format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_5092914_knn9qrc14j8.ttf?t=1766557052211') format('truetype');
|
||||
url('//at.alicdn.com/t/c/font_5142758_pgr9uja0qt.ttf?t=1773887288142') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@@ -14,16 +14,16 @@
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.iconfont-sijiguanli:before {
|
||||
content: '\e61c';
|
||||
.iconfont-fasongtijiao:before {
|
||||
content: '\e693';
|
||||
}
|
||||
|
||||
.iconfont-jindu:before {
|
||||
content: '\e7b0';
|
||||
.iconfont-tupian:before {
|
||||
content: '\e8ba';
|
||||
}
|
||||
|
||||
.iconfont-jihuatiaodu:before {
|
||||
content: '\e7b6';
|
||||
.iconfont-OCRshibie:before {
|
||||
content: '\e658';
|
||||
}
|
||||
|
||||
.iconfont-save:before {
|
||||
@@ -57,3 +57,15 @@
|
||||
.iconfont-system:before {
|
||||
content: '\e703';
|
||||
}
|
||||
|
||||
.iconfont-jihuatiaodu:before {
|
||||
content: '\e7b6';
|
||||
}
|
||||
|
||||
.iconfont-jindu:before {
|
||||
content: '\e7b0';
|
||||
}
|
||||
|
||||
.iconfont-sijiguanli:before {
|
||||
content: '\e61c';
|
||||
}
|
||||
@@ -6,7 +6,7 @@ page,
|
||||
--sar-input-border-color: #ddd;
|
||||
// --sar-primary: #34495e;
|
||||
--sar-primary: #4d80f0;
|
||||
--sar-rounded: 4rpx;
|
||||
--sar-rounded: 8rpx;
|
||||
--sar-dialog-title-font-size: 42rpx;
|
||||
--sar-dialog-message-font-size: 36rpx;
|
||||
--sar-dialog-title-headed-font-size: 38rpx;
|
||||
@@ -38,3 +38,14 @@ uni-toast {
|
||||
.sar-radio-popout__scroll {
|
||||
height: var(--sar-radio-popout-max-height);
|
||||
}
|
||||
|
||||
.sar-upload__wrapper > * {
|
||||
margin-right: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
uni-page-body {
|
||||
height: 100%;
|
||||
> view:first-child {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ declare global {
|
||||
code: number
|
||||
message: string
|
||||
data: T
|
||||
success: boolean
|
||||
}
|
||||
|
||||
// uni.uploadFile文件上传参数
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { toast } from 'sard-uniapp'
|
||||
import { getaliyunkeyApi, loaddataAttachApi } from '@/request/api'
|
||||
import { useUserStore } from '@/store'
|
||||
import { getaliyunkeyApi } from '@/request/api'
|
||||
import { isApp, isH5, isMpWeixin } from './platform'
|
||||
|
||||
const aliyunBucket = import.meta.env.VITE_ALIYUN_BUCKET
|
||||
@@ -132,11 +131,8 @@ export async function uploadFileToAliyun(
|
||||
fileName: string,
|
||||
fileType: any,
|
||||
): Promise<AliyunUploadResult> {
|
||||
const userStore = useUserStore()
|
||||
|
||||
// 获取 OSS 临时上传凭证
|
||||
const keyRes = await getaliyunkeyApi({
|
||||
orgid: userStore.userInfo.orgid,
|
||||
bucket: aliyunBucket,
|
||||
})
|
||||
const { accessid, callback, dir, host, policy, signature } = keyRes.data
|
||||
@@ -421,24 +417,3 @@ function downloadAppMedia(fileUrl: string, type: 'image' | 'video') {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function checkUploadFile(fatherId, modUid, cateId = '') {
|
||||
let searchcondition = `father = '${fatherId}' and mx_moduleid = '${modUid}'`
|
||||
|
||||
if (cateId !== '') {
|
||||
searchcondition += ` and mx_cate_id = '${cateId}'`
|
||||
}
|
||||
|
||||
return loaddataAttachApi({
|
||||
viewname: 'bf_files',
|
||||
searchcondition,
|
||||
orderfield: 'mx_xh',
|
||||
soption: '',
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
console.log(res.data.length)
|
||||
return res.data.length > 0
|
||||
}).catch(() => {
|
||||
return false
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user