htui-yllkbz 2.0.14 → 2.0.15
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 +393 -263
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +393 -263
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +22 -22
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +2 -2
- package/src/packages/HtBaseData/index.vue +2 -2
- package/src/packages/HtMore/index.vue +1 -1
- package/src/packages/HtPopover/index.vue +1 -1
- package/src/packages/HtSelectBaseData/index.vue +2 -2
- package/src/packages/HtSelectBaseDataTable/index.vue +0 -0
- package/src/packages/HtSelectOrg/index.vue +2 -2
- package/src/packages/HtSelectUser/index.vue +2 -2
- package/src/packages/HtTable/htTableColumn.vue +156 -56
- package/src/packages/HtTable/index.vue +171 -112
- package/src/packages/common.ts +16 -8
- package/src/views/About.vue +10 -12
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -409,13 +409,13 @@ import {
|
|
|
409
409
|
DictionaryCategoryDto,
|
|
410
410
|
DictionaryDataDto,
|
|
411
411
|
SeverityLevelDto,
|
|
412
|
-
} from "
|
|
412
|
+
} from "../../plugins/commonApi";
|
|
413
413
|
/* eslint-disable @typescript-eslint/camelcase */
|
|
414
414
|
import {
|
|
415
415
|
ListResultDto_1OfOfOrganizationUnitWithUsersAndContractsAnd_0AndCulture_neutralAndPublicKeyToken_null,
|
|
416
416
|
OrganizationUnitWithDetailsDto,
|
|
417
417
|
OrganizationUnitDto,
|
|
418
|
-
} from "
|
|
418
|
+
} from "../../plugins/Auth";
|
|
419
419
|
import { _axios, baseConfig } from "vue-kst-auth";
|
|
420
420
|
interface Inuser {
|
|
421
421
|
concurrencyStamp: string;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
<script lang="ts">
|
|
40
40
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
41
|
-
import HtPopover from '
|
|
41
|
+
import HtPopover from '../HtPopover/index.vue';
|
|
42
42
|
interface State {
|
|
43
43
|
/** 数据状态 */
|
|
44
44
|
loading: boolean;
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
<script lang="ts">
|
|
60
60
|
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
61
|
-
import HtShowBaseData from "
|
|
62
|
-
import HtBaseData from "
|
|
61
|
+
import HtShowBaseData from "../HtShowBaseData";
|
|
62
|
+
import HtBaseData from "../HtBaseData";
|
|
63
63
|
interface State {
|
|
64
64
|
/** 数据状态 */
|
|
65
65
|
loading: boolean;
|
|
File without changes
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
<script lang="ts">
|
|
37
37
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
|
38
|
-
import HtShowBaseData from '
|
|
39
|
-
import HtBaseData from '
|
|
38
|
+
import HtShowBaseData from '../HtShowBaseData';
|
|
39
|
+
import HtBaseData from '../HtBaseData';
|
|
40
40
|
import { getCommDataItem } from '../common';
|
|
41
41
|
interface State {
|
|
42
42
|
/** 数据状态 */
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
23
|
-
import HtShowBaseData from "
|
|
24
|
-
import HtBaseData from "
|
|
23
|
+
import HtShowBaseData from "../HtShowBaseData";
|
|
24
|
+
import HtBaseData from "../HtBaseData";
|
|
25
25
|
import { getCommDataItem } from "../common";
|
|
26
26
|
interface State {
|
|
27
27
|
/** 数据状态 */
|
|
@@ -1,38 +1,65 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-table-column :label="item.title"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<el-table-column :label="item.title"
|
|
3
|
+
:fixed="item.fixed"
|
|
4
|
+
:align="item.align"
|
|
5
|
+
v-if="fromColumn ? !item.hide : !item.hide && item.checked"
|
|
6
|
+
:resizable="item.resizable === false ? false : true"
|
|
7
|
+
:header-align="item.headerAlign"
|
|
8
|
+
:column-key="item.columnKey"
|
|
9
|
+
:class-name="item.className"
|
|
10
|
+
:prop="item.key"
|
|
11
|
+
:show-overflow-tooltip="item.type === 'common' || item.type === 'org' || item.type === 'userId'
|
|
6
12
|
? false
|
|
7
13
|
: item.showOverflowTooltip === false
|
|
8
14
|
? false
|
|
9
15
|
: true
|
|
10
|
-
"
|
|
11
|
-
|
|
16
|
+
"
|
|
17
|
+
:sortable="item.sortable"
|
|
18
|
+
:sort-method="item.sortMethod"
|
|
19
|
+
:sort-orders="item.sortOrders"
|
|
20
|
+
:formatter="item.formatter"
|
|
21
|
+
:sort-by="item.sortBy"
|
|
22
|
+
:min-width="item.minWidth"
|
|
23
|
+
:width="item.width">
|
|
12
24
|
|
|
13
25
|
<template v-if="item.children && item.children.length">
|
|
14
|
-
<HtTableColumn :item="child"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
<HtTableColumn :item="child"
|
|
27
|
+
:getAllBaseData="getAllBaseData"
|
|
28
|
+
:getAllOrg="getAllOrg"
|
|
29
|
+
:getAllRole="getAllRole"
|
|
30
|
+
:getAllUser="getAllUser"
|
|
31
|
+
v-for="(child, childindex) in item.children"
|
|
32
|
+
@showFiles="emitShowFiles"
|
|
33
|
+
:fromColumn="true"
|
|
34
|
+
:key="`${child.key}_${childindex}_1`">
|
|
35
|
+
<template :slot="child.key"
|
|
36
|
+
slot-scope="scope">
|
|
37
|
+
<slot :name="child.key"
|
|
38
|
+
:row="scope.row"
|
|
39
|
+
:column="scope.column"
|
|
40
|
+
:rowIndex="scope.rowIndex">
|
|
19
41
|
</slot>
|
|
20
42
|
</template>
|
|
21
43
|
<!-- <template slot="title" slot-scope="{ data }">
|
|
22
44
|
<slot name="title" :data="data"></slot
|
|
23
45
|
></template> -->
|
|
24
|
-
<template slot-scope="scope"
|
|
25
|
-
|
|
46
|
+
<template slot-scope="scope"
|
|
47
|
+
:slot="'header_' + child.key">
|
|
48
|
+
<slot :name="'header_' + child.key"
|
|
49
|
+
:column="scope.column"
|
|
50
|
+
:$index="scope.$index"></slot>
|
|
26
51
|
</template>
|
|
27
52
|
</HtTableColumn>
|
|
28
53
|
</template>
|
|
29
54
|
<template slot-scope="{ row, column, $index }">
|
|
30
55
|
|
|
31
|
-
<slot :name="item.key"
|
|
56
|
+
<slot :name="item.key"
|
|
57
|
+
:row="row"
|
|
58
|
+
:column="column"
|
|
59
|
+
:rowIndex="$index">
|
|
32
60
|
<!-- 处理部门 -->
|
|
33
61
|
<template v-if="item.type === 'org'">
|
|
34
|
-
<el-tag v-if="getPropByPath(row, item.key)">
|
|
35
|
-
}}</el-tag>
|
|
62
|
+
<el-tag v-if="getPropByPath(row, item.key)">{{ getOrgDisplayName(getPropByPath(row, item.key)) }}</el-tag>
|
|
36
63
|
<!-- <HtOrgInfo v-if="getPropByPath(row, item.key)"
|
|
37
64
|
:org-id="getPropByPath(row, item.key)"
|
|
38
65
|
type="tag"></HtOrgInfo> -->
|
|
@@ -43,22 +70,24 @@
|
|
|
43
70
|
<span v-if="item.commonType === 'userId' && getPropByPath(row, item.key)">
|
|
44
71
|
{{ getAllUser[getPropByPath(row, item.key)]?.value }}</span>
|
|
45
72
|
<span v-else-if="item.commonType === 'departmentId' && getPropByPath(row, item.key)">
|
|
46
|
-
{{
|
|
73
|
+
{{ getOrgDisplayName(getPropByPath(row, item.key)) }}</span>
|
|
47
74
|
<span v-else-if="item.commonType === 'roleId' && getPropByPath(row, item.key)">
|
|
48
75
|
{{ getAllRole[getPropByPath(row, item.key)]?.name }}</span>
|
|
49
76
|
<span v-else-if="item.commonType === 'baseDataId' && getPropByPath(row, item.key)">
|
|
50
77
|
{{ getAllBaseData[getPropByPath(row, item.key)]?.name }}<span v-if="!item.hideCode">({{
|
|
51
78
|
getAllBaseData[getPropByPath(row, item.key)]?.value }})</span></span>
|
|
52
79
|
|
|
53
|
-
<HtShowBaseData
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
<HtShowBaseData v-else-if="getPropByPath(row, item.key) && (item.commonType === 'baseDataValue' || item.commonType === 'baseDataName')"
|
|
81
|
+
:hide-code="item.hideCode"
|
|
82
|
+
:base-data-value="item.commonType === 'baseDataValue'
|
|
56
83
|
? getPropByPath(row, item.key)
|
|
57
84
|
: ''
|
|
58
|
-
"
|
|
85
|
+
"
|
|
86
|
+
:base-data-name="item.commonType === 'baseDataName'
|
|
59
87
|
? getPropByPath(row, item.key)
|
|
60
88
|
: ''
|
|
61
|
-
"
|
|
89
|
+
"
|
|
90
|
+
:base-data-info="true">
|
|
62
91
|
</HtShowBaseData>
|
|
63
92
|
|
|
64
93
|
<span v-else>--</span>
|
|
@@ -71,7 +100,8 @@
|
|
|
71
100
|
</template>
|
|
72
101
|
<!-- 处理时间 yyyy-mm-dd HH:mm:ss -->
|
|
73
102
|
<template v-else-if="item.type === 'time'">
|
|
74
|
-
<div v-if="getPropByPath(row, item.key)"
|
|
103
|
+
<div v-if="getPropByPath(row, item.key)"
|
|
104
|
+
class="ht-column-cell">
|
|
75
105
|
<span v-if="!item.spread">
|
|
76
106
|
{{
|
|
77
107
|
getPropByPath(row, item.key)
|
|
@@ -95,7 +125,8 @@
|
|
|
95
125
|
</template>
|
|
96
126
|
<!-- 处理日期 yyyy-mm-dd -->
|
|
97
127
|
<template v-else-if="item.type === 'date'">
|
|
98
|
-
<div v-if="getPropByPath(row, item.key)"
|
|
128
|
+
<div v-if="getPropByPath(row, item.key)"
|
|
129
|
+
class="ht-column-cell">
|
|
99
130
|
<span>
|
|
100
131
|
{{
|
|
101
132
|
getPropByPath(row, item.key)
|
|
@@ -107,23 +138,31 @@
|
|
|
107
138
|
</template>
|
|
108
139
|
<!-- 处理布尔值显示 -->
|
|
109
140
|
<template v-else-if="item.type === 'boolean'">
|
|
110
|
-
<el-tag :type="'success'"
|
|
111
|
-
|
|
141
|
+
<el-tag :type="'success'"
|
|
142
|
+
:size="'small'"
|
|
143
|
+
v-if="getPropByPath(row, item.key)">是</el-tag>
|
|
144
|
+
<el-tag type="danger"
|
|
145
|
+
:size="'small'"
|
|
146
|
+
v-else>否</el-tag>
|
|
112
147
|
</template>
|
|
113
148
|
<!-- 处理新资产的单位 -->
|
|
114
149
|
<template v-else-if="item.type === 'unit'">
|
|
115
|
-
<HtSelectUnit :readonly="true"
|
|
150
|
+
<HtSelectUnit :readonly="true"
|
|
151
|
+
:value="getPropByPath(row, item.key)"></HtSelectUnit>
|
|
116
152
|
</template>
|
|
117
153
|
<!-- 处理新资产的单位 -->
|
|
118
154
|
<template v-else-if="item.type === 'position'">
|
|
119
|
-
<HtSelectPosition :readonly="true"
|
|
155
|
+
<HtSelectPosition :readonly="true"
|
|
156
|
+
:value="getPropByPath(row, item.key)"></HtSelectPosition>
|
|
120
157
|
</template>
|
|
121
158
|
<!-- 处理图片显示 -->
|
|
122
159
|
<template v-else-if="item.type === 'img'">
|
|
123
160
|
<span v-if="getPropByPath(row, item.key)">
|
|
124
|
-
<el-image style="width: 38px; height: 38px;margin-right:5px"
|
|
125
|
-
|
|
126
|
-
|
|
161
|
+
<el-image style="width: 38px; height: 38px;margin-right:5px"
|
|
162
|
+
:key="fileToken"
|
|
163
|
+
v-for="fileToken in getPropByPath(row, item.key).split(',')"
|
|
164
|
+
:src="`/${proxy}/api/filing/file/download/` + fileToken"
|
|
165
|
+
:preview-src-list="[
|
|
127
166
|
`/${proxy}/api/filing/file/download/` + fileToken,
|
|
128
167
|
]">
|
|
129
168
|
</el-image>
|
|
@@ -132,8 +171,9 @@
|
|
|
132
171
|
<!-- 处理附件显示 -->
|
|
133
172
|
<template v-else-if="item.type === 'file'">
|
|
134
173
|
<span v-if="getPropByPath(row, item.key)">
|
|
135
|
-
<i class="el-icon-paperclip"
|
|
136
|
-
|
|
174
|
+
<i class="el-icon-paperclip"
|
|
175
|
+
@click="$emit('showFiles', getPropByPath(row, item.key))"
|
|
176
|
+
style="color:var(--primary);cursor:pointer">{{
|
|
137
177
|
Array.isArray(getPropByPath(row, item.key))
|
|
138
178
|
? getPropByPath(row, item.key).length
|
|
139
179
|
: getPropByPath(row, item.key).split(',').length
|
|
@@ -142,14 +182,18 @@
|
|
|
142
182
|
<span v-else>--</span>
|
|
143
183
|
</template>
|
|
144
184
|
<!-- 其他 -->
|
|
145
|
-
<span :style="item.style"
|
|
185
|
+
<span :style="item.style"
|
|
186
|
+
v-else>{{
|
|
146
187
|
getPropByPath(row, item.key)
|
|
147
188
|
}}</span>
|
|
148
189
|
</slot>
|
|
149
190
|
</template>
|
|
150
191
|
<!-- 处理重定义table头相关信息 header_key -->
|
|
151
|
-
<template slot-scope="{ column, $index }"
|
|
152
|
-
|
|
192
|
+
<template slot-scope="{ column, $index }"
|
|
193
|
+
slot="header">
|
|
194
|
+
<slot :name="'header_' + item.key"
|
|
195
|
+
:column="column"
|
|
196
|
+
:$index="$index">{{
|
|
153
197
|
item.title
|
|
154
198
|
}}</slot>
|
|
155
199
|
</template>
|
|
@@ -158,10 +202,10 @@
|
|
|
158
202
|
<script lang="ts">
|
|
159
203
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
160
204
|
import { Column } from "../type";
|
|
161
|
-
import HtShowBaseData from "
|
|
162
|
-
import HtOrgInfo from "
|
|
163
|
-
import HtUploadFiles from "
|
|
164
|
-
import HtSelectUnit from "
|
|
205
|
+
import HtShowBaseData from "../HtShowBaseData";
|
|
206
|
+
import HtOrgInfo from "../HtOrgInfo";
|
|
207
|
+
import HtUploadFiles from "../HtUploadFiles/index.vue";
|
|
208
|
+
import HtSelectUnit from "../HtSelectUnit";
|
|
165
209
|
|
|
166
210
|
interface State {
|
|
167
211
|
/** 数据状态 */
|
|
@@ -179,6 +223,10 @@ interface State {
|
|
|
179
223
|
},
|
|
180
224
|
})
|
|
181
225
|
export default class Index extends Vue {
|
|
226
|
+
private pathKeyCache = new Map<string, string[]>();
|
|
227
|
+
|
|
228
|
+
private rowValueCache = new WeakMap<object, { [key: string]: any }>();
|
|
229
|
+
|
|
182
230
|
/** 单个Column信息 */
|
|
183
231
|
@Prop() item!: Column;
|
|
184
232
|
@Prop() getAllBaseData!: any;
|
|
@@ -192,22 +240,38 @@ export default class Index extends Vue {
|
|
|
192
240
|
state: State = {
|
|
193
241
|
loading: false,
|
|
194
242
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
243
|
+
beforeUpdate() {
|
|
244
|
+
this.rowValueCache = new WeakMap<object, { [key: string]: any }>();
|
|
245
|
+
}
|
|
246
|
+
getPathKeys(path: string) {
|
|
247
|
+
const cachePath = path || "";
|
|
248
|
+
const cacheKeys = this.pathKeyCache.get(cachePath);
|
|
249
|
+
if (cacheKeys) {
|
|
250
|
+
return cacheKeys;
|
|
251
|
+
}
|
|
252
|
+
const normalizedPath = cachePath
|
|
253
|
+
.replace(/\[(\w+)\]/g, ".$1")
|
|
254
|
+
.replace(/^\./, "");
|
|
255
|
+
const keys = normalizedPath ? normalizedPath.split(".") : [];
|
|
256
|
+
this.pathKeyCache.set(cachePath, keys);
|
|
257
|
+
return keys;
|
|
258
|
+
}
|
|
200
259
|
getPropByPath(obj: any, path: string, strict = true) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
260
|
+
if (!obj || typeof obj !== "object") {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
const cache = this.rowValueCache.get(obj);
|
|
264
|
+
if (cache && path in cache) {
|
|
265
|
+
return cache[path];
|
|
266
|
+
}
|
|
204
267
|
|
|
205
|
-
|
|
268
|
+
let tempObj = obj;
|
|
269
|
+
const keyArr = this.getPathKeys(path);
|
|
206
270
|
let i = 0;
|
|
207
271
|
for (let len = keyArr.length; i < len - 1; ++i) {
|
|
208
272
|
if (!tempObj && !strict) break;
|
|
209
273
|
const key = keyArr[i];
|
|
210
|
-
if (key in tempObj) {
|
|
274
|
+
if (tempObj && key in tempObj) {
|
|
211
275
|
tempObj = tempObj[key];
|
|
212
276
|
} else {
|
|
213
277
|
if (strict) {
|
|
@@ -216,12 +280,48 @@ export default class Index extends Vue {
|
|
|
216
280
|
break;
|
|
217
281
|
}
|
|
218
282
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return
|
|
283
|
+
const value = tempObj && keyArr.length ? tempObj[keyArr[i]] : null;
|
|
284
|
+
this.rowValueCache.set(obj, {
|
|
285
|
+
...(cache || {}),
|
|
286
|
+
[path]: value,
|
|
287
|
+
});
|
|
288
|
+
return value;
|
|
289
|
+
}
|
|
290
|
+
getOrgDisplayName(orgId: string) {
|
|
291
|
+
const orgMap = this.getAllOrg || {};
|
|
292
|
+
if (orgMap[orgId]?.displayName) {
|
|
293
|
+
return orgMap[orgId].displayName;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const commonDatas = window.localStorage.getItem("commonDatas");
|
|
297
|
+
if (!commonDatas) {
|
|
298
|
+
return "--";
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
const { organizationUnit = [] } = JSON.parse(commonDatas);
|
|
303
|
+
return this.findOrgName(orgId, organizationUnit);
|
|
304
|
+
} catch (_error) {
|
|
305
|
+
return "--";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
findOrgName(orgId: string, organizationUnit: any[] = []): string {
|
|
309
|
+
for (let i = 0; i < organizationUnit.length; i++) {
|
|
310
|
+
const item = organizationUnit[i];
|
|
311
|
+
if (item.id === orgId) {
|
|
312
|
+
return item.displayName || "--";
|
|
313
|
+
}
|
|
314
|
+
if (item.children?.length) {
|
|
315
|
+
const childName = this.findOrgName(orgId, item.children);
|
|
316
|
+
if (childName !== "--") {
|
|
317
|
+
return childName;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return "--";
|
|
322
|
+
}
|
|
323
|
+
emitShowFiles(val: string | string[]) {
|
|
324
|
+
this.$emit("showFiles", val);
|
|
225
325
|
}
|
|
226
326
|
/** 监听 */
|
|
227
327
|
/** 计算属性 */
|