add qa 参数

This commit is contained in:
zeyu xu
2024-04-15 21:30:06 +08:00
parent 79326de263
commit 559661bb6c
4 changed files with 37 additions and 10 deletions

View File

@@ -17,11 +17,14 @@ namespace AntSK.Domain.Domain.Model
public string FilePath { get; set; } = "";
public string FileName { get; set; } = "";
public bool IsQA { get; set; } = false;
}
public class ImportKMSTaskReq : ImportKMSTaskDTO
{
public bool IsQA { get; set; }=false;
public KmsDetails KmsDetail { get; set; } = new KmsDetails();
}

View File

@@ -47,6 +47,7 @@ namespace AntSK.Controllers
await _kmsDetailsRepositories.InsertAsync(detail);
req.KmsDetail = detail;
req.IsQA=model.IsQA;
_taskBroker.QueueWorkItem(req);
return Ok();
}

View File

@@ -15,8 +15,7 @@
<ChildContent>
<div class="standardList">
<Card Class="listCard"
Title="知识库文档"
>
Title="知识库文档">
<Extra>
<Button Type="@ButtonType.Primary" Style="position: absolute; right:360px; margin-bottom: 8px;" OnClick="Refresh">刷新 </Button>
@@ -106,7 +105,7 @@
<TabPane Key="2">
<TabTemplate>搜索测试</TabTemplate>
<ChildContent>
<KmsTest KmsId="@KmsId"></KmsTest>
<KmsTest KmsId="@KmsId"></KmsTest>
</ChildContent>
</TabPane>
</Tabs>
@@ -125,6 +124,12 @@
<FormItem Label="URL地址">
<Input @bind-Value="@context.Url" />
</FormItem>
<FormItem Label="切分方式">
<RadioGroup @bind-Value="@_isQa">
<Radio Value="false">直接切分</Radio>
<Radio Value="true">QA切分</Radio>
</RadioGroup>
</FormItem>
</Form>
</Modal>
@@ -136,10 +141,16 @@
<Form Model="@textModel"
LabelColSpan="8"
WrapperColSpan="16"
@ref="@_textForm">
@ref="@_textForm">
<FormItem Label="文本内容">
<TextArea @bind-Value="@context.Text" Rows="5" />
</FormItem>
<FormItem Label="切分方式">
<RadioGroup @bind-Value="@_isQa">
<Radio Value="false">直接切分</Radio>
<Radio Value="true">QA切分</Radio>
</RadioGroup>
</FormItem>
</Form>
</Modal>
@@ -147,7 +158,7 @@
Visible="@_fileVisible"
OnOk="@FileHandleOk"
OnCancel="@FileHandleCancel"
ConfirmLoading="@_fileConfirmLoading">
ConfirmLoading="@_fileConfirmLoading">
<Upload Action="@("api/File/UploadFile")"
Name="file"
Drag
@@ -165,7 +176,7 @@
支持 txt、word、pdf、md、excel、ppt、jpeg、png、tiff 等文件。
</p>
}
else
else
{
<p class="ant-upload-hint">
支持 txt、word、pdf、md、excel、ppt 等文件。
@@ -173,6 +184,10 @@
}
</Upload>
<RadioGroup @bind-Value="@_isQa" Style="margin-top:5px;">
<Radio Value="false">直接切分</Radio>
<Radio Value="true">QA切分</Radio>
</RadioGroup>
</Modal>
<Modal Title="Excel导入"
@@ -196,6 +211,10 @@
支持excel文件。
</p>
</Upload>
<RadioGroup @bind-Value="@_isQa" Style="margin-top:5px;">
<Radio Value="false">直接切分</Radio>
<Radio Value="true">QA切分</Radio>
</RadioGroup>
</Modal>
@code {

View File

@@ -76,8 +76,8 @@ namespace AntSK.Pages.KmsPage
private List<KmsDetails> _data = new List<KmsDetails>();
private bool _isQa { get; set; } = false;
protected override async Task OnInitializedAsync()
@@ -118,6 +118,7 @@ namespace AntSK.Pages.KmsPage
ImportType = ImportType.Url,
KmsId = KmsId,
Url = urlModel.Url,
IsQA = _isQa
});
_data = await _kmsDetails_Repositories.GetListAsync(p => p.KmsId == KmsId);
_urlVisible = false;
@@ -158,7 +159,8 @@ namespace AntSK.Pages.KmsPage
{
ImportType = ImportType.Text,
KmsId = KmsId,
Text = textModel.Text
Text = textModel.Text,
IsQA = _isQa
});
_data = await _kmsDetails_Repositories.GetListAsync(p => p.KmsId == KmsId);
_textVisible = false;
@@ -196,7 +198,8 @@ namespace AntSK.Pages.KmsPage
ImportType = ImportType.File,
KmsId = KmsId,
FilePath = item.Url,
FileName = item.FileName
FileName = item.FileName,
IsQA=_isQa
});
}
_data = await _kmsDetails_Repositories.GetListAsync(p => p.KmsId == KmsId);
@@ -235,7 +238,8 @@ namespace AntSK.Pages.KmsPage
ImportType = ImportType.Excel,
KmsId = KmsId,
FilePath = item.Url,
FileName = item.FileName
FileName = item.FileName,
IsQA = _isQa
});
}
_data = await _kmsDetails_Repositories.GetListAsync(p => p.KmsId == KmsId);