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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.3.108",
3
+ "version": "1.3.112",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
package/src/App.vue CHANGED
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-02-27 16:38:46
7
+ * @LastEditTime: 2023-03-07 17:53:20
8
8
  -->
9
9
  <template>
10
10
  <div id="app">
@@ -49,7 +49,16 @@
49
49
  v-model="state.value"
50
50
  data-type-id="SeverityLevel"
51
51
  ></ht-select-base-data> -->
52
- <ht-select-base-data :dataTypeId="'SeverityLevel'"></ht-select-base-data>
52
+ <ht-select-base-data
53
+ :onlyParent="true"
54
+ v-model="state.value"
55
+ :dataTypeId="'TextList'"
56
+ ></ht-select-base-data>
57
+ <ht-select-base-data
58
+ :parentId="state.value"
59
+ :dataTypeId="'TextList'"
60
+ ></ht-select-base-data>
61
+
53
62
  <router-view></router-view>
54
63
  </div>
55
64
  </template>
package/src/main.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-10-24 15:00:02
7
+ * @LastEditTime: 2023-03-07 17:47:41
8
8
  */
9
9
  import Vue from "vue";
10
10
  import App from "./App.vue";
@@ -61,7 +61,7 @@ _axios.get(`${process.env.BASE_URL}/baseConfig.json`).then((res: any) => {
61
61
  next();
62
62
  } else {
63
63
  next(false);
64
- next("/login");
64
+ //next("/login");
65
65
  }
66
66
  });
67
67
 
@@ -863,9 +863,13 @@ export default class CommonDatas extends Vue {
863
863
  )
864
864
  );
865
865
  if (this.parentId) {
866
- body[item.id || ''] = body[item.id || ''].filter(
866
+ const arr = body[item.id || ''].filter(
867
867
  (item) => item.id === this.parentId
868
868
  );
869
+ body[item.id || ''] =
870
+ Array.isArray(arr) && arr.length
871
+ ? (arr[0].children as BaseDataDto[])
872
+ : arr;
869
873
  }
870
874
  } else {
871
875
  body[item.id || ''] = this.recursion(
@@ -874,9 +878,14 @@ export default class CommonDatas extends Vue {
874
878
  )
875
879
  );
876
880
  if (this.parentId) {
877
- body[item.id || ''] = body[item.id || ''].filter(
881
+ const arr = body[item.id || ''].filter(
878
882
  (item) => item.id === this.parentId
879
883
  );
884
+ body[item.id || ''] =
885
+ Array.isArray(arr) && arr.length
886
+ ? (arr[0].children as BaseDataDto[])
887
+ : arr;
888
+ // console.log("body[item.id || '']", body[item.id || '']);
880
889
  }
881
890
  }
882
891
  });
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2022-09-28 10:24:08
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-01-18 13:06:03
7
+ * @LastEditTime: 2023-03-08 09:41:20
8
8
  -->
9
9
  <template>
10
10
  <el-drawer
@@ -96,7 +96,7 @@ export default class Index extends Vue {
96
96
  /** 是否可以通过按下 ESC 关闭 Drawer */
97
97
  @Prop({ default: false }) closeOnPressEscape!: boolean;
98
98
  /** 控制是否在关闭 Drawer 之后将子元素全部销毁 */
99
- @Prop({ default: false }) destroyOnClose!: boolean;
99
+ @Prop({ default: true }) destroyOnClose!: boolean;
100
100
  /** 是否需要遮罩层 */
101
101
  @Prop({ default: true }) modal!: boolean;
102
102
  /** Drawer 的自定义类名 */
@@ -0,0 +1,15 @@
1
+ /*
2
+ * @Descripttion: 更多三个点功能
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2022-04-12 17:34:51
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2023-03-21 10:50:04
8
+ */
9
+
10
+ import HtMenu from "./index.vue";
11
+ (HtMenu as any).install = function (Vue: any) {
12
+
13
+ Vue.component("HtMenu", HtMenu);
14
+ };
15
+ export default HtMenu;
@@ -0,0 +1,86 @@
1
+ <!--
2
+ * @Descripttion: 菜单管理
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2023-03-20 18:46:48
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2023-03-21 19:27:10
8
+ -->
9
+ <template>
10
+ <el-menu
11
+ class="ht-menu-list"
12
+ :default-active="state.defaultIndex"
13
+ router
14
+ :collapse="state.collapsed"
15
+ :collapse-transition="false"
16
+ >
17
+ <MenuItem
18
+ :baseUrl="baseUrl"
19
+ v-for="item in data"
20
+ :key="item.name"
21
+ :data="item"
22
+ ></MenuItem>
23
+ </el-menu>
24
+ </template>
25
+ <script lang="ts">
26
+ import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
27
+ import ElementUI from 'element-ui';
28
+ import MenuItem from './menuItem.vue';
29
+ Vue.use(ElementUI);
30
+ interface State {
31
+ /** 数据状态 */
32
+ loading: boolean;
33
+ collapsed: boolean;
34
+ defaultIndex: string;
35
+ }
36
+ @Component({
37
+ name: 'HtMenu',
38
+ components: {
39
+ MenuItem,
40
+ },
41
+ })
42
+ export default class Index extends Vue {
43
+ /** 通用样式 */
44
+ @Prop() comStyle!: string;
45
+ @Prop() data!: string;
46
+ @Prop() collapse!: string;
47
+ @Prop() baseUrl!: string;
48
+ /** 数据 */
49
+ state: State = {
50
+ loading: false,
51
+ defaultIndex: '/',
52
+ collapsed: false,
53
+ };
54
+ /** 生命周期 */
55
+ created() {
56
+ this.state.defaultIndex = window.location.pathname;
57
+ }
58
+ /** 方法 */
59
+ /** 监听 */
60
+ /** 计算属性 */
61
+ @Watch('collapse', { immediate: true })
62
+ getCollapse(val: boolean) {
63
+ this.state.collapsed = val;
64
+ }
65
+ @Watch('data', { immediate: true })
66
+ getdata(val: any) {
67
+ console.log('data', val);
68
+ }
69
+ }
70
+ </script>
71
+ <style>
72
+ @import url('/publicData/styles/theme/fonts/element-icons.woff');
73
+ @import url('/publicData/styles/theme/index.css');
74
+ </style>
75
+ <style lang="scss">
76
+ .ht-menu-list {
77
+ background: none !important;
78
+ .el-menu {
79
+ background: none !important;
80
+ }
81
+ .el-menu-item {
82
+ height: 30px !important;
83
+ line-height: 30px !important;
84
+ }
85
+ }
86
+ </style>
@@ -0,0 +1,92 @@
1
+ <!--
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2023-03-20 18:47:12
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2023-03-21 19:25:06
8
+ -->
9
+ <template>
10
+ <el-submenu class="ht-menu-list" :index="data.name" v-if="dataLeng">
11
+ <template slot="title">
12
+ <i :class="data.icon"></i>
13
+ <span>{{ data.displayName }}</span>
14
+ </template>
15
+
16
+ <MenuItem
17
+ :baseUrl="baseUrl"
18
+ v-for="item in data.children"
19
+ :key="item.name"
20
+ :data="item"
21
+ ></MenuItem>
22
+ </el-submenu>
23
+
24
+ <el-menu-item
25
+ v-else-if="!dataLeng && setRoute(data).isSelf"
26
+ :route="setRoute(data).url"
27
+ :index="data.name"
28
+ >
29
+ <i :class="data.icon"></i>
30
+ <span slot="title">{{ data.displayName }}</span>
31
+ </el-menu-item>
32
+ <el-menu-item
33
+ v-else-if="!dataLeng && !setRoute(data).isSelf"
34
+ :index="data.name"
35
+ >
36
+ <div class="ht-jump" @click.stop="jumpUrl(data)">
37
+ <i :class="data.icon"> </i>
38
+ <span slot="title">{{ data.displayName }}</span>
39
+ </div>
40
+ </el-menu-item>
41
+ </template>
42
+ <script lang="ts">
43
+ import { Component, Prop, Vue } from 'vue-property-decorator';
44
+ import { MenuDto } from '../type';
45
+ interface State {
46
+ /** 数据状态 */
47
+ loading: boolean;
48
+ }
49
+ @Component({
50
+ components: {
51
+ MenuItem: () => import('./menuItem.vue'),
52
+ },
53
+ })
54
+ export default class Index extends Vue {
55
+ @Prop() data!: MenuDto;
56
+ @Prop() baseUrl!: string;
57
+ /** 数据 */
58
+ state: State = {
59
+ loading: false,
60
+ };
61
+ /** 生命周期 */
62
+ created() {
63
+ //
64
+ }
65
+ /** url跳转 */
66
+ jumpUrl(row: MenuDto) {
67
+ //window.location.href = row.path || '';
68
+ if (row.target == '_blank') {
69
+ window.open(row.path);
70
+ } else {
71
+ window.location.href = row.path || '';
72
+ }
73
+ }
74
+ /** 设置跳转地址 */
75
+ setRoute(data: MenuDto) {
76
+ const urlArr = data.path ? data.path.split(this.baseUrl) : [];
77
+
78
+ if (urlArr && Array.isArray(urlArr) && urlArr.length) {
79
+ return { url: urlArr[urlArr.length - 1], isSelf: urlArr.length > 1 };
80
+ } else {
81
+ return { url: data.path, isSelf: true };
82
+ }
83
+ }
84
+ /** 方法 */
85
+ /** 监听 */
86
+ /** 计算属性 */
87
+ get dataLeng() {
88
+ return this.data.children && this.data.children.length;
89
+ }
90
+ }
91
+ </script>
92
+ <style lang="scss" scoped></style>
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-12-30 14:29:14
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-02-15 17:09:18
7
+ * @LastEditTime: 2023-03-19 19:00:58
8
8
  -->
9
9
  <template>
10
10
  <span v-if="readonly">
@@ -140,18 +140,18 @@ export default class HtSelectUser extends Vue {
140
140
  return;
141
141
  }
142
142
 
143
- _axios
144
- .get(`/asset_manage/api/asset-management/asset-categories/list`, {
145
- params: { Recursive: true, CurrentId: this.parentId },
146
- })
147
- .then((res) => {
148
- const data = res.data.items || [];
149
- this.state.dataSource = data;
150
- window.sessionStorage.setItem('assetCategory', JSON.stringify(data));
151
- if (this.readonly) {
152
- this.getName(data, val);
153
- }
154
- });
143
+ // _axios
144
+ // .get(`/asset_manage/api/asset-management/asset-categories/list`, {
145
+ // params: { Recursive: true, CurrentId: this.parentId },
146
+ // })
147
+ // .then((res) => {
148
+ // const data = res.data.items || [];
149
+ // this.state.dataSource = data;
150
+ // window.sessionStorage.setItem('assetCategory', JSON.stringify(data));
151
+ // if (this.readonly) {
152
+ // this.getName(data, val);
153
+ // }
154
+ // });
155
155
  } else {
156
156
  //设备分类
157
157
  const sessStr = window.sessionStorage.getItem('deviceCategory');
@@ -160,21 +160,21 @@ export default class HtSelectUser extends Vue {
160
160
  this.getName(JSON.parse(sessStr), val);
161
161
  return;
162
162
  }
163
- _axios
164
- .post(
165
- `/device_models/api/device-model-management/device-category/get-list-all`,
166
- {
167
- isTree: true,
168
- }
169
- )
170
- .then((res) => {
171
- const data = res.data.items || [];
172
- this.state.dataSource = data;
173
- window.sessionStorage.setItem('deviceCategory', JSON.stringify(data));
174
- if (this.readonly) {
175
- this.getName(data, val);
176
- }
177
- });
163
+ // _axios
164
+ // .post(
165
+ // `/device_models/api/device-model-management/device-category/get-list-all`,
166
+ // {
167
+ // isTree: true,
168
+ // }
169
+ // )
170
+ // .then((res) => {
171
+ // const data = res.data.items || [];
172
+ // this.state.dataSource = data;
173
+ // window.sessionStorage.setItem('deviceCategory', JSON.stringify(data));
174
+ // if (this.readonly) {
175
+ // this.getName(data, val);
176
+ // }
177
+ // });
178
178
  }
179
179
  }
180
180
  /** 获取名字 */
@@ -190,7 +190,6 @@ export default class HtSelectUser extends Vue {
190
190
  } else {
191
191
  nameStr = data[i].displayName;
192
192
  }
193
-
194
193
  break;
195
194
  } else {
196
195
  if (data[i].children) {
@@ -0,0 +1,14 @@
1
+ /*
2
+ * @Descripttion:树结构展示
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2021-11-15 15:00:57
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2023-03-08 09:43:23
8
+ */
9
+ import HtTree from "./index.vue";
10
+ (HtTree as any).install = function (Vue: any) {
11
+
12
+ Vue.component("HtTree", HtTree);
13
+ };
14
+ export default HtTree;
@@ -0,0 +1,82 @@
1
+ <!--
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: hutao
5
+ * @Date: 2023-03-07 09:16:01
6
+ * @LastEditors: hutao
7
+ * @LastEditTime: 2023-03-08 10:05:00
8
+ -->
9
+ <template>
10
+ <ul class="ht-tree ht-tree-ul">
11
+ <TreeItem
12
+ @nodeClick="nodeClick"
13
+ :data="item"
14
+ v-for="item in dataSource"
15
+ :key="item.id"
16
+ >
17
+ <template slot="title" slot-scope="{ data }">
18
+ <slot name="title" :data="data"></slot
19
+ ></template>
20
+ </TreeItem>
21
+ </ul>
22
+ </template>
23
+ <script lang="ts">
24
+ import { Component, Vue } from 'vue-property-decorator';
25
+ import TreeItem from './treeItem.vue';
26
+ interface State {
27
+ /** 数据状态 */
28
+ loading: boolean;
29
+ }
30
+ @Component({
31
+ name: 'HtTree',
32
+ components: { TreeItem },
33
+ })
34
+ export default class Index extends Vue {
35
+ /** 数据 */
36
+ state: State = {
37
+ loading: false,
38
+ };
39
+ /** 生命周期 */
40
+ /** 方法 */
41
+ /** 点击节点 */
42
+ nodeClick(data: any) {
43
+ this.$emit('nodeClick', data);
44
+ }
45
+ /** 监听 */
46
+ /** 计算属性 */
47
+ get dataSource() {
48
+ return [
49
+ {
50
+ id: 12,
51
+ name: '电科',
52
+ children: [
53
+ { id: 121, name: '张三', children: [{ id: 1211, name: '张三三' }] },
54
+ { id: 122, name: '张四' },
55
+ { id: 123, name: '张五' },
56
+ ],
57
+ },
58
+ { id: 13, name: '水科' },
59
+ { id: 14, name: '气科' },
60
+ { id: 15, name: '空调科' },
61
+ ];
62
+ }
63
+ }
64
+ </script>
65
+ <style lang="scss">
66
+ .ht-tree-ul,
67
+ .ht-tree-li {
68
+ list-style-type: none;
69
+ list-style: none;
70
+ padding: 0;
71
+ margin: 0;
72
+ }
73
+ .ht-tree-li {
74
+ min-height: 25px;
75
+ line-height: 25px;
76
+ padding-left: 12px;
77
+ .ht-tree-item-icon {
78
+ padding: 6px;
79
+ cursor: pointer;
80
+ }
81
+ }
82
+ </style>
@@ -94,7 +94,9 @@ interface State {
94
94
  dialogVisible: boolean;
95
95
  disabled: boolean;
96
96
  }
97
- @Component
97
+ @Component({
98
+ name: 'HtUpload',
99
+ })
98
100
  export default class HtUpload extends Vue {
99
101
  /** 是否只显示 */
100
102
  @Prop({ default: false }) onlyShow?: boolean;
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-25 17:05:17
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-02-09 13:22:24
7
+ * @LastEditTime: 2023-03-21 11:09:37
8
8
  */
9
9
  /** 初始的默认条数 */
10
10
  export const defalutPageSize = 10
@@ -90,6 +90,31 @@ export interface PageInfoType {
90
90
  skipCount: number;
91
91
  totalCount: number;
92
92
  }
93
+ export interface MenuDto {
94
+ id?: string;
95
+ creationTime?: string;
96
+ creatorId?: string | undefined;
97
+ lastModificationTime?: string | undefined;
98
+ lastModifierId?: string | undefined;
99
+ isDeleted?: boolean;
100
+ deleterId?: string | undefined;
101
+ deletionTime?: string | undefined;
102
+ name?: string | undefined;
103
+ displayName?: string | undefined;
104
+ features?: string | undefined;
105
+ path?: string | undefined;
106
+ order?: number;
107
+ description?: string | undefined;
108
+ icon?: string | undefined;
109
+ position?: number;
110
+ isEnabled?: boolean;
111
+ target?: string | undefined;
112
+ code?: string | undefined;
113
+ level?: number;
114
+ parentId?: string | undefined;
115
+ children?: MenuDto[] | undefined;
116
+ childrenCount?: number;
117
+ }
93
118
  /** 分页返回时候的分页信息 */
94
119
  export interface PageType {
95
120