首页重构
This commit is contained in:
parent
f5df84eddb
commit
75775836cd
@ -1,4 +1,2 @@
|
||||
|
||||
export * from './padController';
|
||||
|
||||
export * from './vehicleCollectionController';
|
||||
|
||||
@ -1,9 +1,56 @@
|
||||
import { request } from '../utils/Request';
|
||||
import { http } from '@kit.NetworkKit';
|
||||
|
||||
/** 08、获取Pad首页信息 GET /car-inspection-rest/pad/index/info */
|
||||
export async function getPadIndexInfoUsingGet(params: API.getPadIndexInfoUsingGETParams) {
|
||||
return request<API.RPadIndexInfoRsp>('/car-inspection-rest/pad/index/info', {
|
||||
method: http.RequestMethod.GET,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 04、获取查验预警列表 POST /car-inspection-rest/pad/inspect/alarm */
|
||||
export async function getInspectAlarmUsingPost(body: API.InspectAlarmQueryReq) {
|
||||
return request<API.RInspectAlarmItemRsp>('/car-inspection-rest/pad/inspect/alarm', {
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body
|
||||
});
|
||||
}
|
||||
|
||||
/** 06、获取查验结果详情 GET /car-inspection-rest/pad/inspect/result/detail */
|
||||
export async function getInspectResultDetailUsingGet(params: API.getInspectResultDetailUsingGETParams) {
|
||||
return request<API.RInspectRecordDetailVo>('/car-inspection-rest/pad/inspect/result/detail', {
|
||||
method: http.RequestMethod.GET,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 05、获取查验结果列表 POST /car-inspection-rest/pad/inspect/result/list */
|
||||
export async function getInspectResultListUsingPost(body: API.InspectRecordResultReq) {
|
||||
return request<API.PageResultInspectRecordResultRsp>(
|
||||
'/car-inspection-rest/pad/inspect/result/list',
|
||||
{
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 03、获取查验线监控信息列表 GET /car-inspection-rest/pad/line/monitor */
|
||||
export async function getLineMonitorInfoUsingGet() {
|
||||
return request<API.RListBusiInspectVo>('/car-inspection-rest/pad/line/monitor', {
|
||||
method: http.RequestMethod.GET,
|
||||
});
|
||||
}
|
||||
|
||||
/** 01、登录Pad POST /car-inspection-rest/pad/login */
|
||||
export async function padLoginUsingPost(body: API.PadLoginReq) {
|
||||
export async function padLoginUsingPost(body: API.PadLoginReq,) {
|
||||
return request<API.RPadLoginRsp>('/car-inspection-rest/pad/login', {
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
@ -14,58 +61,16 @@ export async function padLoginUsingPost(body: API.PadLoginReq) {
|
||||
}
|
||||
|
||||
/** 02、获取Pad记录信息 GET /car-inspection-rest/pad/record/info */
|
||||
export async function getPadRecordInfoUsingGet(params: API.getPadRecordInfoUsingGETParams,) {
|
||||
export async function getPadRecordInfoUsingGet(params: API.getPadRecordInfoUsingGETParams) {
|
||||
return request<API.RPadRecordRsp>('/car-inspection-rest/pad/record/info', {
|
||||
method: http.RequestMethod.GET,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 03、获取查验线监控信息列表 GET /car-inspection-rest/pad/line/monitor */
|
||||
export async function getLineMonitorInfoUsingGet() {
|
||||
return request<API.RListBusiInspectVo>('/car-inspection-rest/pad/line/monitor', {
|
||||
method: http.RequestMethod.GET,
|
||||
});
|
||||
}
|
||||
|
||||
/** 04、获取查验预警列表 POST /car-inspection-rest/pad/inspect/alarm */
|
||||
export async function getInspectAlarmUsingPost(
|
||||
body: API.InspectAlarmQueryReq,
|
||||
) {
|
||||
return request<API.RListInspectAlarmItemRsp>('/car-inspection-rest/pad/inspect/alarm', {
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 05、获取查验结果列表 POST /car-inspection-rest/pad/inspect/result/list */
|
||||
export async function getInspectResultListUsingPost(body: API.InspectRecordResultReq,) {
|
||||
return request<API.RListInspectRecordResultRsp>('/car-inspection-rest/pad/inspect/result/list', {
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 06、获取查验结果详情 GET /car-inspection-rest/pad/inspect/result/detail */
|
||||
export async function getInspectResultDetailUsingGet(params: API.getInspectResultDetailUsingGETParams,) {
|
||||
return request<API.RInspectRecordDetailVo>('/car-inspection-rest/pad/inspect/result/detail', {
|
||||
method: http.RequestMethod.GET,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/** 07、获取流程阶段与步骤信息 GET /car-inspection-rest/pad/stage-step/info */
|
||||
export async function getStageAndStepInfoUsingGet() {
|
||||
return request<API.RListStageAndStepRsp>('/car-inspection-rest/pad/stage-step/info', {
|
||||
method: http.RequestMethod.GET,
|
||||
method: http.RequestMethod.GET
|
||||
});
|
||||
}
|
||||
|
||||
@ -80,6 +80,13 @@ declare namespace API {
|
||||
id: number
|
||||
}
|
||||
|
||||
interface getPadIndexInfoUsingGETParams {
|
||||
/** imei */
|
||||
imei: string
|
||||
/** lineId */
|
||||
lineId?: number
|
||||
}
|
||||
|
||||
interface getPadRecordInfoUsingGETParams {
|
||||
/** imei */
|
||||
imei: string
|
||||
@ -93,6 +100,13 @@ declare namespace API {
|
||||
}
|
||||
|
||||
interface InspectAlarmItemRsp {
|
||||
/** 处理数量 */
|
||||
dealNum?: number
|
||||
/** 预警列表 */
|
||||
page?: PageResultInspectAlarmItemVo
|
||||
}
|
||||
|
||||
interface InspectAlarmItemVo {
|
||||
/** 报警代码 */
|
||||
alarmCode?: string
|
||||
/** 报警信息 */
|
||||
@ -118,14 +132,32 @@ declare namespace API {
|
||||
alarmStartTime?: string
|
||||
/** 报警状态 */
|
||||
alarmStatus?: string
|
||||
isAsc?: string
|
||||
/** 线路ID */
|
||||
lineId?: number
|
||||
/** 流程ID */
|
||||
orderByColumn?: string
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
reasonable?: boolean
|
||||
/** 阶段ID */
|
||||
stageId?: number
|
||||
/** 查验站ID */
|
||||
stationId?: number
|
||||
/** 步骤ID */
|
||||
stepId?: number
|
||||
}
|
||||
|
||||
interface InspectIndexCount {
|
||||
/** 失败数量 */
|
||||
fail?: number
|
||||
/** 已完成数量 */
|
||||
finish?: number
|
||||
/** 今日查验总数 */
|
||||
total?: number
|
||||
/** 未完成数量 */
|
||||
unfinish?: number
|
||||
}
|
||||
|
||||
interface InspectionInfo {
|
||||
/** 车辆类型 */
|
||||
carType?: string
|
||||
@ -136,6 +168,23 @@ declare namespace API {
|
||||
certificateId?: number
|
||||
}
|
||||
|
||||
interface InspectLineInfoVo {
|
||||
/** 电量(示例字段,默认90) */
|
||||
battery?: number
|
||||
/** 当前记录结束时间,未结束则为空 */
|
||||
endTime?: string
|
||||
/** 记录ID */
|
||||
id?: number
|
||||
/** 检测线ID */
|
||||
lineId?: number
|
||||
/** 检测线名称 */
|
||||
lineName?: string
|
||||
/** 检测线状态:未启动/使用中/告警 */
|
||||
lineStatus?: string
|
||||
/** 当前步骤名称 */
|
||||
name?: string
|
||||
}
|
||||
|
||||
interface InspectPhotoVo {
|
||||
/** 主键ID */
|
||||
id?: number
|
||||
@ -187,14 +236,23 @@ declare namespace API {
|
||||
}
|
||||
|
||||
interface InspectRecordResultReq {
|
||||
/** 查验日期 */
|
||||
inspectDate?: string
|
||||
/** 查验结束日期 */
|
||||
inspectEndDate?: string
|
||||
/** 查验开始日期 */
|
||||
inspectStartDate?: string
|
||||
isAsc?: string
|
||||
/** 查验线ID */
|
||||
lineId?: string
|
||||
orderByColumn?: string
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
reasonable?: boolean
|
||||
/** 查验结果 */
|
||||
results?: string
|
||||
/** 当前阶段ID */
|
||||
stageId?: string
|
||||
/** 查询未采集列表 */
|
||||
unMatch?: string
|
||||
}
|
||||
|
||||
interface InspectRecordResultRsp {
|
||||
@ -204,8 +262,12 @@ declare namespace API {
|
||||
businessType?: string
|
||||
/** 创建时间 */
|
||||
createTime?: string
|
||||
/** 生产厂家 */
|
||||
factoryName?: string
|
||||
/** 查验记录id */
|
||||
id?: string
|
||||
/** 型号 */
|
||||
model?: string
|
||||
/** 查验线名称 */
|
||||
name?: string
|
||||
/** 查验结果 */
|
||||
@ -225,6 +287,13 @@ declare namespace API {
|
||||
username?: string
|
||||
}
|
||||
|
||||
interface PadIndexInfoRsp {
|
||||
/** 首页统计信息 */
|
||||
indexCount?: InspectIndexCount
|
||||
/** 查验线状态列表 */
|
||||
list?: InspectLineInfoVo[]
|
||||
}
|
||||
|
||||
interface PadLoginReq {
|
||||
/** pad唯一编号 */
|
||||
imei?: string
|
||||
@ -239,6 +308,8 @@ declare namespace API {
|
||||
lines?: VcInspectionLine[]
|
||||
/** 查验员姓名 */
|
||||
name?: string
|
||||
/** padId */
|
||||
padId?: string
|
||||
/** 检测站id */
|
||||
stationId?: string
|
||||
/** 检测站名称 */
|
||||
@ -254,6 +325,39 @@ declare namespace API {
|
||||
lines?: VcInspectionLine[]
|
||||
}
|
||||
|
||||
interface PageResultInspectAlarmItemVo {
|
||||
/** 消息状态码 */
|
||||
code?: number
|
||||
/** 消息内容 */
|
||||
msg?: string
|
||||
/** 列表数据 */
|
||||
rows?: InspectAlarmItemVo[]
|
||||
/** 总记录数 */
|
||||
total?: number
|
||||
}
|
||||
|
||||
interface PageResultInspectRecordResultRsp {
|
||||
/** 消息状态码 */
|
||||
code?: number
|
||||
/** 消息内容 */
|
||||
msg?: string
|
||||
/** 列表数据 */
|
||||
rows?: InspectRecordResultRsp[]
|
||||
/** 总记录数 */
|
||||
total?: number
|
||||
}
|
||||
|
||||
interface PageResultVehicleCollectionRsp {
|
||||
/** 消息状态码 */
|
||||
code?: number
|
||||
/** 消息内容 */
|
||||
msg?: string
|
||||
/** 列表数据 */
|
||||
rows?: VehicleCollectionRsp[]
|
||||
/** 总记录数 */
|
||||
total?: number
|
||||
}
|
||||
|
||||
interface QueryVehicleKindRsp {
|
||||
/** 车架号遮挡描述:掀开主驾驶脚垫 */
|
||||
blockInfo?: string
|
||||
@ -275,7 +379,13 @@ declare namespace API {
|
||||
|
||||
interface R {
|
||||
code?: number
|
||||
data?: Record<string, object>
|
||||
data?: Record<string, any>
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface RInspectAlarmItemRsp {
|
||||
code?: number
|
||||
data?: InspectAlarmItemRsp
|
||||
msg?: string
|
||||
}
|
||||
|
||||
@ -309,18 +419,6 @@ declare namespace API {
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface RListInspectAlarmItemRsp {
|
||||
code?: number
|
||||
data?: InspectAlarmItemRsp[]
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface RListInspectRecordResultRsp {
|
||||
code?: number
|
||||
data?: InspectRecordResultRsp[]
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface RListStageAndStepRsp {
|
||||
code?: number
|
||||
data?: StageAndStepRsp[]
|
||||
@ -473,6 +571,12 @@ declare namespace API {
|
||||
userId?: string
|
||||
}
|
||||
|
||||
interface RPadIndexInfoRsp {
|
||||
code?: number
|
||||
data?: PadIndexInfoRsp
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface RPadLoginRsp {
|
||||
code?: number
|
||||
data?: PadLoginRsp
|
||||
@ -497,9 +601,9 @@ declare namespace API {
|
||||
msg?: string
|
||||
}
|
||||
|
||||
interface Rstring {
|
||||
interface RUploadPhotoRsp {
|
||||
code?: number
|
||||
data?: string
|
||||
data?: UploadPhotoRsp
|
||||
msg?: string
|
||||
}
|
||||
|
||||
@ -522,6 +626,17 @@ declare namespace API {
|
||||
stageId?: string
|
||||
}
|
||||
|
||||
interface UploadInspectReq {
|
||||
/** 相关数据,json格式的数据 */
|
||||
data?: Record<string, any>
|
||||
/** 设备唯一标识 */
|
||||
deviceNo?: string
|
||||
/** 任务编号 */
|
||||
taskCode?: string
|
||||
/** 任务类型,例如:LeftFrontResult,RightRearResult,TireResult。 */
|
||||
taskType?: string
|
||||
}
|
||||
|
||||
interface UploadPhotoReq {
|
||||
/** base64的图片 */
|
||||
base64?: string
|
||||
@ -529,6 +644,13 @@ declare namespace API {
|
||||
lineId?: string
|
||||
}
|
||||
|
||||
interface UploadPhotoRsp {
|
||||
/** 文件相对目录,传给平台的文件地址,使用这个地址!! */
|
||||
path?: string
|
||||
/** 访问地址前缀,文件访问时完整的目录为: url + path */
|
||||
url?: string
|
||||
}
|
||||
|
||||
interface VcInspectionLine {
|
||||
code?: string
|
||||
createBy?: string
|
||||
@ -538,7 +660,7 @@ declare namespace API {
|
||||
doronCheckResult?: string
|
||||
id?: number
|
||||
name?: string
|
||||
params?: Record<string, object>
|
||||
params?: Record<string, any>
|
||||
remark?: string
|
||||
stationId?: number
|
||||
status?: string
|
||||
@ -547,6 +669,56 @@ declare namespace API {
|
||||
}
|
||||
|
||||
interface VehicleCollectionReq {
|
||||
/** 车架号遮挡描述:掀开主驾驶脚垫 */
|
||||
blockInfo?: string
|
||||
/** 品牌 */
|
||||
brandName?: string
|
||||
/** 充电口图片 */
|
||||
chargingPortPhotoUrl?: string
|
||||
/** 充电口位置 */
|
||||
chargingPortPosition?: string
|
||||
/** 生产厂家 */
|
||||
factoryName?: string
|
||||
isAsc?: string
|
||||
/** 型号 */
|
||||
model?: string
|
||||
/** 生产月份 */
|
||||
month?: string
|
||||
orderByColumn?: string
|
||||
/** 其他移动:轮胎左侧转向、备胎移出等 */
|
||||
otherMove?: string
|
||||
/** padId */
|
||||
padId?: number
|
||||
pageNum?: number
|
||||
pageSize?: number
|
||||
/** 铭牌照片 */
|
||||
platePhotoUrl?: string
|
||||
/** 铭牌位置 */
|
||||
platePosition?: string
|
||||
/** 铭牌位置图片 */
|
||||
platePositionUrl?: string
|
||||
/** 车架号总体位置 */
|
||||
position?: string
|
||||
/** 车架号方位信息,类似左边、右边等 */
|
||||
positionDirection?: string
|
||||
/** 查询日期结束 */
|
||||
queryEndDate?: string
|
||||
/** 查询日期开始 */
|
||||
queryStartDate?: string
|
||||
reasonable?: boolean
|
||||
/** 车架号座椅挪动 */
|
||||
seatMove?: string
|
||||
/** 慢充图片 */
|
||||
slowChargingPortPhotoUrl?: string
|
||||
/** 慢充位置 */
|
||||
slowChargingPortPosition?: string
|
||||
/** 车架号图片 */
|
||||
vinPhotoUrl?: string
|
||||
/** 生产年份 */
|
||||
year?: string
|
||||
}
|
||||
|
||||
interface VehicleCollectionRsp {
|
||||
/** 车架号遮挡描述:掀开主驾驶脚垫 */
|
||||
blockInfo?: string
|
||||
/** 品牌 */
|
||||
@ -1,8 +1,26 @@
|
||||
import { request } from '../utils/Request';
|
||||
import { http } from '@kit.NetworkKit';
|
||||
|
||||
/** 02、获取车型采集列表 POST /car-inspection-rest/pad/vehicleCollection/getVehicleCollectionList */
|
||||
export async function getInspectAlarmUsingPost1(
|
||||
body: API.VehicleCollectionReq,
|
||||
) {
|
||||
return request<API.PageResultVehicleCollectionRsp>(
|
||||
'/car-inspection-rest/pad/vehicleCollection/getVehicleCollectionList',
|
||||
{
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 01、保存车型采集信息 POST /car-inspection-rest/pad/vehicleCollection/saveCollection.do */
|
||||
export async function saveVinPositionUsingPost(body: API.VehicleCollectionReq,) {
|
||||
export async function saveVinPositionUsingPost(
|
||||
body: API.VehicleCollectionReq,
|
||||
) {
|
||||
return request<API.R>('/car-inspection-rest/pad/vehicleCollection/saveCollection.do', {
|
||||
method: http.RequestMethod.POST,
|
||||
headers: {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import router from '@ohos.router'
|
||||
import { padLoginUsingPost } from '../api'
|
||||
import { getDeviceId } from '../utils/System'
|
||||
import Loading from './components/Loading/Index'
|
||||
|
||||
@ -79,19 +80,20 @@ struct Index {
|
||||
|
||||
let deviceId = await getDeviceId()
|
||||
|
||||
// this.controller.open()
|
||||
this.controller.open()
|
||||
|
||||
// padLoginUsingPost({
|
||||
// username: this.account,
|
||||
// password: this.password,
|
||||
// imei: deviceId
|
||||
// }).then(() => {
|
||||
padLoginUsingPost({
|
||||
username: this.account,
|
||||
password: this.password,
|
||||
imei: deviceId
|
||||
}).then((res) => {
|
||||
AppStorage.setOrCreate("padId", res.data?.padId!)
|
||||
router.pushUrl({
|
||||
url: "pages/home/Index"
|
||||
})
|
||||
// }).finally(() => {
|
||||
// this.controller.close()
|
||||
// })
|
||||
}).finally(() => {
|
||||
this.controller.close()
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
|
||||
@ -6,6 +6,7 @@ import { CusButton } from '../components/button/Index'
|
||||
import { Dropdown } from '../components/dropdown/Index'
|
||||
import { DateRangePicker } from '../components/date/Index'
|
||||
import { CusInput } from '../components/input/Index'
|
||||
import { getInspectAlarmUsingPost } from '../../api/padController'
|
||||
|
||||
interface Test {
|
||||
date: string
|
||||
@ -90,6 +91,9 @@ struct Alarm {
|
||||
}
|
||||
|
||||
getData() {
|
||||
getInspectAlarmUsingPost({
|
||||
|
||||
})
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.data = new Array(this.pageSize).fill({
|
||||
|
||||
@ -15,9 +15,9 @@ struct Home {
|
||||
@State warn: number[] = [1, 2, 3, 4]
|
||||
@State select: number = 0
|
||||
@State ring: RingOptions[] = [
|
||||
{ color: 0xffcc31, count: 10 },
|
||||
{ color: 0x33ff29, count: 20 },
|
||||
{ color: 0xff3a48, count: 30 },
|
||||
{ color: 0xffcc31, count: 20 },
|
||||
{ color: 0x33ff29, count: 60 },
|
||||
{ color: 0xff3a48, count: 10 },
|
||||
]
|
||||
@State ring2: RingOptions[] = [
|
||||
{ color: 0x034B61, count: 10, animate: false },
|
||||
@ -49,21 +49,6 @@ struct Home {
|
||||
return true
|
||||
}
|
||||
|
||||
toDetail(index: number) {
|
||||
const url: string[] = [
|
||||
"pages/filing/Index",
|
||||
"pages/monitor/Index",
|
||||
"pages/alarm/Index",
|
||||
"pages/result/Index",
|
||||
"pages/control/Index",
|
||||
"pages/vehicle/Index",
|
||||
"pages/reboot/Index",
|
||||
]
|
||||
router.pushUrl({
|
||||
url: url[index]
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Row() {
|
||||
@ -133,7 +118,7 @@ struct Home {
|
||||
Row() {
|
||||
Column() {
|
||||
Text("正在查验数量").fontSize(24).fontColor(0xffffff).fontWeight(700).margin({ bottom: 6 })
|
||||
Text("40").fontSize(32).fontColor(0xFFCC31).fontWeight(700)
|
||||
Text(this.ring[0].count.toString()).fontSize(32).fontColor(0xFFCC31).fontWeight(700)
|
||||
}
|
||||
.layoutWeight(1.8)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
@ -145,7 +130,7 @@ struct Home {
|
||||
|
||||
Column() {
|
||||
Text("完成数量").fontSize(24).fontColor(0xffffff).fontWeight(700).margin({ bottom: 6 })
|
||||
Text("34").fontSize(32).fontColor(0x33FF29).fontWeight(700)
|
||||
Text(this.ring[1].count.toString()).fontSize(32).fontColor(0x33FF29).fontWeight(700)
|
||||
}
|
||||
.layoutWeight(1.4)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
@ -157,7 +142,7 @@ struct Home {
|
||||
|
||||
Column() {
|
||||
Text("失败").fontSize(24).fontColor(0xffffff).fontWeight(700).margin({ bottom: 6 })
|
||||
Text("12").fontSize(32).fontColor(0xFF3A48).fontWeight(700)
|
||||
Text(this.ring[2].count.toString()).fontSize(32).fontColor(0xFF3A48).fontWeight(700)
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user