feat:评判润和修改
This commit is contained in:
		
							parent
							
								
									a7655f7747
								
							
						
					
					
						commit
						e2a2af0be3
					
				| @ -1,11 +1,6 @@ | ||||
| { | ||||
|   "apiType": 'stageMode', | ||||
|   "buildOption": { | ||||
|     "externalNativeOptions": { | ||||
|       "path": "./src/main/cpp/CMakeLists.txt", | ||||
|       "arguments": "", | ||||
|       "cppFlags": "", | ||||
|     }, | ||||
|     "sourceOption": { | ||||
|       "workers": [ | ||||
|         './src/main/ets/workers/worker.ts' | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| import Judge from '../../judgeSDK/utils/judgeReal'; | ||||
| import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d'; | ||||
| import common from '@ohos.app.ability.common'; | ||||
| @ -31,7 +31,7 @@ export default struct RealTime { | ||||
|           XComponent({ | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             libraryname: 'judgesdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.widthNumber) | ||||
|  | ||||
| @ -1,39 +0,0 @@ | ||||
| const folder = 'judge/km3/amplify/' | ||||
| const amplifyImgs = [ | ||||
|   'km_zxB.png','km_hcB.png', | ||||
|   'km_bdB.png', | ||||
|   'km_ccB.png','km_dtB.png','km_tcB.png', | ||||
| ] | ||||
| const amplifyArrs = [ | ||||
|   {name:'直线',projectCode:'3',projectCodeCenter:'40300'}, | ||||
|   {name:'会车',projectCode:'9',projectCodeCenter:'41300'}, | ||||
|   {name:'变道',projectCode:'4',projectCodeCenter:'40500'}, | ||||
|   {name:'超车',projectCode:'10',projectCodeCenter:'41400'}, | ||||
|   {name:'掉头',projectCode:'12',projectCodeCenter:'41500'}, | ||||
|   {name:'停车',projectCode:'11',projectCodeCenter:'40600'}, | ||||
| ] | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
|   private amplifyImgIndex:number = 0 | ||||
|   private closeAmplifyPop:Function = ()=>{} | ||||
|   private confirmAmplify:Function = ()=>{} | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
| 
 | ||||
|       }.width(530).height(386).backgroundImage($rawfile(`${folder}${amplifyImgs[this.amplifyImgIndex]}`)).backgroundImageSize({width:'100%',height:'100%'}).position({y:'25%',x:'37%'}).justifyContent(FlexAlign.Center) | ||||
|        .onClick((e:ClickEvent)=>{ | ||||
|           this.confirmAmplify(amplifyArrs[this.amplifyImgIndex]) | ||||
|        }) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.9)') | ||||
|     .onClick(()=>{this.closeAmplifyPop()}) | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
| @ -1,154 +0,0 @@ | ||||
| import {MarkRule} from '../../judgeSDK/api/judgeSDK' | ||||
| interface SEL{ | ||||
|   fontColor:string | ||||
|   bgColor:string | ||||
| } | ||||
| 
 | ||||
| @Component | ||||
| struct DeductedPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   @State fontSize:number = 25 | ||||
|   @State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'} | ||||
|   @State selected:SEL =   {fontColor:'#FFAD33', bgColor:'#26231E'} | ||||
| 
 | ||||
|   @State currentIndex:number = 0 | ||||
|   @State currentPageIndex:number = 0 | ||||
|   //通用评判扣分 | ||||
|   @State currentUniversalPageIndex:number = 0; | ||||
|   private  markRules:MarkRule[] = [] | ||||
|   @State universalMarkRules:MarkRule[] = [] | ||||
|   @State manualMarkRules:MarkRule[] = [] | ||||
|   @State currentItems:string[] = [] | ||||
| 
 | ||||
|   @State lineBg:Array<string> = ['#4D4136','#26231E'] | ||||
|   @State selectedLine:number = undefined | ||||
|   private  closePopup:Function = ()=> {} | ||||
|   private  confirmMark:Function = (itemno:number,serial:string) => {} | ||||
|   @State selectedLineStyle:SEL = { | ||||
|     fontColor:'#FFF', | ||||
|     bgColor:'#B36E00' | ||||
|   } | ||||
| 
 | ||||
|   aboutToAppear(){ | ||||
|     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|   } | ||||
|   //上一页 下一页 | ||||
|   goPage(typeIndex){ | ||||
|     const currentIndex = this.currentIndex | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       typeIndex ? (this.currentUniversalPageIndex += 1) : (this.currentUniversalPageIndex -= 1) | ||||
|     }else{ | ||||
|       typeIndex ? (this.currentPageIndex += 1) : (this.currentPageIndex -= 1) | ||||
|     } | ||||
|     this.selectedLine = -1 | ||||
|   } | ||||
| 
 | ||||
|   //选中扣分项 | ||||
|   getSelectedLine(index){ | ||||
|     const {selectedLine,selectedLineStyle,lineBg} = this; | ||||
|     if(selectedLine === index){ | ||||
|       return selectedLineStyle.bgColor | ||||
|     } | ||||
|     if(index % 2 === 0){ | ||||
|       return lineBg[0] | ||||
|     }else{ | ||||
|       return lineBg[1] | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   //获取当前页的数据 | ||||
|   getCurrentMarkRuleList(){ | ||||
|     const {currentIndex,currentUniversalPageIndex,currentPageIndex,markRules,universalMarkRules} = this; | ||||
|     if(currentIndex){ | ||||
|       //通用评判 | ||||
|       return universalMarkRules.slice(currentUniversalPageIndex*7,(currentUniversalPageIndex + 1)*7) | ||||
|     }else{ | ||||
|       return universalMarkRules.slice(currentPageIndex*7,(currentPageIndex + 1)*7) | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Column(){ | ||||
|           Row(){ | ||||
|             Row(){ | ||||
|               ForEach(['人工评判','通用评判'],(text,index)=>{ | ||||
| 
 | ||||
|                 Row(){ | ||||
|                   Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|                 .width(180).height(70) | ||||
|                 .backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center) | ||||
|                 .borderRadius({topLeft:20,topRight:20}).margin({right:10}) | ||||
|                 .onClick(()=>{ | ||||
|                   this.currentIndex = index; | ||||
|                   this.selectedLine = -1; | ||||
|                   if(index === 1) { | ||||
|                     this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 ) | ||||
|                   }else{ | ||||
|                     this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+'')) | ||||
|                   } | ||||
|                 }) | ||||
|               }) | ||||
|             } | ||||
|             Row(){ | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1)) >= (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) && | ||||
|                   (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) > 0 | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/zuo_nor.png`)).margin({left:24,top:4}) | ||||
|                   Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(0)}) | ||||
|               } | ||||
| 
 | ||||
|               if( | ||||
|                 (Math.ceil(this.universalMarkRules.length / 7 - 1))  > (this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex) | ||||
|               ){ | ||||
|                 Row(){ | ||||
|                   Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30}) | ||||
|                   Row(){}.width(36).height(36).backgroundImage($rawfile(`judge/km3/you_nor.png`)).margin({left:4,top:4}) | ||||
|                 }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                 .onClick(()=>{this.goPage(1)}) | ||||
|               } | ||||
| 
 | ||||
| 
 | ||||
|               Row(){ | ||||
|                 Text('扣  分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:49}) | ||||
|               }.width(160).height(80).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|                .onClick(()=>{ | ||||
|                  const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; | ||||
|                  const mark = this.universalMarkRules[index * 7 + this.selectedLine] | ||||
|                  mark && this.confirmMark(mark.itemno,mark.markserial) | ||||
|                }) | ||||
|             } | ||||
|           }.width('100%').justifyContent(FlexAlign.SpaceBetween) | ||||
|           Column(){ | ||||
|             ForEach(this.getCurrentMarkRuleList(),(item,index) => { | ||||
|               Row(){ | ||||
|                 Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 Row(){ | ||||
|                   Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500) | ||||
|                 } | ||||
|               } | ||||
|               .width('100%').height(75).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center) | ||||
|               .padding({left:20,right:20}) | ||||
|               .backgroundColor(this.getSelectedLine(index)) | ||||
|               .onClick(()=>{this.selectedLine = index}) | ||||
|             }) | ||||
|           } | ||||
|         } | ||||
|       }.width(1300).height(710).position({x:'15%',y:'10%'}).backgroundColor('#E6E3DF').padding({top:15,bottom:15,left:25,right:25}).borderRadius(20) | ||||
|       Row(){}.width(100).height(100).position({y:'85%',x:'50%'}).backgroundImage($rawfile('judge/km3/close_nor.png')).backgroundImageSize({width:'100%',height:'100%'}) | ||||
|         .onClick(()=>{this.closePopup()}) | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default DeductedPopup | ||||
| @ -1,27 +0,0 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
|   private cancelFn:(event?: ClickEvent) => void | ||||
|   private confirmFn:(event?: ClickEvent) => void | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Text(this.title).fontSize(36).margin({bottom:20}) | ||||
|         Row(){}.height(100) | ||||
|         Row(){ | ||||
|           Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) | ||||
|           Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) | ||||
|         } | ||||
|       }.width('75%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'12.5%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default EndPopup | ||||
| @ -1,21 +0,0 @@ | ||||
| 
 | ||||
| @Component | ||||
| struct LoadingPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Image($rawfile('judge/loading-car.gif')).width(250).margin({top:20,bottom:20}) | ||||
|         Text(this.title).fontSize(32).margin({top:70}) | ||||
|       }.width('70%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'15%',x:'15%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| export default LoadingPopup | ||||
| @ -1,83 +0,0 @@ | ||||
| // @ts-nocheck | ||||
| import hilog from '@ohos.hilog'; | ||||
| import apiJudgeSdk from 'libJudgeSdk.so'; | ||||
| // import apiJudgeSdk from '@ohos.judgesdk'; | ||||
| 
 | ||||
| import Judge from '../../judgeSDK/utils/judge-real' | ||||
| // import Judge from '../../judgeSDK/judge-track-playback' | ||||
| import {Project,ProjectObj,MarkRule} from '../../judgeSDK/api/judgeSDK.d' | ||||
| import AccountTable from '../../../common/database/tables/AccountTable'; | ||||
| import MA_SYSSET from '../../../common//constants/MA_SYSSET'; | ||||
| import common from '@ohos.app.ability.common'; | ||||
| import { getSyncData } from '../../../common/service/initable' | ||||
| import {testAllitems,testUIAllitems,testMarkRules} from '../../judgeSDK/dataTest/index' | ||||
| 
 | ||||
| @Component | ||||
| struct RealTime { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private height:number = 0 | ||||
|   private width:number = 0 | ||||
| 
 | ||||
|   @State message: string = '开始绘制' | ||||
| 
 | ||||
|   // 控制XComponent组件的创建和销毁 | ||||
|   @State draw: boolean = false | ||||
|   //监管接口序列号 | ||||
|   @State serialNumber:number = 0 | ||||
| 
 | ||||
|   //模拟考试项目 | ||||
|   @State projects:Project[] = [] | ||||
|   @State projectsObj:ProjectObj = {} | ||||
|   @State markRuleListObj:MarkRule ={} | ||||
|   private context = getContext(this) as common.UIAbilityContext; | ||||
| 
 | ||||
|   // xcomponentController: XComponentController = new XComponentController() | ||||
| 
 | ||||
|   build() { | ||||
|     Row() { | ||||
|       Column() { | ||||
|         if (this.draw) { | ||||
|           XComponent({ | ||||
|             id: 'duolun_plugin_id_draw', //显示轨迹窗口id名称,注意这个ID要和C++侧一致,不能变 | ||||
|             type: 'surface', | ||||
|             libraryname: 'JudgeSdk' | ||||
|             // libraryname: 'judgesdk' | ||||
|           }) | ||||
|             .width(this.width) | ||||
|             .height(this.height) | ||||
|             .onLoad(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(true); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|             }) | ||||
|             .onDestroy(() => { | ||||
|               apiJudgeSdk.examJudgeMapSetDrawing(false); //停止绘制地图轨迹,false:表示结束绘制 | ||||
|               this.draw = false; | ||||
|               clearInterval(globalThis.realTimer) | ||||
|             }) | ||||
|         } else { | ||||
|           Column() {} | ||||
|           .width(this.width) | ||||
|           .height(this.height) | ||||
|         } | ||||
|       } | ||||
|       .width('100%') | ||||
|       .backgroundColor('#fff') | ||||
|     } | ||||
|     .height('100%') | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
| 
 | ||||
|     const judge = new Judge(this) | ||||
|   } | ||||
| 
 | ||||
|   aboutToDisappear() { | ||||
|     //apiJudgeSdk.stopRender(); | ||||
| 
 | ||||
|   } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| export default RealTime | ||||
| @ -1,25 +0,0 @@ | ||||
| 
 | ||||
| @Component | ||||
| export default struct EndPopup { | ||||
|   constructor() { | ||||
|     super() | ||||
|   } | ||||
| 
 | ||||
|   private title:string = '' | ||||
|   private cancelFn:(event?: ClickEvent) => void | ||||
|   private confirmFn:(event?: ClickEvent) => void | ||||
| 
 | ||||
|   build(){ | ||||
|     Column(){ | ||||
|       Column(){ | ||||
|         Text(this.title).fontSize(38).margin({bottom:20}) | ||||
|         Row(){}.height(50) | ||||
|         Row(){ | ||||
|           Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) | ||||
|           Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(100).fontSize(30).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) | ||||
|         } | ||||
|       }.width('80%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'10%'}).justifyContent(FlexAlign.Center) | ||||
| 
 | ||||
|     }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') | ||||
|   } | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user