修复列表展示问题
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
public override Task<Result> Add(ArticleEntity entity)
|
public override Task<Result> Add(ArticleEntity entity)
|
||||||
{
|
{
|
||||||
//如果标题为空,默认为内容的前20个字符
|
//如果标题为空,默认为内容的前20个字符
|
||||||
entity.Title = entity.Title ?? entity.Content.Substring(0, 20);
|
entity.Title = string.IsNullOrEmpty(entity.Title) ? entity.Content.Substring(0, 20): entity.Title;
|
||||||
entity.UserId = HttpContext.GetUserIdInfo();
|
entity.UserId = HttpContext.GetUserIdInfo();
|
||||||
return base.Add(entity);
|
return base.Add(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Yi.Framework.Service
|
|||||||
//.WhereIF(!string.IsNullOrEmpty(config.ConfigKey), u => u.ConfigKey.Contains(config.ConfigKey))
|
//.WhereIF(!string.IsNullOrEmpty(config.ConfigKey), u => u.ConfigKey.Contains(config.ConfigKey))
|
||||||
.WhereIF(page.StartTime is not null && page.EndTime is not null, u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
|
.WhereIF(page.StartTime is not null && page.EndTime is not null, u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
|
||||||
.WhereIF(entity.IsDeleted is not null, u => u.IsDeleted == entity.IsDeleted)
|
.WhereIF(entity.IsDeleted is not null, u => u.IsDeleted == entity.IsDeleted)
|
||||||
.OrderBy(u => u.CreateTime, OrderByType.Asc)
|
.OrderBy(u => u.CreateTime, OrderByType.Desc)
|
||||||
.ToPageListAsync(page.PageNum, page.PageSize, total);
|
.ToPageListAsync(page.PageNum, page.PageSize, total);
|
||||||
|
|
||||||
return new PageModel<List<ArticleEntity>>(data, total);
|
return new PageModel<List<ArticleEntity>>(data, total);
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
articleApi.pageList(queryParams.value).then((response: any) => {
|
articleApi.pageList(queryParams.value).then((response: any) => {
|
||||||
articleList.value.push(...(response.data.data));
|
articleList.value.unshift(...(response.data.data));
|
||||||
totol.value = response.data.totol;
|
totol.value = response.data.totol;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user