|
@@ -0,0 +1,704 @@
|
|
|
+import { header } from '../view/header'
|
|
|
+import router from '@ohos.router';
|
|
|
+import http from '@ohos.net.http';
|
|
|
+
|
|
|
+class incubator {
|
|
|
+ //序号
|
|
|
+ ID: number
|
|
|
+ //实验状态
|
|
|
+ state: number
|
|
|
+ //责任人
|
|
|
+ personResponsible: string
|
|
|
+ //温箱编号
|
|
|
+ RID: string
|
|
|
+ //试验名
|
|
|
+ experimentalName: string
|
|
|
+ //品名
|
|
|
+ productName: string
|
|
|
+ //SN号
|
|
|
+ SN: string
|
|
|
+ //工装编号
|
|
|
+ toolNumber: string
|
|
|
+ //交付日期,交期
|
|
|
+ deliveryTime: string
|
|
|
+ //试验时长,时长
|
|
|
+ duration: string
|
|
|
+ //开始时间
|
|
|
+ timeOn?: string
|
|
|
+ //结束时间
|
|
|
+ timeOut?: string
|
|
|
+ //入箱视频
|
|
|
+ video?: string
|
|
|
+
|
|
|
+ constructor(
|
|
|
+ //序号
|
|
|
+ ID: number,
|
|
|
+ //实验状态
|
|
|
+ state: number
|
|
|
+ //责任人
|
|
|
+ , personResponsible: string
|
|
|
+ //温箱编号
|
|
|
+ , RID: string
|
|
|
+ //试验名
|
|
|
+ , experimentalName: string
|
|
|
+ //品名
|
|
|
+ , productName: string
|
|
|
+ //SN号
|
|
|
+ , SN: string
|
|
|
+ //工装编号
|
|
|
+ , toolNumber: string
|
|
|
+ //交付日期,交期
|
|
|
+ , deliveryTime: string
|
|
|
+ //试验时长,时长
|
|
|
+ , duration: string
|
|
|
+ //开始时间
|
|
|
+ , timeOn?: string
|
|
|
+ //结束时间
|
|
|
+ , timeOut?: string
|
|
|
+ , video?: string
|
|
|
+ ) {
|
|
|
+ //序号
|
|
|
+ this.ID = ID
|
|
|
+ //实验状态
|
|
|
+ this.state = state
|
|
|
+ //责任人
|
|
|
+ this.personResponsible = personResponsible
|
|
|
+ //温箱编号
|
|
|
+ this.RID = RID
|
|
|
+ //试验名
|
|
|
+ this.experimentalName = experimentalName
|
|
|
+ //品名
|
|
|
+ this.productName = productName
|
|
|
+ //SN号
|
|
|
+ this.SN = SN
|
|
|
+ //工装编号
|
|
|
+ this.toolNumber = toolNumber
|
|
|
+ //交付日期,交期
|
|
|
+ this.deliveryTime = deliveryTime
|
|
|
+ //试验时长,时长
|
|
|
+ this.duration = duration
|
|
|
+ //开始时间
|
|
|
+ this.timeOn = timeOn
|
|
|
+ //结束时间
|
|
|
+ this.timeOut = timeOut
|
|
|
+ //视频
|
|
|
+ this.video = video
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@Entry
|
|
|
+@Component
|
|
|
+export default struct ListView {
|
|
|
+ chinese:string='张三'
|
|
|
+ @State dataList: incubator[] = []
|
|
|
+ @State brr: number[] = []
|
|
|
+ params: any = router.getParams()
|
|
|
+ @State restateName: string = ''
|
|
|
+ @State reRIDName: string = this.params['RID']
|
|
|
+ @State reDurationName: string = ''
|
|
|
+ @State reSNName: string = ''
|
|
|
+ @State rePersonResponsibleName: string =''
|
|
|
+ @State @Watch('getHttpData') reDate: string = ''
|
|
|
+ @State @Watch('getHttpData') restate: number = 0 //试验状态
|
|
|
+ @State @Watch('getHttpData') reRID: string = this.params['RID'] //温箱编号
|
|
|
+ @State @Watch('getHttpData') reDuration: string = '' //试验时长
|
|
|
+ @State @Watch('getHttpData') reSN: string = '' //SN号
|
|
|
+ @State @Watch('getHttpData') rePersonResponsible: string = '' //责任人
|
|
|
+ ID: number = 1
|
|
|
+ @State @Watch('getHttpData') currentPage: number = 1
|
|
|
+ totalPage: number = 0
|
|
|
+ scroller: Scroller = new Scroller()
|
|
|
+
|
|
|
+ async getHttpData() {
|
|
|
+ let httpRequest = http.createHttp();
|
|
|
+ var tempArr: incubator[] = []
|
|
|
+ var url = `http://192.168.101.4:8048/task/page?page=${this.currentPage}&pageSize=10`
|
|
|
+ if (this.reRID != '') url = url + `&boxNumber=%23${this.reRID.slice(1, this.reRID.length)}`
|
|
|
+ if (this.reSN != '') url = url + `&sn=${this.reSN}`
|
|
|
+ if(this.reDate!='')url=url+`&deliverTime=${this.reDate}`
|
|
|
+ if(this.reDuration!='')url=url+`&testTime=${this.reDuration}`
|
|
|
+ if(this.rePersonResponsible!='')url=url+`&person=${this.rePersonResponsible}`
|
|
|
+ if(this.restate!=0)url=url+`&status=${this.restate}`
|
|
|
+ var promise = httpRequest.request(// 请求url地址
|
|
|
+ url,
|
|
|
+ {
|
|
|
+ // 请求方式
|
|
|
+ method: http.RequestMethod.GET,
|
|
|
+ // 可选,默认为60s
|
|
|
+ connectTimeout: 60000,
|
|
|
+ // 可选,默认为60s
|
|
|
+ readTimeout: 60000,
|
|
|
+ // 开发者根据自身业务需要添加header字段
|
|
|
+ header: {
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ await promise.then((data) => {
|
|
|
+ if (data.responseCode === http.ResponseCode.OK) {
|
|
|
+ this.totalPage = Math.ceil(JSON.parse(data.result + '').data.total / 10)
|
|
|
+ var res = JSON.parse(data.result + '').data.records
|
|
|
+ this.initBrr()
|
|
|
+ for (let i = 0; i < res.length; i++) {
|
|
|
+ tempArr.push(new incubator(
|
|
|
+ res[i].id,
|
|
|
+ res[i].status,
|
|
|
+ res[i].person,
|
|
|
+ res[i].boxNumber,
|
|
|
+ res[i].testName,
|
|
|
+ res[i].productName,
|
|
|
+ res[i].sn,
|
|
|
+ res[i].no,
|
|
|
+ res[i].deliverTime,
|
|
|
+ res[i].testTime,
|
|
|
+ res[i].startTime,
|
|
|
+ res[i].finishTime,
|
|
|
+ res[i].video))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log('error:' + JSON.stringify(err))
|
|
|
+ })
|
|
|
+ this.dataList = tempArr
|
|
|
+ }
|
|
|
+
|
|
|
+ initBrr() {
|
|
|
+ this.brr = []
|
|
|
+ for (let index = 1; index <= this.totalPage; index++) {
|
|
|
+ this.brr.push(index)
|
|
|
+ //console.log(`${this.totalPage}`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ onPageShow() {
|
|
|
+ this.getHttpData()
|
|
|
+ }
|
|
|
+
|
|
|
+ onChange() {
|
|
|
+ this.currentPage = 1
|
|
|
+ this.scroller.scrollEdge(Edge.Start)
|
|
|
+ }
|
|
|
+
|
|
|
+ build() {
|
|
|
+ Column() {
|
|
|
+ header({})
|
|
|
+ Row() {
|
|
|
+ Text("试验任务记录")
|
|
|
+ .height('100%')
|
|
|
+ .fontSize(8)
|
|
|
+ .margin(60)
|
|
|
+ .fontColor('#696969')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .height('3%')
|
|
|
+
|
|
|
+ Divider()
|
|
|
+ Row() {
|
|
|
+ RelativeContainer() {
|
|
|
+ Row() {
|
|
|
+ Select([{ value: '未开始' }, { value: '进行中' }, { value: '已完成' }])
|
|
|
+ .value(this.restateName != '' ? this.restateName : '试验状态')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .font({ size: px2fp(20) })
|
|
|
+ .height(12)
|
|
|
+ .width(70)
|
|
|
+ .opacity(0.6)
|
|
|
+ .onSelect((index: number, value: string) => {
|
|
|
+ this.restate = index === 0?-1:index
|
|
|
+ this.restateName = value
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ Select([{ value: '#1' }, { value: '#2' }, { value: '#3' }, { value: '#4' }])
|
|
|
+ .value(this.reRIDName != '' ? this.reRIDName : '温箱编号')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .font({ size: px2fp(20) })
|
|
|
+ .height(12)
|
|
|
+ .width(70)
|
|
|
+ .opacity(0.6)
|
|
|
+ .onSelect((index: number, value: string) => {
|
|
|
+ this.reRID = value
|
|
|
+ this.reRIDName = value
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ Row() {
|
|
|
+ Text(this.reDate === '' ? '日期' : this.reDate)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .opacity(1)
|
|
|
+ Image($r('app.media.blacktriangles'))
|
|
|
+ .height(7)
|
|
|
+ .opacity(0.9)
|
|
|
+ .padding({ top: 0.7 })
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.SpaceEvenly)
|
|
|
+ .width(60)
|
|
|
+ .height(12)
|
|
|
+ .opacity(0.6)
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .onClick(() => {
|
|
|
+ DatePickerDialog.show({
|
|
|
+ start: new Date("2002-1-1"),
|
|
|
+ end: new Date("2100-12-31"),
|
|
|
+ onAccept: (value: DatePickerResult) => {
|
|
|
+ this.reDate = (value.year + '-' + (value.month < 10 ? '0' + (value.month + 1) : value.month + 1) + '-' + (value.day < 10 ? '0' + value.day : value.day))
|
|
|
+ this.onChange()
|
|
|
+ },
|
|
|
+ onCancel: () => {
|
|
|
+ },
|
|
|
+
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ Select([{ value: '24h' }, { value: '28h' }, { value: '48h' }, { value: '72h' }])
|
|
|
+ .value(this.reDurationName != '' ? this.reDurationName : '试验时长')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .font({ size: px2fp(20) })
|
|
|
+ .height(12)
|
|
|
+ .width(70)
|
|
|
+ .opacity(0.6)
|
|
|
+ .onSelect((index: number, value: string) => {
|
|
|
+ this.reDuration = value
|
|
|
+ this.reDurationName = value
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ Row() {
|
|
|
+ Text('责任人')
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .fontColor('#000000')
|
|
|
+ .opacity(0.6)
|
|
|
+ TextInput({ placeholder: '请输入', text: this.rePersonResponsibleName })
|
|
|
+ .height(12)
|
|
|
+ .width(70)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .opacity(0.6)
|
|
|
+ .borderRadius(px2vp(0))
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .placeholderFont({ size: px2fp(20) })
|
|
|
+ .padding({ top: 1, bottom: 1, left: 1 })
|
|
|
+ .onChange((value: string) => {
|
|
|
+ this.rePersonResponsible = value
|
|
|
+ this.rePersonResponsibleName = value
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text('SN号')
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .fontColor('#000000')
|
|
|
+ .opacity(0.6)
|
|
|
+ TextInput({ placeholder: '请输入', text: this.reSNName })
|
|
|
+ .height(12)
|
|
|
+ .width(70)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .opacity(0.6)
|
|
|
+ .borderRadius(px2vp(0))
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(1)
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .placeholderFont({ size: px2fp(20) })
|
|
|
+ .padding({ top: 1, bottom: 1, left: 1 })
|
|
|
+ .onChange((value: string) => {
|
|
|
+ this.reSN = value
|
|
|
+ this.reSNName = value
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ Button({ type: ButtonType.Normal }) {
|
|
|
+ Text('刷新')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ }
|
|
|
+ .onClick(() => {
|
|
|
+ this.restate = 0
|
|
|
+ this.reRID = ''
|
|
|
+ this.reDuration = ''
|
|
|
+ this.reSN = ''
|
|
|
+ this.rePersonResponsible = ''
|
|
|
+ this.restateName = ''
|
|
|
+ this.reRIDName = ''
|
|
|
+ this.reDurationName = ''
|
|
|
+ this.reSNName = ''
|
|
|
+ this.rePersonResponsibleName = ''
|
|
|
+ this.reDate = ''
|
|
|
+ this.onChange()
|
|
|
+ })
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .width(30)
|
|
|
+ .height(15)
|
|
|
+ .backgroundColor(Color.Blue)
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ .id('1')
|
|
|
+ .height('10%')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .alignRules({
|
|
|
+ top: { anchor: "__container__", align: VerticalAlign.Top },
|
|
|
+ middle: { anchor: "__container__", align: HorizontalAlign.Center }
|
|
|
+ })
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Button({ type: ButtonType.Normal }) {
|
|
|
+ Text('返回')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ }
|
|
|
+ .onClick(() => router.pushUrl({ url: 'pages/ManagePage',
|
|
|
+ }))
|
|
|
+ .borderRadius(px2vp(10))
|
|
|
+ .width(30)
|
|
|
+ .height(15)
|
|
|
+ .backgroundColor(Color.Blue)
|
|
|
+
|
|
|
+ Button({ type: ButtonType.Normal }) {
|
|
|
+ Text('导出')
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ }
|
|
|
+ .borderRadius(px2vp(10)).width(30).height(15).backgroundColor(Color.Blue)
|
|
|
+ }.id('2')
|
|
|
+ .justifyContent(FlexAlign.SpaceBetween)
|
|
|
+ .width('100%')
|
|
|
+ .alignRules({
|
|
|
+ top: { anchor: "1", align: VerticalAlign.Bottom },
|
|
|
+ middle: { anchor: "__container__", align: HorizontalAlign.Center }
|
|
|
+ })
|
|
|
+
|
|
|
+ List() {
|
|
|
+ ListItem() {
|
|
|
+ Row() {
|
|
|
+ Text('序号')
|
|
|
+ .width('4%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('试验状态')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('责任人')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('温箱编号')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('试验名')
|
|
|
+ .width('9%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('品名')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('SN号')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('工装编号')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('交付日期')
|
|
|
+ .width('8%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('试验时长')
|
|
|
+ .width('6%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('开始时间')
|
|
|
+ .width('14%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('结束时间')
|
|
|
+ .width('14%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ Text('入箱视频')
|
|
|
+ .width('9%')
|
|
|
+ .height('6%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(22))
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .backgroundColor('#F2F2F2')
|
|
|
+ }
|
|
|
+ .width('100%')
|
|
|
+ }
|
|
|
+
|
|
|
+ ForEach(this.dataList, (item,index)=> {
|
|
|
+ ListItem() {
|
|
|
+ Row() {
|
|
|
+ Text(`${item.ID}`)
|
|
|
+ .width('4%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(`${item.state}`)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.personResponsible)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.RID)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.experimentalName)
|
|
|
+ .width('9%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.productName)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.SN)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.toolNumber)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.deliveryTime)
|
|
|
+ .width('8%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.duration)
|
|
|
+ .width('6%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.timeOn)
|
|
|
+ .width('14%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.timeOut)
|
|
|
+ .width('14%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ Text(item.video)
|
|
|
+ .width('9%')
|
|
|
+ .height('7%')
|
|
|
+ .borderColor('#808080')
|
|
|
+ .borderWidth(0.7)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .backgroundColor((index+1+this.currentPage * 10 - 10) % 2 === 0 ? '#F2F2F2' : Color.White)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.id('3')
|
|
|
+ .alignRules({
|
|
|
+ top: { anchor: "2", align: VerticalAlign.Bottom },
|
|
|
+ middle: { anchor: "__container__", align: HorizontalAlign.Center }
|
|
|
+ })
|
|
|
+ .padding({ top: px2vp(10) })
|
|
|
+
|
|
|
+ Row({ space: 6 }) {
|
|
|
+ Row() {
|
|
|
+ Button('<', { type: ButtonType.Normal })
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius(px2vp(7))
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderColor('#808080')
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .opacity(0.6)
|
|
|
+ .fontSize(px2fp(30))
|
|
|
+ .padding({ top: 1, bottom: 1, left: 1 })
|
|
|
+ .width(15)
|
|
|
+ .height(20)
|
|
|
+ .onClick(() => {
|
|
|
+ this.scroller.scrollBy(-20.5, 0)
|
|
|
+ this.currentPage === 1 ? this.currentPage = this.currentPage : this.currentPage--
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ List({ space: 6, scroller: this.scroller }) {
|
|
|
+ ForEach(this.brr, (item) => {
|
|
|
+ ListItem() {
|
|
|
+ Button(`${item}`, { type: ButtonType.Normal })
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius(px2vp(7))
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderColor(this.currentPage === item ? Color.Blue : '#808080')
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .opacity(0.6)
|
|
|
+ .fontSize(px2fp(20))
|
|
|
+ .padding({ top: 1, bottom: 1, left: 1 })
|
|
|
+ .width(15)
|
|
|
+ .height(20)
|
|
|
+ .onClick(() => {
|
|
|
+ this.currentPage = item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .listDirection(Axis.Horizontal).margin({ top: 8.3 })
|
|
|
+ }
|
|
|
+ .constraintSize({ maxWidth: 100 })
|
|
|
+ .clip(true)
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Button('>', { type: ButtonType.Normal })
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius(px2vp(7))
|
|
|
+ .borderWidth(1)
|
|
|
+ .borderColor('#808080')
|
|
|
+ .fontColor(Color.Black)
|
|
|
+ .opacity(0.6)
|
|
|
+ .fontSize(px2fp(30))
|
|
|
+ .padding({ top: 1, bottom: 1, left: 1 })
|
|
|
+ .width(15)
|
|
|
+ .height(20)
|
|
|
+ .onClick(() => {
|
|
|
+ this.scroller.scrollBy(20.5, 0)
|
|
|
+ this.currentPage === this.totalPage ? this.currentPage = this.currentPage : this.currentPage++
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ .id('4')
|
|
|
+ .margin({ top: px2vp(760), left: px2vp(1800) })
|
|
|
+ .height('10%')
|
|
|
+ .alignRules({
|
|
|
+ bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
|
|
|
+ right: { anchor: "__container__", align: HorizontalAlign.End }
|
|
|
+ })
|
|
|
+ .width(150)
|
|
|
+ .justifyContent(FlexAlign.End)
|
|
|
+ .clip(true)
|
|
|
+ }
|
|
|
+ .width('90%')
|
|
|
+ .height('85%')
|
|
|
+
|
|
|
+ //.justifyContent(FlexAlign.Center)
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
+ .alignItems(VerticalAlign.Top)
|
|
|
+ .width('100%')
|
|
|
+ .height('100%')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|