add 修改水印影响样式问题

This commit is contained in:
zyxucp
2024-04-28 16:53:10 +08:00
parent 0e08b3ae85
commit 125695665b
3 changed files with 83 additions and 79 deletions

View File

@@ -25,7 +25,9 @@
<Body>
@if (!string.IsNullOrEmpty(AppId))
{
<ChatView AppId="@AppId" ShowTitle=false OnRelevantSources="OnRelevantSources"></ChatView>
<Watermark Content="AntSK">
<ChatView AppId="@AppId" ShowTitle=false OnRelevantSources="OnRelevantSources"></ChatView>
</Watermark>
}
</Body>
</Card>
@@ -42,11 +44,11 @@
<AntList Bordered DataSource="@_relevantSources" Style="padding:10px;">
<ChildContent Context="item">
<span> <b>@item.SourceName </b> </span>
<br/>
<br />
<span>相似度:<Text Mark> @item.Relevance</Text></span>
@if (@item.RerankScore != 0)
{
<br/>
<br />
<span> Rerank相关性<Text Mark> @item.RerankScore</Text></span>
}
<Body>

View File

@@ -5,82 +5,82 @@
@layout OpenLayout
@inherits AntDomComponentBase
<Watermark Content="AntSK">
<div id="chat">
@if (ShowTitle)
{
<PageHeader Class="site-page-header" Title="@app.Name" Subtitle="@app.Describe" />
}
<div id="scrollDiv" style="flex:1; width:100%; overflow-y:auto; overflow-x:hidden;padding:10px;">
<Virtualize Items="@(MessageList.OrderBy(o => o.CreateTime).ToList())" Context="item">
@if (item.IsSend)
{
<GridRow>
<GridCol Span="23">
<div class="chat-bubble sent">
<Popover Title="@item.CreateTime.ToString()">
<Unbound>
<Flex Vertical RefBack="context">
@if (item.FileName != null)
{
<p class="message-file">
<Upload DefaultFileList="[new(){ FileName= item.FileName }]" />
</p>
}
<p>@(item.Context)</p>
</Flex>
</Unbound>
</Popover>
</div>
<Icon Style="float:right;margin-top:10px;" Type="copy" Theme="outline" OnClick="async () =>await OnCopyAsync(item)" />
</GridCol>
<GridCol Span="1">
<Image Width="25px" Height="25px" Style="margin-top:10px;" Src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" />
</GridCol>
</GridRow>
}
else
{
<GridRow>
<GridCol Span="1">
<Image Width="25px" Height="25px" Style="margin-top:10px;" Src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg" />
</GridCol>
<GridCol Span="23">
<div class="chat-bubble received">
@((MarkupString)(item.Context))
</div>
</GridCol>
</GridRow>
}
</Virtualize>
</div>
@if (fileList.Count > 0)
{
<Flex Vertical>
<Upload DefaultFileList="fileList" OnRemove="HandleFileRemove" />
</Flex>
}
<Flex Justify="end">
<AntDesign.Input @bind-Value="@(_messageInput)" DebounceMilliseconds="@(-1)" Placeholder="输入消息回车发送" OnPressEnter="@(async () => await OnSendAsync())" Disabled="@Sendding"></AntDesign.Input>
@if (app.EmbeddingModelID != null)
<div id="chat">
@if (ShowTitle)
{
<PageHeader Class="site-page-header" Title="@app.Name" Subtitle="@app.Describe" />
}
<div id="scrollDiv" style="flex:1; width:100%; overflow-y:auto; overflow-x:hidden;padding:10px;">
<Virtualize Items="@(MessageList.OrderBy(o => o.CreateTime).ToList())" Context="item">
@if (item.IsSend)
{
<Upload Action="@("api/File/UploadFile")"
Name="file"
Accept="*/*"
ShowUploadList="false"
BeforeUpload="_kMService.BeforeUpload"
OnSingleCompleted="OnSingleCompleted">
<Button Icon="@IconType.Outline.Upload" Type="@(ButtonType.Link)" Disabled="@Sendding" />
</Upload>
<GridRow>
<GridCol Span="23">
<div class="chat-bubble sent">
<Popover Title="@item.CreateTime.ToString()">
<Unbound>
<Flex Vertical RefBack="context">
@if (item.FileName != null)
{
<p class="message-file">
<Upload DefaultFileList="[new(){ FileName= item.FileName }]" />
</p>
}
<p>@(item.Context)</p>
</Flex>
</Unbound>
</Popover>
</div>
<Icon Style="float:right;margin-top:10px;" Type="copy" Theme="outline" OnClick="async () =>await OnCopyAsync(item)" />
</GridCol>
<GridCol Span="1">
<Image Width="25px" Height="25px" Style="margin-top:10px;" Src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" />
</GridCol>
</GridRow>
}
<Button Icon="clear" Type="@(ButtonType.Link)" OnClick="@(async () => await OnClearAsync())" Disabled="@Sendding"></Button>
<Button Icon="send" Type="@(ButtonType.Link)" OnClick="@(async () => await OnSendAsync())" Disabled="@Sendding"></Button>
</Flex>
else
{
<GridRow>
<GridCol Span="1">
<Image Width="25px" Height="25px" Style="margin-top:10px;" Src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg" />
</GridCol>
<GridCol Span="23">
<div class="chat-bubble received">
@((MarkupString)(item.Context))
</div>
</GridCol>
</GridRow>
}
</Virtualize>
</div>
</Watermark>
@if (fileList.Count > 0)
{
<Flex Vertical>
<Upload DefaultFileList="fileList" OnRemove="HandleFileRemove" />
</Flex>
}
<Flex Justify="end">
<AntDesign.Input @bind-Value="@(_messageInput)" DebounceMilliseconds="@(-1)" Placeholder="输入消息回车发送" OnPressEnter="@(async () => await OnSendAsync())" Disabled="@Sendding"></AntDesign.Input>
@if (app.EmbeddingModelID != null)
{
<Upload Action="@("api/File/UploadFile")"
Name="file"
Accept="*/*"
ShowUploadList="false"
BeforeUpload="_kMService.BeforeUpload"
OnSingleCompleted="OnSingleCompleted">
<Button Icon="@IconType.Outline.Upload" Type="@(ButtonType.Link)" Disabled="@Sendding" />
</Upload>
}
<Button Icon="clear" Type="@(ButtonType.Link)" OnClick="@(async () => await OnClearAsync())" Disabled="@Sendding"></Button>
<Button Icon="send" Type="@(ButtonType.Link)" OnClick="@(async () => await OnSendAsync())" Disabled="@Sendding"></Button>
</Flex>
</div>
<style>
body {

View File

@@ -6,14 +6,16 @@
@page "/OpenChat/{AppId}"
@layout OpenLayout
<ChatView AppId="@AppId" ShowTitle=true>
</ChatView>
<style>
#chat{
height:100% ;
display:flex;
#chat {
height: 100%;
display: flex;
flex-direction: column;
overflow-x: hidden;
font-family: Arial, sans-serif;
@@ -21,7 +23,7 @@
padding: 10px;
}
</style>
@code{
@code {
[Parameter]
public string AppId { get; set; }
}