eoss-ui 0.7.68 → 0.7.70

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.
@@ -134,6 +134,12 @@ export default {
134
134
  isIE: /MSIE|Trident/.test(navigator.userAgent)
135
135
  };
136
136
  },
137
+ watch: {
138
+ layoutType() {
139
+ // 当主题变化时,重新绑定一次事件 防止事件丢失 或者绑定错误
140
+ this.bindEvent();
141
+ }
142
+ },
137
143
  created() {
138
144
  const layoutType = localStorage.getItem('layoutType');
139
145
  if (layoutType) {
@@ -159,70 +165,76 @@ export default {
159
165
  ) {
160
166
  return false;
161
167
  }
162
- if (this.isLogin) {
163
- if (util.win.$wujie) {
164
- util.win.$wujie.bus.$on('changeTheme', (res) => {
165
- util.updateTheme(res);
166
- });
167
- }
168
- this.$nextTick(() => {
169
- this.getConfig();
170
- const bus = this.bus || this.$root.Bus;
171
- if (bus) {
172
- bus.$on('reLogin', this.handleReLogin);
173
- bus.$on('refresh', this.$refs.main.handleRefresh);
174
- bus.$on('windowOpen', this.winOpen);
175
- bus.$on('windowClose', this.winClose);
176
- bus.$on('jumpMenu', this.$refs.main.jumpMenu);
177
- bus.$on('emit', (method, args) => {
178
- // 主应用发送事件
179
- bus.$emit(method, args);
168
+ this.bindEvent();
169
+ },
170
+ methods: {
171
+ /**
172
+ * @desc: 绑定事件
173
+ **/
174
+ bindEvent() {
175
+ if (this.isLogin) {
176
+ if (util.win.$wujie) {
177
+ util.win.$wujie.bus.$on('changeTheme', (res) => {
178
+ util.updateTheme(res);
180
179
  });
181
180
  }
182
- util.win.reLogin = this.handleReLogin;
183
- util.win.windowOpen = this.winOpen;
184
- util.win.windowClose = this.winClose;
185
- util.win.refresh = this.$refs.main.handleRefresh;
186
- util.win.jumpMenu = this.$refs.main.jumpMenu;
187
- WujieVue.bus.$on('reLogin', this.handleReLogin);
188
- WujieVue.bus.$on('refresh', this.$refs.main.handleRefresh);
189
- WujieVue.bus.$on('jumpMenu', this.$refs.main.jumpMenu);
190
- WujieVue.bus.$on('windowOpen', this.winOpen);
191
- WujieVue.bus.$on('windowClose', this.winClose);
192
- WujieVue.bus.$on('emit', (method, args) => {
193
- // 主应用发送事件
194
- WujieVue.bus.$emit(method, args);
195
- });
181
+ this.$nextTick(() => {
182
+ this.getConfig();
183
+ const bus = this.bus || this.$root.Bus;
184
+ if (bus) {
185
+ bus.$on('reLogin', this.handleReLogin);
186
+ bus.$on('refresh', this.$refs.main.handleRefresh);
187
+ bus.$on('windowOpen', this.winOpen);
188
+ bus.$on('windowClose', this.winClose);
189
+ bus.$on('jumpMenu', this.$refs.main.jumpMenu);
190
+ bus.$on('emit', (method, args) => {
191
+ // 主应用发送事件
192
+ bus.$emit(method, args);
193
+ });
194
+ }
195
+ util.win.reLogin = this.handleReLogin;
196
+ util.win.windowOpen = this.winOpen;
197
+ util.win.windowClose = this.winClose;
198
+ util.win.refresh = this.$refs.main.handleRefresh;
199
+ util.win.jumpMenu = this.$refs.main.jumpMenu;
200
+ WujieVue.bus.$on('reLogin', this.handleReLogin);
201
+ WujieVue.bus.$on('refresh', this.$refs.main.handleRefresh);
202
+ WujieVue.bus.$on('jumpMenu', this.$refs.main.jumpMenu);
203
+ WujieVue.bus.$on('windowOpen', this.winOpen);
204
+ WujieVue.bus.$on('windowClose', this.winClose);
205
+ WujieVue.bus.$on('emit', (method, args) => {
206
+ // 主应用发送事件
207
+ WujieVue.bus.$emit(method, args);
208
+ });
196
209
 
197
- window.addEventListener('message', this.handleMessage);
198
- });
199
- } else {
200
- const loginPage =
201
- util.getStorage('login') || util.getStorage('loginPage');
202
- if (loginPage) {
203
- window.location.replace(loginPage);
204
- } else if (document.referrer) {
205
- const referrerUrl = new URL(document.referrer);
206
- if (referrerUrl.host !== window.location.host) {
207
- window.location.replace(document.referrer);
208
- } else if (
209
- window.location.href.indexOf('main.html') > -1 ||
210
- window.location.href.indexOf('index.html') > -1 ||
211
- document.referrer.indexOf('main.html') > -1 ||
212
- document.referrer.indexOf('index.html') > -1
213
- ) {
210
+ window.addEventListener('message', this.handleMessage);
211
+ });
212
+ } else {
213
+ const loginPage =
214
+ util.getStorage('login') || util.getStorage('loginPage');
215
+ if (loginPage) {
216
+ window.location.replace(loginPage);
217
+ } else if (document.referrer) {
218
+ const referrerUrl = new URL(document.referrer);
219
+ if (referrerUrl.host !== window.location.host) {
220
+ window.location.replace(document.referrer);
221
+ } else if (
222
+ window.location.href.indexOf('main.html') > -1 ||
223
+ window.location.href.indexOf('index.html') > -1 ||
224
+ document.referrer.indexOf('main.html') > -1 ||
225
+ document.referrer.indexOf('index.html') > -1
226
+ ) {
227
+ window.location.href = './login.html';
228
+ } else {
229
+ next('/login');
230
+ }
231
+ } else if (window.location.href.indexOf('main.html') > -1) {
214
232
  window.location.href = './login.html';
215
233
  } else {
216
234
  next('/login');
217
235
  }
218
- } else if (window.location.href.indexOf('main.html') > -1) {
219
- window.location.href = './login.html';
220
- } else {
221
- next('/login');
222
236
  }
223
- }
224
- },
225
- methods: {
237
+ },
226
238
  /**
227
239
  * @desc: 切换布局风格
228
240
  * @author huangbo
@@ -133,7 +133,7 @@
133
133
  >
134
134
  <div
135
135
  class="es-setting-navs es-setting-app-nav"
136
- @click.stop="handleLayout('simplicity')"
136
+ @click.stop="handleLayout('simplicity', 'simplicity')"
137
137
  >
138
138
  <div class="es-setting-side-sub-nav"></div>
139
139
  <es-icon
@@ -151,7 +151,7 @@
151
151
  >
152
152
  <div
153
153
  class="es-setting-navs es-setting-top-nav-side"
154
- @click.stop="handleLayout('simplicityTop')"
154
+ @click.stop="handleLayout('simplicityTop', 'simplicityTop')"
155
155
  >
156
156
  <div class="es-setting-side-sub-nav"></div>
157
157
  <es-icon
@@ -1454,13 +1454,17 @@ export default {
1454
1454
  let num = 0;
1455
1455
  obj.forEach((item) => {
1456
1456
  let n = this.setTips(item);
1457
- num += n ? parseInt(n) : 0;
1458
- this.$set(obj, 'tips', num);
1459
- this.setDot(this.userApps, item.appCode, num);
1460
- this.setDot(this.applications, item.appCode, num);
1461
- this.setDot(this.business, item.appCode, num);
1462
- this.setDot(this.systems, item.appCode, num);
1457
+ n = n ? parseInt(n) : 0;
1458
+ num += n;
1459
+ if (n) {
1460
+ this.$set(obj, 'tips', n);
1461
+ this.setDot(this.userApps, item.appCode, n);
1462
+ this.setDot(this.applications, item.appCode, n);
1463
+ this.setDot(this.business, item.appCode, n);
1464
+ this.setDot(this.systems, item.appCode, n);
1465
+ }
1463
1466
  });
1467
+ return num;
1464
1468
  } else {
1465
1469
  if (
1466
1470
  (obj.children && obj.children.length) ||