htui-yllkbz 1.5.13 → 1.5.16
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 +86 -76
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +86 -76
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +5 -5
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +1 -1
- package/src/App.vue +148 -151
- package/src/packages/HtBaseData/index.vue +236 -279
- package/src/packages/HtOffice/cryto.js +5989 -0
- package/src/packages/HtOffice/index.ts +16 -0
- package/src/packages/HtOffice/index.vue +491 -0
- package/src/packages/HtSelectUser/index.vue +29 -25
- package/src/packages/index.ts +2 -1
- package/src/shims-js.d.ts +12 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:导出公共组件Excel
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-15 15:00:57
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2021-12-19 13:38:48
|
|
8
|
+
*/
|
|
9
|
+
// import HtOffice from "./index.vue";
|
|
10
|
+
|
|
11
|
+
// (HtOffice as any).install = function (Vue: any) {
|
|
12
|
+
|
|
13
|
+
// Vue.component("HtOffice", HtOffice);
|
|
14
|
+
// };
|
|
15
|
+
|
|
16
|
+
// export default HtOffice;
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion: 附件預覽
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-09-02 09:03:43
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2024-05-16 13:47:01
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<div v-loading="state.loading"
|
|
11
|
+
style="min-height: 500px;">
|
|
12
|
+
|
|
13
|
+
<div v-if="state.fileToken">
|
|
14
|
+
<iframe v-if="getSuffix.group"
|
|
15
|
+
:src="
|
|
16
|
+
`/onlyOffice/index.html?group=${getSuffix.group}&type=${getSuffix.type}&id=${id}&fileToken=${state.fileToken}&tenant=${tenant}&fileName=${fileName}`
|
|
17
|
+
"
|
|
18
|
+
frameborder="0"
|
|
19
|
+
width="100%"
|
|
20
|
+
style="height: calc(100vh - 120px)"></iframe>
|
|
21
|
+
<!-- <div v-else-if="suffix === 'json'">
|
|
22
|
+
<JsonViewer v-if="state.fileInfo"
|
|
23
|
+
:value="state.fileInfo"
|
|
24
|
+
:expand-depth="3" />
|
|
25
|
+
</div> -->
|
|
26
|
+
<div v-else-if="suffix === 'mp4'">
|
|
27
|
+
<video controls
|
|
28
|
+
autoplay
|
|
29
|
+
controlslist="nodownload noremoteplayback"
|
|
30
|
+
style="margin:0 auto;display:block;max-width:1000px"
|
|
31
|
+
id="previewVideo"></video>
|
|
32
|
+
</div>
|
|
33
|
+
<div v-else>
|
|
34
|
+
<img style="margin:0 auto;display:block;max-width:1000px"
|
|
35
|
+
:src="
|
|
36
|
+
`/file-management-service/api/filing/file/download/${state.fileToken}?token=${state.fileToken}`
|
|
37
|
+
" />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import { baseConfig, _axios } from "vue-kst-auth";
|
|
44
|
+
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
45
|
+
import { AxiosRequestConfig, Method } from "axios";
|
|
46
|
+
//import CryptoJS from "./crypto";
|
|
47
|
+
/** 设置axios返回类型 */
|
|
48
|
+
Vue.config.productionTip = false;
|
|
49
|
+
interface State {
|
|
50
|
+
/** 数据状态 */
|
|
51
|
+
loading: boolean;
|
|
52
|
+
canExport?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** 文件格式 */
|
|
55
|
+
interface InSuffix {
|
|
56
|
+
group?: "word" | "cell" | "slide";
|
|
57
|
+
type?: string;
|
|
58
|
+
}
|
|
59
|
+
interface State {
|
|
60
|
+
/** 数据状态 */
|
|
61
|
+
loading: boolean;
|
|
62
|
+
/** 文件可预览格式 */
|
|
63
|
+
fileSuffix: {
|
|
64
|
+
[key: string]: InSuffix;
|
|
65
|
+
};
|
|
66
|
+
/** 文件预览配置 */
|
|
67
|
+
fileConfig: any;
|
|
68
|
+
/** 文件预览token */
|
|
69
|
+
fileToken: string;
|
|
70
|
+
/** onlyoffice文件预览token */
|
|
71
|
+
fileViewToken: string;
|
|
72
|
+
fileInfo: any;
|
|
73
|
+
}
|
|
74
|
+
@Component({
|
|
75
|
+
name: "HtOffice",
|
|
76
|
+
})
|
|
77
|
+
export default class Index extends Vue {
|
|
78
|
+
@Prop() suffix!: string;
|
|
79
|
+
@Prop() id!: string;
|
|
80
|
+
@Prop() fileName!: string;
|
|
81
|
+
/** 下载权限 */
|
|
82
|
+
@Prop() download?: boolean;
|
|
83
|
+
/** 文件管理api */
|
|
84
|
+
/** 数据 */
|
|
85
|
+
state: State = {
|
|
86
|
+
loading: false,
|
|
87
|
+
fileSuffix: {
|
|
88
|
+
djvu: {
|
|
89
|
+
group: "word",
|
|
90
|
+
type: "djvu",
|
|
91
|
+
},
|
|
92
|
+
doc: {
|
|
93
|
+
group: "word",
|
|
94
|
+
type: "doc",
|
|
95
|
+
},
|
|
96
|
+
docm: {
|
|
97
|
+
group: "word",
|
|
98
|
+
type: "docm",
|
|
99
|
+
},
|
|
100
|
+
docx: {
|
|
101
|
+
group: "word",
|
|
102
|
+
type: "docx",
|
|
103
|
+
},
|
|
104
|
+
docxf: {
|
|
105
|
+
group: "word",
|
|
106
|
+
type: "docxf",
|
|
107
|
+
},
|
|
108
|
+
dot: {
|
|
109
|
+
group: "word",
|
|
110
|
+
type: "dot",
|
|
111
|
+
},
|
|
112
|
+
dotm: {
|
|
113
|
+
group: "word",
|
|
114
|
+
type: "dotm",
|
|
115
|
+
},
|
|
116
|
+
dotx: {
|
|
117
|
+
group: "word",
|
|
118
|
+
type: "dotx",
|
|
119
|
+
},
|
|
120
|
+
epub: {
|
|
121
|
+
group: "word",
|
|
122
|
+
type: "epub",
|
|
123
|
+
},
|
|
124
|
+
fb2: {
|
|
125
|
+
group: "word",
|
|
126
|
+
type: "fb2",
|
|
127
|
+
},
|
|
128
|
+
fodt: {
|
|
129
|
+
group: "word",
|
|
130
|
+
type: "fodt",
|
|
131
|
+
},
|
|
132
|
+
htm: {
|
|
133
|
+
group: "word",
|
|
134
|
+
type: "htm",
|
|
135
|
+
},
|
|
136
|
+
html: {
|
|
137
|
+
group: "word",
|
|
138
|
+
type: "html",
|
|
139
|
+
},
|
|
140
|
+
mht: {
|
|
141
|
+
group: "word",
|
|
142
|
+
type: "mht",
|
|
143
|
+
},
|
|
144
|
+
mhtml: {
|
|
145
|
+
group: "word",
|
|
146
|
+
type: "mhtml",
|
|
147
|
+
},
|
|
148
|
+
odt: {
|
|
149
|
+
group: "word",
|
|
150
|
+
type: "odt",
|
|
151
|
+
},
|
|
152
|
+
oform: {
|
|
153
|
+
group: "word",
|
|
154
|
+
type: "oform",
|
|
155
|
+
},
|
|
156
|
+
ott: {
|
|
157
|
+
group: "word",
|
|
158
|
+
type: "ott",
|
|
159
|
+
},
|
|
160
|
+
oxps: {
|
|
161
|
+
group: "word",
|
|
162
|
+
type: "oxps",
|
|
163
|
+
},
|
|
164
|
+
pdf: {
|
|
165
|
+
group: "word",
|
|
166
|
+
type: "pdf",
|
|
167
|
+
},
|
|
168
|
+
rtf: {
|
|
169
|
+
group: "word",
|
|
170
|
+
type: "rtf",
|
|
171
|
+
},
|
|
172
|
+
stw: {
|
|
173
|
+
group: "word",
|
|
174
|
+
type: "stw",
|
|
175
|
+
},
|
|
176
|
+
sxw: {
|
|
177
|
+
group: "word",
|
|
178
|
+
type: "sxw",
|
|
179
|
+
},
|
|
180
|
+
txt: {
|
|
181
|
+
group: "word",
|
|
182
|
+
type: "txt",
|
|
183
|
+
},
|
|
184
|
+
wps: {
|
|
185
|
+
group: "word",
|
|
186
|
+
type: "wps",
|
|
187
|
+
},
|
|
188
|
+
wpt: {
|
|
189
|
+
group: "word",
|
|
190
|
+
type: "wpt",
|
|
191
|
+
},
|
|
192
|
+
xml: {
|
|
193
|
+
group: "word",
|
|
194
|
+
type: "xml",
|
|
195
|
+
},
|
|
196
|
+
xps: {
|
|
197
|
+
group: "word",
|
|
198
|
+
type: "xps",
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
csv: {
|
|
202
|
+
group: "cell",
|
|
203
|
+
type: "csv",
|
|
204
|
+
},
|
|
205
|
+
et: {
|
|
206
|
+
group: "cell",
|
|
207
|
+
type: "et",
|
|
208
|
+
},
|
|
209
|
+
ett: {
|
|
210
|
+
group: "cell",
|
|
211
|
+
type: "ett",
|
|
212
|
+
},
|
|
213
|
+
fods: {
|
|
214
|
+
group: "cell",
|
|
215
|
+
type: "fods",
|
|
216
|
+
},
|
|
217
|
+
ods: {
|
|
218
|
+
group: "cell",
|
|
219
|
+
type: "ods",
|
|
220
|
+
},
|
|
221
|
+
ots: {
|
|
222
|
+
group: "cell",
|
|
223
|
+
type: "ots",
|
|
224
|
+
},
|
|
225
|
+
sxc: {
|
|
226
|
+
group: "cell",
|
|
227
|
+
type: "sxc",
|
|
228
|
+
},
|
|
229
|
+
xls: {
|
|
230
|
+
group: "cell",
|
|
231
|
+
type: "xls",
|
|
232
|
+
},
|
|
233
|
+
xlsb: {
|
|
234
|
+
group: "cell",
|
|
235
|
+
type: "xlsb",
|
|
236
|
+
},
|
|
237
|
+
xlsm: {
|
|
238
|
+
group: "cell",
|
|
239
|
+
type: "xlsm",
|
|
240
|
+
},
|
|
241
|
+
xlsx: {
|
|
242
|
+
group: "cell",
|
|
243
|
+
type: "xlsx",
|
|
244
|
+
},
|
|
245
|
+
xlt: {
|
|
246
|
+
group: "cell",
|
|
247
|
+
type: "xlt",
|
|
248
|
+
},
|
|
249
|
+
xltm: {
|
|
250
|
+
group: "cell",
|
|
251
|
+
type: "xltm",
|
|
252
|
+
},
|
|
253
|
+
xltx: {
|
|
254
|
+
group: "cell",
|
|
255
|
+
type: "xltx",
|
|
256
|
+
},
|
|
257
|
+
// xml: {
|
|
258
|
+
// group: "cell",
|
|
259
|
+
// type: "xml",
|
|
260
|
+
// },
|
|
261
|
+
|
|
262
|
+
dps: {
|
|
263
|
+
group: "slide",
|
|
264
|
+
type: "dps",
|
|
265
|
+
},
|
|
266
|
+
dpt: {
|
|
267
|
+
group: "slide",
|
|
268
|
+
type: "dpt",
|
|
269
|
+
},
|
|
270
|
+
fodp: {
|
|
271
|
+
group: "slide",
|
|
272
|
+
type: "fodp",
|
|
273
|
+
},
|
|
274
|
+
odp: {
|
|
275
|
+
group: "slide",
|
|
276
|
+
type: "odp",
|
|
277
|
+
},
|
|
278
|
+
otp: {
|
|
279
|
+
group: "slide",
|
|
280
|
+
type: "otp",
|
|
281
|
+
},
|
|
282
|
+
pot: {
|
|
283
|
+
group: "slide",
|
|
284
|
+
type: "pot",
|
|
285
|
+
},
|
|
286
|
+
potm: {
|
|
287
|
+
group: "slide",
|
|
288
|
+
type: "potm",
|
|
289
|
+
},
|
|
290
|
+
potx: {
|
|
291
|
+
group: "slide",
|
|
292
|
+
type: "potx",
|
|
293
|
+
},
|
|
294
|
+
pps: {
|
|
295
|
+
group: "slide",
|
|
296
|
+
type: "pps",
|
|
297
|
+
},
|
|
298
|
+
ppsm: {
|
|
299
|
+
group: "slide",
|
|
300
|
+
type: "ppsm",
|
|
301
|
+
},
|
|
302
|
+
ppsx: {
|
|
303
|
+
group: "slide",
|
|
304
|
+
type: "ppsx",
|
|
305
|
+
},
|
|
306
|
+
ppt: {
|
|
307
|
+
group: "slide",
|
|
308
|
+
type: "ppt",
|
|
309
|
+
},
|
|
310
|
+
pptm: {
|
|
311
|
+
group: "slide",
|
|
312
|
+
type: "pptm",
|
|
313
|
+
},
|
|
314
|
+
pptx: {
|
|
315
|
+
group: "slide",
|
|
316
|
+
type: "pptx",
|
|
317
|
+
},
|
|
318
|
+
sxi: {
|
|
319
|
+
group: "slide",
|
|
320
|
+
type: "sxi",
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
fileConfig: {},
|
|
324
|
+
fileToken: "",
|
|
325
|
+
fileViewToken: "",
|
|
326
|
+
fileInfo: {},
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
mounted() {
|
|
330
|
+
//
|
|
331
|
+
}
|
|
332
|
+
/** 方法 */
|
|
333
|
+
/** 获取json数据 */
|
|
334
|
+
jsonCnt() {
|
|
335
|
+
_axios
|
|
336
|
+
.get(
|
|
337
|
+
`/file-management-service/api/filing/file/download/${this.state.fileToken}`
|
|
338
|
+
)
|
|
339
|
+
.then((res) => {
|
|
340
|
+
this.state.fileInfo = res.data;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
/** 视频获取流数据 */
|
|
344
|
+
getVideoBolb() {
|
|
345
|
+
this.state.loading = true;
|
|
346
|
+
const config: any = {
|
|
347
|
+
headers: {
|
|
348
|
+
_tenant: baseConfig.getCookie("__tenant"),
|
|
349
|
+
Authorization: "Bearer " + baseConfig.getCookie("Abp.AuthToken"),
|
|
350
|
+
},
|
|
351
|
+
responseType: "blob",
|
|
352
|
+
};
|
|
353
|
+
_axios
|
|
354
|
+
.get(
|
|
355
|
+
`/file-management-service/api/filing/file/download/${this.state.fileToken}`,
|
|
356
|
+
config
|
|
357
|
+
)
|
|
358
|
+
.then((res2) => {
|
|
359
|
+
const blob = new Blob([res2.data as any]);
|
|
360
|
+
const downloadHref = window.URL.createObjectURL(blob);
|
|
361
|
+
/** 创建a标签并为其添加属性 */
|
|
362
|
+
const dom = document.getElementById("previewVideo");
|
|
363
|
+
if (dom) (dom as any).src = downloadHref;
|
|
364
|
+
})
|
|
365
|
+
.finally(() => {
|
|
366
|
+
this.state.loading = false;
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/** 设置onlyoffice token */
|
|
370
|
+
setOnlyOfficeToken(id?: string) {
|
|
371
|
+
// 配置文档: https://api.onlyoffice.com/editors/config/
|
|
372
|
+
const host = window.location.origin.includes("localhost")
|
|
373
|
+
? "http://uxinyun.com"
|
|
374
|
+
: window.location.origin;
|
|
375
|
+
this.state.fileConfig = {
|
|
376
|
+
document: {
|
|
377
|
+
permissions: {
|
|
378
|
+
// 启用评论
|
|
379
|
+
comment: false,
|
|
380
|
+
// 启用下载
|
|
381
|
+
download: this.download ?? false,
|
|
382
|
+
// 启用编辑
|
|
383
|
+
edit: false,
|
|
384
|
+
// 启用导出
|
|
385
|
+
print: this.download ?? false,
|
|
386
|
+
// 启用预览
|
|
387
|
+
review: true,
|
|
388
|
+
},
|
|
389
|
+
fileType: this.getSuffix.type, //"pptx", // docx ,
|
|
390
|
+
key: this.id + Math.random(), // 不要忘记每次编辑和保存文档时,都必须重新生成document.key
|
|
391
|
+
title: this.fileName, //"test.pptx",
|
|
392
|
+
// "url": "http://192.168.3.241:21030/api/filing/file/download/0485029d32b198fdc87c3a0bd55fc5b4?__tenant=cbe81ce3-fdf5-ae08-7421-3a0955bd3378",// "http://192.168.3.22:5007/api/files/download/test.pptx"
|
|
393
|
+
// "url": `http://192.168.3.241:44316/api/file-management/file/${urlParams.id}/preview`// "http://192.168.3.22:5007/api/files/download/test.pptx"
|
|
394
|
+
url: `${host}/file-management-service/api/filing/file/download/${id}?token=${id}&__tenant=${this.tenant}`, // "http://192.168.3.22:5007/api/files/download/test.pptx"
|
|
395
|
+
},
|
|
396
|
+
documentType: this.getSuffix.group, //"slide", //cell 如:excel, word 如:docx, slide 如:ppt
|
|
397
|
+
editorConfig: {
|
|
398
|
+
lang: "zh-CN",
|
|
399
|
+
mode: "view",
|
|
400
|
+
// "callbackUrl": "http://192.168.3.237:55002/url-to-callback.ashx"
|
|
401
|
+
},
|
|
402
|
+
token: "",
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
// this.state.fileViewToken = this.generateToken(
|
|
406
|
+
// "dNq6Zd0wOdc2Ha",
|
|
407
|
+
// this.state.fileConfig
|
|
408
|
+
// );
|
|
409
|
+
this.state.fileConfig.token = this.state.fileViewToken;
|
|
410
|
+
window.localStorage.setItem("fileViewToken", this.state.fileViewToken);
|
|
411
|
+
window.localStorage.setItem(
|
|
412
|
+
"onlyofficeConfig",
|
|
413
|
+
JSON.stringify(this.state.fileConfig)
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
/** base64 */
|
|
417
|
+
// base64UrlEncode(str: string) {
|
|
418
|
+
// let encodedSource = (CryptoJS as any).enc.Base64.stringify(str);
|
|
419
|
+
// const reg = new RegExp("/", "g");
|
|
420
|
+
// encodedSource = encodedSource
|
|
421
|
+
// .replace(/=+$/, "")
|
|
422
|
+
// .replace(/\+/g, "-")
|
|
423
|
+
// .replace(reg, "_");
|
|
424
|
+
// return encodedSource;
|
|
425
|
+
// }
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* clains body 将config放进去
|
|
429
|
+
* secretSalt 秘钥
|
|
430
|
+
*/
|
|
431
|
+
generateToken(secretSalt: string, clains: any) {
|
|
432
|
+
const header = JSON.stringify({
|
|
433
|
+
alg: "HS256",
|
|
434
|
+
typ: "JWT",
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
const iat = new Date().getTime();
|
|
438
|
+
const exp = iat + 2 * 60 * 60 * 1000;
|
|
439
|
+
const payload = JSON.stringify({
|
|
440
|
+
iat: iat,
|
|
441
|
+
exp: exp, // 过期时间
|
|
442
|
+
...clains, // 内容
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
446
|
+
// const before_sign =
|
|
447
|
+
// this.base64UrlEncode((CryptoJS as any).enc.Utf8.parse(header)) +
|
|
448
|
+
// "." +
|
|
449
|
+
// this.base64UrlEncode((CryptoJS as any).enc.Utf8.parse(payload));
|
|
450
|
+
// let signature = (CryptoJS as any).HmacSHA256(before_sign, secretSalt);
|
|
451
|
+
// signature = this.base64UrlEncode(signature);
|
|
452
|
+
// // eslint-disable-next-line @typescript-eslint/camelcase
|
|
453
|
+
// const final_sign = before_sign + "." + signature;
|
|
454
|
+
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/camelcase
|
|
456
|
+
//return final_sign;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** 监听 */
|
|
460
|
+
/** 计算属性 */
|
|
461
|
+
/** 匹配在线预览文件格式 */
|
|
462
|
+
get getSuffix(): InSuffix {
|
|
463
|
+
return this.state.fileSuffix[this.suffix as string] ?? {};
|
|
464
|
+
}
|
|
465
|
+
/** 获取租户id */
|
|
466
|
+
get tenant(): string {
|
|
467
|
+
return baseConfig.getCookie("__tenant");
|
|
468
|
+
}
|
|
469
|
+
@Watch("id", { immediate: true })
|
|
470
|
+
setFileToken(id?: string) {
|
|
471
|
+
this.state.fileConfig = {};
|
|
472
|
+
this.state.fileToken = id as string;
|
|
473
|
+
if (id) {
|
|
474
|
+
if (this.getSuffix.group) {
|
|
475
|
+
this.setOnlyOfficeToken(id);
|
|
476
|
+
this.state.loading = false;
|
|
477
|
+
} else {
|
|
478
|
+
if (this.suffix === "json") {
|
|
479
|
+
this.jsonCnt();
|
|
480
|
+
} else if (this.suffix === "mp4") {
|
|
481
|
+
this.getVideoBolb();
|
|
482
|
+
} else {
|
|
483
|
+
this.state.loading = false;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
</script>
|
|
490
|
+
|
|
491
|
+
<style lang="scss" scoped></style>
|
|
@@ -4,42 +4,43 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2024-05-13 14:00:36
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
11
|
-
<HtShowBaseData v-if="value"
|
|
11
|
+
<HtShowBaseData v-if="value"
|
|
12
|
+
:user-id="userId"
|
|
13
|
+
:org="org"></HtShowBaseData>
|
|
12
14
|
<span v-else> </span>
|
|
13
15
|
</span>
|
|
14
|
-
<HtBaseData
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
<HtBaseData v-else
|
|
17
|
+
:size="size"
|
|
18
|
+
:org="org"
|
|
19
|
+
ref="htBaseData"
|
|
20
|
+
:placeholder="placeholder"
|
|
21
|
+
:disabled="disabled"
|
|
22
|
+
com-style="background:#fff"
|
|
23
|
+
:showLocked="showLocked"
|
|
24
|
+
:appendToBody="appendToBody"
|
|
25
|
+
:config-json="configJson"
|
|
26
|
+
:com-class="
|
|
25
27
|
heightAuto
|
|
26
28
|
? 'component-item-heightAuto ht-item-common'
|
|
27
29
|
: 'component-item-height ht-item-common'
|
|
28
30
|
"
|
|
29
|
-
|
|
30
|
-
></HtBaseData>
|
|
31
|
+
@change="searchCommonData"></HtBaseData>
|
|
31
32
|
</template>
|
|
32
33
|
<script lang="ts">
|
|
33
|
-
import { Component, Prop, Vue } from
|
|
34
|
-
import HtShowBaseData from
|
|
35
|
-
import HtBaseData from
|
|
36
|
-
import { getCommDataItem } from
|
|
34
|
+
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
35
|
+
import HtShowBaseData from "@/packages/HtShowBaseData";
|
|
36
|
+
import HtBaseData from "@/packages/HtBaseData";
|
|
37
|
+
import { getCommDataItem } from "../common";
|
|
37
38
|
interface State {
|
|
38
39
|
/** 数据状态 */
|
|
39
40
|
loading: boolean;
|
|
40
41
|
}
|
|
41
42
|
@Component({
|
|
42
|
-
name:
|
|
43
|
+
name: "HtSelectUser",
|
|
43
44
|
components: {
|
|
44
45
|
HtShowBaseData,
|
|
45
46
|
HtBaseData,
|
|
@@ -53,12 +54,15 @@ export default class HtSelectUser extends Vue {
|
|
|
53
54
|
@Prop() disabled?: boolean;
|
|
54
55
|
@Prop() heightAuto?: boolean;
|
|
55
56
|
@Prop() placeholder?: string;
|
|
57
|
+
|
|
56
58
|
/** 是否可以清除 */
|
|
57
59
|
@Prop() clearable?: boolean;
|
|
58
60
|
@Prop({ default: true }) show?: boolean;
|
|
59
61
|
@Prop({ default: false }) multiple?: boolean;
|
|
60
62
|
@Prop({ default: true }) showAllLevels?: boolean;
|
|
61
63
|
@Prop({ default: true }) checkStrictly?: boolean;
|
|
64
|
+
/** 是否显示被锁定的用户 */
|
|
65
|
+
@Prop({ default: true }) showLocked?: boolean;
|
|
62
66
|
/* 是否只读 */
|
|
63
67
|
@Prop({ default: false }) readonly?: boolean;
|
|
64
68
|
@Prop({ default: false }) panel?: boolean;
|
|
@@ -72,7 +76,7 @@ export default class HtSelectUser extends Vue {
|
|
|
72
76
|
/** 方法 */
|
|
73
77
|
/**部门选择回调 */
|
|
74
78
|
searchCommonData(res: any) {
|
|
75
|
-
const dep = res[
|
|
79
|
+
const dep = res["departmentUser"];
|
|
76
80
|
|
|
77
81
|
let data = undefined;
|
|
78
82
|
if (dep.length) {
|
|
@@ -86,19 +90,19 @@ export default class HtSelectUser extends Vue {
|
|
|
86
90
|
data = dep[0].id;
|
|
87
91
|
}
|
|
88
92
|
}
|
|
89
|
-
this.$emit(
|
|
90
|
-
this.$emit(
|
|
93
|
+
this.$emit("input", data);
|
|
94
|
+
this.$emit("change", data, getCommDataItem("user", data));
|
|
91
95
|
}
|
|
92
96
|
/** 监听 */
|
|
93
97
|
get configJson() {
|
|
94
98
|
return JSON.stringify({
|
|
95
99
|
departmentUser: {
|
|
96
|
-
name:
|
|
100
|
+
name: "部门树结构",
|
|
97
101
|
show: this.show,
|
|
98
102
|
disabled: this.disabled,
|
|
99
103
|
showAllLevels: this.showAllLevels,
|
|
100
104
|
multiple: this.multiple,
|
|
101
|
-
code:
|
|
105
|
+
code: "departmentUser",
|
|
102
106
|
data: {},
|
|
103
107
|
checkStrictly: false,
|
|
104
108
|
panel: this.panel,
|
package/src/packages/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-10-21 10:08:41
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2024-05-16 13:45:14
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// 导入组件
|
|
@@ -42,6 +42,7 @@ import HtPopover from './HtPopover'
|
|
|
42
42
|
import HtTimeLine from './HtTimeLine'
|
|
43
43
|
import HtTimeLineItem from './HtTimeLineItem'
|
|
44
44
|
import HtRealTime from './HtRealTime'
|
|
45
|
+
// import HtOffice from './HtOffice'
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|