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