htui-yllkbz 1.3.63 → 1.3.65
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 +21504 -79
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.umd.js +21504 -79
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +282 -5
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/App.vue +7 -6
- package/src/packages/HtDrawer/index.vue +22 -7
- package/src/packages/HtSelectOrg/index.vue +5 -3
- package/src/packages/HtSelectUser/index.vue +3 -2
- package/src/packages/HtTable/index.vue +4 -2
- package/src/packages/common.ts +67 -2
- package/src/packages/type.ts +2 -3
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
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: 2022-
|
|
7
|
+
* @LastEditTime: 2022-10-13 11:38:50
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div id="app">
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
v-model="state.value"
|
|
24
24
|
@change="change"
|
|
25
25
|
></HtSelectBaseData>
|
|
26
|
-
<
|
|
26
|
+
<HtSelectUser
|
|
27
27
|
:clearable="true"
|
|
28
|
-
:multiple="
|
|
28
|
+
:multiple="true"
|
|
29
29
|
v-model="state.value"
|
|
30
30
|
@change="testuser"
|
|
31
|
-
></
|
|
31
|
+
></HtSelectUser>
|
|
32
32
|
<!-- <HtSelectOrg :clearable="true"
|
|
33
33
|
v-model="state.value"
|
|
34
34
|
@change="testuser"></HtSelectOrg> -->
|
|
@@ -49,6 +49,7 @@ import { mgr } from '@/plugins/oidc-client';
|
|
|
49
49
|
HtSelectBaseData,
|
|
50
50
|
HtSelectOrg,
|
|
51
51
|
HtShowBaseType,
|
|
52
|
+
HtSelectUser,
|
|
52
53
|
},
|
|
53
54
|
})
|
|
54
55
|
export default class App extends Vue {
|
|
@@ -75,8 +76,8 @@ export default class App extends Vue {
|
|
|
75
76
|
change() {
|
|
76
77
|
// console.log("eeee", e);
|
|
77
78
|
}
|
|
78
|
-
testuser(e: any) {
|
|
79
|
-
//console.log('eee', e);
|
|
79
|
+
testuser(e: any, data: any) {
|
|
80
|
+
//console.log('eee', e, data);
|
|
80
81
|
}
|
|
81
82
|
test(e: any) {
|
|
82
83
|
//mgr.removeUser();
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-09-28 10:24:08
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-10-11 16:16:39
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<el-drawer
|
|
@@ -42,12 +42,25 @@
|
|
|
42
42
|
<el-divider v-if="withFooter"></el-divider>
|
|
43
43
|
<slot name="foot" v-if="withFooter">
|
|
44
44
|
<div>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
<template v-if="!footerRight">
|
|
46
|
+
<el-button style="margin-left:20px" @click="onCancel">取消</el-button>
|
|
47
|
+
<el-button style="margin-left:20px" type="primary" @click="onOk"
|
|
48
|
+
>确定</el-button
|
|
49
|
+
>
|
|
50
|
+
</template>
|
|
51
|
+
<template v-else>
|
|
52
|
+
<el-button
|
|
53
|
+
style="margin-right:20px;float:right"
|
|
54
|
+
type="primary"
|
|
55
|
+
@click="onOk"
|
|
56
|
+
>确定</el-button
|
|
57
|
+
>
|
|
58
|
+
<el-button style="margin-right:20px;float:right" @click="onCancel"
|
|
59
|
+
>取消</el-button
|
|
60
|
+
>
|
|
61
|
+
</template>
|
|
62
|
+
</div>
|
|
63
|
+
</slot>
|
|
51
64
|
</el-drawer>
|
|
52
65
|
</template>
|
|
53
66
|
<script lang="ts">
|
|
@@ -89,6 +102,8 @@ export default class Index extends Vue {
|
|
|
89
102
|
@Prop({ default: true }) withHeader!: boolean;
|
|
90
103
|
/** 控制是否显示 foot 栏, 默认为 true, 当此项为 false 时, foot attribute 和 foot slot 均不生效 */
|
|
91
104
|
@Prop({ default: true }) withFooter!: boolean;
|
|
105
|
+
/** footer的按钮是否靠右 */
|
|
106
|
+
@Prop({ default: false }) footerRight!: boolean;
|
|
92
107
|
/** 数据 */
|
|
93
108
|
state: State = {
|
|
94
109
|
loading: false,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-10-13 11:22:49
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
33
33
|
import HtShowBaseData from '@/packages/HtShowBaseData';
|
|
34
34
|
import HtBaseData from '@/packages/HtBaseData';
|
|
35
|
+
import { getCommDataItem } from '../common';
|
|
35
36
|
interface State {
|
|
36
37
|
/** 数据状态 */
|
|
37
38
|
loading: boolean;
|
|
@@ -71,7 +72,7 @@ export default class HtSelectOrg extends Vue {
|
|
|
71
72
|
searchCommonData(res: any) {
|
|
72
73
|
const dep = res['departmentId'];
|
|
73
74
|
|
|
74
|
-
let data = undefined;
|
|
75
|
+
let data: string | undefined | string[] = undefined;
|
|
75
76
|
if (dep.length) {
|
|
76
77
|
if (this.multiple) {
|
|
77
78
|
const arr: string[] = [];
|
|
@@ -84,7 +85,8 @@ export default class HtSelectOrg extends Vue {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
this.$emit('input', data);
|
|
87
|
-
|
|
88
|
+
|
|
89
|
+
this.$emit('change', data, getCommDataItem('org', data));
|
|
88
90
|
}
|
|
89
91
|
/** 监听 */
|
|
90
92
|
get configJson() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-10-13 11:36:25
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
29
29
|
import HtShowBaseData from '@/packages/HtShowBaseData';
|
|
30
30
|
import HtBaseData from '@/packages/HtBaseData';
|
|
31
|
+
import { getCommDataItem } from '../common';
|
|
31
32
|
interface State {
|
|
32
33
|
/** 数据状态 */
|
|
33
34
|
loading: boolean;
|
|
@@ -80,7 +81,7 @@ export default class HtSelectUser extends Vue {
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
this.$emit('input', data);
|
|
83
|
-
this.$emit('change', data);
|
|
84
|
+
this.$emit('change', data, getCommDataItem('user', data));
|
|
84
85
|
}
|
|
85
86
|
/** 监听 */
|
|
86
87
|
get configJson() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-11 11:23:24
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-08
|
|
7
|
+
* @LastEditTime: 2022-10-08 14:28:29
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div v-loading="state.loading" style="background:#fff">
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
:default-checked-keys="state.checkedColumnKeys"
|
|
347
347
|
@check-change="changeColumns"
|
|
348
348
|
:allow-drag="allowDrag"
|
|
349
|
-
draggable
|
|
349
|
+
:draggable="draggable"
|
|
350
350
|
:allow-drop="allowDrop"
|
|
351
351
|
>
|
|
352
352
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
@@ -472,6 +472,8 @@ export default class HtTable extends Vue {
|
|
|
472
472
|
@Prop() headerRowClassName?: any;
|
|
473
473
|
@Prop() headerCellClassName?: any;
|
|
474
474
|
@Prop() headerCellStyle?: any;
|
|
475
|
+
/** 是否可以拖动排序 */
|
|
476
|
+
@Prop({ default: true }) draggable?: boolean;
|
|
475
477
|
|
|
476
478
|
/** 分页的所有额外信息通过此参数传递 */
|
|
477
479
|
@Prop() pagination?: any;
|
package/src/packages/common.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-07-18 15:01:02
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-10-13 11:22:09
|
|
8
8
|
*/
|
|
9
9
|
import moment from "moment";
|
|
10
10
|
|
|
@@ -89,4 +89,69 @@ export function getCommDataName(id?: string, showobj = false) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
return undefined;
|
|
92
|
-
}
|
|
92
|
+
}
|
|
93
|
+
/** 获取基础数据的相关内容
|
|
94
|
+
* @parmas type 想要查询的类型
|
|
95
|
+
* @params keys 查询的内容
|
|
96
|
+
*/
|
|
97
|
+
export function getCommDataItem(type: "users" | "organizationUnit" | "dictionaryCategory" | "dictionaryData" | 'user' | 'org' | "baseData", keys?: string | string[]) {
|
|
98
|
+
const commen = window.localStorage.getItem("commonDatas");
|
|
99
|
+
if (!commen) {
|
|
100
|
+
return undefined
|
|
101
|
+
}
|
|
102
|
+
const commonDatas = JSON.parse(commen)
|
|
103
|
+
|
|
104
|
+
switch (type) {
|
|
105
|
+
case "users"://返回所有人员
|
|
106
|
+
return commonDatas.users.items;
|
|
107
|
+
case "organizationUnit"://返回所有部门
|
|
108
|
+
return commonDatas.organizationUnit;
|
|
109
|
+
case "dictionaryData"://返回所有dictionaryData
|
|
110
|
+
return commonDatas.dictionaryData;
|
|
111
|
+
case "dictionaryCategory":
|
|
112
|
+
return commonDatas.dictionaryCategory.items;
|
|
113
|
+
case "user"://查询所有的关联的人员信息
|
|
114
|
+
const users = commonDatas.users.items;
|
|
115
|
+
if (keys) {
|
|
116
|
+
if (Array.isArray(keys)) {
|
|
117
|
+
return users.filter((item: any) => keys.toString().includes(item.id))
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
return users.find((item: any) => item.id === keys)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
case "org"://查询所有的关联的部门信息
|
|
127
|
+
const organizationUnit = commonDatas.organizationUnit;
|
|
128
|
+
if (keys) {
|
|
129
|
+
if (Array.isArray(keys)) {
|
|
130
|
+
return organizationUnit.filter((item: any) => keys.toString().includes(item.id))
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
return organizationUnit.find((item: any) => item.id === keys)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
case "baseData"://查询所有的id关联的基础数据
|
|
140
|
+
const baseData = commonDatas.baseData.items;
|
|
141
|
+
if (keys) {
|
|
142
|
+
if (Array.isArray(keys)) {
|
|
143
|
+
return baseData.filter((item: any) => keys.toString().includes(item.id))
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return baseData.find((item: any) => item.id === keys)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return baseData
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
}
|
package/src/packages/type.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-10-25 17:05:17
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-08
|
|
7
|
+
* @LastEditTime: 2022-10-08 11:43:12
|
|
8
8
|
*/
|
|
9
9
|
/** 初始的默认条数 */
|
|
10
10
|
export const defalutPageSize = 10
|
|
@@ -63,8 +63,7 @@ export interface Column {
|
|
|
63
63
|
headerAlign?: 'left' | 'right' | 'center';
|
|
64
64
|
className?: string;
|
|
65
65
|
labelClassName?: string;
|
|
66
|
-
|
|
67
|
-
headerSlot?: boolean;
|
|
66
|
+
|
|
68
67
|
/** 是否隐藏当前列 */
|
|
69
68
|
hide?: boolean;
|
|
70
69
|
/** 时间是否跨行展示 */
|