xframelib 0.5.5 → 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,9 @@
2
2
 
3
3
  基于 VUE3+Hprose+Typescript 的前端框架
4
4
 
5
+ - v0.5.8 修改 VueWindow 报 fixPosition 错误;重构升级 widget 加载过程;升级依赖基础库版本
6
+ - v0.5.7 修改 init 初始化增加 sysGroup 参数;增加 Global.SystemGroup 字段,Axios 和 Hprose 的 Http 请求头加入 sysgroup 系统分组名;解决 Global 变量的循环引用,增加 SysConfig 的 UI 下的 GrayMode 参数、部分 ServiceURL 下参数,修改一些小 BUG;
7
+ - v0.5.6 修改 init 初始化方法增加 sysID 参数;增加 Global.SystemID 字段,Axios 和 Hprose 的 Http 请求头加入 sysid;
5
8
  - v0.5.5 截取捕捉后台返回的有用异常信息,重新抛出;异常警告输出统一模型增加 isExceptionInfo 字段;更新依赖库;
6
9
  - v0.5.4 解决 IRole 相关模型类型未导出;LayoutManager.d.ts 输出两遍问题;完善 axios http 请求异常警告输出统一模型,发送 SysEvents.AxiosRequestErrorEvent 系统事件;
7
10
  - v0.5.3 撤销的版本
@@ -55,11 +58,57 @@
55
58
 
56
59
  or
57
60
 
58
- `npm i -D xframelib`
61
+ `npm i xframelib`
59
62
 
60
63
  ## Usage
61
64
 
62
- 暂无
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
+ ```
63
112
 
64
113
  ### Working with hprose
65
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: any;
14
- centerbackComponents: any;
15
- centerfrontComponents: any;
16
- leftContainerComponents: any;
17
- rightContainerComponents: any;
18
- bottomContainerComponents: any;
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;
@@ -1,26 +1,2 @@
1
- import ProxyClient from '../hprose/ProxyClient';
2
- import { InnerObject, XOptions } from './IModel';
1
+ import { InnerObject } from './IModel';
3
2
  export declare const Global: InnerObject;
4
- /**
5
- * 通过配置文件初始化系统
6
- * @param options 配置参数对象
7
- */
8
- export declare function initXFrame(options: XOptions): void;
9
- /**
10
- * 框架初始化
11
- * @param messageUI 消息UI
12
- * @param defaultHproseURL 默认HproseURL
13
- */
14
- export declare const init: (messageUI: any, defaultHproseURL?: string | undefined) => void;
15
- /**
16
- * 获取HproseProxy对象
17
- * @param hproseURL Hprose服务链接地址
18
- * @returns Hprose代理对象
19
- */
20
- export declare function getProxyClient(hproseURL?: string): ProxyClient | undefined;
21
- /**
22
- * 初始化Global.DefaultProxyClient对象
23
- * @param defaulthproseURL 默认的Hprose服务对象URL
24
- * @returns ProxyClient对象
25
- */
26
- export declare function initDefaultProxyClient(defaulthproseURL?: string): ProxyClient | undefined;
@@ -22,6 +22,15 @@ export interface InnerObject {
22
22
  * 布局管理对象
23
23
  */
24
24
  LayoutManager?: LayoutManager;
25
+ /**
26
+ * 系统ID标识
27
+ */
28
+ SystemID?: string;
29
+ /**
30
+ * 系统——工程项目名,分组名
31
+ * 例如:都是影像工程
32
+ */
33
+ SystemGroup?: string;
25
34
  [props: string]: any;
26
35
  }
27
36
  /**
@@ -30,5 +39,7 @@ export interface InnerObject {
30
39
  export interface XOptions {
31
40
  config?: any;
32
41
  message?: any;
42
+ sysID?: string;
43
+ sysGroup?: string;
33
44
  defaultHproseURL?: string;
34
45
  }
@@ -0,0 +1,20 @@
1
+ import ProxyClient from '../hprose/ProxyClient';
2
+ /**
3
+ * 框架初始化
4
+ * @param messageUI 消息UI,例如message
5
+ * @param sysID 系统的标识,工程名+版本的MD5值
6
+ * @param sysGroup 系统工程分组名,工程
7
+ */
8
+ export declare const init: (messageUI: any, sysID?: string | undefined, sysGroup?: string | undefined) => void;
9
+ /**
10
+ * 获取HproseProxy对象
11
+ * @param hproseURL Hprose服务链接地址
12
+ * @returns Hprose代理对象
13
+ */
14
+ export declare function getProxyClient(hproseURL?: string): ProxyClient | undefined;
15
+ /**
16
+ * 初始化Global.DefaultProxyClient对象
17
+ * @param defaulthproseURL 默认的Hprose服务对象URL
18
+ * @returns ProxyClient对象
19
+ */
20
+ export declare function initDefaultProxyClient(defaulthproseURL?: string): ProxyClient | undefined;
@@ -1,3 +1,4 @@
1
1
  export * from './Global';
2
+ export * from './Init';
2
3
  export * from './SysEvents';
3
4
  export * from './MsgHelper';