cloud-web-corejs-haier 1.0.42 → 1.0.44

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 (227) hide show
  1. package/package.json +9 -7
  2. package/src/api/user.js +54 -46
  3. package/src/components/baseAlert/index.vue +57 -53
  4. package/src/components/baseInputExport/index.vue +3 -3
  5. package/src/components/baseTabs/mixins.js +12 -1
  6. package/src/components/errorMsg/index.vue +78 -78
  7. package/src/components/excelExport/button.vue +54 -45
  8. package/src/components/excelExport/exportFieldDialog.vue +3 -3
  9. package/src/components/excelExport/index.js +1 -43
  10. package/src/components/excelExport/index.vue +62 -34
  11. package/src/components/excelExport/mixins.js +74 -87
  12. package/src/components/excelImport/index.js +1 -62
  13. package/src/components/excelImport/mixins.js +1 -774
  14. package/src/components/fileLibrary/index.vue +113 -33
  15. package/src/components/fileLibrary/propertiesDialog.vue +6 -0
  16. package/src/components/hiprint/view/design/index.vue +139 -47
  17. package/src/components/hiprint/view/design/preview.vue +75 -52
  18. package/src/components/hiprint/view/json-view.vue +31 -31
  19. package/src/components/luckysheet/dialog.vue +159 -0
  20. package/src/components/luckysheet/export.js +595 -0
  21. package/src/components/luckysheet/fileUtils.js +147 -0
  22. package/src/components/luckysheet/index.js +69 -0
  23. package/src/components/luckysheet/templateJson.js +12078 -0
  24. package/src/components/luckysheet/view.vue +210 -0
  25. package/src/components/onlineTalk/index.vue +328 -6
  26. package/src/components/onlineTalk/talkUserDialog.vue +280 -0
  27. package/src/components/wf/addTaskUserdialog.vue +5 -5
  28. package/src/components/wf/content.vue +1244 -1169
  29. package/src/components/wf/mixins/setCandidateDialog.js +228 -2
  30. package/src/components/wf/mixins/setCandidateDialog2.js +115 -100
  31. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +67 -1
  32. package/src/components/wf/setCandidateDialog.vue +5 -7
  33. package/src/components/wf/setCandidateDialog2.vue +14 -10
  34. package/src/components/wf/wf.js +527 -411
  35. package/src/components/wf/wfTaskUserRangeDialog.vue +1 -1
  36. package/src/components/wf/wfUtil.js +129 -91
  37. package/src/components/xform/form-designer/designer.js +1994 -9
  38. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +10 -0
  39. package/src/components/xform/form-designer/form-widget/container-widget/detail-pane-widget.vue +3 -2
  40. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +5 -1
  41. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +1639 -0
  42. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1756 -2
  43. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -0
  44. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +10 -1
  45. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +170 -0
  46. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1630 -1
  47. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +153 -40
  48. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +65 -46
  49. package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +231 -0
  50. package/src/components/xform/form-designer/setting-panel/form-setting.vue +7 -4
  51. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +281 -0
  52. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +659 -221
  53. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +3 -3
  54. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +133 -0
  55. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -6
  56. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +1 -1
  57. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +1 -1
  58. package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +48 -0
  59. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +18 -17
  60. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +26 -26
  61. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +67 -13
  62. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +2 -0
  63. package/src/components/xform/form-designer/setting-panel/property-editor/showViewButton-editor.vue +29 -0
  64. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +8 -6
  65. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
  66. package/src/components/xform/form-render/container-item/data-table-mixin.js +20 -17
  67. package/src/components/xform/form-render/container-item/detail-item.vue +72 -48
  68. package/src/components/xform/form-render/container-item/sub-form-item.vue +10 -2
  69. package/src/components/xform/form-render/container-item/table2-item.vue +40 -10
  70. package/src/components/xform/form-render/indexMixin.js +3705 -1
  71. package/src/components/xform/icon-picker/icons.json +284 -0
  72. package/src/components/xform/icon-picker/index.vue +145 -0
  73. package/src/components/xform/lang/zh-CN.js +2 -1
  74. package/src/components/xform/mixins/defaultHandle.js +366 -2
  75. package/src/components/xform/utils/formula-util.js +3 -0
  76. package/src/components/xform/utils/sfc-generator.js +2 -2
  77. package/src/components/xform/utils/smart-vue-i18n/index.js +2 -1
  78. package/src/components/xform/utils/tableColumnHelper.js +54 -10
  79. package/src/components/xform/utils/util.js +1547 -1
  80. package/src/index.js +190 -211
  81. package/src/lang/locale/en/login.js +26 -19
  82. package/src/lang/locale/zh/login.js +25 -19
  83. package/src/layout/components/Sidebar/default.vue +252 -71
  84. package/src/layout/components/Sidebar/index.vue +6 -1
  85. package/src/layout/components/TagsView/index.vue +6 -0
  86. package/src/layout/components/langTool.vue +32 -29
  87. package/src/layout/defaultLayout.vue +16 -8
  88. package/src/layout/index.vue +5 -3
  89. package/src/permission.js +135 -1
  90. package/src/router/index.js +1 -4
  91. package/src/store/config/index.js +667 -1
  92. package/src/store/getters.js +2 -1
  93. package/src/store/modules/permission.js +332 -1
  94. package/src/store/modules/settings.js +26 -1
  95. package/src/store/modules/tagsView.js +190 -1
  96. package/src/store/modules/user.js +358 -1
  97. package/src/utils/aes.js +15 -1
  98. package/src/utils/auth.js +27 -1
  99. package/src/utils/componentDialog.js +217 -0
  100. package/src/utils/request.js +368 -1
  101. package/src/utils/vab.js +1256 -7
  102. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -174
  103. package/src/views/bd/setting/bd_company_env/edit.vue +193 -193
  104. package/src/views/bd/setting/formVersion/button.vue +55 -0
  105. package/src/views/bd/setting/formVersion/compareBasicSection.vue +125 -0
  106. package/src/views/bd/setting/formVersion/compareCodeSection.vue +539 -0
  107. package/src/views/bd/setting/formVersion/compareContMixin.scss +65 -0
  108. package/src/views/bd/setting/formVersion/compareContent.vue +63 -0
  109. package/src/views/bd/setting/formVersion/compareDialog.vue +88 -0
  110. package/src/views/bd/setting/formVersion/compareMixin.js +93 -0
  111. package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
  112. package/src/views/bd/setting/formVersion/formScriptCompareView.vue +94 -0
  113. package/src/views/bd/setting/formVersion/formTemplateCompareView.vue +74 -0
  114. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +491 -0
  115. package/src/views/bd/setting/formVersion/link.vue +58 -0
  116. package/src/views/bd/setting/formVersion/preformDialog.vue +87 -0
  117. package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
  118. package/src/views/bd/setting/formVersion/tableDetailDiff.js +99 -0
  119. package/src/views/bd/setting/formVersion/tableModelCompareView.vue +514 -0
  120. package/src/views/bd/setting/formVersion/textDiff.js +102 -0
  121. package/src/views/bd/setting/form_import_log/edit.vue +6 -3
  122. package/src/views/bd/setting/form_import_log/list.vue +5 -0
  123. package/src/views/bd/setting/form_script/edit.vue +196 -83
  124. package/src/views/bd/setting/form_script/edit1.vue +410 -220
  125. package/src/views/bd/setting/form_script/form_list.vue +19 -0
  126. package/src/views/bd/setting/form_script/list.vue +95 -21
  127. package/src/views/bd/setting/form_script/list1.vue +24 -0
  128. package/src/views/bd/setting/form_script/mixins/dialog.js +2 -2
  129. package/src/views/bd/setting/form_script/mixins/edit.js +265 -207
  130. package/src/views/bd/setting/form_script/mixins/edit1.js +259 -201
  131. package/src/views/bd/setting/form_script/mixins/form_list.js +322 -296
  132. package/src/views/bd/setting/form_script/mixins/list.js +163 -95
  133. package/src/views/bd/setting/form_script/mixins/list1.js +244 -155
  134. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +1 -1
  135. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +1 -1
  136. package/src/views/bd/setting/form_template/edit.vue +355 -205
  137. package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -0
  138. package/src/views/bd/setting/form_template/list.vue +49 -74
  139. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +3 -3
  140. package/src/views/bd/setting/form_template/mixins/edit.js +51 -8
  141. package/src/views/bd/setting/form_template/mixins/itemList.js +1 -1
  142. package/src/views/bd/setting/form_template/mixins/list.js +114 -82
  143. package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
  144. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +1 -1
  145. package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -7
  146. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +254 -254
  147. package/src/views/bd/setting/form_template/wf_list.vue +161 -127
  148. package/src/views/bd/setting/request_async_setting/edit.vue +320 -320
  149. package/src/views/bd/setting/request_setting/edit.vue +300 -300
  150. package/src/views/bd/setting/request_setting/list.vue +15 -25
  151. package/src/views/bd/setting/table_model/edit.vue +702 -498
  152. package/src/views/bd/setting/table_model/list.vue +28 -0
  153. package/src/views/bd/setting/table_model/mixins/dialog.js +1 -1
  154. package/src/views/bd/setting/table_model/mixins/edit copy.js +903 -0
  155. package/src/views/bd/setting/table_model/mixins/edit.js +228 -121
  156. package/src/views/bd/setting/table_model/mixins/list.js +55 -20
  157. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +1 -1
  158. package/src/views/bd/setting/table_model/mixins/zdDialog.js +50 -46
  159. package/src/views/bd/setting/utils/index.js +15 -0
  160. package/src/views/user/api_request/list.vue +203 -203
  161. package/src/views/user/bill_setting/list.vue +345 -345
  162. package/src/views/user/code_rules/list.vue +204 -204
  163. package/src/views/user/common_attribute/list.vue +378 -378
  164. package/src/views/user/common_script/list.vue +341 -341
  165. package/src/views/user/company_info/dialog.vue +80 -49
  166. package/src/views/user/country/list.vue +197 -197
  167. package/src/views/user/extend_datasource/dialog.vue +0 -3
  168. package/src/views/user/extend_datasource/edit.vue +1 -2
  169. package/src/views/user/extend_datasource/list.vue +221 -224
  170. package/src/views/user/fieldTranslation/editDialog.vue +1 -1
  171. package/src/views/user/fieldTranslation/list.vue +473 -473
  172. package/src/views/user/field_values_invisible/list.vue +207 -207
  173. package/src/views/user/file_type/list.vue +271 -271
  174. package/src/views/user/file_view_area/list.vue +331 -331
  175. package/src/views/user/form/vform/designer.vue +303 -287
  176. package/src/views/user/form/vform/formFieldMapping.js +2 -3
  177. package/src/views/user/form/view/edit.vue +19 -1
  178. package/src/views/user/form/view/list.vue +59 -17
  179. package/src/views/user/groups/list.vue +158 -158
  180. package/src/views/user/home/default.vue +274 -182
  181. package/src/views/user/home/default2.vue +1148 -0
  182. package/src/views/user/home/index.vue +2 -1
  183. package/src/views/user/lang_tag/list.vue +170 -170
  184. package/src/views/user/language_setting/list.vue +208 -208
  185. package/src/views/user/ledger_library/list.vue +12 -10
  186. package/src/views/user/login/default.vue +1 -1
  187. package/src/views/user/login/indexMixin.js +204 -169
  188. package/src/views/user/menu/list.vue +575 -575
  189. package/src/views/user/notify_message/dialog.vue +7 -1
  190. package/src/views/user/notify_template/list.vue +192 -192
  191. package/src/views/user/notify_template/list2.vue +190 -190
  192. package/src/views/user/position/list.vue +188 -188
  193. package/src/views/user/project_tag/list.vue +175 -175
  194. package/src/views/user/push_setting/list.vue +236 -236
  195. package/src/views/user/request_setting/list.vue +248 -248
  196. package/src/views/user/role/list.vue +182 -182
  197. package/src/views/user/system_notice/infoDialog.vue +61 -2
  198. package/src/views/user/system_notice/list.vue +203 -203
  199. package/src/views/user/system_parameter/list.vue +141 -141
  200. package/src/views/user/user/edit.vue +45 -0
  201. package/src/views/user/user/form_list.vue +245 -245
  202. package/src/views/user/user/info.vue +253 -140
  203. package/src/views/user/user_log_classify/list.vue +197 -197
  204. package/src/views/user/wf/iframe/index.vue +46 -46
  205. package/src/views/user/wf/wfReport/index.vue +1 -1
  206. package/src/views/user/wf/wf_auto_submit_data/list.vue +659 -659
  207. package/src/views/user/wf/wf_diy_attribute/edit.vue +1 -1
  208. package/src/views/user/wf/wf_manage/list.vue +795 -795
  209. package/src/views/user/wf/wf_manage/wfContentDialog.vue +106 -106
  210. package/src/views/user/wf/wf_obj_config/dialog.vue +2 -2
  211. package/src/views/user/wf/wf_obj_config/edit.vue +1 -1
  212. package/src/views/user/wf/wf_obj_config/edit_form.vue +2 -2
  213. package/src/views/user/wf/wf_obj_config/itemEdit.vue +1 -1
  214. package/src/views/user/wf/wf_obj_config/itemEdit_form.vue +1 -1
  215. package/src/views/user/wf/wf_obj_config/itemOperateDialog.vue +4 -4
  216. package/src/views/user/wf/wf_obj_config/list.vue +28 -28
  217. package/src/views/user/wf/wf_obj_config/list_form.vue +5 -5
  218. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +292 -292
  219. package/src/views/user/wf/wf_param/edit.vue +1 -1
  220. package/src/views/user/wf/wf_transfer_setting/edit.vue +1 -1
  221. package/src/views/user/wf/wf_transfer_setting/list.vue +321 -319
  222. package/src/views/user/wf/wf_work_calendar/components/calendar.vue +369 -367
  223. package/src/views/user/wf/wf_work_calendar/components/calendar2.vue +401 -399
  224. package/src/views/user/wf/wf_work_calendar/configDialog.vue +6 -6
  225. package/src/views/user/wf/wf_work_calendar/date.js +84 -83
  226. package/src/views/user/wf/wf_work_calendar/list.vue +6 -6
  227. package/src/views/user/workbench_menu/list.vue +555 -0
@@ -1,20 +1,27 @@
1
1
  <template>
2
2
  <el-dialog
3
- custom-class="dialog-style list-dialog"
3
+ custom-class="dialog-style list-dialog table-column-config-dialog"
4
4
  :title="i18nt('designer.setting.tableColEdit')"
5
5
  :visible.sync="showDialog"
6
6
  :modal="false"
7
7
  :show-close="!0"
8
8
  :close-on-click-modal="!1"
9
9
  :close-on-press-escape="!1"
10
- :destroy-on-close="!0"
10
+ :destroy-on-close="false"
11
11
  top="5vh"
12
12
  width="1220px"
13
13
  v-dialog-drag
14
14
  :before-close="closeHandle"
15
15
  >
16
- <div class="cont">
16
+ <div
17
+ class="cont table-column-dialog-cont"
18
+ v-loading="!tableReady"
19
+ element-loading-background="rgba(0, 0, 0, 0)"
20
+ element-loading-text="数据正在加载中"
21
+ element-loading-spinner="el-icon-loading"
22
+ >
17
23
  <el-table
24
+ v-if="tableReady"
18
25
  ref="singleTable"
19
26
  width="100%"
20
27
  :data="tableData"
@@ -23,11 +30,7 @@
23
30
  row-key="columnId"
24
31
  stripe=""
25
32
  :tree-props="{ children: 'children' }"
26
- default-expand-all
27
- v-loading="pictLoading"
28
- element-loading-background="rgba(0, 0, 0, 0)"
29
- element-loading-text="数据正在加载中"
30
- element-loading-spinner="el-icon-loading"
33
+ :default-expand-all="shouldExpandAllTable"
31
34
  >
32
35
  <el-table-column label="" width="80" fixed="left">
33
36
  <template #default="scope">
@@ -104,7 +107,9 @@
104
107
  @change="changeFormatS(scope.row, false)"
105
108
  clearable
106
109
  >
107
- <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
110
+ <el-option-group
111
+ :label="i18nt('designer.setting.customRenderGroup')"
112
+ >
108
113
  <el-option value="render" label="render"></el-option>
109
114
  </el-option-group>
110
115
  <el-option-group v-for="t in op" :key="t.label" :label="t.label">
@@ -128,7 +133,8 @@
128
133
  @click="openFormatConfigDialog(scope.row, scope.$index)"
129
134
  :disabled="
130
135
  !columnFormatMap[scope.row.formatS] &&
131
- 'widgetRender' !== scope.row.formatS
136
+ 'widgetRender' !== scope.row.formatS &&
137
+ 'editTreeButtonGroup' !== scope.row.formatS
132
138
  "
133
139
  ></el-button>
134
140
  </template>
@@ -172,7 +178,20 @@
172
178
  <el-switch v-model="scope.row.filterable"></el-switch>
173
179
  </template>
174
180
  </el-table-column>
175
- <el-table-column label="编辑更多属性" width="100" align="center" fixed="right">
181
+ <el-table-column label="UTC时差转换" width="90" align="center">
182
+ <template #default="scope">
183
+ <el-switch
184
+ v-if="isUtcTransformColumn(scope.row)"
185
+ v-model="scope.row.utcTransformEnabled"
186
+ ></el-switch>
187
+ </template>
188
+ </el-table-column>
189
+ <el-table-column
190
+ label="编辑更多属性"
191
+ width="100"
192
+ align="center"
193
+ fixed="right"
194
+ >
176
195
  <template #default="scope">
177
196
  <el-button
178
197
  size="mini"
@@ -258,6 +277,12 @@
258
277
  :visiable.sync="showColumnRenderDialog"
259
278
  @confirm="confirmWidgetRenderDialog"
260
279
  ></columnRenderDialog>
280
+ <editTreeButtonGroupConfigDialog
281
+ v-if="showEditTreeButtonGroupConfigDialog && editTreeButtonGroupRowData"
282
+ :visible.sync="showEditTreeButtonGroupConfigDialog"
283
+ :row="editTreeButtonGroupRowData"
284
+ @confirm="confirmEditTreeButtonGroupConfig"
285
+ />
261
286
  </div>
262
287
  <div class="dialog-footer" slot="footer">
263
288
  <el-button @click="closeHandle" class="button-sty" icon="el-icon-close">
@@ -286,7 +311,11 @@
286
311
  top="7vh"
287
312
  :append-to-body="true"
288
313
  >
289
- <el-alert type="info" :closable="!1" title="function customRender(params,h) {" />
314
+ <el-alert
315
+ type="info"
316
+ :closable="!1"
317
+ title="function customRender(params,h) {"
318
+ />
290
319
  <code-editor
291
320
  ref="dsResultEditor"
292
321
  mode="javascript"
@@ -406,7 +435,7 @@
406
435
  </el-dialog>
407
436
 
408
437
  <el-dialog
409
- custom-class="dialog-style list-dialog"
438
+ custom-class="dialog-style list-dialog table-column-row-edit-dialog"
410
439
  :title="i18nt('designer.setting.tableColEdit')"
411
440
  :visible.sync="showRowEditDialog"
412
441
  v-if="showRowEditDialog"
@@ -415,11 +444,13 @@
415
444
  :close-on-click-modal="!1"
416
445
  :close-on-press-escape="!1"
417
446
  :destroy-on-close="!0"
447
+ :append-to-body="true"
448
+ :modal-append-to-body="true"
418
449
  top="5vh"
419
- width="409px"
450
+ width="480px"
420
451
  v-dialog-drag
421
452
  >
422
- <div class="cont">
453
+ <div class="cont table-column-row-edit-cont">
423
454
  <el-form :model="rowData" class="form-m2" label-position="top">
424
455
  <el-form-item :label="i18nt('designer.setting.columnLabel')">
425
456
  <el-input
@@ -455,7 +486,9 @@
455
486
  @change="changeFormatS(rowData, false)"
456
487
  clearable
457
488
  >
458
- <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
489
+ <el-option-group
490
+ :label="i18nt('designer.setting.customRenderGroup')"
491
+ >
459
492
  <el-option value="render" label="render"></el-option>
460
493
  </el-option-group>
461
494
  <el-option-group v-for="t in op" :key="t.label" :label="t.label">
@@ -476,7 +509,9 @@
476
509
  icon="el-icon-edit"
477
510
  @click="openFormatConfigDialog(rowData, rowDataIndex)"
478
511
  :disabled="
479
- !columnFormatMap[rowData.formatS] && 'widgetRender' !== rowData.formatS
512
+ !columnFormatMap[rowData.formatS] &&
513
+ 'widgetRender' !== rowData.formatS &&
514
+ 'editTreeButtonGroup' !== rowData.formatS
480
515
  "
481
516
  ></el-button>
482
517
  </el-form-item>
@@ -490,9 +525,25 @@
490
525
  @click="showRenderDialog(rowData)"
491
526
  ></el-button>
492
527
  </el-form-item>
528
+ <el-form-item
529
+ v-if="isUtcTransformColumn(rowData)"
530
+ label="UTC时差转换"
531
+ >
532
+ <el-switch v-model="rowData.utcTransformEnabled"></el-switch>
533
+ </el-form-item>
493
534
  <el-form-item :label="i18nt('designer.setting.visibleColumn')">
494
535
  <el-switch v-model="rowData.show"></el-switch>
495
536
  </el-form-item>
537
+ <el-form-item label="动态显示脚本">
538
+ <a
539
+ href="javascript:void(0);"
540
+ class="a-link link-oneLind"
541
+ @click="openColumnShowDialog(rowData)"
542
+ >
543
+ <span>{{ rowData.columnShow }}</span>
544
+ <i class="el-icon-edit"></i>
545
+ </a>
546
+ </el-form-item>
496
547
  <el-form-item :label="i18nt('designer.setting.sortableColumn')">
497
548
  <el-switch v-model="rowData.sortable"></el-switch>
498
549
  </el-form-item>
@@ -559,7 +610,9 @@
559
610
  plain=""
560
611
  round=""
561
612
  icon="el-icon-edit"
562
- @click="editFormEventHandler(rowData, rowDataIndex, 'footerMethodConfg')"
613
+ @click="
614
+ editFormEventHandler(rowData, rowDataIndex, 'footerMethodConfg')
615
+ "
563
616
  :disabled="rowData.footerDataType !== '3'"
564
617
  ></el-button>
565
618
  </el-form-item>
@@ -572,10 +625,84 @@
572
625
  <el-option value="#ea5353" label="红"></el-option>
573
626
  </el-select>
574
627
  </el-form-item>
628
+ <el-form-item label-width="0" class="form-item-full">
629
+ <el-divider class="custom-divider">{{
630
+ i18nt("designer.setting.customLabelIcon")
631
+ }}</el-divider>
632
+ </el-form-item>
633
+ <el-form-item :label="i18nt('designer.setting.labelIconClass')">
634
+ <icon-picker v-model="rowData.labelIconClass"></icon-picker>
635
+ </el-form-item>
636
+ <el-form-item :label="i18nt('designer.setting.labelIconPosition')">
637
+ <el-select
638
+ v-model="rowData.labelIconPosition"
639
+ clearable
640
+ placeholder="默认后面"
641
+ >
642
+ <el-option label="前面" value="front"></el-option>
643
+ <el-option label="后面" value="rear"></el-option>
644
+ </el-select>
645
+ </el-form-item>
646
+ <el-form-item
647
+ :label="i18nt('designer.setting.labelTooltip')"
648
+ class="form-item-full"
649
+ >
650
+ <a
651
+ href="javascript:void(0);"
652
+ class="a-link link-oneLind"
653
+ @click="openLabelTooltipDialog"
654
+ >
655
+ <span>{{ rowData.labelTooltip }}</span>
656
+ <i class="el-icon-edit"></i>
657
+ </a>
658
+ </el-form-item>
575
659
  </el-form>
576
660
  </div>
661
+ <el-dialog
662
+ v-if="labelTooltipDialogVisible"
663
+ custom-class="dialog-style"
664
+ :title="i18nt('designer.setting.labelTooltip')"
665
+ :visible.sync="labelTooltipDialogVisible"
666
+ :show-close="true"
667
+ :append-to-body="true"
668
+ :modal="false"
669
+ :close-on-click-modal="false"
670
+ :close-on-press-escape="false"
671
+ :destroy-on-close="true"
672
+ width="520px"
673
+ v-dialog-drag
674
+ >
675
+ <el-input
676
+ type="textarea"
677
+ :rows="14"
678
+ class="label-tooltip-textarea"
679
+ v-model="labelTooltipValue"
680
+ clearable
681
+ ></el-input>
682
+ <div class="dialog-footer" slot="footer">
683
+ <el-button
684
+ @click="labelTooltipDialogVisible = false"
685
+ class="button-sty"
686
+ icon="el-icon-close"
687
+ >
688
+ {{ i18nt("designer.hint.cancel") }}
689
+ </el-button>
690
+ <el-button
691
+ type="primary"
692
+ @click="submitLabelTooltipDialog"
693
+ class="button-sty"
694
+ icon="el-icon-check"
695
+ >
696
+ {{ i18nt("designer.hint.confirm") }}
697
+ </el-button>
698
+ </div>
699
+ </el-dialog>
577
700
  <div class="dialog-footer" slot="footer">
578
- <el-button @click="closeRowEditDialog" class="button-sty" icon="el-icon-close">
701
+ <el-button
702
+ @click="closeRowEditDialog"
703
+ class="button-sty"
704
+ icon="el-icon-close"
705
+ >
579
706
  {{ i18nt("designer.hint.cancel") }}
580
707
  </el-button>
581
708
  <el-button
@@ -600,6 +727,8 @@ import {
600
727
  columnFormatMap,
601
728
  } from "../../../../../../components/xform/utils/util";
602
729
  import columnRenderDialog from "./columnRenderDialog.vue";
730
+ import editTreeButtonGroupConfigDialog from "./edit-tree-button-group-config-dialog.vue";
731
+ import IconPicker from "@base/components/xform/icon-picker/index.vue";
603
732
 
604
733
  let businessOptions = [
605
734
  {
@@ -627,18 +756,27 @@ export default {
627
756
  designer: Object,
628
757
  selectedWidget: Object,
629
758
  optionModel: Object,
759
+ visiable: {
760
+ type: Boolean,
761
+ default: false,
762
+ },
763
+ },
764
+ components: {
765
+ columnRenderDialog,
766
+ editTreeButtonGroupConfigDialog,
767
+ IconPicker,
630
768
  },
631
- components: { columnRenderDialog },
632
769
  inject: ["openWidgetPropertyDialog"],
633
770
  data() {
634
771
  return {
635
- pictLoading: true,
772
+ tableReady: false,
636
773
  tableColumnConfigTitle: null,
637
774
  showTableColumnConfigDialog: false,
638
775
  tableColumnConfigHeader: null,
639
776
  tableColumnConfigCode: null,
640
- showDialog: true,
641
- dialogVisible: true,
777
+ showEditTreeButtonGroupConfigDialog: false,
778
+ currentEditTreeButtonGroupRow: null,
779
+ editTreeButtonGroupRowData: null,
642
780
  alignOptions: [
643
781
  {
644
782
  value: "left",
@@ -671,6 +809,14 @@ export default {
671
809
  value: "editDate",
672
810
  label: "日期输入框",
673
811
  },
812
+ {
813
+ value: "textarea",
814
+ label: "多行文本输入框",
815
+ },
816
+ {
817
+ value: "editScriptInput",
818
+ label: "脚本输入框",
819
+ },
674
820
  {
675
821
  value: "editSelect",
676
822
  label: "下拉框",
@@ -699,6 +845,23 @@ export default {
699
845
  value: "text",
700
846
  label: "文本",
701
847
  },
848
+ {
849
+ value: "aText",
850
+ label: "超链接文本",
851
+ },
852
+ {
853
+ value: "widgetRender",
854
+ label: "自定义组件",
855
+ },
856
+ ],
857
+ },
858
+ {
859
+ label: "按钮控件",
860
+ options: [
861
+ {
862
+ value: "dropdown",
863
+ label: "下拉按钮",
864
+ },
702
865
  {
703
866
  value: "editDelete",
704
867
  label: "删除按钮",
@@ -707,10 +870,6 @@ export default {
707
870
  value: "editButton",
708
871
  label: "查看按钮",
709
872
  },
710
- {
711
- value: "aText",
712
- label: "超链接文本",
713
- },
714
873
  {
715
874
  value: "aLink",
716
875
  label: "超链接按钮",
@@ -723,10 +882,6 @@ export default {
723
882
  value: "editTreeButtonGroup",
724
883
  label: "编辑行按钮组",
725
884
  },
726
- {
727
- value: "widgetRender",
728
- label: "自定义组件",
729
- },
730
885
  ],
731
886
  },
732
887
  {
@@ -760,7 +915,7 @@ export default {
760
915
  options: businessOptions,
761
916
  },
762
917
  {
763
- label: "Date Format",
918
+ label: "日期格式化",
764
919
  options: [
765
920
  {
766
921
  value: "d1",
@@ -785,7 +940,7 @@ export default {
785
940
  ],
786
941
  },
787
942
  {
788
- label: "Number Format",
943
+ label: "数字格式化",
789
944
  options: [
790
945
  {
791
946
  value: "n1",
@@ -863,6 +1018,7 @@ export default {
863
1018
 
864
1019
  eventParamsMap: {
865
1020
  footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
1021
+ columnShow: "columnShow(dataId,formCode,columnConfig) {",
866
1022
  },
867
1023
 
868
1024
  showColumnRenderDialog: false,
@@ -871,16 +1027,163 @@ export default {
871
1027
  rowData: null,
872
1028
  rowDataIndex: 0,
873
1029
  showRowEditDialog: false,
1030
+ labelTooltipDialogVisible: false,
1031
+ labelTooltipValue: "",
1032
+ sourceTableColumnsSnapshot: null,
874
1033
  };
875
1034
  },
876
1035
  beforeDestroy() {
877
1036
  if (this.dragSort) this.dragSort.destroy();
878
1037
  },
1038
+ computed: {
1039
+ showDialog: {
1040
+ get() {
1041
+ return this.visiable;
1042
+ },
1043
+ set(val) {
1044
+ this.$emit("update:visiable", val);
1045
+ },
1046
+ },
1047
+ shouldExpandAllTable() {
1048
+ return this.countTreeRows(this.tableData) <= 30;
1049
+ },
1050
+ },
1051
+ watch: {
1052
+ visiable(val) {
1053
+ if (val) {
1054
+ this.onDialogOpen();
1055
+ } else {
1056
+ this.onDialogClose();
1057
+ }
1058
+ },
1059
+ },
879
1060
  created() {},
880
1061
  mounted() {
881
- this.init();
1062
+ if (this.visiable) {
1063
+ this.onDialogOpen();
1064
+ }
882
1065
  },
883
1066
  methods: {
1067
+ countTreeRows(rows) {
1068
+ if (!Array.isArray(rows) || !rows.length) {
1069
+ return 0;
1070
+ }
1071
+ let count = 0;
1072
+ const walk = (list) => {
1073
+ list.forEach((item) => {
1074
+ count += 1;
1075
+ if (item.children && item.children.length) {
1076
+ walk(item.children);
1077
+ }
1078
+ });
1079
+ };
1080
+ walk(rows);
1081
+ return count;
1082
+ },
1083
+ cloneTableColumnsForEdit(columns) {
1084
+ if (!Array.isArray(columns)) {
1085
+ return [];
1086
+ }
1087
+ const refKeys = ["widget", "editWidget", "widgetList"];
1088
+ const cloneRow = (row) => {
1089
+ if (!row || typeof row !== "object") {
1090
+ return row;
1091
+ }
1092
+ const cloned = {};
1093
+ Object.keys(row).forEach((key) => {
1094
+ const val = row[key];
1095
+ if (key === "children" && Array.isArray(val) && val.length) {
1096
+ cloned.children = val.map(cloneRow);
1097
+ return;
1098
+ }
1099
+ if (refKeys.includes(key)) {
1100
+ cloned[key] = val;
1101
+ return;
1102
+ }
1103
+ if (key === "columnOption") {
1104
+ if (!row.widget) {
1105
+ cloned.columnOption =
1106
+ val !== null && typeof val === "object" ? deepClone(val) : val;
1107
+ }
1108
+ return;
1109
+ }
1110
+ if (key === "editColumnOption") {
1111
+ if (!row.editWidget) {
1112
+ cloned.editColumnOption =
1113
+ val !== null && typeof val === "object" ? deepClone(val) : val;
1114
+ }
1115
+ return;
1116
+ }
1117
+ if (val !== null && typeof val === "object") {
1118
+ try {
1119
+ cloned[key] = deepClone(val);
1120
+ } catch (e) {
1121
+ cloned[key] = val;
1122
+ }
1123
+ return;
1124
+ }
1125
+ cloned[key] = val;
1126
+ });
1127
+ if (row.widget && !cloned.widget) {
1128
+ cloned.widget = row.widget;
1129
+ }
1130
+ if (row.editWidget && !cloned.editWidget) {
1131
+ cloned.editWidget = row.editWidget;
1132
+ }
1133
+ return cloned;
1134
+ };
1135
+ return columns.map(cloneRow);
1136
+ },
1137
+ buildColumnWidgetMap(columns, map = {}) {
1138
+ if (!Array.isArray(columns)) {
1139
+ return map;
1140
+ }
1141
+ columns.forEach((col) => {
1142
+ if (col && col.columnId) {
1143
+ map[col.columnId] = col;
1144
+ }
1145
+ if (col.children && col.children.length) {
1146
+ this.buildColumnWidgetMap(col.children, map);
1147
+ }
1148
+ });
1149
+ return map;
1150
+ },
1151
+ restoreColumnWidgetRefs(columns, widgetMap) {
1152
+ if (!Array.isArray(columns)) {
1153
+ return [];
1154
+ }
1155
+ return columns.map((row) => {
1156
+ const next = Object.assign({}, row);
1157
+ const orig = widgetMap[next.columnId];
1158
+ if (orig) {
1159
+ // 仅 formatS 未变更时补回 widget,避免清空 formatS 后又被快照还原
1160
+ const formatUnchanged = next.formatS === orig.formatS;
1161
+ const editFormatUnchanged = next.editFormatS === orig.editFormatS;
1162
+ if (formatUnchanged && !next.widget && orig.widget) {
1163
+ next.widget = orig.widget;
1164
+ }
1165
+ if (editFormatUnchanged && !next.editWidget && orig.editWidget) {
1166
+ next.editWidget = orig.editWidget;
1167
+ }
1168
+ if (
1169
+ formatUnchanged &&
1170
+ next.formatS === "widgetRender" &&
1171
+ (!next.widgetList || !next.widgetList.length) &&
1172
+ orig.widgetList &&
1173
+ orig.widgetList.length
1174
+ ) {
1175
+ next.widgetList = orig.widgetList;
1176
+ }
1177
+ }
1178
+ if (next.children && next.children.length) {
1179
+ next.children = this.restoreColumnWidgetRefs(
1180
+ next.children,
1181
+ widgetMap
1182
+ );
1183
+ }
1184
+ return next;
1185
+ });
1186
+ },
884
1187
  editFormEventHandler(row, index, eventName) {
885
1188
  this.curEventRow = row;
886
1189
  this.curEventName = eventName;
@@ -900,31 +1203,61 @@ export default {
900
1203
  });
901
1204
 
902
1205
  if (syntaxErrorFlag) {
903
- this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
1206
+ this.$message.error(
1207
+ this.i18nt("designer.setting.syntaxCheckWarning")
1208
+ );
904
1209
  return;
905
1210
  }
906
1211
  }
907
1212
  this.curEventRow[this.curEventName] = this.formEventHandlerCode;
908
1213
  this.showFormEventDialogFlag = false;
909
1214
  },
910
- init() {
911
- setTimeout(() => {
912
- this.tableData = this.$baseLodash.cloneDeep(this.optionModel.tableColumns);
913
- this.$nextTick(() => {
914
- this.rowDrop();
915
- setTimeout(() => {
916
- this.pictLoading = false;
917
- }, 200);
918
- });
919
- }, 10);
920
-
921
- /*this.$nextTick(() => {
922
- this.rowDrop();
923
- });*/
1215
+ onDialogClose() {
1216
+ this.tableReady = false;
1217
+ this.sourceTableColumnsSnapshot = null;
1218
+ if (this.dragSort) {
1219
+ this.dragSort.destroy();
1220
+ this.dragSort = null;
1221
+ }
1222
+ },
1223
+ onDialogOpen() {
1224
+ this.tableReady = false;
1225
+ if (this.dragSort) {
1226
+ this.dragSort.destroy();
1227
+ this.dragSort = null;
1228
+ }
1229
+ this.$nextTick(() => {
1230
+ const load = () => {
1231
+ this.loadTableData();
1232
+ this.tableReady = true;
1233
+ this.$nextTick(() => {
1234
+ requestAnimationFrame(() => {
1235
+ this.rowDrop();
1236
+ });
1237
+ });
1238
+ };
1239
+ if (typeof requestIdleCallback === "function") {
1240
+ requestIdleCallback(load, { timeout: 80 });
1241
+ } else {
1242
+ setTimeout(load, 0);
1243
+ }
1244
+ });
1245
+ },
1246
+ loadTableData() {
1247
+ const source = this.optionModel.tableColumns || [];
1248
+ this.sourceTableColumnsSnapshot = source;
1249
+ this.tableData = this.cloneTableColumnsForEdit(source);
924
1250
  },
925
1251
  colSubmit() {
926
1252
  this.dialogVisible = !1;
927
- this.optionModel.tableColumns = this.tableData;
1253
+ const widgetMap = this.buildColumnWidgetMap(
1254
+ this.sourceTableColumnsSnapshot || []
1255
+ );
1256
+ this.optionModel.tableColumns = this.restoreColumnWidgetRefs(
1257
+ this.tableData,
1258
+ widgetMap
1259
+ );
1260
+ this.sourceTableColumnsSnapshot = null;
928
1261
  this.closeHandle();
929
1262
  },
930
1263
  openWidgetRenderDialog(row, sourceData) {
@@ -1009,7 +1342,8 @@ export default {
1009
1342
  let newRow = this.generateRow(generateParentId);
1010
1343
  if (children) {
1011
1344
  if (type === "SIBLING") {
1012
- let addIndex = children.findIndex((item) => item.columnId == row.columnId) + 1;
1345
+ let addIndex =
1346
+ children.findIndex((item) => item.columnId == row.columnId) + 1;
1013
1347
  children.splice(addIndex, 0, newRow);
1014
1348
  } else {
1015
1349
  children.push(newRow);
@@ -1021,6 +1355,9 @@ export default {
1021
1355
  getUuid() {
1022
1356
  return new Date().getTime();
1023
1357
  },
1358
+ createRowAuthName(type) {
1359
+ return `row${type}` + generateId();
1360
+ },
1024
1361
  /**
1025
1362
  * 生成一行数据
1026
1363
  */
@@ -1044,10 +1381,35 @@ export default {
1044
1381
  footerMethodConfg: null,
1045
1382
  widgetList: [],
1046
1383
  labelColor: null,
1384
+ rowAddAuthName: this.createRowAuthName("Add"),
1385
+ rowEditAuthName: this.createRowAuthName("Edit"),
1386
+ rowAddShow: null,
1387
+ rowEditShow: null,
1388
+ columnShow: null,
1389
+ utcTransformEnabled: false,
1390
+ labelIconClass: null,
1391
+ labelIconPosition: "rear",
1392
+ labelTooltip: null,
1047
1393
  // treeNode: false,
1048
1394
  };
1049
1395
  return row;
1050
1396
  },
1397
+ isUtcTransformColumn(row) {
1398
+ const formatS = row.formatS;
1399
+ if (!formatS) {
1400
+ return true;
1401
+ }
1402
+ return [
1403
+ "d1",
1404
+ "d2",
1405
+ "d3",
1406
+ "d4",
1407
+ "d5",
1408
+ "render",
1409
+ "create_date",
1410
+ "modify_date",
1411
+ ].includes(formatS);
1412
+ },
1051
1413
  // 添加根节点
1052
1414
  onAddRoot() {
1053
1415
  this.tableData.push(this.generateRow());
@@ -1057,7 +1419,9 @@ export default {
1057
1419
  const { parentId, columnId } = row;
1058
1420
  // 根节点直接删除
1059
1421
  if (!parentId) {
1060
- const delIndex = this.tableData.findIndex((item) => item.columnId === columnId);
1422
+ const delIndex = this.tableData.findIndex(
1423
+ (item) => item.columnId === columnId
1424
+ );
1061
1425
  this.tableData.splice(delIndex, 1);
1062
1426
  } else {
1063
1427
  // 找到父节点,通过父节点删除
@@ -1076,7 +1440,9 @@ export default {
1076
1440
 
1077
1441
  const { children } = parentRow;
1078
1442
 
1079
- const delIndex = children.findIndex((item) => item.columnId === columnId);
1443
+ const delIndex = children.findIndex(
1444
+ (item) => item.columnId === columnId
1445
+ );
1080
1446
 
1081
1447
  children.splice(delIndex, 1);
1082
1448
  }
@@ -1140,7 +1506,9 @@ export default {
1140
1506
  //数组转树
1141
1507
  arrToTree(arr, parentId) {
1142
1508
  return arr
1143
- .filter((item) => (!parentId ? !item.parentId : item.parentId === parentId))
1509
+ .filter((item) =>
1510
+ !parentId ? !item.parentId : item.parentId === parentId
1511
+ )
1144
1512
  .map((item) => {
1145
1513
  item.children = this.arrToTree(arr, item.columnId);
1146
1514
  return item;
@@ -1224,7 +1592,10 @@ export default {
1224
1592
  let isButtontCell = false;
1225
1593
  let widgetType = this.columnFormatMap[formatS];
1226
1594
  if (widgetType) {
1227
- isButtontCell = widgetType === "a-link" || widgetType === "button";
1595
+ isButtontCell =
1596
+ widgetType === "a-link" ||
1597
+ widgetType === "button" ||
1598
+ widgetType === "dropdown";
1228
1599
  }
1229
1600
  return isButtontCell;
1230
1601
  },
@@ -1232,31 +1603,24 @@ export default {
1232
1603
  changeFormatS(row, isEdit) {
1233
1604
  let formatS = isEdit ? row.editFormatS : row.formatS;
1234
1605
  let isButtontCell = this.getIsButtontCell(formatS);
1235
- // let columnWidgetConfig = this.getColumnWidgetConfig(row, true, isEdit);
1236
- // let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
1237
1606
  let attachmentPrefix = this.designer.getAttachmentPrefix();
1238
1607
  let columnSelectedWidget = this.designer.createColumnWidget(row, isEdit);
1239
1608
  if (!isEdit) {
1240
- //格式化类型
1241
1609
  if (columnSelectedWidget) {
1242
- row.columnOption = columnSelectedWidget.options;
1243
1610
  row.widget = columnSelectedWidget;
1244
1611
  } else {
1245
- row.columnOption = {};
1246
1612
  row.widget = null;
1247
1613
  }
1614
+ row.utcTransformEnabled = false;
1248
1615
  } else {
1249
1616
  if (row.prop && row.prop.startsWith(attachmentPrefix)) {
1250
1617
  let suffix = row.prop.replace(attachmentPrefix, "");
1251
1618
  columnSelectedWidget.options.keyName = row.prop;
1252
1619
  columnSelectedWidget.options.keyNameSuffix = suffix;
1253
1620
  }
1254
- //编辑插槽类型
1255
1621
  if (columnSelectedWidget) {
1256
- row.columnOption = columnSelectedWidget.options;
1257
1622
  row.editWidget = columnSelectedWidget;
1258
1623
  } else {
1259
- row.editColumnOption = {};
1260
1624
  row.editWidget = null;
1261
1625
  }
1262
1626
  }
@@ -1267,8 +1631,11 @@ export default {
1267
1631
  row.label = null;
1268
1632
  row.sortable = false;
1269
1633
  row.width = 150;
1634
+ row.widget = null;
1270
1635
  } else if (isButtontCell) {
1271
- if (row.formatS == "aLink" || row.formatS == "button") {
1636
+ if (row.formatS == "dropdown") {
1637
+ row.width = 100;
1638
+ } else if (row.formatS == "aLink" || row.formatS == "button") {
1272
1639
  if (!row.width || row.width == 47) row.width = 150;
1273
1640
  } else {
1274
1641
  row.width = 47;
@@ -1276,6 +1643,7 @@ export default {
1276
1643
  row.prop = null;
1277
1644
  row.label = null;
1278
1645
  row.sortable = false;
1646
+ row.filterable = false;
1279
1647
  } else {
1280
1648
  let tmpId = "column" + generateId();
1281
1649
  if (!row.width || row.width == 47) row.width = 150;
@@ -1283,7 +1651,9 @@ export default {
1283
1651
  if (!row.label) row.label = tmpId;
1284
1652
 
1285
1653
  if (this.userFields.includes(row.formatS)) {
1286
- let item = this.businessOptions.find((item) => item.value == row.formatS);
1654
+ let item = this.businessOptions.find(
1655
+ (item) => item.value == row.formatS
1656
+ );
1287
1657
  if (item) {
1288
1658
  row.prop = item.value;
1289
1659
  row.label = item.label;
@@ -1310,92 +1680,79 @@ export default {
1310
1680
  let type = this.columnFormatMap[formatS];
1311
1681
 
1312
1682
  if (type) {
1313
- // columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
1314
- columnSelectedWidget = this.designer.copyNewFieldWidget(
1315
- this.designer.getFieldWidgetByType(type)
1316
- );
1317
- /*let tmpId = generateId();
1318
- let idVal = row.prop ? row.prop : (type + tmpId);*/
1319
- /*columnSelectedWidget.id = idVal;*/
1320
- // columnSelectedWidget.options.name = idVal;
1321
- /*if (isEdit) {
1322
- columnSelectedWidget.id = "edit_" + row.columnId;
1323
- } else {
1324
- columnSelectedWidget.id = row.columnId;
1325
- }*/
1326
- // columnSelectedWidget.id = row.columnId;
1327
- let columnOption;
1328
- if (!isEdit) {
1329
- columnOption = row.columnOption;
1330
- } else {
1331
- columnOption = row.editColumnOption;
1332
- }
1333
- if (!isChange && columnOption && Object.keys(columnOption).length) {
1334
- columnOption.required = row.required || false;
1335
- columnSelectedWidget.options = columnOption;
1336
- if ("editDelete" == formatS) {
1337
- columnSelectedWidget.options.hiddenByWf =
1338
- columnSelectedWidget.options.hiddenByWf ?? true;
1339
- columnSelectedWidget.options.prefixIcon =
1340
- columnSelectedWidget.options.prefixIcon || "el-icon-delete";
1341
- } else if ("editButton" == formatS) {
1342
- columnSelectedWidget.options.prefixIcon =
1343
- columnSelectedWidget.options.prefixIcon || "el-icon-edit";
1344
- }
1345
- } else {
1346
- columnSelectedWidget.options.required = row.required || false;
1347
-
1683
+ const applyNewWidgetDefaults = (widget) => {
1684
+ widget.options.required = row.required || false;
1348
1685
  if ("editDelete" == formatS) {
1349
- columnSelectedWidget.options.prefixIcon = "el-icon-delete";
1350
- columnSelectedWidget.options.label = "删除";
1351
- columnSelectedWidget.options.labelHidden = true;
1352
- columnSelectedWidget.options.hiddenByWf = true;
1353
- columnSelectedWidget.options.onClick =
1686
+ widget.options.prefixIcon = "el-icon-delete";
1687
+ widget.options.label = "删除";
1688
+ widget.options.labelHidden = true;
1689
+ widget.options.hiddenByWf = true;
1690
+ widget.options.onClick =
1354
1691
  "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
1355
1692
  } else if ("editButton" == formatS) {
1356
- columnSelectedWidget.options.prefixIcon = "el-icon-edit";
1357
- columnSelectedWidget.options.label = "查看";
1358
- columnSelectedWidget.options.labelHidden = true;
1359
- columnSelectedWidget.options.onClick =
1693
+ widget.options.prefixIcon = "el-icon-edit";
1694
+ widget.options.label = "查看";
1695
+ widget.options.labelHidden = true;
1696
+ widget.options.onClick =
1360
1697
  "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
1361
1698
  } else if ("addSiblingEditRow" == formatS) {
1362
- columnSelectedWidget.options.prefixIcon = "el-icon-plus";
1363
- columnSelectedWidget.options.label = "新增兄弟节点";
1364
- columnSelectedWidget.options.labelHidden = false;
1365
- columnSelectedWidget.options.onClick =
1699
+ widget.options.prefixIcon = "el-icon-plus";
1700
+ widget.options.label = "新增兄弟节点";
1701
+ widget.options.labelHidden = false;
1702
+ widget.options.onClick =
1366
1703
  "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
1367
1704
  } else if ("addChildTreeRow" == formatS) {
1368
- columnSelectedWidget.options.prefixIcon = "el-icon-plus";
1369
- columnSelectedWidget.options.label = "新增子节点";
1370
- columnSelectedWidget.options.labelHidden = false;
1371
- columnSelectedWidget.options.onClick =
1705
+ widget.options.prefixIcon = "el-icon-plus";
1706
+ widget.options.label = "新增子节点";
1707
+ widget.options.labelHidden = false;
1708
+ widget.options.onClick =
1372
1709
  "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
1373
1710
  } else if ("moveUpRow" == formatS) {
1374
- // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
1375
- columnSelectedWidget.options.label = "↑上移";
1376
- columnSelectedWidget.options.labelHidden = false;
1377
- columnSelectedWidget.options.onClick =
1711
+ widget.options.label = "↑上移";
1712
+ widget.options.labelHidden = false;
1713
+ widget.options.onClick =
1378
1714
  "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
1379
1715
  } else if ("moveDownRow" == formatS) {
1380
- // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
1381
- columnSelectedWidget.options.label = "↓下移";
1382
- columnSelectedWidget.options.labelHidden = false;
1383
- columnSelectedWidget.options.onClick =
1716
+ widget.options.label = "↓下移";
1717
+ widget.options.labelHidden = false;
1718
+ widget.options.onClick =
1384
1719
  "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
1385
1720
  } else if ("removeTreeRow" == formatS) {
1386
- columnSelectedWidget.options.prefixIcon = "el-icon-delete";
1387
- columnSelectedWidget.options.label = "删除";
1388
- columnSelectedWidget.options.labelHidden = true;
1389
- columnSelectedWidget.options.onClick =
1721
+ widget.options.prefixIcon = "el-icon-delete";
1722
+ widget.options.label = "删除";
1723
+ widget.options.labelHidden = true;
1724
+ widget.options.onClick =
1390
1725
  "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
1391
1726
  }
1727
+ };
1392
1728
 
1393
- columnOption = columnSelectedWidget.options;
1729
+ if (!isChange) {
1730
+ const sourceWidget = this.designer.getColumnWidget(row, isEdit);
1731
+ if (sourceWidget) {
1732
+ columnSelectedWidget = this.$baseLodash.cloneDeep(sourceWidget);
1733
+ columnSelectedWidget.options.required = row.required || false;
1734
+ if ("editDelete" == formatS) {
1735
+ columnSelectedWidget.options.hiddenByWf =
1736
+ columnSelectedWidget.options.hiddenByWf ?? true;
1737
+ columnSelectedWidget.options.prefixIcon =
1738
+ columnSelectedWidget.options.prefixIcon || "el-icon-delete";
1739
+ } else if ("editButton" == formatS) {
1740
+ columnSelectedWidget.options.prefixIcon =
1741
+ columnSelectedWidget.options.prefixIcon || "el-icon-edit";
1742
+ }
1743
+ } else {
1744
+ columnSelectedWidget = this.designer.copyNewFieldWidget(
1745
+ this.designer.getFieldWidgetByType(type)
1746
+ );
1747
+ applyNewWidgetDefaults(columnSelectedWidget);
1748
+ }
1749
+ } else {
1750
+ columnSelectedWidget = this.designer.copyNewFieldWidget(
1751
+ this.designer.getFieldWidgetByType(type)
1752
+ );
1753
+ applyNewWidgetDefaults(columnSelectedWidget);
1394
1754
  }
1395
1755
 
1396
- // columnSelectedWidget.options.name = isEdit? (type + row.columnId) : row.prop;
1397
- // columnSelectedWidget.options.name = type + row.columnId;
1398
- // columnSelectedWidget.options.name = row.prop;
1399
1756
  if (columnSelectedWidget.options.hasOwnProperty("keyName")) {
1400
1757
  columnSelectedWidget.options.keyName = row.prop;
1401
1758
  columnSelectedWidget.options.keyNameEnabled = true;
@@ -1414,14 +1771,15 @@ export default {
1414
1771
  let result = null;
1415
1772
  if (columnList) {
1416
1773
  let column = columnList.find((item) => item.columnId == columnId);
1417
- if (!column) {
1418
- }
1419
1774
  for (let column of columnList) {
1420
1775
  if (column.columnId == columnId) {
1421
1776
  result = column;
1422
1777
  break;
1423
1778
  } else if (column.children && column.children.length) {
1424
- let subColumn = this.findColumnByColumnId(column.children, children);
1779
+ let subColumn = this.findColumnByColumnId(
1780
+ column.children,
1781
+ children
1782
+ );
1425
1783
  if (subColumn) {
1426
1784
  result = subColumn;
1427
1785
  break;
@@ -1440,10 +1798,29 @@ export default {
1440
1798
  }
1441
1799
  return widget;
1442
1800
  },
1801
+ confirmEditTreeButtonGroupConfig(rowConfig) {
1802
+ if (this.currentEditTreeButtonGroupRow) {
1803
+ Object.assign(this.currentEditTreeButtonGroupRow, rowConfig);
1804
+ }
1805
+ this.currentEditTreeButtonGroupRow = null;
1806
+ this.editTreeButtonGroupRowData = null;
1807
+ },
1443
1808
  openFormatConfigDialog(row, index) {
1809
+ if (row.formatS === "editTreeButtonGroup") {
1810
+ this.currentEditTreeButtonGroupRow = row;
1811
+ this.editTreeButtonGroupRowData = this.$baseLodash.cloneDeep(row);
1812
+ this.showEditTreeButtonGroupConfigDialog = true;
1813
+ return;
1814
+ }
1444
1815
  if (row.formatS == "widgetRender") {
1445
1816
  let formWidgetList = deepClone(this.designer.widgetList);
1446
- let tableData = deepClone(this.tableData);
1817
+ const widgetMap = this.buildColumnWidgetMap(
1818
+ this.sourceTableColumnsSnapshot || this.optionModel.tableColumns || []
1819
+ );
1820
+ let tableData = this.restoreColumnWidgetRefs(
1821
+ this.cloneTableColumnsForEdit(this.tableData),
1822
+ widgetMap
1823
+ );
1447
1824
  let columnId = row.columnId;
1448
1825
 
1449
1826
  let dataTableName = this.optionModel.name;
@@ -1452,7 +1829,10 @@ export default {
1452
1829
  loopHandleWidget(formWidgetList, (item) => {
1453
1830
  if (item.options.name == dataTableName) {
1454
1831
  item.options.tableColumns = tableData;
1455
- targetColumn = this.findColumnByColumnId(item.options.tableColumns, columnId);
1832
+ targetColumn = this.findColumnByColumnId(
1833
+ item.options.tableColumns,
1834
+ columnId
1835
+ );
1456
1836
  }
1457
1837
  });
1458
1838
  let getWidgetList = (subWidgetList = []) => {
@@ -1470,32 +1850,24 @@ export default {
1470
1850
  return;
1471
1851
  }
1472
1852
 
1473
- /*let option = row.columnOption;
1474
- let selectedWidget;
1475
- let columnWidgetConfig = this.getColumnWidgetConfig(row);
1476
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1477
- if (columnSelectedWidget) {
1478
- option = columnSelectedWidget.options;
1479
- selectedWidget = columnSelectedWidget;
1480
- } else {
1481
- option = {};
1482
- selectedWidget = {};
1853
+ const { columnSelectedWidget, columnEditFields } =
1854
+ this.getColumnWidgetConfig(row);
1855
+ if (!columnSelectedWidget) {
1856
+ this.$message.warning(this.$t1("请先选择列格式化类型"));
1857
+ return;
1483
1858
  }
1484
-
1485
- let columnOption = this.$baseLodash.cloneDeep(option);
1486
- row.columnOption = columnOption;*/
1487
- let selectedWidget = row.widget;
1859
+ columnSelectedWidget.options = this.$baseLodash.cloneDeep(
1860
+ columnSelectedWidget.options
1861
+ );
1488
1862
  this.operateIndex = index;
1489
-
1490
- let tableColumns = this.tableData;
1491
1863
  this.openWidgetPropertyDialog({
1492
1864
  row: row,
1493
- columnSelectedWidget: selectedWidget,
1494
- tableColumns,
1865
+ columnSelectedWidget,
1866
+ tableColumns: this.tableData,
1495
1867
  index: index,
1496
- // columnEditFields: columnEditFields,
1497
- callback: (columnOption) => {
1498
- this.confirmFormatConfigDialog(columnOption, row);
1868
+ columnEditFields,
1869
+ callback: (confirmedWidget) => {
1870
+ this.confirmFormatConfigDialog(confirmedWidget, row);
1499
1871
  },
1500
1872
  });
1501
1873
  },
@@ -1503,61 +1875,44 @@ export default {
1503
1875
  let o = options.name;
1504
1876
  return (options.keyNameEnabled && options.keyName) || o;
1505
1877
  },
1506
- confirmFormatConfigDialog(columnOption, row) {
1507
- // let row = this.tableData[this.operateIndex];
1508
- row.columnOption = columnOption;
1509
-
1510
- if (row.widget) {
1511
- row.widget.options = columnOption;
1512
- } else {
1513
- let type = this.columnFormatMap[row.formatS];
1514
- let fieldWidget = this.designer.createColumnWidget(row, false);
1515
- fieldWidget.options = columnOption;
1516
- row.widget = fieldWidget;
1517
- this.$forceUpdate();
1518
- }
1878
+ confirmFormatConfigDialog(columnSelectedWidget, row) {
1879
+ row.widget = columnSelectedWidget;
1880
+ const options = columnSelectedWidget.options;
1519
1881
 
1520
1882
  let isButtontCell = this.getIsButtontCell(row.formatS);
1521
1883
  if (!isButtontCell) {
1522
- row.prop = this.getFieldKeyNameByOptions(columnOption);
1523
- row.label = columnOption.label;
1524
- row.required = columnOption.required;
1884
+ row.prop = this.getFieldKeyNameByOptions(options);
1885
+ row.label = options.label;
1886
+ row.required = options.required;
1525
1887
  }
1526
1888
  },
1527
1889
  openEditFormatConfigDialog(row, index) {
1528
- let selectedWidget = row.editWidget;
1890
+ const { columnSelectedWidget, columnEditFields } =
1891
+ this.getColumnWidgetConfig(row, false, true);
1892
+ if (!columnSelectedWidget) {
1893
+ this.$message.warning(this.$t1("请先选择编辑列格式化类型"));
1894
+ return;
1895
+ }
1896
+ columnSelectedWidget.options = this.$baseLodash.cloneDeep(
1897
+ columnSelectedWidget.options
1898
+ );
1529
1899
  this.operateIndex = index;
1530
-
1531
- let tableColumns = this.tableData;
1532
1900
  this.openWidgetPropertyDialog({
1533
1901
  row: row,
1534
- tableColumns,
1535
- columnSelectedWidget: selectedWidget,
1902
+ tableColumns: this.tableData,
1903
+ columnSelectedWidget,
1536
1904
  index: index,
1537
- // columnEditFields: columnEditFields,
1538
- callback: (columnOption) => {
1539
- this.confirmEditFormatConfigDialog(columnOption, row);
1905
+ columnEditFields,
1906
+ callback: (confirmedWidget) => {
1907
+ this.confirmEditFormatConfigDialog(confirmedWidget, row);
1540
1908
  },
1541
1909
  });
1542
1910
  },
1543
- confirmEditFormatConfigDialog(columnOption, row) {
1544
- // let row = this.tableData[this.operateIndex];
1545
- row.editColumnOption = columnOption;
1546
- // row.editWidget.options = columnOption;
1547
-
1548
- if (row.editWidget) {
1549
- row.editWidget.options = columnOption;
1550
- } else {
1551
- let type = this.columnFormatMap[row.editFormatS];
1552
- let fieldWidget = this.designer.createColumnWidget(row, true);
1553
- fieldWidget.options = columnOption;
1554
- row.editWidget = fieldWidget;
1555
- this.$forceUpdate();
1556
- }
1557
-
1558
- /*row.prop = columnOption.name;
1559
- row.label = columnOption.label;
1560
- row.required = columnOption.required;*/
1911
+ confirmEditFormatConfigDialog(columnSelectedWidget, row) {
1912
+ row.editWidget = columnSelectedWidget;
1913
+ },
1914
+ openColumnShowDialog(row) {
1915
+ this.editFormEventHandler(row, this.rowDataIndex, "columnShow");
1561
1916
  },
1562
1917
  openTableColumnConfigDialog(row, index) {
1563
1918
  this.operateIndex = index;
@@ -1575,7 +1930,6 @@ export default {
1575
1930
  this.showTableColumnConfigDialog = true;
1576
1931
  },
1577
1932
  saveTableColumnConfigDialog() {
1578
- // let row = this.tableData[this.operateIndex];
1579
1933
  let row = this.currentTableColumn;
1580
1934
  const codeHints = this.$refs.ecEditor.getEditorAnnotations();
1581
1935
  let syntaxErrorFlag = false;
@@ -1587,7 +1941,9 @@ export default {
1587
1941
  });
1588
1942
 
1589
1943
  if (syntaxErrorFlag) {
1590
- this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
1944
+ this.$message.error(
1945
+ this.i18nt("designer.setting.syntaxCheckWarning")
1946
+ );
1591
1947
  return;
1592
1948
  }
1593
1949
  }
@@ -1611,45 +1967,61 @@ export default {
1611
1967
  let type1 = this.columnFormatMap[row.formatS];
1612
1968
  let type2 = this.columnFormatMap[row.editFormatS];
1613
1969
  let newWidget = type1
1614
- ? this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type1))
1970
+ ? this.designer.copyNewFieldWidget(
1971
+ this.designer.getFieldWidgetByType(type1)
1972
+ )
1615
1973
  : null;
1616
1974
 
1617
1975
  let newEditWidget = type2
1618
- ? this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type2))
1976
+ ? this.designer.copyNewFieldWidget(
1977
+ this.designer.getFieldWidgetByType(type2)
1978
+ )
1619
1979
  : null;
1620
1980
 
1621
- if (newWidget.formItemFlag) {
1622
- if (row.widget) {
1623
- if (row.widget.options[key] !== undefined) row.widget.options[key] = value;
1624
- }
1625
- if (row.columnOption) {
1626
- if (row.columnOption[key] !== undefined) row.columnOption[key] = value;
1981
+ if (newWidget && newWidget.formItemFlag && row.widget) {
1982
+ if (row.widget.options[key] !== undefined) {
1983
+ row.widget.options[key] = value;
1627
1984
  }
1628
1985
  }
1629
1986
 
1630
- if (newWidget.formItemFlag) {
1631
- if (row.editWidget) {
1632
- if (row.editWidget.options[key] !== undefined)
1633
- row.editWidget.options[key] = value;
1634
- }
1635
- if (row.editColumnOption) {
1636
- if (row.editColumnOption[key] !== undefined) row.editColumnOption[key] = value;
1987
+ if (newEditWidget && newEditWidget.formItemFlag && row.editWidget) {
1988
+ if (row.editWidget.options[key] !== undefined) {
1989
+ row.editWidget.options[key] = value;
1637
1990
  }
1638
1991
  }
1639
1992
  },
1640
1993
  openRowEditDialog(row, index) {
1641
1994
  this.editRowData = row;
1642
- this.rowData = this.$baseLodash.cloneDeep(row);
1995
+ this.rowData = this.cloneTableColumnsForEdit([row])[0];
1643
1996
  this.rowDataIndex = index;
1644
1997
  this.showRowEditDialog = true;
1645
1998
  },
1646
1999
  submitRowEditDialog() {
1647
- Object.assign(this.editRowData, this.$baseLodash.cloneDeep(this.rowData));
1648
- // this.editRowData = this.$baseLodash.cloneDeep(this.rowData);
2000
+ Object.assign(this.editRowData, this.rowData);
2001
+ if (this.rowData.widget) {
2002
+ this.editRowData.widget = this.rowData.widget;
2003
+ }
2004
+ if (this.rowData.editWidget) {
2005
+ this.editRowData.editWidget = this.rowData.editWidget;
2006
+ }
2007
+ if (this.rowData.widgetList && this.rowData.widgetList.length) {
2008
+ this.editRowData.widgetList = this.rowData.widgetList;
2009
+ }
1649
2010
  this.showRowEditDialog = false;
2011
+ this.labelTooltipDialogVisible = false;
1650
2012
  },
1651
2013
  closeRowEditDialog() {
1652
2014
  this.showRowEditDialog = false;
2015
+ this.labelTooltipDialogVisible = false;
2016
+ },
2017
+ openLabelTooltipDialog() {
2018
+ this.labelTooltipValue = this.rowData.labelTooltip || "";
2019
+ this.labelTooltipDialogVisible = true;
2020
+ },
2021
+ submitLabelTooltipDialog() {
2022
+ const value = (this.labelTooltipValue || "").trim();
2023
+ this.rowData.labelTooltip = value || null;
2024
+ this.labelTooltipDialogVisible = false;
1653
2025
  },
1654
2026
  },
1655
2027
  };
@@ -1658,4 +2030,70 @@ export default {
1658
2030
  .icon-drag:before {
1659
2031
  content: "\e61d";
1660
2032
  }
2033
+
2034
+ /* 固定弹框内容区高度,避免加载前后抖动 */
2035
+ ::v-deep .table-column-config-dialog.el-dialog {
2036
+ .el-dialog__body {
2037
+ height: 532px;
2038
+ max-height: 532px;
2039
+ overflow: hidden;
2040
+ box-sizing: border-box;
2041
+ }
2042
+ }
2043
+
2044
+ .table-column-dialog-cont {
2045
+ height: 516px;
2046
+ min-height: 516px;
2047
+ max-height: 516px;
2048
+ overflow: hidden;
2049
+ box-sizing: border-box;
2050
+ }
2051
+
2052
+ /* 完整列配置弹框:挂到 body,内容区可滚动 */
2053
+ ::v-deep .table-column-row-edit-dialog.el-dialog {
2054
+ .el-dialog__body {
2055
+ max-height: calc(90vh - 130px);
2056
+ overflow-y: auto;
2057
+ overflow-x: hidden;
2058
+ box-sizing: border-box;
2059
+
2060
+ .cont.table-column-row-edit-cont {
2061
+ overflow: visible;
2062
+ max-height: none;
2063
+ padding-bottom: 12px;
2064
+ }
2065
+
2066
+ .form-m2 {
2067
+ height: auto !important;
2068
+ overflow: visible !important;
2069
+
2070
+ .el-form-item.form-item-full:last-child {
2071
+ margin-bottom: 8px;
2072
+ }
2073
+ }
2074
+ }
2075
+ }
2076
+
2077
+ .table-column-row-edit-cont {
2078
+ box-sizing: border-box;
2079
+
2080
+ ::v-deep .form-m2 {
2081
+ .form-item-full {
2082
+ width: calc(100% - 20px) !important;
2083
+ display: block;
2084
+ }
2085
+
2086
+ .form-item-full .el-input {
2087
+ width: 100% !important;
2088
+ }
2089
+ }
2090
+
2091
+ ::v-deep .custom-divider.el-divider--horizontal {
2092
+ margin: 10px 0;
2093
+ }
2094
+ }
2095
+
2096
+ ::v-deep .label-tooltip-textarea textarea {
2097
+ min-height: 320px;
2098
+ }
1661
2099
  </style>