htui-yllkbz 1.5.38 → 1.5.40
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 +93 -78
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +93 -78
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +9 -9
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +2 -2
- package/src/packages/HtMd/index.vue +6 -14
- package/src/packages/HtTable/htTableColumn.vue +68 -113
- package/src/packages/HtTable/index.vue +73 -189
- package/src/packages/HtUpload/index.vue +17 -50
- package/src/packages/HtUploadFiles/index.vue +20 -36
|
@@ -7,179 +7,94 @@
|
|
|
7
7
|
* @LastEditTime: 2024-10-22 11:28:41
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
|
-
<div v-loading="state.loading"
|
|
11
|
-
style="background:#fff">
|
|
10
|
+
<div v-loading="state.loading" style="background:#fff">
|
|
12
11
|
<article>
|
|
13
|
-
<el-table ref="comTable"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
:data="data"
|
|
42
|
-
tooltip-effect="dark"
|
|
43
|
-
:tree-props="treeProps"
|
|
44
|
-
@row-click="
|
|
45
|
-
(row, column, event) => $emit('row-click', row, column, event)
|
|
46
|
-
"
|
|
47
|
-
@row-contextmenu="
|
|
48
|
-
(row, column, event) => $emit('row-contextmenu', row, column, event)
|
|
49
|
-
"
|
|
50
|
-
@row-dblclick="
|
|
51
|
-
(row, column, event) => $emit('row-dblclick', row, column, event)
|
|
52
|
-
"
|
|
53
|
-
@header-click="(column, event) => $emit('header-click', column, event)"
|
|
54
|
-
@header-contextmenu="
|
|
55
|
-
(column, event) => $emit('header-contextmenu', column, event)
|
|
56
|
-
"
|
|
57
|
-
@header-dragend="headerDragend"
|
|
58
|
-
@sort-change="
|
|
59
|
-
({ column, prop, order }) =>
|
|
60
|
-
$emit('sort-change', { column, prop, order })
|
|
61
|
-
"
|
|
62
|
-
@expand-change="(row, da) => $emit('expand-change', row, da)"
|
|
63
|
-
@filter-change="(filter) => $emit('filter-change', filter)"
|
|
64
|
-
@current-change="
|
|
65
|
-
(currentRow, oldCurrentRow) =>
|
|
66
|
-
$emit('current-change', currentRow, oldCurrentRow)
|
|
67
|
-
"
|
|
68
|
-
@select="(selection, row) => $emit('select', selection, row)"
|
|
69
|
-
@select-all="(selection) => $emit('select-all', selection)"
|
|
70
|
-
@selection-change="(selection) => $emit('selection-change', selection)"
|
|
71
|
-
@cell-mouse-enter="
|
|
72
|
-
(row, column, cell, event) =>
|
|
73
|
-
$emit('cell-mouse-enter', row, column, cell, event)
|
|
74
|
-
"
|
|
75
|
-
@cell-mouse-leave="
|
|
76
|
-
(row, column, cell, event) =>
|
|
77
|
-
$emit('cell-mouse-leave', row, column, cell, event)
|
|
78
|
-
"
|
|
79
|
-
@cell-click="
|
|
80
|
-
(row, column, cell, event) =>
|
|
81
|
-
$emit('cell-click', row, column, cell, event)
|
|
82
|
-
"
|
|
83
|
-
@cell-dblclick="
|
|
84
|
-
(row, column, cell, event) =>
|
|
85
|
-
$emit('cell-dblclick', row, column, cell, event)
|
|
86
|
-
">
|
|
12
|
+
<el-table ref="comTable" :height="height" :max-height="maxHeight" :sum-text="sumText" :show-summary="showSummary"
|
|
13
|
+
:summary-method="summaryMethod" :border="border" :default-expand-all="defaultExpandAll"
|
|
14
|
+
:expand-row-keys="expandRowKeys" :stripe="stripe !== undefined ? stripe : true" :size="size || 'small'"
|
|
15
|
+
:fit="fit" :span-method="spanMethodCom" :header-row-style="headerRowStyle || { background: 'var(--primary-92)' }
|
|
16
|
+
" :header-row-class-name="headerRowClassName" :header-cell-class-name="headerCellClassName"
|
|
17
|
+
:header-cell-style="headerCellStyle" :show-header="showHeader" :empty-text="emptyText || '暂无数据'"
|
|
18
|
+
:row-style="rowStyle" :cell-style="cellStyle" :row-class-name="rowClassName" :cell-class-name="cellClassName"
|
|
19
|
+
:current-row-key="currentRowKey" :highlight-current-row="highlightCurrentRow" :row-key="rowKey || 'id'"
|
|
20
|
+
:data="data" tooltip-effect="dark" :tree-props="treeProps" @row-click="(row, column, event) => $emit('row-click', row, column, event)
|
|
21
|
+
" @row-contextmenu="(row, column, event) => $emit('row-contextmenu', row, column, event)
|
|
22
|
+
" @row-dblclick="(row, column, event) => $emit('row-dblclick', row, column, event)
|
|
23
|
+
" @header-click="(column, event) => $emit('header-click', column, event)" @header-contextmenu="(column, event) => $emit('header-contextmenu', column, event)
|
|
24
|
+
" @header-dragend="headerDragend" @sort-change="({ column, prop, order }) =>
|
|
25
|
+
$emit('sort-change', { column, prop, order })
|
|
26
|
+
" @expand-change="(row, da) => $emit('expand-change', row, da)"
|
|
27
|
+
@filter-change="(filter) => $emit('filter-change', filter)" @current-change="(currentRow, oldCurrentRow) =>
|
|
28
|
+
$emit('current-change', currentRow, oldCurrentRow)
|
|
29
|
+
" @select="(selection, row) => $emit('select', selection, row)"
|
|
30
|
+
@select-all="(selection) => $emit('select-all', selection)"
|
|
31
|
+
@selection-change="(selection) => $emit('selection-change', selection)" @cell-mouse-enter="(row, column, cell, event) =>
|
|
32
|
+
$emit('cell-mouse-enter', row, column, cell, event)
|
|
33
|
+
" @cell-mouse-leave="(row, column, cell, event) =>
|
|
34
|
+
$emit('cell-mouse-leave', row, column, cell, event)
|
|
35
|
+
" @cell-click="(row, column, cell, event) =>
|
|
36
|
+
$emit('cell-click', row, column, cell, event)
|
|
37
|
+
" @cell-dblclick="(row, column, cell, event) =>
|
|
38
|
+
$emit('cell-dblclick', row, column, cell, event)
|
|
39
|
+
">
|
|
87
40
|
<template slot="empty">
|
|
88
41
|
<slot name="empty"> </slot>
|
|
89
42
|
</template>
|
|
90
|
-
<el-table-column width="55"
|
|
91
|
-
|
|
92
|
-
v-if="checked"
|
|
93
|
-
:reserve-selection="reserveSelection"
|
|
94
|
-
:selectable="(row) => row[selectKey] !== false"
|
|
95
|
-
type="selection">
|
|
43
|
+
<el-table-column width="55" :resizable="false" v-if="checked" :reserve-selection="reserveSelection"
|
|
44
|
+
:selectable="(row) => row[selectKey] !== false" type="selection">
|
|
96
45
|
</el-table-column>
|
|
97
|
-
<el-table-column v-if="isExpand"
|
|
98
|
-
type="expand">
|
|
46
|
+
<el-table-column v-if="isExpand" type="expand">
|
|
99
47
|
<!-- 展开行专用 -->
|
|
100
48
|
<template slot-scope="props">
|
|
101
|
-
<slot name="expand"
|
|
102
|
-
:row="props.row"
|
|
103
|
-
:column="props.column"
|
|
104
|
-
:rowIndex="props.$index">
|
|
49
|
+
<slot name="expand" :row="props.row" :column="props.column" :rowIndex="props.$index">
|
|
105
50
|
</slot>
|
|
106
51
|
</template>
|
|
107
52
|
</el-table-column>
|
|
108
|
-
<el-table-column v-if="!hideOrder"
|
|
109
|
-
|
|
110
|
-
:label="keyName === undefined ? '序号' : keyName"
|
|
111
|
-
:align="'center'"
|
|
112
|
-
width="55">
|
|
53
|
+
<el-table-column v-if="!hideOrder" :resizable="false" :label="keyName === undefined ? '序号' : keyName"
|
|
54
|
+
:align="'center'" width="55">
|
|
113
55
|
<template slot="header">
|
|
114
56
|
<slot :name="'header_order'">
|
|
115
|
-
<div @click="showFilterModel"
|
|
116
|
-
v-if="showFilter"
|
|
117
|
-
title="筛选排序">
|
|
57
|
+
<div @click="showFilterModel" v-if="showFilter" title="筛选排序">
|
|
118
58
|
<el-button type="text"><i class="el-icon-s-grid"></i></el-button>
|
|
119
59
|
</div>
|
|
120
60
|
<span v-else>{{ keyName || '序号' }}</span>
|
|
121
61
|
</slot>
|
|
122
62
|
</template>
|
|
123
63
|
<template slot-scope="{ row, column, $index }">
|
|
124
|
-
<slot name="body_order"
|
|
125
|
-
:row="row"
|
|
126
|
-
:column="column"
|
|
127
|
-
:$index="$index">
|
|
64
|
+
<slot name="body_order" :row="row" :column="column" :$index="$index">
|
|
128
65
|
{{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
66
|
+
(state.pageInfo.currentPage - 1) * state.pageInfo.pageSize +
|
|
67
|
+
($index + 1)
|
|
68
|
+
}}
|
|
132
69
|
</slot>
|
|
133
70
|
</template>
|
|
134
71
|
</el-table-column>
|
|
135
72
|
|
|
136
73
|
<template v-for="(item, index) in showColumns">
|
|
137
74
|
|
|
138
|
-
<HtTableColumn :key="`${item.key}_${index}`"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
:getAllRole="getAllRole"
|
|
143
|
-
:getAllUser="getAllUser"
|
|
144
|
-
@showFiles="showFiles">
|
|
145
|
-
<template v-for="child in allChildren"
|
|
146
|
-
:slot="child.key"
|
|
147
|
-
slot-scope="scope">
|
|
148
|
-
<slot :name="child.key"
|
|
149
|
-
:row="scope.row"
|
|
150
|
-
:column="scope.column"
|
|
151
|
-
:rowIndex="scope.rowIndex">
|
|
75
|
+
<HtTableColumn :key="`${item.key}_${index}`" :item="item" :getAllBaseData="getAllBaseData"
|
|
76
|
+
:getAllOrg="getAllOrg" :getAllRole="getAllRole" :getAllUser="getAllUser" @showFiles="showFiles">
|
|
77
|
+
<template v-for="child in allChildren" :slot="child.key" slot-scope="scope">
|
|
78
|
+
<slot :name="child.key" :row="scope.row" :column="scope.column" :rowIndex="scope.rowIndex">
|
|
152
79
|
</slot>
|
|
153
80
|
</template>
|
|
154
|
-
<template v-for="child in allChildren"
|
|
155
|
-
|
|
156
|
-
:slot="'header_' + child.key">
|
|
157
|
-
<slot :name="'header_' + child.key"
|
|
158
|
-
:column="column"
|
|
159
|
-
:$index="$index"></slot>
|
|
81
|
+
<template v-for="child in allChildren" slot-scope="{ column, $index }" :slot="'header_' + child.key">
|
|
82
|
+
<slot :name="'header_' + child.key" :column="column" :$index="$index"></slot>
|
|
160
83
|
</template>
|
|
161
84
|
|
|
162
|
-
<template :slot="item.key"
|
|
163
|
-
slot-scope="scope">
|
|
85
|
+
<template :slot="item.key" slot-scope="scope">
|
|
164
86
|
|
|
165
|
-
<slot :name="item.key"
|
|
166
|
-
:row="scope.row"
|
|
167
|
-
:column="scope.column"
|
|
168
|
-
:rowIndex="scope.rowIndex">
|
|
87
|
+
<slot :name="item.key" :row="scope.row" :column="scope.column" :rowIndex="scope.rowIndex">
|
|
169
88
|
</slot>
|
|
170
89
|
</template>
|
|
171
|
-
<template slot-scope="{ column, $index }"
|
|
172
|
-
|
|
173
|
-
<slot :name="'header_' + item.key"
|
|
174
|
-
:column="column"
|
|
175
|
-
:$index="$index"></slot>
|
|
90
|
+
<template slot-scope="{ column, $index }" :slot="'header_' + item.key">
|
|
91
|
+
<slot :name="'header_' + item.key" :column="column" :$index="$index"></slot>
|
|
176
92
|
</template>
|
|
177
93
|
</HtTableColumn>
|
|
178
94
|
</template>
|
|
179
95
|
</el-table>
|
|
180
96
|
</article>
|
|
181
|
-
<footer v-if="!hidePage"
|
|
182
|
-
class="ht-table-footer">
|
|
97
|
+
<footer v-if="!hidePage" class="ht-table-footer">
|
|
183
98
|
<el-row name="footer">
|
|
184
99
|
<!-- 此处建议使用el-col -->
|
|
185
100
|
<slot name="footerLeft"></slot>
|
|
@@ -187,81 +102,49 @@
|
|
|
187
102
|
<el-col :span="$slots['footerLeft'] ? 12 : 24">
|
|
188
103
|
<!-- <p style="width:90px;float:left">共{{data.length}}条</p> -->
|
|
189
104
|
<PageInfo :hide-on-single-page="pagination && pagination.hideOnSinglePage"
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
@onchange="(e) => $emit('onchange', e)"
|
|
193
|
-
:page-sizes="pagination && pagination.pageSizes"
|
|
194
|
-
:page-info="state.pageInfo"></PageInfo>
|
|
105
|
+
:small="pagination && pagination.small" :style="pageStyle" @onchange="(e) => $emit('onchange', e)"
|
|
106
|
+
:page-sizes="pagination && pagination.pageSizes" :page-info="state.pageInfo"></PageInfo>
|
|
195
107
|
</el-col>
|
|
196
108
|
</el-row>
|
|
197
109
|
</footer>
|
|
198
110
|
<!-- 详情弹框 -->
|
|
199
|
-
<el-dialog :visible.sync="state.visibleFilter"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
:append-to-body="true"
|
|
203
|
-
:modal-append-to-body="true"
|
|
204
|
-
:close-on-click-modal="true"
|
|
205
|
-
width="400px">
|
|
206
|
-
<p slot="title"
|
|
207
|
-
style="font-weight:700;font-size:18px;float:left;margin:0">
|
|
111
|
+
<el-dialog :visible.sync="state.visibleFilter" title="属性设置" v-if="state.visibleFilter" :append-to-body="true"
|
|
112
|
+
:modal-append-to-body="true" :close-on-click-modal="true" width="400px">
|
|
113
|
+
<p slot="title" style="font-weight:700;font-size:18px;float:left;margin:0">
|
|
208
114
|
自定义列展示
|
|
209
115
|
</p>
|
|
210
116
|
<div style="overflow:hidden;height:35vh;margin-top:12px">
|
|
211
117
|
<el-scrollbar style="height: calc(35vh + 17px)">
|
|
212
|
-
<el-tree :data="getAllColumns"
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
@node-drag-enter="handleDragEnter"
|
|
220
|
-
@node-drag-leave="handleDragLeave"
|
|
221
|
-
@node-drag-over="handleDragOver"
|
|
222
|
-
@node-drag-end="handleDragEnd"
|
|
223
|
-
@node-drop="handleDrop"
|
|
224
|
-
:default-checked-keys="state.checkedColumnKeys"
|
|
225
|
-
@check-change="changeColumns"
|
|
226
|
-
:allow-drag="allowDrag"
|
|
227
|
-
:draggable="draggable"
|
|
228
|
-
:allow-drop="allowDrop">
|
|
229
|
-
<span class="custom-tree-node"
|
|
230
|
-
slot-scope="{ node, data }">
|
|
231
|
-
<slot :name="'header_' + data.key"
|
|
232
|
-
:column="data">{{ data.title
|
|
118
|
+
<el-tree :data="getAllColumns" ref="tree" show-checkbox :expand-on-click-node="false" node-key="key"
|
|
119
|
+
:check-on-click-node="false" @node-drag-start="handleDragStart" @node-drag-enter="handleDragEnter"
|
|
120
|
+
@node-drag-leave="handleDragLeave" @node-drag-over="handleDragOver" @node-drag-end="handleDragEnd"
|
|
121
|
+
@node-drop="handleDrop" :default-checked-keys="state.checkedColumnKeys" @check-change="changeColumns"
|
|
122
|
+
:allow-drag="allowDrag" :draggable="draggable" :allow-drop="allowDrop">
|
|
123
|
+
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
124
|
+
<slot :name="'header_' + data.key" :column="data">{{ data.title
|
|
233
125
|
}}<span style="color:#C0C4CC">{{
|
|
234
|
-
|
|
235
|
-
|
|
126
|
+
data.property ? `(${data.property})` : ''
|
|
127
|
+
}}</span></slot>
|
|
236
128
|
</span>
|
|
237
129
|
</el-tree>
|
|
238
130
|
</el-scrollbar>
|
|
239
131
|
</div>
|
|
240
132
|
<span slot="footer">
|
|
241
|
-
<el-button type="primary"
|
|
242
|
-
@click="confirmSortAndshow">确定</el-button>
|
|
133
|
+
<el-button type="primary" @click="confirmSortAndshow">确定</el-button>
|
|
243
134
|
<el-button @click="state.visibleFilter = false">取消</el-button>
|
|
244
135
|
<el-button @click="resetColumn">重置</el-button>
|
|
245
136
|
</span>
|
|
246
137
|
</el-dialog>
|
|
247
138
|
<!-- 附件详情弹框 -->
|
|
248
|
-
<el-dialog :visible.sync="state.visibleFile"
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
:append-to-body="true"
|
|
252
|
-
:modal-append-to-body="true"
|
|
253
|
-
:close-on-click-modal="true"
|
|
254
|
-
width="400px"
|
|
255
|
-
:center="true">
|
|
256
|
-
<p slot="title"
|
|
257
|
-
style="font-weight:700;font-size:18px;float:left;margin:0">
|
|
139
|
+
<el-dialog :visible.sync="state.visibleFile" v-if="state.visibleFile" title="附件查看" :append-to-body="true"
|
|
140
|
+
:modal-append-to-body="true" :close-on-click-modal="true" width="400px" :center="true">
|
|
141
|
+
<p slot="title" style="font-weight:700;font-size:18px;float:left;margin:0">
|
|
258
142
|
附件查看
|
|
259
143
|
</p>
|
|
260
144
|
|
|
261
145
|
<div style="overflow:hidden;height:calc(30vh)">
|
|
262
146
|
<el-scrollbar style="height: calc(100% + 17px)">
|
|
263
|
-
<HtUploadFiles :disabled="true"
|
|
264
|
-
v-model="state.files"></HtUploadFiles>
|
|
147
|
+
<HtUploadFiles :disabled="true" v-model="state.files"></HtUploadFiles>
|
|
265
148
|
</el-scrollbar>
|
|
266
149
|
</div>
|
|
267
150
|
</el-dialog>
|
|
@@ -314,6 +197,7 @@ interface State {
|
|
|
314
197
|
export default class HtTable extends Vue {
|
|
315
198
|
/** 默认的table头 */
|
|
316
199
|
@Prop({ default: [] }) columns!: Column[];
|
|
200
|
+
@Prop({ default: "file-management-service" }) proxy?: string;
|
|
317
201
|
@Prop() data!: any[];
|
|
318
202
|
/** 是否在表尾显示合计行 */
|
|
319
203
|
@Prop({ default: false }) showSummary!: boolean;
|
|
@@ -726,13 +610,13 @@ export default class HtTable extends Vue {
|
|
|
726
610
|
return this.spanMethod
|
|
727
611
|
? this.spanMethod
|
|
728
612
|
: this.data && this.data.length > 1
|
|
729
|
-
|
|
613
|
+
? getSpanMethod(
|
|
730
614
|
this.data,
|
|
731
615
|
this.spanMethodProps?.colRows || [],
|
|
732
616
|
this.spanMethodProps?.sameColRows || [],
|
|
733
617
|
this.spanMethodProps?.relateProps || {}
|
|
734
618
|
)
|
|
735
|
-
|
|
619
|
+
: undefined;
|
|
736
620
|
}
|
|
737
621
|
}
|
|
738
622
|
</script>
|
|
@@ -1,65 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="files-view">
|
|
3
|
-
<el-upload
|
|
4
|
-
|
|
5
|
-
:
|
|
6
|
-
:accept="state.accept"
|
|
7
|
-
:before-upload="handelBeforeLoad"
|
|
8
|
-
:headers="headers"
|
|
9
|
-
:file-list="state.fileData.fileList"
|
|
10
|
-
list-type="picture-card"
|
|
11
|
-
multiple
|
|
12
|
-
:disabled="onlyShow"
|
|
13
|
-
:class="{ 'only-show': onlyShow }"
|
|
14
|
-
>
|
|
3
|
+
<el-upload :action="`/${proxy}/api/filing/file/upload`" :on-success="handleSuccess" :accept="state.accept"
|
|
4
|
+
:before-upload="handelBeforeLoad" :headers="headers" :file-list="state.fileData.fileList" list-type="picture-card"
|
|
5
|
+
multiple :disabled="onlyShow" :class="{ 'only-show': onlyShow }">
|
|
15
6
|
<i slot="default" class="el-icon-plus"></i>
|
|
16
7
|
<div slot="file" slot-scope="{ file }" :title="file.fileName">
|
|
17
|
-
<img
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:src="`/files/api/filing/file/download/${file.fileToken}`"
|
|
21
|
-
:alt="file.fileName"
|
|
22
|
-
fit="fill"
|
|
23
|
-
/>
|
|
24
|
-
<img
|
|
25
|
-
class="el-upload-list__item-thumbnail"
|
|
26
|
-
v-else
|
|
27
|
-
:src="showIcon(file)"
|
|
28
|
-
:alt="file.fileName"
|
|
29
|
-
fit="fill"
|
|
30
|
-
/>
|
|
8
|
+
<img class="el-upload-list__item-thumbnail" v-if="file.fileType && file.fileType.includes('image')"
|
|
9
|
+
:src="`/${proxy}/api/filing/file/download/${file.fileToken}`" :alt="file.fileName" fit="fill" />
|
|
10
|
+
<img class="el-upload-list__item-thumbnail" v-else :src="showIcon(file)" :alt="file.fileName" fit="fill" />
|
|
31
11
|
|
|
32
12
|
<span class="el-upload-list__item-actions">
|
|
33
|
-
<span
|
|
34
|
-
|
|
35
|
-
v-if="file.fileType && file.fileType.includes('image')"
|
|
36
|
-
@click="handlePictureCardPreview(file)"
|
|
37
|
-
>
|
|
13
|
+
<span class="el-upload-list__item-preview" v-if="file.fileType && file.fileType.includes('image')"
|
|
14
|
+
@click="handlePictureCardPreview(file)">
|
|
38
15
|
<i class="el-icon-zoom-in"></i>
|
|
39
16
|
</span>
|
|
40
|
-
<span
|
|
41
|
-
v-if="!state.disabled"
|
|
42
|
-
class="el-upload-list__item-delete"
|
|
43
|
-
@click="handleDownload(file)"
|
|
44
|
-
>
|
|
17
|
+
<span v-if="!state.disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
|
45
18
|
<i class="el-icon-download"></i>
|
|
46
19
|
</span>
|
|
47
|
-
<span
|
|
48
|
-
v-if="!state.disabled && !onlyShow"
|
|
49
|
-
class="el-upload-list__item-delete"
|
|
50
|
-
@click="handleRemove(file)"
|
|
51
|
-
>
|
|
20
|
+
<span v-if="!state.disabled && !onlyShow" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
|
52
21
|
<i class="el-icon-delete"></i>
|
|
53
22
|
</span>
|
|
54
23
|
</span>
|
|
55
24
|
</div>
|
|
56
25
|
</el-upload>
|
|
57
|
-
<el-dialog
|
|
58
|
-
:visible.sync="state.dialogVisible"
|
|
59
|
-
:modal-append-to-body="false"
|
|
60
|
-
:modal="false"
|
|
61
|
-
:append-to-body="true"
|
|
62
|
-
>
|
|
26
|
+
<el-dialog :visible.sync="state.dialogVisible" :modal-append-to-body="false" :modal="false" :append-to-body="true">
|
|
63
27
|
<article style="height: calc(100vh - 200px); overflow: auto;">
|
|
64
28
|
<img :src="state.dialogImageUrl" alt="" />
|
|
65
29
|
</article>
|
|
@@ -104,6 +68,7 @@ export default class HtUpload extends Vue {
|
|
|
104
68
|
@Prop() tokens!: InFile[];
|
|
105
69
|
/** 文件后缀格式 */
|
|
106
70
|
@Prop() accept?: string;
|
|
71
|
+
@Prop({ default: "file-management-service" }) proxy?: string;
|
|
107
72
|
/** 数据 */
|
|
108
73
|
state: State = {
|
|
109
74
|
loading: false,
|
|
@@ -181,7 +146,7 @@ export default class HtUpload extends Vue {
|
|
|
181
146
|
}
|
|
182
147
|
}
|
|
183
148
|
handlePictureCardPreview(file: InFile) {
|
|
184
|
-
this.state.dialogImageUrl =
|
|
149
|
+
this.state.dialogImageUrl = `/${this.proxy}/api/filing/file/download/${file.fileToken}`;
|
|
185
150
|
this.state.dialogVisible = true;
|
|
186
151
|
}
|
|
187
152
|
/** 上传文件之前的判断 */
|
|
@@ -214,7 +179,7 @@ export default class HtUpload extends Vue {
|
|
|
214
179
|
}
|
|
215
180
|
handleDownload(file: InFile) {
|
|
216
181
|
/** 创建下载链接 */
|
|
217
|
-
const downloadHref =
|
|
182
|
+
const downloadHref = `/${this.proxy}/api/filing/file/download/${file.fileToken}`;
|
|
218
183
|
|
|
219
184
|
/** 创建a标签并为其添加属性 */
|
|
220
185
|
const downloadLink = document.createElement('a');
|
|
@@ -245,7 +210,7 @@ export default class HtUpload extends Vue {
|
|
|
245
210
|
<style lang="scss">
|
|
246
211
|
.files-view {
|
|
247
212
|
.only-show {
|
|
248
|
-
|
|
213
|
+
>.el-upload {
|
|
249
214
|
display: none;
|
|
250
215
|
}
|
|
251
216
|
|
|
@@ -254,9 +219,11 @@ export default class HtUpload extends Vue {
|
|
|
254
219
|
height: 54px;
|
|
255
220
|
float: left;
|
|
256
221
|
margin: 8px 8px 0 0px !important;
|
|
222
|
+
|
|
257
223
|
div {
|
|
258
224
|
width: 70px !important;
|
|
259
225
|
height: 54px;
|
|
226
|
+
|
|
260
227
|
img {
|
|
261
228
|
width: 70px;
|
|
262
229
|
height: 54px;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2022-02-11 14:26:23
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2024-12-20 14:56:38
|
|
8
8
|
-->
|
|
9
9
|
<!--
|
|
10
10
|
* @Descripttion: 附件列表 ------没有搞完
|
|
@@ -16,23 +16,11 @@
|
|
|
16
16
|
-->
|
|
17
17
|
<template>
|
|
18
18
|
<div>
|
|
19
|
-
<el-upload
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
>
|
|
19
|
+
<el-upload class="ht-upload" v-if="!disabled" style="width:368px;height:108px" :show-file-list="false"
|
|
20
|
+
:disabled="disabled" :on-success="onSuccess" :before-upload="beforeUpload" drag
|
|
21
|
+
:action="`/${proxy}/api/filing/file/upload`" multiple>
|
|
31
22
|
<!-- <i class="el-icon-upload"></i> -->
|
|
32
|
-
<div
|
|
33
|
-
style="margin-top:8px;font-size:12px;color:#999"
|
|
34
|
-
class="el-upload__text"
|
|
35
|
-
>
|
|
23
|
+
<div style="margin-top:8px;font-size:12px;color:#999" class="el-upload__text">
|
|
36
24
|
拖动文件到此处,或<br /><em>点击上传</em>
|
|
37
25
|
</div>
|
|
38
26
|
<!-- <div class="el-upload__tip"
|
|
@@ -40,24 +28,12 @@
|
|
|
40
28
|
</el-upload>
|
|
41
29
|
<ul class="ht-ul-upload">
|
|
42
30
|
<li :key="item.fileToken" v-for="(item, index) in state.filesInfo">
|
|
43
|
-
<a @click="downLoadFile(item)"
|
|
44
|
-
|
|
45
|
-
>{{ item.fileName }}</a
|
|
46
|
-
>
|
|
31
|
+
<a @click="downLoadFile(item)"><i class="le-icon el-icon-document" style="margin-right:7px"></i>{{ item.fileName
|
|
32
|
+
}}</a>
|
|
47
33
|
<span>
|
|
48
34
|
<i v-if="!disabled" class="el-icon el-icon-circle-check"></i>
|
|
49
|
-
<i
|
|
50
|
-
|
|
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>
|
|
35
|
+
<i v-if="!disabled" class="el-icon el-icon-close" @click="delItem(item, index)" title="删除"></i>
|
|
36
|
+
<i class="el-icon el-icon-download" style="margin-right:24px" @click="downLoadFile(item)" title="下载"></i>
|
|
61
37
|
</span>
|
|
62
38
|
</li>
|
|
63
39
|
</ul>
|
|
@@ -103,6 +79,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
103
79
|
@Prop({ default: false }) isArray?: boolean;
|
|
104
80
|
|
|
105
81
|
@Prop() filesInfo?: CreateAttachmentDto[];
|
|
82
|
+
@Prop({ default: "file-management-service" }) proxy?: string;
|
|
106
83
|
/** 数据 */
|
|
107
84
|
state: State = {
|
|
108
85
|
loading: false,
|
|
@@ -136,7 +113,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
136
113
|
}
|
|
137
114
|
/**下载文件 */
|
|
138
115
|
downLoadFile(item: any) {
|
|
139
|
-
this.state.fileSrc =
|
|
116
|
+
this.state.fileSrc = `/${this.proxy}/api/filing/file/download/${item.fileToken}`;
|
|
140
117
|
setTimeout(() => {
|
|
141
118
|
const adom: any = this.$refs.download1;
|
|
142
119
|
adom.click();
|
|
@@ -150,7 +127,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
150
127
|
}
|
|
151
128
|
/** 获取到的附件列表详情 */
|
|
152
129
|
getFileInfo(id: string) {
|
|
153
|
-
_axios.get(
|
|
130
|
+
_axios.get(`/${this.proxy}/api/filing/file/` + id).then((res) => {
|
|
154
131
|
this.state.filesInfo.push(res.data);
|
|
155
132
|
});
|
|
156
133
|
}
|
|
@@ -173,7 +150,7 @@ export default class HtUploadFiles extends Vue {
|
|
|
173
150
|
) < 0
|
|
174
151
|
) {
|
|
175
152
|
await _axios
|
|
176
|
-
.get(
|
|
153
|
+
.get(`/${this.proxy}/api/filing/file/` + fileToken[i])
|
|
177
154
|
.then((res) => {
|
|
178
155
|
this.state.filesInfo.push(res.data);
|
|
179
156
|
});
|
|
@@ -235,26 +212,33 @@ export default class HtUploadFiles extends Vue {
|
|
|
235
212
|
display: flex;
|
|
236
213
|
justify-content: space-between;
|
|
237
214
|
cursor: pointer;
|
|
215
|
+
|
|
238
216
|
a {
|
|
239
217
|
color: #606266;
|
|
240
218
|
font-size: 12px;
|
|
241
219
|
}
|
|
220
|
+
|
|
242
221
|
.el-icon-close {
|
|
243
222
|
display: none;
|
|
244
223
|
}
|
|
224
|
+
|
|
245
225
|
&:hover {
|
|
246
226
|
background: #eee;
|
|
227
|
+
|
|
247
228
|
a {
|
|
248
229
|
color: var(--primary);
|
|
249
230
|
}
|
|
231
|
+
|
|
250
232
|
.el-icon-close {
|
|
251
233
|
display: block;
|
|
252
234
|
line-height: 40px;
|
|
253
235
|
}
|
|
236
|
+
|
|
254
237
|
.el-icon-circle-check {
|
|
255
238
|
display: none;
|
|
256
239
|
}
|
|
257
240
|
}
|
|
241
|
+
|
|
258
242
|
.el-icon-circle-check {
|
|
259
243
|
color: var(--primary);
|
|
260
244
|
}
|