@oinone/kunlun-vue-admin-base 6.2.2 → 6.2.4
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 +267 -79
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/action/server-actions/ServerActionWidget.d.ts +1 -0
- package/dist/types/src/field/form/m2o/address/FormM2OAddressFieldWidget.d.ts +11 -1
- package/dist/types/src/typing/model.d.ts +27 -12
- package/dist/types/src/view/login/LoginWidget.d.ts +5 -1
- package/dist/types/src/view/reset-password/ForgetPasswordWidget.d.ts +1 -1
- package/package.json +8 -8
- package/src/action/server-actions/ServerActionWidget.ts +17 -1
- package/src/basic/BaseI18nRouterWidget.ts +1 -1
- package/src/field/detail/common/DetailCommonField.vue +11 -5
- package/src/field/form/html/richtext/FormHtmlRichTextFieldWidget.ts +1 -1
- package/src/field/form/m2o/address/FormM2OAddressFieldWidget.ts +187 -12
- package/src/field/table/text/TableTextFieldWidget.ts +7 -4
- package/src/main-view/shared/SharedMainViewWidget.ts +5 -1
- package/src/permission/system-permission/style/permission.scss +18 -12
- package/src/spi-register/message-hub.ts +3 -3
- package/src/typing/model.ts +29 -12
- package/src/util/default-tree-definition.ts +11 -0
- package/src/view/login/LoginWidget.ts +22 -8
- package/src/view/reset-password/FirstResetPasswordWidget.ts +5 -1
- package/src/view/reset-password/ForgetPasswordWidget.ts +7 -3
package/src/typing/model.ts
CHANGED
|
@@ -3,35 +3,35 @@ import { ActiveRecord } from '@oinone/kunlun-engine';
|
|
|
3
3
|
export interface ResourceAddress extends ActiveRecord {
|
|
4
4
|
id?: string;
|
|
5
5
|
|
|
6
|
-
countryCode?: string;
|
|
7
|
-
countryName?: string;
|
|
6
|
+
countryCode?: string | null;
|
|
7
|
+
countryName?: string | null;
|
|
8
8
|
originCountry?: ResourceCountry;
|
|
9
9
|
|
|
10
|
-
provinceCode?: string;
|
|
11
|
-
provinceName?: string;
|
|
10
|
+
provinceCode?: string | null;
|
|
11
|
+
provinceName?: string | null;
|
|
12
12
|
originProvince?: ResourceProvince;
|
|
13
13
|
|
|
14
|
-
cityCode?: string;
|
|
15
|
-
cityName?: string;
|
|
14
|
+
cityCode?: string | null;
|
|
15
|
+
cityName?: string | null;
|
|
16
16
|
originCity?: ResourceCity;
|
|
17
17
|
|
|
18
|
-
districtCode?: string;
|
|
19
|
-
districtName?: string;
|
|
18
|
+
districtCode?: string | null;
|
|
19
|
+
districtName?: string | null;
|
|
20
20
|
originDistrict?: ResourceDistrict;
|
|
21
21
|
|
|
22
|
-
streetCode?: string;
|
|
23
|
-
streetName?: string;
|
|
22
|
+
streetCode?: string | null;
|
|
23
|
+
streetName?: string | null;
|
|
24
24
|
originStreet?: ResourceStreet;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* 详细地址
|
|
28
28
|
*/
|
|
29
|
-
street2?: string;
|
|
29
|
+
street2?: string | null;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* 完整地址
|
|
33
33
|
*/
|
|
34
|
-
fullAddress?: string;
|
|
34
|
+
fullAddress?: string | null;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export interface ResourceCountry extends ActiveRecord {
|
|
@@ -65,3 +65,20 @@ export interface ResourceStreet extends ActiveRecord {
|
|
|
65
65
|
code?: string;
|
|
66
66
|
name?: string;
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
export interface ResourceRegion extends ActiveRecord {
|
|
70
|
+
id?: string;
|
|
71
|
+
type?: AddressTypeEnum;
|
|
72
|
+
code?: string | null;
|
|
73
|
+
name?: string | null;
|
|
74
|
+
pCode?: string;
|
|
75
|
+
parent?: ResourceRegion;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export enum AddressTypeEnum {
|
|
79
|
+
Country = 'Country',
|
|
80
|
+
Province = 'Province',
|
|
81
|
+
City = 'City',
|
|
82
|
+
District = 'District',
|
|
83
|
+
Street = 'Street'
|
|
84
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XMLParse } from '@oinone/kunlun-dsl';
|
|
2
|
+
import { ExperimentalConfigManager } from '@oinone/kunlun-engine';
|
|
2
3
|
import { TreeNodeMetadata } from '../typing';
|
|
3
4
|
import { TreeUtils } from './tree-utils';
|
|
4
5
|
|
|
@@ -13,7 +14,17 @@ const defaultAddressTemplate = XMLParse.INSTANCE.parse(`<template>
|
|
|
13
14
|
</template>
|
|
14
15
|
`);
|
|
15
16
|
|
|
17
|
+
const defaultAddressTemplateNext = XMLParse.INSTANCE.parse(`<template>
|
|
18
|
+
<nodes>
|
|
19
|
+
<node model="resource.ResourceRegion" label="activeRecord.name" labelFields="name" selfReferences="parent" />
|
|
20
|
+
</nodes>
|
|
21
|
+
</template>
|
|
22
|
+
`);
|
|
23
|
+
|
|
16
24
|
export function generatorDefaultAddressTreeDefinition(): TreeNodeMetadata | undefined {
|
|
25
|
+
if (ExperimentalConfigManager.addressWidgetNext()) {
|
|
26
|
+
return TreeUtils.convert(defaultAddressTemplateNext);
|
|
27
|
+
}
|
|
17
28
|
return TreeUtils.convert(defaultAddressTemplate);
|
|
18
29
|
}
|
|
19
30
|
|
|
@@ -10,7 +10,14 @@ import {
|
|
|
10
10
|
translateValueByKey
|
|
11
11
|
} from '@oinone/kunlun-engine';
|
|
12
12
|
import { RuntimeConfig, SYSTEM_MODULE_NAME } from '@oinone/kunlun-meta';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
gql,
|
|
15
|
+
HttpClientError,
|
|
16
|
+
ILevel,
|
|
17
|
+
isFirstResetPasswordError,
|
|
18
|
+
isPicCodeError,
|
|
19
|
+
useMessageHub
|
|
20
|
+
} from '@oinone/kunlun-request';
|
|
14
21
|
import { Router } from '@oinone/kunlun-router';
|
|
15
22
|
import { http } from '@oinone/kunlun-service';
|
|
16
23
|
import { SPI } from '@oinone/kunlun-spi';
|
|
@@ -28,15 +35,17 @@ import {
|
|
|
28
35
|
LoginMode,
|
|
29
36
|
RuntimeLanguage
|
|
30
37
|
} from '@oinone/kunlun-vue-ui-common';
|
|
31
|
-
import {
|
|
32
|
-
import { toString } from 'lodash-es';
|
|
38
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
33
39
|
import { BaseI18nRouterWidget } from '../../basic/BaseI18nRouterWidget';
|
|
34
|
-
|
|
35
40
|
import { encrypt, homepageMaybeRuntimeContext } from '../../util';
|
|
36
41
|
import LoginComponent from './Login.vue';
|
|
37
42
|
|
|
38
|
-
@SPI.ClassFactory(
|
|
39
|
-
|
|
43
|
+
@SPI.ClassFactory(
|
|
44
|
+
RouterWidget.Token({
|
|
45
|
+
widget: 'Login'
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
export class LoginWidget extends BaseI18nRouterWidget {
|
|
40
49
|
protected moduleName = SYSTEM_MODULE_NAME.USER;
|
|
41
50
|
|
|
42
51
|
public errorMessages = defaultLoginErrorMessages;
|
|
@@ -601,7 +610,7 @@ export class LoginPageWidget extends BaseI18nRouterWidget {
|
|
|
601
610
|
return;
|
|
602
611
|
}
|
|
603
612
|
|
|
604
|
-
if (
|
|
613
|
+
if (isFirstResetPasswordError(errorCode)) {
|
|
605
614
|
// 首次登录需修改密码
|
|
606
615
|
this.router.push({ segments: [{ path: 'first' }] });
|
|
607
616
|
return;
|
|
@@ -635,7 +644,7 @@ export class LoginPageWidget extends BaseI18nRouterWidget {
|
|
|
635
644
|
const hub = useMessageHub(loginMessageHubName);
|
|
636
645
|
hub.subscribe((error) => {
|
|
637
646
|
const { errorCode } = error;
|
|
638
|
-
if (errorCode
|
|
647
|
+
if (isPicCodeError(errorCode)) {
|
|
639
648
|
this.getPicCode();
|
|
640
649
|
}
|
|
641
650
|
hub.unsubscribe();
|
|
@@ -689,3 +698,8 @@ export class LoginPageWidget extends BaseI18nRouterWidget {
|
|
|
689
698
|
});
|
|
690
699
|
}
|
|
691
700
|
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* @deprecated please using LoginWidget
|
|
704
|
+
*/
|
|
705
|
+
export const LoginPageWidget = LoginWidget;
|
|
@@ -9,7 +9,11 @@ import { UserService } from '../../service';
|
|
|
9
9
|
import FirstResetPassword from './FirstResetPassword.vue';
|
|
10
10
|
import { ForgetPasswordWidget } from './ForgetPasswordWidget';
|
|
11
11
|
|
|
12
|
-
@SPI.ClassFactory(
|
|
12
|
+
@SPI.ClassFactory(
|
|
13
|
+
RouterWidget.Token({
|
|
14
|
+
widget: 'FirstResetPassword'
|
|
15
|
+
})
|
|
16
|
+
)
|
|
13
17
|
export class FirstResetPasswordWidget extends ForgetPasswordWidget {
|
|
14
18
|
public initialize(config) {
|
|
15
19
|
super.initialize(config);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getMajorConfig, MajorConfig, translateValueByKey } from '@oinone/kunlun-engine';
|
|
2
|
+
import { SYSTEM_MODULE_NAME } from '@oinone/kunlun-meta';
|
|
2
3
|
import { Router } from '@oinone/kunlun-router';
|
|
3
4
|
import { http } from '@oinone/kunlun-service';
|
|
4
5
|
import { SPI } from '@oinone/kunlun-spi';
|
|
@@ -6,14 +7,17 @@ import { RouterWidget, useRouter } from '@oinone/kunlun-vue-router';
|
|
|
6
7
|
import { FormItemRule, OioFormInstance, OioMessage } from '@oinone/kunlun-vue-ui-antd';
|
|
7
8
|
import { SelectItem } from '@oinone/kunlun-vue-ui-common';
|
|
8
9
|
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
10
|
+
import { BaseI18nRouterWidget } from '../../basic';
|
|
9
11
|
import { PhoneCodeQueryService, UserService } from '../../service';
|
|
10
12
|
import { ResourceCountry } from '../../typing';
|
|
11
13
|
import ForgetPassword from './ForgetPassword.vue';
|
|
12
14
|
import { ResetPasswordData } from './typing';
|
|
13
|
-
import { BaseI18nRouterWidget } from '../../basic/BaseI18nRouterWidget';
|
|
14
|
-
import { SYSTEM_MODULE_NAME } from '@oinone/kunlun-meta';
|
|
15
15
|
|
|
16
|
-
@SPI.ClassFactory(
|
|
16
|
+
@SPI.ClassFactory(
|
|
17
|
+
RouterWidget.Token({
|
|
18
|
+
widget: 'ForgetPassword'
|
|
19
|
+
})
|
|
20
|
+
)
|
|
17
21
|
export class ForgetPasswordWidget extends BaseI18nRouterWidget {
|
|
18
22
|
protected moduleName = SYSTEM_MODULE_NAME.USER;
|
|
19
23
|
|