t-lj-service 1.0.6 → 1.0.9

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.
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="cn.fjdmy.uniapp.UniappProjectDataService">
4
+ <option name="generalBasePath" value="$PROJECT_DIR$" />
5
+ <option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
6
+ <option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
7
+ <option name="scanNum" value="1" />
8
+ <option name="type" value="store" />
9
+ </component>
10
+ </project>
package/README.md CHANGED
@@ -80,6 +80,7 @@ useApp({
80
80
  use,
81
81
  id: '#app',
82
82
  icons: ElementPlusIconsVue,
83
+ padding: [ 0,0 ] // 默认 [0,0]视图全屏减去的[宽,高]
83
84
  })
84
85
 
85
86
  ```
package/module/config.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import hooks from './hooks';
2
2
  const BASE_URL = import.meta.env.MODE === 'dev' ? '/api' : hooks.getLocal("sessioncurraddr") || '';
3
- const TIME_OUT = 7200000;
3
+ const TIME_OUT = 10 * 1000;
4
4
  export enum REQUEST_METHOD {
5
5
  POST = 'post',
6
6
  GET = 'get',
@@ -73,6 +73,9 @@ const RequestConfig = (config: any): any => {
73
73
  if(config.Token !== undefined ){
74
74
  config.headers['Token'] = config.Token;
75
75
  }
76
+ if(config.Timeout !== undefined ){
77
+ config.timeout = Number(config.Timeout) * 1000;
78
+ }
76
79
  hooks.setLocal('sessiononlineTime', new Date().toString());
77
80
  return config;
78
81
  }
@@ -78,16 +78,16 @@ const autoApp = (url: string = '/business/') => {
78
78
 
79
79
  // 子系统
80
80
  type GlobalIcons = Record<string, Component>;
81
- const _setInner = (container: HTMLDivElement) => {
82
- container.style.width = `${window.innerWidth - 30}px`
83
- container.style.height = `${window.innerHeight - 85}px`
81
+ const _set = (container: HTMLDivElement, padding: number[] = [ 0, 0 ],) => {
82
+ container.style.width = `${window.innerWidth - padding[0]}px`
83
+ container.style.height = `${window.innerHeight - padding[1]}px`
84
84
  container.style.boxSizing = `border-box`
85
85
  }
86
- const _window = (container: HTMLDivElement, type: number = 1) => {
86
+ const _window = (container: HTMLDivElement, type: number = 1, padding: number[] = [ 0, 0 ],) => {
87
87
  if(type === 1){
88
- window.addEventListener('resize', () => _setInner(container));
88
+ window.addEventListener('resize', () => _set(container, padding));
89
89
  } else {
90
- window.removeEventListener('resize', () => _setInner(container));
90
+ window.removeEventListener('resize', () => _set(container, padding));
91
91
  }
92
92
  }
93
93
  const render = (
@@ -97,6 +97,7 @@ const render = (
97
97
  id: string = '#container',
98
98
  icons: GlobalIcons | null = null,
99
99
  props: QiankunProps = {},
100
+ padding: number[] = [ 0, 0 ],
100
101
  ) => {
101
102
  const { container, actions } = props;
102
103
  root = createApp(App);
@@ -115,16 +116,10 @@ const render = (
115
116
  use.forEach((item: any) => {
116
117
  root.use(item.module, item.options || {});
117
118
  })
118
- // registerElementPlusIcons(root);
119
- // root.use(router);
120
- // root.use(ElementPlus, {
121
- // locale: ZhCn,
122
- // });
123
- // root.use(i18n);
124
119
 
125
120
  const c: any = container?.querySelector(id) || document.querySelector(id);
126
- _setInner(c);
127
- _window(c)
121
+ _set(c, padding);
122
+ _window(c, 1, padding)
128
123
  root.mount(c);
129
124
  }
130
125
 
@@ -134,17 +129,18 @@ const initQianKun = (
134
129
  use: any[] = [],
135
130
  id: string = '#container',
136
131
  icons: GlobalIcons | null = null,
132
+ padding: number[] = [ 0, 0 ],
137
133
  ):void => {
138
134
  renderWithQiankun({
139
135
  async mount(props: QiankunProps) {
140
136
  console.log(props);
141
- render(root, App, use, id, icons, props);
137
+ render(root, App, use, id, icons, props, padding);
142
138
  },
143
139
  bootstrap() {},
144
140
  unmount(props: QiankunProps): void | Promise<void> {
145
141
  const { container } = props;
146
142
  const c: any = container?.querySelector(id) || document.querySelector(id);
147
- _window(c, 0);
143
+ _window(c, 0, padding);
148
144
  root.unmount();
149
145
  },
150
146
  update(props: QiankunProps): void | Promise<void> {
@@ -160,18 +156,20 @@ const useApp = ({
160
156
  use = [],
161
157
  id = '#container',
162
158
  icons = null,
159
+ padding = [ 0, 0 ],
163
160
  }: {
164
161
  root?: ReturnType<typeof createApp> | null,
165
162
  App?: Component,
166
163
  use?: any[],
167
164
  id?: string,
168
165
  icons?: GlobalIcons | null,
166
+ padding?: number[],
169
167
  } = {}) => {
170
168
  if (!App) {
171
169
  throw new Error('App 组件不能为空');
172
170
  }
173
171
  const appRoot = root || createApp(App);
174
- qiankunWindow.__POWERED_BY_QIANKUN__ ? initQianKun(appRoot, App, use, id, icons) : render(appRoot, App, use, id ,icons)
172
+ qiankunWindow.__POWERED_BY_QIANKUN__ ? initQianKun(appRoot, App, use, id, icons, padding) : render(appRoot, App, use, id ,icons, padding)
175
173
  };
176
174
 
177
175
 
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "t-lj-service",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "",
5
8
  "main": "index.ts",
6
9
  "scripts": {