فهرست منبع

feat: 完成 《成绩》 《课程表》 下的静态UI 和 交互

YuJing 1 ماه پیش
والد
کامیت
42adc20480

+ 4 - 2
commons/basic/src/main/ets/models/YTDiaLogModel.ets

@@ -18,8 +18,10 @@ export enum DiaLogPageEnum{
   // 底部菜单
   BottomMenu,
 
-  // 添加座位表
-  AddSeatTable,
+  // 添加信息 - 文字、日期、分数
+  InputInfomation,
+  // 录入成绩
+  InputScore,
 }
 
 export interface DiaLogParam<T = ESObject>{

+ 212 - 34
features/feature/src/main/ets/components/YtComp/YTDiaLogBuild.ets

@@ -1,6 +1,6 @@
 import { BasicType, DateFormat, IBestToast, YTDateUtil, yTRouter } from 'basic'
 import { DiaLogPageEnum, DiaLogParam } from 'basic/src/main/ets/models/YTDiaLogModel'
-import { AddSeatTablePageModel } from '../../model/RouterModel'
+import { InputDiaLogParams } from '../../model/RouterModel'
 import { NumberKeyBoard, NumberKeyBoardStyle } from './NumberKeyboard'
 import { YtDatePicker } from './YtDatePicker'
 import { _YtHeader } from './_YtHeader'
@@ -15,8 +15,8 @@ export function getBuilder(param: DiaLogParam, onBack: (ans?: string) => void){
   else if (param.pageEnum == DiaLogPageEnum.TextInput) InputComp({onBack: onBack, param: param.param})
 
   /********  额外的   ***********/
-  else if (param.pageEnum == DiaLogPageEnum.AddSeatTable) AddSeatTableComp({onBack: onBack, param: param.param})
-
+  else if (param.pageEnum == DiaLogPageEnum.InputInfomation) AddSeatTableComp({onBack: onBack, param: param.param})
+  else if (param.pageEnum == DiaLogPageEnum.InputScore) InputScore({onBack: onBack, param: param.param})
 }
 
 // 底部菜单
@@ -275,12 +275,17 @@ struct InputComp{
 @ComponentV2
 struct AddSeatTableComp{
   @Event onBack: (ans?:string) => void
-  @Param @Require param: BasicType<AddSeatTablePageModel>
+  @Param @Require param: BasicType<InputDiaLogParams>
 
   // 选择开始时间
   @Local startTime: string = ''
   @Local endTime: string = ''
   @Local name: string = ''
+  @Local type: number = 0
+  @Local message: string = ''
+  @Local text: string = ''
+
+  @Local lineColor: ResourceColor = '#ECECEC'
 
   selectTime(isStart: boolean = true){
     yTRouter.router2DatePickerDiaLog(isStart ? this.startTime : this.endTime, '#7186F9', (res)=>{
@@ -300,11 +305,14 @@ struct AddSeatTableComp{
     this.startTime = this.param.generics?.startDate ?? now
     this.endTime = this.param.generics?.endDate ?? now
     this.name = this.param.generics?.name ?? ''
+    this.type = this.param.generics?.type ?? 0
+    this.message = this.param.message ?? ''
+    this.text = this.param.text ?? ''
   }
 
   build() {
     Column({space: 30}) {
-      Text('添加座位表')
+      Text(this.text)
         .fontColor(Color.Black)
         .fontSize(20)
         .lineHeight(18)
@@ -317,45 +325,48 @@ struct AddSeatTableComp{
             .fontSize(18)
             .fontWeight(500)
 
-          TextInput({placeholder: '请输入座位表名称', text: $$this.name})
+          TextInput({placeholder: this.message, text: $$this.name})
             .padding(0)
             .layoutWeight(1)
             .borderRadius(0)
             .backgroundColor(Color.Transparent)
-            .border({ width: {bottom: 1.5}, color: '#ECECEC' })
+            .border({ width: {bottom: 1.5}, color: this.lineColor })
+            .onChange(() => { this.lineColor = '#ECECEC' })
         }
         .width("100%")
         .padding({right: 15})
         .justifyContent(FlexAlign.SpaceBetween)
 
-        Row({space: 25}){
-          Text('日  期')
-            .fontSize(18)
-            .fontWeight(500)
-
-          Row(){
-            Text(this.startTime)
-              .borderRadius(8)
-              .border({width: 1, color: '#ECECEC'})
-              .padding({left: 9, top: 5, right: 9, bottom: 5})
-              .onClick(() => { this.selectTime(true) })
-
-            Divider()
-              .width(13)
-              .height(1.5)
-              .backgroundColor(this.param.color)
-
-            Text(this.endTime)
-              .borderRadius(8)
-              .border({width: 1, color: '#ECECEC'})
-              .padding({left: 9, top: 5, right: 9, bottom: 5})
-              .onClick(() => { this.selectTime(false) })
+        if(this.type == 1) {
+          Row({space: 25}){
+            Text('日  期')
+              .fontSize(18)
+              .fontWeight(500)
+
+            Row(){
+              Text(this.startTime)
+                .borderRadius(8)
+                .border({width: 1, color: '#ECECEC'})
+                .padding({left: 9, top: 5, right: 9, bottom: 5})
+                .onClick(() => { this.selectTime(true) })
+
+              Divider()
+                .width(13)
+                .height(1.5)
+                .backgroundColor(this.param.color)
+
+              Text(this.endTime)
+                .borderRadius(8)
+                .border({width: 1, color: '#ECECEC'})
+                .padding({left: 9, top: 5, right: 9, bottom: 5})
+                .onClick(() => { this.selectTime(false) })
+            }
+            .alignItems(VerticalAlign.Center)
+            .layoutWeight(1)
           }
-          .alignItems(VerticalAlign.Center)
-          .layoutWeight(1)
+          .width("100%")
+          .justifyContent(FlexAlign.SpaceBetween)
         }
-        .width("100%")
-        .justifyContent(FlexAlign.SpaceBetween)
       }
 
       // 确定 和 取消
@@ -382,7 +393,12 @@ struct AddSeatTableComp{
             angle: 200
           })
           .onClick(() => {
-            let ans: AddSeatTablePageModel = {
+            if(!this.name){
+              this.lineColor = Color.Red
+              return
+            }
+
+            let ans: InputDiaLogParams = {
               name: this.name,
               startDate: this.startTime,
               endDate: this.endTime
@@ -401,7 +417,169 @@ struct AddSeatTableComp{
 }
 
 
+// 录入成绩
+@ComponentV2
+struct InputScore{
+  @Event onBack: (ans?:string) => void
+  @Param @Require param: BasicType<InputDiaLogParams>
+
+  // 选择开始时间
+  @Local name: string = ''
+  @Local score: string = ''
+  @Local message: string = ''
+  @Local text: string = ''
+  @Local nameList: string[] = new Array(15).fill('刘鸥')
+
+  // 下划线颜色
+  @Local nameLineColor: ResourceColor = '#ECECEC'
+  @Local scoreLineColor: ResourceColor = '#ECECEC'
+
+  updateCuisine(name: string) {
+    this.nameLineColor = '#ECECEC'
+    this.name = name
+  }
+
+  // 点击确认按钮
+  _onConfirm() {
+    if(!this.name){
+      this.nameLineColor = Color.Red
+      return
+    }
+    if(!this.score){
+      this.scoreLineColor = Color.Red
+      return
+    }
+
+    let ans: InputDiaLogParams = {
+      name: this.name,
+      score: Number.parseFloat(this.score) ?? 0
+    }
+    this.onBack(JSON.stringify(ans))
+  }
+
+
+  aboutToAppear(): void {
+    this.name = this.param.generics?.name ?? ''
+    this.score = `${this.param.generics?.score ?? 0}`
+    this.message = this.param.message ?? ''
+    this.text = this.param.text ?? ''
+  }
+
+  build() {
+    Column({space: 30}) {
+      Text(this.text)
+        .fontColor(Color.Black)
+        .fontSize(20)
+        .lineHeight(18)
+        .fontWeight(500)
+        .textAlign(TextAlign.Center)
+
+      Column({space: 15}){
+        Row({space: 25}){
+          Text('姓 名')
+            .fontSize(18)
+            .fontWeight(500)
+
+          Row(){
+            Text() {
+              if(this.name) {
+                Span(this.name)
+              } else {
+                Span('请输入姓名')
+                  .fontSize(16)
+                  .fontColor('rgba(0, 0, 0, 0.6)')
+                  .fontWeight(300)
+              }
+            }
+
+            Image($r('[basic].media.ic_back'))
+              .width(20)
+              .aspectRatio(1)
+              .rotate({angle: 270})
+          }
+          .layoutWeight(1)
+          .justifyContent(FlexAlign.SpaceBetween)
+          .border({ width: {bottom: 1.5}, color: this.nameLineColor })
+          .bindMenu(this.NameEnum)
+        }
+        .width("100%")
+        .padding({right: 15})
+        .justifyContent(FlexAlign.SpaceBetween)
+
+        Row({space: 25}){
+          Text('总 分')
+            .fontSize(18)
+            .fontWeight(500)
+
+          TextInput({placeholder: this.message, text: $$this.score})
+            .padding(0)
+            .layoutWeight(1)
+            .borderRadius(0)
+            .type(InputType.NUMBER_DECIMAL)
+            .backgroundColor(Color.Transparent)
+            .onChange(() => { this.scoreLineColor = '#ECECEC' })
+            .border({ width: {bottom: 1.5}, color: this.scoreLineColor })
+        }
+        .width("100%")
+        .padding({right: 15})
+        .justifyContent(FlexAlign.SpaceBetween)
+      }
+
+      // 确定 和 取消
+      Row() {
+        Text('取消')
+          .fontSize(16)
+          .fontWeight(400)
+          .borderRadius(this.param?.number ?? 36)
+          .fontColor(Color.Black)
+          .backgroundColor('#F5F5F7')
+          .padding({ left: 36, top: 9, right: 36, bottom: 9})
+          .onClick(() => {
+            this.onBack()
+          })
 
+        Text('确定')
+          .fontSize(16)
+          .fontWeight(400)
+          .borderRadius(this.param?.number ?? 36)
+          .fontColor(Color.Black)
+          .padding({ left: 36, top: 9, right: 36, bottom: 9})
+          .linearGradient({
+            colors: [ this.param?.color ? [this.param.color, 1 ] : ['#30E3CE', 0.4], ['#91F1FF', 0.8] ],
+            angle: 200
+          })
+          .onClick(() => {
+            this._onConfirm()
+          })
+      }
+      .justifyContent(FlexAlign.SpaceBetween)
+      .width('100%')
+    }
+    .width(335)
+    .padding(16)
+    .borderRadius(8)
+    .backgroundColor(Color.White)
+  }
+
+  @Builder NameEnum(){
+    Scroll(){
+      Column(){
+        ForEach(this.nameList, (item:string, index: number) => {
+          Text(`${item}-${index}`)
+            .fontSize(14)
+            .width("100%")
+            .fontWeight(400)
+            .textAlign(TextAlign.Center)
+            .padding({left: 12, right: 12, top: 8, bottom: 8})
+            .backgroundColor(item == this.name ? '#F3F3F3' : '#FFFFFF')
+            .onClick(() => {  this.updateCuisine(item) } )
+        })
+      }
+    }
+    .width(105)
+    .height(250)
+  }
+}
 
 
 

+ 13 - 3
features/feature/src/main/ets/model/RouterModel.ets

@@ -3,9 +3,19 @@ export interface IncreaseStudentPageModel{
   id?: string
 }
 
-// 添加座位表弹窗参数
-export interface AddSeatTablePageModel{
+// 可填写信息弹窗的路由参数
+export interface InputDiaLogParams{
   name?: string
   startDate?: string
   endDate?: string
-}
+  // 分数
+  score?: number
+  // 弹窗类型 0-仅输入名称 1-输入名称和日期 2-输入名称和分数
+  type?: number
+}
+
+// 录入成绩页面路由参数
+export interface IncreaseScorePageModel{
+  id?: string
+  name?: string
+}

+ 183 - 0
features/feature/src/main/ets/pages/IncreaseScorePage.ets

@@ -0,0 +1,183 @@
+import { EmptyComp } from '../components/EmptyComp';
+import { _YtHeader } from '../components/YtComp/_YtHeader';
+import { IncreaseScorePageViewModel } from '../viewModel/IncreaseScorePageViewModel';
+
+// 录入成绩
+@ComponentV2
+struct IncreaseScorePage {
+  @Local vm: IncreaseScorePageViewModel = new IncreaseScorePageViewModel();
+
+  build() {
+    NavDestination() {
+      Column({space: 24}) {
+        _YtHeader({
+          title: `录入`,
+          _onBackPress: () => { this.vm._onBackPressed() },
+          rightComp: () => { this.rightComp() },
+          _padding: 10,
+          _h: 60
+        })
+
+        Column(){
+          Row(){
+            Column({space: 23}){
+              Text('平均分')
+                .fontSize(18)
+
+              Text('0')
+                .fontSize(25)
+                .fontColor('#5668FC')
+            }
+            .width(90)
+            .height(115)
+            .borderRadius(15)
+            .backgroundColor('#FFFFFFFF')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.Center)
+            .shadow({ radius: 6, color: '#1a000000'})
+
+            Column({space: 23}){
+              Text('最高分')
+                .fontSize(18)
+
+              Text('0')
+                .fontSize(25)
+                .fontColor('#5668FC')
+            }
+            .width(90)
+            .height(115)
+            .borderRadius(15)
+            .backgroundColor('#FFFFFFFF')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.Center)
+            .shadow({ radius: 6, color: '#1a000000'})
+
+            Column({space: 23}){
+              Text('最低分')
+                .fontSize(18)
+
+              Text('0')
+                .fontSize(25)
+                .fontColor('#5668FC')
+            }
+            .width(90)
+            .height(115)
+            .borderRadius(15)
+            .backgroundColor('#FFFFFFFF')
+            .justifyContent(FlexAlign.Center)
+            .alignItems(HorizontalAlign.Center)
+            .shadow({ radius: 6, color: '#1a000000'})
+          }
+          .width("100%")
+          .justifyContent(FlexAlign.SpaceBetween)
+
+          Row(){
+            Text(){
+              Span('0')
+              Span(' 人')
+                .fontColor('#FF5668FC')
+            }
+          }
+          .width("100%")
+          .padding({top: 22, bottom: 15})
+          .justifyContent(FlexAlign.Center)
+
+          Column(){
+            EmptyComp({isEmpty: false}){
+              List({space: 16}){
+                ForEach(new Array(20).fill(10), (item: number, index: number) => {
+                  ListItem(){
+                    Row({space: 22}){
+                      Image(item == 1 ? $r('app.media.img_BoyHead') : $r('app.media.img_GirHead'))
+                        .width(52)
+                        .aspectRatio(1)
+
+                      Text('李明 - ' +  (item == 1 ? '男' : '女'))
+                        .fontSize(14)
+                        .fontWeight(400)
+
+                      Text('99')
+                    }
+                    .width("97%")
+                    .borderRadius(15)
+                    .margin({left: 3})
+                    .backgroundColor(Color.White)
+                    .justifyContent(FlexAlign.Start)
+                    .alignItems(VerticalAlign.Center)
+                    .shadow({ radius: 6, color: '#1a000000' })
+                    .padding({left: 12, top: 9, right: 12, bottom: 9})
+                  }
+                  .align(Alignment.Center)
+                  .swipeAction({
+                    end: () => { this.swiperAction(index) }
+                  })
+                })
+              }
+              .width("100%")
+              .height("100%")
+              .scrollBar(BarState.Off)
+            }
+          }
+          .width('100%')
+          .layoutWeight(1)
+        }
+        .width("100%")
+        .layoutWeight(1)
+        .padding({left: 16, right: 16, bottom: 24})
+      }
+      .width('100%')
+      .height('100%')
+      .justifyContent(FlexAlign.Center)
+      .alignItems(HorizontalAlign.Center)
+    }
+    .hideTitleBar(true)
+    .backgroundColor('#FAFAFA')
+    .padding({ top: this.vm.safeTop })
+  }
+
+  @Builder rightComp(){
+    Text('添加')
+      .fontSize(18)
+      .fontWeight(500)
+      .borderRadius(8)
+      .fontColor(Color.White)
+      .backgroundColor(Color.Black)
+      .padding({left: 15, top: 7, right: 15, bottom: 7})
+      .onClick(() => { this.vm._onAddScore() })
+  }
+
+  @Builder
+  swiperAction(index: number){
+    Row(){
+      Row(){
+        Image($r('app.media.icon_edit'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#BFBFBF')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .padding({ left: 18, top: 23, right: 18, bottom: 23 })
+      .onClick(() => { this.vm._onEditScore() })
+
+      Row(){
+        Image($r('app.media.icon_del'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#FF3B30')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .borderRadius({topRight: 15, bottomRight: 15})
+      .padding({ left: 18, top: 23, right: 18, bottom: 23 })
+      .onClick(() => { this.vm._onDeleteScore() })
+    }
+    .borderRadius({topRight: 15, bottomRight: 15})
+  }
+
+}
+
+@Builder
+function IncreaseScorePageBuilder() {
+  IncreaseScorePage()
+}

+ 1 - 0
features/feature/src/main/ets/pages/IncreaseStudentPage.ets

@@ -2,6 +2,7 @@ import { _YtHeader } from '../components/YtComp/_YtHeader';
 import { IncreaseStudentPageViewModel } from '../viewModel/IncreaseStudentPage';
 import { cert } from '@kit.DeviceCertificateKit';
 
+// 添加学生信息页面
 @ComponentV2
 struct IncreaseStudentPage {
   @Local vm: IncreaseStudentPageViewModel = new IncreaseStudentPageViewModel();

+ 2 - 4
features/feature/src/main/ets/pages/SeatingPlanPage.ets

@@ -1,15 +1,13 @@
 import { SeatingPlanPageViewModel } from '../viewModel/SeatingPlanPageViewModel';
 import { window } from '@kit.ArkUI';
 
+// 座位表页面
 @ComponentV2
 struct SeatingPlanPage {
   @Local vm: SeatingPlanPageViewModel = new SeatingPlanPageViewModel(this.getUIContext());
 
   aboutToAppear() {
-    window.getLastWindow(this.getUIContext().getHostContext())
-      .then(res => {
-        res.setPreferredOrientation(window.Orientation.LANDSCAPE)
-      })
+
   }
 
   aboutToDisappear(): void {

+ 27 - 4
features/feature/src/main/ets/utils/RouterUtils.ets

@@ -1,12 +1,14 @@
 import { BasicType, yTRouter } from "basic"
 import { DiaLogPageEnum, DiaLogParam, YTDiaLogModel } from "basic/src/main/ets/models/YTDiaLogModel"
-import { AddSeatTablePageModel, IncreaseStudentPageModel } from "../model/RouterModel"
+import { InputDiaLogParams, IncreaseStudentPageModel, IncreaseScorePageModel } from "../model/RouterModel"
 
 class RouterUtils{
+  // 主页面 - app 第一次的启动页
   router2MainPage(param: ESObject, back: Callback<PopInfo>){
     yTRouter.pushPathByName('Mainpage', param, back)
   }
 
+  // 我的页面 - 介绍 app 信息页
   router2MinePage(param: ESObject, back: Callback<PopInfo>){
     yTRouter.pushPathByName('MinePage', param, back)
   }
@@ -20,16 +22,37 @@ class RouterUtils{
     return yTRouter.getParamByName('IncreaseStudentPage').pop() as IncreaseStudentPageModel
   }
 
+  // 座位表页面
   router2SeatingPlanPage(param: ESObject, back: Callback<PopInfo>){
     yTRouter.pushPathByName('SeatingPlanPage', param, back)
   }
 
+  // 录入成绩页面
+  router2IncreaseScorePage(param: IncreaseScorePageModel, back: Callback<PopInfo>){
+    yTRouter.pushPathByName('IncreaseScorePage', param, back)
+  }
+
+  getIncreaseScorePageParam(): IncreaseScorePageModel{
+    return yTRouter.getParamByName('IncreaseScorePage').pop() as IncreaseScorePageModel
+  }
+
 
   // DiaLog
+  // 录入信息弹窗
   // 添加座位表弹窗
-  router2AddSeatTableDialog(param: BasicType<AddSeatTablePageModel>, back: Callback<PopInfo>){
-    let p: DiaLogParam<AddSeatTablePageModel> = {
-      pageEnum: DiaLogPageEnum.AddSeatTable,
+  router2InputDialog(param: BasicType<InputDiaLogParams>, back: Callback<PopInfo>){
+    let p: DiaLogParam<InputDiaLogParams> = {
+      pageEnum: DiaLogPageEnum.InputInfomation,
+      param: param,
+      align: YTDiaLogModel.Center
+    }
+    yTRouter.router2NaviDiaLog(p, back)
+  }
+
+  // 录入成绩弹窗
+  router2InputScoreDialog(param: BasicType<InputDiaLogParams>, back: Callback<PopInfo>){
+    let p: DiaLogParam<InputDiaLogParams> = {
+      pageEnum: DiaLogPageEnum.InputScore,
       param: param,
       align: YTDiaLogModel.Center
     }

+ 94 - 1
features/feature/src/main/ets/view/FiveView.ets

@@ -1,6 +1,99 @@
-@Component
+import { EmptyComp } from "../components/EmptyComp"
+import { FiveViewModel } from "../viewModel/FiveViewModel"
+
+@ComponentV2
 export struct FiveView {
+  @Local vm: FiveViewModel = new FiveViewModel()
+
   build() {
+    Column(){
+      Row(){
+        Text('课程表')
+          .fontSize(24)
+          .fontWeight(600)
+          .fontColor('#333333')
+        Text('添加')
+          .fontSize(18)
+          .fontWeight(500)
+          .borderRadius(8)
+          .fontColor(Color.White)
+          .backgroundColor(Color.Black)
+          .padding({left: 15, top: 7, right: 15, bottom: 7})
+          .onClick(() => { this.vm._onAddTestScore() })
+      }
+      .width("100%")
+      .justifyContent(FlexAlign.SpaceBetween)
+
+      Column(){
+        EmptyComp({ isEmpty: this.vm.dataSource.length == 0 }){
+          List({space: 16}){
+            ForEach(this.vm.dataSource, (item: string, index) => {
+              ListItem(){
+                Column({space: 5}){
+                  Text(item)
+                    .fontSize(20)
+                    .fontWeight(500)
+                }
+                .width("97%")
+                .borderRadius(15)
+                .margin({left: 3})
+                .justifyContent(FlexAlign.Start)
+                .alignItems(HorizontalAlign.Start)
+                .backgroundImageSize(ImageSize.Cover)
+                .backgroundImage($r('app.media.seatBg'))
+                .shadow({ radius: 6, color: '#1a000000' })
+                .padding({left: 12, top: 20, right: 12, bottom: 20})
+              }
+              .align(Alignment.Center)
+              .swipeAction({
+                end: () => { this.swiperAction(index) }
+              })
+              .onClick(() => { this.vm._onLookScore() })
+            })
+          }
+          .width("100%")
+          .height("100%")
+          .padding({top: 16, bottom: 16})
+          .scrollBar(BarState.Off)
+        }
+      }
+      .width('100%')
+      .layoutWeight(1)
+    }
+    .width('100%')
+    .height('100%')
+    .alignItems(HorizontalAlign.Center)
+    .justifyContent(FlexAlign.Start)
+    .padding({top: this.vm.safeTop, left: 16, right: 16})
+  }
+
+  @Builder
+  swiperAction(index: number){
+    Row(){
+      Row(){
+        Image($r('app.media.icon_edit'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#BFBFBF')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .padding({ left: 18, top: 30, right: 18, bottom: 30 })
+      .onClick(() => { this.vm._onEditTestScore() })
 
+      Row(){
+        Image($r('app.media.icon_del'))
+          .width(25)
+          .aspectRatio(1)
+      }
+      .backgroundColor('#FF3B30')
+      .alignItems(VerticalAlign.Center)
+      .justifyContent(FlexAlign.Center)
+      .borderRadius({topRight: 15, bottomRight: 15})
+      .padding({ left: 18, top: 30, right: 18, bottom: 30 })
+      .onClick(() => { this.vm._onDeleteTestScore() })
+    }
+    .borderRadius({topRight: 15, bottomRight: 15})
   }
+
 }

+ 5 - 4
features/feature/src/main/ets/view/FourView.ets

@@ -8,7 +8,7 @@ export struct FourView {
   build() {
     Column(){
       Row(){
-        Text('座位表')
+        Text('成绩单')
           .fontSize(24)
           .fontWeight(600)
           .fontColor('#333333')
@@ -19,7 +19,7 @@ export struct FourView {
           .fontColor(Color.White)
           .backgroundColor(Color.Black)
           .padding({left: 15, top: 7, right: 15, bottom: 7})
-          .onClick(() => { this.vm._onAddSeatTable() })
+          .onClick(() => { this.vm._onAddTestScore() })
       }
       .width("100%")
       .justifyContent(FlexAlign.SpaceBetween)
@@ -52,6 +52,7 @@ export struct FourView {
               .swipeAction({
                 end: () => { this.swiperAction(index) }
               })
+              .onClick(() => { this.vm._onLookScore() })
             })
           }
           .width("100%")
@@ -82,7 +83,7 @@ export struct FourView {
       .alignItems(VerticalAlign.Center)
       .justifyContent(FlexAlign.Center)
       .padding({ left: 18, top: 30, right: 18, bottom: 30 })
-      .onClick(() => { this.vm._onEditSeatTable() })
+      .onClick(() => { this.vm._onEditTestScore() })
 
       Row(){
         Image($r('app.media.icon_del'))
@@ -94,7 +95,7 @@ export struct FourView {
       .justifyContent(FlexAlign.Center)
       .borderRadius({topRight: 15, bottomRight: 15})
       .padding({ left: 18, top: 30, right: 18, bottom: 30 })
-      .onClick(() => { this.vm._onDeleteSeatTable() })
+      .onClick(() => { this.vm._onDeleteTestScore() })
     }
     .borderRadius({topRight: 15, bottomRight: 15})
   }

+ 75 - 0
features/feature/src/main/ets/viewModel/FiveViewModel.ets

@@ -0,0 +1,75 @@
+import { YTAvoid, yTRouter } from "basic"
+import { InputDiaLogParams } from "../model/RouterModel"
+import { iRouter } from "../utils/RouterUtils"
+
+@ObservedV2
+export class FiveViewModel{
+
+  @Trace safeTop: number = 0
+  @Trace dataSource: string[] = new Array(15).fill('语文课程表')
+
+  constructor() {
+    this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
+  }
+
+  // 查看课程表
+  _onLookScore() {
+
+  }
+
+  // 添加课程表
+  _onAddTestScore() {
+    iRouter.router2InputDialog({
+      color: '#5668FC',
+      message: '请输入课程表',
+      text: '添加课程表',
+      generics: {
+        type: 0
+      }
+    }, (res) => {
+      let ans = res.result as InputDiaLogParams
+      if(ans) {
+        iRouter.router2IncreaseScorePage({ name: '课程表1' }, () => {
+
+        })
+      }
+    })
+  }
+
+  // 删除课程表
+  _onDeleteTestScore() {
+    yTRouter.router2DoubleConfirmDiaLog({
+      text: '是否确认删除?',
+      color: '#7186F9'
+    }, (res) => {
+      if (res?.result && res.result == 'true') {
+
+      }
+    })
+  }
+
+  // 编辑 课程表信息
+  _onEditTestScore() {
+    iRouter.router2InputDialog({
+      color: '#5668FC',
+      message: '请输入课程表',
+      text: '编辑课程表',
+      generics: {
+        name: '课程表1',
+        startDate: '2025.11.10',
+        endDate: '2025.9.19',
+        type: 0
+      }
+    }, () => {
+
+    })
+  }
+  /**
+   * 重写的返回逻辑
+   * @returns
+   */
+  _onBackPressed(){
+    yTRouter.pop('')
+    return true;
+  }
+}

+ 33 - 10
features/feature/src/main/ets/viewModel/FourViewModel.ets

@@ -1,25 +1,45 @@
 import { YTAvoid, yTRouter } from "basic"
+import { InputDiaLogParams } from "../model/RouterModel"
 import { iRouter } from "../utils/RouterUtils"
 
 @ObservedV2
 export class FourViewModel{
 
   @Trace safeTop: number = 0
-  @Trace dataSource: string[] = new Array(15).fill('第二次月考座位表')
+  @Trace dataSource: string[] = new Array(15).fill('开学测验成绩')
 
   constructor() {
     this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
   }
 
-  // 添加座位表
-  _onAddSeatTable() {
-    iRouter.router2SeatingPlanPage({}, () => {
+  // 查看成绩单
+  _onLookScore() {
+    iRouter.router2IncreaseScorePage({ name: '成绩单1' }, () => {
 
     })
   }
 
-  // 删除
-  _onDeleteSeatTable() {
+  // 添加成绩表
+  _onAddTestScore() {
+    iRouter.router2InputDialog({
+      color: '#5668FC',
+      message: '请输入成绩单',
+      text: '添加座位表',
+      generics: {
+        type: 0
+      }
+    }, (res) => {
+      let ans = res.result as InputDiaLogParams
+      if(ans) {
+        iRouter.router2IncreaseScorePage({ name: '成绩单1' }, () => {
+
+        })
+      }
+    })
+  }
+
+  // 删除成绩单
+  _onDeleteTestScore() {
     yTRouter.router2DoubleConfirmDiaLog({
       text: '是否确认删除?',
       color: '#7186F9'
@@ -30,14 +50,17 @@ export class FourViewModel{
     })
   }
 
-  // 编辑 座位表信息
-  _onEditSeatTable() {
-    iRouter.router2AddSeatTableDialog({
+  // 编辑 成绩单信息
+  _onEditTestScore() {
+    iRouter.router2InputDialog({
       color: '#5668FC',
+      message: '请输入成绩单',
+      text: '编辑座位表',
       generics: {
         name: '座位表1',
         startDate: '2025.11.10',
-        endDate: '2025.9.19'
+        endDate: '2025.9.19',
+        type: 0
       }
     }, () => {
 

+ 73 - 0
features/feature/src/main/ets/viewModel/IncreaseScorePageViewModel.ets

@@ -0,0 +1,73 @@
+import { BasicType, YTAvoid, yTRouter } from "basic"
+import { InputDiaLogParams } from "../model/RouterModel"
+import { iRouter } from "../utils/RouterUtils"
+
+@ObservedV2
+export class IncreaseScorePageViewModel{
+  @Trace safeTop: number = 0
+  @Trace title: string = ''
+
+  constructor() {
+    this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
+
+    let ans = iRouter.getIncreaseScorePageParam()
+    this.title = ans?.name || ''
+  }
+
+  // 添加成绩
+  _onAddScore() {
+    let _p: BasicType<InputDiaLogParams> = {
+      text: '添加成绩',
+      message: "请输入成绩" ,
+      color: '#5668FC',
+      generics: {
+      }
+    }
+    iRouter.router2InputScoreDialog(_p, (ans) => {
+      let res = ans.result as InputDiaLogParams
+      if(res) {
+        console.log(`res = ${JSON.stringify(res)}`)
+      }
+    })
+  }
+
+  // 编辑成绩
+  _onEditScore() {
+    let _p: BasicType<InputDiaLogParams> = {
+      text: '添加成绩',
+      message: "请输入成绩" ,
+      color: '#5668FC',
+      generics: {
+        name: "张三",
+        score: 99.9
+      }
+    }
+    iRouter.router2InputScoreDialog(_p, (ans) => {
+      let res = ans.result as InputDiaLogParams
+      if(res) {
+        console.log(`res = ${JSON.stringify(res)}`)
+      }
+    })
+  }
+
+  // 删除成绩
+  _onDeleteScore() {
+    yTRouter.router2DoubleConfirmDiaLog({
+      text: '是否确认删除该成绩?',
+      color: '#7186F9'
+    }, (res) => {
+      if (res?.result && res.result == 'true') {
+
+      }
+    })
+  }
+
+  /**
+   * 重写的返回逻辑
+   * @returns
+   */
+  _onBackPressed(){
+    yTRouter.pop('')
+    return true;
+  }
+}

+ 5 - 0
features/feature/src/main/ets/viewModel/SeatingPlanPageViewModel.ets

@@ -14,6 +14,11 @@ export class SeatingPlanPageViewModel{
   constructor(conText: UIContext) {
     this.safeTop = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number
     this.conText = conText
+
+    window.getLastWindow(this.conText.getHostContext())
+      .then(res => {
+        res.setPreferredOrientation(window.Orientation.LANDSCAPE)
+      })
   }
 
   

+ 11 - 4
features/feature/src/main/ets/viewModel/SecondViewModel.ets

@@ -1,4 +1,5 @@
 import { YTAvoid, yTRouter } from "basic"
+import { InputDiaLogParams } from "../model/RouterModel"
 import { iRouter } from "../utils/RouterUtils"
 
 @ObservedV2
@@ -32,15 +33,21 @@ export class SecondViewModel{
 
   // 编辑 座位表信息
   _onEditSeatTable() {
-    iRouter.router2AddSeatTableDialog({
+    iRouter.router2InputDialog({
       color: '#5668FC',
+      message: '请输入座位表',
+      text: '添加座位表',
       generics: {
         name: '座位表1',
         startDate: '2025.11.10',
-        endDate: '2025.9.19'
+        endDate: '2025.9.19',
+        type: 1
+      }
+    }, (res) => {
+      let ans = res?.result as InputDiaLogParams
+      if (ans) {
+        console.log('ans: ', JSON.stringify(ans))
       }
-    }, () => {
-
     })
   }
   /**

+ 4 - 0
features/feature/src/main/resources/base/profile/router_map.json

@@ -24,6 +24,10 @@
       "name": "SeatingPlanPage",
       "pageSourceFile": "src/main/ets/pages/SeatingPlanPage.ets",
       "buildFunction": "SeatingPlanPageBuilder"
+    }, {
+      "name": "IncreaseScorePage",
+      "pageSourceFile": "src/main/ets/pages/IncreaseScorePage.ets",
+      "buildFunction": "IncreaseScorePageBuilder"
     }
   ]
 }