@ibiz-template/vue3-util 0.5.7-alpha.3 → 0.5.7-alpha.5
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/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/code-list/code-list.d.ts +2 -2
- package/es/panel-component/grid-container/grid-container.d.ts +2 -0
- package/es/panel-component/grid-container/grid-container.d.ts.map +1 -1
- package/es/panel-component/grid-container/index.d.ts +2 -0
- package/es/panel-component/grid-container/index.d.ts.map +1 -1
- package/es/props/editor/autocomplete.d.ts +2 -2
- package/es/props/editor/check-box-list.d.ts +2 -2
- package/es/props/editor/check-box.d.ts +2 -2
- package/es/props/editor/data-picker.d.ts +2 -2
- package/es/props/editor/date-picker.d.ts +2 -2
- package/es/props/editor/date-range.d.ts +2 -2
- package/es/props/editor/dropdown-list.d.ts +2 -2
- package/es/props/editor/list-box.d.ts +2 -2
- package/es/props/editor/number-range.d.ts +2 -2
- package/es/props/editor/radio-button-list.d.ts +2 -2
- package/es/props/editor/rate.d.ts +2 -2
- package/es/props/editor/raw.d.ts +2 -2
- package/es/props/editor/slider.d.ts +2 -2
- package/es/props/editor/span.d.ts +2 -2
- package/es/props/editor/stepper.d.ts +2 -2
- package/es/props/editor/switch.d.ts +2 -2
- package/es/props/editor/text-box.d.ts +2 -2
- package/es/util/store/app-store/app-store.d.ts +3 -82
- package/es/util/store/app-store/app-store.d.ts.map +1 -1
- package/es/util/store/app-store/app-store.mjs +1 -8
- package/package.json +6 -7
- package/src/util/store/app-store/app-store.ts +3 -14
- package/es/util/store/async-action/async-action.d.ts +0 -56
- package/es/util/store/async-action/async-action.d.ts.map +0 -1
- package/es/util/store/async-action/async-action.mjs +0 -80
- package/src/util/store/async-action/async-action.ts +0 -122
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function getListBoxProps<C>(): {
|
|
11
|
-
value: (
|
|
11
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
12
12
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
13
13
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
14
14
|
disabled: {
|
|
@@ -43,7 +43,7 @@ export declare function getGridListBoxProps<C>(): {
|
|
|
43
43
|
hasError: {
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
};
|
|
46
|
-
value: (
|
|
46
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
47
47
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
48
48
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
49
49
|
disabled: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getNumberRangeProps<C>(): {
|
|
9
|
-
value: (
|
|
9
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridNumberRangeProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (
|
|
42
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function getRadioProps<C>(): {
|
|
11
|
-
value: (
|
|
11
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
12
12
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
13
13
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
14
14
|
disabled: {
|
|
@@ -43,7 +43,7 @@ export declare function getGridRadioProps<C>(): {
|
|
|
43
43
|
hasError: {
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
};
|
|
46
|
-
value: (
|
|
46
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
47
47
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
48
48
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
49
49
|
disabled: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getRateProps<C>(): {
|
|
9
|
-
value: (
|
|
9
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridRateProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (
|
|
42
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
package/es/props/editor/raw.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getRawProps<C>(): {
|
|
9
|
-
value: (ArrayConstructor |
|
|
9
|
+
value: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridRawProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (ArrayConstructor |
|
|
42
|
+
value: (ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getSliderProps<C>(): {
|
|
9
|
-
value: (
|
|
9
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridSliderProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (
|
|
42
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function getSpanProps<C>(): {
|
|
11
|
-
value: (ObjectConstructor | ArrayConstructor |
|
|
11
|
+
value: (ObjectConstructor | ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
12
12
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
13
13
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
14
14
|
disabled: {
|
|
@@ -43,7 +43,7 @@ export declare function getGridSpanProps<C>(): {
|
|
|
43
43
|
hasError: {
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
};
|
|
46
|
-
value: (ObjectConstructor | ArrayConstructor |
|
|
46
|
+
value: (ObjectConstructor | ArrayConstructor | StringConstructor | NumberConstructor)[];
|
|
47
47
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
48
48
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
49
49
|
disabled: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getStepperProps<C>(): {
|
|
9
|
-
value: (
|
|
9
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridStepperProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (
|
|
42
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @returns {*}
|
|
7
7
|
*/
|
|
8
8
|
export declare function getSwitchProps<C>(): {
|
|
9
|
-
value: (
|
|
9
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
10
10
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
11
11
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
12
12
|
disabled: {
|
|
@@ -39,7 +39,7 @@ export declare function getGridSwitchProps<C>(): {
|
|
|
39
39
|
hasError: {
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
value: (
|
|
42
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
43
43
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
44
44
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
45
45
|
disabled: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function getInputProps<C>(): {
|
|
11
|
-
value: (
|
|
11
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
12
12
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
13
13
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
14
14
|
disabled: {
|
|
@@ -43,7 +43,7 @@ export declare function getGridInputProps<C>(): {
|
|
|
43
43
|
hasError: {
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
};
|
|
46
|
-
value: (
|
|
46
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
47
47
|
controller: import("..").RequiredProp<import("vue").PropType<C>, undefined, undefined>;
|
|
48
48
|
data: import("..").RequiredProp<import("vue").PropType<IData>, undefined, undefined>;
|
|
49
49
|
disabled: {
|
|
@@ -1,89 +1,10 @@
|
|
|
1
|
-
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
2
|
-
import { Ref } from 'vue';
|
|
3
1
|
export interface IAppStore {
|
|
4
|
-
allAsyncActions: Ref<IPortalAsyncAction[]>;
|
|
5
|
-
recentAsyncActions: IPortalAsyncAction[];
|
|
6
2
|
}
|
|
7
3
|
export declare const useAppStore: import("pinia").StoreDefinition<"appStore", import("pinia")._UnwrapAll<Pick<{
|
|
8
|
-
appStore:
|
|
9
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
10
|
-
recentAsyncActions: {
|
|
11
|
-
asyncacitonid: string;
|
|
12
|
-
asyncacitonname: string;
|
|
13
|
-
fulltopictag: string;
|
|
14
|
-
srfdcid: string;
|
|
15
|
-
dcsystemid: string;
|
|
16
|
-
actiontype: string;
|
|
17
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
18
|
-
actionresult?: unknown;
|
|
19
|
-
stepinfo?: string | undefined;
|
|
20
|
-
completionrate?: number | undefined;
|
|
21
|
-
asyncresultdownloadurl?: string | undefined;
|
|
22
|
-
actionparam?: unknown;
|
|
23
|
-
actionparam2?: unknown;
|
|
24
|
-
actionparam3?: unknown;
|
|
25
|
-
actionparam4?: unknown;
|
|
26
|
-
begintime: string;
|
|
27
|
-
endtime: string;
|
|
28
|
-
createman: string;
|
|
29
|
-
createdate: string;
|
|
30
|
-
updateman: string;
|
|
31
|
-
updatedate: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
4
|
+
appStore: IAppStore;
|
|
34
5
|
}, "appStore">>, Pick<{
|
|
35
|
-
appStore:
|
|
36
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
37
|
-
recentAsyncActions: {
|
|
38
|
-
asyncacitonid: string;
|
|
39
|
-
asyncacitonname: string;
|
|
40
|
-
fulltopictag: string;
|
|
41
|
-
srfdcid: string;
|
|
42
|
-
dcsystemid: string;
|
|
43
|
-
actiontype: string;
|
|
44
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
45
|
-
actionresult?: unknown;
|
|
46
|
-
stepinfo?: string | undefined;
|
|
47
|
-
completionrate?: number | undefined;
|
|
48
|
-
asyncresultdownloadurl?: string | undefined;
|
|
49
|
-
actionparam?: unknown;
|
|
50
|
-
actionparam2?: unknown;
|
|
51
|
-
actionparam3?: unknown;
|
|
52
|
-
actionparam4?: unknown;
|
|
53
|
-
begintime: string;
|
|
54
|
-
endtime: string;
|
|
55
|
-
createman: string;
|
|
56
|
-
createdate: string;
|
|
57
|
-
updateman: string;
|
|
58
|
-
updatedate: string;
|
|
59
|
-
}[];
|
|
60
|
-
};
|
|
6
|
+
appStore: IAppStore;
|
|
61
7
|
}, never>, Pick<{
|
|
62
|
-
appStore:
|
|
63
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
64
|
-
recentAsyncActions: {
|
|
65
|
-
asyncacitonid: string;
|
|
66
|
-
asyncacitonname: string;
|
|
67
|
-
fulltopictag: string;
|
|
68
|
-
srfdcid: string;
|
|
69
|
-
dcsystemid: string;
|
|
70
|
-
actiontype: string;
|
|
71
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
72
|
-
actionresult?: unknown;
|
|
73
|
-
stepinfo?: string | undefined;
|
|
74
|
-
completionrate?: number | undefined;
|
|
75
|
-
asyncresultdownloadurl?: string | undefined;
|
|
76
|
-
actionparam?: unknown;
|
|
77
|
-
actionparam2?: unknown;
|
|
78
|
-
actionparam3?: unknown;
|
|
79
|
-
actionparam4?: unknown;
|
|
80
|
-
begintime: string;
|
|
81
|
-
endtime: string;
|
|
82
|
-
createman: string;
|
|
83
|
-
createdate: string;
|
|
84
|
-
updateman: string;
|
|
85
|
-
updatedate: string;
|
|
86
|
-
}[];
|
|
87
|
-
};
|
|
8
|
+
appStore: IAppStore;
|
|
88
9
|
}, never>>;
|
|
89
10
|
//# sourceMappingURL=app-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-store.d.ts","sourceRoot":"","sources":["../../../../src/util/store/app-store/app-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-store.d.ts","sourceRoot":"","sources":["../../../../src/util/store/app-store/app-store.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;CAAG;AAE7B,eAAO,MAAM,WAAW;;;;;;UAItB,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
2
|
import { reactive } from 'vue';
|
|
3
|
-
import { useAsyncAction } from '../async-action/async-action.mjs';
|
|
4
3
|
|
|
5
4
|
"use strict";
|
|
6
5
|
const useAppStore = defineStore("appStore", () => {
|
|
7
|
-
const
|
|
8
|
-
const appStore = reactive({
|
|
9
|
-
allAsyncActions,
|
|
10
|
-
get recentAsyncActions() {
|
|
11
|
-
return recentAsyncActions.value;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
6
|
+
const appStore = reactive({});
|
|
14
7
|
return { appStore };
|
|
15
8
|
});
|
|
16
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.5.7-alpha.
|
|
3
|
+
"version": "0.5.7-alpha.5",
|
|
4
4
|
"description": "vue3 工具包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@ibiz-template/cli": "^0.3.10",
|
|
35
|
-
"@ibiz-template/core": "^0.5.7-alpha.
|
|
36
|
-
"@ibiz-template/runtime": "^0.5.7-alpha.
|
|
35
|
+
"@ibiz-template/core": "^0.5.7-alpha.5",
|
|
36
|
+
"@ibiz-template/runtime": "^0.5.7-alpha.5",
|
|
37
37
|
"@ibiz-template/theme": "^0.5.7-alpha.0",
|
|
38
|
-
"@ibiz/model-core": "^0.1.
|
|
38
|
+
"@ibiz/model-core": "^0.1.9",
|
|
39
39
|
"@types/path-browserify": "^1.0.2",
|
|
40
40
|
"@types/qs": "^6.9.11",
|
|
41
41
|
"@types/systemjs": "^6.13.5",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
54
54
|
"@ibiz-template/runtime": "^0.5.0-beta.0",
|
|
55
|
-
"@ibiz/model-core": "^0.1.
|
|
55
|
+
"@ibiz/model-core": "^0.1.9",
|
|
56
56
|
"dayjs": "^1.11.10",
|
|
57
57
|
"path-browserify": "^1.0.1",
|
|
58
58
|
"pinia": "^2.1.7",
|
|
@@ -61,6 +61,5 @@
|
|
|
61
61
|
"ramda": "^0.29.0",
|
|
62
62
|
"vue": "^3.3.4",
|
|
63
63
|
"vue-router": "^4.2.4"
|
|
64
|
-
}
|
|
65
|
-
"gitHead": "b23913f86bad00bf9f2c31afda41556ed5432f36"
|
|
64
|
+
}
|
|
66
65
|
}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
2
1
|
import { defineStore } from 'pinia';
|
|
3
|
-
import { reactive
|
|
4
|
-
import { useAsyncAction } from '../async-action/async-action';
|
|
2
|
+
import { reactive } from 'vue';
|
|
5
3
|
|
|
6
|
-
export interface IAppStore {
|
|
7
|
-
allAsyncActions: Ref<IPortalAsyncAction[]>;
|
|
8
|
-
recentAsyncActions: IPortalAsyncAction[];
|
|
9
|
-
}
|
|
4
|
+
export interface IAppStore {}
|
|
10
5
|
|
|
11
6
|
export const useAppStore = defineStore('appStore', () => {
|
|
12
|
-
const
|
|
13
|
-
const appStore = reactive<IAppStore>({
|
|
14
|
-
allAsyncActions,
|
|
15
|
-
get recentAsyncActions() {
|
|
16
|
-
return recentAsyncActions.value;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
7
|
+
const appStore = reactive<IAppStore>({});
|
|
19
8
|
|
|
20
9
|
return { appStore };
|
|
21
10
|
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 使用异步操作消息
|
|
3
|
-
* @author lxm
|
|
4
|
-
* @date 2023-11-14 03:17:28
|
|
5
|
-
* @export
|
|
6
|
-
* @return {*}
|
|
7
|
-
*/
|
|
8
|
-
export declare function useAsyncAction(): {
|
|
9
|
-
allAsyncActions: import("vue").Ref<{
|
|
10
|
-
asyncacitonid: string;
|
|
11
|
-
asyncacitonname: string;
|
|
12
|
-
fulltopictag: string;
|
|
13
|
-
srfdcid: string;
|
|
14
|
-
dcsystemid: string;
|
|
15
|
-
actiontype: string;
|
|
16
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
17
|
-
actionresult?: unknown;
|
|
18
|
-
stepinfo?: string | undefined;
|
|
19
|
-
completionrate?: number | undefined;
|
|
20
|
-
asyncresultdownloadurl?: string | undefined;
|
|
21
|
-
actionparam?: unknown;
|
|
22
|
-
actionparam2?: unknown;
|
|
23
|
-
actionparam3?: unknown;
|
|
24
|
-
actionparam4?: unknown;
|
|
25
|
-
begintime: string;
|
|
26
|
-
endtime: string;
|
|
27
|
-
createman: string;
|
|
28
|
-
createdate: string;
|
|
29
|
-
updateman: string;
|
|
30
|
-
updatedate: string;
|
|
31
|
-
}[]>;
|
|
32
|
-
recentAsyncActions: import("vue").ComputedRef<{
|
|
33
|
-
asyncacitonid: string;
|
|
34
|
-
asyncacitonname: string;
|
|
35
|
-
fulltopictag: string;
|
|
36
|
-
srfdcid: string;
|
|
37
|
-
dcsystemid: string;
|
|
38
|
-
actiontype: string;
|
|
39
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
40
|
-
actionresult?: unknown;
|
|
41
|
-
stepinfo?: string | undefined;
|
|
42
|
-
completionrate?: number | undefined;
|
|
43
|
-
asyncresultdownloadurl?: string | undefined;
|
|
44
|
-
actionparam?: unknown;
|
|
45
|
-
actionparam2?: unknown;
|
|
46
|
-
actionparam3?: unknown;
|
|
47
|
-
actionparam4?: unknown;
|
|
48
|
-
begintime: string;
|
|
49
|
-
endtime: string;
|
|
50
|
-
createman: string;
|
|
51
|
-
createdate: string;
|
|
52
|
-
updateman: string;
|
|
53
|
-
updatedate: string;
|
|
54
|
-
}[]>;
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=async-action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-action.d.ts","sourceRoot":"","sources":["../../../../src/util/store/async-action/async-action.ts"],"names":[],"mappings":"AAiDA;;;;;;GAMG;AACH,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiE7B"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
|
-
import { isNumber, isNil } from 'lodash-es';
|
|
3
|
-
import { ref, computed, onUnmounted } from 'vue';
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
function formatAsyncAction(data) {
|
|
7
|
-
const dateFields = [
|
|
8
|
-
"begintime",
|
|
9
|
-
"endtime",
|
|
10
|
-
"createdate",
|
|
11
|
-
"updatedate"
|
|
12
|
-
];
|
|
13
|
-
dateFields.forEach((key) => {
|
|
14
|
-
if (isNumber(data[key])) {
|
|
15
|
-
data[key] = dayjs(data[key]).format("YYYY-MM-DD HH:mm:ss");
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
if (!isNil(data.actionresult)) {
|
|
19
|
-
try {
|
|
20
|
-
const json = JSON.parse(data.actionresult);
|
|
21
|
-
data.actionresult = json;
|
|
22
|
-
} catch (error) {
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (!isNil(data.completionrate)) {
|
|
26
|
-
const num = Number(data.completionrate);
|
|
27
|
-
if (Number.isNaN(num)) {
|
|
28
|
-
data.completionrate = void 0;
|
|
29
|
-
} else {
|
|
30
|
-
data.completionrate = num;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function useAsyncAction() {
|
|
36
|
-
const allAsyncActions = ref([]);
|
|
37
|
-
const showLength = ref(0);
|
|
38
|
-
const recentAsyncActions = computed(() => {
|
|
39
|
-
return allAsyncActions.value.filter(
|
|
40
|
-
(_item, index) => index < showLength.value
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
const load = async () => {
|
|
44
|
-
const res = await ibiz.asyncAction.fetch();
|
|
45
|
-
res.data.forEach(formatAsyncAction);
|
|
46
|
-
allAsyncActions.value = res.data;
|
|
47
|
-
};
|
|
48
|
-
const asyncActionCallBack = (msg) => {
|
|
49
|
-
if (!msg.data || msg.subtype !== "ASYNCACTION") {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
console.log("\u539F\u59CB\u6570\u636E", msg);
|
|
53
|
-
const asyncAction = formatAsyncAction(msg.data);
|
|
54
|
-
console.log("\u683C\u5F0F\u5316\u540E\u6570\u636E", asyncAction);
|
|
55
|
-
const findIndex = allAsyncActions.value.findIndex(
|
|
56
|
-
(item) => item.asyncacitonid === asyncAction.asyncacitonid
|
|
57
|
-
);
|
|
58
|
-
if (findIndex === -1) {
|
|
59
|
-
allAsyncActions.value.unshift(asyncAction);
|
|
60
|
-
showLength.value += 1;
|
|
61
|
-
} else {
|
|
62
|
-
const isShow = findIndex >= showLength.value;
|
|
63
|
-
if (isShow) {
|
|
64
|
-
allAsyncActions.value.splice(findIndex, 1);
|
|
65
|
-
allAsyncActions.value.unshift(asyncAction);
|
|
66
|
-
showLength.value += 1;
|
|
67
|
-
} else {
|
|
68
|
-
allAsyncActions.value.splice(findIndex, 1, asyncAction);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
load();
|
|
73
|
-
ibiz.mc.command.asyncAction.on(asyncActionCallBack);
|
|
74
|
-
onUnmounted(() => {
|
|
75
|
-
ibiz.mc.command.asyncAction.off(asyncActionCallBack);
|
|
76
|
-
});
|
|
77
|
-
return { allAsyncActions, recentAsyncActions };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export { useAsyncAction };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
2
|
-
|
|
3
|
-
import { IPortalAsyncAction, IPortalMessage } from '@ibiz-template/core';
|
|
4
|
-
import dayjs from 'dayjs';
|
|
5
|
-
import { isNil, isNumber } from 'lodash-es';
|
|
6
|
-
import { computed, onUnmounted, ref } from 'vue';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 格式化数据
|
|
10
|
-
* @author lxm
|
|
11
|
-
* @date 2023-11-14 09:02:49
|
|
12
|
-
* @param {IPortalAsyncAction} data
|
|
13
|
-
* @return {*} {IPortalAsyncAction}
|
|
14
|
-
*/
|
|
15
|
-
function formatAsyncAction(data: IPortalAsyncAction): IPortalAsyncAction {
|
|
16
|
-
// 处理时间日期为毫秒值时,转换成字符串。
|
|
17
|
-
const dateFields = [
|
|
18
|
-
'begintime',
|
|
19
|
-
'endtime',
|
|
20
|
-
'createdate',
|
|
21
|
-
'updatedate',
|
|
22
|
-
] as const;
|
|
23
|
-
dateFields.forEach(key => {
|
|
24
|
-
if (isNumber(data[key])) {
|
|
25
|
-
data[key] = dayjs(data[key]).format('YYYY-MM-DD HH:mm:ss');
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
if (!isNil(data.actionresult)) {
|
|
30
|
-
try {
|
|
31
|
-
const json = JSON.parse(data.actionresult as string);
|
|
32
|
-
data.actionresult = json;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
// 不是对象类型就是字符串。
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!isNil(data.completionrate)) {
|
|
39
|
-
const num = Number(data.completionrate);
|
|
40
|
-
if (Number.isNaN(num)) {
|
|
41
|
-
data.completionrate = undefined;
|
|
42
|
-
} else {
|
|
43
|
-
data.completionrate = num;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 使用异步操作消息
|
|
52
|
-
* @author lxm
|
|
53
|
-
* @date 2023-11-14 03:17:28
|
|
54
|
-
* @export
|
|
55
|
-
* @return {*}
|
|
56
|
-
*/
|
|
57
|
-
export function useAsyncAction() {
|
|
58
|
-
/** 所有消息数据 */
|
|
59
|
-
const allAsyncActions = ref<IPortalAsyncAction[]>([]);
|
|
60
|
-
/** 显示的长度 */
|
|
61
|
-
const showLength = ref(0);
|
|
62
|
-
|
|
63
|
-
/** 显示的消息数据 */
|
|
64
|
-
const recentAsyncActions = computed(() => {
|
|
65
|
-
return allAsyncActions.value.filter(
|
|
66
|
-
(_item, index) => index < showLength.value,
|
|
67
|
-
);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const load = async () => {
|
|
71
|
-
const res = await ibiz.asyncAction.fetch();
|
|
72
|
-
res.data.forEach(formatAsyncAction);
|
|
73
|
-
allAsyncActions.value = res.data;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* 异步消息变更回调处理
|
|
78
|
-
* @author lxm
|
|
79
|
-
* @date 2023-11-14 03:53:08
|
|
80
|
-
*/
|
|
81
|
-
const asyncActionCallBack = (msg: IPortalMessage) => {
|
|
82
|
-
if (!msg.data || msg.subtype !== 'ASYNCACTION') {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
console.log('原始数据', msg);
|
|
86
|
-
|
|
87
|
-
const asyncAction = formatAsyncAction(msg.data as IPortalAsyncAction);
|
|
88
|
-
|
|
89
|
-
console.log('格式化后数据', asyncAction);
|
|
90
|
-
|
|
91
|
-
const findIndex = allAsyncActions.value.findIndex(
|
|
92
|
-
item => item.asyncacitonid === asyncAction.asyncacitonid,
|
|
93
|
-
);
|
|
94
|
-
if (findIndex === -1) {
|
|
95
|
-
// 不存在的数据补充到最开始,并显示长度加一
|
|
96
|
-
allAsyncActions.value.unshift(asyncAction);
|
|
97
|
-
showLength.value += 1;
|
|
98
|
-
} else {
|
|
99
|
-
const isShow = findIndex >= showLength.value;
|
|
100
|
-
// 找的到但是不在显示列表里,移到开头,并增加长度
|
|
101
|
-
if (isShow) {
|
|
102
|
-
allAsyncActions.value.splice(findIndex, 1);
|
|
103
|
-
allAsyncActions.value.unshift(asyncAction);
|
|
104
|
-
showLength.value += 1;
|
|
105
|
-
} else {
|
|
106
|
-
allAsyncActions.value.splice(findIndex, 1, asyncAction);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// *初始化操作
|
|
112
|
-
load();
|
|
113
|
-
|
|
114
|
-
// 监听异步操作消息变更
|
|
115
|
-
ibiz.mc.command.asyncAction.on(asyncActionCallBack);
|
|
116
|
-
// 销毁时删除监听
|
|
117
|
-
onUnmounted(() => {
|
|
118
|
-
ibiz.mc.command.asyncAction.off(asyncActionCallBack);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
return { allAsyncActions, recentAsyncActions };
|
|
122
|
-
}
|