agilebuilder-ui 1.0.621 → 1.0.962
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 +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
|
@@ -11,330 +11,50 @@
|
|
|
11
11
|
:width="getColumnWidth()"
|
|
12
12
|
>
|
|
13
13
|
<template v-slot:header>
|
|
14
|
-
<span :class="{ is_req: isFieldRequired() }"
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<span v-if="!column.customHeader" :class="{ is_req: isFieldRequired() }">
|
|
15
|
+
<span :title="$escapeHtml(label)" class="cell--span required__label" v-html="$escapeHtml(label)" />
|
|
16
|
+
</span>
|
|
17
|
+
<component
|
|
18
|
+
:is="column.customHeader"
|
|
19
|
+
v-else
|
|
20
|
+
:prop="column.prop"
|
|
21
|
+
:parent="parentFormData"
|
|
22
|
+
:grid-data="gridData"
|
|
23
|
+
:current-page="currentPage"
|
|
24
|
+
/>
|
|
17
25
|
<el-icon v-if="isShowAdd" style="font-size: 20px; color: #409eff" @click="createFormSubTableRow">
|
|
18
26
|
<CirclePlus />
|
|
19
27
|
</el-icon>
|
|
20
28
|
</template>
|
|
21
29
|
<template v-slot="scope">
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
v-model:value="scope.row[column.prop]"
|
|
26
|
-
:class="isRequired(scope.row.$editing) ? 'm-requried' : ''"
|
|
27
|
-
:column="column"
|
|
30
|
+
<!-- :pagination="pagination" -->
|
|
31
|
+
<NormalColumnContent
|
|
32
|
+
:ref="column.prop"
|
|
28
33
|
:is-sql="isSql"
|
|
29
|
-
:
|
|
34
|
+
:column="column"
|
|
30
35
|
:list-code="listCode"
|
|
36
|
+
:new-width="newWidth"
|
|
37
|
+
:drag-column-prop="dragColumnProp"
|
|
38
|
+
:right-click-menu-arr="options.rightClickMenuArr"
|
|
39
|
+
:table-name="tableName"
|
|
40
|
+
:page-code="pageCode"
|
|
31
41
|
:list-toolbar-form-data="listToolbarFormData"
|
|
32
|
-
:
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:disabled="disabled"
|
|
42
|
+
:list-name="listName"
|
|
43
|
+
:options="options"
|
|
44
|
+
:current-page="currentPage"
|
|
45
|
+
:grid-data="gridData"
|
|
46
|
+
:page-grid-data="pageGridData"
|
|
38
47
|
:row="scope.row"
|
|
39
48
|
:row-index="scope.$index"
|
|
40
|
-
:
|
|
41
|
-
|
|
42
|
-
@
|
|
43
|
-
@prohibit-to-edit="prohibitToEdit"
|
|
49
|
+
:line-edit="lineEdit"
|
|
50
|
+
:custom-format="customFormat"
|
|
51
|
+
@open-page="openPageEvent"
|
|
44
52
|
@refresData="refresData"
|
|
45
|
-
@
|
|
53
|
+
@refresh-list="refreshList"
|
|
46
54
|
@refresPortData="refresPortData"
|
|
47
55
|
@refresPortsData="refresPortsData"
|
|
48
|
-
@
|
|
49
|
-
|
|
50
|
-
<span v-else>
|
|
51
|
-
<span v-if="column.operations" class="grid-operation-buttons">
|
|
52
|
-
<span v-for="(operation, operationIndex) in column.operations" :key="operationIndex" class="cell--span">
|
|
53
|
-
<el-dropdown
|
|
54
|
-
v-if="operation.isGroup"
|
|
55
|
-
:size="operation.buttons && operation.buttons.length > 0 ? operation.buttons[0].props.size : 'small'"
|
|
56
|
-
split-button
|
|
57
|
-
style="padding-left: 10px"
|
|
58
|
-
@command="handleCommand"
|
|
59
|
-
>
|
|
60
|
-
{{ $escapeHtml(operation.label) }}
|
|
61
|
-
<template v-slot:dropdown>
|
|
62
|
-
<el-dropdown-menu>
|
|
63
|
-
<span
|
|
64
|
-
v-for="(buttonChild, buttonChildIndex) in operation.buttons"
|
|
65
|
-
:key="buttonChild.props.code + buttonChildIndex"
|
|
66
|
-
>
|
|
67
|
-
<el-dropdown-item
|
|
68
|
-
v-permission="buttonChild.props.permission"
|
|
69
|
-
:command="beforeHandleCommand(buttonChild.props.code, scope.row, scope.$index)"
|
|
70
|
-
:disabled="preventReclick"
|
|
71
|
-
>
|
|
72
|
-
{{
|
|
73
|
-
$escapeHtml(
|
|
74
|
-
buttonChild.props.label
|
|
75
|
-
? buttonChild.props.label
|
|
76
|
-
: buttonChild.props.code === 'search'
|
|
77
|
-
? $t('superPageMessage.searchButtonLabel')
|
|
78
|
-
: ''
|
|
79
|
-
)
|
|
80
|
-
}}
|
|
81
|
-
</el-dropdown-item>
|
|
82
|
-
</span>
|
|
83
|
-
</el-dropdown-menu>
|
|
84
|
-
</template>
|
|
85
|
-
</el-dropdown>
|
|
86
|
-
<row-operation
|
|
87
|
-
v-else
|
|
88
|
-
:column="column"
|
|
89
|
-
:editing="scope.row.$editing"
|
|
90
|
-
:entity="scope.row"
|
|
91
|
-
:is-show="operation.isShow"
|
|
92
|
-
:label="operation.props.label ? operation.props.label : scope.row[column.prop]"
|
|
93
|
-
:on-click="operation.onClick"
|
|
94
|
-
:operation-index="operationIndex"
|
|
95
|
-
:operation-setting="operation.props"
|
|
96
|
-
:row-index="scope.$index"
|
|
97
|
-
/>
|
|
98
|
-
</span>
|
|
99
|
-
</span>
|
|
100
|
-
<span v-else-if="customFormatValue(scope.row, column.prop, customFormat, scope.$index)" class="cell--span">
|
|
101
|
-
<component
|
|
102
|
-
:is="column.prop + scope.$index"
|
|
103
|
-
:entity="scope.row"
|
|
104
|
-
:parent="parentFormData"
|
|
105
|
-
:prop="column.prop"
|
|
106
|
-
:row="scope.row"
|
|
107
|
-
:row-index="scope.$index"
|
|
108
|
-
:select-options="column.valueSet"
|
|
109
|
-
:show-value="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
110
|
-
:value="getCellValue(scope.row)"
|
|
111
|
-
:additional-param-map="additionalParamMap"
|
|
112
|
-
/>
|
|
113
|
-
</span>
|
|
114
|
-
<!-- 自定义格式的时候 -->
|
|
115
|
-
<span
|
|
116
|
-
v-else-if="
|
|
117
|
-
columnFormatter !== undefined &&
|
|
118
|
-
columnFormatter.type !== undefined &&
|
|
119
|
-
columnFormatter.type === 'customControl' &&
|
|
120
|
-
columnFormatter.options &&
|
|
121
|
-
columnFormatter.options.format &&
|
|
122
|
-
columnFormatter.options.format !== ''
|
|
123
|
-
"
|
|
124
|
-
class="cell--span"
|
|
125
|
-
>
|
|
126
|
-
<!--:key="column.prop+'_'+scope.$index+'_'+currentPage" 为了解决子表分页时,新增自动跳转到下一页,第一条记录的自定义控件被复用,导致业务逻辑没执行 -->
|
|
127
|
-
<component
|
|
128
|
-
:is="columnFormatter.options.format"
|
|
129
|
-
:key="column.prop + '_' + scope.$index + '_' + currentPage"
|
|
130
|
-
:current-page="currentPage"
|
|
131
|
-
:disabled="true"
|
|
132
|
-
:entity="pageGridData[scope.$index]"
|
|
133
|
-
:get-form-data="getFormData"
|
|
134
|
-
:get-grid-data="getTableGridData"
|
|
135
|
-
:grid-data="gridData"
|
|
136
|
-
:page-grid-data="pageGridData"
|
|
137
|
-
:parent="parentFormData"
|
|
138
|
-
:prop="column.prop"
|
|
139
|
-
:row="pageGridData[scope.$index]"
|
|
140
|
-
:row-index="scope.$index"
|
|
141
|
-
:select-options="column.valueSet"
|
|
142
|
-
:show-value="$escapeHtml(getLabel(pageGridData[scope.$index], scope.$index))"
|
|
143
|
-
:value="getCellValue(pageGridData[scope.$index])"
|
|
144
|
-
:additional-param-map="additionalParamMap"
|
|
145
|
-
/></span>
|
|
146
|
-
<span
|
|
147
|
-
v-else-if="
|
|
148
|
-
columnFormatter !== undefined && columnFormatter.type !== undefined && columnFormatter.type === 'secretInfo'
|
|
149
|
-
"
|
|
150
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
151
|
-
class="cell--span"
|
|
152
|
-
>
|
|
153
|
-
<secret-info
|
|
154
|
-
:entity="scope.row"
|
|
155
|
-
:field-label="$escapeHtml(label)"
|
|
156
|
-
:list-code="listCode"
|
|
157
|
-
:list-name="listName"
|
|
158
|
-
:page-code="pageCode"
|
|
159
|
-
:prop="column.prop"
|
|
160
|
-
:table-name="tableName"
|
|
161
|
-
:value="getCellValue(scope.row)"
|
|
162
|
-
/>
|
|
163
|
-
</span>
|
|
164
|
-
<span v-else-if="isObjectProp(column.prop)">
|
|
165
|
-
<span v-if="column.formatter && column.formatter.type === 'files'" type="primary">
|
|
166
|
-
<span
|
|
167
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
168
|
-
:style="{ width: cellWidth + 'px' }"
|
|
169
|
-
:title="isShowOverflowTooltip ? $escapeHtml(getLabel(scope.row)) : ''"
|
|
170
|
-
class="ellipsis cell--span"
|
|
171
|
-
>
|
|
172
|
-
<FsPreview
|
|
173
|
-
:entity="scope.row"
|
|
174
|
-
:file-set-obj="getFilesFormatter()"
|
|
175
|
-
:is-sql="isSql"
|
|
176
|
-
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
177
|
-
/>
|
|
178
|
-
</span>
|
|
179
|
-
</span>
|
|
180
|
-
<!-- <el-link
|
|
181
|
-
v-else-if="
|
|
182
|
-
columnFormatter !== undefined &&
|
|
183
|
-
columnFormatter.type !== undefined &&
|
|
184
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
185
|
-
getMyHyperLinkSetting(scope.row).visible === true
|
|
186
|
-
"
|
|
187
|
-
type="primary"
|
|
188
|
-
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
189
|
-
> -->
|
|
190
|
-
<el-link
|
|
191
|
-
v-else-if="
|
|
192
|
-
columnFormatter !== undefined &&
|
|
193
|
-
columnFormatter.type !== undefined &&
|
|
194
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
195
|
-
getMyHyperLinkSetting(scope.row).visible === true
|
|
196
|
-
"
|
|
197
|
-
:type="getLinkType(scope.row)"
|
|
198
|
-
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
199
|
-
>
|
|
200
|
-
<span
|
|
201
|
-
v-if="isShowOverflowTooltip"
|
|
202
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
203
|
-
:style="{ width: cellWidth + 'px' }"
|
|
204
|
-
:title="getMyHyperLinkSetting(scope.row).title"
|
|
205
|
-
class="ellipsis cell--span"
|
|
206
|
-
>{{ getMyHyperLinkSetting(scope.row).label }}
|
|
207
|
-
<el-icon v-if="getMyHyperLinkSetting(scope.row).icon">
|
|
208
|
-
<component :is="getMyHyperLinkSetting(scope.row).icon" />
|
|
209
|
-
</el-icon>
|
|
210
|
-
</span>
|
|
211
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span"
|
|
212
|
-
>{{ getMyHyperLinkSetting(scope.row).label }}
|
|
213
|
-
<el-icon v-if="getMyHyperLinkSetting(scope.row).icon">
|
|
214
|
-
<component :is="getMyHyperLinkSetting(scope.row).icon" />
|
|
215
|
-
</el-icon>
|
|
216
|
-
</span>
|
|
217
|
-
</el-link>
|
|
218
|
-
<span
|
|
219
|
-
v-else-if="isShowOverflowTooltip"
|
|
220
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
221
|
-
:style="{ width: cellWidth + 'px' }"
|
|
222
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
223
|
-
class="ellipsis cell--span"
|
|
224
|
-
>{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}</span
|
|
225
|
-
>
|
|
226
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span">{{
|
|
227
|
-
$escapeHtml(getLabel(scope.row, scope.$index))
|
|
228
|
-
}}</span>
|
|
229
|
-
</span>
|
|
230
|
-
<span v-else>
|
|
231
|
-
<span v-if="column.componentType === 'annex' || column.componentType === 'multipartUpload'" type="primary">
|
|
232
|
-
<span
|
|
233
|
-
v-if="isShowOverflowTooltip"
|
|
234
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
235
|
-
:style="{ width: cellWidth + 'px' }"
|
|
236
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
237
|
-
class="ellipsis cell--span"
|
|
238
|
-
>
|
|
239
|
-
<FsPreview
|
|
240
|
-
:entity="scope.row"
|
|
241
|
-
:file-set-obj="getFileObj(column.fileSet)"
|
|
242
|
-
:is-sql="isSql"
|
|
243
|
-
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
244
|
-
/>
|
|
245
|
-
</span>
|
|
246
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span">
|
|
247
|
-
<FsPreview
|
|
248
|
-
:entity="scope.row"
|
|
249
|
-
:file-set-obj="getFileObj(column.fileSet)"
|
|
250
|
-
:is-sql="isSql"
|
|
251
|
-
:label="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
252
|
-
/>
|
|
253
|
-
</span>
|
|
254
|
-
</span>
|
|
255
|
-
<span v-else-if="column.formatter && column.formatter.type === 'files'">
|
|
256
|
-
<span
|
|
257
|
-
v-if="isShowOverflowTooltip"
|
|
258
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
259
|
-
:style="{ width: cellWidth + 'px' }"
|
|
260
|
-
:title="$escapeHtml(getLabel(scope.row))"
|
|
261
|
-
class="ellipsis cell--span"
|
|
262
|
-
>
|
|
263
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
264
|
-
<el-icon class="annex-cell" @click="previewImg(scope.row)"><el-icon-zoom-in /></el-icon>
|
|
265
|
-
</span>
|
|
266
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
267
|
-
</span>
|
|
268
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span">
|
|
269
|
-
<span v-if="$escapeHtml(getLabel(scope.row, scope.$index))">
|
|
270
|
-
<el-icon class="annex-cell" @click="previewImg(scope.row)"><el-icon-zoom-in /></el-icon>
|
|
271
|
-
</span>
|
|
272
|
-
{{ $escapeHtml(getLabel(scope.row, scope.$index)) }}
|
|
273
|
-
</span>
|
|
274
|
-
</span>
|
|
275
|
-
<!-- 超链接 -->
|
|
276
|
-
<el-link
|
|
277
|
-
v-else-if="
|
|
278
|
-
columnFormatter !== undefined &&
|
|
279
|
-
columnFormatter.type !== undefined &&
|
|
280
|
-
columnFormatter.type === 'hyperlinks' &&
|
|
281
|
-
getMyHyperLinkSetting(scope.row).visible === true
|
|
282
|
-
"
|
|
283
|
-
type="primary"
|
|
284
|
-
@click="clickHyperLink(column, scope.row, listCode, scope.$index)"
|
|
285
|
-
>
|
|
286
|
-
<span
|
|
287
|
-
v-if="isShowOverflowTooltip"
|
|
288
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
289
|
-
:style="{ width: cellWidth + 'px' }"
|
|
290
|
-
:title="$escapeHtml(getMyHyperLinkSetting(scope.row).title)"
|
|
291
|
-
class="ellipsis cell--span"
|
|
292
|
-
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label) }}
|
|
293
|
-
<el-icon v-if="getMyHyperLinkSetting(scope.row).icon">
|
|
294
|
-
<component :is="getMyHyperLinkSetting(scope.row).icon" />
|
|
295
|
-
</el-icon>
|
|
296
|
-
</span>
|
|
297
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span"
|
|
298
|
-
>{{ $escapeHtml(getMyHyperLinkSetting(scope.row).label) }}
|
|
299
|
-
<el-icon v-if="getMyHyperLinkSetting(scope.row).icon">
|
|
300
|
-
<component :is="getMyHyperLinkSetting(scope.row).icon" />
|
|
301
|
-
</el-icon>
|
|
302
|
-
</span>
|
|
303
|
-
</el-link>
|
|
304
|
-
<!-- 富文本 -->
|
|
305
|
-
<span v-else-if="column.formatter && column.formatter.type === 'richEditor'">
|
|
306
|
-
<el-tooltip :content="$t('superGrid.show')" class="item" effect="dark" placement="top">
|
|
307
|
-
<em class="fa fa-info-circle annex-cell" @click="showRichEditorContent(scope.row, column, getHeader())" />
|
|
308
|
-
</el-tooltip>
|
|
309
|
-
</span>
|
|
310
|
-
<GridIcon
|
|
311
|
-
v-else-if="column.formatter && column.formatter.type === 'icon'"
|
|
312
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
313
|
-
:column="column"
|
|
314
|
-
:row="scope.row"
|
|
315
|
-
:row-index="scope.$index"
|
|
316
|
-
:is-sql="isSql"
|
|
317
|
-
:list-code="listCode"
|
|
318
|
-
/>
|
|
319
|
-
<span
|
|
320
|
-
v-else-if="isShowOverflowTooltip"
|
|
321
|
-
:id="column.prop + 'DomData' + scope.$index"
|
|
322
|
-
:style="{ width: cellWidth + 'px' }"
|
|
323
|
-
:title="getLabel(scope.row)"
|
|
324
|
-
class="ellipsis cell--span"
|
|
325
|
-
style="white-space: pre"
|
|
326
|
-
v-html="$escapeHtml(getLabel(scope.row, scope.$index))"
|
|
327
|
-
/>
|
|
328
|
-
<span v-else :id="column.prop + 'DomData' + scope.$index" class="cell--span">{{
|
|
329
|
-
$escapeHtml(getLabel(scope.row, scope.$index))
|
|
330
|
-
}}</span>
|
|
331
|
-
</span>
|
|
332
|
-
</span>
|
|
333
|
-
<view-image-dialog v-if="showSingleImgFlag" :file-list="fileList" @close="showSingleImgFlag = false" />
|
|
334
|
-
<rich-editor-viewer
|
|
335
|
-
v-if="showRichEditorViewer"
|
|
336
|
-
ref="richEditorViewerRef"
|
|
337
|
-
@closeRichEditorContent="closeRichEditorContent"
|
|
56
|
+
@refresMainTableFields="refresMainTableFields"
|
|
57
|
+
@prohibitToEdit="prohibitToEdit"
|
|
338
58
|
/>
|
|
339
59
|
</template>
|
|
340
60
|
</el-table-column>
|
|
@@ -343,29 +63,18 @@
|
|
|
343
63
|
<script>
|
|
344
64
|
import { CirclePlus, ZoomIn as ElIconZoomIn } from '@element-plus/icons-vue'
|
|
345
65
|
import { $emit, $off, $on } from '../../utils/gogocodeTransfer'
|
|
346
|
-
import {
|
|
347
|
-
ArrowKeyAction,
|
|
348
|
-
getColumnValues,
|
|
349
|
-
getFileList,
|
|
350
|
-
isDynamicDataSourceSource,
|
|
351
|
-
isHasEditOption,
|
|
352
|
-
isRequiredEdit,
|
|
353
|
-
getAdditionalParamMap
|
|
354
|
-
} from './utils'
|
|
66
|
+
import { getColumnValues, isRequiredEdit, getContentAlign, getHeaderAlign, getHeaderLable } from './utils'
|
|
355
67
|
import DynamicInput from './dynamic-input.vue'
|
|
356
68
|
import store from './store'
|
|
357
|
-
import { doFormatWithValueSet } from './formatter'
|
|
358
69
|
import customFormatter from './custom-formatter'
|
|
359
70
|
import RowOperation from './row-operation.vue'
|
|
360
71
|
import apis from './apis'
|
|
361
72
|
import { mapGetters } from 'vuex'
|
|
362
|
-
import { getEntityFieldValue, getParentObjectUtil } from '../../../src/utils/util'
|
|
363
73
|
import ViewImageDialog from './view-image-dialog.vue'
|
|
364
|
-
import eventBus from './eventBus'
|
|
365
74
|
import FsPreview from '../../fs-preview'
|
|
366
75
|
import RichEditorViewer from '../../rich-editor/viewer.vue'
|
|
367
76
|
import GridIcon from './components/grid-icon.vue'
|
|
368
|
-
import
|
|
77
|
+
import NormalColumnContent from './normal-column-content.vue'
|
|
369
78
|
export default {
|
|
370
79
|
components: {
|
|
371
80
|
DynamicInput,
|
|
@@ -375,7 +84,8 @@ export default {
|
|
|
375
84
|
RichEditorViewer,
|
|
376
85
|
CirclePlus,
|
|
377
86
|
ElIconZoomIn,
|
|
378
|
-
GridIcon
|
|
87
|
+
GridIcon,
|
|
88
|
+
NormalColumnContent
|
|
379
89
|
},
|
|
380
90
|
name: 'NormalColumn',
|
|
381
91
|
props: {
|
|
@@ -435,34 +145,22 @@ export default {
|
|
|
435
145
|
data() {
|
|
436
146
|
let parentFormData
|
|
437
147
|
const gridParams = store.get(this.listCode)
|
|
148
|
+
const options = gridParams.options
|
|
438
149
|
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
439
150
|
parentFormData = gridParams.options.extraParam.entityMap
|
|
440
151
|
}
|
|
441
|
-
|
|
152
|
+
|
|
442
153
|
return {
|
|
443
154
|
selectRow: null,
|
|
444
155
|
that: this,
|
|
445
156
|
align: 'left', // 文本内容对齐
|
|
446
157
|
headerAlign: 'left', // 表头对齐方式
|
|
447
|
-
columnFormatter: this.column.formatter,
|
|
448
|
-
hyperLinks: {},
|
|
449
|
-
fileDownType: '',
|
|
450
158
|
isFormSubTable: false, // 是否是表单子表
|
|
451
159
|
subTableCanAdd: true, // 表单子表时是否有新增权限
|
|
452
160
|
isShowAdd: false, // 是否显示表头的新增按钮
|
|
453
161
|
cellWidth: null,
|
|
454
162
|
parentFormData,
|
|
455
|
-
|
|
456
|
-
showSingleImgFlag: false,
|
|
457
|
-
singleImgSrc: '',
|
|
458
|
-
fileList: [],
|
|
459
|
-
index: null,
|
|
460
|
-
isEditable: this.column.editable,
|
|
461
|
-
showRichEditorViewer: false,
|
|
462
|
-
getFormData: gridParams.options.getFormData,
|
|
463
|
-
getTableGridData: gridParams.options.getGridData,
|
|
464
|
-
additionalParamMap,
|
|
465
|
-
disabled: false
|
|
163
|
+
options
|
|
466
164
|
}
|
|
467
165
|
},
|
|
468
166
|
computed: {
|
|
@@ -578,35 +276,13 @@ export default {
|
|
|
578
276
|
) {
|
|
579
277
|
this.subTableCanAdd = gridParams.options.subTableCanAdd
|
|
580
278
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
this.
|
|
584
|
-
} else {
|
|
585
|
-
if (
|
|
586
|
-
typeof gridParams.options.showOverflowTooltip !== 'undefined' &&
|
|
587
|
-
gridParams.options.showOverflowTooltip === false
|
|
588
|
-
) {
|
|
589
|
-
this.isShowOverflowTooltip = false
|
|
590
|
-
} else {
|
|
591
|
-
this.isShowOverflowTooltip = true
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
if (typeof gridParams.options.align !== 'undefined') {
|
|
595
|
-
this.align = gridParams.options.align
|
|
596
|
-
} else if (this.column.contAlign && this.column.contAlign !== '') {
|
|
597
|
-
this.align = this.column.contAlign
|
|
279
|
+
const align = getContentAlign(this.column, gridParams)
|
|
280
|
+
if (align) {
|
|
281
|
+
this.align = align
|
|
598
282
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
this.headerAlign = this.column.titleAlign
|
|
603
|
-
} else {
|
|
604
|
-
// 如果没有配置表头对齐方式,默认使用内容对齐方式
|
|
605
|
-
this.headerAlign = 'left'
|
|
606
|
-
}
|
|
607
|
-
if (gridParams.isHasDynamic === undefined && this.column.dynamic !== undefined && this.column.dynamic === true) {
|
|
608
|
-
// 当前列表中有动态列
|
|
609
|
-
gridParams.isHasDynamic = true
|
|
283
|
+
const headerAlign = getHeaderAlign(this.column, gridParams)
|
|
284
|
+
if (headerAlign) {
|
|
285
|
+
this.headerAlign = headerAlign
|
|
610
286
|
}
|
|
611
287
|
this.label = this.getHeader()
|
|
612
288
|
if (this.column.operations) {
|
|
@@ -619,337 +295,39 @@ export default {
|
|
|
619
295
|
this.subTableCanAdd &&
|
|
620
296
|
gridParams.options &&
|
|
621
297
|
gridParams.options.showOperationButton
|
|
622
|
-
if (this.column.fileSet && this.column.fileSet !== '' && this.column.componentType === 'annex') {
|
|
623
|
-
const fileSetObj = JSON.parse(this.column.fileSet)
|
|
624
|
-
if (fileSetObj && fileSetObj.multiple) {
|
|
625
|
-
this.fileMultiple = true
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
},
|
|
629
|
-
mounted() {
|
|
630
|
-
// 监听保存时点击按钮事件线触发
|
|
631
|
-
$on(eventBus, 'un-edit', (param) => {
|
|
632
|
-
// 处理多选选项组问题保存问题
|
|
633
|
-
if (
|
|
634
|
-
this.column.componentType &&
|
|
635
|
-
(this.column.componentType === 'multiselect' || this.column.componentType === 'select')
|
|
636
|
-
) {
|
|
637
|
-
const isDynamic = isDynamicDataSourceSource(this.column)
|
|
638
|
-
if (!isDynamic) {
|
|
639
|
-
// 选项组保存时将数组处理为字符串
|
|
640
|
-
const beforeColumnValue = param.row[this.column.prop]
|
|
641
|
-
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
642
|
-
// 如果是数组才需要转换
|
|
643
|
-
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
644
|
-
}
|
|
645
|
-
} else {
|
|
646
|
-
// 动态数据源多选保存时,获取已选择的字段,由于多选选项组的值是数组,保存时要拼接成“ ,” 分隔的字符串
|
|
647
|
-
if ('_dynamic-source-data-' + this.column.prop in this.column) {
|
|
648
|
-
const temp = this.column['_dynamic-source-data-' + this.column.prop]
|
|
649
|
-
const valueSetOptions = temp.valueSetOptions
|
|
650
|
-
// 获取当前字段对应在映射关系中对应的是动态数据源中的哪一个字段key
|
|
651
|
-
let selectDataKey
|
|
652
|
-
for (let i = 0; i < valueSetOptions.length; i++) {
|
|
653
|
-
const valueSetOption = valueSetOptions[i]
|
|
654
|
-
if (this.column.prop === valueSetOption.valueColumn.dbColumnName) {
|
|
655
|
-
selectDataKey = valueSetOption.columnName
|
|
656
|
-
break
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
if (selectDataKey) {
|
|
660
|
-
// beforeColumnValue是数组值,如果是单选则是字符串
|
|
661
|
-
let beforeColumnValue = param.row[this.column.prop]
|
|
662
|
-
if (this.column.componentType === 'select') {
|
|
663
|
-
if (selectDataKey !== temp.valueAttribute) {
|
|
664
|
-
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
665
|
-
beforeColumnValue = temp.optionItems.find(
|
|
666
|
-
(item) =>
|
|
667
|
-
// 当前字段映射的是工厂名称,
|
|
668
|
-
// 筛选动态数据源选项值字段对应的当前字段所映射的字段, 例如 根据工厂编码找工厂编码对应的工厂名称
|
|
669
|
-
// 找出名称后赋值给当前字段
|
|
670
|
-
item[temp.valueAttribute] === beforeColumnValue
|
|
671
|
-
)[selectDataKey]
|
|
672
|
-
}
|
|
673
|
-
// 如果是单选
|
|
674
|
-
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
675
|
-
// temp.optionItems.forEach(optionItem => {
|
|
676
|
-
// if (optionItem[temp.valueAttribute] === beforeColumnValue) {
|
|
677
|
-
// this.$set(param.row, this.column.prop, optionItem[selectDataKey])
|
|
678
|
-
// }
|
|
679
|
-
// })
|
|
680
|
-
param.row[this.column.prop] = beforeColumnValue
|
|
681
|
-
} else {
|
|
682
|
-
// 如果是多选,join “ ,” , 并给row赋值
|
|
683
|
-
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
684
|
-
// const afterColumnValue = []
|
|
685
|
-
// temp.optionItems.forEach(optionItem => {
|
|
686
|
-
// beforeColumnValue.forEach(value => {
|
|
687
|
-
// if (optionItem[temp.valueAttribute] === value) {
|
|
688
|
-
// afterColumnValue.push(optionItem[selectDataKey])
|
|
689
|
-
// }
|
|
690
|
-
// })
|
|
691
|
-
// })
|
|
692
|
-
if (beforeColumnValue && selectDataKey !== temp.valueAttribute) {
|
|
693
|
-
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
694
|
-
const t = []
|
|
695
|
-
beforeColumnValue.forEach((selectItem) => {
|
|
696
|
-
if (selectDataKey !== temp.valueAttribute) {
|
|
697
|
-
t.push(
|
|
698
|
-
temp.optionItems.find((option) => option[temp.valueAttribute] === selectItem)[selectDataKey]
|
|
699
|
-
)
|
|
700
|
-
}
|
|
701
|
-
})
|
|
702
|
-
beforeColumnValue = t
|
|
703
|
-
}
|
|
704
|
-
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
} else {
|
|
708
|
-
const beforeColumnValue = param.row[this.column.prop]
|
|
709
|
-
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
710
|
-
// 如果是数组才需要转换
|
|
711
|
-
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
})
|
|
717
|
-
const that = this
|
|
718
|
-
if (this.$parent.$parent && this.$parent.$parent.$options._componentTag === 'GroupColumn') {
|
|
719
|
-
eventBus.$on('prohibitToEdit', (param) => {
|
|
720
|
-
if (param[that.column.prop] !== undefined) {
|
|
721
|
-
that.fnProhibitToEdit(param[that.column.prop])
|
|
722
|
-
}
|
|
723
|
-
})
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
unmounted() {
|
|
727
|
-
$off(eventBus, 'un-edit')
|
|
728
|
-
if (this.$parent.$parent && this.$parent.$parent.$options._componentTag === 'GroupColumn') {
|
|
729
|
-
eventBus.$off('prohibitToEdit')
|
|
730
|
-
}
|
|
731
298
|
},
|
|
299
|
+
mounted() {},
|
|
300
|
+
unmounted() {},
|
|
732
301
|
methods: {
|
|
733
302
|
...customFormatter,
|
|
734
303
|
...apis,
|
|
735
|
-
getFileObj(fileSet) {
|
|
736
|
-
if (fileSet) {
|
|
737
|
-
return JSON.parse(fileSet)
|
|
738
|
-
}
|
|
739
|
-
},
|
|
740
304
|
getHeader() {
|
|
741
|
-
|
|
742
|
-
return this.column.label.replace(/\\n/g, '</br>')
|
|
743
|
-
} else {
|
|
744
|
-
return this.formatHeader()
|
|
745
|
-
}
|
|
746
|
-
},
|
|
747
|
-
formatHeader() {
|
|
748
|
-
return doFormatWithValueSet(this.column.titleValueSetValue, this.column.label)
|
|
305
|
+
return getHeaderLable(this.column)
|
|
749
306
|
},
|
|
750
307
|
filterHandler(value, row, column) {
|
|
751
308
|
const property = column['property']
|
|
752
309
|
return row[property] === value
|
|
753
310
|
},
|
|
754
|
-
onFocus(index) {
|
|
755
|
-
const gridParams = store.get(this.listCode)
|
|
756
|
-
if (gridParams.lineEdit.editingCell) {
|
|
757
|
-
gridParams.lineEdit.editingCell.row = index
|
|
758
|
-
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
759
|
-
}
|
|
760
|
-
},
|
|
761
|
-
findIndex(index) {
|
|
762
|
-
this.index = index
|
|
763
|
-
const gridParams = store.get(this.listCode)
|
|
764
|
-
if (gridParams.lineEdit.editingCell) {
|
|
765
|
-
gridParams.lineEdit.editingCell.row = index
|
|
766
|
-
gridParams.lineEdit.editingCell.prop = this.column.prop
|
|
767
|
-
}
|
|
768
|
-
},
|
|
769
311
|
refresData(data) {
|
|
770
312
|
$emit(this, 'refresData', data)
|
|
771
313
|
},
|
|
772
|
-
refresPortData(port, value) {
|
|
773
|
-
|
|
774
|
-
console.log('gridParams', gridParams)
|
|
775
|
-
console.log('this.index', this.index)
|
|
776
|
-
if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editingCell) {
|
|
777
|
-
$emit(this, 'refresPortData', port, value, gridParams.lineEdit.editingCell.row)
|
|
778
|
-
} else {
|
|
779
|
-
$emit(this, 'refresPortData', port, value, this.index)
|
|
780
|
-
}
|
|
314
|
+
refresPortData(port, value, index) {
|
|
315
|
+
$emit(this, 'refresPortData', port, value, index)
|
|
781
316
|
},
|
|
782
|
-
refresPortsData(map) {
|
|
783
|
-
|
|
784
|
-
console.log('gridParams', gridParams)
|
|
785
|
-
console.log('this.index', this.index)
|
|
786
|
-
if (gridParams && gridParams.lineEdit && gridParams.lineEdit.editingCell) {
|
|
787
|
-
$emit(this, 'refresPortsData', map, gridParams.lineEdit.editingCell.row)
|
|
788
|
-
} else {
|
|
789
|
-
$emit(this, 'refresPortsData', map, this.index)
|
|
790
|
-
}
|
|
317
|
+
refresPortsData(map, index) {
|
|
318
|
+
$emit(this, 'refresPortsData', map, index)
|
|
791
319
|
},
|
|
792
320
|
refresMainTableFields(map) {
|
|
793
321
|
$emit(this, 'refresMainTableFields', map)
|
|
794
322
|
},
|
|
795
|
-
// @keyup.native.left="move('left')"
|
|
796
|
-
// @keyup.native.right="move('right')"
|
|
797
|
-
// @keyup.native.up="move('up')"
|
|
798
|
-
// @keyup.native.down="move('down')"
|
|
799
|
-
move(direction) {
|
|
800
|
-
if (direction === 'left') {
|
|
801
|
-
const prop = ArrowKeyAction.getLeftColumn(this.column.prop)
|
|
802
|
-
const gridParams = store.get(this.listCode)
|
|
803
|
-
gridParams.lineEdit.editingCell.prop = prop
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
323
|
// filterHandler(value, row, column) {
|
|
807
324
|
// const property = column['property']
|
|
808
325
|
// return row[property] === value
|
|
809
326
|
// },
|
|
810
|
-
isSaveByEnter() {
|
|
811
|
-
const gridParams = store.get(this.listCode)
|
|
812
|
-
return (
|
|
813
|
-
typeof gridParams.options.lineEditOptions.isSaveByEnter === 'undefined' ||
|
|
814
|
-
(isHasEditOption('isSaveByEnter', this.listCode) && gridParams.options.lineEditOptions.isSaveByEnter === true)
|
|
815
|
-
)
|
|
816
|
-
},
|
|
817
|
-
isRestoreByEsc() {
|
|
818
|
-
const gridParams = store.get(this.listCode)
|
|
819
|
-
return (
|
|
820
|
-
typeof gridParams.options.lineEditOptions.isRestoreByEsc === 'undefined' ||
|
|
821
|
-
(isHasEditOption('isRestoreByEsc', this.listCode) && gridParams.options.lineEditOptions.isRestoreByEsc === true)
|
|
822
|
-
)
|
|
823
|
-
},
|
|
824
|
-
canFocus(index) {
|
|
825
|
-
const gridParams = store.get(this.listCode)
|
|
826
|
-
if (index === gridParams.lineEdit.editingCell.row && this.column.prop === gridParams.lineEdit.editingCell.prop) {
|
|
827
|
-
return true
|
|
828
|
-
} else {
|
|
829
|
-
return false
|
|
830
|
-
}
|
|
831
|
-
},
|
|
832
|
-
getLabel(row, index) {
|
|
833
|
-
this.transferColumnDataToUpperCase(row)
|
|
834
|
-
const obj = this.objectPropValueTwo(row, this.column)
|
|
835
|
-
// // 存储执行时间
|
|
836
|
-
// const get2 = new Date().getTime()
|
|
837
|
-
// const get3 = Number(get2) - Number(get1)
|
|
838
|
-
// if (!window.sessionStorage.getItem('getLabel')) {
|
|
839
|
-
// window.sessionStorage.setItem('getLabel', get3)
|
|
840
|
-
// } else {
|
|
841
|
-
// const get4 = window.sessionStorage.getItem('getLabel')
|
|
842
|
-
// const get5 = Number(get4) + Number(get3)
|
|
843
|
-
// window.sessionStorage.setItem('getLabel', get5)
|
|
844
|
-
// }
|
|
845
|
-
return obj
|
|
846
|
-
// const returnValue = this.objectPropValueTwo(row, this.column)
|
|
847
|
-
// if (returnValue) {
|
|
848
|
-
// // 解决当文本中有多个空格时候, vue自动将多个空格合并为一个空格,
|
|
849
|
-
// // 或者修改vue的配置 https://cn.vuejs.org/api/application.html#app-config-compileroptions app.config.compilerOptions.whitespace
|
|
850
|
-
// return returnValue.replaceAll(' ', '\u00A0')
|
|
851
|
-
// }
|
|
852
|
-
// return returnValue
|
|
853
|
-
},
|
|
854
|
-
getCellValue(row) {
|
|
855
|
-
let cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
856
|
-
if (cellValue === undefined || cellValue === null) {
|
|
857
|
-
this.transferColumnDataToUpperCase(row)
|
|
858
|
-
cellValue = getEntityFieldValue(row, this.column.prop, false)
|
|
859
|
-
}
|
|
860
|
-
return cellValue
|
|
861
|
-
},
|
|
862
|
-
// 兼容oracle和mysql数据库,oracle是字段名是大写的,mysql是小写的,将小写转为大写
|
|
863
|
-
transferColumnDataToUpperCase(row) {
|
|
864
|
-
const reg1 = /[A-Z]+/ // 大写字母
|
|
865
|
-
if (this.isSql && reg1.test(this.column.prop)) {
|
|
866
|
-
this.transferColumnDataToUpperCaseWithProp(row, this.column.prop.toLowerCase(), this.column.prop)
|
|
867
|
-
}
|
|
868
|
-
},
|
|
869
|
-
transferColumnDataToUpperCaseWithProp(row, propLowerCase, columnProp) {
|
|
870
|
-
let dataModel
|
|
871
|
-
if (propLowerCase && propLowerCase.indexOf('.') > 0) {
|
|
872
|
-
const parentObj = getParentObjectUtil(propLowerCase, row)
|
|
873
|
-
const prop = propLowerCase.substring(propLowerCase.lastIndexOf('.') + 1)
|
|
874
|
-
dataModel = parentObj[prop]
|
|
875
|
-
if (dataModel !== undefined) {
|
|
876
|
-
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
877
|
-
parentObj[columnProp] = dataModel
|
|
878
|
-
delete parentObj[prop]
|
|
879
|
-
}
|
|
880
|
-
} else {
|
|
881
|
-
dataModel = row[propLowerCase]
|
|
882
|
-
if (dataModel !== undefined) {
|
|
883
|
-
// sql字段名小写转大写,兼容mysql、oracle数据库
|
|
884
|
-
row[columnProp] = dataModel
|
|
885
|
-
delete row[propLowerCase]
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
return dataModel
|
|
889
|
-
},
|
|
890
|
-
getMyHyperLinkSetting(row) {
|
|
891
|
-
this.transferColumnDataToUpperCase(row)
|
|
892
|
-
const gridParams = store.get(this.listCode)
|
|
893
|
-
let tableName
|
|
894
|
-
if (gridParams && gridParams.basicInfo && gridParams.basicInfo.tableName) {
|
|
895
|
-
tableName = gridParams.basicInfo.tableName
|
|
896
|
-
}
|
|
897
|
-
const hyperLinkResult = this.getHyperLinkSetting(
|
|
898
|
-
this.column,
|
|
899
|
-
row,
|
|
900
|
-
this.isSql,
|
|
901
|
-
this.additionalParamMap,
|
|
902
|
-
gridParams.contextParameter,
|
|
903
|
-
tableName,
|
|
904
|
-
this.listCode
|
|
905
|
-
)
|
|
906
|
-
hyperLinkResult.icon = this.getHyperIconClass(hyperLinkResult)
|
|
907
|
-
return hyperLinkResult
|
|
908
|
-
},
|
|
909
|
-
getHyperIconClass(hyperLinkResult) {
|
|
910
|
-
let iconName
|
|
911
|
-
if (hyperLinkResult && hyperLinkResult !== null && hyperLinkResult.icon && hyperLinkResult.icon !== '') {
|
|
912
|
-
iconName = hyperLinkResult.icon
|
|
913
|
-
}
|
|
914
|
-
if (iconName && iconName.indexOf('fa-') === 0) {
|
|
915
|
-
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
916
|
-
iconName = 'fa ' + iconName
|
|
917
|
-
}
|
|
918
|
-
return iconName
|
|
919
|
-
},
|
|
920
327
|
createFormSubTableRow() {
|
|
921
328
|
console.log('触发了行新建')
|
|
922
329
|
this.createRow(this.listCode)
|
|
923
330
|
},
|
|
924
|
-
handleCommand(comman) {
|
|
925
|
-
let prop = null
|
|
926
|
-
this.column.operations.forEach((item) => {
|
|
927
|
-
if (item.isGroup) {
|
|
928
|
-
item.buttons.forEach((button) => {
|
|
929
|
-
if (button.props.code === comman.comman) {
|
|
930
|
-
prop = button
|
|
931
|
-
}
|
|
932
|
-
})
|
|
933
|
-
}
|
|
934
|
-
})
|
|
935
|
-
if (prop) {
|
|
936
|
-
customFormatter.onClickFun(comman.row, this.column, prop.onClick, comman.rowIndex)
|
|
937
|
-
}
|
|
938
|
-
},
|
|
939
|
-
beforeHandleCommand(comman, row, rowIndex) {
|
|
940
|
-
return {
|
|
941
|
-
comman: comman,
|
|
942
|
-
row: row,
|
|
943
|
-
rowIndex: rowIndex
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
previewImg(row) {
|
|
947
|
-
this.fileList = getFileList(row, this.column, this.isSql)
|
|
948
|
-
this.showSingleImgFlag = true
|
|
949
|
-
},
|
|
950
|
-
getFileList(row) {
|
|
951
|
-
return getFileList(row, this.column, this.isSql)
|
|
952
|
-
},
|
|
953
331
|
getColumnWidth() {
|
|
954
332
|
if (this.column && this.column.prop === 'operation' && !this.column.width) {
|
|
955
333
|
// 表示操作列,宽度固定
|
|
@@ -959,9 +337,7 @@ export default {
|
|
|
959
337
|
},
|
|
960
338
|
// 设置字段禁止编辑
|
|
961
339
|
fnProhibitToEdit(isEditable) {
|
|
962
|
-
this.$
|
|
963
|
-
this.disabled = !isEditable
|
|
964
|
-
})
|
|
340
|
+
this.$refs[this.column.prop].fnProhibitToEdit(isEditable)
|
|
965
341
|
},
|
|
966
342
|
// 设置字段禁止编辑
|
|
967
343
|
prohibitToEdit(entity) {
|
|
@@ -971,75 +347,16 @@ export default {
|
|
|
971
347
|
return isRequiredEdit(this.column, this.listCode)
|
|
972
348
|
// return true
|
|
973
349
|
},
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
this.showRichEditorViewer = true
|
|
977
|
-
this.$nextTick(() => {
|
|
978
|
-
this.$refs.richEditorViewerRef.showContent(row[column.prop], header)
|
|
979
|
-
})
|
|
350
|
+
refreshList() {
|
|
351
|
+
this.$emit('refresh-list')
|
|
980
352
|
},
|
|
981
|
-
|
|
982
|
-
this
|
|
983
|
-
},
|
|
984
|
-
isRequired(editing) {
|
|
985
|
-
if (!this.isFormSubTable && this.lineEdit.editable && this.isEditable && editing && this.column.validations) {
|
|
986
|
-
if (this.column.validations.indexOf('"required":true') > 0) {
|
|
987
|
-
return true
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
return false
|
|
991
|
-
},
|
|
992
|
-
getFormatIconSetting(row) {
|
|
993
|
-
this.transferColumnDataToUpperCase(row)
|
|
994
|
-
const gridParams = store.get(this.listCode)
|
|
995
|
-
const result = this.getIconSetting(this.column, row, this.isSql, gridParams, this.listCode)
|
|
996
|
-
result.icon = this.getHyperIconClass(result)
|
|
997
|
-
if (this.column.formatter.options && this.column.formatter.options.format) {
|
|
998
|
-
result.position = JSON.parse(this.column.formatter.options.format).position
|
|
999
|
-
}
|
|
1000
|
-
return result
|
|
1001
|
-
},
|
|
1002
|
-
getLinkType(row) {
|
|
1003
|
-
if (this.column.events && this.column.events['cellStyle']) {
|
|
1004
|
-
const params = {
|
|
1005
|
-
value: row[this.column.property],
|
|
1006
|
-
row: row,
|
|
1007
|
-
column: this.column,
|
|
1008
|
-
prop: this.column.property
|
|
1009
|
-
}
|
|
1010
|
-
const gridParams = store.get(this.listCode)
|
|
1011
|
-
return gridParams.options['eventCallBack'][this.column.events['cellStyle']].call(this, params)
|
|
1012
|
-
}
|
|
1013
|
-
return 'primary'
|
|
1014
|
-
},
|
|
1015
|
-
changeDisabled(state) {
|
|
1016
|
-
this.disabled = state
|
|
1017
|
-
},
|
|
1018
|
-
getFilesFormatter() {
|
|
1019
|
-
if (this.column.formatter.options?.fileSet) {
|
|
1020
|
-
return JSON.parse(column.formatter.options.fileSet)
|
|
1021
|
-
}
|
|
1022
|
-
return {}
|
|
353
|
+
openPageEvent(openPageParams) {
|
|
354
|
+
this.$emit('open-page', openPageParams)
|
|
1023
355
|
}
|
|
1024
356
|
},
|
|
1025
|
-
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit'
|
|
357
|
+
emits: ['refresData', 'refresPortData', 'refresPortsData', 'refresMainTableFields', 'prohibitToEdit']
|
|
1026
358
|
}
|
|
1027
359
|
</script>
|
|
1028
360
|
|
|
1029
361
|
<style lang="scss" scoped>
|
|
1030
|
-
.annex-cell {
|
|
1031
|
-
padding-right: 5px;
|
|
1032
|
-
cursor: pointer;
|
|
1033
|
-
color: #409eff;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
.m-requried {
|
|
1037
|
-
float: left;
|
|
1038
|
-
white-space: nowrap;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
.m-requried::after {
|
|
1042
|
-
content: '*';
|
|
1043
|
-
color: #f56c6c;
|
|
1044
|
-
}
|
|
1045
362
|
</style>
|