htui-yllkbz 2.0.9 → 2.0.11

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -4,13 +4,13 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2022-07-18 15:01:02
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2025-08-01 15:40:35
7
+ * @LastEditTime: 2026-01-27 16:41:28
8
8
  */
9
9
  import moment from "moment";
10
10
  import { FormValues, TimeModes } from "./type";
11
11
  import { baseConfig } from "vue-kst-auth";
12
12
  import axios from "axios";
13
-
13
+ const dataCache: { [key: string]: any } = {};
14
14
  /** 生成唯一Id
15
15
  * @params e 生成的id位数 默认32
16
16
  */
@@ -246,6 +246,9 @@ export const roundHalfToEven = (num: number, precision = 2) => {
246
246
 
247
247
  /** 获取所有部门信息 */
248
248
  export const getAllOrg = () => {
249
+ if (dataCache.allOrg) {
250
+ return dataCache.allOrg;
251
+ }
249
252
  const baseDataItem: any = {}
250
253
  let resData = {
251
254
  baseData: {
@@ -285,10 +288,14 @@ export const getAllOrg = () => {
285
288
  });
286
289
  }
287
290
  getBaseDataItem(organizationUnit);
291
+ dataCache.allOrg = baseDataItem;
288
292
  return baseDataItem
289
293
  }
290
294
  /** 获取所有角色信息 */
291
295
  export const getAllRole = () => {
296
+ if (dataCache.allRole) {
297
+ return dataCache.allRole;
298
+ }
292
299
  const baseDataItem: any = {}
293
300
  let resData = {
294
301
  baseData: {
@@ -328,10 +335,14 @@ export const getAllRole = () => {
328
335
  });
329
336
  }
330
337
  getBaseDataItem(roleList);
338
+ dataCache.allRole = baseDataItem;
331
339
  return baseDataItem
332
340
  }
333
341
  /** 获取所有用户信息 */
334
342
  export const getAllUser = () => {
343
+ if (dataCache.allUser) {
344
+ return dataCache.allUser;
345
+ }
335
346
  const baseDataItem: any = {}
336
347
  let resData = {
337
348
  baseData: {
@@ -372,11 +383,15 @@ export const getAllUser = () => {
372
383
  });
373
384
  }
374
385
  getBaseDataItem(items);
386
+ dataCache.allUser = baseDataItem;
375
387
  return baseDataItem
376
388
  }
377
389
 
378
390
  /** 获取所有的base信息通过KEY:VALUE形式 */
379
391
  export const getAllBaseData = () => {
392
+ if (dataCache.allBaseData) {
393
+ return dataCache.allBaseData;
394
+ }
380
395
  const baseDataItem: any = {}
381
396
  let resData = {
382
397
  baseData: {
@@ -417,6 +432,7 @@ export const getAllBaseData = () => {
417
432
  }
418
433
  getBaseDataItem(items);
419
434
 
435
+ dataCache.allBaseData = baseDataItem;
420
436
  return baseDataItem
421
437
  }
422
438
  export function getCurrentTime() {
@@ -473,7 +489,7 @@ function getSupport() {
473
489
  }
474
490
  export function trackPageAndGenerateNumber() {
475
491
  // 检查localStorage中是否有首次加载时间记录
476
- getSupport()
492
+ //getSupport()
477
493
  const systemConfig = localStorage.getItem('systemConfig_1');
478
494
 
479
495
  // 如果是第一次加载,记录当前时间