htui-yllkbz 1.3.72 → 1.3.74
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 +61 -51
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +61 -51
- 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/packages/HtDrawer/index.vue +5 -2
- package/src/packages/HtUploadFiles/index.vue +65 -55
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -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-11-04 09:27:46
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<el-drawer
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
:destroy-on-close="destroyOnClose"
|
|
17
17
|
:modal-append-to-body="modalAppendToBody"
|
|
18
18
|
:modal="modal"
|
|
19
|
+
@close="close"
|
|
19
20
|
:size="size"
|
|
20
21
|
:show-close="showClose"
|
|
21
22
|
:withHeader="withHeader"
|
|
@@ -113,11 +114,13 @@ export default class Index extends Vue {
|
|
|
113
114
|
/** 方法 */
|
|
114
115
|
onCancel() {
|
|
115
116
|
this.state.visible = false;
|
|
116
|
-
this.$emit('onCancel', false);
|
|
117
117
|
}
|
|
118
118
|
onOk() {
|
|
119
119
|
this.$emit('onOk', true);
|
|
120
120
|
}
|
|
121
|
+
close() {
|
|
122
|
+
this.$emit('onCancel', false);
|
|
123
|
+
}
|
|
121
124
|
|
|
122
125
|
/** 监听 */
|
|
123
126
|
@Watch('value', { immediate: true })
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-02-11 14:26:23
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-11-07 14:32:25
|
|
8
8
|
-->
|
|
9
9
|
<!--
|
|
10
10
|
* @Descripttion: 附件列表 ------没有搞完
|
|
@@ -16,52 +16,57 @@
|
|
|
16
16
|
-->
|
|
17
17
|
<template>
|
|
18
18
|
<div>
|
|
19
|
-
<el-upload
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
<el-upload
|
|
20
|
+
class="ht-upload"
|
|
21
|
+
v-if="!disabled"
|
|
22
|
+
style="width:368px;height:108px"
|
|
23
|
+
:show-file-list="false"
|
|
24
|
+
:disabled="disabled"
|
|
25
|
+
:on-success="onSuccess"
|
|
26
|
+
:before-upload="beforeUpload"
|
|
27
|
+
drag
|
|
28
|
+
action="/files/api/filing/file/upload"
|
|
29
|
+
multiple
|
|
30
|
+
>
|
|
29
31
|
<!-- <i class="el-icon-upload"></i> -->
|
|
30
|
-
<div
|
|
31
|
-
|
|
32
|
+
<div
|
|
33
|
+
style="margin-top:8px;font-size:12px;color:#999"
|
|
34
|
+
class="el-upload__text"
|
|
35
|
+
>
|
|
36
|
+
拖动文件到此处,或<br /><em>点击上传</em>
|
|
37
|
+
</div>
|
|
32
38
|
<!-- <div class="el-upload__tip"
|
|
33
39
|
slot="tip">只能上传jpg/png文件,且不超过5M</div> -->
|
|
34
40
|
</el-upload>
|
|
35
41
|
<ul class="ht-ul-upload">
|
|
36
|
-
<li :key="item.fileToken"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
<li :key="item.fileToken" v-for="(item, index) in state.filesInfo">
|
|
43
|
+
<a @click="downLoadFile(item)"
|
|
44
|
+
><i class="le-icon el-icon-document" style="margin-right:7px"></i
|
|
45
|
+
>{{ item.fileName }}</a
|
|
46
|
+
>
|
|
40
47
|
<span>
|
|
41
|
-
|
|
42
|
-
<i
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<i
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
<i v-if="!disabled" class="el-icon el-icon-circle-check"></i>
|
|
49
|
+
<i
|
|
50
|
+
v-if="!disabled"
|
|
51
|
+
class="el-icon el-icon-close"
|
|
52
|
+
@click="delItem(item, index)"
|
|
53
|
+
title="删除"
|
|
54
|
+
></i>
|
|
55
|
+
<i
|
|
56
|
+
class="el-icon el-icon-download"
|
|
57
|
+
style="margin-right:24px"
|
|
58
|
+
@click="downLoadFile(item)"
|
|
59
|
+
title="下载"
|
|
60
|
+
></i>
|
|
52
61
|
</span>
|
|
53
|
-
|
|
54
62
|
</li>
|
|
55
63
|
</ul>
|
|
56
|
-
<a :href="state.fileSrc"
|
|
57
|
-
target="_blank"
|
|
58
|
-
v-show="false"
|
|
59
|
-
ref="download1"></a>
|
|
64
|
+
<a :href="state.fileSrc" target="_blank" v-show="false" ref="download1"></a>
|
|
60
65
|
</div>
|
|
61
66
|
</template>
|
|
62
|
-
<script lang=
|
|
63
|
-
import { _axios } from
|
|
64
|
-
import { Component, Prop, Vue, Watch } from
|
|
67
|
+
<script lang="ts">
|
|
68
|
+
import { _axios } from 'vue-kst-auth';
|
|
69
|
+
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
|
65
70
|
interface State {
|
|
66
71
|
/** 数据状态 */
|
|
67
72
|
loading: boolean;
|
|
@@ -86,10 +91,10 @@ interface CreateAttachmentDto {
|
|
|
86
91
|
sortNum?: number;
|
|
87
92
|
}
|
|
88
93
|
@Component({
|
|
89
|
-
name:
|
|
94
|
+
name: 'HtUploadFiles',
|
|
90
95
|
})
|
|
91
96
|
export default class HtUploadFiles extends Vue {
|
|
92
|
-
@Prop() value!: string;
|
|
97
|
+
@Prop() value!: string | string[];
|
|
93
98
|
/* 是否只读 */
|
|
94
99
|
@Prop({ default: false }) readonly?: boolean;
|
|
95
100
|
/** 是否禁用 */
|
|
@@ -101,14 +106,14 @@ export default class HtUploadFiles extends Vue {
|
|
|
101
106
|
/** 数据 */
|
|
102
107
|
state: State = {
|
|
103
108
|
loading: false,
|
|
104
|
-
fileSrc:
|
|
109
|
+
fileSrc: '',
|
|
105
110
|
fileToken: [],
|
|
106
111
|
filesInfo: [],
|
|
107
112
|
dialogVisible: false,
|
|
108
113
|
};
|
|
109
114
|
/** 生命周期 */
|
|
110
115
|
created() {
|
|
111
|
-
this.onValue(this.value);
|
|
116
|
+
//this.onValue(this.value);
|
|
112
117
|
}
|
|
113
118
|
/** 方法 */
|
|
114
119
|
/** 上传文件前验证 */
|
|
@@ -116,11 +121,11 @@ export default class HtUploadFiles extends Vue {
|
|
|
116
121
|
/** 附件上传之前的判断 */
|
|
117
122
|
beforeUpload(file: File) {
|
|
118
123
|
const isLt10MB = file.size / 1024 / 1024 < 5;
|
|
119
|
-
const arr = [
|
|
120
|
-
const lastArr = file.name.split(
|
|
124
|
+
const arr = ['jpg', 'png', 'xlsx', 'lsx', 'doc', 'pdf'];
|
|
125
|
+
const lastArr = file.name.split('.');
|
|
121
126
|
const type = lastArr[lastArr.length - 1];
|
|
122
127
|
if (!isLt10MB) {
|
|
123
|
-
this.$message.error(
|
|
128
|
+
this.$message.error('大小不能超过 5MB!');
|
|
124
129
|
}
|
|
125
130
|
if (arr.includes(type)) {
|
|
126
131
|
return true;
|
|
@@ -145,7 +150,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
145
150
|
}
|
|
146
151
|
/** 获取到的附件列表详情 */
|
|
147
152
|
getFileInfo(id: string) {
|
|
148
|
-
_axios.get(
|
|
153
|
+
_axios.get('/files/api/filing/file/' + id).then((res) => {
|
|
149
154
|
this.state.filesInfo.push(res.data);
|
|
150
155
|
});
|
|
151
156
|
}
|
|
@@ -168,7 +173,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
168
173
|
) < 0
|
|
169
174
|
) {
|
|
170
175
|
await _axios
|
|
171
|
-
.get(
|
|
176
|
+
.get('/files/api/filing/file/' + fileToken[i])
|
|
172
177
|
.then((res) => {
|
|
173
178
|
this.state.filesInfo.push(res.data);
|
|
174
179
|
});
|
|
@@ -180,30 +185,35 @@ export default class HtUploadFiles extends Vue {
|
|
|
180
185
|
get fileList() {
|
|
181
186
|
return [];
|
|
182
187
|
}
|
|
183
|
-
@Watch(
|
|
188
|
+
@Watch('state.filesInfo')
|
|
184
189
|
onFileToken(val: CreateAttachmentDto[], old: string) {
|
|
185
190
|
if (!this.readonly && !this.isArray) {
|
|
186
191
|
const arr: string[] = [];
|
|
187
192
|
val.forEach((item) => {
|
|
188
193
|
if (item.fileToken) arr.push(item.fileToken);
|
|
189
194
|
});
|
|
190
|
-
this.$emit(
|
|
191
|
-
this.$emit(
|
|
195
|
+
this.$emit('input', arr.toString());
|
|
196
|
+
this.$emit('change', arr.toString());
|
|
192
197
|
}
|
|
193
198
|
if (this.isArray) {
|
|
194
|
-
this.$emit(
|
|
199
|
+
this.$emit('change', val);
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
|
-
@Watch(
|
|
202
|
+
@Watch('filesInfo', { immediate: true })
|
|
198
203
|
onArrValue(val: CreateAttachmentDto[]) {
|
|
199
204
|
if (this.isArray) {
|
|
200
205
|
this.state.filesInfo = val || [];
|
|
201
206
|
}
|
|
202
207
|
}
|
|
203
|
-
@Watch(
|
|
204
|
-
onValue(val: string) {
|
|
208
|
+
@Watch('value', { immediate: true })
|
|
209
|
+
onValue(val: string | string[]) {
|
|
205
210
|
if (val && !this.isArray) {
|
|
206
|
-
|
|
211
|
+
if (Array.isArray(val)) {
|
|
212
|
+
this.state.fileToken = val;
|
|
213
|
+
} else {
|
|
214
|
+
this.state.fileToken = val.split(',');
|
|
215
|
+
}
|
|
216
|
+
|
|
207
217
|
this.getAllFileInfo();
|
|
208
218
|
} else {
|
|
209
219
|
this.state.fileToken = [];
|
|
@@ -214,7 +224,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
214
224
|
}
|
|
215
225
|
}
|
|
216
226
|
</script>
|
|
217
|
-
<style lang=
|
|
227
|
+
<style lang="scss" scoped>
|
|
218
228
|
.ht-ul-upload {
|
|
219
229
|
li {
|
|
220
230
|
width: 100%;
|
|
@@ -250,4 +260,4 @@ export default class HtUploadFiles extends Vue {
|
|
|
250
260
|
}
|
|
251
261
|
}
|
|
252
262
|
}
|
|
253
|
-
</style>
|
|
263
|
+
</style>
|