Skip to content

Commit

Permalink
Merge pull request #1010 from colinin/dev
Browse files Browse the repository at this point in the history
Merge dev to master
  • Loading branch information
colinin authored Sep 16, 2024
2 parents 98d7c6f + e9b345d commit 28ad4d6
Show file tree
Hide file tree
Showing 20 changed files with 144 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Publish"

on:
push:
branches: [ rel-8.2.1 ]
branches: [ rel-8.2.2 ]
env:
DOTNET_VERSION: "8.0.200"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Tagged Release"

on:
push:
branches: [ rel-8.2.1 ]
branches: [ rel-8.2.2 ]

jobs:
tagged-release:
Expand All @@ -14,4 +14,4 @@ jobs:
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: "8.2.1"
automatic_release_tag: "8.2.2"
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<DotNetCoreCAPPackageVersion>8.2.0</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.14.1</ElsaPackageVersion>
<VoloAbpPackageVersion>8.2.1</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>8.2.1</LINGYUNAbpPackageVersion>
<VoloAbpPackageVersion>8.2.2</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>8.2.2</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion>
Expand Down
32 changes: 21 additions & 11 deletions apps/vue/src/components/Table/src/BasicTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
<slot :name="item" v-bind="data || {}"></slot>
</template>
<template #advanceBefore>
<Button
v-if="getAdvancedSearchProps?.useAdvancedSearch"
type="link"
size="small"
@click="handleAdvanceSearch"
>
{{ t('component.table.advancedSearch.title') }}
</Button>
<Badge v-if="getAdvancedSearchProps?.useAdvancedSearch" :count="advancedSearchInput?.paramters.length">
<Button
type="link"
size="small"
@click="handleAdvanceSearch"
>
{{ t('component.table.advancedSearch.title') }}
</Button>
</Badge>
</template>
</BasicForm>
Expand Down Expand Up @@ -55,7 +56,7 @@
ref="advancedSearchRef"
@register="registerAdSearchModal"
v-bind="getAdvancedSearchProps"
@change="handleAdvanceSearchChange"
@change="handleAdvanceSearchChanged"
@search="handleAdvanceSearchInfoChange"
/>
</div>
Expand All @@ -70,13 +71,14 @@
} from './types/table';
import { defineComponent, ref, reactive, computed, unref, toRaw, inject, watchEffect, nextTick } from 'vue';
import { Button, Table } from 'ant-design-vue';
import { Badge, Button, Table } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { useModal } from '/@/components/Modal/index';
import { PageWrapperFixedHeightKey } from '/@/components/Page';
import HeaderCell from './components/HeaderCell.vue';
import AdvancedSearch from './components/AdvancedSearch.vue';
import { InnerHandlers } from './types/table';
import { DynamicQueryable } from './types/advancedSearch';
import { usePagination } from './hooks/usePagination';
import { useColumns } from './hooks/useColumns';
Expand Down Expand Up @@ -105,6 +107,7 @@
name: 'BasicTable',
components: {
Table,
Badge,
BasicForm,
Button,
HeaderCell,
Expand Down Expand Up @@ -137,6 +140,7 @@
const wrapRef = ref(null);
const formRef = ref(null);
const advancedSearchRef = ref<any>(null);
const advancedSearchInput = ref<DynamicQueryable>();
const innerPropsRef = ref<Partial<BasicTableProps>>();
const { prefixCls } = useDesign('basic-table');
Expand Down Expand Up @@ -276,6 +280,11 @@
getDataSourceRef,
);
function handleAdvanceSearchChanged(queryable: DynamicQueryable) {
advancedSearchInput.value = queryable;
handleAdvanceSearchChange(queryable);
}
const {
getFormProps,
getAdvancedSearchProps,
Expand Down Expand Up @@ -401,12 +410,13 @@
formRef,
tableElRef,
advancedSearchRef,
advancedSearchInput,
getBindValues,
getLoading,
registerForm,
handleSearchInfoChange,
registerAdSearchModal,
handleAdvanceSearchChange,
handleAdvanceSearchChanged,
handleAdvanceSearchInfoChange,
handleSearchInfoReset,
handleAdvanceSearch,
Expand Down
16 changes: 4 additions & 12 deletions apps/vue/src/components/Table/src/components/AdvancedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
function handleDelField(paramter) {
const index = formMdel.paramters.findIndex(p => p.field === paramter.field);
formMdel.paramters.splice(index, 1);
emits('change', getSearchInput());
emits('change', formMdel);
}
function handleFieldChange(field, record) {
Expand All @@ -344,26 +344,18 @@
if (defineParam.javaScriptType === 'boolean') {
record.value = false;
}
emits('change', getSearchInput());
emits('change', formMdel);
}
}
function handleSubmit() {
emits('search', getSearchInput());
emits('search', formMdel);
closeModal();
}
function resetFields() {
formMdel.paramters = [];
emits('change', getSearchInput());
}
function getSearchInput() {
const searchInput = {
// 过滤未定义值
paramters: formMdel.paramters.filter(p => p.value !== undefined)
};
return searchInput;
emits('change', formMdel);
}
function setLoading(loading: boolean) {
Expand Down
17 changes: 11 additions & 6 deletions apps/vue/src/components/Table/src/hooks/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,17 @@ export function useDataSource(
} = unref(propsRef);
let fetchApi = api;
// 高级查询条件支持
const searchInput = cloneDeep(getFieldsValue());
if (advancedSearchConfig?.useAdvancedSearch) {
const searchInput = getFieldsValue();
if (Reflect.has(searchInput, 'queryable') &&
Array.isArray(searchInput.queryable?.paramters) &&
searchInput.queryable.paramters.length > 0)
fetchApi = advancedSearchConfig?.fetchApi;
if (Reflect.has(searchInput, 'queryable')
&& searchInput?.queryable?.paramters
&& Array.isArray(searchInput.queryable?.paramters)) {
searchInput.queryable.paramters = searchInput.queryable.paramters
.filter((p) => p.value !== undefined);
if (searchInput.queryable.paramters.length > 0) {
fetchApi = advancedSearchConfig?.fetchApi;
}
}
}
if (!fetchApi || !isFunction(fetchApi)) return;
try {
Expand Down Expand Up @@ -275,7 +280,7 @@ export function useDataSource(

let params: Recordable = merge(
pageParams,
useSearchForm ? getFieldsValue() : {},
useSearchForm ? searchInput : {},
searchInfo,
opt?.searchInfo ?? {},
defSort,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public interface IDynamicQueryableAppService<TEntityDto>
/// </summary>
/// <param name="dynamicInput"></param>
/// <returns></returns>
Task<PagedResultDto<TEntityDto>> GetListAsync(GetListByDynamicQueryableInput dynamicInput);
Task<PagedResultDto<TEntityDto>> SearchAsync(GetListByDynamicQueryableInput dynamicInput);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public virtual Task<ListResultDto<DynamicParamterDto>> GetAvailableFieldsAsync()
/// </summary>
/// <param name="dynamicInput"></param>
/// <returns></returns>
public async virtual Task<PagedResultDto<TEntityDto>> GetListAsync(GetListByDynamicQueryableInput dynamicInput)
public async virtual Task<PagedResultDto<TEntityDto>> SearchAsync(GetListByDynamicQueryableInput dynamicInput)
{
Expression<Func<TEntity, bool>> condition = (e) => true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public Task<ListResultDto<DynamicParamterDto>> GetAvailableFieldsAsync()

[HttpPost]
[Route("search")]
public Task<PagedResultDto<TEntityDto>> GetListAsync(GetListByDynamicQueryableInput dynamicInput)
public Task<PagedResultDto<TEntityDto>> SearchAsync(GetListByDynamicQueryableInput dynamicInput)
{
return DynamicQueryableAppService.GetListAsync(dynamicInput);
return DynamicQueryableAppService.SearchAsync(dynamicInput);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ public abstract class LanguageCreateOrUpdateDto
[Required]
[DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxDisplayNameLength))]
public string DisplayName { get; set; }

[DynamicStringLength(typeof(LanguageConsts), nameof(LanguageConsts.MaxTwoLetterISOLanguageNameLength))]
public string FlagIcon { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public async virtual Task<TenantDto> GetAsync(Guid id)
var tenant = await TenantRepository.FindAsync(id);
if (tenant == null)
{
throw new UserFriendlyException(L["TenantNotFoundById", id]);
throw new BusinessException(AbpSaasErrorCodes.TenantIdOrNameNotFound)
.WithData("Tenant", id);
}

return ObjectMapper.Map<Tenant, TenantDto>(tenant);
Expand All @@ -50,7 +51,8 @@ public async virtual Task<TenantDto> GetAsync(string name)
var tenant = await TenantRepository.FindByNameAsync(name);
if (tenant == null)
{
throw new UserFriendlyException(L["TenantNotFoundByName", name]);
throw new BusinessException(AbpSaasErrorCodes.TenantIdOrNameNotFound)
.WithData("Tenant", name);
}
return ObjectMapper.Map<Tenant, TenantDto>(tenant);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
public static class AbpSaasErrorCodes
{
public const string Namespace = "Saas";

/// <summary>
/// 已经存在名为 {DisplayName} 的版本!
/// </summary>
public const string DuplicateEditionDisplayName = Namespace + ":010001";
/// <summary>
/// 试图删除正在使用的版本: {DisplayName}!
/// </summary>
public const string DeleteUsedEdition = Namespace + ":010002";
/// <summary>
/// 已经存在名为 {Name} 的租户!
/// </summary>
public const string DuplicateTenantName = Namespace + ":020001";
/// <summary>
/// 租户: {Tenant} 不存在!
/// </summary>
public const string TenantIdOrNameNotFound = Namespace + ":020002";
/// <summary>
/// 无效的默认连接字符串
/// </summary>
public const string InvalidDefaultConnectionString = Namespace + ":020101";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Saas:010001": "Unable to create duplicate editions {DisplayName}!",
"Saas:010002": "Tried to delete the edition in use: {DisplayName}!",
"Saas:020001": "Unable to create duplicate tenants {Name}!",
"Saas:020002": "Tenant: {Tenant} not found!",
"Saas:020101": "The default connection string cannot open a connection to the database!",
"Saas:020102": "The database pointed to by the default connection string already exists!",
"Saas:020103": "Unable to open the database connection pointed to by {Name}!",
Expand Down Expand Up @@ -47,8 +48,6 @@
"Features:ExpirationReminderDaysDesc": "Send a reminder to the administrator when the resource has how many days left to expire",
"Features:ExpiredRecoveryTime": "Expired Recovery Time",
"Features:ExpiredRecoveryTimeDesc": "If the resource expiration is not handled for a long time, tenant resources will be reclaimed",
"TenantNotFoundById": "Tenant: {0} not found!",
"TenantNotFoundByName": "Tenant: {0} not found!",
"UnActived": "UnActived",
"RecycleStrategy:Reserve": "Reserve",
"RecycleStrategy:Recycle": "Recycle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Saas:010001": "已经存在名为 {DisplayName} 的版本!",
"Saas:010002": "试图删除正在使用的版本: {DisplayName}!",
"Saas:020001": "已经存在名为 {Name} 的租户!",
"Saas:020002": "租户: {Tenant} 不存在!",
"Saas:020101": "无法打开默认连接字符串指向的数据库连接!",
"Saas:020102": "默认连接字符串指向的数据库已经存在!",
"Saas:020103": "无法打开 {Name} 指向的数据库连接!",
Expand Down Expand Up @@ -47,8 +48,6 @@
"Features:ExpirationReminderDaysDesc": "当资源还有多少天过期时, 给管理员发送提醒",
"Features:ExpiredRecoveryTime": "过期回收时长",
"Features:ExpiredRecoveryTimeDesc": "当资源超期多久没有处理, 将回收租户资源",
"TenantNotFoundById": "租户: {0} 不存在!",
"TenantNotFoundByName": "租户: {0} 不存在!",
"UnActived": "未启用",
"RecycleStrategy:Reserve": "保留",
"RecycleStrategy:Recycle": "回收"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using LINGYUN.Abp.TaskManagement.Permissions;
using Microsoft.AspNetCore.Authorization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;

Expand Down Expand Up @@ -32,22 +34,38 @@ public async virtual Task<BackgroundJobLogDto> GetAsync(long id)

public async virtual Task<PagedResultDto<BackgroundJobLogDto>> GetListAsync(BackgroundJobLogGetListInput input)
{
var filter = new BackgroundJobLogFilter
{
BeginRunTime = input.BeginRunTime,
EndRunTime = input.EndRunTime,
HasExceptions = input.HasExceptions,
Filter = input.Filter,
Group = input.Group,
Name = input.Name,
Type = input.Type
};

var totalCount = await BackgroundJobLogRepository.GetCountAsync(filter, input.JobId);
var specification = new BackgroundJobLogGetListSpecification(input);

var totalCount = await BackgroundJobLogRepository.GetCountAsync(specification);
var backgroundJobLogs = await BackgroundJobLogRepository.GetListAsync(
filter, input.JobId, input.Sorting, input.MaxResultCount, input.SkipCount);
specification, input.Sorting, input.MaxResultCount, input.SkipCount);

return new PagedResultDto<BackgroundJobLogDto>(totalCount,
ObjectMapper.Map<List<BackgroundJobLog>, List<BackgroundJobLogDto>>(backgroundJobLogs));
ObjectMapper.Map<List<BackgroundJobLog>, List<BackgroundJobLogDto>>(backgroundJobLogs));
}

private class BackgroundJobLogGetListSpecification : Volo.Abp.Specifications.Specification<BackgroundJobLog>
{
protected BackgroundJobLogGetListInput Input { get; }
public BackgroundJobLogGetListSpecification(BackgroundJobLogGetListInput input)
{
Input = input;
}

public override Expression<Func<BackgroundJobLog, bool>> ToExpression()
{
Expression<Func<BackgroundJobLog, bool>> expression = _ => true;

return expression
.AndIf(!Input.JobId.IsNullOrWhiteSpace(), x => x.JobId.Equals(Input.JobId))
.AndIf(!Input.Type.IsNullOrWhiteSpace(), x => x.JobType.Contains(Input.Type))
.AndIf(!Input.Group.IsNullOrWhiteSpace(), x => x.JobGroup.Equals(Input.Group))
.AndIf(!Input.Name.IsNullOrWhiteSpace(), x => x.JobName.Equals(Input.Name))
.AndIf(!Input.Filter.IsNullOrWhiteSpace(), x => x.JobName.Contains(Input.Filter) ||
x.JobGroup.Contains(Input.Filter) || x.JobType.Contains(Input.Filter) || x.Message.Contains(Input.Filter))
.AndIf(Input.HasExceptions.HasValue, x => !string.IsNullOrWhiteSpace(x.Exception))
.AndIf(Input.BeginRunTime.HasValue, x => x.RunTime >= Input.BeginRunTime)
.AndIf(Input.EndRunTime.HasValue, x => x.RunTime <= Input.EndRunTime);
}
}
}
Loading

0 comments on commit 28ad4d6

Please sign in to comment.