import router from '@ohos.router'
//射频类测试表
export class  configurationTable{
  //测试项
  testingItem?:number
  //产品名称
  productName?:string
  //测试项名字
  name?:string
  //测试步进
  testStep?:number
  //输入功率
  inputPower?:number
  //输入开关通道
  inputSwitch?:number
  //输出开关通道
  OUTPUT?:number
  //射频范围
  RFRangeMin?:number
  RFRangeMax?:number
  //输出增益
  outputGain?:number
  //输出增益开关
  outputGainSw?:number
  //输入P-1tb
  inputPdb?:number
  //输入P-1tb开关
  inputPdbSw?:number
  //动态范围
  dynamicRange?:number
  //动态范围开关
  dynamicRangeSw?:number
  //增益平坦度
  gainFlatness?:number
  //增益平坦度开关
  gainFlatnessSw?:number

}
export class productName{
  //产品名字
  Name?:string
  //测试表
  configuration?:configurationTable[]
  //飞机编码
  aircraftNumber?:string
  //测试人员
  testingPersonnel?:string
  //测试时间
  testTime?:string

}

@Entry
@Component
struct RFtesting {
  @State private configuration:Array<configurationTable>=[
    {productName:'射频1号',testingItem:1,name:'旋转开挂-0档',testStep:10,inputPower:-20,inputSwitch:2, OUTPUT:1,RFRangeMin:2,RFRangeMax:6, outputGain:20,inputPdb:1,dynamicRange:20,gainFlatness:2,outputGainSw:0,inputPdbSw:1,dynamicRangeSw:0,gainFlatnessSw:1}as configurationTable,
  {productName:'射频2号',testingItem:2,name:'旋转开挂-2档',testStep:10,inputPower:-20,inputSwitch:2, OUTPUT:1,RFRangeMin:2,RFRangeMax:6, outputGain:20,inputPdb:1,dynamicRange:20,gainFlatness:2,outputGainSw:1,inputPdbSw:0,dynamicRangeSw:1,gainFlatnessSw:0}as configurationTable
  ]
  @State private newConfiguration:Array<configurationTable>=[
    { productName:'射频1号',testingItem:this.configuration.length+1,name:'旋转开挂-0档',testStep:0,inputPower:0,inputSwitch:0, OUTPUT:0,RFRangeMin:0,RFRangeMax:0, outputGain:0,inputPdb:0,dynamicRange:0,gainFlatness:0,outputGainSw:0,inputPdbSw:0,dynamicRangeSw:0,gainFlatnessSw:0}as configurationTable ]
  @State index:number=0
  //打开产品名称弹窗，0打开选择产品，1打开选择删除
  @State select:number=0
  @State text: string = '0.01'
  @State text1: string = '0.05'
  controller: TextInputController = new TextInputController()
  @State number1: string  ='1'
  @State index1: number = 2
  @State space: number = 8
  @State arrowPosition1: ArrowPosition = ArrowPosition.END
  //执行
  @State execute:number=0
  //频率步进
  @State testStep:number=0
  @State click:number=0
  //时间
  @State coding:string=''
  //日期
  @State Date:string=''
  //产品名称
  @State productName:string=''
  //产品名称列表
  @State private product:Array<productName>=[
    { Name:"射频1号",configuration:[],aircraftNumber:'鲲鹏轰炸机-FG-J35',testingPersonnel:'国家统一',testTime:''} as productName,
    { Name:"射频2号",configuration:[],aircraftNumber:'',testingPersonnel:'',testTime:'' } as productName,
    { Name:"射频3号",configuration:[],aircraftNumber:'',testingPersonnel:'',testTime:'' } as productName,
    { Name:"射频4号",configuration:[],aircraftNumber:'',testingPersonnel:'',testTime:'' } as productName,
    { Name:"射频5号",configuration:[],aircraftNumber:'',testingPersonnel:'',testTime:''} as productName,
    { Name:"射频6号",configuration:[],aircraftNumber:'',testingPersonnel:'',testTime:'' } as productName,]
  //产品名称弹窗
  productController: CustomDialogController = new CustomDialogController({
    builder:namePopUp({
      index:this.index,
      select:this.select,
      product:this.product,
      productName:this.productName
    }),
    alignment: DialogAlignment.Center,
        customStyle:true,
        autoCancel:true,
  })
  //新建弹窗
  newBuiltController: CustomDialogController = new CustomDialogController({
    builder:newBuilt({
      product:this.product
    }),
    alignment: DialogAlignment.Center,
    customStyle:true,
    autoCancel:true,
  })
  //删除
  editController: CustomDialogController = new CustomDialogController({
    builder:edit({
      index:this.index,
      product:this.product
    }),
    alignment: DialogAlignment.Center,
    customStyle:true,
    autoCancel:true,
  })
  build() {
    Column() {
      Row() {
        Row() {
          Image($r('app.media.return'))
            .width(px2vp(48))
            .height(px2vp(48))
            .objectFit(ImageFit.Contain)
            .margin({ left: px2vp(40) })
        }.width(px2vp(500))
        .height(px2vp(80))
        .onClick(() => {
          router.back();
        })
        Blank()
        Column(){
          Row() {
            Text('配置')
              .fontSize($r('app.float.fontSize_24'))
              .fontWeight(FontWeight.Medium)
              .fontColor($r('app.color.black_100'))
              .textAlign(TextAlign.Center)
              .width(px2vp(292))
              .height(px2vp(80))
              .borderRadius($r('app.float.borderRadius_16'))
              .backgroundColor(this.click === 0 ? $r('app.color.white_100') : '')
              .onClick(() => {
                this.click = 0
              })
            Blank()
            Text('执行')
              .fontSize($r('app.float.fontSize_24'))
              .fontWeight(FontWeight.Medium)
              .fontColor($r('app.color.black_100'))
              .textAlign(TextAlign.Center)
              .width(px2vp(292))
              .height(px2vp(80))
              .borderRadius($r('app.float.borderRadius_16'))
              .backgroundColor(this.click === 1 ? $r('app.color.white_100') : '')
              .onClick(() => {
                this.click = 1
              })
          }
          .width(px2vp(608))
          .height(px2vp(80))
          .backgroundColor($r('app.color.black_10'))
          .borderRadius($r('app.float.borderRadius_16'))
        }
        .justifyContent(FlexAlign.Center)
        Blank()
        Row() {
          Blank()
          Image($r('app.media.homePage'))
            .margin({ right: px2vp(40) })
            .width(px2vp(48))
            .height(px2vp(48))
            .onClick(()=>{
              router.pushUrl({
                url:'pages/Index'
              })
            })
          Image($r('app.media.news'))
            .margin({ right: px2vp(40) })
            .width(px2vp(48))
            .height(px2vp(48))
          Image($r('app.media.personal'))
            .margin({ right: px2vp(40) })
            .width(px2vp(48))
            .height(px2vp(48))
        }.width(px2vp(500))

      }.width(px2vp(1920))
      .height(px2vp(140))
      .alignItems(VerticalAlign.Center)
      if (this.click===0){
        Row(){
            Column(){
              Text('射频类维修检测系统')
                .fontSize($r('app.float.fontSize_30'))
                .fontWeight(FontWeight.Medium)
                .width('100%')
                .height(px2vp(30))
                .textAlign(TextAlign.Start)
                .margin({bottom:px2vp(57)})
              Text('产品：')
                .fontSize($r('app.float.fontSize_20'))
                .fontWeight(FontWeight.Regular)
                .width(px2vp(292))
                .height(px2vp(26))
                .textAlign(TextAlign.Start)
                .fontColor($r('app.color.gray_6666'))
              Row(){
                Text(this.product[this.index]?.Name)
                  .width(px2vp(247))
                  .height(px2vp(80))
                  .fontWeight(FontWeight.Medium)
                  .textAlign(TextAlign.Center)
                  .fontSize($r('app.float.fontSize_24'))
                Column(){
                  Image($r('app.media.subscript_space'))
                    .height(px2vp(45))
                    .width(px2vp(45))
                }
                .width(px2vp(12))
                .height(px2vp(80))
                .justifyContent(FlexAlign.End)

              } .border({width:1})
              .margin({bottom:px2vp(40),top:px2vp(8)})
              .width(px2vp(292))
              .borderRadius(px2vp(16))
              .height(px2vp(80))
              .onClick(()=>{
                this.select=0
                this.productController.open()
              })
              Button('编辑')
                .width(px2vp(292))
                .height(px2vp(80))
                .fontWeight(FontWeight.Medium)
                .fontSize($r('app.float.fontSize_24'))
                .margin({bottom:px2vp(40)})
                .onClick(()=>{
                  this.editController.open()
                })

              Button('新建')
                .width(px2vp(292))
                .height(px2vp(80))
                .fontWeight(FontWeight.Medium)
                .fontSize($r('app.float.fontSize_24'))
                .margin({bottom:px2vp(40)})
                .onClick(()=>{
                  this.newBuiltController.open()
                })
              Button('删除')
                .width(px2vp(292))
                .height(px2vp(80))
                .fontWeight(FontWeight.Medium)
                .fontSize($r('app.float.fontSize_24'))
                .fontColor($r('app.color.blue_100'))
                .backgroundColor($r('app.color.black_10'))
                .margin({bottom:px2vp(194)})
                .onClick(()=>{
                  this.product.splice(this.index,1)

                })
            }
            .padding(px2vp(30))
            .width(px2vp(642))
            .height(px2vp(900))
            .borderRadius($r('app.float.borderRadius_16'))
            .alignItems(HorizontalAlign.Center)
            .backgroundColor($r('app.color.white_60'))
            Column(){
              Text('产品：')
                .fontSize($r('app.float.fontSize_20'))
                .fontWeight(FontWeight.Regular)
                .width('100%')
                .height(px2vp(26))
                .textAlign(TextAlign.Start)
                .fontColor($r('app.color.gray_6666'))
              Row(){
                Text(this.product[this.index]?.Name)
                  .borderRadius(px2vp(76))
                  .padding({left:px2vp(30)})
                  .width(px2vp(292))
                  .height(px2vp(80))
                  .fontWeight(FontWeight.Medium)
                  .margin({right:px2vp(142)})
                Button('新建')
                  .width(px2vp(292))
                  .fontSize($r('app.float.fontSize_24'))
                  .height(px2vp(80))
                  .margin({right:px2vp(40)})
                  .onClick(()=>{
                    this.configuration.unshift(    { productName:'射频1号',testingItem:this.configuration.length+1,name:'旋转开挂-0档',testStep:0,inputPower:0,inputSwitch:0, OUTPUT:0,RFRangeMin:0,RFRangeMax:0, outputGain:0,inputPdb:0,dynamicRange:0,gainFlatness:0,outputGainSw:0,inputPdbSw:0,dynamicRangeSw:0,gainFlatnessSw:0}as configurationTable)
                    console.log("textTag"+JSON.stringify(this.configuration))
                  })
                Button('保存')
                  .width(px2vp(292))
                  .height(px2vp(80))
                  .fontSize($r('app.float.fontSize_24'))
                  .onClick(()=>{
                    for (let index = 0; index < this.configuration.length; index++) {
                      this.configuration[index]= {
                        testingItem:this.configuration[index].testingItem,
                        productName:this.configuration[index].productName,
                        name:this.configuration[index].name,
                        testStep:this.configuration[index].testStep,
                        inputPower:this.configuration[index].inputPower,
                        inputSwitch:this.configuration[index].inputSwitch,
                        OUTPUT:this.configuration[index].OUTPUT,
                        RFRangeMin:this.configuration[index].RFRangeMin,
                        RFRangeMax:this.configuration[index].RFRangeMax,
                        outputGain:this.configuration[index].outputGain,
                        inputPdb:this.configuration[index].inputPdb,
                        dynamicRange:this.configuration[index].dynamicRange,
                        gainFlatness:this.configuration[index].gainFlatness,
                        outputGainSw:this.configuration[index].outputGainSw,
                        inputPdbSw:this.configuration[index].inputPdbSw,
                        dynamicRangeSw:this.configuration[index].dynamicRangeSw,
                        gainFlatnessSw:this.configuration[index].gainFlatnessSw
                      }
                      console.log("textTag"+JSON.stringify(this.configuration))
                    }
                  })


              }.width(px2vp(1058))
              .height(px2vp(80))

              List(){
                ForEach(this.configuration, (item:configurationTable ,index:number) => {
                  ListItem() {
                      Column(){
                        Row(){
                          Text('测试项'+item.testingItem?.toString())
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                          TextInput({ text: item.name, controller: this.controller })
                            .backgroundColor($r('app.color.white_100'))
                            .caretColor(Color.Blue)
                            .width(px2vp(292))
                            .height(px2vp(80))
                            .borderRadius(px2vp(16))
                            .textAlign(TextAlign.Center)
                            .border({width:1})
                            .margin({left:px2vp(29)})
                            .fontWeight(FontWeight.Medium)
                            .fontSize($r('app.float.fontSize_24'))
                            .fontColor(Color.Black)
                            .padding(0)
                            .onChange((value: string) => {
                              this.configuration[index].name = value
                            })
                          Blank()
                          Image($r('app.media.upper'))
                            .width(px2vp(48))
                            .height(px2vp(48))
                            .margin({right:px2vp(30)})
                            .onClick(()=>{
                              if (index!==0) {
                                const temp = this.configuration[index];
                                this.configuration[index]={
                                  testingItem:this.configuration[index-1].testingItem,
                                  productName:this.configuration[index-1].productName,
                                  name:this.configuration[index-1].name,
                                  testStep:this.configuration[index-1].testStep,
                                  inputPower:this.configuration[index-1].inputPower,
                                  inputSwitch:this.configuration[index-1].inputSwitch,
                                  OUTPUT:this.configuration[index-1].OUTPUT,
                                  RFRangeMin:this.configuration[index-1].RFRangeMin,
                                  RFRangeMax:this.configuration[index-1].RFRangeMax,
                                  outputGain:this.configuration[index-1].outputGain,
                                  inputPdb:this.configuration[index-1].inputPdb,
                                  dynamicRange:this.configuration[index-1].dynamicRange,
                                  gainFlatness:this.configuration[index-1].gainFlatness,
                                  outputGainSw:this.configuration[index-1].outputGainSw,
                                  inputPdbSw:this.configuration[index-1].inputPdbSw,
                                  dynamicRangeSw:this.configuration[index-1].dynamicRangeSw,
                                  gainFlatnessSw:this.configuration[index-1].gainFlatnessSw
                                }
                                this.configuration[index-1]={
                                  testingItem:temp.testingItem,
                                  productName:temp.productName,
                                  name:temp.name,
                                  testStep:temp.testStep,
                                  inputPower:temp.inputPower,
                                  inputSwitch:temp.inputSwitch,
                                  OUTPUT:temp.OUTPUT,
                                  RFRangeMin:temp.RFRangeMin,
                                  RFRangeMax:temp.RFRangeMax,
                                  outputGain:temp.outputGain,
                                  inputPdb:temp.inputPdb,
                                  dynamicRange:temp.dynamicRange,
                                  gainFlatness:temp.gainFlatness,
                                  outputGainSw:temp.outputGainSw,
                                  inputPdbSw:temp.inputPdbSw,
                                  dynamicRangeSw:temp.dynamicRangeSw,
                                  gainFlatnessSw:temp.gainFlatnessSw
                                }
                              }


                            })
                          Image($r('app.media.lower'))
                            .width(px2vp(48))
                            .height(px2vp(48))
                            .margin({right:px2vp(30)})
                            .onClick(()=>{
                                const temp = this.configuration[index];
                                this.configuration[index]={
                                  testingItem:this.configuration[index+1].testingItem,
                                  productName:this.configuration[index+1].productName,
                                  name:this.configuration[index+1].name,
                                  testStep:this.configuration[index+1].testStep,
                                  inputPower:this.configuration[index+1].inputPower,
                                  inputSwitch:this.configuration[index+1].inputSwitch,
                                  OUTPUT:this.configuration[index+1].OUTPUT,
                                  RFRangeMin:this.configuration[index+1].RFRangeMin,
                                  RFRangeMax:this.configuration[index+1].RFRangeMax,
                                  outputGain:this.configuration[index+1].outputGain,
                                  inputPdb:this.configuration[index+1].inputPdb,
                                  dynamicRange:this.configuration[index+1].dynamicRange,
                                  gainFlatness:this.configuration[index+1].gainFlatness,
                                  outputGainSw:this.configuration[index+1].outputGainSw,
                                  inputPdbSw:this.configuration[index+1].inputPdbSw,
                                  dynamicRangeSw:this.configuration[index+1].dynamicRangeSw,
                                  gainFlatnessSw:this.configuration[index+1].gainFlatnessSw

                                }
                                this.configuration[index+1]={
                                  testingItem:temp.testingItem,
                                  productName:temp.productName,
                                  name:temp.name,
                                  testStep:temp.testStep,
                                  inputPower:temp.inputPower,
                                  inputSwitch:temp.inputSwitch,
                                  OUTPUT:temp.OUTPUT,
                                  RFRangeMin:temp.RFRangeMin,
                                  RFRangeMax:temp.RFRangeMax,
                                  outputGain:temp.outputGain,
                                  inputPdb:temp.inputPdb,
                                  dynamicRange:temp.dynamicRange,
                                  gainFlatness:temp.gainFlatness,
                                  outputGainSw:temp.outputGainSw,
                                  inputPdbSw:temp.inputPdbSw,
                                  dynamicRangeSw:temp.dynamicRangeSw,
                                  gainFlatnessSw:temp.gainFlatnessSw,

                                }


                            })
                          Image($r("app.media.delete"))
                            .width(px2vp(48))
                            .height(px2vp(48))
                            .onClick(()=>{
                              this.configuration.splice(index,1)
                            })

                        }.width(px2vp(998))
                        .height(px2vp(80))
                        .alignItems(VerticalAlign.Center)
                        .margin({top:px2vp(20),left:px2vp(30),bottom:px2vp(20)})
                        Row(){
                          Column(){
                            Row(){
                              Column(){
                                Text('频率步进')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(300))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              TextInput({ text: item.testStep===0?'-':item.testStep?.toString(),placeholder:'-', controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .textAlign(TextAlign.Center)
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .fontColor(Color.Black)
                                .textAlign(TextAlign.Center)
                                .padding(0)
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].testStep=Number(value)
                                })
                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)
                            Row(){
                              Column(){
                                Text('输入开关通道')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)




                              }.width(px2vp(200))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              TextInput({ text:  item.inputSwitch===0?'-':item.inputSwitch?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .borderRadius(px2vp(16))
                                .textAlign(TextAlign.Center)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].inputSwitch =Number(value)
                                })


                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)


                          }.width(px2vp(482))
                          .height(px2vp(240))
                          .margin({right:px2vp(40)})
                          Column(){
                            Row(){
                              Column(){
                                Text('输入功率范围')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(200))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              Text('小于')
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .margin({right:px2vp(5)})
                              TextInput({ text: item.inputPower===0?'-':item.inputPower?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .textAlign(TextAlign.Center)
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .textAlign(TextAlign.Center)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].inputPower =Number(value)
                                })


                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)
                            Row(){
                              Column(){
                                Text('输出开关通道')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(200))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()

                              TextInput({ text:item.OUTPUT===0?'-': item.OUTPUT?.toString(),controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .textAlign(TextAlign.Center)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].OUTPUT=Number(value)
                                })



                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)



                          }.width(px2vp(482))
                          .height(px2vp(240))

                        }
                        .width(px2vp(1004))
                        .height(px2vp(240))
                        Row(){
                          Column(){
                            Text('射频范围')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)
                          }.padding({left:px2vp(30)})
                          Blank()
                          TextInput({  text: item.RFRangeMin===0?'-':item.RFRangeMin?.toString(), controller: this.controller })
                            .backgroundColor($r('app.color.white_100'))
                            .caretColor(Color.Blue)
                            .width(px2vp(98))
                            .height(px2vp(80))
                            .border({width:1})
                            .margin({right:px2vp(29)})
                            .fontWeight(FontWeight.Medium)
                            .fontSize($r('app.float.fontSize_24'))
                            .fontColor(Color.Black)
                            .padding(0)
                            .inputFilter('[(-999999)-999999]', () => {
                            })
                            .textAlign(TextAlign.Center)
                            .borderRadius(px2vp(16))
                            .onChange((value: string) => {
                              this.configuration[index].RFRangeMin=Number(value)
                            })
                          Text('-')
                            .fontWeight(FontWeight.Medium)
                            .fontSize($r('app.float.fontSize_24'))
                            .fontColor(Color.Black)
                          TextInput({ text:item.RFRangeMax===0?'-':item.RFRangeMax?.toString(), controller: this.controller })
                            .backgroundColor($r('app.color.white_100'))
                            .caretColor(Color.Blue)
                            .width(px2vp(98))
                            .height(px2vp(80))
                            .border({width:1})
                            .margin({right:px2vp(120),left:px2vp(29)})
                            .fontWeight(FontWeight.Medium)
                            .fontSize($r('app.float.fontSize_24'))
                            .fontColor(Color.Black)
                            .padding(0)
                            .inputFilter('[(-999999)-999999]', () => {
                            })
                            .textAlign(TextAlign.Center)
                            .borderRadius(px2vp(16))
                            .onChange((value: string) => {
                              this.configuration[index].RFRangeMax=Number(value)
                            })


                        }
                        .width(px2vp(1004))
                        .height(px2vp(100))
                        .borderRadius($r('app.float.borderRadius_16'))
                        .alignItems(VerticalAlign.Center)
                        .margin({left:px2vp(30),right:px2vp(25),bottom:px2vp(20)})
                        .backgroundColor($r('app.color.white_100'))
                        Row(){
                          Column(){
                            Row(){
                              Column(){
                                Text('输出增益')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(150))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              Text('大于')
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .margin({right:px2vp(5)})
                              TextInput({ text: item.outputGain===0?'-':item.outputGain?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .textAlign(TextAlign.Center)
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].outputGain=Number(value)
                                })
                              Toggle({ type: ToggleType.Switch, isOn: item.outputGainSw===1?true:false })
                                .width(px2vp(72))
                                .height(px2vp(40))
                                .margin({right:px2vp(30)})
                                .onChange( (isOn: boolean) => {
                                  if (isOn===true) {
                                    this.configuration[index].outputGainSw=1
                                  }else if (isOn===false) {
                                    this.configuration[index].outputGainSw=0
                                  }
                                })


                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)
                            Row(){
                              Column(){
                                Text('动态范围')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)




                              }.width(px2vp(150))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              Text('大于')
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .margin({right:px2vp(5)})
                              TextInput({ text: item.dynamicRange===0?'-':item.dynamicRange?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .textAlign(TextAlign.Center)
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].dynamicRange=Number(value)
                                })
                              Toggle({ type: ToggleType.Switch, isOn:item.dynamicRangeSw===1?true:false })
                                .width(px2vp(72))
                                .height(px2vp(40))
                                .margin({right:px2vp(30)})
                                .onChange( (isOn: boolean) => {
                                  if (isOn===true) {
                                    this.configuration[index].dynamicRangeSw=1
                                  }else if (isOn===false) {
                                    this.configuration[index].dynamicRangeSw=0
                                  }
                                })
                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)


                          }.width(px2vp(482))
                          .height(px2vp(240))
                          .margin({right:px2vp(40)})
                          Column(){
                            Row(){
                              Column(){
                                Text('输入P-1dB')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(150))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              Text('大于')
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .margin({right:px2vp(5)})
                              TextInput({ text:  item.inputPdb===0?'-':item.inputPdb?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .textAlign(TextAlign.Center)
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].inputPdb=Number(value)
                                })
                              Toggle({ type: ToggleType.Switch, isOn: item.inputPdbSw===1?true:false })
                                .width(px2vp(72))
                                .height(px2vp(40))
                                .margin({right:px2vp(30)})
                                .onChange( (isOn: boolean) => {
                                  if (isOn===true) {
                                    this.configuration[index].inputPdbSw=1
                                  }else if (isOn===false) {
                                    this.configuration[index].inputPdbSw=0
                                  }
                                })



                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)
                            Row(){
                              Column(){
                                Text('增益平坦度')
                                  .fontSize($r('app.float.fontSize_24'))
                                  .fontWeight(FontWeight.Medium)
                                  .width('100%')
                                  .height(px2vp(30))
                                  .textAlign(TextAlign.Start)

                              }.width(px2vp(150))
                              .height(px2vp(100))
                              .justifyContent(FlexAlign.Center)
                              Blank()
                              Text('小于')
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .margin({right:px2vp(5)})
                              TextInput({ text:item.gainFlatness===0?'-':item.gainFlatness?.toString(), controller: this.controller })
                                .backgroundColor($r('app.color.white_100'))
                                .caretColor(Color.Blue)
                                .width(px2vp(98))
                                .height(px2vp(80))
                                .border({width:1})
                                .margin({right:px2vp(29)})
                                .fontWeight(FontWeight.Medium)
                                .fontSize($r('app.float.fontSize_24'))
                                .fontColor(Color.Black)
                                .padding(0)
                                .inputFilter('[(-999999)-999999]', () => {
                                })
                                .textAlign(TextAlign.Center)
                                .borderRadius(px2vp(16))
                                .onChange((value: string) => {
                                  this.configuration[index].gainFlatness=Number(value)
                                })
                              Toggle({ type: ToggleType.Switch, isOn: item.gainFlatnessSw===1?true:false })
                                .width(px2vp(72))
                                .height(px2vp(40))
                                .margin({right:px2vp(30)})
                                .onChange( (isOn: boolean) => {
                                  if (isOn===true) {
                                    this.configuration[index].gainFlatnessSw=1
                                  }else if (isOn===false) {
                                    this.configuration[index].gainFlatnessSw=0
                                  }
                                })
                            }.width(px2vp(482))
                            .height(px2vp(100))
                            .padding({left:px2vp(30)})
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.white_100'))
                            .margin({bottom:px2vp(20)})
                            .alignItems(VerticalAlign.Center)
                          }.width(px2vp(482))
                          .height(px2vp(240))

                        }
                        .width(px2vp(1004))
                        .height(px2vp(240))
                      }.width(px2vp(1058))
                      .height(px2vp(720))
                      .margin({bottom:px2vp(20)})
                      .borderRadius($r('app.float.borderRadius_16'))
                      .backgroundColor($r('app.color.black_10'))
                      .alignItems(HorizontalAlign.Center)


                  }
                })
              }
              .width(px2vp(1058))
              .height(px2vp(720))
              .margin({top:px2vp(20)})


            }
            .padding(px2vp(30))
            .backgroundColor($r('app.color.white_60'))
            .width(px2vp(1118))
            .height(px2vp(900))
            .borderRadius($r('app.float.borderRadius_16'))
            .margin({left:px2vp(40)})
        }.width(px2vp(1800))
        .height(px2vp(900))
        .borderRadius($r('app.float.borderRadius_16'))
        .margin({left:px2vp(60),right:px2vp(60),bottom:px2vp(40)})
      }else if (this.click===1){
        Row(){
          Column(){
            Text('射频类维修检测系统')
              .fontSize($r('app.float.fontSize_30'))
              .fontWeight(FontWeight.Medium)
              .width('100%')
              .height(px2vp(30))
              .textAlign(TextAlign.Start)
              .margin({bottom:px2vp(57)})
            Text('产品：')
              .fontSize($r('app.float.fontSize_20'))
              .fontWeight(FontWeight.Regular)
              .width(px2vp(292))
              .height(px2vp(26))
              .textAlign(TextAlign.Start)
              .fontColor($r('app.color.gray_6666'))
            Row(){
              Text(this.product[this.index]?.Name)
                .width(px2vp(247))
                .height(px2vp(80))
                .fontWeight(FontWeight.Medium)
                .textAlign(TextAlign.Center)
                .fontSize($r('app.float.fontSize_24'))
              Column(){
                Image($r('app.media.subscript_space'))
                  .height(px2vp(45))
                  .width(px2vp(45))

              }
              .width(px2vp(12))
              .height(px2vp(80))
              .justifyContent(FlexAlign.End)

            } .border({width:1})
            .margin({bottom:px2vp(40),top:px2vp(8)})
            .width(px2vp(292))
            .borderRadius(px2vp(16))
            .height(px2vp(80))
            .onClick(()=>{
              this.select=0
              this.productController.open()
            })
            Text('飞机编号：')
              .fontSize($r('app.float.fontSize_20'))
              .fontWeight(FontWeight.Regular)
              .width(px2vp(292))
              .height(px2vp(26))
              .textAlign(TextAlign.Start)
              .fontColor($r('app.color.gray_6666'))
              .margin({bottom:px2vp(8)})
            TextInput({ text: this.product[this.index]?.aircraftNumber,controller: this.controller})
              .caretColor(Color.Blue)
              .width(px2vp(292))
              .height(px2vp(80))
              .backgroundColor($r('app.color.white_100'))
              .border({width:1})
              .margin({bottom:px2vp(20)})
              .fontWeight(FontWeight.Medium)
              .fontSize($r('app.float.fontSize_24'))
              .fontColor(Color.Black)
              .onChange((value: string) => {
                this.product[this.index].aircraftNumber = value
              })
            Text('测试人员：')
              .fontSize($r('app.float.fontSize_20'))
              .fontWeight(FontWeight.Regular)
              .width(px2vp(292))
              .height(px2vp(26))
              .textAlign(TextAlign.Start)
              .fontColor($r('app.color.gray_6666'))
              .margin({bottom:px2vp(8)})
            TextInput({ text:  this.product[this.index]?.testingPersonnel, controller: this.controller})
              .caretColor(Color.Blue)
              .width(px2vp(292))
              .height(px2vp(80))
              .backgroundColor($r('app.color.white_100'))
              .border({width:1})
              .margin({bottom:px2vp(20)})
              .fontWeight(FontWeight.Medium)
              .fontSize($r('app.float.fontSize_24'))
              .fontColor(Color.Black)
              .onChange((value: string) => {
                this.product[this.index].testingPersonnel = value
              })
            Text('测试时间：')
              .fontSize($r('app.float.fontSize_20'))
              .fontWeight(FontWeight.Regular)
              .width(px2vp(292))
              .height(px2vp(26))
              .textAlign(TextAlign.Start)
              .fontColor($r('app.color.gray_6666'))
              .margin({bottom:px2vp(8)})
           Text( this.product[this.index].testTime)
             .fontWeight(FontWeight.Medium)
             .fontSize($r('app.float.fontSize_24'))
             .width(px2vp(292))
             .height(px2vp(26))
            Blank()
            Button(this.execute===0?'执行':'停止执行')
              .width(px2vp(292))
              .height(px2vp(80))
              .backgroundColor(this.execute===0?$r('app.color.green_100'):$r('app.color.red_100'))
              .onClick(()=>{
                if (this.execute===0) {
                  this.execute=1
                  //日期时间
                  let dateTime = new Date()
                  let coding = dateTime.getFullYear() +'-'+ (dateTime.getMonth() + 1).toString().padStart(2, '0')
                    +'-'+  (dateTime.getDate().toString().padStart(2, '0')) +'   '+
                  (dateTime.getHours()).toString().padStart(2, '0')+':'+(dateTime.getMinutes() + 1).toString().padStart(2, '0')
                    +':'+(dateTime.getSeconds() ).toString().padStart(2, '0')
                  this.product[this.index].testTime=coding
                  this.product[this.index]={
                    Name:this.product[this.index].Name,
                    testingPersonnel:this.product[this.index]?.testingPersonnel,
                    aircraftNumber:this.product[this.index]?.aircraftNumber,
                    testTime:this.product[this.index]?.testTime,
                    configuration:this.product[this.index]?.configuration
                  }as productName
                  console.log("textTag"+JSON.stringify(this.product))
                }else if (this.execute===1){
                  this.execute=0
                }

              })


          }
          .padding(px2vp(30))
          .width(px2vp(642))
          .height(px2vp(900))
          .borderRadius($r('app.float.borderRadius_16'))
          .alignItems(HorizontalAlign.Center)
          .backgroundColor($r('app.color.white_60'))
          Column(){
            List() {
              ForEach(this.configuration, (item: configurationTable, index: number) => {
                ListItem() {
                  Column(){
                    Row(){
                      Text('测试项1')
                        .fontSize($r('app.float.fontSize_24'))
                        .fontWeight(FontWeight.Medium)
                      Text('旋钮开关-0挡')
                        .fontSize($r('app.float.fontSize_24'))
                        .fontWeight(FontWeight.Medium)
                        .borderRadius(px2vp(76))
                        .padding({left:px2vp(30)})
                        .border({width:1})
                        .width(px2vp(292))
                        .height(px2vp(80))
                        .margin({right:px2vp(142),left:px2vp(20)})
                      Blank()


                    }.width(px2vp(998))
                    .height(px2vp(80))
                    .alignItems(VerticalAlign.Center)
                    .margin({top:px2vp(20),left:px2vp(30),bottom:px2vp(20)})
                    Row(){
                      Column(){
                        Row(){
                          Column(){
                            Text('频率步进')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('10')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('合格')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.green_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('输入功率')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)




                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('-40')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('频率步进')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('10')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('频率步进')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('10')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)


                      }.width(px2vp(482))
                      .height(px2vp(480))
                      .margin({right:px2vp(40)})
                      Column(){
                        Row(){
                          Column(){
                            Text('频率')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('2.0')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('合格')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.green_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('输出功率')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('-20')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})




                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('频率步进')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('10')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)
                        Row(){
                          Column(){
                            Text('频率步进')
                              .fontSize($r('app.float.fontSize_24'))
                              .fontWeight(FontWeight.Medium)
                              .width('100%')
                              .height(px2vp(30))
                              .textAlign(TextAlign.Start)

                          }.width(px2vp(200))
                          .height(px2vp(100))
                          .justifyContent(FlexAlign.Center)
                          Blank()
                          Text('10')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .textAlign(TextAlign.Start)
                            .margin({right:px2vp(30)})
                          Text('待检测')
                            .fontSize($r('app.float.fontSize_24'))
                            .fontWeight(FontWeight.Medium)
                            .height(px2vp(30))
                            .width(px2vp(85))
                            .textAlign(TextAlign.Center)
                            .borderRadius($r('app.float.borderRadius_16'))
                            .backgroundColor($r('app.color.grey_100'))
                            .margin({right:px2vp(30)})


                        }.width(px2vp(482))
                        .height(px2vp(100))
                        .padding({left:px2vp(30)})
                        .borderRadius($r('app.float.borderRadius_16'))
                        .backgroundColor($r('app.color.white_100'))
                        .margin({bottom:px2vp(20)})
                        .alignItems(VerticalAlign.Center)



                      }.width(px2vp(482))
                      .height(px2vp(480))

                    }
                    .width(px2vp(1004))
                    .height(px2vp(480))

                  }.width(px2vp(1058))
                  .height(px2vp(620))
                  .margin({bottom:px2vp(20)})
                  .borderRadius($r('app.float.borderRadius_16'))
                  .backgroundColor($r('app.color.black_10'))
                }
              })
            }.width(px2vp(1058))
            .height(px2vp(740))
            //.margin({top:px2vp(20)})


            Blank()
            Button('保存数据')
              .width(px2vp(292))
              .height(px2vp(80))
              .onClick(()=>{

              })
          }
          .padding(px2vp(30))
          .backgroundColor($r('app.color.white_60'))
          .width(px2vp(1118))
          .height(px2vp(900))
          .borderRadius($r('app.float.borderRadius_16'))
          .margin({left:px2vp(40)})

        }.width(px2vp(1800))
        .height(px2vp(900))
        .borderRadius($r('app.float.borderRadius_16'))
        .margin({left:px2vp(60),right:px2vp(60),bottom:px2vp(40)})
      }
    }
    .width(px2vp(1920))
    .height(px2vp(1080))
    .backgroundImage($r('app.media.BG_two'))
  }
}
@CustomDialog
struct namePopUp {
  @Link index:number
  @Link select:number
  scroller: Scroller = new Scroller()
  @Link product:productName[]
  @Link productName:string
  controller: CustomDialogController
  build() {
    Column(){
      Text('产品名称')
        .fontSize($r('app.float.fontSize_30'))
        .fontWeight(FontWeight.Medium)
        .height(px2vp(50))
        .margin({bottom:px2vp(20)})
      List({space:px2vp(20)}){
        ForEach(this.product, (item:productName,index:number) => {
          ListItem(){
            Row(){
              Text(item.Name)
                .fontWeight(FontWeight.Medium)
                .fontSize($r('app.float.fontSize_24'))
                .width(px2vp(500))
                .height(px2vp(80))
                .textAlign(TextAlign.Center)
                .borderRadius(px2vp(16))
                .onClick(()=>{
                  this.index=index
                    this.productName=item.Name!
                    this.controller.close()
                })
            }
            .backgroundColor($r('app.color.white_f1f3f5'))
            .borderRadius(px2vp(16))
            .width(px2vp(600))
            .height(px2vp(80))
            .justifyContent(FlexAlign.Center)
          }

        })
      }
      .scrollBar(BarState.Off)
      .width(px2vp(600))
      .height(px2vp(430))
      

    }.width(px2vp(700))
    .height(px2vp(500))
    .borderRadius(px2vp(16))
    .backgroundColor($r('app.color.white_100'))
    .alignItems(HorizontalAlign.Center)
  }
}
export class newProductClass{
  Name?:string
  configuration?:configurationTable[]
  aircraftNumber?:string
  testingPersonnel?:string
  testTime?:string
}
//新建
@CustomDialog
struct newBuilt {
  @State private newProduct:Array<newProductClass>=[{Name:'',testingPersonnel:'',testTime:'',configuration:[]}as newProductClass]
  scroller: Scroller = new Scroller()
  @Link product: productName[]
  CustomDialogController: CustomDialogController
  @State Name: string = ''
  controller: TextInputController = new TextInputController()

  build() {
    Column() {
      Text('新建产品名称')
        .fontSize($r('app.float.fontSize_30'))
        .fontWeight(FontWeight.Medium)
        .margin({top:px2vp(20)})
        .height(px2vp(60))
      TextInput({ text: this.Name, placeholder: '请输入产品名称', controller: this.controller })
        .placeholderColor(Color.Grey)
        .placeholderFont({ size: 14, weight: px2vp(400) })
        .caretColor(Color.Blue)
        .width('95%')
        .height(px2vp(80))
        .margin(px2vp(20))
        .fontSize(14)
        .fontColor(Color.Black)
        .onChange((value: string) => {
          this.Name = value
        })
      Row({space:px2vp(24)}){
        Button('取消')
          .width(px2vp(292))
          .height(px2vp(80))
          .onClick(()=>{
          this.CustomDialogController.close()
          })
        Button('确认')
          .width(px2vp(292))
          .height(px2vp(80))
          .onClick(()=>{
            this.newProduct[0]= { Name: this.Name,
              aircraftNumber:this.newProduct[0].aircraftNumber,
              testingPersonnel:this.newProduct[0].testingPersonnel,
              testTime:this.newProduct[0].testTime,
            }
            this.product.unshift(this.newProduct[0]= { Name: this.Name,
              aircraftNumber:this.newProduct[0].aircraftNumber,
              testingPersonnel:this.newProduct[0].testingPersonnel,
              testTime:this.newProduct[0].testTime,
            })
            console.log('textTag'+'+++++'+ JSON.stringify(this.product))
            this.CustomDialogController.close()
          })

      }.width(px2vp(700))
      .height(px2vp(80))
      .alignItems(VerticalAlign.Center)
      .justifyContent(FlexAlign.Center)

    }.width(px2vp(700))
    .height(px2vp(300))
    .borderRadius(px2vp(16))
    .backgroundColor($r('app.color.white_100'))
    .alignItems(HorizontalAlign.Center)
  }
}
//编辑
@CustomDialog
struct edit {
  @Link index:number
  @State private newProduct:Array<newProductClass>=[]
  scroller: Scroller = new Scroller()
  @Link product: productName[]
  CustomDialogController: CustomDialogController
  @State Name: string = ''
  controller: TextInputController = new TextInputController()

  build() {
    Column() {
      Text('编辑产品名称')
        .fontSize($r('app.float.fontSize_30'))
        .fontWeight(FontWeight.Medium)
        .margin({top:px2vp(20)})
        .height(px2vp(60))

      TextInput({ text: this.product[this.index].Name, placeholder:this.product[this.index].Name, controller: this.controller })
        .placeholderColor(Color.Grey)
        .placeholderFont({ size: 14, weight: px2vp(400) })
        .caretColor(Color.Blue)
        .width('95%')
        .height(px2vp(80))
        .margin(px2vp(20))
        .fontSize(14)
        .fontColor(Color.Black)
        .onChange((value: string) => {
          this.Name = value
        })
      Row({space:px2vp(24)}){
        Button('取消')
          .width(px2vp(292))
          .height(px2vp(80))
          .onClick(()=>{
            this.CustomDialogController.close()
          })
        Button('确认')
          .width(px2vp(292))
          .height(px2vp(80))
          .onClick(()=>{
            this.product[this.index]= { Name: this.Name }
            console.log('textTag'+'+++++'+ JSON.stringify(this.product))
            this.CustomDialogController.close()
          })

      }.width(px2vp(700))
      .height(px2vp(80))
      .alignItems(VerticalAlign.Center)
      .justifyContent(FlexAlign.Center)

    }.width(px2vp(700))
    .height(px2vp(300))
    .borderRadius(px2vp(16))
    .backgroundColor($r('app.color.white_100'))
    .alignItems(HorizontalAlign.Center)
  }
}
