接口对接
This commit is contained in:
		
							parent
							
								
									75775836cd
								
							
						
					
					
						commit
						d2cf99d6c9
					
				
							
								
								
									
										894
									
								
								entry/src/main/ets/api/typings.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										894
									
								
								entry/src/main/ets/api/typings.d.ts
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -55,6 +55,15 @@ struct Detail { | ||||
|   @State isFullScreen: boolean = false | ||||
|   @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() { | ||||
| 
 | ||||
|   } | ||||
|  | ||||
| @ -8,20 +8,12 @@ import { DateRangePicker } from '../components/date/Index' | ||||
| import { CusInput } from '../components/input/Index' | ||||
| import { getInspectAlarmUsingPost } from '../../api/padController' | ||||
| 
 | ||||
| interface Test { | ||||
|   date: string | ||||
|   type: string | ||||
|   content: string | ||||
|   state: string | ||||
|   step: string | ||||
|   status: string | ||||
| } | ||||
| 
 | ||||
| @Component | ||||
| @Entry | ||||
| struct Alarm { | ||||
|   @State columns: Array<Column> = [] | ||||
|   @State data: Array<Test> = [] | ||||
|   @State data: Array<API.InspectAlarmItemVo> = [] | ||||
|   @State total: number = 500 | ||||
|   @State loading: boolean = false | ||||
|   @State date: string[] = [] | ||||
| @ -35,7 +27,7 @@ struct Alarm { | ||||
|   private pageSizes: number[] = [10, 20, 30, 50] | ||||
| 
 | ||||
|   @Builder | ||||
|   buildOperate(_row: Test) { | ||||
|   buildOperate(_row: API.InspectAlarmItemVo) { | ||||
|     Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => { | ||||
|       router.pushUrl({ | ||||
|         url: "pages/alarm/Detail" | ||||
| @ -44,9 +36,9 @@ struct Alarm { | ||||
|   } | ||||
| 
 | ||||
|   @Builder | ||||
|   buildStatus(row: Test) { | ||||
|   buildStatus(row: API.InspectAlarmItemVo) { | ||||
|     Row() { | ||||
|       if (row.status === "1") { | ||||
|       if (row.alarmStatus === "1") { | ||||
|         Image($rawfile("images/alarm/success.png")).width(18).height(18).margin({ right: 12 }) | ||||
|         Text("已处理").fontSize(16).fontColor(0x2EB023) | ||||
|       } else { | ||||
| @ -64,16 +56,16 @@ struct Alarm { | ||||
|         width: "60", | ||||
|         type: "index" | ||||
|       }, | ||||
|       { title: "预警日期", prop: "date", width: 1, }, | ||||
|       { title: "预警类型", prop: "type", width: 1, }, | ||||
|       { title: "预警内容", prop: "content", width: 2, }, | ||||
|       { title: "阶段", prop: "state", width: 1.5, }, | ||||
|       { title: "步骤", prop: "step", width: 1, }, | ||||
|       { title: "预警日期", prop: "createTime", width: 1, }, | ||||
|       { title: "预警类型", prop: "alarmCode", width: 1, }, | ||||
|       { title: "预警内容", prop: "alarmInfo", width: 2, }, | ||||
|       { title: "阶段", prop: "stageName", width: 1.5, }, | ||||
|       { title: "步骤", prop: "stepName", width: 1, }, | ||||
|       { | ||||
|         title: "状态", | ||||
|         prop: "status", | ||||
|         width: 1, | ||||
|         cell: (row: Test) => { | ||||
|         cell: (row: API.InspectAlarmItemVo) => { | ||||
|           this.buildStatus(row) | ||||
|         } | ||||
|       }, | ||||
| @ -81,7 +73,7 @@ struct Alarm { | ||||
|         title: "操作", | ||||
|         prop: "", | ||||
|         width: 1, | ||||
|         cell: (row: Test) => { | ||||
|         cell: (row: API.InspectAlarmItemVo) => { | ||||
|           this.buildOperate(row) | ||||
|         } | ||||
|       }, | ||||
| @ -91,21 +83,20 @@ struct Alarm { | ||||
|   } | ||||
| 
 | ||||
|   getData() { | ||||
|     getInspectAlarmUsingPost({ | ||||
| 
 | ||||
|     }) | ||||
|     this.loading = true | ||||
|     setTimeout(() => { | ||||
|       this.data = new Array(this.pageSize).fill({ | ||||
|         date: "2025-09-13", | ||||
|         type: `PAD001-${Math.random().toFixed(3)}`, | ||||
|         content: "车辆长时间未驶入查验区域", | ||||
|         state: "等待车辆进入", | ||||
|         step: "步骤一", | ||||
|         status: "2" | ||||
|       }) | ||||
|     getInspectAlarmUsingPost({ | ||||
|       alarmStartTime: this.date[0], | ||||
|       alarmEndTime: this.date[1], | ||||
|       alarmStatus: this.status, | ||||
|       pageNum: this.currentPage, | ||||
|       pageSize: this.pageSize, | ||||
|       stageId: Number(this.state), | ||||
|       stepId: Number(this.step) | ||||
|     }).then(res => { | ||||
|       this.data = res.data?.page?.rows || [] | ||||
|     }).finally(() => { | ||||
|       this.loading = false | ||||
|     }, 1000) | ||||
|     }) | ||||
|   } | ||||
| 
 | ||||
|   reset() { | ||||
|  | ||||
| @ -167,7 +167,7 @@ struct Add { | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   async save() { | ||||
|   save() { | ||||
|     if (!this.picture1) { | ||||
|       promptAction.showToast({ | ||||
|         message: "请上传铭牌图片" | ||||
| @ -247,7 +247,7 @@ struct Add { | ||||
|       chargingPortPosition: this.quickElectric, | ||||
|       slowChargingPortPhotoUrl: this.picture4, | ||||
|       slowChargingPortPosition: this.slowElectric, | ||||
|       padId: 0, | ||||
|       padId: AppStorage.get<string>("padId"), | ||||
|     } | ||||
| 
 | ||||
|     saveVinPositionUsingPost(data).then(res => { | ||||
|  | ||||
| @ -5,22 +5,13 @@ import { Title } from '../components/title/Index' | ||||
| import { CusButton } from '../components/button/Index' | ||||
| import { DateRangePicker } from '../components/date/Index' | ||||
| import { CusInput } from '../components/input/Index' | ||||
| 
 | ||||
| interface Test { | ||||
|   date: string | ||||
|   type: string | ||||
|   content: string | ||||
|   state: string | ||||
|   step: string | ||||
|   status: string | ||||
| } | ||||
| 
 | ||||
| import { getInspectResultListUsingPost } from '../../api' | ||||
| 
 | ||||
| @Component | ||||
| @Entry | ||||
| struct Vehicle { | ||||
|   @State columns: Array<Column> = [] | ||||
|   @State data: Array<Test> = [] | ||||
|   @State data: Array<API.InspectRecordResultRsp> = [] | ||||
|   @State total: number = 500 | ||||
|   @State loading: boolean = false | ||||
|   @State date: string[] = [] | ||||
| @ -34,7 +25,7 @@ struct Vehicle { | ||||
|   private pageSizes: number[] = [10, 20, 30, 50] | ||||
| 
 | ||||
|   @Builder | ||||
|   buildOperate(_row: Test) { | ||||
|   buildOperate(_row: API.InspectRecordResultRsp) { | ||||
|     Image($rawfile("images/detail.png")).objectFit(ImageFit.Contain).width(80).height(30).onClick(() => { | ||||
|       router.pushUrl({ | ||||
|         url: "pages/vehicle/Add" | ||||
| @ -50,20 +41,20 @@ struct Vehicle { | ||||
|         width: "60", | ||||
|         type: "index" | ||||
|       }, | ||||
|       { title: "查验日期", prop: "date", width: 1, }, | ||||
|       { title: "流水号", prop: "type", width: 1, }, | ||||
|       { title: "业务类型", prop: "state", width: 1, }, | ||||
|       { title: "号牌种类", prop: "state", width: 1, }, | ||||
|       { title: "车辆品牌", prop: "step", width: 1, }, | ||||
|       { title: "型号", prop: "step", width: 1, }, | ||||
|       { title: "生产厂家", prop: "step", width: 1.5, }, | ||||
|       { title: "生产年月", prop: "step", width: 1, }, | ||||
|       { title: "车主姓名", prop: "step", width: 1, }, | ||||
|       { title: "查验日期", prop: "createTime", width: 1, }, | ||||
|       { title: "流水号", prop: "serialNumber", width: 1, }, | ||||
|       { title: "业务类型", prop: "businessType", width: 1, }, | ||||
|       { title: "号牌种类", prop: "vin", width: 1, }, | ||||
|       { title: "车辆品牌", prop: "brandName", width: 1, }, | ||||
|       { title: "型号", prop: "model", width: 1, }, | ||||
|       // { title: "生产厂家", prop: "factoryName", width: 1.5, }, | ||||
|       // { title: "生产年月", prop: "step", width: 1, }, | ||||
|       // { title: "车主姓名", prop: "step", width: 1, }, | ||||
|       { | ||||
|         title: "操作", | ||||
|         prop: "", | ||||
|         width: 1, | ||||
|         cell: (row: Test) => { | ||||
|         cell: (row: API.InspectRecordResultRsp) => { | ||||
|           this.buildOperate(row) | ||||
|         } | ||||
|       }, | ||||
| @ -74,17 +65,19 @@ struct Vehicle { | ||||
| 
 | ||||
|   getData() { | ||||
|     this.loading = true | ||||
|     setTimeout(() => { | ||||
|       this.data = new Array(this.pageSize).fill({ | ||||
|         date: "2025-09-13", | ||||
|         type: `PAD001-${Math.random().toFixed(3)}`, | ||||
|         content: "车辆长时间未驶入查验区域", | ||||
|         state: "等待车辆进入", | ||||
|         step: "步骤一", | ||||
|         status: "2" | ||||
|       }) | ||||
|     getInspectResultListUsingPost({ | ||||
|       inspectStartDate: this.date[0], | ||||
|       inspectEndDate: this.date[1], | ||||
|       pageNum: this.currentPage, | ||||
|       pageSize: this.pageSize, | ||||
|       unMatch: "1" | ||||
|     }).then(res => { | ||||
|       this.data = res.rows || [] | ||||
|       this.total = res.total || 0 | ||||
|     }).finally(() => { | ||||
|       this.loading = false | ||||
|     }, 1000) | ||||
| 
 | ||||
|     }) | ||||
|   } | ||||
| 
 | ||||
|   reset() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user