eoss-ui 0.5.81-beta5 → 0.5.81-beta7

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.
Files changed (38) hide show
  1. package/lib/data-table.js +143 -124
  2. package/lib/eoss-ui.common.js +371 -281
  3. package/lib/index.js +1 -1
  4. package/lib/login.js +8 -6
  5. package/lib/main.js +206 -137
  6. package/lib/select.js +1 -1
  7. package/lib/theme-chalk/base.css +1 -1
  8. package/lib/theme-chalk/index.css +1 -1
  9. package/lib/theme-chalk/main.css +1 -1
  10. package/lib/theme-chalk/menu.css +1 -1
  11. package/lib/theme-chalk/simplicity.css +1 -1
  12. package/lib/theme-chalk/sizer.css +1 -1
  13. package/lib/theme-chalk/tree.css +1 -1
  14. package/lib/theme-chalk/upload.css +1 -1
  15. package/package.json +2 -2
  16. package/packages/data-table/src/main.vue +50 -26
  17. package/packages/login/src/main.vue +10 -4
  18. package/packages/main/src/default/index.vue +1 -1
  19. package/packages/main/src/main.vue +8 -3
  20. package/packages/main/src/simplicity/index.vue +81 -76
  21. package/packages/main/src/simplicity/menu-list.vue +46 -17
  22. package/packages/main/src/simplicity/sub-menu.vue +2 -1
  23. package/packages/main/src/simplicity/user.vue +1 -0
  24. package/packages/select/src/main.vue +4 -1
  25. package/packages/theme-chalk/lib/base.css +1 -1
  26. package/packages/theme-chalk/lib/index.css +1 -1
  27. package/packages/theme-chalk/lib/main.css +1 -1
  28. package/packages/theme-chalk/lib/menu.css +1 -1
  29. package/packages/theme-chalk/lib/simplicity.css +1 -1
  30. package/packages/theme-chalk/lib/sizer.css +1 -1
  31. package/packages/theme-chalk/lib/tree.css +1 -1
  32. package/packages/theme-chalk/lib/upload.css +1 -1
  33. package/packages/theme-chalk/src/base.scss +3 -0
  34. package/packages/theme-chalk/src/common/var.scss +4 -0
  35. package/packages/theme-chalk/src/login.scss +2 -2
  36. package/packages/theme-chalk/src/simplicity.scss +5 -5
  37. package/packages/theme-chalk/src/tree.scss +4 -2
  38. package/src/index.js +1 -1
@@ -2,7 +2,9 @@
2
2
  <div class="es-main">
3
3
  <div class="es-simplicity-side">
4
4
  <img class="es-simplicity-logo" v-if="mainLogo" :src="mainLogo" />
5
- <div class="es-simplicity-org-name">{{ userModel.orgName }}</div>
5
+ <div class="es-simplicity-org-name">
6
+ {{ simpleUserInfo.orgShortName || simpleUserInfo.orgName }}
7
+ </div>
6
8
  <el-popover
7
9
  class="es-simplicity-user-popover"
8
10
  placement="right-start"
@@ -15,6 +17,7 @@
15
17
  :notifyList="notifyList"
16
18
  :notify="notify"
17
19
  :contents="userInfoContents"
20
+ @success="handleSuccess"
18
21
  @change="handleChangeConfig"
19
22
  @close="handlerClose"
20
23
  ></user>
@@ -83,6 +86,7 @@
83
86
  :color="menuColor"
84
87
  :backgroundColor="menuBackgroundColor"
85
88
  :menu-icon="menuIcon"
89
+ :active="subActive"
86
90
  v-bind="subMenus"
87
91
  @command="handlerClickMenu"
88
92
  ></sub-menu>
@@ -182,6 +186,7 @@
182
186
  v-model="activeName"
183
187
  closable
184
188
  hide-bar
189
+ opacity
185
190
  @tab-remove="handleRemove"
186
191
  @tab-contextmenu="handleContextmenu"
187
192
  >
@@ -466,6 +471,8 @@ export default {
466
471
  subMenus: null,
467
472
  //展示菜单导航
468
473
  showMenu: false,
474
+ //子菜单选中
475
+ subActive: '',
469
476
  //折叠菜单
470
477
  fold: false,
471
478
  //人工智能配置
@@ -528,7 +535,7 @@ export default {
528
535
  //选中菜单
529
536
  active: '',
530
537
  //单位名称
531
- orgName: ''
538
+ simpleUserInfo: {}
532
539
  };
533
540
  },
534
541
  computed: {
@@ -841,52 +848,73 @@ export default {
841
848
  let tab = this.setIframeType(obj);
842
849
  this.tabs = [tab];
843
850
  this.activeName = tab.id;
844
- // if (tab.method == 'router') {
845
- // let params = util.getParams({ url: tab.url });
846
- // this.$router.push({
847
- // path: tab.path,
848
- // query: { ...this.$parent.params, ...params }
849
- // });
850
- // }
851
851
  }
852
852
  }
853
853
  }
854
- if (this.tabs.length == 0) {
855
- let subMenus = this.getMenu(
856
- this.menus,
857
- this.appCode,
858
- 'appCode'
859
- );
860
- if (subMenus) {
861
- // this.subMenus = subMenus;
862
- // this.showMenu = true;
854
+ let subMenus = this.getMenu(
855
+ this.menus,
856
+ this.appCode,
857
+ 'appCode'
858
+ );
859
+ if (subMenus) {
860
+ if (this.tabs.length == 0) {
863
861
  let obj = this.getFirst(subMenus);
864
862
  if (obj) {
863
+ this.subActive = obj.id;
865
864
  let tab = this.setIframeType(obj);
866
865
  this.tabs = [tab];
867
866
  this.activeName = tab.id;
868
- // if (tab.method == 'router') {
869
- // let params = util.getParams({ url: tab.url });
867
+ } else {
868
+ this.subActive = '';
869
+ }
870
+ }
871
+ this.subMenus = subMenus;
872
+ this.showMenu = true;
873
+ } else {
874
+ this.subMenus = null;
875
+ this.showMenu = false;
876
+ }
877
+ } else {
878
+ if (this.indexUrl) {
879
+ let obj = this.getMenu(this.menus, this.indexUrl);
880
+ if (obj) {
881
+ if (!this.appCode) {
882
+ let tab = this.setIframeType(obj);
883
+ this.tabs = [tab];
884
+ this.activeName = tab.id;
885
+ }
886
+ this.homePage = obj;
887
+ } else {
888
+ this.homePage = this.setIframeType({
889
+ url: this.indexUrl,
890
+ text: '工作台',
891
+ id: '0',
892
+ appCode: 'indexUrl'
893
+ });
894
+ if (!this.appCode) {
895
+ this.tabs = [this.homePage];
896
+ this.activeName = '0';
897
+ // if (this.homePage.method == 'router') {
898
+ // let params = util.getParams({ url: this.homePage.url });
870
899
  // this.$router.push({
871
- // path: tab.path,
900
+ // path: this.homePage.path,
872
901
  // query: { ...this.$parent.params, ...params }
873
902
  // });
874
903
  // }
875
904
  }
876
- } else {
877
- this.subMenus = null;
878
- this.showMenu = false;
879
905
  }
880
- }
881
- // this.width = this.menuWidth;
882
- // this.$refs.subMenus && this.$refs.subMenus.clearSubmenu();
883
- }
884
- if (this.indexUrl) {
885
- let obj = this.getMenu(this.menus, this.indexUrl);
886
- if (obj) {
887
- if (!this.appCode) {
906
+ } else if (
907
+ this.initApps &&
908
+ this.initApps.length &&
909
+ !this.appCode
910
+ ) {
911
+ let obj = this.getMenu(
912
+ this.menus,
913
+ this.initApps[this.initApps.length - 1]
914
+ );
915
+ if (obj) {
888
916
  let tab = this.setIframeType(obj);
889
- this.tabs = [tab];
917
+ this.tabs.push(tab);
890
918
  this.activeName = tab.id;
891
919
  // if (tab.method == 'router') {
892
920
  // let params = util.getParams({ url: tab.url });
@@ -896,46 +924,6 @@ export default {
896
924
  // });
897
925
  // }
898
926
  }
899
- this.homePage = obj;
900
- } else {
901
- this.homePage = this.setIframeType({
902
- url: this.indexUrl,
903
- text: '工作台',
904
- id: '0',
905
- appCode: 'indexUrl'
906
- });
907
- if (!this.appCode) {
908
- this.tabs = [this.homePage];
909
- this.activeName = '0';
910
- // if (this.homePage.method == 'router') {
911
- // let params = util.getParams({ url: this.homePage.url });
912
- // this.$router.push({
913
- // path: this.homePage.path,
914
- // query: { ...this.$parent.params, ...params }
915
- // });
916
- // }
917
- }
918
- }
919
- } else if (
920
- this.initApps &&
921
- this.initApps.length &&
922
- !this.appCode
923
- ) {
924
- let obj = this.getMenu(
925
- this.menus,
926
- this.initApps[this.initApps.length - 1]
927
- );
928
- if (obj) {
929
- let tab = this.setIframeType(obj);
930
- this.tabs.push(tab);
931
- this.activeName = tab.id;
932
- // if (tab.method == 'router') {
933
- // let params = util.getParams({ url: tab.url });
934
- // this.$router.push({
935
- // path: tab.path,
936
- // query: { ...this.$parent.params, ...params }
937
- // });
938
- // }
939
927
  }
940
928
  }
941
929
  } else {
@@ -1114,8 +1102,9 @@ export default {
1114
1102
  return flag;
1115
1103
  }
1116
1104
  } else {
1117
- if (this.menuTips[obj.id] && Number(this.menuTips[obj.id])) {
1118
- this.$set(obj, 'tips', Number(this.menuTips[obj.id]));
1105
+ let num = this.menuTips[obj.id] || this.menuTips[obj.code];
1106
+ if (num && Number(num)) {
1107
+ this.$set(obj, 'tips', Number(num));
1119
1108
  return this.menuTips[obj.id];
1120
1109
  }
1121
1110
  }
@@ -1274,6 +1263,15 @@ export default {
1274
1263
  this.tabs.push(tab);
1275
1264
  }
1276
1265
  },
1266
+
1267
+ /**
1268
+ * @desc:用户详情请求成功
1269
+ * @author huangbo
1270
+ * @date 2024年9月7日
1271
+ **/
1272
+ handleSuccess(res) {
1273
+ this.simpleUserInfo = res.simpleUserInfo;
1274
+ },
1277
1275
  /**
1278
1276
  * @desc:修改用户配置
1279
1277
  * @author huangbo
@@ -1314,7 +1312,14 @@ export default {
1314
1312
  * @date 2024年9月7日
1315
1313
  **/
1316
1314
  handleRefresh() {
1317
- this.handleTab();
1315
+ let tab = this.tabs[this.activeName];
1316
+ if (tab.method === 'iframe') {
1317
+ tab.url = util.handlerUrl(tab.url);
1318
+ }
1319
+ tab.refresh = false;
1320
+ this.$nextTick(() => {
1321
+ tab.refresh = true;
1322
+ });
1318
1323
  },
1319
1324
  /**
1320
1325
  * @desc:删除iframe
@@ -10,21 +10,28 @@
10
10
  trigger="hover"
11
11
  popper-class="es-simplicity-menus-sub"
12
12
  :width="width"
13
+ @show="handleShow"
14
+ @hide="handleHide"
13
15
  >
14
- <menu-list
15
- ref="menus"
16
- :data="[...(item.children || []), ...(item.fourthTabs || [])]"
17
- :menuIcon="menuIcon"
18
- :color="color"
19
- :backgroundColor="backgroundColor"
20
- :width="width"
21
- @command="handleClick"
22
- ></menu-list>
16
+ <template slot-scope="{ parent }">
17
+ <menu-list
18
+ ref="menus"
19
+ :parent="parent"
20
+ :active="active"
21
+ :popover="show"
22
+ :data="[...(item.children || []), ...(item.fourthTabs || [])]"
23
+ :menuIcon="menuIcon"
24
+ :color="color"
25
+ :backgroundColor="backgroundColor"
26
+ :width="width"
27
+ @command="handleClick"
28
+ ></menu-list>
29
+ </template>
23
30
  <div
24
31
  slot="reference"
25
32
  class="es-simplicity-menus-item"
26
33
  :key="item.id"
27
- :class="{ 'is-active': active === item.id, 'is-fold': fold }"
34
+ :class="{ 'is-active': defaultActive === item.id, 'is-fold': fold }"
28
35
  :title="fold ? item.text || item.name : ''"
29
36
  >
30
37
  <template v-if="fold">
@@ -55,7 +62,7 @@
55
62
  v-else
56
63
  class="es-simplicity-menus-item"
57
64
  :key="item.id"
58
- :class="{ 'is-active': active === item.id, 'is-fold': fold }"
65
+ :class="{ 'is-active': defaultActive === item.id, 'is-fold': fold }"
59
66
  :title="fold ? item.text || item.name : ''"
60
67
  @click="handleClick(item)"
61
68
  >
@@ -91,20 +98,33 @@ export default {
91
98
  name: 'MenuList',
92
99
  components: {},
93
100
  props: {
101
+ active: String,
94
102
  menuIcon: String,
95
103
  color: [String, Array],
96
104
  backgroundColor: [String, Array],
97
105
  data: Array,
98
106
  fold: Boolean,
99
- width: Number
107
+ width: Number,
108
+ popover: Boolean,
109
+ parent: Object
100
110
  },
101
111
  data() {
102
112
  return {
103
- active: ''
113
+ defaultActive: this.active,
114
+ show: false,
115
+ height: document.body.offsetHeight - 44
104
116
  };
105
117
  },
106
118
  computed: {},
107
- watch: {},
119
+ watch: {
120
+ popover() {
121
+ if (this.$el.offsetHeight > this.height) {
122
+ this.$el.style.height = this.height + 'px';
123
+ } else {
124
+ this.$el.style.height = '';
125
+ }
126
+ }
127
+ },
108
128
  created() {},
109
129
  mounted() {},
110
130
  methods: {
@@ -129,7 +149,7 @@ export default {
129
149
  return obj;
130
150
  },
131
151
  handleClick(res) {
132
- this.active = res.id;
152
+ this.defaultActive = res.id;
133
153
  if (res.url) {
134
154
  if (res.urlopenmode == 1) {
135
155
  util.win.open(res.url);
@@ -141,8 +161,17 @@ export default {
141
161
  }
142
162
  this.$emit('command', res);
143
163
  },
144
- clearActive() {
145
- this.active = '';
164
+ handleShow() {
165
+ this.show = true;
166
+ if (this.parent) {
167
+ this.parent.changeContinue(true);
168
+ }
169
+ },
170
+ handleHide() {
171
+ if (this.parent) {
172
+ this.parent.changeContinue(false);
173
+ //this.parent.hidePopper();
174
+ }
146
175
  }
147
176
  }
148
177
  };
@@ -30,6 +30,7 @@
30
30
  </div>
31
31
  <menu-list
32
32
  ref="menus"
33
+ :active="active"
33
34
  :data="menus"
34
35
  :menuIcon="menuIcon"
35
36
  :color="color"
@@ -50,6 +51,7 @@ export default {
50
51
  components: { MenuList },
51
52
  props: {
52
53
  title: String,
54
+ active: String,
53
55
  color: {
54
56
  type: [String, Array],
55
57
  default: '#fff'
@@ -91,7 +93,6 @@ export default {
91
93
  return {
92
94
  fold: false,
93
95
  width: this.size,
94
- active: '',
95
96
  subMenus: []
96
97
  };
97
98
  },
@@ -133,6 +133,7 @@ export default {
133
133
  this.checkPassword = results.checkPassword;
134
134
  this.checkPasswordMsg = results.checkPasswordMsg;
135
135
  this.headImgCode = results.headImgCode || undefined;
136
+ this.$emit('success', results);
136
137
  } else {
137
138
  let msg = res.msg || '系统错误,请联系管理员!';
138
139
  this.$message.error(msg);
@@ -498,7 +498,10 @@ export default {
498
498
  }
499
499
  }
500
500
  } else {
501
- if (typeof data === 'string' || !data.length) {
501
+ if (
502
+ typeof data === 'string' ||
503
+ (!data.length && !this.sysCode && !this.url)
504
+ ) {
502
505
  return value;
503
506
  }
504
507
  if (Array.isArray(data) && data.length) {