agilebuilder-ui 1.1.32 → 1.1.33-sit2
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/{401-572d1150.js → 401-7b6f6bb7.js} +1 -1
- package/lib/{404-442a62d4.js → 404-427a0b5a.js} +1 -1
- package/lib/{iframe-page-1b622fa5.js → iframe-page-89815912.js} +1 -1
- package/lib/index-e2f27581.js +73223 -0
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +94 -94
- package/lib/{tab-content-iframe-index-285c8311.js → tab-content-iframe-index-2619cf03.js} +1 -1
- package/lib/{tab-content-index-ddb9e911.js → tab-content-index-391b0efb.js} +1 -1
- package/lib/{tache-subprocess-history-81e8e4f4.js → tache-subprocess-history-2097ae7f.js} +1 -1
- package/package.json +1 -1
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +5 -1
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +343 -368
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +193 -101
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +74 -62
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +1 -1
- package/packages/organization-input/src/organization-input.vue +11 -0
- package/packages/super-grid/src/dynamic-input.vue +11 -1
- package/packages/super-grid/src/formatter.js +55 -56
- package/packages/super-grid/src/normal-column-content.vue +125 -55
- package/packages/super-grid/src/row-operation.vue +35 -18
- package/packages/super-grid/src/super-grid.vue +135 -97
- package/packages/super-icon/src/index.vue +1 -0
- package/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
- package/src/styles/display-layout.scss +1 -1
- package/src/styles/index.scss +7 -1
- package/src/utils/auth-api.js +4 -0
- package/src/utils/common-util.js +3 -0
- package/src/utils/dingtalk-util.ts +37 -0
- package/lib/index-0ffdab4a.js +0 -72771
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<div v-else :style="row.validateErrorField && row.validateErrorField === column.prop ? 'border:1px solid red' : ''">
|
|
29
29
|
<!--必须有@input ,否则无法输入值-->
|
|
30
30
|
<el-date-picker
|
|
31
|
-
v-if="type === 'year' || type === 'month'"
|
|
31
|
+
v-if="type === 'year' || type === 'month' || type === 'week'"
|
|
32
32
|
ref="item"
|
|
33
33
|
v-model="innerValue"
|
|
34
34
|
:disabled="disabled"
|
|
@@ -1844,6 +1844,11 @@ export default {
|
|
|
1844
1844
|
if (this.column.dataType === 'TEXT' || this.column.dataType === 'text') {
|
|
1845
1845
|
return this.isFormat()
|
|
1846
1846
|
}
|
|
1847
|
+
if (this.type === 'week') {
|
|
1848
|
+
if (this.controlConfig && this.controlConfig.valueFormat) {
|
|
1849
|
+
return this.controlConfig.valueFormat
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1847
1852
|
// timestamp毫秒值为x
|
|
1848
1853
|
return 'x'
|
|
1849
1854
|
},
|
|
@@ -1862,6 +1867,11 @@ export default {
|
|
|
1862
1867
|
return 'MM'
|
|
1863
1868
|
} else if (this.type === 'date') {
|
|
1864
1869
|
return 'YYYY-MM-DD'
|
|
1870
|
+
} else if (this.type === 'week') {
|
|
1871
|
+
if (this.controlConfig && this.controlConfig.format) {
|
|
1872
|
+
return this.controlConfig.format
|
|
1873
|
+
}
|
|
1874
|
+
return 'ww'
|
|
1865
1875
|
} else if (this.type === 'time' || this.column.dataType === 'TIME') {
|
|
1866
1876
|
return 'HH:mm:ss'
|
|
1867
1877
|
} else if (this.column.dataType === 'DATE') {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { isDynamicDataSourceSource } from './utils'
|
|
2
|
+
import dayjs from 'dayjs'
|
|
3
|
+
import weekOfYear from 'dayjs/plugin/weekOfYear'
|
|
4
|
+
dayjs.extend(weekOfYear)
|
|
2
5
|
const formatter = {
|
|
3
6
|
number: function (inputValue, options) {
|
|
4
7
|
// 小数位数
|
|
@@ -19,10 +22,7 @@ const formatter = {
|
|
|
19
22
|
}
|
|
20
23
|
if (isDelimiter) {
|
|
21
24
|
const inputValueStr = inputValue + ''
|
|
22
|
-
const value = inputValueStr.replace(
|
|
23
|
-
/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,
|
|
24
|
-
'$&,'
|
|
25
|
-
)
|
|
25
|
+
const value = inputValueStr.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
|
|
26
26
|
if (sign) {
|
|
27
27
|
return value + sign
|
|
28
28
|
} else {
|
|
@@ -65,47 +65,52 @@ const formatter = {
|
|
|
65
65
|
date: function (value, options) {
|
|
66
66
|
// format格式,例如:yyyy-m-d,yyyy-m-d hh:mm:ss等等
|
|
67
67
|
const format = options.format
|
|
68
|
+
|
|
68
69
|
if (value != null) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
h =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
70
|
+
if (format === 'ww') {
|
|
71
|
+
return dayjs(value).week()
|
|
72
|
+
} else {
|
|
73
|
+
const date = new Date(value)
|
|
74
|
+
var y = date.getFullYear()
|
|
75
|
+
var m = date.getMonth() + 1
|
|
76
|
+
var d = date.getDate()
|
|
77
|
+
var h = date.getHours()
|
|
78
|
+
var min = date.getMinutes()
|
|
79
|
+
var s = date.getSeconds()
|
|
80
|
+
if (m < 10) {
|
|
81
|
+
m = '0' + m
|
|
82
|
+
}
|
|
83
|
+
if (d < 10) {
|
|
84
|
+
d = '0' + d
|
|
85
|
+
}
|
|
86
|
+
// if (format.indexOf('hh') >= 0) {
|
|
87
|
+
// h = h > 12 ? h - 12 : h
|
|
88
|
+
// } else {
|
|
89
|
+
if (h < 10) {
|
|
90
|
+
h = '0' + h
|
|
91
|
+
}
|
|
92
|
+
// }
|
|
93
|
+
if (min < 10) {
|
|
94
|
+
min = '0' + min
|
|
95
|
+
}
|
|
96
|
+
if (s < 10) {
|
|
97
|
+
s = '0' + s
|
|
98
|
+
}
|
|
99
|
+
const newValue = format
|
|
100
|
+
.replace('yyyy', y)
|
|
101
|
+
.replace('mm', min)
|
|
102
|
+
.replace('M', m)
|
|
103
|
+
.replace('m', m)
|
|
104
|
+
.replace('d', d)
|
|
105
|
+
.replace('hh', h)
|
|
106
|
+
.replace('HH', h)
|
|
107
|
+
.replace('ss', s)
|
|
108
|
+
// 判断格式化的值是否包含NaN,如果包含NaN取数据库的值
|
|
109
|
+
if (newValue.indexOf('NaN') === -1) {
|
|
110
|
+
return newValue
|
|
111
|
+
}
|
|
112
|
+
return value
|
|
107
113
|
}
|
|
108
|
-
return value
|
|
109
114
|
}
|
|
110
115
|
return value
|
|
111
116
|
},
|
|
@@ -117,7 +122,7 @@ const formatter = {
|
|
|
117
122
|
return this.number(value, options) + '%'
|
|
118
123
|
}
|
|
119
124
|
return value
|
|
120
|
-
}
|
|
125
|
+
}
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
export function doFormat(column, value) {
|
|
@@ -132,24 +137,21 @@ export function doFormat(column, value) {
|
|
|
132
137
|
column.formatter = {
|
|
133
138
|
type: 'date',
|
|
134
139
|
options: {
|
|
135
|
-
format: 'yyyy-m-d'
|
|
136
|
-
}
|
|
140
|
+
format: 'yyyy-m-d'
|
|
141
|
+
}
|
|
137
142
|
}
|
|
138
143
|
} else if (column.dataType === 'TIME') {
|
|
139
144
|
// 默认的“TIME”类型的格式设置
|
|
140
145
|
column.formatter = {
|
|
141
146
|
type: 'time',
|
|
142
147
|
options: {
|
|
143
|
-
format: 'yyyy-m-d hh:mm:ss'
|
|
144
|
-
}
|
|
148
|
+
format: 'yyyy-m-d hh:mm:ss'
|
|
149
|
+
}
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
const columnFormatter = column.formatter
|
|
149
|
-
if (
|
|
150
|
-
columnFormatter !== undefined &&
|
|
151
|
-
formatter[columnFormatter.type] !== undefined
|
|
152
|
-
) {
|
|
154
|
+
if (columnFormatter !== undefined && formatter[columnFormatter.type] !== undefined) {
|
|
153
155
|
return formatter[columnFormatter.type](value, columnFormatter.options)
|
|
154
156
|
} else {
|
|
155
157
|
return value
|
|
@@ -163,10 +165,7 @@ export function doFormatWithValueSet(column, value) {
|
|
|
163
165
|
const valueSet = column.valueSet
|
|
164
166
|
// 先处理值设置再处理格式化设置:即会对值设置的结果进行格式化设置
|
|
165
167
|
if (valueSet !== undefined) {
|
|
166
|
-
if (
|
|
167
|
-
column.componentType === 'multiselect' &&
|
|
168
|
-
!isDynamicDataSourceSource(column)
|
|
169
|
-
) {
|
|
168
|
+
if (column.componentType === 'multiselect' && !isDynamicDataSourceSource(column)) {
|
|
170
169
|
if (typeof value === 'number') {
|
|
171
170
|
// 当value是0时, value instanceof Number 为false
|
|
172
171
|
value += ''
|
|
@@ -35,9 +35,21 @@
|
|
|
35
35
|
@open-page="openPageEvent"
|
|
36
36
|
/>
|
|
37
37
|
<div v-else class="column-text-main">
|
|
38
|
-
<div
|
|
38
|
+
<div
|
|
39
|
+
v-if="
|
|
40
|
+
lineEdit.editable &&
|
|
41
|
+
(options?.configureObj?.props?.base?.columnEditable ?? false) &&
|
|
42
|
+
isEditable &&
|
|
43
|
+
!isHideEdit &&
|
|
44
|
+
!isContentViewText
|
|
45
|
+
"
|
|
46
|
+
class="column-text-edit-main"
|
|
47
|
+
@click="onEditing"
|
|
48
|
+
>
|
|
39
49
|
<el-icon :size="14" color="#409eff"><Edit /></el-icon>
|
|
40
|
-
<span v-if="[undefined, null, ''].includes(row[column.prop])" table-column-placeholder>{{
|
|
50
|
+
<span v-if="[undefined, null, ''].includes(row[column.prop])" table-column-placeholder>{{
|
|
51
|
+
$t('superGrid.editablePlaceholder')
|
|
52
|
+
}}</span>
|
|
41
53
|
</div>
|
|
42
54
|
<span v-if="column.operations" class="grid-operation-buttons" data-v="20250527">
|
|
43
55
|
<span
|
|
@@ -64,29 +76,27 @@
|
|
|
64
76
|
:command="beforeHandleCommand(buttonChild.props.code, row, rowIndex)"
|
|
65
77
|
:disabled="preventReclick"
|
|
66
78
|
>
|
|
67
|
-
{{
|
|
68
|
-
$escapeHtml(buttonChild.props.label)
|
|
69
|
-
}}
|
|
79
|
+
{{ $escapeHtml(buttonChild.props.label) }}
|
|
70
80
|
</el-dropdown-item>
|
|
71
81
|
</span>
|
|
72
82
|
</el-dropdown-menu>
|
|
73
83
|
</template>
|
|
74
84
|
</el-dropdown>
|
|
75
85
|
<component
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
:is="operation.props.customControl"
|
|
87
|
+
v-else-if="operation.props.customControl"
|
|
88
|
+
v-permission="operation.props.permission"
|
|
89
|
+
:key="column.prop + '_' + rowIndex + '_' + currentPage"
|
|
90
|
+
:disabled="true"
|
|
91
|
+
:row="pageGridData[rowIndex]"
|
|
92
|
+
:entity="pageGridData[rowIndex]"
|
|
93
|
+
:prop="column.prop"
|
|
94
|
+
:parent="parentFormData"
|
|
95
|
+
:row-index="rowIndex"
|
|
96
|
+
:grid-data="gridData"
|
|
97
|
+
:page-grid-data="pageGridData"
|
|
98
|
+
:current-page="currentPage"
|
|
99
|
+
@refresh-list="refreshList"
|
|
90
100
|
/>
|
|
91
101
|
<row-operation
|
|
92
102
|
v-else
|
|
@@ -96,6 +106,7 @@
|
|
|
96
106
|
:is-show="operation.isShow"
|
|
97
107
|
:label="operation.props.label ? operation.props.label : row[column.prop]"
|
|
98
108
|
:on-click="operation.onClick"
|
|
109
|
+
:operation="operation"
|
|
99
110
|
:operation-index="operationIndex"
|
|
100
111
|
:operation-setting="operation.props"
|
|
101
112
|
:row-index="rowIndex"
|
|
@@ -185,9 +196,9 @@
|
|
|
185
196
|
<span v-if="column.formatter && column.formatter.type === 'files'" type="primary">
|
|
186
197
|
<span
|
|
187
198
|
:id="column.prop + 'DomData' + rowIndex"
|
|
188
|
-
:style="
|
|
199
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
189
200
|
:title="isShowOverflowTooltip ? $escapeHtml(getLabel(row)) : ''"
|
|
190
|
-
:class="
|
|
201
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
191
202
|
>
|
|
192
203
|
<FsPreview
|
|
193
204
|
:entity="row"
|
|
@@ -220,9 +231,9 @@
|
|
|
220
231
|
<span
|
|
221
232
|
v-if="isShowOverflowTooltip"
|
|
222
233
|
:id="column.prop + 'DomData' + rowIndex"
|
|
223
|
-
:style="
|
|
234
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
224
235
|
:title="getMyHyperLinkSetting(row, rowIndex).title"
|
|
225
|
-
:class="
|
|
236
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
226
237
|
>{{ getMyHyperLinkSetting(row, rowIndex).label }}
|
|
227
238
|
<el-icon v-if="getMyHyperLinkSetting(row, rowIndex).icon">
|
|
228
239
|
<component :is="(getMyHyperLinkSetting(row), rowIndex.icon)" />
|
|
@@ -238,9 +249,9 @@
|
|
|
238
249
|
<span
|
|
239
250
|
v-else-if="isShowOverflowTooltip"
|
|
240
251
|
:id="column.prop + 'DomData' + rowIndex"
|
|
241
|
-
:style="
|
|
252
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
242
253
|
:title="$escapeHtml(getLabel(row))"
|
|
243
|
-
:class="
|
|
254
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
244
255
|
>{{ $escapeHtml(getLabel(row, rowIndex)) }}</span
|
|
245
256
|
>
|
|
246
257
|
<span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'">{{
|
|
@@ -252,9 +263,9 @@
|
|
|
252
263
|
<span
|
|
253
264
|
v-if="isShowOverflowTooltip"
|
|
254
265
|
:id="column.prop + 'DomData' + rowIndex"
|
|
255
|
-
:style="
|
|
266
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
256
267
|
:title="$escapeHtml(getLabel(row))"
|
|
257
|
-
:class="
|
|
268
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
258
269
|
>
|
|
259
270
|
<FsPreview
|
|
260
271
|
:entity="row"
|
|
@@ -275,9 +286,9 @@
|
|
|
275
286
|
<span v-else-if="column.formatter && column.formatter.type === 'files'">
|
|
276
287
|
<span
|
|
277
288
|
:id="column.prop + 'DomData' + rowIndex"
|
|
278
|
-
:style="
|
|
289
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
279
290
|
:title="isShowOverflowTooltip ? $escapeHtml(getLabel(row)) : ''"
|
|
280
|
-
:class="
|
|
291
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
281
292
|
>
|
|
282
293
|
<FsPreview
|
|
283
294
|
:entity="row"
|
|
@@ -301,9 +312,9 @@
|
|
|
301
312
|
<span
|
|
302
313
|
v-if="isShowOverflowTooltip"
|
|
303
314
|
:id="column.prop + 'DomData' + rowIndex"
|
|
304
|
-
:style="
|
|
315
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
305
316
|
:title="$escapeHtml(getMyHyperLinkSetting(row, rowIndex).title)"
|
|
306
|
-
:class="
|
|
317
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
307
318
|
>{{ $escapeHtml(getMyHyperLinkSetting(row, rowIndex).label) }}
|
|
308
319
|
<el-icon v-if="getMyHyperLinkSetting(row, rowIndex).icon">
|
|
309
320
|
<component :is="getMyHyperLinkSetting(row, rowIndex).icon" />
|
|
@@ -334,10 +345,9 @@
|
|
|
334
345
|
<span
|
|
335
346
|
v-else-if="isShowOverflowTooltip"
|
|
336
347
|
:id="column.prop + 'DomData' + rowIndex"
|
|
337
|
-
:style="
|
|
348
|
+
:style="textOverflow === 'newline' ? {} : { width: cellWidth + 'px' }"
|
|
338
349
|
:title="getLabel(row)"
|
|
339
|
-
:class="
|
|
340
|
-
style="white-space: pre"
|
|
350
|
+
:class="textOverflow === 'newline' ? 'wrap-text' : 'ellipsis cell--span'"
|
|
341
351
|
v-html="$escapeHtml(getLabel(row, rowIndex))"
|
|
342
352
|
/>
|
|
343
353
|
<span v-else :id="column.prop + 'DomData' + rowIndex" :class="isShowForm ? '' : 'cell--span'">{{
|
|
@@ -367,7 +377,8 @@ import {
|
|
|
367
377
|
isRequiredEdit,
|
|
368
378
|
getAdditionalParamMap,
|
|
369
379
|
getContentAlign,
|
|
370
|
-
getHeaderAlign
|
|
380
|
+
getHeaderAlign,
|
|
381
|
+
isEditOptionFunction
|
|
371
382
|
} from './utils'
|
|
372
383
|
import DynamicInput from './dynamic-input.vue'
|
|
373
384
|
import store from './store'
|
|
@@ -383,7 +394,8 @@ import FsPreview from '../../fs-preview'
|
|
|
383
394
|
import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
384
395
|
import GridIcon from './components/grid-icon.vue'
|
|
385
396
|
import { formatScanRuleSets } from './scan-util.ts'
|
|
386
|
-
import storeVuex from '../../../src/store'
|
|
397
|
+
import storeVuex from '../../../src/store'
|
|
398
|
+
import { isPromise } from '../../../src/utils/common-util'
|
|
387
399
|
|
|
388
400
|
export default {
|
|
389
401
|
components: {
|
|
@@ -493,6 +505,13 @@ export default {
|
|
|
493
505
|
if (gridParams.lineEdit !== null && gridParams.lineEdit !== undefined) {
|
|
494
506
|
lineEdit = gridParams.lineEdit
|
|
495
507
|
}
|
|
508
|
+
let textOverflow = 'hidden'
|
|
509
|
+
if (gridParams.basicInfo && gridParams.basicInfo.textOverflow) {
|
|
510
|
+
textOverflow = gridParams.basicInfo.textOverflow
|
|
511
|
+
}
|
|
512
|
+
if (this.isShowForm) {
|
|
513
|
+
textOverflow = 'newline'
|
|
514
|
+
}
|
|
496
515
|
return {
|
|
497
516
|
selectRow: null,
|
|
498
517
|
that: this,
|
|
@@ -524,7 +543,8 @@ export default {
|
|
|
524
543
|
rowLinkConfigMapping: {},
|
|
525
544
|
requiredClass: '',
|
|
526
545
|
lineEdit,
|
|
527
|
-
options
|
|
546
|
+
options,
|
|
547
|
+
textOverflow
|
|
528
548
|
}
|
|
529
549
|
},
|
|
530
550
|
computed: {
|
|
@@ -556,7 +576,7 @@ export default {
|
|
|
556
576
|
return true
|
|
557
577
|
}
|
|
558
578
|
}
|
|
559
|
-
return this.row.$editing
|
|
579
|
+
return this.row.$editing
|
|
560
580
|
} catch (error) {
|
|
561
581
|
return false
|
|
562
582
|
}
|
|
@@ -585,7 +605,7 @@ export default {
|
|
|
585
605
|
'row.$editing': {
|
|
586
606
|
deep: true,
|
|
587
607
|
handler(newValue) {
|
|
588
|
-
if([false].includes(newValue)) {
|
|
608
|
+
if ([false].includes(newValue)) {
|
|
589
609
|
this.clearAllEditing()
|
|
590
610
|
}
|
|
591
611
|
}
|
|
@@ -779,8 +799,14 @@ export default {
|
|
|
779
799
|
}
|
|
780
800
|
},
|
|
781
801
|
// 手动编辑触发
|
|
782
|
-
onEditing(event) {
|
|
802
|
+
async onEditing(event) {
|
|
783
803
|
if (this.hasEditPermission && !this.isEditing) {
|
|
804
|
+
let canEdit = true
|
|
805
|
+
// 触发编辑前事件
|
|
806
|
+
if (isEditOptionFunction('beforeEdit', this.listCode)) {
|
|
807
|
+
canEdit = await this.triggerCustomEvent('beforeEdit')
|
|
808
|
+
}
|
|
809
|
+
if (!canEdit) return
|
|
784
810
|
event.stopPropagation()
|
|
785
811
|
|
|
786
812
|
const onEditing = () => {
|
|
@@ -792,13 +818,13 @@ export default {
|
|
|
792
818
|
setTimeout(this.focusBottomInput, 400)
|
|
793
819
|
}
|
|
794
820
|
|
|
795
|
-
if(!this.isFormSubTable) {
|
|
821
|
+
if (!this.isFormSubTable) {
|
|
796
822
|
// 非子表
|
|
797
823
|
if (storeVuex.getters.isConfigEditing) {
|
|
798
824
|
if (storeVuex.getters.isRowEditing(this.$rowGuId)) {
|
|
799
825
|
onEditing()
|
|
800
826
|
} else {
|
|
801
|
-
const isNext =
|
|
827
|
+
const isNext = this.isLastEditRowSaveMessage(this.listCode)
|
|
802
828
|
if (!isNext) return
|
|
803
829
|
}
|
|
804
830
|
// else {
|
|
@@ -806,7 +832,7 @@ export default {
|
|
|
806
832
|
// // this.confirmBeforeSwitchingRow(this.listCode, () => { })
|
|
807
833
|
// }
|
|
808
834
|
} else {
|
|
809
|
-
const isNext =
|
|
835
|
+
const isNext = this.isLastEditRowSaveMessage(this.listCode)
|
|
810
836
|
if (!isNext) return
|
|
811
837
|
// 如果不是子表 则 开启 编辑模式
|
|
812
838
|
this.editRow(this.rowIndex, this.listCode, true)
|
|
@@ -825,26 +851,27 @@ export default {
|
|
|
825
851
|
this.$nextTick(() => {
|
|
826
852
|
try {
|
|
827
853
|
const getOffsetParent = (selectorAll) => {
|
|
828
|
-
return selectorAll
|
|
854
|
+
return selectorAll
|
|
855
|
+
? Array.from(this.$refs.dynamicRef.$el.querySelectorAll(selectorAll)).filter(
|
|
856
|
+
(control) => !!control.offsetParent
|
|
857
|
+
)
|
|
858
|
+
: []
|
|
829
859
|
}
|
|
830
860
|
|
|
831
|
-
let visibleFormControls = getOffsetParent('.el-select, .el-date-picker, .el-upload')
|
|
861
|
+
let visibleFormControls = getOffsetParent('.el-select, .el-date-picker, .el-upload')
|
|
832
862
|
if (visibleFormControls.length) {
|
|
833
863
|
visibleFormControls[0].click()
|
|
834
864
|
} else {
|
|
835
|
-
visibleFormControls = getOffsetParent('input, textarea')
|
|
865
|
+
visibleFormControls = getOffsetParent('input, textarea')
|
|
836
866
|
if (visibleFormControls.length > 0) {
|
|
837
867
|
const bottomControl = visibleFormControls.reduce((prev, current) => {
|
|
838
|
-
return current.getBoundingClientRect().bottom > prev.getBoundingClientRect().bottom
|
|
839
|
-
|
|
840
|
-
: prev;
|
|
841
|
-
});
|
|
868
|
+
return current.getBoundingClientRect().bottom > prev.getBoundingClientRect().bottom ? current : prev
|
|
869
|
+
})
|
|
842
870
|
if (['INPUT', 'TEXTAREA'].includes(bottomControl.tagName)) {
|
|
843
|
-
bottomControl.focus()
|
|
844
|
-
bottomControl.select()
|
|
871
|
+
bottomControl.focus()
|
|
872
|
+
bottomControl.select()
|
|
845
873
|
}
|
|
846
874
|
}
|
|
847
|
-
|
|
848
875
|
}
|
|
849
876
|
} catch (error) {
|
|
850
877
|
console.error(error)
|
|
@@ -1115,7 +1142,14 @@ export default {
|
|
|
1115
1142
|
}
|
|
1116
1143
|
},
|
|
1117
1144
|
isRequired(editing) {
|
|
1118
|
-
if (
|
|
1145
|
+
if (
|
|
1146
|
+
!this.isFormSubTable &&
|
|
1147
|
+
this.lineEdit &&
|
|
1148
|
+
this.lineEdit.editable &&
|
|
1149
|
+
this.isEditable &&
|
|
1150
|
+
editing &&
|
|
1151
|
+
this.column.validations
|
|
1152
|
+
) {
|
|
1119
1153
|
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
1120
1154
|
return true
|
|
1121
1155
|
}
|
|
@@ -1170,11 +1204,47 @@ export default {
|
|
|
1170
1204
|
}
|
|
1171
1205
|
},
|
|
1172
1206
|
changeRequired(required) {
|
|
1173
|
-
this.requiredClass = required? 'm-requried' : ''
|
|
1207
|
+
this.requiredClass = required ? 'm-requried' : ''
|
|
1174
1208
|
},
|
|
1175
1209
|
openPageEvent(openPageParams) {
|
|
1176
1210
|
console.log('normalColumnContent----openPageEvent----', openPageParams)
|
|
1177
1211
|
this.$emit('open-page', openPageParams)
|
|
1212
|
+
},
|
|
1213
|
+
triggerCustomEvent(type) {
|
|
1214
|
+
return new Promise((resolve) => {
|
|
1215
|
+
const gridParams = store.get(this.listCode)
|
|
1216
|
+
const isSubTableShowPage = gridParams.isSubTableShowPage
|
|
1217
|
+
// 每页显示多少条
|
|
1218
|
+
const pageSize = gridParams.pagination && gridParams.pagination.pageSize
|
|
1219
|
+
let canEdit = gridParams.options.lineEditOptions[type].call(this, {
|
|
1220
|
+
gridData: isSubTableShowPage ? gridParams.subTableData : gridParams.gridData,
|
|
1221
|
+
listCode: this.listCode,
|
|
1222
|
+
entity: gridParams.gridData[this.rowIndex],
|
|
1223
|
+
row: gridParams.gridData[this.rowIndex],
|
|
1224
|
+
rowIndex: this.rowIndex,
|
|
1225
|
+
columns: gridParams.columns,
|
|
1226
|
+
isMobile: false,
|
|
1227
|
+
pageGridData: isSubTableShowPage ? gridParams.gridData : null,
|
|
1228
|
+
pageSize,
|
|
1229
|
+
additionalParamMap: getAdditionalParamMap(gridParams),
|
|
1230
|
+
pageContext: gridParams.pageContext,
|
|
1231
|
+
configureObj: gridParams.configureObj
|
|
1232
|
+
})
|
|
1233
|
+
if (isPromise(canEdit)) {
|
|
1234
|
+
canEdit.then((result) => {
|
|
1235
|
+
if (result === undefined || result === true) {
|
|
1236
|
+
resolve(true)
|
|
1237
|
+
} else {
|
|
1238
|
+
resolve(false)
|
|
1239
|
+
}
|
|
1240
|
+
})
|
|
1241
|
+
} else {
|
|
1242
|
+
if (canEdit === undefined || canEdit === true) {
|
|
1243
|
+
resolve(true)
|
|
1244
|
+
}
|
|
1245
|
+
resolve(false)
|
|
1246
|
+
}
|
|
1247
|
+
})
|
|
1178
1248
|
}
|
|
1179
1249
|
},
|
|
1180
1250
|
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|