htui-yllkbz 1.5.24 → 1.5.29
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/htui.common.js +509 -528
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +509 -528
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +8 -8
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +2 -1
- package/src/packages/HtShowBaseData/index.vue +1 -0
- package/src/packages/HtTable/htTableColumn.vue +23 -28
- package/src/packages/HtTable/index.vue +26 -1
- package/src/packages/common.ts +179 -1
- package/src/views/About.vue +27 -6
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "htui-yllkbz",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.29",
|
|
4
4
|
"port": "8082",
|
|
5
5
|
"typings": "types/index.d.ts",
|
|
6
6
|
"main": "lib/htui.common.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@microsoft/signalr": "^8.0.0",
|
|
24
|
+
"@types/node": "^22.5.5",
|
|
24
25
|
"axios": "^0.21.0",
|
|
25
26
|
"core-js": "^3.6.5",
|
|
26
27
|
"element-ui": "^2.14.1",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
<template v-if="item.children && item.children.length">
|
|
27
27
|
<HtTableColumn :item="child"
|
|
28
|
+
:getAllBaseData="getAllBaseData"
|
|
29
|
+
:getAllOrg="getAllOrg"
|
|
30
|
+
:getAllRole="getAllRole"
|
|
31
|
+
:getAllUser="getAllUser"
|
|
28
32
|
v-for="(child, childindex) in item.children"
|
|
29
33
|
@showFiles="(val) => $emit('showFiles', val)"
|
|
30
34
|
:fromColumn="true"
|
|
@@ -56,35 +60,25 @@
|
|
|
56
60
|
:rowIndex="$index">
|
|
57
61
|
<!-- 处理部门 -->
|
|
58
62
|
<template v-if="item.type === 'org'">
|
|
59
|
-
<
|
|
63
|
+
<el-tag v-if="getPropByPath(row, item.key)"> {{getAllOrg[getPropByPath(row, item.key)]?.displayName }}</el-tag>
|
|
64
|
+
<!-- <HtOrgInfo v-if="getPropByPath(row, item.key)"
|
|
60
65
|
:org-id="getPropByPath(row, item.key)"
|
|
61
|
-
type="tag"></HtOrgInfo>
|
|
66
|
+
type="tag"></HtOrgInfo> -->
|
|
62
67
|
<span v-else>--</span>
|
|
63
68
|
</template>
|
|
64
69
|
<!-- 处理基础数据 -->
|
|
65
70
|
<template v-else-if="item.type === 'common'">
|
|
66
|
-
<
|
|
71
|
+
<span v-if="item.commonType === 'userId'&&getPropByPath(row, item.key)">
|
|
72
|
+
{{ getAllUser[getPropByPath(row, item.key)]?.value }}</span>
|
|
73
|
+
<span v-else-if="item.commonType === 'departmentId'&&getPropByPath(row, item.key)">
|
|
74
|
+
{{ getAllOrg[getPropByPath(row, item.key)]?.displayName }}</span>
|
|
75
|
+
<span v-else-if="item.commonType === 'roleId'&&getPropByPath(row, item.key)">
|
|
76
|
+
{{ getAllRole[getPropByPath(row, item.key)]?.name }}</span>
|
|
77
|
+
<span v-else-if="item.commonType === 'baseDataId'&&getPropByPath(row, item.key)">
|
|
78
|
+
{{ getAllBaseData[getPropByPath(row, item.key)]?.name }}<span v-if="!item.hideCode">({{ getAllBaseData[getPropByPath(row, item.key)]?.value }})</span></span>
|
|
79
|
+
|
|
80
|
+
<HtShowBaseData v-else-if="getPropByPath(row, item.key)&&(item.commonType === 'baseDataValue'|| item.commonType === 'baseDataName')"
|
|
67
81
|
:hide-code="item.hideCode"
|
|
68
|
-
:user-id="
|
|
69
|
-
item.commonType === 'userId'
|
|
70
|
-
? JSON.stringify([getPropByPath(row, item.key)])
|
|
71
|
-
: '[]'
|
|
72
|
-
"
|
|
73
|
-
:department-id="
|
|
74
|
-
item.commonType === 'departmentId'
|
|
75
|
-
? JSON.stringify([getPropByPath(row, item.key)])
|
|
76
|
-
: '[]'
|
|
77
|
-
"
|
|
78
|
-
:role-id="
|
|
79
|
-
item.commonType === 'roleId'
|
|
80
|
-
? JSON.stringify([getPropByPath(row, item.key)])
|
|
81
|
-
: '[]'
|
|
82
|
-
"
|
|
83
|
-
:base-data-id="
|
|
84
|
-
item.commonType === 'baseDataId'
|
|
85
|
-
? getPropByPath(row, item.key)
|
|
86
|
-
: ''
|
|
87
|
-
"
|
|
88
82
|
:base-data-value="
|
|
89
83
|
item.commonType === 'baseDataValue'
|
|
90
84
|
? getPropByPath(row, item.key)
|
|
@@ -102,11 +96,8 @@
|
|
|
102
96
|
</template>
|
|
103
97
|
<!-- 处理部门人员 -->
|
|
104
98
|
<template v-else-if="item.type === 'userId'">
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
:base-data-info="true">
|
|
108
|
-
</HtShowBaseData>
|
|
109
|
-
|
|
99
|
+
<span v-if="getPropByPath(row, item.key)">
|
|
100
|
+
{{ getAllUser[getPropByPath(row, item.key)]?.value }}</span>
|
|
110
101
|
<span v-else>--</span>
|
|
111
102
|
</template>
|
|
112
103
|
<!-- 处理时间 yyyy-mm-dd HH:mm:ss -->
|
|
@@ -236,6 +227,10 @@ interface State {
|
|
|
236
227
|
export default class Index extends Vue {
|
|
237
228
|
/** 单个Column信息 */
|
|
238
229
|
@Prop() item!: Column;
|
|
230
|
+
@Prop() getAllBaseData!: any;
|
|
231
|
+
@Prop() getAllOrg!: any;
|
|
232
|
+
@Prop() getAllRole!: any;
|
|
233
|
+
@Prop() getAllUser!: any;
|
|
239
234
|
/** 是否来自循环嵌套 */
|
|
240
235
|
@Prop() fromColumn!: boolean;
|
|
241
236
|
/** 数据 */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-11 11:23:24
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2024-
|
|
7
|
+
* @LastEditTime: 2024-09-24 09:45:55
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div v-loading="state.loading"
|
|
@@ -137,6 +137,10 @@
|
|
|
137
137
|
|
|
138
138
|
<HtTableColumn :key="`${item.key}_${index}`"
|
|
139
139
|
:item="item"
|
|
140
|
+
:getAllBaseData="getAllBaseData"
|
|
141
|
+
:getAllOrg="getAllOrg"
|
|
142
|
+
:getAllRole="getAllRole"
|
|
143
|
+
:getAllUser="getAllUser"
|
|
140
144
|
@showFiles="showFiles">
|
|
141
145
|
<template v-for="child in allChildren"
|
|
142
146
|
:slot="child.key"
|
|
@@ -274,6 +278,7 @@ import HtSelectUnit from "@/packages/HtSelectUnit";
|
|
|
274
278
|
import HtTableColumn from "./htTableColumn.vue";
|
|
275
279
|
import ElmentUI from "element-ui";
|
|
276
280
|
import { getSpanMethod } from "./table-span-method";
|
|
281
|
+
import { getAllBaseData, getAllOrg, getAllRole, getAllUser } from "../common";
|
|
277
282
|
Vue.use(ElmentUI);
|
|
278
283
|
interface State {
|
|
279
284
|
pageInfo: PageInfoType;
|
|
@@ -638,6 +643,26 @@ export default class HtTable extends Vue {
|
|
|
638
643
|
});
|
|
639
644
|
return allchildren;
|
|
640
645
|
}
|
|
646
|
+
/** 获取所有基础信息 */
|
|
647
|
+
get getAllBaseData() {
|
|
648
|
+
// console.log("获取所有基础信息", getAllBaseData());
|
|
649
|
+
return getAllBaseData();
|
|
650
|
+
}
|
|
651
|
+
/** 获取所有部门信息 */
|
|
652
|
+
get getAllOrg() {
|
|
653
|
+
// console.log("获取所有部门信息", getAllOrg());
|
|
654
|
+
return getAllOrg();
|
|
655
|
+
}
|
|
656
|
+
/** 获取所有用户信息 */
|
|
657
|
+
get getAllUser() {
|
|
658
|
+
//console.log("获取所有用户信息", getAllUser());
|
|
659
|
+
return getAllUser();
|
|
660
|
+
}
|
|
661
|
+
/** 获取所有角色信息 */
|
|
662
|
+
get getAllRole() {
|
|
663
|
+
// console.log("获取所有角色信息", getAllRole());
|
|
664
|
+
return getAllRole();
|
|
665
|
+
}
|
|
641
666
|
|
|
642
667
|
/** 监听 */
|
|
643
668
|
@Watch("pageInfo")
|
package/src/packages/common.ts
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-07-18 15:01:02
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2024-
|
|
7
|
+
* @LastEditTime: 2024-09-24 09:01:39
|
|
8
8
|
*/
|
|
9
9
|
import moment from "moment";
|
|
10
10
|
import { FormValues, TimeModes } from "./type";
|
|
11
|
+
import { baseConfig } from "vue-kst-auth";
|
|
11
12
|
|
|
12
13
|
/** 生成唯一Id
|
|
13
14
|
* @params e 生成的id位数 默认32
|
|
@@ -241,3 +242,180 @@ export const roundHalfToEven = (num: number, precision = 2) => {
|
|
|
241
242
|
// 将结果除以10的precision次方,得到最终舍入后的结果
|
|
242
243
|
return tempNum / factor;
|
|
243
244
|
}
|
|
245
|
+
|
|
246
|
+
/** 获取所有部门信息 */
|
|
247
|
+
export const getAllOrg = () => {
|
|
248
|
+
const baseDataItem: any = {}
|
|
249
|
+
let resData = {
|
|
250
|
+
baseData: {
|
|
251
|
+
items: [],
|
|
252
|
+
},
|
|
253
|
+
dictionaryCategory: {
|
|
254
|
+
items: [],
|
|
255
|
+
},
|
|
256
|
+
dictionaryData: [],
|
|
257
|
+
severityLevel: [],
|
|
258
|
+
organizationUnit: [],
|
|
259
|
+
organizationUsersTree: [],
|
|
260
|
+
users: {
|
|
261
|
+
items: [],
|
|
262
|
+
},
|
|
263
|
+
SessionState: "",
|
|
264
|
+
userInOrganiza: [],
|
|
265
|
+
organizationUsers: {},
|
|
266
|
+
roleList: [],
|
|
267
|
+
}
|
|
268
|
+
if (!baseConfig.getLoginState()) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
let data = window.localStorage.getItem("commonDatas");
|
|
272
|
+
if (data) {
|
|
273
|
+
resData = Object.assign(resData, JSON.parse(data));
|
|
274
|
+
data = null;
|
|
275
|
+
}
|
|
276
|
+
const organizationUnit = resData.organizationUnit;
|
|
277
|
+
/** 递归处理基础数据 */
|
|
278
|
+
function getBaseDataItem(list: any[]) {
|
|
279
|
+
list.forEach((item) => {
|
|
280
|
+
baseDataItem[item.id || ""] = item;
|
|
281
|
+
if (item.children) {
|
|
282
|
+
getBaseDataItem(item.children);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
getBaseDataItem(organizationUnit);
|
|
287
|
+
return baseDataItem
|
|
288
|
+
}
|
|
289
|
+
/** 获取所有角色信息 */
|
|
290
|
+
export const getAllRole = () => {
|
|
291
|
+
const baseDataItem: any = {}
|
|
292
|
+
let resData = {
|
|
293
|
+
baseData: {
|
|
294
|
+
items: [],
|
|
295
|
+
},
|
|
296
|
+
dictionaryCategory: {
|
|
297
|
+
items: [],
|
|
298
|
+
},
|
|
299
|
+
dictionaryData: [],
|
|
300
|
+
severityLevel: [],
|
|
301
|
+
organizationUnit: [],
|
|
302
|
+
organizationUsersTree: [],
|
|
303
|
+
users: {
|
|
304
|
+
items: [],
|
|
305
|
+
},
|
|
306
|
+
SessionState: "",
|
|
307
|
+
userInOrganiza: [],
|
|
308
|
+
organizationUsers: {},
|
|
309
|
+
roleList: [],
|
|
310
|
+
}
|
|
311
|
+
if (!baseConfig.getLoginState()) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
let data = window.localStorage.getItem("commonDatas");
|
|
315
|
+
if (data) {
|
|
316
|
+
resData = Object.assign(resData, JSON.parse(data));
|
|
317
|
+
data = null;
|
|
318
|
+
}
|
|
319
|
+
const roleList = resData.roleList;
|
|
320
|
+
/** 递归处理基础数据 */
|
|
321
|
+
function getBaseDataItem(list: any[]) {
|
|
322
|
+
list.forEach((item) => {
|
|
323
|
+
baseDataItem[item.id || ""] = item;
|
|
324
|
+
if (item.children) {
|
|
325
|
+
getBaseDataItem(item.children);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
getBaseDataItem(roleList);
|
|
330
|
+
return baseDataItem
|
|
331
|
+
}
|
|
332
|
+
/** 获取所有用户信息 */
|
|
333
|
+
export const getAllUser = () => {
|
|
334
|
+
const baseDataItem: any = {}
|
|
335
|
+
let resData = {
|
|
336
|
+
baseData: {
|
|
337
|
+
items: [],
|
|
338
|
+
},
|
|
339
|
+
dictionaryCategory: {
|
|
340
|
+
items: [],
|
|
341
|
+
},
|
|
342
|
+
dictionaryData: [],
|
|
343
|
+
severityLevel: [],
|
|
344
|
+
organizationUnit: [],
|
|
345
|
+
organizationUsersTree: [],
|
|
346
|
+
users: {
|
|
347
|
+
items: [],
|
|
348
|
+
},
|
|
349
|
+
SessionState: "",
|
|
350
|
+
userInOrganiza: [],
|
|
351
|
+
organizationUsers: {},
|
|
352
|
+
roleList: [],
|
|
353
|
+
}
|
|
354
|
+
if (!baseConfig.getLoginState()) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
let data = window.localStorage.getItem("commonDatas");
|
|
358
|
+
if (data) {
|
|
359
|
+
resData = Object.assign(resData, JSON.parse(data));
|
|
360
|
+
data = null;
|
|
361
|
+
}
|
|
362
|
+
const { items = [] } = resData.users;
|
|
363
|
+
|
|
364
|
+
/** 递归处理基础数据 */
|
|
365
|
+
function getBaseDataItem(list: any[]) {
|
|
366
|
+
list.forEach((item) => {
|
|
367
|
+
baseDataItem[item.id || ""] = item;
|
|
368
|
+
if (item.children) {
|
|
369
|
+
getBaseDataItem(item.children);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
getBaseDataItem(items);
|
|
374
|
+
return baseDataItem
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** 获取所有的base信息通过KEY:VALUE形式 */
|
|
378
|
+
export const getAllBaseData = () => {
|
|
379
|
+
const baseDataItem: any = {}
|
|
380
|
+
let resData = {
|
|
381
|
+
baseData: {
|
|
382
|
+
items: [],
|
|
383
|
+
},
|
|
384
|
+
dictionaryCategory: {
|
|
385
|
+
items: [],
|
|
386
|
+
},
|
|
387
|
+
dictionaryData: [],
|
|
388
|
+
severityLevel: [],
|
|
389
|
+
organizationUnit: [],
|
|
390
|
+
organizationUsersTree: [],
|
|
391
|
+
users: {
|
|
392
|
+
items: [],
|
|
393
|
+
},
|
|
394
|
+
SessionState: "",
|
|
395
|
+
userInOrganiza: [],
|
|
396
|
+
organizationUsers: {},
|
|
397
|
+
roleList: [],
|
|
398
|
+
}
|
|
399
|
+
if (!baseConfig.getLoginState()) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
let data = window.localStorage.getItem("commonDatas");
|
|
403
|
+
if (data) {
|
|
404
|
+
resData = Object.assign(resData, JSON.parse(data));
|
|
405
|
+
data = null;
|
|
406
|
+
}
|
|
407
|
+
const { items = [] } = resData.baseData;
|
|
408
|
+
/** 递归处理基础数据 */
|
|
409
|
+
function getBaseDataItem(list: any[]) {
|
|
410
|
+
list.forEach((item) => {
|
|
411
|
+
baseDataItem[item.id || ""] = item;
|
|
412
|
+
if (item.children) {
|
|
413
|
+
getBaseDataItem(item.children);
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
getBaseDataItem(items);
|
|
418
|
+
|
|
419
|
+
return baseDataItem
|
|
420
|
+
}
|
|
421
|
+
|
package/src/views/About.vue
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-15 14:41:40
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2024-
|
|
7
|
+
* @LastEditTime: 2024-09-24 09:41:14
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div>
|
|
11
|
+
|
|
11
12
|
<el-button @click="state.visible = true">打开</el-button>
|
|
12
13
|
<!-- <ht-row :gutter="16" :copies="10" colMinHeight="56px">
|
|
13
14
|
<ht-col :span="2">iii</ht-col>
|
|
@@ -79,6 +80,7 @@ import HtBread from "@/packages/HtBread";
|
|
|
79
80
|
import HtMore from "@/packages/HtMore";
|
|
80
81
|
import { getSpanMethod } from "@/packages/HtTable/table-span-method";
|
|
81
82
|
import HtMd from "@/packages/HtMd";
|
|
83
|
+
import { getAllBaseData } from "@/packages/common";
|
|
82
84
|
|
|
83
85
|
interface State {
|
|
84
86
|
/** 数据状态 */
|
|
@@ -115,7 +117,9 @@ export default class Index extends Vue {
|
|
|
115
117
|
data: [
|
|
116
118
|
{
|
|
117
119
|
name: "胡涛",
|
|
118
|
-
userId: "
|
|
120
|
+
userId: "50eb2d57-8529-00fb-4244-3a0c8ec117b0",
|
|
121
|
+
basedata: "0af4e2e8-21a8-85ed-bca5-3a0f9d36eb5f",
|
|
122
|
+
orgId: "2c3f739e-3c8d-3095-c7c4-3a0e59500dc0",
|
|
119
123
|
selectable: true,
|
|
120
124
|
times: 1,
|
|
121
125
|
|
|
@@ -127,7 +131,7 @@ export default class Index extends Vue {
|
|
|
127
131
|
},
|
|
128
132
|
{
|
|
129
133
|
name: "胡涛",
|
|
130
|
-
userId: "
|
|
134
|
+
userId: "50eb2d57-8529-00fb-4244-3a0c8ec117b0",
|
|
131
135
|
times: 1,
|
|
132
136
|
age: 12,
|
|
133
137
|
selectable: false,
|
|
@@ -138,7 +142,7 @@ export default class Index extends Vue {
|
|
|
138
142
|
},
|
|
139
143
|
{
|
|
140
144
|
name: "胡涛1",
|
|
141
|
-
userId: "
|
|
145
|
+
userId: "50eb2d57-8529-00fb-4244-3a0c8ec117b0",
|
|
142
146
|
age: 13,
|
|
143
147
|
times: 1,
|
|
144
148
|
sex: "tt",
|
|
@@ -148,7 +152,7 @@ export default class Index extends Vue {
|
|
|
148
152
|
},
|
|
149
153
|
{
|
|
150
154
|
name: "胡涛",
|
|
151
|
-
userId: "
|
|
155
|
+
userId: "50eb2d57-8529-00fb-4244-3a0c8ec117b0",
|
|
152
156
|
age: 13,
|
|
153
157
|
times: 4,
|
|
154
158
|
file: [],
|
|
@@ -159,7 +163,7 @@ export default class Index extends Vue {
|
|
|
159
163
|
},
|
|
160
164
|
{
|
|
161
165
|
name: "胡涛",
|
|
162
|
-
userId: "
|
|
166
|
+
userId: "50eb2d57-8529-00fb-4244-3a0c8ec117b0",
|
|
163
167
|
age: 12,
|
|
164
168
|
times: 8,
|
|
165
169
|
sex: "tt",
|
|
@@ -184,6 +188,19 @@ export default class Index extends Vue {
|
|
|
184
188
|
width: "300px",
|
|
185
189
|
type: "userId",
|
|
186
190
|
},
|
|
191
|
+
{
|
|
192
|
+
title: "basedata",
|
|
193
|
+
key: "basedata",
|
|
194
|
+
width: "300px",
|
|
195
|
+
type: "common",
|
|
196
|
+
commonType: "baseDataId",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
title: "orgId",
|
|
200
|
+
key: "orgId",
|
|
201
|
+
width: "300px",
|
|
202
|
+
type: "org",
|
|
203
|
+
},
|
|
187
204
|
{
|
|
188
205
|
title: "姓额外名",
|
|
189
206
|
key: "namey",
|
|
@@ -251,6 +268,10 @@ export default class Index extends Vue {
|
|
|
251
268
|
}
|
|
252
269
|
/** 监听 */
|
|
253
270
|
/** 计算属性 */
|
|
271
|
+
get test() {
|
|
272
|
+
console.log("getAllBaseData", getAllBaseData());
|
|
273
|
+
return getAllBaseData();
|
|
274
|
+
}
|
|
254
275
|
}
|
|
255
276
|
</script>
|
|
256
277
|
<style lang="scss" scoped></style>
|