UNPKG

logwire-wms-ui-test

Version:

运匠科技wms-PDA基础组件库

77 lines (76 loc) 3.33 kB
import { n as s, l as a } from "./index.f1359381.mjs"; import "vue"; const n = { name: "init", mixins: [a], data() { return { showLoading: !0, errorMsg: "" }; }, mounted() { window.lwInitTimeout && clearInterval(window.lwInitTimeout), this.init(); }, methods: { async init() { try { const i = this.$lwLocalStorage.get("lwLanguage") || this.$lwLanguage.getKey() || navigator.language; await this.$lwLanguage.asyncSetKey(i, !1), this.$lwLocalStorage.get("lwTimezone") || this.$lwLocalStorage.set("lwTimezone", this.$lwTimezone.getTimezone()); try { await this.$lwAppPower.setExitRoute(this.$lwAppBack.getExitRoute()); } catch (t) { console.warn("\u8BBE\u7F6EAPP\u9000\u51FA\u8DEF\u7531\u5931\u8D25", t); } if (!this.$lwApiUtils.getToken() || !this.$lwWarehouse.get().id) { this.$router.replace({ path: "/lwLogin" }); return; } await this.$lwUUID.bound(), await this.getSystemInitData(), self === top ? history.go(-1) : this.$router.replace({ path: "/lwHome" }), setTimeout(() => { this.errorMsg = this.$lwLanguage.get("wms_project.pda.views.init.time", "\u7B49\u5F85\u8D85\u65F6"), this.showLoading = !1; }, 1e3); } catch (i) { setTimeout(() => { this.errorMsg = this.$lwLanguage.get("wms_project.pda.views.init.infoError", "\u57FA\u7840\u6570\u636E\u52A0\u8F7D\u5931\u8D25"), this.showLoading = !1; }, 1e3), console.error("\u521D\u59CB\u5316\u9875\u9762\u5F02\u5E38\uFF1A", i); const t = [ "wmsGetAllChoices", "wmsGetUserPermissions", "wmsMobilePrintSelectedTemplate", "commonWmsLoadAllComponentConfig" ], e = i.config.url.split("/"); t.includes(e.pop()) && (this.$lwCloseErrorMsg(), this.$router.replace({ path: "/lwLogin" })); } }, refresh() { this.$router.push({ path: "/lwHome" }), setTimeout(() => { history.go(0); }, 5); } } }; var o = function() { var t = this, e = t._self._c; return e("div", { staticClass: "lw-global-flex-center", staticStyle: { position: "fixed", width: "100%", height: "100%" } }, [t.showLoading ? e("div", [e("span", { staticClass: "van-loading__spinner van-loading__spinner--circular", staticStyle: { width: "30px", height: "30px" } }, [e("svg", { staticClass: "van-loading__circular", attrs: { viewBox: "25 25 50 50" } }, [e("circle", { attrs: { cx: "50", cy: "50", r: "20", fill: "none" } })])])]) : e("div", { staticClass: "lw-global-animation-rotate", staticStyle: { "text-align": "center" } }, [e("van-icon", { attrs: { name: "warning", size: "50px", color: "#D50000" } }), e("div", { staticStyle: { margin: "10px 0", "font-size": "18px" } }, [t._v(t._s(t.errorMsg) + " ")]), e("lw-button", { attrs: { plain: "", type: "last" }, on: { click: t.refresh } }, [e("van-icon", { staticStyle: { "font-weight": "bold" }, attrs: { name: "replay", size: "16px" } }), t._v(" " + t._s(t.$lwLanguage.get("wms_project.pda.views.init.refresh", "\u91CD\u8BD5")) + " ")], 1)], 1)]); }, r = [], l = /* @__PURE__ */ s( n, o, r, !1, null, "f315b479", null, null ); const w = l.exports; export { w as default };