Skip to content

Commit

Permalink
修复热力图时区转换导致的bug,修改编辑规范Tip的显示等级,添加Id相关Tip
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFish-233 committed Nov 26, 2022
1 parent 038702e commit 5009e59
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ public async Task<UserEditInforBindModel> GetUserEditInforBindModel(ApplicationU
//拉取审核数据
var examines = await _examineRepository.GetAll().AsNoTracking()
.Where(s => s.ApplicationUserId == user.Id)
.Select(n => new { n.IsPassed, n.Operation, n.Context, n.EntryId, n.ArticleId, n.TagId, n.ApplyTime, n.Id })
.Select(n => new { n.IsPassed, n.Operation, n.ApplyTime, n.Id })
.ToListAsync();

model.EditCount = examines.Count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public async Task<ActionResult<Result>> TempFunction()
{
try
{
await _weeklyNewsRepository.GetRangeUpdateTable().Set(s => s.CreateTime, b => b.CreateTime.AddHours(8)).ExecuteAsync();
//await _weeklyNewsRepository.GetRangeUpdateTable().Set(s => s.CreateTime, b => b.CreateTime.AddHours(8)).ExecuteAsync();
return new Result { Successful = true };
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div style=" display: flex; flex-direction: column; align-items: flex-end;">
<div>
<i class="fa fa-pencil fa-fw font-color"></i>
<span class="font-color me-2">最后编辑:@Model.LastEditTime.ToString("yyyy-MM-dd")</span>
<span class="font-color me-2">最后编辑:@Model.LastEditTime.ToString("yyyy-MM-dd HH:mm")</span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@
if (begin.DayOfWeek != DayOfWeek.Monday)
{
DateTime begin_ = begin.AddDays(-(int)begin.DayOfWeek + 1);
for (DateTime temp = begin_; temp < begin; temp = temp.AddDays(1))
for (DateTime temp = begin_; temp.Date < begin.Date; temp = temp.AddDays(1))
{
AfterTreatmentDate.Add(new KeyValuePair<DateTime, int>(temp, -1));
}
}
if (end.DayOfWeek != DayOfWeek.Sunday)
{
DateTime end_ = end.AddDays((7 - (int)end.DayOfWeek));
for (DateTime temp = end.AddDays(1); temp <= end_; temp = temp.AddDays(1))
for (DateTime temp = end.AddDays(1); temp.Date <= end_.Date; temp = temp.AddDays(1))
{
AfterTreatmentDate.Add(new KeyValuePair<DateTime, int>(temp, -1));
}
}

for (DateTime i = begin; i <= end; i = i.AddDays(1))
{
KeyValuePair<DateTime, int> temp = BeforeTreatmentDate.FirstOrDefault(s => s.Key == i);
KeyValuePair<DateTime, int> temp = BeforeTreatmentDate.FirstOrDefault(s => s.Key.Date == i.Date);
if (temp.Key == default(KeyValuePair<DateTime, int>).Key)
{
AfterTreatmentDate.Add(new KeyValuePair<DateTime, int>(i, 0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
{
var url = Type switch
{
ExaminedNormalListModelType.Article => "api/articles/HiddenArticle",
ExaminedNormalListModelType.Article => "api/articles/Hide",
ExaminedNormalListModelType.Entry => "api/entries/HiddenEntry",
ExaminedNormalListModelType.Periphery => "api/peripheries/HiddenPeriphery",
ExaminedNormalListModelType.Tag => "api/tags/HiddenTag"
ExaminedNormalListModelType.Tag => "api/tags/HiddenTag",
ExaminedNormalListModelType.Video => "api/videos/Hide"
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>
@if (Type == ExaminedNormalListModelType.Entry)
{
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Success">
@(Creating?"创建": "编辑")词条前请先<TabLink Text="词条规范" Url="/articles/index/2" Icon="fa fa-newspaper-o" class="success--text fw-bold">阅读《词条编辑规范》</TabLink>,我们不会审核通过不符合规范的词条
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Error">
@(Creating?"创建": "编辑")词条前请先<TabLink Text="词条规范" Url="/articles/index/2" Icon="fa fa-newspaper-o" class="error--text fw-bold">阅读《词条编辑规范》</TabLink>,我们不会审核通过不符合规范的词条
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>
}
else if (Type == ExaminedNormalListModelType.Article)
{
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Success">
@(Creating?"发表": "编辑")文章前请先<TabLink Text="文章规范" Url="/articles/index/3" Icon="fa fa-newspaper-o" class="success--text fw-bold">阅读《文章发表规范》</TabLink>,我们不会审核通过不符合规范的文章
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Error">
@(Creating?"发表": "编辑")文章前请先<TabLink Text="文章规范" Url="/articles/index/3" Icon="fa fa-newspaper-o" class="error--text fw-bold">阅读《文章发表规范》</TabLink>,我们不会审核通过不符合规范的文章
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>

}
else if (Type == ExaminedNormalListModelType.Periphery)
{
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Success">
@(Creating?"创建": "编辑")周边前请先<TabLink Text="周边规范" Url="/articles/index/253" Icon="fa fa-newspaper-o" class="success--text fw-bold">阅读《周边编辑规范》</TabLink>,我们不会审核通过不符合规范的周边
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Error">
@(Creating?"创建": "编辑")周边前请先<TabLink Text="周边规范" Url="/articles/index/253" Icon="fa fa-newspaper-o" class="error--text fw-bold">阅读《周边编辑规范》</TabLink>,我们不会审核通过不符合规范的周边
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>

}
else if (Type == ExaminedNormalListModelType.Tag)
{
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Success">
@(Creating?"创建": "编辑")标签前请先<TabLink Text="标签规范" Url="/articles/index/254" Icon="fa fa-newspaper-o" class="success--text fw-bold">阅读《标签编辑规范》</TabLink>,我们不会审核通过不符合规范的标签
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Error">
@(Creating?"创建": "编辑")标签前请先<TabLink Text="标签规范" Url="/articles/index/254" Icon="fa fa-newspaper-o" class="error--text fw-bold">阅读《标签编辑规范》</TabLink>,我们不会审核通过不符合规范的标签
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>
}
else if (Type == ExaminedNormalListModelType.Video)
{
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Success">
@(Creating?"发布": "编辑")视频前请先<TabLink Text="视频规范" Url="/articles/index/254" Icon="fa fa-newspaper-o" class="success--text fw-bold">阅读《视频编辑规范》</TabLink>,我们不会审核通过不符合规范的视频
<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Error">
@(Creating?"发布": "编辑")视频前请先<TabLink Text="视频规范" Url="/articles/index/254" Icon="fa fa-newspaper-o" class="error--text fw-bold">阅读《视频编辑规范》</TabLink>,我们不会审核通过不符合规范的视频
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert Type="AlertTypes.Info" Class="mb-3">
下方的Id是指链接后方的标识字符串(绝大多数是数字Id),例如下方链接只要红色部分。 <br />
<strong>https://www.bilibili.com/video/<font style="color:red">BV1tF411N7XD</font>/?spm_id_from=333.999.0.0</strong><br />
<strong>https://weibo.com/u/<font style="color:red">5643366143</font></strong> <br />
大多数情况下可以直接复制完整链接,我们将会自动裁剪。
</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaAlert>

<CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaTitleContainer Icon="fa fa-fw fa-info-circle" Title="附加信息" Class="@Class" Collapable>
@switch (Model.Type)
{
Expand Down Expand Up @@ -132,66 +138,66 @@

</CnGalWebSite.Shared.MasaComponent.Shared.Components.MasaTitleContainer>

@code {
[Parameter]
public EditAddInforViewModel Model { get; set; }
[Parameter]
public string Class { get; set; }
[Parameter]
public IEnumerable<string> EntryGroupItems { get; set; }
[Parameter]
public IEnumerable<string> EntryStaffItems { get; set; }
@code {
[Parameter]
public EditAddInforViewModel Model { get; set; }
[Parameter]
public string Class { get; set; }
[Parameter]
public IEnumerable<string> EntryGroupItems { get; set; }
[Parameter]
public IEnumerable<string> EntryStaffItems { get; set; }

List<SelectedItem> GamePlatforms { get; set; } = new List<SelectedItem>();
List<SelectedItem> GamePlatforms { get; set; } = new List<SelectedItem>();

private List<string> GamePlatformsValue { get; set; } = new List<string>();
private List<string> GamePlatformsValue { get; set; } = new List<string>();

protected override async Task OnInitializedAsync()
{
protected override async Task OnInitializedAsync()
{

//设置游戏平台
if (Model.Type == EntryType.Game)
//设置游戏平台
if (Model.Type == EntryType.Game)
{
foreach (var item in Model.GamePlatforms)
{
foreach (var item in Model.GamePlatforms)
GamePlatforms.Add(new SelectedItem
{
GamePlatforms.Add(new SelectedItem
{
Text = item.GamePlatformType.GetDisplayName(),
Value = item.GamePlatformType.ToString(),
Active = item.IsSelected
});
if (item.IsSelected == true)
{
GamePlatformsValue.Add(item.GamePlatformType.ToString());
}
Text = item.GamePlatformType.GetDisplayName(),
Value = item.GamePlatformType.ToString(),
Active = item.IsSelected
});
if (item.IsSelected == true)
{
GamePlatformsValue.Add(item.GamePlatformType.ToString());
}
}

}

public Task GamePlatformsValueChanged(List<string> games)
}

public Task GamePlatformsValueChanged(List<string> games)
{
GamePlatformsValue = games;
//处理游戏平台数据
Model.GamePlatforms.Clear();
foreach (var item in GamePlatforms)
{
GamePlatformsValue = games;
//处理游戏平台数据
Model.GamePlatforms.Clear();
foreach (var item in GamePlatforms)
bool isSelected = false;
foreach (var infor in GamePlatformsValue)
{
bool isSelected = false;
foreach (var infor in GamePlatformsValue)
if (infor == item.Value)
{
if (infor == item.Value)
{
isSelected = true;
}
isSelected = true;
}
Model.GamePlatforms.Add(new GamePlatformModel
{
GamePlatformType = (GamePlatformType)Enum.Parse(typeof(GamePlatformType), item.Value),
IsSelected = isSelected
});
}

return Task.CompletedTask;
Model.GamePlatforms.Add(new GamePlatformModel
{
GamePlatformType = (GamePlatformType)Enum.Parse(typeof(GamePlatformType), item.Value),
IsSelected = isSelected
});
}

return Task.CompletedTask;
}

}

0 comments on commit 5009e59

Please sign in to comment.