htui-yllkbz 1.4.4 → 1.4.7

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.4.4",
3
+ "version": "1.4.7",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2023-03-20 18:46:48
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-03-30 17:15:49
7
+ * @LastEditTime: 2023-03-30 17:38:51
8
8
  -->
9
9
  <template>
10
10
  <el-menu
@@ -16,7 +16,7 @@
16
16
  >
17
17
  <MenuItem
18
18
  :baseUrl="baseUrl"
19
- v-for="item in data"
19
+ v-for="item in menuList"
20
20
  :key="item.name"
21
21
  :data="item"
22
22
  ></MenuItem>
@@ -42,7 +42,7 @@ interface State {
42
42
  export default class Index extends Vue {
43
43
  /** 通用样式 */
44
44
  @Prop() comStyle!: string;
45
- @Prop() data!: string;
45
+ @Prop() data!: any[];
46
46
  @Prop() collapse!: string;
47
47
  @Prop() baseUrl!: string;
48
48
  /** 数据 */
@@ -55,6 +55,9 @@ export default class Index extends Vue {
55
55
  created() {
56
56
  // console.log('', this.$route, this.$router);
57
57
  }
58
+ get menuList() {
59
+ return this.data.filter((item) => item.isEnabled && item.position === 1);
60
+ }
58
61
  /** 方法 */
59
62
  /** 监听 */
60
63
  /** 计算属性 */
@@ -82,7 +85,7 @@ export default class Index extends Vue {
82
85
  }
83
86
  @Watch('data', { immediate: true })
84
87
  getdata(val: any) {
85
- //console.log('data', val);
88
+ console.log('data', val);
86
89
  }
87
90
  }
88
91
  </script>
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2023-03-20 18:47:12
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-03-30 17:10:36
7
+ * @LastEditTime: 2023-03-30 17:45:19
8
8
  -->
9
9
  <template>
10
10
  <el-submenu class="ht-menu-list" :index="data.name" v-if="dataLeng">
@@ -15,7 +15,9 @@
15
15
 
16
16
  <MenuItem
17
17
  :baseUrl="baseUrl"
18
- v-for="item in data.children"
18
+ v-for="item in data.children.filter(
19
+ (item) => item.isEnabled && item.position === 1
20
+ )"
19
21
  :key="item.name"
20
22
  :data="item"
21
23
  ></MenuItem>
@@ -26,15 +28,17 @@
26
28
  :route="setRoute(data).url || '/'"
27
29
  :index="!!setRoute(data).url ? data.path : '/'"
28
30
  >
29
- <i :class="data.icon"></i>
30
- <span slot="title">{{ data.displayName }}{{ data.path }}</span>
31
+ <i :class="data.icon || 'el-icon-menu'"></i>
32
+ <!-- <i v-else>{{ getFirstName(data.displayName) }}</i> -->
33
+ <span slot="title">{{ data.displayName }}</span>
31
34
  </el-menu-item>
32
35
  <el-menu-item
33
36
  v-else-if="!dataLeng && !setRoute(data).isSelf"
34
37
  :index="data.name"
35
38
  >
36
39
  <div class="ht-jump" @click.stop="jumpUrl(data)">
37
- <i :class="data.icon"> </i>
40
+ <i :class="data.icon || 'el-icon-menu'" v-if="data.icon"></i>
41
+ <!-- <i v-else>{{ getFirstName(data.displayName) }}</i> -->
38
42
  <span slot="title">{{ data.displayName }}</span>
39
43
  </div>
40
44
  </el-menu-item>
@@ -71,6 +75,9 @@ export default class Index extends Vue {
71
75
  window.location.href = row.path || '';
72
76
  }
73
77
  }
78
+ getFirstName(displayName: string) {
79
+ return displayName.slice(0, 1);
80
+ }
74
81
  /** 设置跳转地址 */
75
82
  setRoute(data: MenuDto) {
76
83
  const urlArr = data.path ? data.path.split(this.baseUrl) : [];
@@ -336,7 +336,7 @@
336
336
  <!-- 此处建议使用el-col -->
337
337
  <slot name="footerLeft"></slot>
338
338
 
339
- <el-col :span="12">
339
+ <el-col :span="$slots['footerLeft'] ? 12 : 24">
340
340
  <!-- <p style="width:90px;float:left">共{{data.length}}条</p> -->
341
341
  <PageInfo
342
342
  :hide-on-single-page="pagination && pagination.hideOnSinglePage"