imatrix-ui 0.2.3-up → 0.2.4-up
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/super-ui.css +1 -1
- package/lib/super-ui.js +920 -984
- package/lib/super-ui.umd.cjs +23 -23
- package/package.json +36 -34
- package/packages/super-grid/src/normal-column.vue +1224 -1221
- package/packages/super-nine-grid/src/super-nine-grid.vue +1169 -1164
- package/packages/super-nine-grid/src/utils.js +264 -264
- package/src/permission.js +160 -160
- package/src/router/index.js +110 -110
- package/src/store/modules/permission.js +145 -145
- package/src/styles/theme/dark-blue/button.scss +6 -0
- package/src/styles/theme/dark-blue/pagination.scss +4 -0
- package/src/utils/auth-api.js +160 -159
- package/src/utils/util.js +544 -539
- package/src/views/layout/components/Menubar/SidebarItem.vue +164 -164
- package/src/views/layout/components/Sidebar/SidebarItem.vue +135 -135
|
@@ -1,1221 +1,1224 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-table-column
|
|
3
|
-
:fixed="fixed"
|
|
4
|
-
:sortable="sortable"
|
|
5
|
-
:filters="filters"
|
|
6
|
-
:filter-method="filterMethod"
|
|
7
|
-
:prop="column.prop"
|
|
8
|
-
:width="getColumnWidth()"
|
|
9
|
-
:align="align"
|
|
10
|
-
:header-align="headerAlign"
|
|
11
|
-
:class-name="column.prop"
|
|
12
|
-
>
|
|
13
|
-
<template v-slot:header>
|
|
14
|
-
<span :class="{ is_req: isFieldRequired() }"
|
|
15
|
-
><span
|
|
16
|
-
class="cell--span required__label"
|
|
17
|
-
:title="$escapeHtml(label)"
|
|
18
|
-
v-html="$escapeHtml(label)"
|
|
19
|
-
/></span>
|
|
20
|
-
<el-icon v-if="isShowAdd" @click="createFormSubTableRow" style="font-size: 20px; color: #409eff"><CirclePlus /></el-icon>
|
|
21
|
-
</template>
|
|
22
|
-
<template v-slot="scope">
|
|
23
|
-
<!--添加:key="column.prop+'_'+scope.$index"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
|
|
24
|
-
<dynamic-input
|
|
25
|
-
v-if="lineEdit.editable && isEditable && scope.row.$editing"
|
|
26
|
-
v-model:value="scope.row[column.prop]"
|
|
27
|
-
:type="column.componentType"
|
|
28
|
-
:position="{
|
|
29
|
-
row: scope.$index,
|
|
30
|
-
prop: column.prop,
|
|
31
|
-
}"
|
|
32
|
-
:list-toolbar-form-data="listToolbarFormData"
|
|
33
|
-
:line-edit="lineEdit"
|
|
34
|
-
:options="column.valueSet"
|
|
35
|
-
:row="scope.row"
|
|
36
|
-
:column="column"
|
|
37
|
-
:list-code="listCode"
|
|
38
|
-
:is-sql="isSql"
|
|
39
|
-
:row-index="scope.$index"
|
|
40
|
-
:class="isRequired(scope.row.$editing) ? 'm-requried' : ''"
|
|
41
|
-
@findIndex="findIndex(scope.$index)"
|
|
42
|
-
@focus="onFocus(scope.$index)"
|
|
43
|
-
@refresData="refresData"
|
|
44
|
-
@refresPortData="refresPortData"
|
|
45
|
-
@refresPortsData="refresPortsData"
|
|
46
|
-
@refresMainTableFields="refresMainTableFields"
|
|
47
|
-
@prohibitToEdit="prohibitToEdit"
|
|
48
|
-
/>
|
|
49
|
-
<span v-else>
|
|
50
|
-
<span v-if="column.operations" class="grid-operation-buttons">
|
|
51
|
-
<span
|
|
52
|
-
v-for="(operation, operationIndex) in column.operations"
|
|
53
|
-
:key="operationIndex"
|
|
54
|
-
class="cell--span"
|
|
55
|
-
>
|
|
56
|
-
<el-dropdown
|
|
57
|
-
v-if="operation.isGroup"
|
|
58
|
-
:size="
|
|
59
|
-
operation.buttons && operation.buttons.length > 0
|
|
60
|
-
? operation.buttons[0].props.size
|
|
61
|
-
: 'small'
|
|
62
|
-
"
|
|
63
|
-
style="padding-left: 10px"
|
|
64
|
-
split-button
|
|
65
|
-
@command="handleCommand"
|
|
66
|
-
>
|
|
67
|
-
{{ $escapeHtml(operation.label) }}
|
|
68
|
-
<template v-slot:dropdown>
|
|
69
|
-
<el-dropdown-menu>
|
|
70
|
-
<span
|
|
71
|
-
v-for="(buttonChild, buttonChildIndex) in operation.buttons"
|
|
72
|
-
:key="buttonChild.props.code + buttonChildIndex"
|
|
73
|
-
>
|
|
74
|
-
<el-dropdown-item
|
|
75
|
-
v-permission="buttonChild.props.permission"
|
|
76
|
-
:command="
|
|
77
|
-
beforeHandleCommand(
|
|
78
|
-
buttonChild.props.code,
|
|
79
|
-
scope.row,
|
|
80
|
-
scope.$index
|
|
81
|
-
)
|
|
82
|
-
"
|
|
83
|
-
:disabled="preventReclick"
|
|
84
|
-
>
|
|
85
|
-
{{
|
|
86
|
-
$escapeHtml(
|
|
87
|
-
buttonChild.props.label
|
|
88
|
-
? buttonChild.props.label
|
|
89
|
-
: buttonChild.props.code === 'search'
|
|
90
|
-
? $t('superPageMessage.searchButtonLabel')
|
|
91
|
-
: ''
|
|
92
|
-
)
|
|
93
|
-
}}
|
|
94
|
-
</el-dropdown-item>
|
|
95
|
-
</span>
|
|
96
|
-
</el-dropdown-menu>
|
|
97
|
-
</template>
|
|
98
|
-
</el-dropdown>
|
|
99
|
-
<row-operation
|
|
100
|
-
v-else
|
|
101
|
-
:operation-setting="operation.props"
|
|
102
|
-
:label="
|
|
103
|
-
operation.props.label
|
|
104
|
-
? operation.props.label
|
|
105
|
-
: scope.row[column.prop]
|
|
106
|
-
"
|
|
107
|
-
:operation-index="operationIndex"
|
|
108
|
-
:entity="scope.row"
|
|
109
|
-
:editing="scope.row.$editing"
|
|
110
|
-
:column="column"
|
|
111
|
-
:row-index="scope.$index"
|
|
112
|
-
:is-show="operation.isShow"
|
|
113
|
-
:on-click="operation.onClick"
|
|
114
|
-
/>
|
|
115
|
-
</span>
|
|
116
|
-
</span>
|
|
117
|
-
<span
|
|
118
|
-
v-else-if="
|
|
119
|
-
customFormatValue(
|
|
120
|
-
scope.row,
|
|
121
|
-
column.prop,
|
|
122
|
-
customFormat,
|
|
123
|
-
scope.$index
|
|
124
|
-
)
|
|
125
|
-
"
|
|
126
|
-
class="cell--span"
|
|
127
|
-
>
|
|
128
|
-
<component
|
|
129
|
-
:is="column.prop + scope.$index"
|
|
130
|
-
:row="scope.row"
|
|
131
|
-
:entity="scope.row"
|
|
132
|
-
:prop="column.prop"
|
|
133
|
-
:parent="parentFormData"
|
|
134
|
-
:row-index="scope.$index"
|
|
135
|
-
:show-value="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
136
|
-
:value="getCellValue(scope.row)"
|
|
137
|
-
:select-options="column.valueSet"
|
|
138
|
-
/>
|
|
139
|
-
</span>
|
|
140
|
-
<!-- 自定义格式的时候 -->
|
|
141
|
-
<span
|
|
142
|
-
v-else-if="
|
|
143
|
-
columnFormatter !== undefined &&
|
|
144
|
-
columnFormatter.type !== undefined &&
|
|
145
|
-
columnFormatter.type === 'customControl' &&
|
|
146
|
-
columnFormatter.options &&
|
|
147
|
-
columnFormatter.options.format &&
|
|
148
|
-
columnFormatter.options.format !== ''
|
|
149
|
-
"
|
|
150
|
-
class="cell--span"
|
|
151
|
-
>
|
|
152
|
-
<!--:key="column.prop+'_'+scope.$index+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
|
|
153
|
-
<component
|
|
154
|
-
:is="columnFormatter.options.format"
|
|
155
|
-
:key="column.prop + '_' + scope.$index + '_' + currentPage"
|
|
156
|
-
:disabled="true"
|
|
157
|
-
:row="pageGridData[scope.$index]"
|
|
158
|
-
:entity="pageGridData[scope.$index]"
|
|
159
|
-
:prop="column.prop"
|
|
160
|
-
:parent="parentFormData"
|
|
161
|
-
:row-index="scope.$index"
|
|
162
|
-
:get-form-data="getFormData"
|
|
163
|
-
:get-grid-data="getTableGridData"
|
|
164
|
-
:show-value="
|
|
165
|
-
$escapeHtml(getLabel(pageGridData[scope.$index], scope.$index))
|
|
166
|
-
"
|
|
167
|
-
:value="getCellValue(pageGridData[scope.$index])"
|
|
168
|
-
:select-options="column.valueSet"
|
|
169
|
-
:grid-data="gridData"
|
|
170
|
-
:page-grid-data="pageGridData"
|
|
171
|
-
:current-page="currentPage"
|
|
172
|
-
/></span>
|
|
173
|
-
<span
|
|
174
|
-
v-else-if="
|
|
175
|
-
columnFormatter !== undefined &&
|
|
176
|
-
columnFormatter.type !== undefined &&
|
|
177
|
-
columnFormatter.type === 'secretInfo'
|
|
178
|
-
"
|
|
179
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
180
|
-
class="cell--span"
|
|
181
|
-
>
|
|
182
|
-
<secret-info
|
|
183
|
-
:entity="scope.row"
|
|
184
|
-
:prop="column.prop"
|
|
185
|
-
:value="getCellValue(scope.row)"
|
|
186
|
-
:table-name="tableName"
|
|
187
|
-
:list-code="listCode"
|
|
188
|
-
:page-code="pageCode"
|
|
189
|
-
:list-name="listName"
|
|
190
|
-
:field-label="$escapeHtml(label)"
|
|
191
|
-
/>
|
|
192
|
-
</span>
|
|
193
|
-
<span v-else-if="isObjectProp(column.prop)">
|
|
194
|
-
<span v-if="column.componentType === 'annex'" type="primary">
|
|
195
|
-
<span
|
|
196
|
-
v-if="isShowOverflowTooltip"
|
|
197
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
198
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
199
|
-
:style="{ width: cellWidth + 'px' }"
|
|
200
|
-
class="ellipsis cell--span"
|
|
201
|
-
>
|
|
202
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
203
|
-
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
204
|
-
</span>
|
|
205
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
206
|
-
</span>
|
|
207
|
-
<span
|
|
208
|
-
v-else
|
|
209
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
210
|
-
class="cell--span"
|
|
211
|
-
>
|
|
212
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
213
|
-
<el-icon class="annex-cell" @click="previewImg(scope.row)"><el-icon-zoom-in /></el-icon>
|
|
214
|
-
</span>
|
|
215
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
216
|
-
</span>
|
|
217
|
-
</span>
|
|
218
|
-
<span
|
|
219
|
-
v-else-if="column.formatter && column.formatter.type === 'files'"
|
|
220
|
-
type="primary"
|
|
221
|
-
>
|
|
222
|
-
<span
|
|
223
|
-
v-if="isShowOverflowTooltip"
|
|
224
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
225
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
226
|
-
:style="{ width: cellWidth + 'px' }"
|
|
227
|
-
class="ellipsis cell--span"
|
|
228
|
-
>
|
|
229
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
230
|
-
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
231
|
-
</span>
|
|
232
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
233
|
-
</span>
|
|
234
|
-
<span
|
|
235
|
-
v-else
|
|
236
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
237
|
-
class="cell--span"
|
|
238
|
-
>
|
|
239
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
240
|
-
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
241
|
-
</span>
|
|
242
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
243
|
-
</span>
|
|
244
|
-
</span>
|
|
245
|
-
<el-link
|
|
246
|
-
v-else-if="
|
|
247
|
-
columnFormatter !== undefined &&
|
|
248
|
-
columnFormatter.type !== undefined &&
|
|
249
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
250
|
-
getMyHyperLinkSetting(scope.row).visible === true
|
|
251
|
-
"
|
|
252
|
-
type="primary"
|
|
253
|
-
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
254
|
-
>
|
|
255
|
-
<span
|
|
256
|
-
v-if="isShowOverflowTooltip"
|
|
257
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
258
|
-
:title="getMyHyperLinkSetting(scope.row).title"
|
|
259
|
-
:style="{ width: cellWidth + 'px' }"
|
|
260
|
-
class="ellipsis cell--span"
|
|
261
|
-
>{{ getMyHyperLinkSetting(scope.row).label
|
|
262
|
-
}}<i
|
|
263
|
-
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
264
|
-
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
265
|
-
/></span>
|
|
266
|
-
<span
|
|
267
|
-
v-else
|
|
268
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
269
|
-
class="cell--span"
|
|
270
|
-
>{{ getMyHyperLinkSetting(scope.row).label
|
|
271
|
-
}}<i
|
|
272
|
-
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
273
|
-
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
274
|
-
/></span>
|
|
275
|
-
</el-link>
|
|
276
|
-
<span
|
|
277
|
-
v-else-if="isShowOverflowTooltip"
|
|
278
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
279
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
280
|
-
:style="{ width: cellWidth + 'px' }"
|
|
281
|
-
class="ellipsis cell--span"
|
|
282
|
-
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
283
|
-
>
|
|
284
|
-
<span
|
|
285
|
-
v-else
|
|
286
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
287
|
-
class="cell--span"
|
|
288
|
-
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
289
|
-
>
|
|
290
|
-
</span>
|
|
291
|
-
<span v-else>
|
|
292
|
-
<span
|
|
293
|
-
v-if="
|
|
294
|
-
column.componentType === 'annex' ||
|
|
295
|
-
column.componentType === 'multipartUpload'
|
|
296
|
-
"
|
|
297
|
-
type="primary"
|
|
298
|
-
>
|
|
299
|
-
<span
|
|
300
|
-
v-if="isShowOverflowTooltip"
|
|
301
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
302
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
303
|
-
:style="{ width: cellWidth + 'px' }"
|
|
304
|
-
class="ellipsis cell--span"
|
|
305
|
-
>
|
|
306
|
-
<FsPreview
|
|
307
|
-
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
308
|
-
:entity="scope.row"
|
|
309
|
-
:file-set-obj="JSON.parse(column.fileSet)"
|
|
310
|
-
:is-sql="isSql"
|
|
311
|
-
/>
|
|
312
|
-
</span>
|
|
313
|
-
<span
|
|
314
|
-
v-else
|
|
315
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
316
|
-
class="cell--span"
|
|
317
|
-
>
|
|
318
|
-
<FsPreview
|
|
319
|
-
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
320
|
-
:entity="scope.row"
|
|
321
|
-
:file-set-obj="JSON.parse(column.fileSet)"
|
|
322
|
-
:is-sql="isSql"
|
|
323
|
-
/>
|
|
324
|
-
</span>
|
|
325
|
-
</span>
|
|
326
|
-
<span
|
|
327
|
-
v-else-if="column.formatter && column.formatter.type === 'files'"
|
|
328
|
-
>
|
|
329
|
-
<span
|
|
330
|
-
v-if="isShowOverflowTooltip"
|
|
331
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
332
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
333
|
-
:style="{ width: cellWidth + 'px' }"
|
|
334
|
-
class="ellipsis cell--span"
|
|
335
|
-
>
|
|
336
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
337
|
-
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
338
|
-
</span>
|
|
339
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
340
|
-
</span>
|
|
341
|
-
<span
|
|
342
|
-
v-else
|
|
343
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
344
|
-
class="cell--span"
|
|
345
|
-
>
|
|
346
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
347
|
-
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
348
|
-
</span>
|
|
349
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
350
|
-
</span>
|
|
351
|
-
</span>
|
|
352
|
-
<!-- 超链接 -->
|
|
353
|
-
<el-link
|
|
354
|
-
v-else-if="
|
|
355
|
-
columnFormatter !== undefined &&
|
|
356
|
-
columnFormatter.type !== undefined &&
|
|
357
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
358
|
-
getMyHyperLinkSetting(scope.row).visible === true
|
|
359
|
-
"
|
|
360
|
-
type="primary"
|
|
361
|
-
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
362
|
-
>
|
|
363
|
-
<span
|
|
364
|
-
v-if="isShowOverflowTooltip"
|
|
365
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
366
|
-
:title="$escapeHtml(getMyHyperLinkSetting(scope.row).title)"
|
|
367
|
-
:style="{ width: cellWidth + 'px' }"
|
|
368
|
-
class="ellipsis cell--span"
|
|
369
|
-
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label)
|
|
370
|
-
}}<i
|
|
371
|
-
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
372
|
-
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
373
|
-
/></span>
|
|
374
|
-
<span
|
|
375
|
-
v-else
|
|
376
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
377
|
-
class="cell--span"
|
|
378
|
-
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label)
|
|
379
|
-
}}<i
|
|
380
|
-
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
381
|
-
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
382
|
-
/></span>
|
|
383
|
-
</el-link>
|
|
384
|
-
<!-- 富文本 -->
|
|
385
|
-
<span
|
|
386
|
-
v-else-if="
|
|
387
|
-
column.formatter && column.formatter.type === 'richEditor'
|
|
388
|
-
"
|
|
389
|
-
>
|
|
390
|
-
<el-tooltip
|
|
391
|
-
:content="$t('superGrid.show')"
|
|
392
|
-
class="item"
|
|
393
|
-
effect="dark"
|
|
394
|
-
placement="top"
|
|
395
|
-
>
|
|
396
|
-
<em
|
|
397
|
-
class="fa fa-info-circle annex-cell"
|
|
398
|
-
@click="showRichEditorContent(scope.row, column, getHeader())"
|
|
399
|
-
/>
|
|
400
|
-
</el-tooltip>
|
|
401
|
-
</span>
|
|
402
|
-
<span
|
|
403
|
-
v-else-if="column.formatter && column.formatter.type === 'icon'"
|
|
404
|
-
>
|
|
405
|
-
<i
|
|
406
|
-
v-if="getFormatIconSetting(formatConfig).position === 'pre'"
|
|
407
|
-
:class="getFormatIconSetting(formatConfig).icon"
|
|
408
|
-
/>
|
|
409
|
-
<span
|
|
410
|
-
v-if="formatConfig.displayTextJudge"
|
|
411
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
412
|
-
class="cell--span"
|
|
413
|
-
>{{ $escapeHtml(getFormatIconSetting(scope.row).label) }}
|
|
414
|
-
</span>
|
|
415
|
-
<i
|
|
416
|
-
v-if="getFormatIconSetting(formatConfig).position === 'suf'"
|
|
417
|
-
:class="getFormatIconSetting(formatConfig).icon"
|
|
418
|
-
/>
|
|
419
|
-
</span>
|
|
420
|
-
<span
|
|
421
|
-
v-else-if="isShowOverflowTooltip"
|
|
422
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
423
|
-
:title="getLabel(scope.row)"
|
|
424
|
-
:style="{ width: cellWidth + 'px' }"
|
|
425
|
-
style="white-space: pre"
|
|
426
|
-
class="ellipsis cell--span"
|
|
427
|
-
v-html="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
428
|
-
/>
|
|
429
|
-
<span
|
|
430
|
-
v-else
|
|
431
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
432
|
-
class="cell--span"
|
|
433
|
-
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
434
|
-
>
|
|
435
|
-
</span>
|
|
436
|
-
</span>
|
|
437
|
-
</template>
|
|
438
|
-
</el-table-column>
|
|
439
|
-
<view-image-dialog
|
|
440
|
-
v-if="showSingleImgFlag"
|
|
441
|
-
:file-list="fileList"
|
|
442
|
-
@close="showSingleImgFlag = false"
|
|
443
|
-
/>
|
|
444
|
-
<rich-editor-viewer
|
|
445
|
-
v-if="showRichEditorViewer"
|
|
446
|
-
ref="richEditorViewerRef"
|
|
447
|
-
@closeRichEditorContent="closeRichEditorContent"
|
|
448
|
-
/>
|
|
449
|
-
</template>
|
|
450
|
-
|
|
451
|
-
<script>
|
|
452
|
-
import {
|
|
453
|
-
CirclePlus as ElIconCirclePlusOutline,
|
|
454
|
-
ZoomIn as ElIconZoomIn,
|
|
455
|
-
} from '@element-plus/icons-vue'
|
|
456
|
-
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
457
|
-
import { getColumnValues, isRequiredEdit } from './utils'
|
|
458
|
-
import DynamicInput from './dynamic-input.vue'
|
|
459
|
-
import store from './store'
|
|
460
|
-
import { ArrowKeyAction, isHasEditOption, getFileList } from './utils'
|
|
461
|
-
import { doFormatWithValueSet } from './formatter'
|
|
462
|
-
import customFormatter from './custom-formatter'
|
|
463
|
-
import RowOperation from './row-operation.vue'
|
|
464
|
-
import apis from './apis'
|
|
465
|
-
import { mapGetters } from 'vuex'
|
|
466
|
-
import {
|
|
467
|
-
getEntityFieldValue,
|
|
468
|
-
getParentObjectUtil,
|
|
469
|
-
} from '../../../src/utils/util'
|
|
470
|
-
import ViewImageDialog from './view-image-dialog.vue'
|
|
471
|
-
import eventBus from './eventBus'
|
|
472
|
-
import { isDynamicDataSourceSource } from './utils'
|
|
473
|
-
import FsPreview from '../../fs-preview'
|
|
474
|
-
import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
475
|
-
export default {
|
|
476
|
-
components: {
|
|
477
|
-
DynamicInput,
|
|
478
|
-
RowOperation,
|
|
479
|
-
ViewImageDialog,
|
|
480
|
-
FsPreview,
|
|
481
|
-
RichEditorViewer,
|
|
482
|
-
ElIconCirclePlusOutline,
|
|
483
|
-
ElIconZoomIn,
|
|
484
|
-
},
|
|
485
|
-
name: 'NormalColumn',
|
|
486
|
-
props: {
|
|
487
|
-
column: {
|
|
488
|
-
type: Object,
|
|
489
|
-
default: null,
|
|
490
|
-
},
|
|
491
|
-
customFormat: {
|
|
492
|
-
type: Function,
|
|
493
|
-
default: null,
|
|
494
|
-
},
|
|
495
|
-
listCode: {
|
|
496
|
-
type: String,
|
|
497
|
-
default: null,
|
|
498
|
-
},
|
|
499
|
-
isSql: {
|
|
500
|
-
type: Boolean,
|
|
501
|
-
default: false,
|
|
502
|
-
},
|
|
503
|
-
newWidth: {
|
|
504
|
-
type: Number,
|
|
505
|
-
default: null,
|
|
506
|
-
},
|
|
507
|
-
dragColumnProp: {
|
|
508
|
-
type: String,
|
|
509
|
-
default: null,
|
|
510
|
-
},
|
|
511
|
-
tableName: {
|
|
512
|
-
type: String,
|
|
513
|
-
default: null,
|
|
514
|
-
},
|
|
515
|
-
pageCode: {
|
|
516
|
-
type: String,
|
|
517
|
-
default: null,
|
|
518
|
-
},
|
|
519
|
-
listName: {
|
|
520
|
-
type: String,
|
|
521
|
-
default: null,
|
|
522
|
-
},
|
|
523
|
-
currentPage: {
|
|
524
|
-
type: Number,
|
|
525
|
-
default: 1,
|
|
526
|
-
},
|
|
527
|
-
gridData: {
|
|
528
|
-
type: Array,
|
|
529
|
-
default: null,
|
|
530
|
-
},
|
|
531
|
-
pageGridData: {
|
|
532
|
-
type: Array,
|
|
533
|
-
default: null,
|
|
534
|
-
},
|
|
535
|
-
listToolbarFormData: {
|
|
536
|
-
type: Object,
|
|
537
|
-
default: null,
|
|
538
|
-
},
|
|
539
|
-
},
|
|
540
|
-
data() {
|
|
541
|
-
let parentFormData
|
|
542
|
-
const gridParams = store.get(this.listCode)
|
|
543
|
-
if (
|
|
544
|
-
gridParams.options.extraParam &&
|
|
545
|
-
gridParams.options.extraParam.entityMap
|
|
546
|
-
) {
|
|
547
|
-
parentFormData = gridParams.options.extraParam.entityMap
|
|
548
|
-
}
|
|
549
|
-
return {
|
|
550
|
-
selectRow: null,
|
|
551
|
-
that: this,
|
|
552
|
-
align: 'left', // 文本内容对齐
|
|
553
|
-
headerAlign: 'left', // 表头对齐方式
|
|
554
|
-
columnFormatter: this.column.formatter,
|
|
555
|
-
hyperLinks: {},
|
|
556
|
-
fileDownType: '',
|
|
557
|
-
isFormSubTable: false, // 是否是表单子表
|
|
558
|
-
subTableCanAdd: true, // 表单子表时是否有新增权限
|
|
559
|
-
isShowAdd: false, // 是否显示表头的新增按钮
|
|
560
|
-
cellWidth: null,
|
|
561
|
-
parentFormData,
|
|
562
|
-
fileMultiple: false, // 附件上传是否多选
|
|
563
|
-
showSingleImgFlag: false,
|
|
564
|
-
singleImgSrc: '',
|
|
565
|
-
fileList: [],
|
|
566
|
-
index: null,
|
|
567
|
-
isEditable: this.column.editable,
|
|
568
|
-
showRichEditorViewer: false,
|
|
569
|
-
formatConfig: {},
|
|
570
|
-
getFormData: gridParams.options.getFormData,
|
|
571
|
-
getTableGridData: gridParams.options.getGridData,
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
computed: {
|
|
575
|
-
filters() {
|
|
576
|
-
if (this.column.filterable) {
|
|
577
|
-
const gridParams = store.get(this.listCode)
|
|
578
|
-
const values = getColumnValues(gridParams.gridData, this.column.prop)
|
|
579
|
-
const filters = []
|
|
580
|
-
for (const value of values) {
|
|
581
|
-
filters.push({
|
|
582
|
-
text: value,
|
|
583
|
-
value,
|
|
584
|
-
})
|
|
585
|
-
}
|
|
586
|
-
return filters
|
|
587
|
-
} else {
|
|
588
|
-
return null
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
filterMethod() {
|
|
592
|
-
if (this.column.filterable) {
|
|
593
|
-
return this.filterHandler
|
|
594
|
-
} else {
|
|
595
|
-
return null
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
fixed() {
|
|
599
|
-
if (
|
|
600
|
-
(this.column.fixed && this.column.fixed === 'false') ||
|
|
601
|
-
this.column.fixed === undefined ||
|
|
602
|
-
this.column.fixed === ''
|
|
603
|
-
) {
|
|
604
|
-
return false
|
|
605
|
-
}
|
|
606
|
-
if (
|
|
607
|
-
this.column.prop === 'operation' &&
|
|
608
|
-
this.column.fixed &&
|
|
609
|
-
this.column.fixed === 'left'
|
|
610
|
-
) {
|
|
611
|
-
// 操作列居右固定
|
|
612
|
-
return 'right'
|
|
613
|
-
}
|
|
614
|
-
return this.column.fixed
|
|
615
|
-
},
|
|
616
|
-
sortable() {
|
|
617
|
-
const gridParams = store.get(this.listCode)
|
|
618
|
-
if (
|
|
619
|
-
gridParams &&
|
|
620
|
-
gridParams.options &&
|
|
621
|
-
gridParams.options.isFormSubTable &&
|
|
622
|
-
gridParams.options.showOperationButton
|
|
623
|
-
) {
|
|
624
|
-
return false
|
|
625
|
-
}
|
|
626
|
-
if (
|
|
627
|
-
this.column.sortable === 'false' ||
|
|
628
|
-
this.column.sortable === false ||
|
|
629
|
-
this.column.sortable === ''
|
|
630
|
-
) {
|
|
631
|
-
return false
|
|
632
|
-
} else if (
|
|
633
|
-
this.column.sortable === 'true' ||
|
|
634
|
-
this.column.sortable === true
|
|
635
|
-
) {
|
|
636
|
-
return 'custom'
|
|
637
|
-
}
|
|
638
|
-
if (this.column.sortable) {
|
|
639
|
-
return 'custom'
|
|
640
|
-
} else {
|
|
641
|
-
return false
|
|
642
|
-
}
|
|
643
|
-
},
|
|
644
|
-
lineEdit() {
|
|
645
|
-
let isLineEdit = false
|
|
646
|
-
if (this.listCode) {
|
|
647
|
-
const gridParams = store.get(this.listCode)
|
|
648
|
-
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
649
|
-
isLineEdit = gridParams.lineEdit
|
|
650
|
-
} else {
|
|
651
|
-
isLineEdit = false
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return isLineEdit
|
|
655
|
-
},
|
|
656
|
-
|
|
657
|
-
...mapGetters(['preventReclick']),
|
|
658
|
-
},
|
|
659
|
-
watch: {
|
|
660
|
-
isSql: {
|
|
661
|
-
deep: true,
|
|
662
|
-
|
|
663
|
-
handler(newValue, oldValue) {
|
|
664
|
-
this.isSql = newValue
|
|
665
|
-
},
|
|
666
|
-
},
|
|
667
|
-
newWidth: {
|
|
668
|
-
deep: true,
|
|
669
|
-
|
|
670
|
-
handler(newValue, oldValue) {
|
|
671
|
-
if (
|
|
672
|
-
newValue !== undefined &&
|
|
673
|
-
newValue !== null &&
|
|
674
|
-
this.dragColumnProp &&
|
|
675
|
-
this.dragColumnProp === this.column.prop
|
|
676
|
-
) {
|
|
677
|
-
this.cellWidth = newValue
|
|
678
|
-
}
|
|
679
|
-
},
|
|
680
|
-
},
|
|
681
|
-
},
|
|
682
|
-
created() {
|
|
683
|
-
if (this.column.width) {
|
|
684
|
-
this.cellWidth = this.column.width - 10
|
|
685
|
-
}
|
|
686
|
-
const gridParams = store.get(this.listCode)
|
|
687
|
-
if (gridParams && gridParams.options && gridParams.options.isFormSubTable) {
|
|
688
|
-
this.isFormSubTable = gridParams.options.isFormSubTable
|
|
689
|
-
}
|
|
690
|
-
if (
|
|
691
|
-
gridParams &&
|
|
692
|
-
gridParams.options &&
|
|
693
|
-
gridParams.options.subTableCanAdd !== undefined &&
|
|
694
|
-
gridParams.options.subTableCanAdd !== null
|
|
695
|
-
) {
|
|
696
|
-
this.subTableCanAdd = gridParams.options.subTableCanAdd
|
|
697
|
-
}
|
|
698
|
-
if (this.column.prop && this.column.prop === 'operation') {
|
|
699
|
-
// 如果是操作列按钮则不显示省略号
|
|
700
|
-
this.isShowOverflowTooltip = false
|
|
701
|
-
} else {
|
|
702
|
-
if (
|
|
703
|
-
typeof gridParams.options.showOverflowTooltip !== 'undefined' &&
|
|
704
|
-
gridParams.options.showOverflowTooltip === false
|
|
705
|
-
) {
|
|
706
|
-
this.isShowOverflowTooltip = false
|
|
707
|
-
} else {
|
|
708
|
-
this.isShowOverflowTooltip = true
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
if (typeof gridParams.options.align !== 'undefined') {
|
|
712
|
-
this.align = gridParams.options.align
|
|
713
|
-
} else if (this.column.contAlign && this.column.contAlign !== '') {
|
|
714
|
-
this.align = this.column.contAlign
|
|
715
|
-
}
|
|
716
|
-
if (typeof gridParams.options.headerAlign !== 'undefined') {
|
|
717
|
-
this.headerAlign = gridParams.options.headerAlign
|
|
718
|
-
} else if (this.column.titleAlign && this.column.titleAlign !== '') {
|
|
719
|
-
this.headerAlign = this.column.titleAlign
|
|
720
|
-
} else {
|
|
721
|
-
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
722
|
-
this.headerAlign = 'left'
|
|
723
|
-
}
|
|
724
|
-
if (
|
|
725
|
-
gridParams.isHasDynamic === undefined &&
|
|
726
|
-
this.column.dynamic !== undefined &&
|
|
727
|
-
this.column.dynamic === true
|
|
728
|
-
) {
|
|
729
|
-
// 当前列表中有动态列
|
|
730
|
-
gridParams.isHasDynamic = true
|
|
731
|
-
}
|
|
732
|
-
this.label = this.getHeader()
|
|
733
|
-
if (this.column.operations) {
|
|
734
|
-
// console.log('this.column.operations', this.column.operations)
|
|
735
|
-
}
|
|
736
|
-
// console.log('gridParams.options.subTableCanAdd=', gridParams.options.subTableCanAdd, 'this.subTableCanAdd=', this.subTableCanAdd)
|
|
737
|
-
this.isShowAdd =
|
|
738
|
-
this.isFormSubTable &&
|
|
739
|
-
this.column.prop === 'operation' &&
|
|
740
|
-
this.subTableCanAdd &&
|
|
741
|
-
gridParams.options &&
|
|
742
|
-
gridParams.options.showOperationButton
|
|
743
|
-
if (
|
|
744
|
-
this.column.fileSet &&
|
|
745
|
-
this.column.fileSet !== '' &&
|
|
746
|
-
this.column.componentType === 'annex'
|
|
747
|
-
) {
|
|
748
|
-
const fileSetObj = JSON.parse(this.column.fileSet)
|
|
749
|
-
if (fileSetObj && fileSetObj.multiple) {
|
|
750
|
-
this.fileMultiple = true
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
if (
|
|
754
|
-
this.column.formatter &&
|
|
755
|
-
this.column.formatter.options &&
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
//
|
|
816
|
-
//
|
|
817
|
-
//
|
|
818
|
-
//
|
|
819
|
-
param.row
|
|
820
|
-
|
|
821
|
-
//
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
//
|
|
825
|
-
//
|
|
826
|
-
//
|
|
827
|
-
//
|
|
828
|
-
//
|
|
829
|
-
//
|
|
830
|
-
//
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
},
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
},
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
},
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
// @keyup.native.
|
|
948
|
-
move(
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
//
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
//
|
|
995
|
-
//
|
|
996
|
-
//
|
|
997
|
-
//
|
|
998
|
-
//
|
|
999
|
-
//
|
|
1000
|
-
//
|
|
1001
|
-
|
|
1002
|
-
//
|
|
1003
|
-
//
|
|
1004
|
-
|
|
1005
|
-
//
|
|
1006
|
-
//
|
|
1007
|
-
//
|
|
1008
|
-
//
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
hyperLinkResult
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
comman.
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
},
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
},
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
this.
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
'
|
|
1201
|
-
'
|
|
1202
|
-
,
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<el-table-column
|
|
3
|
+
:fixed="fixed"
|
|
4
|
+
:sortable="sortable"
|
|
5
|
+
:filters="filters"
|
|
6
|
+
:filter-method="filterMethod"
|
|
7
|
+
:prop="column.prop"
|
|
8
|
+
:width="getColumnWidth()"
|
|
9
|
+
:align="align"
|
|
10
|
+
:header-align="headerAlign"
|
|
11
|
+
:class-name="column.prop"
|
|
12
|
+
>
|
|
13
|
+
<template v-slot:header>
|
|
14
|
+
<span :class="{ is_req: isFieldRequired() }"
|
|
15
|
+
><span
|
|
16
|
+
class="cell--span required__label"
|
|
17
|
+
:title="$escapeHtml(label)"
|
|
18
|
+
v-html="$escapeHtml(label)"
|
|
19
|
+
/></span>
|
|
20
|
+
<el-icon v-if="isShowAdd" @click="createFormSubTableRow" style="font-size: 20px; color: #409eff"><CirclePlus /></el-icon>
|
|
21
|
+
</template>
|
|
22
|
+
<template v-slot="scope">
|
|
23
|
+
<!--添加:key="column.prop+'_'+scope.$index"是为了解决多行是行编辑状态时新建的记录的文本框内有值的问题-->
|
|
24
|
+
<dynamic-input
|
|
25
|
+
v-if="lineEdit.editable && isEditable && scope.row.$editing"
|
|
26
|
+
v-model:value="scope.row[column.prop]"
|
|
27
|
+
:type="column.componentType"
|
|
28
|
+
:position="{
|
|
29
|
+
row: scope.$index,
|
|
30
|
+
prop: column.prop,
|
|
31
|
+
}"
|
|
32
|
+
:list-toolbar-form-data="listToolbarFormData"
|
|
33
|
+
:line-edit="lineEdit"
|
|
34
|
+
:options="column.valueSet"
|
|
35
|
+
:row="scope.row"
|
|
36
|
+
:column="column"
|
|
37
|
+
:list-code="listCode"
|
|
38
|
+
:is-sql="isSql"
|
|
39
|
+
:row-index="scope.$index"
|
|
40
|
+
:class="isRequired(scope.row.$editing) ? 'm-requried' : ''"
|
|
41
|
+
@findIndex="findIndex(scope.$index)"
|
|
42
|
+
@focus="onFocus(scope.$index)"
|
|
43
|
+
@refresData="refresData"
|
|
44
|
+
@refresPortData="refresPortData"
|
|
45
|
+
@refresPortsData="refresPortsData"
|
|
46
|
+
@refresMainTableFields="refresMainTableFields"
|
|
47
|
+
@prohibitToEdit="prohibitToEdit"
|
|
48
|
+
/>
|
|
49
|
+
<span v-else>
|
|
50
|
+
<span v-if="column.operations" class="grid-operation-buttons">
|
|
51
|
+
<span
|
|
52
|
+
v-for="(operation, operationIndex) in column.operations"
|
|
53
|
+
:key="operationIndex"
|
|
54
|
+
class="cell--span"
|
|
55
|
+
>
|
|
56
|
+
<el-dropdown
|
|
57
|
+
v-if="operation.isGroup"
|
|
58
|
+
:size="
|
|
59
|
+
operation.buttons && operation.buttons.length > 0
|
|
60
|
+
? operation.buttons[0].props.size
|
|
61
|
+
: 'small'
|
|
62
|
+
"
|
|
63
|
+
style="padding-left: 10px"
|
|
64
|
+
split-button
|
|
65
|
+
@command="handleCommand"
|
|
66
|
+
>
|
|
67
|
+
{{ $escapeHtml(operation.label) }}
|
|
68
|
+
<template v-slot:dropdown>
|
|
69
|
+
<el-dropdown-menu>
|
|
70
|
+
<span
|
|
71
|
+
v-for="(buttonChild, buttonChildIndex) in operation.buttons"
|
|
72
|
+
:key="buttonChild.props.code + buttonChildIndex"
|
|
73
|
+
>
|
|
74
|
+
<el-dropdown-item
|
|
75
|
+
v-permission="buttonChild.props.permission"
|
|
76
|
+
:command="
|
|
77
|
+
beforeHandleCommand(
|
|
78
|
+
buttonChild.props.code,
|
|
79
|
+
scope.row,
|
|
80
|
+
scope.$index
|
|
81
|
+
)
|
|
82
|
+
"
|
|
83
|
+
:disabled="preventReclick"
|
|
84
|
+
>
|
|
85
|
+
{{
|
|
86
|
+
$escapeHtml(
|
|
87
|
+
buttonChild.props.label
|
|
88
|
+
? buttonChild.props.label
|
|
89
|
+
: buttonChild.props.code === 'search'
|
|
90
|
+
? $t('superPageMessage.searchButtonLabel')
|
|
91
|
+
: ''
|
|
92
|
+
)
|
|
93
|
+
}}
|
|
94
|
+
</el-dropdown-item>
|
|
95
|
+
</span>
|
|
96
|
+
</el-dropdown-menu>
|
|
97
|
+
</template>
|
|
98
|
+
</el-dropdown>
|
|
99
|
+
<row-operation
|
|
100
|
+
v-else
|
|
101
|
+
:operation-setting="operation.props"
|
|
102
|
+
:label="
|
|
103
|
+
operation.props.label
|
|
104
|
+
? operation.props.label
|
|
105
|
+
: scope.row[column.prop]
|
|
106
|
+
"
|
|
107
|
+
:operation-index="operationIndex"
|
|
108
|
+
:entity="scope.row"
|
|
109
|
+
:editing="scope.row.$editing"
|
|
110
|
+
:column="column"
|
|
111
|
+
:row-index="scope.$index"
|
|
112
|
+
:is-show="operation.isShow"
|
|
113
|
+
:on-click="operation.onClick"
|
|
114
|
+
/>
|
|
115
|
+
</span>
|
|
116
|
+
</span>
|
|
117
|
+
<span
|
|
118
|
+
v-else-if="
|
|
119
|
+
customFormatValue(
|
|
120
|
+
scope.row,
|
|
121
|
+
column.prop,
|
|
122
|
+
customFormat,
|
|
123
|
+
scope.$index
|
|
124
|
+
)
|
|
125
|
+
"
|
|
126
|
+
class="cell--span"
|
|
127
|
+
>
|
|
128
|
+
<component
|
|
129
|
+
:is="column.prop + scope.$index"
|
|
130
|
+
:row="scope.row"
|
|
131
|
+
:entity="scope.row"
|
|
132
|
+
:prop="column.prop"
|
|
133
|
+
:parent="parentFormData"
|
|
134
|
+
:row-index="scope.$index"
|
|
135
|
+
:show-value="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
136
|
+
:value="getCellValue(scope.row)"
|
|
137
|
+
:select-options="column.valueSet"
|
|
138
|
+
/>
|
|
139
|
+
</span>
|
|
140
|
+
<!-- 自定义格式的时候 -->
|
|
141
|
+
<span
|
|
142
|
+
v-else-if="
|
|
143
|
+
columnFormatter !== undefined &&
|
|
144
|
+
columnFormatter.type !== undefined &&
|
|
145
|
+
columnFormatter.type === 'customControl' &&
|
|
146
|
+
columnFormatter.options &&
|
|
147
|
+
columnFormatter.options.format &&
|
|
148
|
+
columnFormatter.options.format !== ''
|
|
149
|
+
"
|
|
150
|
+
class="cell--span"
|
|
151
|
+
>
|
|
152
|
+
<!--:key="column.prop+'_'+scope.$index+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
|
|
153
|
+
<component
|
|
154
|
+
:is="columnFormatter.options.format"
|
|
155
|
+
:key="column.prop + '_' + scope.$index + '_' + currentPage"
|
|
156
|
+
:disabled="true"
|
|
157
|
+
:row="pageGridData[scope.$index]"
|
|
158
|
+
:entity="pageGridData[scope.$index]"
|
|
159
|
+
:prop="column.prop"
|
|
160
|
+
:parent="parentFormData"
|
|
161
|
+
:row-index="scope.$index"
|
|
162
|
+
:get-form-data="getFormData"
|
|
163
|
+
:get-grid-data="getTableGridData"
|
|
164
|
+
:show-value="
|
|
165
|
+
$escapeHtml(getLabel(pageGridData[scope.$index], scope.$index))
|
|
166
|
+
"
|
|
167
|
+
:value="getCellValue(pageGridData[scope.$index])"
|
|
168
|
+
:select-options="column.valueSet"
|
|
169
|
+
:grid-data="gridData"
|
|
170
|
+
:page-grid-data="pageGridData"
|
|
171
|
+
:current-page="currentPage"
|
|
172
|
+
/></span>
|
|
173
|
+
<span
|
|
174
|
+
v-else-if="
|
|
175
|
+
columnFormatter !== undefined &&
|
|
176
|
+
columnFormatter.type !== undefined &&
|
|
177
|
+
columnFormatter.type === 'secretInfo'
|
|
178
|
+
"
|
|
179
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
180
|
+
class="cell--span"
|
|
181
|
+
>
|
|
182
|
+
<secret-info
|
|
183
|
+
:entity="scope.row"
|
|
184
|
+
:prop="column.prop"
|
|
185
|
+
:value="getCellValue(scope.row)"
|
|
186
|
+
:table-name="tableName"
|
|
187
|
+
:list-code="listCode"
|
|
188
|
+
:page-code="pageCode"
|
|
189
|
+
:list-name="listName"
|
|
190
|
+
:field-label="$escapeHtml(label)"
|
|
191
|
+
/>
|
|
192
|
+
</span>
|
|
193
|
+
<span v-else-if="isObjectProp(column.prop)">
|
|
194
|
+
<span v-if="column.componentType === 'annex'" type="primary">
|
|
195
|
+
<span
|
|
196
|
+
v-if="isShowOverflowTooltip"
|
|
197
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
198
|
+
:title="$escapeHtml(getLabel(scope.row))"
|
|
199
|
+
:style="{ width: cellWidth + 'px' }"
|
|
200
|
+
class="ellipsis cell--span"
|
|
201
|
+
>
|
|
202
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
203
|
+
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
204
|
+
</span>
|
|
205
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
206
|
+
</span>
|
|
207
|
+
<span
|
|
208
|
+
v-else
|
|
209
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
210
|
+
class="cell--span"
|
|
211
|
+
>
|
|
212
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
213
|
+
<el-icon class="annex-cell" @click="previewImg(scope.row)"><el-icon-zoom-in /></el-icon>
|
|
214
|
+
</span>
|
|
215
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
216
|
+
</span>
|
|
217
|
+
</span>
|
|
218
|
+
<span
|
|
219
|
+
v-else-if="column.formatter && column.formatter.type === 'files'"
|
|
220
|
+
type="primary"
|
|
221
|
+
>
|
|
222
|
+
<span
|
|
223
|
+
v-if="isShowOverflowTooltip"
|
|
224
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
225
|
+
:title="$escapeHtml(getLabel(scope.row))"
|
|
226
|
+
:style="{ width: cellWidth + 'px' }"
|
|
227
|
+
class="ellipsis cell--span"
|
|
228
|
+
>
|
|
229
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
230
|
+
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
231
|
+
</span>
|
|
232
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
233
|
+
</span>
|
|
234
|
+
<span
|
|
235
|
+
v-else
|
|
236
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
237
|
+
class="cell--span"
|
|
238
|
+
>
|
|
239
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
240
|
+
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
241
|
+
</span>
|
|
242
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
243
|
+
</span>
|
|
244
|
+
</span>
|
|
245
|
+
<el-link
|
|
246
|
+
v-else-if="
|
|
247
|
+
columnFormatter !== undefined &&
|
|
248
|
+
columnFormatter.type !== undefined &&
|
|
249
|
+
columnFormatter.type === 'hyperlinks' &&
|
|
250
|
+
getMyHyperLinkSetting(scope.row).visible === true
|
|
251
|
+
"
|
|
252
|
+
type="primary"
|
|
253
|
+
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
254
|
+
>
|
|
255
|
+
<span
|
|
256
|
+
v-if="isShowOverflowTooltip"
|
|
257
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
258
|
+
:title="getMyHyperLinkSetting(scope.row).title"
|
|
259
|
+
:style="{ width: cellWidth + 'px' }"
|
|
260
|
+
class="ellipsis cell--span"
|
|
261
|
+
>{{ getMyHyperLinkSetting(scope.row).label
|
|
262
|
+
}}<i
|
|
263
|
+
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
264
|
+
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
265
|
+
/></span>
|
|
266
|
+
<span
|
|
267
|
+
v-else
|
|
268
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
269
|
+
class="cell--span"
|
|
270
|
+
>{{ getMyHyperLinkSetting(scope.row).label
|
|
271
|
+
}}<i
|
|
272
|
+
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
273
|
+
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
274
|
+
/></span>
|
|
275
|
+
</el-link>
|
|
276
|
+
<span
|
|
277
|
+
v-else-if="isShowOverflowTooltip"
|
|
278
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
279
|
+
:title="$escapeHtml(getLabel(scope.row))"
|
|
280
|
+
:style="{ width: cellWidth + 'px' }"
|
|
281
|
+
class="ellipsis cell--span"
|
|
282
|
+
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
283
|
+
>
|
|
284
|
+
<span
|
|
285
|
+
v-else
|
|
286
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
287
|
+
class="cell--span"
|
|
288
|
+
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
289
|
+
>
|
|
290
|
+
</span>
|
|
291
|
+
<span v-else>
|
|
292
|
+
<span
|
|
293
|
+
v-if="
|
|
294
|
+
column.componentType === 'annex' ||
|
|
295
|
+
column.componentType === 'multipartUpload'
|
|
296
|
+
"
|
|
297
|
+
type="primary"
|
|
298
|
+
>
|
|
299
|
+
<span
|
|
300
|
+
v-if="isShowOverflowTooltip"
|
|
301
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
302
|
+
:title="$escapeHtml(getLabel(scope.row))"
|
|
303
|
+
:style="{ width: cellWidth + 'px' }"
|
|
304
|
+
class="ellipsis cell--span"
|
|
305
|
+
>
|
|
306
|
+
<FsPreview
|
|
307
|
+
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
308
|
+
:entity="scope.row"
|
|
309
|
+
:file-set-obj="JSON.parse(column.fileSet)"
|
|
310
|
+
:is-sql="isSql"
|
|
311
|
+
/>
|
|
312
|
+
</span>
|
|
313
|
+
<span
|
|
314
|
+
v-else
|
|
315
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
316
|
+
class="cell--span"
|
|
317
|
+
>
|
|
318
|
+
<FsPreview
|
|
319
|
+
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
320
|
+
:entity="scope.row"
|
|
321
|
+
:file-set-obj="JSON.parse(column.fileSet)"
|
|
322
|
+
:is-sql="isSql"
|
|
323
|
+
/>
|
|
324
|
+
</span>
|
|
325
|
+
</span>
|
|
326
|
+
<span
|
|
327
|
+
v-else-if="column.formatter && column.formatter.type === 'files'"
|
|
328
|
+
>
|
|
329
|
+
<span
|
|
330
|
+
v-if="isShowOverflowTooltip"
|
|
331
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
332
|
+
:title="$escapeHtml(getLabel(scope.row))"
|
|
333
|
+
:style="{ width: cellWidth + 'px' }"
|
|
334
|
+
class="ellipsis cell--span"
|
|
335
|
+
>
|
|
336
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
337
|
+
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
338
|
+
</span>
|
|
339
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
340
|
+
</span>
|
|
341
|
+
<span
|
|
342
|
+
v-else
|
|
343
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
344
|
+
class="cell--span"
|
|
345
|
+
>
|
|
346
|
+
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
347
|
+
<el-icon @click="previewImg(scope.row)" class="annex-cell"><el-icon-zoom-in /></el-icon>
|
|
348
|
+
</span>
|
|
349
|
+
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
350
|
+
</span>
|
|
351
|
+
</span>
|
|
352
|
+
<!-- 超链接 -->
|
|
353
|
+
<el-link
|
|
354
|
+
v-else-if="
|
|
355
|
+
columnFormatter !== undefined &&
|
|
356
|
+
columnFormatter.type !== undefined &&
|
|
357
|
+
columnFormatter.type === 'hyperlinks' &&
|
|
358
|
+
getMyHyperLinkSetting(scope.row).visible === true
|
|
359
|
+
"
|
|
360
|
+
type="primary"
|
|
361
|
+
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
362
|
+
>
|
|
363
|
+
<span
|
|
364
|
+
v-if="isShowOverflowTooltip"
|
|
365
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
366
|
+
:title="$escapeHtml(getMyHyperLinkSetting(scope.row).title)"
|
|
367
|
+
:style="{ width: cellWidth + 'px' }"
|
|
368
|
+
class="ellipsis cell--span"
|
|
369
|
+
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label)
|
|
370
|
+
}}<i
|
|
371
|
+
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
372
|
+
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
373
|
+
/></span>
|
|
374
|
+
<span
|
|
375
|
+
v-else
|
|
376
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
377
|
+
class="cell--span"
|
|
378
|
+
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label)
|
|
379
|
+
}}<i
|
|
380
|
+
v-if="getMyHyperLinkSetting(scope.row).icon"
|
|
381
|
+
:class="getMyHyperLinkSetting(scope.row).icon"
|
|
382
|
+
/></span>
|
|
383
|
+
</el-link>
|
|
384
|
+
<!-- 富文本 -->
|
|
385
|
+
<span
|
|
386
|
+
v-else-if="
|
|
387
|
+
column.formatter && column.formatter.type === 'richEditor'
|
|
388
|
+
"
|
|
389
|
+
>
|
|
390
|
+
<el-tooltip
|
|
391
|
+
:content="$t('superGrid.show')"
|
|
392
|
+
class="item"
|
|
393
|
+
effect="dark"
|
|
394
|
+
placement="top"
|
|
395
|
+
>
|
|
396
|
+
<em
|
|
397
|
+
class="fa fa-info-circle annex-cell"
|
|
398
|
+
@click="showRichEditorContent(scope.row, column, getHeader())"
|
|
399
|
+
/>
|
|
400
|
+
</el-tooltip>
|
|
401
|
+
</span>
|
|
402
|
+
<span
|
|
403
|
+
v-else-if="column.formatter && column.formatter.type === 'icon'"
|
|
404
|
+
>
|
|
405
|
+
<i
|
|
406
|
+
v-if="getFormatIconSetting(formatConfig).position === 'pre'"
|
|
407
|
+
:class="getFormatIconSetting(formatConfig).icon"
|
|
408
|
+
/>
|
|
409
|
+
<span
|
|
410
|
+
v-if="formatConfig.displayTextJudge"
|
|
411
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
412
|
+
class="cell--span"
|
|
413
|
+
>{{ $escapeHtml(getFormatIconSetting(scope.row).label) }}
|
|
414
|
+
</span>
|
|
415
|
+
<i
|
|
416
|
+
v-if="getFormatIconSetting(formatConfig).position === 'suf'"
|
|
417
|
+
:class="getFormatIconSetting(formatConfig).icon"
|
|
418
|
+
/>
|
|
419
|
+
</span>
|
|
420
|
+
<span
|
|
421
|
+
v-else-if="isShowOverflowTooltip"
|
|
422
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
423
|
+
:title="getLabel(scope.row)"
|
|
424
|
+
:style="{ width: cellWidth + 'px' }"
|
|
425
|
+
style="white-space: pre"
|
|
426
|
+
class="ellipsis cell--span"
|
|
427
|
+
v-html="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
428
|
+
/>
|
|
429
|
+
<span
|
|
430
|
+
v-else
|
|
431
|
+
:id="column.prop + 'DomData' + scope.$index"
|
|
432
|
+
class="cell--span"
|
|
433
|
+
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
434
|
+
>
|
|
435
|
+
</span>
|
|
436
|
+
</span>
|
|
437
|
+
</template>
|
|
438
|
+
</el-table-column>
|
|
439
|
+
<view-image-dialog
|
|
440
|
+
v-if="showSingleImgFlag"
|
|
441
|
+
:file-list="fileList"
|
|
442
|
+
@close="showSingleImgFlag = false"
|
|
443
|
+
/>
|
|
444
|
+
<rich-editor-viewer
|
|
445
|
+
v-if="showRichEditorViewer"
|
|
446
|
+
ref="richEditorViewerRef"
|
|
447
|
+
@closeRichEditorContent="closeRichEditorContent"
|
|
448
|
+
/>
|
|
449
|
+
</template>
|
|
450
|
+
|
|
451
|
+
<script>
|
|
452
|
+
import {
|
|
453
|
+
CirclePlus as ElIconCirclePlusOutline,
|
|
454
|
+
ZoomIn as ElIconZoomIn,
|
|
455
|
+
} from '@element-plus/icons-vue'
|
|
456
|
+
import { $on, $off, $once, $emit } from '../../utils/gogocodeTransfer'
|
|
457
|
+
import { getColumnValues, isRequiredEdit } from './utils'
|
|
458
|
+
import DynamicInput from './dynamic-input.vue'
|
|
459
|
+
import store from './store'
|
|
460
|
+
import { ArrowKeyAction, isHasEditOption, getFileList } from './utils'
|
|
461
|
+
import { doFormatWithValueSet } from './formatter'
|
|
462
|
+
import customFormatter from './custom-formatter'
|
|
463
|
+
import RowOperation from './row-operation.vue'
|
|
464
|
+
import apis from './apis'
|
|
465
|
+
import { mapGetters } from 'vuex'
|
|
466
|
+
import {
|
|
467
|
+
getEntityFieldValue,
|
|
468
|
+
getParentObjectUtil,
|
|
469
|
+
} from '../../../src/utils/util'
|
|
470
|
+
import ViewImageDialog from './view-image-dialog.vue'
|
|
471
|
+
import eventBus from './eventBus'
|
|
472
|
+
import { isDynamicDataSourceSource } from './utils'
|
|
473
|
+
import FsPreview from '../../fs-preview'
|
|
474
|
+
import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
475
|
+
export default {
|
|
476
|
+
components: {
|
|
477
|
+
DynamicInput,
|
|
478
|
+
RowOperation,
|
|
479
|
+
ViewImageDialog,
|
|
480
|
+
FsPreview,
|
|
481
|
+
RichEditorViewer,
|
|
482
|
+
ElIconCirclePlusOutline,
|
|
483
|
+
ElIconZoomIn,
|
|
484
|
+
},
|
|
485
|
+
name: 'NormalColumn',
|
|
486
|
+
props: {
|
|
487
|
+
column: {
|
|
488
|
+
type: Object,
|
|
489
|
+
default: null,
|
|
490
|
+
},
|
|
491
|
+
customFormat: {
|
|
492
|
+
type: Function,
|
|
493
|
+
default: null,
|
|
494
|
+
},
|
|
495
|
+
listCode: {
|
|
496
|
+
type: String,
|
|
497
|
+
default: null,
|
|
498
|
+
},
|
|
499
|
+
isSql: {
|
|
500
|
+
type: Boolean,
|
|
501
|
+
default: false,
|
|
502
|
+
},
|
|
503
|
+
newWidth: {
|
|
504
|
+
type: Number,
|
|
505
|
+
default: null,
|
|
506
|
+
},
|
|
507
|
+
dragColumnProp: {
|
|
508
|
+
type: String,
|
|
509
|
+
default: null,
|
|
510
|
+
},
|
|
511
|
+
tableName: {
|
|
512
|
+
type: String,
|
|
513
|
+
default: null,
|
|
514
|
+
},
|
|
515
|
+
pageCode: {
|
|
516
|
+
type: String,
|
|
517
|
+
default: null,
|
|
518
|
+
},
|
|
519
|
+
listName: {
|
|
520
|
+
type: String,
|
|
521
|
+
default: null,
|
|
522
|
+
},
|
|
523
|
+
currentPage: {
|
|
524
|
+
type: Number,
|
|
525
|
+
default: 1,
|
|
526
|
+
},
|
|
527
|
+
gridData: {
|
|
528
|
+
type: Array,
|
|
529
|
+
default: null,
|
|
530
|
+
},
|
|
531
|
+
pageGridData: {
|
|
532
|
+
type: Array,
|
|
533
|
+
default: null,
|
|
534
|
+
},
|
|
535
|
+
listToolbarFormData: {
|
|
536
|
+
type: Object,
|
|
537
|
+
default: null,
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
data() {
|
|
541
|
+
let parentFormData
|
|
542
|
+
const gridParams = store.get(this.listCode)
|
|
543
|
+
if (
|
|
544
|
+
gridParams.options.extraParam &&
|
|
545
|
+
gridParams.options.extraParam.entityMap
|
|
546
|
+
) {
|
|
547
|
+
parentFormData = gridParams.options.extraParam.entityMap
|
|
548
|
+
}
|
|
549
|
+
return {
|
|
550
|
+
selectRow: null,
|
|
551
|
+
that: this,
|
|
552
|
+
align: 'left', // 文本内容对齐
|
|
553
|
+
headerAlign: 'left', // 表头对齐方式
|
|
554
|
+
columnFormatter: this.column.formatter,
|
|
555
|
+
hyperLinks: {},
|
|
556
|
+
fileDownType: '',
|
|
557
|
+
isFormSubTable: false, // 是否是表单子表
|
|
558
|
+
subTableCanAdd: true, // 表单子表时是否有新增权限
|
|
559
|
+
isShowAdd: false, // 是否显示表头的新增按钮
|
|
560
|
+
cellWidth: null,
|
|
561
|
+
parentFormData,
|
|
562
|
+
fileMultiple: false, // 附件上传是否多选
|
|
563
|
+
showSingleImgFlag: false,
|
|
564
|
+
singleImgSrc: '',
|
|
565
|
+
fileList: [],
|
|
566
|
+
index: null,
|
|
567
|
+
isEditable: this.column.editable,
|
|
568
|
+
showRichEditorViewer: false,
|
|
569
|
+
formatConfig: {},
|
|
570
|
+
getFormData: gridParams.options.getFormData,
|
|
571
|
+
getTableGridData: gridParams.options.getGridData,
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
computed: {
|
|
575
|
+
filters() {
|
|
576
|
+
if (this.column.filterable) {
|
|
577
|
+
const gridParams = store.get(this.listCode)
|
|
578
|
+
const values = getColumnValues(gridParams.gridData, this.column.prop)
|
|
579
|
+
const filters = []
|
|
580
|
+
for (const value of values) {
|
|
581
|
+
filters.push({
|
|
582
|
+
text: value,
|
|
583
|
+
value,
|
|
584
|
+
})
|
|
585
|
+
}
|
|
586
|
+
return filters
|
|
587
|
+
} else {
|
|
588
|
+
return null
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
filterMethod() {
|
|
592
|
+
if (this.column.filterable) {
|
|
593
|
+
return this.filterHandler
|
|
594
|
+
} else {
|
|
595
|
+
return null
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
fixed() {
|
|
599
|
+
if (
|
|
600
|
+
(this.column.fixed && this.column.fixed === 'false') ||
|
|
601
|
+
this.column.fixed === undefined ||
|
|
602
|
+
this.column.fixed === ''
|
|
603
|
+
) {
|
|
604
|
+
return false
|
|
605
|
+
}
|
|
606
|
+
if (
|
|
607
|
+
this.column.prop === 'operation' &&
|
|
608
|
+
this.column.fixed &&
|
|
609
|
+
this.column.fixed === 'left'
|
|
610
|
+
) {
|
|
611
|
+
// 操作列居右固定
|
|
612
|
+
return 'right'
|
|
613
|
+
}
|
|
614
|
+
return this.column.fixed
|
|
615
|
+
},
|
|
616
|
+
sortable() {
|
|
617
|
+
const gridParams = store.get(this.listCode)
|
|
618
|
+
if (
|
|
619
|
+
gridParams &&
|
|
620
|
+
gridParams.options &&
|
|
621
|
+
gridParams.options.isFormSubTable &&
|
|
622
|
+
gridParams.options.showOperationButton
|
|
623
|
+
) {
|
|
624
|
+
return false
|
|
625
|
+
}
|
|
626
|
+
if (
|
|
627
|
+
this.column.sortable === 'false' ||
|
|
628
|
+
this.column.sortable === false ||
|
|
629
|
+
this.column.sortable === ''
|
|
630
|
+
) {
|
|
631
|
+
return false
|
|
632
|
+
} else if (
|
|
633
|
+
this.column.sortable === 'true' ||
|
|
634
|
+
this.column.sortable === true
|
|
635
|
+
) {
|
|
636
|
+
return 'custom'
|
|
637
|
+
}
|
|
638
|
+
if (this.column.sortable) {
|
|
639
|
+
return 'custom'
|
|
640
|
+
} else {
|
|
641
|
+
return false
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
lineEdit() {
|
|
645
|
+
let isLineEdit = false
|
|
646
|
+
if (this.listCode) {
|
|
647
|
+
const gridParams = store.get(this.listCode)
|
|
648
|
+
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
649
|
+
isLineEdit = gridParams.lineEdit
|
|
650
|
+
} else {
|
|
651
|
+
isLineEdit = false
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return isLineEdit
|
|
655
|
+
},
|
|
656
|
+
|
|
657
|
+
...mapGetters(['preventReclick']),
|
|
658
|
+
},
|
|
659
|
+
watch: {
|
|
660
|
+
isSql: {
|
|
661
|
+
deep: true,
|
|
662
|
+
|
|
663
|
+
handler(newValue, oldValue) {
|
|
664
|
+
this.isSql = newValue
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
newWidth: {
|
|
668
|
+
deep: true,
|
|
669
|
+
|
|
670
|
+
handler(newValue, oldValue) {
|
|
671
|
+
if (
|
|
672
|
+
newValue !== undefined &&
|
|
673
|
+
newValue !== null &&
|
|
674
|
+
this.dragColumnProp &&
|
|
675
|
+
this.dragColumnProp === this.column.prop
|
|
676
|
+
) {
|
|
677
|
+
this.cellWidth = newValue
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
},
|
|
681
|
+
},
|
|
682
|
+
created() {
|
|
683
|
+
if (this.column.width) {
|
|
684
|
+
this.cellWidth = this.column.width - 10
|
|
685
|
+
}
|
|
686
|
+
const gridParams = store.get(this.listCode)
|
|
687
|
+
if (gridParams && gridParams.options && gridParams.options.isFormSubTable) {
|
|
688
|
+
this.isFormSubTable = gridParams.options.isFormSubTable
|
|
689
|
+
}
|
|
690
|
+
if (
|
|
691
|
+
gridParams &&
|
|
692
|
+
gridParams.options &&
|
|
693
|
+
gridParams.options.subTableCanAdd !== undefined &&
|
|
694
|
+
gridParams.options.subTableCanAdd !== null
|
|
695
|
+
) {
|
|
696
|
+
this.subTableCanAdd = gridParams.options.subTableCanAdd
|
|
697
|
+
}
|
|
698
|
+
if (this.column.prop && this.column.prop === 'operation') {
|
|
699
|
+
// 如果是操作列按钮则不显示省略号
|
|
700
|
+
this.isShowOverflowTooltip = false
|
|
701
|
+
} else {
|
|
702
|
+
if (
|
|
703
|
+
typeof gridParams.options.showOverflowTooltip !== 'undefined' &&
|
|
704
|
+
gridParams.options.showOverflowTooltip === false
|
|
705
|
+
) {
|
|
706
|
+
this.isShowOverflowTooltip = false
|
|
707
|
+
} else {
|
|
708
|
+
this.isShowOverflowTooltip = true
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (typeof gridParams.options.align !== 'undefined') {
|
|
712
|
+
this.align = gridParams.options.align
|
|
713
|
+
} else if (this.column.contAlign && this.column.contAlign !== '') {
|
|
714
|
+
this.align = this.column.contAlign
|
|
715
|
+
}
|
|
716
|
+
if (typeof gridParams.options.headerAlign !== 'undefined') {
|
|
717
|
+
this.headerAlign = gridParams.options.headerAlign
|
|
718
|
+
} else if (this.column.titleAlign && this.column.titleAlign !== '') {
|
|
719
|
+
this.headerAlign = this.column.titleAlign
|
|
720
|
+
} else {
|
|
721
|
+
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
722
|
+
this.headerAlign = 'left'
|
|
723
|
+
}
|
|
724
|
+
if (
|
|
725
|
+
gridParams.isHasDynamic === undefined &&
|
|
726
|
+
this.column.dynamic !== undefined &&
|
|
727
|
+
this.column.dynamic === true
|
|
728
|
+
) {
|
|
729
|
+
// 当前列表中有动态列
|
|
730
|
+
gridParams.isHasDynamic = true
|
|
731
|
+
}
|
|
732
|
+
this.label = this.getHeader()
|
|
733
|
+
if (this.column.operations) {
|
|
734
|
+
// console.log('this.column.operations', this.column.operations)
|
|
735
|
+
}
|
|
736
|
+
// console.log('gridParams.options.subTableCanAdd=', gridParams.options.subTableCanAdd, 'this.subTableCanAdd=', this.subTableCanAdd)
|
|
737
|
+
this.isShowAdd =
|
|
738
|
+
this.isFormSubTable &&
|
|
739
|
+
this.column.prop === 'operation' &&
|
|
740
|
+
this.subTableCanAdd &&
|
|
741
|
+
gridParams.options &&
|
|
742
|
+
gridParams.options.showOperationButton
|
|
743
|
+
if (
|
|
744
|
+
this.column.fileSet &&
|
|
745
|
+
this.column.fileSet !== '' &&
|
|
746
|
+
this.column.componentType === 'annex'
|
|
747
|
+
) {
|
|
748
|
+
const fileSetObj = JSON.parse(this.column.fileSet)
|
|
749
|
+
if (fileSetObj && fileSetObj.multiple) {
|
|
750
|
+
this.fileMultiple = true
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (
|
|
754
|
+
this.column.formatter &&
|
|
755
|
+
this.column.formatter.options &&
|
|
756
|
+
this.column.formatter.options.format &&
|
|
757
|
+
this.column.formatter.type === 'icon'
|
|
758
|
+
|
|
759
|
+
) {
|
|
760
|
+
|
|
761
|
+
this.formatConfig = JSON.parse(this.column.formatter.options.format)
|
|
762
|
+
}
|
|
763
|
+
},
|
|
764
|
+
mounted() {
|
|
765
|
+
// 监听保存时点击按钮事件线触发
|
|
766
|
+
$on(eventBus, 'un-edit', (param) => {
|
|
767
|
+
// 处理多选选项组问题保存问题
|
|
768
|
+
if (
|
|
769
|
+
this.column.componentType &&
|
|
770
|
+
(this.column.componentType === 'multiselect' ||
|
|
771
|
+
this.column.componentType === 'select')
|
|
772
|
+
) {
|
|
773
|
+
const isDynamic = isDynamicDataSourceSource(this.column)
|
|
774
|
+
if (!isDynamic) {
|
|
775
|
+
// 选项组保存时将数组处理为字符串
|
|
776
|
+
const beforeColumnValue = param.row[this.column.prop]
|
|
777
|
+
if (
|
|
778
|
+
beforeColumnValue &&
|
|
779
|
+
Object.prototype.toString.apply(beforeColumnValue) ===
|
|
780
|
+
'[object Array]'
|
|
781
|
+
) {
|
|
782
|
+
// 如果是数组才需要转换
|
|
783
|
+
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
784
|
+
}
|
|
785
|
+
} else {
|
|
786
|
+
// 动态数据源多选保存时,获取已选择的字段,由于多选选项组的值是数组,保存时要拼接成“ ,” 分隔的字符串
|
|
787
|
+
if ('_dynamic-source-data-' + this.column.prop in this.column) {
|
|
788
|
+
const temp = this.column['_dynamic-source-data-' + this.column.prop]
|
|
789
|
+
const valueSetOptions = temp.valueSetOptions
|
|
790
|
+
// 获取当前字段对应在映射关系中对应的是动态数据源中的哪一个字段key
|
|
791
|
+
let selectDataKey
|
|
792
|
+
for (let i = 0; i < valueSetOptions.length; i++) {
|
|
793
|
+
const valueSetOption = valueSetOptions[i]
|
|
794
|
+
if (
|
|
795
|
+
this.column.prop === valueSetOption.valueColumn.dbColumnName
|
|
796
|
+
) {
|
|
797
|
+
selectDataKey = valueSetOption.columnName
|
|
798
|
+
break
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
if (selectDataKey) {
|
|
802
|
+
// beforeColumnValue是数组值,如果是单选则是字符串
|
|
803
|
+
let beforeColumnValue = param.row[this.column.prop]
|
|
804
|
+
if (this.column.componentType === 'select') {
|
|
805
|
+
if (selectDataKey !== temp.valueAttribute) {
|
|
806
|
+
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
807
|
+
beforeColumnValue = temp.optionItems.find(
|
|
808
|
+
(item) =>
|
|
809
|
+
// 当前字段映射的是工厂名称,
|
|
810
|
+
// 筛选动态数据源选项值字段对应的当前字段所映射的字段, 例如 根据工厂编码找工厂编码对应的工厂名称
|
|
811
|
+
// 找出名称后赋值给当前字段
|
|
812
|
+
item[temp.valueAttribute] === beforeColumnValue
|
|
813
|
+
)[selectDataKey]
|
|
814
|
+
}
|
|
815
|
+
// 如果是单选
|
|
816
|
+
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
817
|
+
// temp.optionItems.forEach(optionItem => {
|
|
818
|
+
// if (optionItem[temp.valueAttribute] === beforeColumnValue) {
|
|
819
|
+
// this.$set(param.row, this.column.prop, optionItem[selectDataKey])
|
|
820
|
+
// }
|
|
821
|
+
// })
|
|
822
|
+
param.row[this.column.prop] = beforeColumnValue
|
|
823
|
+
} else {
|
|
824
|
+
// 如果是多选,join “ ,” , 并给row赋值
|
|
825
|
+
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
826
|
+
// const afterColumnValue = []
|
|
827
|
+
// temp.optionItems.forEach(optionItem => {
|
|
828
|
+
// beforeColumnValue.forEach(value => {
|
|
829
|
+
// if (optionItem[temp.valueAttribute] === value) {
|
|
830
|
+
// afterColumnValue.push(optionItem[selectDataKey])
|
|
831
|
+
// }
|
|
832
|
+
// })
|
|
833
|
+
// })
|
|
834
|
+
if (
|
|
835
|
+
beforeColumnValue &&
|
|
836
|
+
selectDataKey !== temp.valueAttribute
|
|
837
|
+
) {
|
|
838
|
+
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
839
|
+
const t = []
|
|
840
|
+
beforeColumnValue.forEach((selectItem) => {
|
|
841
|
+
if (selectDataKey !== temp.valueAttribute) {
|
|
842
|
+
t.push(
|
|
843
|
+
temp.optionItems.find(
|
|
844
|
+
(option) => option[temp.valueAttribute] === selectItem
|
|
845
|
+
)[selectDataKey]
|
|
846
|
+
)
|
|
847
|
+
}
|
|
848
|
+
})
|
|
849
|
+
beforeColumnValue = t
|
|
850
|
+
}
|
|
851
|
+
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
} else {
|
|
855
|
+
const beforeColumnValue = param.row[this.column.prop]
|
|
856
|
+
if (
|
|
857
|
+
beforeColumnValue &&
|
|
858
|
+
Object.prototype.toString.apply(beforeColumnValue) ===
|
|
859
|
+
'[object Array]'
|
|
860
|
+
) {
|
|
861
|
+
// 如果是数组才需要转换
|
|
862
|
+
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
})
|
|
868
|
+
},
|
|
869
|
+
unmounted() {
|
|
870
|
+
$off(eventBus, 'un-edit')
|
|
871
|
+
},
|
|
872
|
+
methods: {
|
|
873
|
+
...customFormatter,
|
|
874
|
+
...apis,
|
|
875
|
+
getHeader() {
|
|
876
|
+
if (!this.column.titleValueSet) {
|
|
877
|
+
return this.column.label.replace(/\\n/g, '</br>')
|
|
878
|
+
} else {
|
|
879
|
+
return this.formatHeader()
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
formatHeader() {
|
|
883
|
+
return doFormatWithValueSet(
|
|
884
|
+
this.column.titleValueSetValue,
|
|
885
|
+
this.column.label
|
|
886
|
+
)
|
|
887
|
+
},
|
|
888
|
+
filterHandler(value, row, column) {
|
|
889
|
+
const property = column['property']
|
|
890
|
+
return row[property] === value
|
|
891
|
+
},
|
|
892
|
+
onFocus(index) {
|
|
893
|
+
const gridParams = store.get(this.listCode)
|
|
894
|
+
if (gridParams.lineEdit.editingCell) {
|
|
895
|
+
gridParams.lineEdit.editingCell.row = index
|
|
896
|
+
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
897
|
+
}
|
|
898
|
+
},
|
|
899
|
+
findIndex(index) {
|
|
900
|
+
this.index = index
|
|
901
|
+
const gridParams = store.get(this.listCode)
|
|
902
|
+
if (gridParams.lineEdit.editingCell) {
|
|
903
|
+
gridParams.lineEdit.editingCell.row = index
|
|
904
|
+
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
refresData(data) {
|
|
908
|
+
$emit(this, 'refresData', data)
|
|
909
|
+
},
|
|
910
|
+
refresPortData(port, value) {
|
|
911
|
+
const gridParams = store.get(this.listCode)
|
|
912
|
+
console.log('gridParams', gridParams)
|
|
913
|
+
console.log('this.index', this.index)
|
|
914
|
+
if (
|
|
915
|
+
gridParams &&
|
|
916
|
+
gridParams.lineEdit &&
|
|
917
|
+
gridParams.lineEdit.editingCell
|
|
918
|
+
) {
|
|
919
|
+
$emit(
|
|
920
|
+
this,
|
|
921
|
+
'refresPortData',
|
|
922
|
+
port,
|
|
923
|
+
value,
|
|
924
|
+
gridParams.lineEdit.editingCell.row
|
|
925
|
+
)
|
|
926
|
+
} else {
|
|
927
|
+
$emit(this, 'refresPortData', port, value, this.index)
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
refresPortsData(map) {
|
|
931
|
+
const gridParams = store.get(this.listCode)
|
|
932
|
+
console.log('gridParams', gridParams)
|
|
933
|
+
console.log('this.index', this.index)
|
|
934
|
+
if (
|
|
935
|
+
gridParams &&
|
|
936
|
+
gridParams.lineEdit &&
|
|
937
|
+
gridParams.lineEdit.editingCell
|
|
938
|
+
) {
|
|
939
|
+
$emit(this, 'refresPortsData', map, gridParams.lineEdit.editingCell.row)
|
|
940
|
+
} else {
|
|
941
|
+
$emit(this, 'refresPortsData', map, this.index)
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
refresMainTableFields(map) {
|
|
945
|
+
$emit(this, 'refresMainTableFields', map)
|
|
946
|
+
},
|
|
947
|
+
// @keyup.native.left="move('left')"
|
|
948
|
+
// @keyup.native.right="move('right')"
|
|
949
|
+
// @keyup.native.up="move('up')"
|
|
950
|
+
// @keyup.native.down="move('down')"
|
|
951
|
+
move(direction) {
|
|
952
|
+
if (direction === 'left') {
|
|
953
|
+
const prop = ArrowKeyAction.getLeftColumn(this.column.prop)
|
|
954
|
+
const gridParams = store.get(this.listCode)
|
|
955
|
+
gridParams.lineEdit.editingCell.prop = prop
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
// filterHandler(value, row, column) {
|
|
959
|
+
// const property = column['property']
|
|
960
|
+
// return row[property] === value
|
|
961
|
+
// },
|
|
962
|
+
isSaveByEnter() {
|
|
963
|
+
const gridParams = store.get(this.listCode)
|
|
964
|
+
return (
|
|
965
|
+
typeof gridParams.options.lineEditOptions.isSaveByEnter ===
|
|
966
|
+
'undefined' ||
|
|
967
|
+
(isHasEditOption('isSaveByEnter', this.listCode) &&
|
|
968
|
+
gridParams.options.lineEditOptions.isSaveByEnter === true)
|
|
969
|
+
)
|
|
970
|
+
},
|
|
971
|
+
isRestoreByEsc() {
|
|
972
|
+
const gridParams = store.get(this.listCode)
|
|
973
|
+
return (
|
|
974
|
+
typeof gridParams.options.lineEditOptions.isRestoreByEsc ===
|
|
975
|
+
'undefined' ||
|
|
976
|
+
(isHasEditOption('isRestoreByEsc', this.listCode) &&
|
|
977
|
+
gridParams.options.lineEditOptions.isRestoreByEsc === true)
|
|
978
|
+
)
|
|
979
|
+
},
|
|
980
|
+
canFocus(index) {
|
|
981
|
+
const gridParams = store.get(this.listCode)
|
|
982
|
+
if (
|
|
983
|
+
index === gridParams.lineEdit.editingCell.row &&
|
|
984
|
+
this.column.prop === gridParams.lineEdit.editingCell.prop
|
|
985
|
+
) {
|
|
986
|
+
return true
|
|
987
|
+
} else {
|
|
988
|
+
return false
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
getLabel(row, index) {
|
|
992
|
+
this.transferColumnDataToUpperCase(row)
|
|
993
|
+
const obj = this.objectPropValueTwo(row, this.column)
|
|
994
|
+
// // 存储执行时间
|
|
995
|
+
// const get2 = new Date().getTime()
|
|
996
|
+
// const get3 = Number(get2) - Number(get1)
|
|
997
|
+
// if (!window.sessionStorage.getItem('getLabel')) {
|
|
998
|
+
// window.sessionStorage.setItem('getLabel', get3)
|
|
999
|
+
// } else {
|
|
1000
|
+
// const get4 = window.sessionStorage.getItem('getLabel')
|
|
1001
|
+
// const get5 = Number(get4) + Number(get3)
|
|
1002
|
+
// window.sessionStorage.setItem('getLabel', get5)
|
|
1003
|
+
// }
|
|
1004
|
+
return obj
|
|
1005
|
+
// const returnValue = this.objectPropValueTwo(row, this.column)
|
|
1006
|
+
// if (returnValue) {
|
|
1007
|
+
// // 解决当文本中有多个空格时候, vue自动将多个空格合并为一个空格,
|
|
1008
|
+
// // 或者修改vue的配置 https://cn.vuejs.org/api/application.html#app-config-compileroptions app.config.compilerOptions.whitespace
|
|
1009
|
+
// return returnValue.replaceAll(' ', '\u00A0')
|
|
1010
|
+
// }
|
|
1011
|
+
// return returnValue
|
|
1012
|
+
},
|
|
1013
|
+
getCellValue(row) {
|
|
1014
|
+
let cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
1015
|
+
if (cellValue === undefined || cellValue === null) {
|
|
1016
|
+
this.transferColumnDataToUpperCase(row)
|
|
1017
|
+
cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
1018
|
+
}
|
|
1019
|
+
return cellValue
|
|
1020
|
+
},
|
|
1021
|
+
// 兼容oracle和mysql数据库,oracle是字段名是大写的,mysql是小写的,将小写转为大写
|
|
1022
|
+
transferColumnDataToUpperCase(row) {
|
|
1023
|
+
const reg1 = /[A-Z]+/ // 大写字母
|
|
1024
|
+
if (this.isSql && reg1.test(this.column.prop)) {
|
|
1025
|
+
this.transferColumnDataToUpperCaseWithProp(
|
|
1026
|
+
row,
|
|
1027
|
+
this.column.prop.toLowerCase(),
|
|
1028
|
+
this.column.prop
|
|
1029
|
+
)
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1032
|
+
transferColumnDataToUpperCaseWithProp(row, propLowerCase, columnProp) {
|
|
1033
|
+
let dataModel
|
|
1034
|
+
if (propLowerCase && propLowerCase.indexOf('.') > 0) {
|
|
1035
|
+
const parentObj = getParentObjectUtil(propLowerCase, row)
|
|
1036
|
+
const prop = propLowerCase.substring(propLowerCase.lastIndexOf('.') + 1)
|
|
1037
|
+
dataModel = parentObj[prop]
|
|
1038
|
+
if (dataModel !== undefined) {
|
|
1039
|
+
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
1040
|
+
parentObj[columnProp] = dataModel
|
|
1041
|
+
delete parentObj[prop]
|
|
1042
|
+
}
|
|
1043
|
+
} else {
|
|
1044
|
+
dataModel = row[propLowerCase]
|
|
1045
|
+
if (dataModel !== undefined) {
|
|
1046
|
+
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
1047
|
+
row[columnProp] = dataModel
|
|
1048
|
+
delete row[propLowerCase]
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
return dataModel
|
|
1052
|
+
},
|
|
1053
|
+
getMyHyperLinkSetting(row) {
|
|
1054
|
+
this.transferColumnDataToUpperCase(row)
|
|
1055
|
+
const gridParams = store.get(this.listCode)
|
|
1056
|
+
let tableName
|
|
1057
|
+
if (
|
|
1058
|
+
gridParams &&
|
|
1059
|
+
gridParams.basicInfo &&
|
|
1060
|
+
gridParams.basicInfo.tableName
|
|
1061
|
+
) {
|
|
1062
|
+
tableName = gridParams.basicInfo.tableName
|
|
1063
|
+
}
|
|
1064
|
+
const hyperLinkResult = this.getHyperLinkSetting(
|
|
1065
|
+
this.column,
|
|
1066
|
+
row,
|
|
1067
|
+
this.isSql,
|
|
1068
|
+
gridParams.additionalParamMap,
|
|
1069
|
+
gridParams.contextParameter,
|
|
1070
|
+
tableName,
|
|
1071
|
+
this.listCode
|
|
1072
|
+
)
|
|
1073
|
+
hyperLinkResult.icon = this.getHyperIconClass(hyperLinkResult)
|
|
1074
|
+
return hyperLinkResult
|
|
1075
|
+
},
|
|
1076
|
+
getHyperIconClass(hyperLinkResult) {
|
|
1077
|
+
let iconName
|
|
1078
|
+
if (
|
|
1079
|
+
hyperLinkResult &&
|
|
1080
|
+
hyperLinkResult !== null &&
|
|
1081
|
+
hyperLinkResult.icon &&
|
|
1082
|
+
hyperLinkResult.icon !== ''
|
|
1083
|
+
) {
|
|
1084
|
+
iconName = hyperLinkResult.icon
|
|
1085
|
+
}
|
|
1086
|
+
if (iconName && iconName.indexOf('fa-') === 0) {
|
|
1087
|
+
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
1088
|
+
iconName = 'fa ' + iconName
|
|
1089
|
+
}
|
|
1090
|
+
return iconName
|
|
1091
|
+
},
|
|
1092
|
+
createFormSubTableRow() {
|
|
1093
|
+
console.log('触发了行新建')
|
|
1094
|
+
this.createRow(this.listCode)
|
|
1095
|
+
},
|
|
1096
|
+
handleCommand(comman) {
|
|
1097
|
+
let prop = null
|
|
1098
|
+
this.column.operations.forEach((item) => {
|
|
1099
|
+
if (item.isGroup) {
|
|
1100
|
+
item.buttons.forEach((button) => {
|
|
1101
|
+
if (button.props.code === comman.comman) {
|
|
1102
|
+
prop = button
|
|
1103
|
+
}
|
|
1104
|
+
})
|
|
1105
|
+
}
|
|
1106
|
+
})
|
|
1107
|
+
if (prop) {
|
|
1108
|
+
customFormatter.onClickFun(
|
|
1109
|
+
comman.row,
|
|
1110
|
+
this.column,
|
|
1111
|
+
prop.onClick,
|
|
1112
|
+
comman.rowIndex
|
|
1113
|
+
)
|
|
1114
|
+
}
|
|
1115
|
+
},
|
|
1116
|
+
beforeHandleCommand(comman, row, rowIndex) {
|
|
1117
|
+
return {
|
|
1118
|
+
comman: comman,
|
|
1119
|
+
row: row,
|
|
1120
|
+
rowIndex: rowIndex,
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
previewImg(row) {
|
|
1124
|
+
this.fileList = getFileList(row, this.column, this.isSql)
|
|
1125
|
+
this.showSingleImgFlag = true
|
|
1126
|
+
},
|
|
1127
|
+
getFileList(row) {
|
|
1128
|
+
return getFileList(row, this.column, this.isSql)
|
|
1129
|
+
},
|
|
1130
|
+
getColumnWidth() {
|
|
1131
|
+
if (
|
|
1132
|
+
this.column &&
|
|
1133
|
+
this.column.prop === 'operation' &&
|
|
1134
|
+
!this.column.width
|
|
1135
|
+
) {
|
|
1136
|
+
// 表示操作列,宽度固定
|
|
1137
|
+
return '210'
|
|
1138
|
+
}
|
|
1139
|
+
return this.column.width ? this.column.width + '' : '130'
|
|
1140
|
+
},
|
|
1141
|
+
// 设置字段禁止编辑
|
|
1142
|
+
fnProhibitToEdit(isEditable) {
|
|
1143
|
+
this.isEditable = isEditable
|
|
1144
|
+
},
|
|
1145
|
+
// 设置字段禁止编辑
|
|
1146
|
+
prohibitToEdit(entity) {
|
|
1147
|
+
$emit(this, 'prohibitToEdit', entity)
|
|
1148
|
+
},
|
|
1149
|
+
isFieldRequired() {
|
|
1150
|
+
return isRequiredEdit(this.column, this.listCode)
|
|
1151
|
+
// return true
|
|
1152
|
+
},
|
|
1153
|
+
// 展示富文本内容
|
|
1154
|
+
showRichEditorContent(row, column, header) {
|
|
1155
|
+
this.showRichEditorViewer = true
|
|
1156
|
+
this.$nextTick(() => {
|
|
1157
|
+
this.$refs.richEditorViewerRef.showContent(row[column.prop], header)
|
|
1158
|
+
})
|
|
1159
|
+
},
|
|
1160
|
+
closeRichEditorContent() {
|
|
1161
|
+
this.showRichEditorViewer = false
|
|
1162
|
+
},
|
|
1163
|
+
isRequired(editing) {
|
|
1164
|
+
if (
|
|
1165
|
+
!this.isFormSubTable &&
|
|
1166
|
+
this.lineEdit.editable &&
|
|
1167
|
+
this.isEditable &&
|
|
1168
|
+
editing &&
|
|
1169
|
+
this.column.validations
|
|
1170
|
+
) {
|
|
1171
|
+
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
1172
|
+
return true
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
return false
|
|
1176
|
+
},
|
|
1177
|
+
getFormatIconSetting(row) {
|
|
1178
|
+
this.transferColumnDataToUpperCase(row)
|
|
1179
|
+
const gridParams = store.get(this.listCode)
|
|
1180
|
+
const result = this.getIconSetting(
|
|
1181
|
+
this.column,
|
|
1182
|
+
row,
|
|
1183
|
+
this.isSql,
|
|
1184
|
+
gridParams,
|
|
1185
|
+
this.listCode
|
|
1186
|
+
)
|
|
1187
|
+
result.icon = this.getHyperIconClass(result)
|
|
1188
|
+
if (
|
|
1189
|
+
this.column.formatter.options &&
|
|
1190
|
+
this.column.formatter.options.format
|
|
1191
|
+
) {
|
|
1192
|
+
result.position = JSON.parse(
|
|
1193
|
+
this.column.formatter.options.format
|
|
1194
|
+
).position
|
|
1195
|
+
}
|
|
1196
|
+
return result
|
|
1197
|
+
},
|
|
1198
|
+
},
|
|
1199
|
+
emits: [
|
|
1200
|
+
'refresData',
|
|
1201
|
+
'refresPortData',
|
|
1202
|
+
'refresPortsData',
|
|
1203
|
+
'refresMainTableFields',
|
|
1204
|
+
'prohibitToEdit',
|
|
1205
|
+
,
|
|
1206
|
+
],
|
|
1207
|
+
}
|
|
1208
|
+
</script>
|
|
1209
|
+
|
|
1210
|
+
<style lang="scss" scoped>
|
|
1211
|
+
.annex-cell {
|
|
1212
|
+
padding-right: 5px;
|
|
1213
|
+
cursor: pointer;
|
|
1214
|
+
color: #409eff;
|
|
1215
|
+
}
|
|
1216
|
+
.m-requried {
|
|
1217
|
+
float: left;
|
|
1218
|
+
white-space: nowrap;
|
|
1219
|
+
}
|
|
1220
|
+
.m-requried::after {
|
|
1221
|
+
content: '*';
|
|
1222
|
+
color: #f56c6c;
|
|
1223
|
+
}
|
|
1224
|
+
</style>
|