@oinone/kunlun-vue-admin-base 6.2.8 → 6.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/oinone-kunlun-vue-admin-base.css +1 -1
- package/dist/oinone-kunlun-vue-admin-base.esm.js +37 -6
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/field/table/date/TableYearFieldWidget.d.ts +1 -0
- package/package.json +8 -8
- package/src/field/table/boolean/TableBooleanSelectFieldWidget.ts +7 -2
- package/src/field/table/date/TableYearFieldWidget.ts +30 -1
- package/src/field/table/string/upload/TableStringUploadImageFieldWidget.ts +2 -2
- package/src/field/table/string/upload/TableStringUploadWidget.ts +0 -1
- package/src/view/table/TableWidget.ts +5 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TableDateTimeFieldWidget } from './TableDateTimeFieldWidget';
|
|
2
2
|
export declare class TableYearFieldWidget extends TableDateTimeFieldWidget {
|
|
3
|
+
renderDefaultSlot(context: any): any;
|
|
3
4
|
protected get defaultFormat(): string;
|
|
4
5
|
protected get valueFormat(): string;
|
|
5
6
|
protected hasDateFormat: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oinone/kunlun-vue-admin-base",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.10",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prebuild": "rimraf dist",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"doc": "typedoc --out docs src/index.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@oinone/kunlun-vue-admin-layout": "6.2.
|
|
18
|
-
"@oinone/kunlun-vue-router": "6.2.
|
|
19
|
-
"@oinone/kunlun-vue-ui": "6.2.
|
|
20
|
-
"@oinone/kunlun-vue-ui-antd": "6.2.
|
|
21
|
-
"@oinone/kunlun-vue-ui-common": "6.2.
|
|
22
|
-
"@oinone/kunlun-vue-ui-el": "6.2.
|
|
23
|
-
"@oinone/kunlun-vue-widget": "6.2.
|
|
17
|
+
"@oinone/kunlun-vue-admin-layout": "6.2.10",
|
|
18
|
+
"@oinone/kunlun-vue-router": "6.2.10",
|
|
19
|
+
"@oinone/kunlun-vue-ui": "6.2.10",
|
|
20
|
+
"@oinone/kunlun-vue-ui-antd": "6.2.10",
|
|
21
|
+
"@oinone/kunlun-vue-ui-common": "6.2.10",
|
|
22
|
+
"@oinone/kunlun-vue-ui-el": "6.2.10",
|
|
23
|
+
"@oinone/kunlun-vue-widget": "6.2.10",
|
|
24
24
|
"@wangeditor/editor": "5.1.23",
|
|
25
25
|
"@wangeditor/editor-for-vue": "5.1.11",
|
|
26
26
|
"@wangeditor/plugin-upload-attachment": "1.1.0",
|
|
@@ -3,6 +3,7 @@ import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
|
|
|
3
3
|
import { SPI } from '@oinone/kunlun-spi';
|
|
4
4
|
import { RowContext } from '@oinone/kunlun-vue-ui';
|
|
5
5
|
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
6
|
+
import { toString } from 'lodash-es';
|
|
6
7
|
import { createVNode, VNode } from 'vue';
|
|
7
8
|
import { BaseFieldWidget, BaseTableFieldWidget } from '../../../basic';
|
|
8
9
|
import { OptionColorStyle } from '../../FieldCommonEnum';
|
|
@@ -13,7 +14,7 @@ import TableEnum from '../enum/TableEnum.vue';
|
|
|
13
14
|
BaseFieldWidget.Token({
|
|
14
15
|
viewType: ViewType.Table,
|
|
15
16
|
ttype: ModelFieldType.Boolean,
|
|
16
|
-
widget: ['Select', '
|
|
17
|
+
widget: ['Select', 'Radio']
|
|
17
18
|
})
|
|
18
19
|
)
|
|
19
20
|
export class TableBooleanSelectFieldWidget extends BaseTableFieldWidget<string | string[], RuntimeEnumerationField> {
|
|
@@ -35,9 +36,13 @@ export class TableBooleanSelectFieldWidget extends BaseTableFieldWidget<string |
|
|
|
35
36
|
@Widget.Method()
|
|
36
37
|
public renderDefaultSlot(context: RowContext): VNode[] | string {
|
|
37
38
|
const value = this.compute(context);
|
|
39
|
+
let stringValue: string | undefined;
|
|
40
|
+
if (value != null) {
|
|
41
|
+
stringValue = toString(value);
|
|
42
|
+
}
|
|
38
43
|
return [
|
|
39
44
|
createVNode(TableEnum, {
|
|
40
|
-
value,
|
|
45
|
+
value: stringValue,
|
|
41
46
|
currentValue: this.handleValue(value),
|
|
42
47
|
options: this.options,
|
|
43
48
|
optionColor: this.optionColor,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ModelFieldType, ViewType } from '@oinone/kunlun-meta';
|
|
2
|
-
import { defaultYearFormat, defaultYearValueFormat } from '@oinone/kunlun-shared';
|
|
2
|
+
import { DateUtil, defaultYearFormat, defaultYearValueFormat } from '@oinone/kunlun-shared';
|
|
3
3
|
import { SPI } from '@oinone/kunlun-spi';
|
|
4
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
5
|
+
import { isNil } from 'lodash-es';
|
|
4
6
|
import { BaseFieldWidget } from '../../../basic';
|
|
5
7
|
import { TableDateTimeFieldWidget } from './TableDateTimeFieldWidget';
|
|
6
8
|
|
|
@@ -11,6 +13,33 @@ import { TableDateTimeFieldWidget } from './TableDateTimeFieldWidget';
|
|
|
11
13
|
})
|
|
12
14
|
)
|
|
13
15
|
export class TableYearFieldWidget extends TableDateTimeFieldWidget {
|
|
16
|
+
@Widget.Method()
|
|
17
|
+
public renderDefaultSlot(context) {
|
|
18
|
+
const value = this.compute(context);
|
|
19
|
+
let cv;
|
|
20
|
+
if (isNil(value)) {
|
|
21
|
+
cv = '';
|
|
22
|
+
} else {
|
|
23
|
+
let format = DateUtil.fetchDatetimeFormat(
|
|
24
|
+
{ hasDateFormat: this.hasDateFormat, hasTimeFormat: this.hasTimeFormat },
|
|
25
|
+
this.format,
|
|
26
|
+
this.getDateFormat(context),
|
|
27
|
+
this.getTimeFormat(context),
|
|
28
|
+
this.convertFormat,
|
|
29
|
+
this.convertDateFormat,
|
|
30
|
+
this.convertTimeFormat
|
|
31
|
+
);
|
|
32
|
+
if (!format) {
|
|
33
|
+
format = this.defaultFormat;
|
|
34
|
+
}
|
|
35
|
+
const datetimeFormatValue = DateUtil.dateFormat(DateUtil.toDate(value, this.valueFormat), format);
|
|
36
|
+
if (datetimeFormatValue) {
|
|
37
|
+
cv = datetimeFormatValue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return cv;
|
|
41
|
+
}
|
|
42
|
+
|
|
14
43
|
protected get defaultFormat() {
|
|
15
44
|
return defaultYearFormat;
|
|
16
45
|
}
|
|
@@ -9,8 +9,8 @@ import DefaultTableImage from './DefaultTableImage.vue';
|
|
|
9
9
|
@SPI.ClassFactory(
|
|
10
10
|
BaseFieldWidget.Token({
|
|
11
11
|
viewType: ViewType.Table,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
ttype: [ModelFieldType.String, ModelFieldType.Text],
|
|
13
|
+
widget: 'UploadImg'
|
|
14
14
|
})
|
|
15
15
|
)
|
|
16
16
|
export class TableStringUploadImageFieldWidget extends BaseTableFieldWidget {
|
|
@@ -61,6 +61,7 @@ export class TableWidget<Props extends TableWidgetProps = TableWidgetProps> exte
|
|
|
61
61
|
|
|
62
62
|
@Widget.Provide()
|
|
63
63
|
protected get cellWidth() {
|
|
64
|
+
// fixme @zbh 20250723 请使用语义明确的dsl属性名称
|
|
64
65
|
const { autoColumnWidth } = this.getDsl();
|
|
65
66
|
if (autoColumnWidth) {
|
|
66
67
|
return 'auto';
|
|
@@ -69,6 +70,7 @@ export class TableWidget<Props extends TableWidgetProps = TableWidgetProps> exte
|
|
|
69
70
|
|
|
70
71
|
@Widget.Provide()
|
|
71
72
|
protected get cellMinWidth() {
|
|
73
|
+
// fixme @zbh 20250723 请使用语义明确的dsl属性名称
|
|
72
74
|
const { minFieldWidth } = this.getDsl();
|
|
73
75
|
if (minFieldWidth) {
|
|
74
76
|
return StyleHelper.px(minFieldWidth) as string;
|
|
@@ -119,7 +121,9 @@ export class TableWidget<Props extends TableWidgetProps = TableWidgetProps> exte
|
|
|
119
121
|
*/
|
|
120
122
|
@Widget.Reactive()
|
|
121
123
|
protected get autoLineHeight(): boolean {
|
|
122
|
-
const autoLineHeight = Optional.ofNullable(this.getDsl().autoLineHeight)
|
|
124
|
+
const autoLineHeight = Optional.ofNullable(this.getDsl().autoLineHeight)
|
|
125
|
+
.map(BooleanHelper.toBoolean)
|
|
126
|
+
.orElse(undefined);
|
|
123
127
|
|
|
124
128
|
if (typeof autoLineHeight === 'boolean') {
|
|
125
129
|
return autoLineHeight;
|