Skip to content

Commit

Permalink
Merge pull request #12 from HammCn/dev
Browse files Browse the repository at this point in the history
release(v2.3.6): 发布了`v2.3.6`版本
  • Loading branch information
HammCn authored Sep 20, 2024
2 parents 11be8cc + a1ef5fe commit c71d52f
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 50 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# AirPower4T 版本发布日志

## v2.3.6

### 🎉 Features:

- feat(IPayload): 提供了一个`Payload`标准接口

### 🐞 Bug fixes:

- fix(ISelector): 统一到 `IPayload` 接口
- fix(Copy): 优化`Copy`组件的行内展示样式
- fix(TableField): 移除泛型支持和冗余属性
- fix(ToolBar): 移除关键词搜索,更新搜索逻辑
- fix(Upload): 修改自定义上传成功的返回事件优先级

## v2.3.5

### 🎉 Features:
Expand Down
6 changes: 2 additions & 4 deletions component/Copy.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<el-link
v-tip="copyTips"
class="air-copy"
:underline="false"
class="air-copy"
@click="copy"
>
<slot>{{ content || "-" }}</slot>
<slot>{{ content || '-' }}</slot>
</el-link>
</template>
<script lang="ts" setup>
Expand Down Expand Up @@ -59,8 +59,6 @@ async function copy() {

<style lang="scss" scoped>
.air-copy {
flex: 1;
::v-deep(.el-link__inner) {
flex: 1;
}
Expand Down
6 changes: 3 additions & 3 deletions component/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
</template>
</el-input>
</template>
<script setup lang="ts" generic="T extends ISelector">
<script setup lang="ts" generic="T extends IPayload">
import {
Component, computed, ModelRef, PropType,
} from 'vue'
import { AirDialog } from '../helper/AirDialog'
import { ISelector } from '../interface/ISelector'
import { IPayload } from '../interface/IPayload'
const result = defineModel<T>() as ModelRef<T | undefined>
Expand Down Expand Up @@ -114,7 +114,7 @@ function emitClear() {
emits('onClear')
}
const label = computed(() => result.value?.getSelectorLabel() || props.default)
const label = computed(() => result.value?.getPayloadLabel() || props.default)
async function onSelect() {
result.value = await AirDialog.show<T>(props.selector, props.param)
Expand Down
12 changes: 0 additions & 12 deletions component/ToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ const searchFieldList = computed(() => props.searchParams || entityInstance.valu
*/
const filter = ref<IJson>({})
/**
* # 查询用的关键词
*/
const keyword = ref('')
/**
* # 查询事件
*/
Expand All @@ -453,8 +448,6 @@ function onSearch() {
if (request.value.page) {
request.value.page.pageNum = 1
}
request.value.keyword = keyword.value.trimEnd()
.trimStart()
emits('onSearch', request.value)
}
Expand All @@ -463,7 +456,6 @@ function onSearch() {
*/
function onResetSearch() {
filter.value = {}
keyword.value = ''
request.value = new AirRequestPage(props.entity)
request.value.exclude('filter')
emits('onReset')
Expand Down Expand Up @@ -551,10 +543,6 @@ defineExpose({
align-items: center;
flex-wrap: wrap-reverse;
.keyword {
width: 240px;
}
>* {
margin: 0 2px 5px;
}
Expand Down
17 changes: 9 additions & 8 deletions component/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,23 @@ function onUploadError() {
*/
function onUploadSuccess(result: IJson) {
loading.value = false
if (props.onCustomSuccess) {
props.onCustomSuccess(result)
props.onConfirm(null)
return
}
if (result.code === undefined || result.code === null) {
onUploadError()
return
}
if (result.code === AirConfig.successCode) {
AirNotification.success(props.uploadSuccess, AirI18n.get().UploadSuccess || '上传成功')
if (props.onCustomSuccess) {
props.onCustomSuccess(result.data)
props.onConfirm(null)
} else {
const entity = AirClassTransformer.parse(
const entity = AirClassTransformer.parse(
result.data as IJson,
props.entity,
)
props.onConfirm(entity)
}
)
props.onConfirm(entity)
} else {
AirNotification.error(result.message as string || '好家伙,后端的拉垮哥们连Message都没返回???', AirI18n.get().UploadError || '上传失败')
props.onCancel()
Expand Down
2 changes: 2 additions & 0 deletions component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ASelect from './Select.vue'
import ASelector from './Selector.vue'
import AMoney from './Money.vue'
import AFormField from './FormField.vue'
import ATablePayload from './table/Payload.vue'

export {
ACopy,
Expand Down Expand Up @@ -50,4 +51,5 @@ export {
ASelector,
AMoney,
AFormField,
ATablePayload,
}
25 changes: 25 additions & 0 deletions component/table/Payload.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<el-link @click="show()">
{{ payload.getPayloadLabel() }}
</el-link>
</template>
<script lang="ts" setup generic="T extends IPayload">
import { Component, PropType } from 'vue'
import { AirDialog } from '../../helper/AirDialog'
import { IPayload } from '../../interface/IPayload'
const props = defineProps({
payload: {
type: Object as PropType<IPayload>,
required: true,
},
view: {
type: Object as PropType<Component>,
required: true,
},
})
function show() {
AirDialog.show(props.view, props.payload.copy())
}
</script>
2 changes: 1 addition & 1 deletion config/AirConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AirConfig {
/**
* ## `AirPower` 版本号
*/
static readonly version = 'v2.3.5'
static readonly version = 'v2.3.6'

/**
* ## `AppKey`
Expand Down
12 changes: 12 additions & 0 deletions interface/IPayload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { AirEntity } from '../base/AirEntity'

/**
* # 标准的负载接口
* @author Hamm.cn
*/
export interface IPayload extends AirEntity {
/**
* ## 获取负载显示的文本
*/
getPayloadLabel(): string
}
12 changes: 0 additions & 12 deletions interface/ISelector.ts

This file was deleted.

8 changes: 3 additions & 5 deletions interface/decorators/ITableFieldConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import { AirDateTimeFormatter } from '../../enum/AirDateTimeFormatter'
import { AirDictionaryArray } from '../../model/extend/AirDictionaryArray'
import { IFieldConfig } from './IFieldConfig'
import {
AirEnumKey, AirMoneyDirection, AirSortable, AirTableAlign, AirTableFixed,
AirMoneyDirection, AirSortable, AirTableAlign, AirTableFixed,
} from '../../type/AirType'
import { AirEnum } from '../../base/AirEnum'
import { ClassConstructor } from '../../type/ClassConstructor'

/**
* # 表格的字段配置接口
* @author Hamm.cn
*/
export interface ITableFieldConfig<K extends AirEnumKey = AirEnumKey, E extends AirEnum<K> = AirEnum<K>> extends IFieldConfig {
export interface ITableFieldConfig extends IFieldConfig {
/**
* ## 默认隐藏
* `可自行勾选后放出`
Expand Down Expand Up @@ -49,7 +47,7 @@ export interface ITableFieldConfig<K extends AirEnumKey = AirEnumKey, E extends
* ## 枚举字典
* 如字典配置了 `color`, 可使用 `showColor` 配置项显示颜色
*/
dictionary?: AirDictionaryArray | ClassConstructor<E>;
dictionary?: AirDictionaryArray;

/**
* ## 如是日期 可传入转换规则
Expand Down
5 changes: 0 additions & 5 deletions model/AirRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ export class AirRequest<E extends AirEntity = AirEntity> extends AirModel {
*/
filter!: E

/**
* ## 关键词搜索
*/
@Type(String) keyword!: string

/**
* ## 排序信息
*/
Expand Down

0 comments on commit c71d52f

Please sign in to comment.