接口对接

This commit is contained in:
lixiao 2025-09-28 16:26:26 +08:00
parent 75775836cd
commit d2cf99d6c9
5 changed files with 510 additions and 517 deletions

File diff suppressed because it is too large Load Diff

View File

@ -55,6 +55,15 @@ struct Detail {
@State isFullScreen: boolean = false @State isFullScreen: boolean = false
@State url: string = "" @State url: string = ""
aboutToAppear(): void {
let data: API.InspectAlarmItemVo = router.getParams()
this.base[0].value = data.createTime || ""
this.base[1].value = data.alarmCode || ""
this.base[2].value = data.stageName || ""
this.base[3].value = data.stepName || ""
this.base[4].value = data.alarmInfo || ""
}
submit() { submit() {
} }
@ -114,10 +123,10 @@ struct Detail {
Column() { Column() {
Row() { Row() {
Stack({ alignContent: Alignment.TopStart }) { Stack({ alignContent: Alignment.TopStart }) {
Image($rawfile("images/vehicle/default.png")).width("100%").height("100%").objectFit(ImageFit.Contain) Image($rawfile("images/vehicle/default.png")).width("100%").height("100%").objectFit(ImageFit.Contain)
Text("现场图片").label() Text("现场图片").label()
}.margin({ right: 6 }).layoutWeight(1) }.margin({ right: 6 }).layoutWeight(1)
Stack({ alignContent: Alignment.TopStart }) { Stack({ alignContent: Alignment.TopStart }) {

View File

@ -8,20 +8,12 @@ import { DateRangePicker } from '../components/date/Index'
import { CusInput } from '../components/input/Index' import { CusInput } from '../components/input/Index'
import { getInspectAlarmUsingPost } from '../../api/padController' import { getInspectAlarmUsingPost } from '../../api/padController'
interface Test {
date: string
type: string
content: string
state: string
step: string
status: string
}
@Component @Component
@Entry @Entry
struct Alarm { struct Alarm {
@State columns: Array<Column> = [] @State columns: Array<Column> = []
@State data: Array<Test> = [] @State data: Array<API.InspectAlarmItemVo> = []
@State total: number = 500 @State total: number = 500
@State loading: boolean = false @State loading: boolean = false
@State date: string[] = [] @State date: string[] = []
@ -35,7 +27,7 @@ struct Alarm {
private pageSizes: number[] = [10, 20, 30, 50] private pageSizes: number[] = [10, 20, 30, 50]
@Builder @Builder
buildOperate(_row: Test) { buildOperate(_row: API.InspectAlarmItemVo) {
Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => { Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => {
router.pushUrl({ router.pushUrl({
url: "pages/alarm/Detail" url: "pages/alarm/Detail"
@ -44,9 +36,9 @@ struct Alarm {
} }
@Builder @Builder
buildStatus(row: Test) { buildStatus(row: API.InspectAlarmItemVo) {
Row() { Row() {
if (row.status === "1") { if (row.alarmStatus === "1") {
Image($rawfile("images/alarm/success.png")).width(18).height(18).margin({ right: 12 }) Image($rawfile("images/alarm/success.png")).width(18).height(18).margin({ right: 12 })
Text("已处理").fontSize(16).fontColor(0x2EB023) Text("已处理").fontSize(16).fontColor(0x2EB023)
} else { } else {
@ -64,16 +56,16 @@ struct Alarm {
width: "60", width: "60",
type: "index" type: "index"
}, },
{ title: "预警日期", prop: "date", width: 1, }, { title: "预警日期", prop: "createTime", width: 1, },
{ title: "预警类型", prop: "type", width: 1, }, { title: "预警类型", prop: "alarmCode", width: 1, },
{ title: "预警内容", prop: "content", width: 2, }, { title: "预警内容", prop: "alarmInfo", width: 2, },
{ title: "阶段", prop: "state", width: 1.5, }, { title: "阶段", prop: "stageName", width: 1.5, },
{ title: "步骤", prop: "step", width: 1, }, { title: "步骤", prop: "stepName", width: 1, },
{ {
title: "状态", title: "状态",
prop: "status", prop: "status",
width: 1, width: 1,
cell: (row: Test) => { cell: (row: API.InspectAlarmItemVo) => {
this.buildStatus(row) this.buildStatus(row)
} }
}, },
@ -81,7 +73,7 @@ struct Alarm {
title: "操作", title: "操作",
prop: "", prop: "",
width: 1, width: 1,
cell: (row: Test) => { cell: (row: API.InspectAlarmItemVo) => {
this.buildOperate(row) this.buildOperate(row)
} }
}, },
@ -91,21 +83,20 @@ struct Alarm {
} }
getData() { getData() {
getInspectAlarmUsingPost({
})
this.loading = true this.loading = true
setTimeout(() => { getInspectAlarmUsingPost({
this.data = new Array(this.pageSize).fill({ alarmStartTime: this.date[0],
date: "2025-09-13", alarmEndTime: this.date[1],
type: `PAD001-${Math.random().toFixed(3)}`, alarmStatus: this.status,
content: "车辆长时间未驶入查验区域", pageNum: this.currentPage,
state: "等待车辆进入", pageSize: this.pageSize,
step: "步骤一", stageId: Number(this.state),
status: "2" stepId: Number(this.step)
}) }).then(res => {
this.data = res.data?.page?.rows || []
}).finally(() => {
this.loading = false this.loading = false
}, 1000) })
} }
reset() { reset() {

View File

@ -167,7 +167,7 @@ struct Add {
} }
} }
async save() { save() {
if (!this.picture1) { if (!this.picture1) {
promptAction.showToast({ promptAction.showToast({
message: "请上传铭牌图片" message: "请上传铭牌图片"
@ -247,7 +247,7 @@ struct Add {
chargingPortPosition: this.quickElectric, chargingPortPosition: this.quickElectric,
slowChargingPortPhotoUrl: this.picture4, slowChargingPortPhotoUrl: this.picture4,
slowChargingPortPosition: this.slowElectric, slowChargingPortPosition: this.slowElectric,
padId: 0, padId: AppStorage.get<string>("padId"),
} }
saveVinPositionUsingPost(data).then(res => { saveVinPositionUsingPost(data).then(res => {

View File

@ -5,22 +5,13 @@ import { Title } from '../components/title/Index'
import { CusButton } from '../components/button/Index' import { CusButton } from '../components/button/Index'
import { DateRangePicker } from '../components/date/Index' import { DateRangePicker } from '../components/date/Index'
import { CusInput } from '../components/input/Index' import { CusInput } from '../components/input/Index'
import { getInspectResultListUsingPost } from '../../api'
interface Test {
date: string
type: string
content: string
state: string
step: string
status: string
}
@Component @Component
@Entry @Entry
struct Vehicle { struct Vehicle {
@State columns: Array<Column> = [] @State columns: Array<Column> = []
@State data: Array<Test> = [] @State data: Array<API.InspectRecordResultRsp> = []
@State total: number = 500 @State total: number = 500
@State loading: boolean = false @State loading: boolean = false
@State date: string[] = [] @State date: string[] = []
@ -34,7 +25,7 @@ struct Vehicle {
private pageSizes: number[] = [10, 20, 30, 50] private pageSizes: number[] = [10, 20, 30, 50]
@Builder @Builder
buildOperate(_row: Test) { buildOperate(_row: API.InspectRecordResultRsp) {
Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => { Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => {
router.pushUrl({ router.pushUrl({
url: "pages/vehicle/Add" url: "pages/vehicle/Add"
@ -50,20 +41,20 @@ struct Vehicle {
width: "60", width: "60",
type: "index" type: "index"
}, },
{ title: "查验日期", prop: "date", width: 1, }, { title: "查验日期", prop: "createTime", width: 1, },
{ title: "流水号", prop: "type", width: 1, }, { title: "流水号", prop: "serialNumber", width: 1, },
{ title: "业务类型", prop: "state", width: 1, }, { title: "业务类型", prop: "businessType", width: 1, },
{ title: "号牌种类", prop: "state", width: 1, }, { title: "号牌种类", prop: "vin", width: 1, },
{ title: "车辆品牌", prop: "step", width: 1, }, { title: "车辆品牌", prop: "brandName", width: 1, },
{ title: "型号", prop: "step", width: 1, }, { title: "型号", prop: "model", width: 1, },
{ title: "生产厂家", prop: "step", width: 1.5, }, // { title: "生产厂家", prop: "factoryName", width: 1.5, },
{ title: "生产年月", prop: "step", width: 1, }, // { title: "生产年月", prop: "step", width: 1, },
{ title: "车主姓名", prop: "step", width: 1, }, // { title: "车主姓名", prop: "step", width: 1, },
{ {
title: "操作", title: "操作",
prop: "", prop: "",
width: 1, width: 1,
cell: (row: Test) => { cell: (row: API.InspectRecordResultRsp) => {
this.buildOperate(row) this.buildOperate(row)
} }
}, },
@ -74,17 +65,19 @@ struct Vehicle {
getData() { getData() {
this.loading = true this.loading = true
setTimeout(() => { getInspectResultListUsingPost({
this.data = new Array(this.pageSize).fill({ inspectStartDate: this.date[0],
date: "2025-09-13", inspectEndDate: this.date[1],
type: `PAD001-${Math.random().toFixed(3)}`, pageNum: this.currentPage,
content: "车辆长时间未驶入查验区域", pageSize: this.pageSize,
state: "等待车辆进入", unMatch: "1"
step: "步骤一", }).then(res => {
status: "2" this.data = res.rows || []
}) this.total = res.total || 0
}).finally(() => {
this.loading = false this.loading = false
}, 1000)
})
} }
reset() { reset() {