eoss-ui 0.5.81-beta3 → 0.5.81-beta4

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/main.js CHANGED
@@ -3971,8 +3971,8 @@ render._withStripped = true
3971
3971
 
3972
3972
  // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=0794c41f&
3973
3973
 
3974
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/index.vue?vue&type=template&id=4d97469e&scoped=true&
3975
- var simplicityvue_type_template_id_4d97469e_scoped_true_render = function () {
3974
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/index.vue?vue&type=template&id=110cff37&scoped=true&
3975
+ var simplicityvue_type_template_id_110cff37_scoped_true_render = function () {
3976
3976
  var _vm = this
3977
3977
  var _h = _vm.$createElement
3978
3978
  var _c = _vm._self._c || _h
@@ -4160,7 +4160,7 @@ var simplicityvue_type_template_id_4d97469e_scoped_true_render = function () {
4160
4160
  attrs: {
4161
4161
  direction: "ltr",
4162
4162
  "modal-class": "es-simplicity-apps-modal",
4163
- size: _vm.width,
4163
+ size: _vm.width + "px",
4164
4164
  "modal-append-to-body": false,
4165
4165
  "with-header": false,
4166
4166
  visible: _vm.showMenu,
@@ -4365,7 +4365,6 @@ var simplicityvue_type_template_id_4d97469e_scoped_true_render = function () {
4365
4365
  staticClass: "es-simplicity-iframe",
4366
4366
  attrs: { closable: "", "hide-bar": "" },
4367
4367
  on: {
4368
- "tab-click": _vm.handleTab,
4369
4368
  "tab-remove": _vm.handleRemove,
4370
4369
  "tab-contextmenu": _vm.handleContextmenu,
4371
4370
  },
@@ -4541,11 +4540,11 @@ var simplicityvue_type_template_id_4d97469e_scoped_true_render = function () {
4541
4540
  ),
4542
4541
  ])
4543
4542
  }
4544
- var simplicityvue_type_template_id_4d97469e_scoped_true_staticRenderFns = []
4545
- simplicityvue_type_template_id_4d97469e_scoped_true_render._withStripped = true
4543
+ var simplicityvue_type_template_id_110cff37_scoped_true_staticRenderFns = []
4544
+ simplicityvue_type_template_id_110cff37_scoped_true_render._withStripped = true
4546
4545
 
4547
4546
 
4548
- // CONCATENATED MODULE: ./packages/main/src/simplicity/index.vue?vue&type=template&id=4d97469e&scoped=true&
4547
+ // CONCATENATED MODULE: ./packages/main/src/simplicity/index.vue?vue&type=template&id=110cff37&scoped=true&
4549
4548
 
4550
4549
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/simplicity/avatar.vue?vue&type=template&id=2597c13a&scoped=true&
4551
4550
  var avatarvue_type_template_id_2597c13a_scoped_true_render = function () {
@@ -7991,7 +7990,6 @@ var simplicityvue_type_script_lang_js_this = undefined;
7991
7990
  //
7992
7991
  //
7993
7992
  //
7994
- //
7995
7993
 
7996
7994
 
7997
7995
 
@@ -8140,7 +8138,11 @@ var events = [function (tabs, index) {
8140
8138
  //无界微前端Props属性
8141
8139
  wjProps: Object,
8142
8140
  //无界微前端Attrs属性
8143
- wjAttrs: Object
8141
+ wjAttrs: Object,
8142
+ menuWidth: {
8143
+ type: Number,
8144
+ default: 220
8145
+ }
8144
8146
  },
8145
8147
  data: function data() {
8146
8148
  return {
@@ -8159,7 +8161,7 @@ var events = [function (tabs, index) {
8159
8161
  //展示菜单导航
8160
8162
  showMenu: false,
8161
8163
  //展示菜单导航宽度
8162
- width: '296px',
8164
+ width: this.menuWidth,
8163
8165
  //人工智能配置
8164
8166
  aiConfig: null,
8165
8167
  //公用窗口面板配置
@@ -8344,7 +8346,6 @@ var events = [function (tabs, index) {
8344
8346
  this.setConfig(results);
8345
8347
  if (this.remote) {
8346
8348
  this.getApplications();
8347
- this.getMenus();
8348
8349
  }
8349
8350
  },
8350
8351
 
@@ -8461,6 +8462,7 @@ var events = [function (tabs, index) {
8461
8462
  getApplications: function getApplications() {
8462
8463
  var _this2 = this;
8463
8464
 
8465
+ var loading = utils_util["a" /* default */].loading('', '加载中...');
8464
8466
  utils_util["a" /* default */].ajax({
8465
8467
  url: this.appsUrl,
8466
8468
  defaults: true
@@ -8486,11 +8488,14 @@ var events = [function (tabs, index) {
8486
8488
  } else {
8487
8489
  _this2.$message.error('未分配应用菜单权限,请联系管理员!');
8488
8490
  }
8491
+ _this2.getMenus(loading);
8489
8492
  } else {
8493
+ loading.close();
8490
8494
  var msg = res.msg || '系统错误,请联系管理员!';
8491
8495
  _this2.$message.error(msg);
8492
8496
  }
8493
8497
  }).catch(function (err) {
8498
+ loading.close();
8494
8499
  if (err.message && err.message !== 'canceled') {
8495
8500
  _this2.$message.error(err.message);
8496
8501
  }
@@ -8502,21 +8507,81 @@ var events = [function (tabs, index) {
8502
8507
  * @author huangbo
8503
8508
  * @date 2024年9月7日
8504
8509
  **/
8505
- getMenus: function getMenus() {
8510
+ getMenus: function getMenus(loading) {
8506
8511
  var _this3 = this;
8507
8512
 
8508
8513
  utils_util["a" /* default */].ajax({ url: this._menuUrl }).then(function (res) {
8514
+ loading.close();
8509
8515
  if (res.rCode === 0) {
8510
8516
  if (res.results && res.results.length) {
8511
8517
  _this3.menus = res.results;
8512
8518
  _this3.setTips(_this3.menus);
8513
8519
  store["a" /* default */].set('nav', _this3.menus);
8520
+ console.log(12121);
8521
+ if (_this3.appCode) {
8522
+ var app = _this3.userApps.filter(function (item) {
8523
+ return item.code === _this3.appCode;
8524
+ })[0];
8525
+ if (app) {
8526
+ _this3.active = app.id;
8527
+ if (app.url) {
8528
+ var _obj = _this3.getMenu(_this3.menus, app.url);
8529
+ if (_obj) {
8530
+ var tab = _this3.setIframeType(_obj);
8531
+ _this3.tabs = [tab];
8532
+ _this3.activeName = tab.id;
8533
+ if (tab.method == 'router') {
8534
+ var params = utils_util["a" /* default */].getParams({ url: tab.url });
8535
+ _this3.$router.push({
8536
+ path: tab.path,
8537
+ query: params
8538
+ });
8539
+ }
8540
+ }
8541
+ }
8542
+ }
8543
+ if (_this3.tabs.length == 0) {
8544
+ var subMenus = _this3.getMenu(_this3.menus, _this3.appCode, 'appCode');
8545
+ if (subMenus) {
8546
+ // this.subMenus = subMenus;
8547
+ // this.showMenu = true;
8548
+ var _obj2 = _this3.getFirst(subMenus);
8549
+ if (_obj2) {
8550
+ var _tab = _this3.setIframeType(_obj2);
8551
+ _this3.tabs = [_tab];
8552
+ _this3.activeName = _tab.id;
8553
+ if (_tab.method == 'router') {
8554
+ var _params = utils_util["a" /* default */].getParams({ url: _tab.url });
8555
+ _this3.$router.push({
8556
+ path: _tab.path,
8557
+ query: _params
8558
+ });
8559
+ }
8560
+ }
8561
+ } else {
8562
+ _this3.subMenus = null;
8563
+ _this3.showMenu = false;
8564
+ }
8565
+ }
8566
+ // this.width = this.menuWidth;
8567
+ // this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
8568
+ }
8514
8569
  if (_this3.indexUrl) {
8515
- var obj = _this3.getMenu(_this3.menus, _this3.indexUrl);
8516
- if (obj) {
8517
- _this3.tabs = [_this3.setIframeType(obj)];
8518
- _this3.activeName = obj.id;
8519
- _this3.homePage = obj;
8570
+ var _obj3 = _this3.getMenu(_this3.menus, _this3.indexUrl);
8571
+ if (_obj3) {
8572
+ if (!_this3.appCode) {
8573
+ var _tab2 = _this3.setIframeType(_obj3);
8574
+ _this3.tabs = [_tab2];
8575
+ _this3.activeName = _tab2.id;
8576
+ if (_tab2.method == 'router') {
8577
+ var _params2 = utils_util["a" /* default */].getParams({ url: _tab2.url });
8578
+ _this3.$router.push({
8579
+ path: _tab2.path,
8580
+ query: _params2
8581
+ });
8582
+ }
8583
+ }
8584
+ _this3.homePage = _obj3;
8520
8585
  } else {
8521
8586
  _this3.homePage = _this3.setIframeType({
8522
8587
  url: _this3.indexUrl,
@@ -8524,25 +8589,33 @@ var events = [function (tabs, index) {
8524
8589
  id: '0',
8525
8590
  appCode: 'indexUrl'
8526
8591
  });
8527
- _this3.tabs = [_this3.homePage];
8528
- _this3.activeName = '0';
8592
+ if (!_this3.appCode) {
8593
+ _this3.tabs = [_this3.homePage];
8594
+ _this3.activeName = '0';
8595
+ if (_this3.homePage.method == 'router') {
8596
+ var _params3 = utils_util["a" /* default */].getParams({ url: _this3.homePage.url });
8597
+ _this3.$router.push({
8598
+ path: _this3.homePage.path,
8599
+ query: _params3
8600
+ });
8601
+ }
8602
+ }
8529
8603
  }
8530
- }
8531
- if (_this3.initApps && _this3.initApps.length) {
8532
- var _obj = _this3.getMenu(_this3.menus, _this3.initApps[_this3.initApps.length - 1]);
8533
- if (_obj) {
8534
- _this3.tabs.push(_this3.setIframeType(_obj));
8535
- _this3.activeName = _obj.id;
8604
+ } else if (_this3.initApps && _this3.initApps.length && !_this3.appCode) {
8605
+ var _obj4 = _this3.getMenu(_this3.menus, _this3.initApps[_this3.initApps.length - 1]);
8606
+ if (_obj4) {
8607
+ var _tab3 = _this3.setIframeType(_obj4);
8608
+ _this3.tabs.push(_tab3);
8609
+ _this3.activeName = _tab3.id;
8610
+ if (_tab3.method == 'router') {
8611
+ var _params4 = utils_util["a" /* default */].getParams({ url: _tab3.url });
8612
+ _this3.$router.push({
8613
+ path: _tab3.path,
8614
+ query: _params4
8615
+ });
8616
+ }
8536
8617
  }
8537
8618
  }
8538
- if (_this3.appCode) {
8539
- var subMenus = _this3.getMenu(_this3.menus, res.code, 'appCode');
8540
- _this3.subMenus = subMenus ? subMenus : null;
8541
- _this3.showMenu = subMenus !== false;
8542
- _this3.showApps = false;
8543
- _this3.width = '296px';
8544
- _this3.$refs.subMenus && _this3.$refs.subMenus.clearSubmenu();
8545
- }
8546
8619
  } else {
8547
8620
  _this3.$message.error('未分配菜单权限,请联系管理员!');
8548
8621
  }
@@ -8551,6 +8624,7 @@ var events = [function (tabs, index) {
8551
8624
  _this3.$message.error(msg);
8552
8625
  }
8553
8626
  }).catch(function (err) {
8627
+ loading.close();
8554
8628
  if (err.message && err.message !== 'canceled') {
8555
8629
  _this3.$message.error(err.message);
8556
8630
  }
@@ -8568,9 +8642,6 @@ var events = [function (tabs, index) {
8568
8642
  var urls = url.split('?');
8569
8643
  if (urls[0].indexOf('.js') > 1 && !isIE) {
8570
8644
  res.method = 'wujie';
8571
- this.$nextTick(function () {
8572
- res.refresh = true;
8573
- });
8574
8645
  } else if (urls[0].indexOf('.dhtml') > 0 || urls[0].indexOf('.html') > 0 && urls[0].indexOf('.html#') === -1) {
8575
8646
  res.method = 'iframe';
8576
8647
  } else {
@@ -8582,14 +8653,7 @@ var events = [function (tabs, index) {
8582
8653
  var path = this.hasRouter(routes, urls[0], res.appCode);
8583
8654
  if (path) {
8584
8655
  res.method = 'router';
8585
- var params = utils_util["a" /* default */].getParams({ url: url });
8586
- this.$router.push({
8587
- path: path,
8588
- query: params
8589
- });
8590
- this.$nextTick(function () {
8591
- res.refresh = true;
8592
- });
8656
+ res.path = path;
8593
8657
  } else {
8594
8658
  var urlopenmode = utils_util["a" /* default */].getParams({
8595
8659
  url: url,
@@ -8599,21 +8663,16 @@ var events = [function (tabs, index) {
8599
8663
  res.method = 'iframe';
8600
8664
  } else {
8601
8665
  res.method = 'wujie';
8602
- this.$nextTick(function () {
8603
- res.refresh = true;
8604
- });
8605
8666
  }
8606
8667
  }
8607
8668
  } else if (urls[0].indexOf('.html') > -1 && urls[0].indexOf('#/') > -1 || urls[0].indexOf('/#/') > -1) {
8608
8669
  res.method = 'wujie';
8609
- this.$nextTick(function () {
8610
- res.refresh = true;
8611
- });
8612
8670
  } else {
8613
8671
  res.method = 'iframe';
8614
8672
  }
8615
8673
  }
8616
8674
  }
8675
+ res.refresh = true;
8617
8676
  return res;
8618
8677
  },
8619
8678
 
@@ -8634,14 +8693,14 @@ var events = [function (tabs, index) {
8634
8693
  return item;
8635
8694
  }
8636
8695
  if (Object.prototype.hasOwnProperty.call(item, 'children') && item.children.length) {
8637
- var obj = this.getMenu(item.children, res, key);
8638
- if (obj) {
8639
- return obj;
8696
+ var _obj5 = this.getMenu(item.children, res, key);
8697
+ if (_obj5) {
8698
+ return _obj5;
8640
8699
  }
8641
8700
  } else if (Object.prototype.hasOwnProperty.call(item, 'fourthTabs') && item.fourthTabs.length) {
8642
- var _obj2 = this.getMenu(item.fourthTabs, res, key);
8643
- if (_obj2) {
8644
- return _obj2;
8701
+ var _obj6 = this.getMenu(item.fourthTabs, res, key);
8702
+ if (_obj6) {
8703
+ return _obj6;
8645
8704
  }
8646
8705
  }
8647
8706
  }
@@ -8649,6 +8708,28 @@ var events = [function (tabs, index) {
8649
8708
  return false;
8650
8709
  },
8651
8710
 
8711
+ /**
8712
+ * @desc:获取菜单第一条数据
8713
+ * @author huangbo
8714
+ * @date 2024年9月7日
8715
+ **/
8716
+ getFirst: function getFirst(obj) {
8717
+ if (!obj) {
8718
+ return '';
8719
+ }
8720
+ var openIdex = 0;
8721
+ if (obj.extendData && (obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen)) {
8722
+ openIdex = parseInt(obj.extendData.subDefOpenIndex || obj.extendData.subDefOpen, 10);
8723
+ }
8724
+ if (obj.children && obj.children.length && obj.children[openIdex]) {
8725
+ return this.getFirst(obj.children[openIdex]);
8726
+ } else if (obj.fourthTabs && obj.fourthTabs.length && obj.fourthTabs[openIdex]) {
8727
+ return this.getFirst(obj.fourthTabs[openIdex]);
8728
+ } else if (obj.url) {
8729
+ return obj;
8730
+ }
8731
+ },
8732
+
8652
8733
  /**
8653
8734
  * @desc:遍历设置菜单气泡提醒
8654
8735
  * @author huangbo
@@ -8776,7 +8857,7 @@ var events = [function (tabs, index) {
8776
8857
  this.subMenus = res;
8777
8858
  this.showMenu = true;
8778
8859
  this.showApps = false;
8779
- this.width = '296px';
8860
+ this.width = this.menuWidth;
8780
8861
  this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
8781
8862
  } else {
8782
8863
  var set = true;
@@ -8791,16 +8872,25 @@ var events = [function (tabs, index) {
8791
8872
  var i = utils_util["a" /* default */].indexOfObj(this.tabs, res, 'id');
8792
8873
  this.activeName = res.id;
8793
8874
  if (i == -1) {
8794
- this.tabs.push(this.setIframeType(res));
8875
+ var tab = this.setIframeType(res);
8876
+ this.tabs.push(obj);
8877
+ if (tab.method == 'router') {
8878
+ var params = utils_util["a" /* default */].getParams({ url: tab.url });
8879
+ this.$router.push({
8880
+ path: tab.path,
8881
+ query: params
8882
+ });
8883
+ }
8795
8884
  }
8796
8885
  }
8797
8886
  }
8798
8887
  if (set && res.code) {
8799
8888
  var subMenus = this.getMenu(this.menus, res.code, 'appCode');
8889
+ console.log(subMenus);
8800
8890
  this.subMenus = subMenus ? subMenus : null;
8801
8891
  this.showMenu = subMenus !== false;
8802
8892
  this.showApps = false;
8803
- this.width = '296px';
8893
+ this.width = this.menuWidth;
8804
8894
  this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
8805
8895
  }
8806
8896
  }
@@ -8850,13 +8940,21 @@ var events = [function (tabs, index) {
8850
8940
  **/
8851
8941
  handlerClickMenu: function handlerClickMenu(res) {
8852
8942
  if (typeof res === 'number') {
8853
- var num = 296;
8854
- this.width = num * res + 'px';
8943
+ var num = this.menuWidth;
8944
+ this.width = num * res;
8855
8945
  } else {
8856
8946
  var i = utils_util["a" /* default */].indexOfObj(this.tabs, res, 'id');
8857
8947
  this.activeName = res.id;
8858
8948
  if (i == -1) {
8859
- this.tabs.push(this.setIframeType(res));
8949
+ var tab = this.setIframeType(res);
8950
+ this.tabs.push(tab);
8951
+ if (tab.method == 'router') {
8952
+ var params = utils_util["a" /* default */].getParams({ url: tab.url });
8953
+ this.$router.push({
8954
+ path: tab.path,
8955
+ query: params
8956
+ });
8957
+ }
8860
8958
  }
8861
8959
  this.showMenu = false;
8862
8960
  }
@@ -8892,29 +8990,6 @@ var events = [function (tabs, index) {
8892
8990
  }
8893
8991
  },
8894
8992
 
8895
- /**
8896
- * @desc:选中iframe页签刷新
8897
- * @author huangbo
8898
- * @date 2024年9月7日
8899
- **/
8900
- handleTab: function handleTab(res) {
8901
- var index = void 0;
8902
- if (res) {
8903
- index = parseInt(res.index);
8904
- } else {
8905
- index = utils_util["a" /* default */].indexOfObj(this.tabs, this.activeName, 'id');
8906
- }
8907
- var item = this.tabs[index];
8908
- if (item.method == 'iframe') {
8909
- item.url = utils_util["a" /* default */].handlerUrl(item.url);
8910
- } else {
8911
- item.refresh = false;
8912
- this.$nextTick(function () {
8913
- item.refresh = true;
8914
- });
8915
- }
8916
- },
8917
-
8918
8993
  /**
8919
8994
  * @desc:刷新选中iframe页签
8920
8995
  * @author huangbo
@@ -9261,10 +9336,19 @@ var events = [function (tabs, index) {
9261
9336
  var obj = this.getMenu(this.menus, apps[apps.length - 1]);
9262
9337
  if (obj) {
9263
9338
  var i = utils_util["a" /* default */].indexOfObj(this.tabs, obj, 'id');
9339
+ var n = utils_util["a" /* default */].indexOfObj(this.tabs, this.activeName, 'id');
9340
+ this.activeName = obj.id;
9264
9341
  if (i == -1) {
9265
- this.tabs.push(this.setIframeType(obj));
9342
+ var tab = this.setIframeType(obj);
9343
+ this.tabs.splice(n + 1, 0, tab);
9344
+ if (tab.method == 'router') {
9345
+ var params = utils_util["a" /* default */].getParams({ url: tab.url });
9346
+ this.$router.push({
9347
+ path: tab.path,
9348
+ query: params
9349
+ });
9350
+ }
9266
9351
  }
9267
- this.activeName = obj.id;
9268
9352
  } else {
9269
9353
  this.$message.error('没有此菜单!');
9270
9354
  }
@@ -9357,11 +9441,11 @@ var events = [function (tabs, index) {
9357
9441
 
9358
9442
  var simplicity_component = Object(componentNormalizer["a" /* default */])(
9359
9443
  src_simplicityvue_type_script_lang_js_,
9360
- simplicityvue_type_template_id_4d97469e_scoped_true_render,
9361
- simplicityvue_type_template_id_4d97469e_scoped_true_staticRenderFns,
9444
+ simplicityvue_type_template_id_110cff37_scoped_true_render,
9445
+ simplicityvue_type_template_id_110cff37_scoped_true_staticRenderFns,
9362
9446
  false,
9363
9447
  null,
9364
- "4d97469e",
9448
+ "110cff37",
9365
9449
  null
9366
9450
 
9367
9451
  )