htui-yllkbz 1.3.108 → 1.3.112

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.
@@ -1,21 +1,25 @@
1
1
  <template>
2
2
  <div id="index">
3
- <el-container style="height: 100vh"
4
- class="index">
3
+ <el-container style="height: 100vh" class="index">
5
4
  <el-header style="padding: 0; height: min-content">
6
- <xhkj-layout02>
7
- <router-link to="/login"
8
- slot="navEnd">注销</router-link>
5
+ <xhkj-layout02 @leftMenu="leftMenu" :hide="true">
6
+ <router-link to="/login" slot="navEnd">注销</router-link>
9
7
  </xhkj-layout02>
10
8
  </el-header>
11
9
  <el-container class="body">
12
- <el-aside :width="state.collapsed ? '66px' : '230px'"
13
- class="left">
10
+ <el-aside :width="state.collapsed ? '66px' : '230px'" class="left">
11
+ <HtMenu
12
+ :data="state.menusList"
13
+ :collapse="state.collapsed"
14
+ baseUrl="/plan-maintenance"
15
+ ></HtMenu>
14
16
  <!--导航菜单-->
15
- <el-menu :default-active="state.defaultIndex"
16
- router
17
- :collapse="state.collapsed"
18
- :collapse-transition="false">
17
+ <el-menu
18
+ :default-active="state.defaultIndex"
19
+ router
20
+ :collapse="state.collapsed"
21
+ :collapse-transition="false"
22
+ >
19
23
  <el-menu-item index="/">
20
24
  <i class="el-icon-s-check"></i>
21
25
  <span slot="title">导航1</span>
@@ -29,30 +33,34 @@
29
33
  <span slot="title">导航3</span>
30
34
  </el-menu-item>
31
35
  </el-menu>
32
- <el-button class="action-btn"
33
- :title="state.collapsed ? '展开菜单' : '收起菜单'"
34
- type="text"
35
- size="medium"
36
- :icon="state.collapsed ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
37
- @click="state.collapsed = !state.collapsed"
38
- style="font-size: 16px"></el-button>
36
+ <el-button
37
+ class="action-btn"
38
+ :title="state.collapsed ? '展开菜单' : '收起菜单'"
39
+ type="text"
40
+ size="medium"
41
+ :icon="state.collapsed ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
42
+ @click="state.collapsed = !state.collapsed"
43
+ style="font-size: 16px"
44
+ ></el-button>
39
45
  </el-aside>
40
- <el-main style="padding: 8px 0 0 15px"
41
- class="cont">
46
+ <el-main style="padding: 8px 0 0 15px" class="cont">
42
47
  <router-view v-if="state.loading"></router-view>
43
48
  </el-main>
44
49
  </el-container>
45
50
  </el-container>
46
- <div v-if="state.isLogin"
47
- is="common-datas"
48
- @commonDatas="commonDatas"
49
- @error="error"></div>
51
+ <div
52
+ v-if="state.isLogin"
53
+ is="common-datas"
54
+ @commonDatas="commonDatas"
55
+ @error="error"
56
+ ></div>
50
57
  </div>
51
58
  </template>
52
59
 
53
60
  <script lang="ts">
54
- import { Component, Vue, Watch } from "vue-property-decorator";
55
- import { baseConfig } from "vue-kst-auth";
61
+ import { Component, Vue, Watch } from 'vue-property-decorator';
62
+ import { baseConfig } from 'vue-kst-auth';
63
+ import HtMenu from '@/packages/HtMenu/index.vue';
56
64
  interface State {
57
65
  /** 数据状态 */
58
66
  loading: boolean;
@@ -62,25 +70,30 @@ interface State {
62
70
  defaultIndex: string;
63
71
  /** 菜单是否收缩 */
64
72
  collapsed: boolean;
73
+ menusList: any[];
65
74
  }
66
75
 
67
76
  @Component({
68
- components: {},
77
+ components: { HtMenu },
69
78
  })
70
79
  export default class App extends Vue {
71
80
  /** 数据 */
72
81
  state: State = {
73
82
  loading: false,
74
83
  isLogin: false,
75
- defaultIndex: "/",
84
+ menusList: [],
85
+ defaultIndex: '/',
76
86
  collapsed: true,
77
87
  };
88
+ leftMenu(e: CustomEvent) {
89
+ this.state.menusList = e.detail[0];
90
+ }
78
91
  /** 生命周期 */
79
92
  created() {
80
93
  // 动态加载引用文件
81
- const files = this.$store.getters.getBaseData("files");
94
+ const files = this.$store.getters.getBaseData('files');
82
95
  const filesKeys: string[] = Object.keys(files);
83
- let heatStr = document.getElementsByTagName("head")[0].innerHTML;
96
+ let heatStr = document.getElementsByTagName('head')[0].innerHTML;
84
97
  filesKeys.forEach((cur) => {
85
98
  const src = files[cur];
86
99
  if (src && /\.css$/.test(src.toString())) {
@@ -90,7 +103,7 @@ export default class App extends Vue {
90
103
  heatStr += `<link rel="icon" href="${src}">`;
91
104
  }
92
105
  });
93
- document.getElementsByTagName("head")[0].innerHTML = heatStr;
106
+ document.getElementsByTagName('head')[0].innerHTML = heatStr;
94
107
  this.state.isLogin = baseConfig.getLoginState() || false;
95
108
  }
96
109
  mounted() {
@@ -107,36 +120,36 @@ export default class App extends Vue {
107
120
  res.SessionState.auth &&
108
121
  res.SessionState.auth.grantedPolicies
109
122
  ) {
110
- this.$store.commit("setBaseDataApi", {
111
- key: "grantedPolicies",
123
+ this.$store.commit('setBaseDataApi', {
124
+ key: 'grantedPolicies',
112
125
  value: res.SessionState.auth.grantedPolicies,
113
126
  });
114
127
  }
115
128
  /** 部门人员数据 */
116
129
  if (res.organizationUsers) {
117
- this.$store.commit("setBaseDataApi", {
118
- key: "organizationUsers",
130
+ this.$store.commit('setBaseDataApi', {
131
+ key: 'organizationUsers',
119
132
  value: res.organizationUsers.items,
120
133
  });
121
134
  }
122
135
  /** 部门数据 */
123
136
  if (res.organizationUnit) {
124
- this.$store.commit("setBaseDataApi", {
125
- key: "organizationUnit",
137
+ this.$store.commit('setBaseDataApi', {
138
+ key: 'organizationUnit',
126
139
  value: res.organizationUnit,
127
140
  });
128
141
  }
129
142
  /** 人员数据 */
130
143
  if (res.users) {
131
- this.$store.commit("setBaseDataApi", {
132
- key: "users",
144
+ this.$store.commit('setBaseDataApi', {
145
+ key: 'users',
133
146
  value: res.users.items,
134
147
  });
135
148
  }
136
149
  /** 严重等级 */
137
150
  if (res.severityLevel) {
138
- this.$store.commit("setBaseDataApi", {
139
- key: "severityLevel",
151
+ this.$store.commit('setBaseDataApi', {
152
+ key: 'severityLevel',
140
153
  value: res.severityLevel,
141
154
  });
142
155
  }
@@ -145,9 +158,9 @@ export default class App extends Vue {
145
158
  this.state.loading = true;
146
159
  }
147
160
  /** 监听 */
148
- @Watch("$route.path", { deep: true })
161
+ @Watch('$route.path', { deep: true })
149
162
  ondata(val: string) {
150
- this.state.defaultIndex = val || "/";
163
+ this.state.defaultIndex = val || '/';
151
164
  }
152
165
  }
153
166
  </script>
@@ -174,9 +187,9 @@ a {
174
187
  }
175
188
  }
176
189
  .index {
177
- background: url("/publicData/images/bg.png ") center no-repeat;
190
+ background: url('/publicData/images/bg.png ') center no-repeat;
178
191
  background-size: 100% 100%;
179
- font-family: "SourceHanSansCN-Normal", "Avenir", Helvetica, Arial, sans-serif;
192
+ font-family: 'SourceHanSansCN-Normal', 'Avenir', Helvetica, Arial, sans-serif;
180
193
  -webkit-font-smoothing: antialiased;
181
194
  -moz-osx-font-smoothing: grayscale;
182
195
  color: #333333;