xframelib 0.5.7 → 0.5.8

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/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  基于 VUE3+Hprose+Typescript 的前端框架
4
4
 
5
+ - v0.5.8 修改 VueWindow 报 fixPosition 错误;重构升级 widget 加载过程;升级依赖基础库版本
5
6
  - v0.5.7 修改 init 初始化增加 sysGroup 参数;增加 Global.SystemGroup 字段,Axios 和 Hprose 的 Http 请求头加入 sysgroup 系统分组名;解决 Global 变量的循环引用,增加 SysConfig 的 UI 下的 GrayMode 参数、部分 ServiceURL 下参数,修改一些小 BUG;
6
7
  - v0.5.6 修改 init 初始化方法增加 sysID 参数;增加 Global.SystemID 字段,Axios 和 Hprose 的 Http 请求头加入 sysid;
7
8
  - v0.5.5 截取捕捉后台返回的有用异常信息,重新抛出;异常警告输出统一模型增加 isExceptionInfo 字段;更新依赖库;
@@ -57,11 +58,57 @@
57
58
 
58
59
  or
59
60
 
60
- `npm i -D xframelib`
61
+ `npm i xframelib`
61
62
 
62
63
  ## Usage
63
64
 
64
- 暂无
65
+ main.ts 文件
66
+ In Typescript:
67
+
68
+ ```js
69
+ import { createApp } from 'vue';
70
+ import App from './App.vue';
71
+ //模板添加的
72
+ import { setupRouter } from './router/index';
73
+ import { init } from 'xframelib';
74
+ import 'xframelib/dist/index.css';
75
+ import { message } from 'ant-design-vue';
76
+ import 'ant-design-vue/es/message/style/index.css';
77
+ import 'ant-design-vue/es/modal/style/index.css';
78
+ import { setupI18n } from '@/locales/setupI18n';
79
+ //dev阶段打开,build注销
80
+ import 'ant-design-vue/dist/antd.css';
81
+ import { getSystemPKG, getSystemID } from '@/utils/sysTool';
82
+ import { createPinia } from 'pinia';
83
+ message.config({
84
+ top: `100px`,
85
+ duration: 1,
86
+ maxCount: 3
87
+ });
88
+ //绑定消息和初始化xframe
89
+ //系统ID,唯一标识
90
+ const sysID = getSystemID();
91
+ //分组名,工程名
92
+ const sysGroup = getSystemPKG().name;
93
+ //初始化
94
+ init(message, sysID, sysGroup);
95
+ // 创建pinia 实例
96
+ const pinia = createPinia();
97
+ const app = createApp(App);
98
+ // 挂载到 Vue 根实例上
99
+ app.use(pinia);
100
+ //注册全局常用的ant-design-vue组件
101
+ if (import.meta.env.DEV) {
102
+ import('ant-design-vue/dist/antd.js').then(it => {
103
+ app.use(it.default);
104
+ });
105
+ }
106
+
107
+ setupI18n(app).then(() => {
108
+ setupRouter(app);
109
+ app.mount('#app');
110
+ });
111
+ ```
65
112
 
66
113
  ### Working with hprose
67
114
 
@@ -15,11 +15,17 @@ export interface ILayoutContainer {
15
15
  }
16
16
  declare class LayoutManager {
17
17
  private layoutState;
18
- private widgetCofig;
19
18
  private layoutMap;
20
19
  private preConditionMap;
21
20
  private widgetsLoadedSet;
22
- constructor(layoutState: ILayoutContainer, widgetCofig: Array<IWidgetConfig>);
21
+ private widgetConfig;
22
+ private _LayoutID;
23
+ constructor(layoutState: ILayoutContainer, allWidgetConfig: Array<IWidgetConfig>, layoutID?: string);
24
+ /**
25
+ * 所属的Layout布局对象ID
26
+ * @returns
27
+ */
28
+ getLayoutID(): string | undefined;
23
29
  /**
24
30
  * 获得widget配置参数
25
31
  * @returns
@@ -33,7 +39,7 @@ declare class LayoutManager {
33
39
  * 加载组件和子组件
34
40
  * @param widgetItem 组件对象
35
41
  */
36
- loadWidget(widgetItem: IWidgetConfig | string): void;
42
+ loadWidget(widgetItem: IWidgetConfig | string): Promise<void>;
37
43
  private loadOtherDependenceWidgets;
38
44
  private _loadWidget;
39
45
  /**
@@ -6,16 +6,20 @@ declare const _default: import("vue").DefineComponent<{
6
6
  required: true;
7
7
  default: () => never[];
8
8
  };
9
+ layoutID: {
10
+ type: StringConstructor;
11
+ default: undefined;
12
+ };
9
13
  layoutStyle: {
10
14
  type: ObjectConstructor;
11
15
  };
12
16
  }, {
13
- topContainerComponents: import("vue").Ref<Map<string, Object>> | undefined;
14
- centerbackComponents: import("vue").Ref<Map<string, Object>> | undefined;
15
- centerfrontComponents: import("vue").Ref<Map<string, Object>> | undefined;
16
- leftContainerComponents: import("vue").Ref<Map<string, Object>> | undefined;
17
- rightContainerComponents: import("vue").Ref<Map<string, Object>> | undefined;
18
- bottomContainerComponents: import("vue").Ref<Map<string, Object>> | undefined;
17
+ topContainerComponents: import("vue").Ref<Map<string, Object>>;
18
+ centerbackComponents: import("vue").Ref<Map<string, Object>>;
19
+ centerfrontComponents: import("vue").Ref<Map<string, Object>>;
20
+ leftContainerComponents: import("vue").Ref<Map<string, Object>>;
21
+ rightContainerComponents: import("vue").Ref<Map<string, Object>>;
22
+ bottomContainerComponents: import("vue").Ref<Map<string, Object>>;
19
23
  containerStyle: import("vue").ComputedRef<Record<string, any> | undefined>;
20
24
  topContainer?: import("vue").Ref<HTMLElement | undefined> | undefined;
21
25
  centerBackContainer?: import("vue").Ref<HTMLElement | undefined> | undefined;
@@ -24,16 +28,23 @@ declare const _default: import("vue").DefineComponent<{
24
28
  bottomContainer?: import("vue").Ref<HTMLElement | undefined> | undefined;
25
29
  leftContainer?: import("vue").Ref<HTMLElement | undefined> | undefined;
26
30
  rightContainer?: import("vue").Ref<HTMLElement | undefined> | undefined;
27
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
31
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "containerLoaded"[], "containerLoaded", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
32
  widgetConfig: {
29
33
  type: PropType<IWidgetConfig[]>;
30
34
  required: true;
31
35
  default: () => never[];
32
36
  };
37
+ layoutID: {
38
+ type: StringConstructor;
39
+ default: undefined;
40
+ };
33
41
  layoutStyle: {
34
42
  type: ObjectConstructor;
35
43
  };
36
- }>>, {
44
+ }>> & {
45
+ onContainerLoaded?: ((...args: any[]) => any) | undefined;
46
+ }, {
37
47
  widgetConfig: IWidgetConfig[];
48
+ layoutID: string;
38
49
  }>;
39
50
  export default _default;
@@ -100,6 +100,7 @@ declare const _default: import("vue").DefineComponent<{
100
100
  styleTitlebar: import("vue").ComputedRef<any>;
101
101
  styleContent: import("vue").ComputedRef<any>;
102
102
  closeButtonClick: () => void;
103
+ fixPosition: () => void;
103
104
  } | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
104
105
  windowStyle: {
105
106
  type: ObjectConstructor;