Learn.VideoAnalysis/VideoAnalysis/Components/Pages/EvaluationProject.razor

88 lines
3.8 KiB
Plaintext

@page "/Project"
@using AntDesign
@using AntDesign.TableModels
@using System.ComponentModel.DataAnnotations
@using SqlSugar
@using VideoAnalysisCore.Model
@using UserCenter.Model.Enum
<Table @ref="_table" Loading="tableLoading" TItem="CourseGradingCriteria" ScrollY="600px"
PageSize="20" Total="_total" DataSource="_dataSource" @bind-SelectedRows="_selectedRows" OnChange="OnChange">
<TitleTemplate>
<Flex Justify="end" Gap="10">
<Button Type="primary" @onclick="()=> StartEdit()">编辑</Button>
</Flex>
</TitleTemplate>
<ColumnDefinitions Context="row">
<PropertyColumn Property="c=>c.Id" Width="130px" Filterable="true" Sortable="true" />
<PropertyColumn Property="c=>c.Subject" Filterable="true" Width="130px" />
<PropertyColumn Property="c=>c.TotalScore" Width="130px" />
<PropertyColumn Property="c=>c.PassScore" Width="130px" />
<PropertyColumn Property="c=>c.NamePrompt" />
</ColumnDefinitions>
</Table>
@{
RenderFragment modelfooter = @<Template>
<Button OnClick="@EditOnOkAsync" @key="@( "submit" )"
Type="primary"
Loading="@modalBtnLoading">
提交
</Button>
<Button OnClick="()=>modalShow = false" @key="@( "back" )">取消</Button>
</Template>;
}
<Modal Title="@("编辑学科课堂指标")" Visible="modalShow" Width="650"
Footer="@modelfooter">
<Form @ref="form" Model="rowData" LabelAlign="AntLabelAlignType.Left">
<GridRow>
<GridCol Span="24">
<FormItem Label="学科指标">
<div style="display:flex;">
<EnumSelect TEnum="SubjectEnum" @bind-Value="editSubject" AllowClear />
<Button OnClick="SubjectEnumSelect" Type="primary" Icon="@IconType.Outline.Search">
查询
</Button>
</div>
</FormItem>
</GridCol>
<GridCol Span="12">
<FormItem Label="满分分值">
<AntDesign.InputNumber Precision="1" @bind-Value="context.TotalScore" Min="1" Max="100" DefaultValue="10" PlaceHolder="满分分值" />
</FormItem>
</GridCol>
<GridCol Span="12">
<FormItem Label="及格分值">
<AntDesign.InputNumber Precision="1" @bind-Value="context.PassScore" Min="1" Max="@context.TotalScore"
DefaultValue="6" PlaceHolder="及格分值" />
</FormItem>
</GridCol>
<GridCol Span="24">
<FormItem Label="标准提问词">
<TextArea Rows="2" @bind-Value="@context.NamePrompt" />
</FormItem>
</GridCol>
<GridCol Span="24">
<FormItem Label="学科提示词" Rules="[new(){ Min=1 }]">
<Button OnClick="EditAddRow" Type="primary" Style="margin-bottom:16px" Size="small">
添加
</Button>
<Table PaginationPosition="none" @ref="tableRef" ScrollY="350px" PageSize="20"DataSource="_editSource" TItem="CourseGradingCriteria" Context="row" Size="TableSize.Small">
<ActionColumn Width="80px">
<Button Type="@ButtonType.Text" Danger @onclick="() => _editSource.Remove(row)">删除</Button>
</ActionColumn>
<PropertyColumn Width="50px" Property="c=>c.TotalScore" />
<PropertyColumn Width="50px" Property="c=>c.PassScore" />
<PropertyColumn Property="c=>c.NamePrompt" />
</Table>
</FormItem>
</GridCol>
</GridRow>
</Form>
</Modal>
@code
{
}