lw-cdp-ui 1.4.49 → 1.4.51
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/dist/lw-cdp-ui.esm.js +26 -24
- package/dist/lw-cdp-ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/lw-cdp-ui.esm.js
CHANGED
|
@@ -22809,38 +22809,40 @@ function hy(e) {
|
|
|
22809
22809
|
</div>
|
|
22810
22810
|
<button id="update-button" style="margin-left: 10px; background: white; color: #42b983; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; display: none;">立即更新</button>
|
|
22811
22811
|
</div>
|
|
22812
|
-
`, document.body.appendChild(t)), t)
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22812
|
+
`, document.body.appendChild(t)), t);
|
|
22813
|
+
let r = null;
|
|
22814
|
+
const a = e({
|
|
22815
|
+
onRegisterError(o) {
|
|
22816
|
+
console.error("Service worker 注册失败:", o);
|
|
22817
|
+
},
|
|
22818
|
+
onRegistered(o) {
|
|
22819
|
+
console.log("Service Worker 注册成功222", o), o.update().then(() => {
|
|
22820
|
+
if (console.log("已检查更新"), console.log(o.installing), console.log(o.waiting), o != null && o.installing) {
|
|
22819
22821
|
console.log("检测到新版本..."), n();
|
|
22820
|
-
const
|
|
22821
|
-
|
|
22822
|
-
let
|
|
22823
|
-
setInterval(() => {
|
|
22824
|
-
const
|
|
22825
|
-
|
|
22826
|
-
const
|
|
22827
|
-
|
|
22822
|
+
const l = t == null ? void 0 : t.querySelector("#status-text");
|
|
22823
|
+
l && (l.textContent = "正在准备下载更新...");
|
|
22824
|
+
let i = 0;
|
|
22825
|
+
r = setInterval(() => {
|
|
22826
|
+
const s = (1 - i) * (1 - i) * Math.random() * 0.1;
|
|
22827
|
+
i += s, i > 0.99 && (i = 0.99);
|
|
22828
|
+
const u = t == null ? void 0 : t.querySelector("#update-progress"), d = t == null ? void 0 : t.querySelector("#status-text");
|
|
22829
|
+
u && (u.style.width = `${Math.round(i * 100)}%`), d && (d.textContent = `项目有更新迭代,正在下载新版本-${Math.round(i * 100)}%`);
|
|
22828
22830
|
}, 200);
|
|
22829
22831
|
}
|
|
22830
|
-
if (
|
|
22831
|
-
console.log("新版本已下载...")
|
|
22832
|
-
const
|
|
22833
|
-
|
|
22834
|
-
|
|
22832
|
+
if (o != null && o.waiting) {
|
|
22833
|
+
console.log("新版本已下载...");
|
|
22834
|
+
const l = t == null ? void 0 : t.querySelector("#progress-body"), i = t == null ? void 0 : t.querySelector("#update-button"), s = t == null ? void 0 : t.querySelector("#status-text");
|
|
22835
|
+
i && s && (l.style.display = "none", s.textContent = "新版本已准备就绪!", i.style.display = "inline-block", i.addEventListener("click", () => {
|
|
22836
|
+
a(!0);
|
|
22835
22837
|
}));
|
|
22836
22838
|
}
|
|
22837
22839
|
});
|
|
22838
22840
|
},
|
|
22839
22841
|
onNeedRefresh() {
|
|
22840
|
-
console.log("下载完成...");
|
|
22841
|
-
const
|
|
22842
|
-
|
|
22843
|
-
|
|
22842
|
+
console.log("下载完成..."), clearInterval(r);
|
|
22843
|
+
const o = t == null ? void 0 : t.querySelector("#progress-body"), l = t == null ? void 0 : t.querySelector("#update-button"), i = t == null ? void 0 : t.querySelector("#status-text");
|
|
22844
|
+
l && i && (o.style.display = "none", i.textContent = "新版本已准备就绪!", l.style.display = "inline-block", l.addEventListener("click", () => {
|
|
22845
|
+
a(!0);
|
|
22844
22846
|
}));
|
|
22845
22847
|
},
|
|
22846
22848
|
onOfflineReady() {
|
package/dist/lw-cdp-ui.umd.js
CHANGED
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
<button id="update-button" style="margin-left: 10px; background: white; color: #42b983; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; display: none;">立即更新</button>
|
|
35
35
|
</div>
|
|
36
|
-
`,document.body.appendChild(n)),n)
|
|
36
|
+
`,document.body.appendChild(n)),n);let a=null;const r=t({onRegisterError(l){console.error("Service worker 注册失败:",l)},onRegistered(l){console.log("Service Worker 注册成功222",l),l.update().then(()=>{if(console.log("已检查更新"),console.log(l.installing),console.log(l.waiting),l!=null&&l.installing){console.log("检测到新版本..."),o();const i=n==null?void 0:n.querySelector("#status-text");i&&(i.textContent="正在准备下载更新...");let s=0;a=setInterval(()=>{const c=(1-s)*(1-s)*Math.random()*.1;s+=c,s>.99&&(s=.99);const h=n==null?void 0:n.querySelector("#update-progress"),p=n==null?void 0:n.querySelector("#status-text");h&&(h.style.width=`${Math.round(s*100)}%`),p&&(p.textContent=`项目有更新迭代,正在下载新版本-${Math.round(s*100)}%`)},200)}if(l!=null&&l.waiting){console.log("新版本已下载...");const i=n==null?void 0:n.querySelector("#progress-body"),s=n==null?void 0:n.querySelector("#update-button"),c=n==null?void 0:n.querySelector("#status-text");s&&c&&(i.style.display="none",c.textContent="新版本已准备就绪!",s.style.display="inline-block",s.addEventListener("click",()=>{r(!0)}))}})},onNeedRefresh(){console.log("下载完成..."),clearInterval(a);const l=n==null?void 0:n.querySelector("#progress-body"),i=n==null?void 0:n.querySelector("#update-button"),s=n==null?void 0:n.querySelector("#status-text");i&&s&&(l.style.display="none",s.textContent="新版本已准备就绪!",i.style.display="inline-block",i.addEventListener("click",()=>{r(!0)}))},onOfflineReady(){console.log("应用已准备好离线工作。")}})}function iC(t,n={}){if(n)for(const o in n)n.hasOwnProperty(o)&&(t.config.globalProperties[`$${o.toUpperCase()}`]=n[o]);t.directive("copy",t4),t.directive("auth",n4),t.component("lwLayout",Ka),t.component("lwLayoutInit",Wa),t.component("lwLogin",$a),t.component("lwSearch",wn),t.component("lwSvgIcon",el),t.component("lwTable",bn),t.component("lwForm",tl),t.component("lwFormMini",ol),t.component("lwUpload",ct),t.component("lwIconSelect",rl),t.component("lwTableSelect",al),t.component("lwTableForm",ll),t.component("lwFormView",sl),t.component("lwFormJson",il),t.component("lwCronSelect",cl),t.component("lwFlow",Ld),t.component("lwBiChart",Td),t.component("lwBiChartItem",Gd),t.component("lwBiChartPage",Hd),t.component("lwTour",Kd)}const sC={install:iC,uiI18n:Qt,registerServiceWorker:Wd};$.default=sC,$.lwBiChart=Td,$.lwBiChartItem=Gd,$.lwBiChartPage=Hd,$.lwCronSelect=cl,$.lwFlow=Ld,$.lwForm=tl,$.lwFormJson=il,$.lwFormMini=ol,$.lwFormView=sl,$.lwIconSelect=rl,$.lwLayout=Ka,$.lwLayoutInit=Wa,$.lwLogin=$a,$.lwSearch=wn,$.lwSvgIcon=el,$.lwTable=bn,$.lwTableForm=ll,$.lwTableSelect=al,$.lwTour=Kd,$.lwUpload=ct,$.registerServiceWorker=Wd,$.uiI18n=Qt,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|