cloud-web-corejs 1.0.54-dev.797 → 1.0.54-dev.799

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 (187) hide show
  1. package/package.json +3 -1
  2. package/src/components/baseTabs/mixins.js +11 -12
  3. package/src/components/bizTab/BizBillActions.vue +129 -0
  4. package/src/components/bizTab/BizTabListPage.vue +391 -0
  5. package/src/components/bizTab/README.md +378 -0
  6. package/src/components/bizTab/billTableUtil.js +48 -0
  7. package/src/components/bizTab/billValidators.js +136 -0
  8. package/src/components/bizTab/bizBillDetailMixin.js +687 -0
  9. package/src/components/bizTab/index.js +24 -0
  10. package/src/components/excelExport/exportFieldDialog.vue +373 -367
  11. package/src/components/excelExport/exportType.js +49 -0
  12. package/src/components/excelExport/mixins.js +1153 -1141
  13. package/src/components/vb-tabs/x-tabs.vue +167 -143
  14. package/src/components/wf/wfUtil.js +327 -292
  15. package/src/components/xform/form-designer/designer.js +56 -8
  16. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
  17. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +60 -8
  18. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +8 -2
  19. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -92
  20. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +63 -94
  21. package/src/components/xform/form-designer/index.vue +0 -1
  22. package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
  23. package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -602
  24. package/src/components/xform/form-designer/setting-panel/form-setting.vue +13 -13
  25. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -585
  26. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
  27. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
  28. package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
  29. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
  30. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
  31. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
  32. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1154 -1154
  33. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -80
  34. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -75
  35. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
  36. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +1 -1
  37. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
  38. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
  39. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
  40. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
  41. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
  42. package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
  43. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
  44. package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
  45. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
  46. package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
  47. package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -344
  48. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
  49. package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
  50. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
  51. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
  52. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
  53. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
  54. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
  55. package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
  56. package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
  57. package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
  58. package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
  59. package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
  60. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
  61. package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
  62. package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
  63. package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
  64. package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
  65. package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
  66. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
  67. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
  68. package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
  69. package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
  70. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -84
  71. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
  72. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -97
  73. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -188
  74. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
  75. package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
  76. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +4 -4
  77. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +1 -1
  78. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
  79. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
  80. package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
  81. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
  82. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +1 -1
  83. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
  84. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
  85. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
  86. package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
  87. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
  88. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
  89. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
  90. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
  91. package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
  92. package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
  93. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
  94. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +3 -3
  95. package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
  96. package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
  97. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
  98. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
  99. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
  100. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
  101. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
  102. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
  103. package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
  104. package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
  105. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
  106. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
  107. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
  108. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
  109. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
  110. package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
  111. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
  112. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -71
  113. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
  114. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +1 -1
  115. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
  116. package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +1 -1
  117. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +1 -1
  118. package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
  119. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
  120. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
  121. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
  122. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
  123. package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
  124. package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
  125. package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
  126. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +2 -1
  127. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
  128. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
  129. package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
  130. package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
  131. package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
  132. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
  133. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
  134. package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
  135. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
  136. package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
  137. package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
  138. package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
  139. package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
  140. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
  141. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +178 -178
  142. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
  143. package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
  144. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
  145. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
  146. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
  147. package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
  148. package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
  149. package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
  150. package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
  151. package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
  152. package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
  153. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
  154. package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
  155. package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
  156. package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
  157. package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
  158. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
  159. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
  160. package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
  161. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
  162. package/src/components/xform/form-designer/widget-panel/index.vue +3 -1
  163. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -13
  164. package/src/components/xform/form-render/container-item/data-table-mixin copy.js +5910 -0
  165. package/src/components/xform/form-render/container-item/data-table-mixin.js +59 -13
  166. package/src/components/xform/form-render/container-item/detail-item.vue +52 -11
  167. package/src/components/xform/form-render/container-item/tab-item.vue +6 -2
  168. package/src/components/xform/form-render/indexMixin.js +56 -16
  169. package/src/components/xform/lang/zh-CN.js +2 -1
  170. package/src/components/xform/utils/attachmentValueUtil.js +239 -0
  171. package/src/components/xform/utils/util.js +27 -0
  172. package/src/mixins/wf/index.js +40 -38
  173. package/src/router/modules/customer.js +50 -0
  174. package/src/store/config/index.js +46 -0
  175. package/src/utils/scrollUtil.js +25 -0
  176. package/src/views/demo/bizTab/bill/billConfig.js +41 -0
  177. package/src/views/demo/bizTab/bill/detail.vue +436 -0
  178. package/src/views/demo/bizTab/bill/list.vue +288 -0
  179. package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
  180. package/src/views/demo/bizTab/simple/billApi.js +123 -0
  181. package/src/views/demo/bizTab/simple/detail.vue +407 -0
  182. package/src/views/demo/bizTab/simple/list.vue +217 -0
  183. package/src/views/demo/bizTab/standalone/index.vue +121 -0
  184. package/src/views/demo/bizTab/wf/billConfig.js +44 -0
  185. package/src/views/demo/bizTab/wf/detail.vue +661 -0
  186. package/src/views/demo/bizTab/wf/list.vue +242 -0
  187. package/src/views/user/outLink/cc_form_view.vue +185 -0
@@ -301,7 +301,7 @@ let chartContainers = [],
301
301
  handleKeyNameSuffix(selected) {
302
302
  if (!selected) return;
303
303
  let optionModel = selected.options;
304
- let prefix = this.getKeyNamePrefix(selected.type);
304
+ let prefix = this.getKeyNamePrefix(selected.type, optionModel);
305
305
  if (
306
306
  optionModel.keyNameEnabled &&
307
307
  !!prefix &&
@@ -1298,9 +1298,9 @@ let chartContainers = [],
1298
1298
  this.emitEvent("canvas-add-field", newWidget.options.name);
1299
1299
  return newWidget;
1300
1300
  },
1301
- createKeyName(type, suffix) {
1301
+ createKeyName(type, suffix, options) {
1302
1302
  let keyNameSuffix = suffix ? suffix : this.createKeyNameSuffix(type);
1303
- let keyNamePrefix = this.getKeyNamePrefix(type);
1303
+ let keyNamePrefix = this.getKeyNamePrefix(type, options);
1304
1304
  let keyName = null;
1305
1305
  if (keyNamePrefix) {
1306
1306
  keyName = keyNamePrefix + keyNameSuffix;
@@ -1317,7 +1317,13 @@ let chartContainers = [],
1317
1317
  }*/
1318
1318
  return suffix;
1319
1319
  },
1320
- getKeyNamePrefix(type) {
1320
+ /* 开了「值存为URL」的附件字段存的是主表普通列(值是 URL 字符串),不再走
1321
+ attachments_ 独立附件通道,keyName 不能带前缀——否则保存时会被
1322
+ data-table-mixin 的 attachments_ 提取逻辑当附件包发走,主表列存不到 */
1323
+ getKeyNamePrefix(type, options) {
1324
+ if (options && options.urlValueEnabled) {
1325
+ return null;
1326
+ }
1321
1327
  return keyNamePrefixMap[type] ?? null;
1322
1328
  },
1323
1329
  getFormCodePrefix(type) {
@@ -1492,6 +1498,39 @@ let chartContainers = [],
1492
1498
  ); //vabUpload
1493
1499
  newCol.widgetList.push(vabUploadCon);
1494
1500
  newCon.panes.push(newCol);
1501
+
1502
+ /* 「详情模块(标签)」面板条目:type=detail-tabs + targetType=detail,落地后就是 detail,
1503
+ 不是新的容器类型。与「详情模块」的区别是内容模块不直接挂在正文区,而是收进标签里,
1504
+ 详见 docs/详情模块标签承载方案.md */
1505
+ if (newCon.sourceType === "detail-tabs") {
1506
+ // 上面已按 detail 的默认骨架建好一批内容模块,整体挪进第一个标签——
1507
+ // 标签形态下正文区只放标签容器,不留散在标签外面的模块。
1508
+ let presetPanes = newCon.panes.splice(0);
1509
+
1510
+ // 标签内的模块由 detail-plain 承载:它自带一套独立锚点导航,
1511
+ // 外层 baseTabs 探测不到标签内的模块(tab-item 不满足 getTabs 的两个条件)。
1512
+ let plainCon = this.copyNewContainerWidget(
1513
+ this.getContainerByType("detail-plain")
1514
+ );
1515
+ plainCon.panes = presetPanes; // 丢掉 detail-plain 自带的默认模块,用上面建好的这批
1516
+ plainCon.options.hideNav = false; // schema 默认关导航,标签内要开
1517
+
1518
+ let tabCon = this.copyNewContainerWidget(
1519
+ this.getContainerByType("tab")
1520
+ );
1521
+ tabCon.tabs[0].widgetList.push(plainCon);
1522
+
1523
+ // copyNewContainerWidget 只预置 1 个 tab-pane,只有一个标签页的标签栏看着像 bug,补第二个
1524
+ let secondPane = baseRefUtil.deepClone(
1525
+ this.getContainerByType("tab-pane")
1526
+ );
1527
+ secondPane.id = "tab-pane-" + baseRefUtil.generateId();
1528
+ secondPane.options.name = "tab2";
1529
+ secondPane.options.label = "tab 2";
1530
+ tabCon.tabs.push(secondPane);
1531
+
1532
+ newCon.panes.push(tabCon);
1533
+ }
1495
1534
  } else if (newCon.type === "table-column") {
1496
1535
  newCon.options.label = "tableColumn";
1497
1536
  } else if (newCon.type === "h5-card") {
@@ -1682,10 +1721,19 @@ let chartContainers = [],
1682
1721
  this.emitEvent("canvas-add-field", newWidget.options.name),
1683
1722
  this.emitHistoryChange();
1684
1723
  },
1685
- deletePaneOfDetail(gridWidget, colIdx) {
1686
- if (!!gridWidget && !!gridWidget.panes) {
1687
- gridWidget.panes.splice(colIdx, 1);
1688
- }
1724
+ /**
1725
+ * 删除详情容器下的一个 pane。
1726
+ * @param gridWidget 详情容器(detail / detail-plain)
1727
+ * @param paneOrIdx pane 的 widget 引用,或它在 panes 中的下标。
1728
+ * detail 的属性面板按 type 做了显隐,下标不再可靠,故走引用;
1729
+ * detail-plain 的属性面板仍传下标,这里一并兼容。
1730
+ */
1731
+ deletePaneOfDetail(gridWidget, paneOrIdx) {
1732
+ if (!gridWidget || !gridWidget.panes) return;
1733
+ let isIdx = typeof paneOrIdx === "number";
1734
+ let colIdx = isIdx ? paneOrIdx : gridWidget.panes.indexOf(paneOrIdx);
1735
+ if (colIdx < 0) return;
1736
+ gridWidget.panes.splice(colIdx, 1);
1689
1737
  },
1690
1738
  cloneDetailPane(widget, parentWidget) {
1691
1739
  let newGridCol = baseRefUtil.deepClone(
@@ -65,11 +65,57 @@
65
65
  <el-button type="primary" class="button-sty" icon="el-icon-check">保存</el-button>
66
66
  </div>-->
67
67
  </div>
68
- <baseTabs style="height: auto;">
69
- <detail-pane-widget v-for="(paneWidget, index) in widget.panes" :key="index" :widget="paneWidget" :designer="designer" :parent-list="widget.panes"
70
- :index-of-parent-list="index" :parent-widget="widget"
71
- :col-height="widget.options.colHeight" tabRef="baseTabRef" :tabPaneGrade="2"></detail-pane-widget>
72
- </baseTabs>
68
+ <!-- 正文区:通用容器列表。panes 里既可以直接挂 detail-pane(模块),也可以挂 tab 等
69
+ 其它容器(标签承载)。设计期这里不套 baseTabs——draggable 会隔断 baseTabs.getTabs()
70
+ slot 子级的探测(见 baseTabs/mixins.js getTabs),导航拿不到 pane,索性不渲染,
71
+ 左侧导航预览只在运行期有。 -->
72
+ <draggable
73
+ :list="widget.panes"
74
+ v-bind="{ group: 'dragGroup', ghostClass: 'ghost', animation: 200 }"
75
+ handle=".drag-handler"
76
+ @add="evt => onContainerDragAdd(evt, widget.panes)"
77
+ @update="onContainerDragUpdate"
78
+ :move="checkContainerMove"
79
+ >
80
+ <transition-group name="fade" tag="div" class="detail-pane-list">
81
+ <template v-for="(paneWidget, index) in widget.panes">
82
+ <!-- 模块:额外要 tabRef/tabPaneGrade,这两个 props 是 baseTabs 探测用的,只给 detail-pane -->
83
+ <detail-pane-widget
84
+ v-if="paneWidget.type === 'detail-pane'"
85
+ :key="paneWidget.id"
86
+ :widget="paneWidget"
87
+ :designer="designer"
88
+ :parent-list="widget.panes"
89
+ :index-of-parent-list="index"
90
+ :parent-widget="widget"
91
+ :col-height="widget.options.colHeight"
92
+ tabRef="baseTabRef"
93
+ :tabPaneGrade="2"
94
+ ></detail-pane-widget>
95
+ <component
96
+ v-else-if="'container' === paneWidget.category"
97
+ :is="paneWidget.type + '-widget'"
98
+ :key="paneWidget.id"
99
+ :widget="paneWidget"
100
+ :designer="designer"
101
+ :parent-list="widget.panes"
102
+ :index-of-parent-list="index"
103
+ :parent-widget="widget"
104
+ ></component>
105
+ <component
106
+ v-else
107
+ :is="paneWidget.type + '-widget'"
108
+ :key="paneWidget.id"
109
+ :field="paneWidget"
110
+ :designer="designer"
111
+ :parent-list="widget.panes"
112
+ :index-of-parent-list="index"
113
+ :parent-widget="widget"
114
+ :design-state="true"
115
+ ></component>
116
+ </template>
117
+ </transition-group>
118
+ </draggable>
73
119
  </div>
74
120
  </container-wrapper>
75
121
  </template>
@@ -140,6 +186,14 @@
140
186
  height: 100%;
141
187
  }
142
188
 
189
+ /* 正文区(panes)的拖放区。不能复用上面的 .form-widget-list——那条是 height:100% 且
190
+ min-height 被注释掉的,空态会塌成一条线,没有地方往里拖组件。
191
+ 这里给足高度,保证空态也是个看得见、拖得进的落区。 */
192
+ .detail-pane-list {
193
+ min-height: 150px;
194
+ height: auto;
195
+ }
196
+
143
197
  }
144
198
 
145
199
  .grid-container.selected, .grid-cell.selected {
@@ -19,6 +19,12 @@ import FormItemWrapper from './form-item-wrapper'
19
19
  import emitter from '../../../../../components/xform/utils/emitter'
20
20
  import i18n from "../../../../../components/xform/utils/i18n";
21
21
  import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
22
+ import {
23
+ normalizeAttachmentValue,
24
+ isSameAttachmentRows,
25
+ isSameModelValue,
26
+ toModelValue,
27
+ } from "../../../../../components/xform/utils/attachmentValueUtil";
22
28
 
23
29
  export default {
24
30
  name: "baseAttachment-widget",
@@ -65,7 +71,20 @@ export default {
65
71
  },
66
72
  watch: {
67
73
  fieldModel(val) {
68
- this.handleChangeEvent(val);
74
+ /* fieldMixin.initValueWatchEvent 监听模型值,一变就 initFieldModel(true)
75
+ 模型值原样灌回 fieldModel——URL 模式下灌回来的是字符串/字符串数组,会打破
76
+ 「fieldModel 恒为附件对象数组」这个内部约定,所以这里兜底归一。 */
77
+ let rows = normalizeAttachmentValue(val);
78
+ if (!isSameAttachmentRows(rows, val)) {
79
+ this.fieldModel = rows;
80
+ return;
81
+ }
82
+ /* 落到表单模型的值由 urlValueEnabled 决定是对象数组还是 URL 字符串。
83
+ 默认模式下 rows 就是 val 本身(归一未改动任何东西),写回模型的是同一个
84
+ 引用,模型值身份不变,不会触发 initValueWatchEvent 回灌。 */
85
+ let modelValue = this.toModelValue(rows);
86
+ if (this.isSameFieldModelValue(modelValue)) return;
87
+ this.handleChangeEvent(modelValue);
69
88
  },
70
89
  'option':function(){
71
90
 
@@ -119,6 +138,7 @@ export default {
119
138
  this.isH5 = this.getFormConfig()?.layoutType === 'H5';
120
139
 
121
140
  this.initFieldModel()
141
+ this.initAttachmentValue()
122
142
  this.registerToRefList()
123
143
  this.initEventHandler()
124
144
  this.buildFieldRules()
@@ -146,7 +166,9 @@ export default {
146
166
  resultType: "Array"
147
167
  },
148
168
  rows: (done) => {
149
- done(this.fieldModel);
169
+ /* base-attachment 对数组只走 domain + url 的对象分支,数组里混进
170
+ URL 字符串会得到 undefinedhttp://...,所以这里再兜一次归一 */
171
+ done(normalizeAttachmentValue(this.fieldModel));
150
172
  },
151
173
  confirm: (rows, fileInfos) => {
152
174
  this.fieldModel = rows;
@@ -157,24 +179,54 @@ export default {
157
179
  }
158
180
  }
159
181
  },
182
+ /* 模型里存的可能是 URL 字符串/数组(urlValueEnabled)或外部塞进来的 URL,
183
+ 统一归一成附件对象数组,组件内部只处理这一种形态 */
184
+ initAttachmentValue() {
185
+ let rows = normalizeAttachmentValue(this.fieldModel);
186
+ /* 归一前后等价就不重新赋值,换新数组会让 watcher 白触发一次 onChange */
187
+ if (!isSameAttachmentRows(rows, this.fieldModel)) {
188
+ this.fieldModel = rows;
189
+ }
190
+ },
191
+ toModelValue(rows) {
192
+ return toModelValue(rows, this.field.options);
193
+ },
194
+ /* URL 模式下 toModelValue 每次都产出新数组,值没变也回写模型的话,会和
195
+ initValueWatchEvent 形成「写模型 → 灌回 fieldModel → 又写模型」的死循环
196
+ (多值模式页面直接卡死)。默认模式模型值就是 fieldModel 本身、身份不变,
197
+ 不存在这个问题,行为保持原样。 */
198
+ isSameFieldModelValue(modelValue) {
199
+ if (!this.field.options.urlValueEnabled) return false;
200
+ let currentData = this.tableRow ? this.tableRow : this.formModel;
201
+ let current = currentData ? currentData[this.fieldKeyName] : undefined;
202
+ return isSameModelValue(current, modelValue);
203
+ },
160
204
  setValue(val) {
161
- let data = val || []
205
+ let data = normalizeAttachmentValue(val)
206
+ let modelValue = this.toModelValue(data);
162
207
  // 按 tableParam 决定落点:行内附件写回当前行对象,主表写回表单模型。
163
208
  // 旧实现固定写 getFormRef().formDataModel(顶层),行内附件会写错位置并丢失联动,
164
209
  // 且多行会互相覆盖同一个顶层字段。
165
- let currentData = this.tableParam && this.tableParam.row
166
- ? this.tableParam.row
167
- : this.formModel;
210
+ let currentData = this.tableRow ? this.tableRow : this.formModel;
168
211
  if (currentData[this.fieldKeyName] === undefined) {
169
- this.$set(currentData, this.fieldKeyName, [])
212
+ this.$set(currentData, this.fieldKeyName, modelValue)
170
213
  }
171
214
  // 赋值 fieldModel 会触发 watch.fieldModel -> handleChangeEvent(内部再走
172
215
  // syncUpdateFormModel + emitFieldDataChange,异步一次)。这里再同步写一次模型,
173
216
  // 保证 setValue 返回后立即可读到最新值,且落点与 watcher 一致,不会重复触发变更事件。
174
217
  this.fieldModel = data;
175
- this.syncUpdateFormModel(data);
218
+ this.syncUpdateFormModel(modelValue);
219
+ },
220
+ /* 脚本 API:直接用 URL 赋值,支持单个 URL、逗号/换行分隔的多个 URL、URL 数组。
221
+ 非法输入会被忽略并在控制台告警,不抛异常。 */
222
+ setValueByUrl(fileUrl) {
223
+ this.setValue(normalizeAttachmentValue(fileUrl));
176
224
  },
177
225
  loadDataDefaultHandle() {
226
+ /* URL 模式下值就存在主表列上、随表单 getOne 一起回来,不存在独立附件记录。
227
+ 再发这一包不仅多余,查不到还会 setValue([]) 把主表带回来的 URL 清掉。
228
+ 在这里拦截而不是改 onCreated 脚本,已有表单不用逐个改配置。 */
229
+ if (this.field.options.urlValueEnabled) return;
178
230
  let dataId = this.formDataId;
179
231
  if (!dataId) return;
180
232
  let reportTemplate = this.getFormRef().reportTemplate;
@@ -382,9 +382,15 @@ export default {
382
382
  return (opts.keyNameEnabled && opts.keyName) || opts.name || "";
383
383
  },
384
384
  compareExcluded() {
385
- // 按类型排除
385
+ // 按类型排除。附件类天然不参与对比,但开了「值存为URL」的附件字段存的是主表
386
+ // 普通列上的 URL 字符串,与普通字段无异,应照常参与对比
386
387
  let types = this.getCompareExcludeTypes() || [];
387
- if (types.indexOf(this.field.type) !== -1) return true;
388
+ if (
389
+ types.indexOf(this.field.type) !== -1 &&
390
+ !this.field.options.urlValueEnabled
391
+ ) {
392
+ return true;
393
+ }
388
394
  // 按字段名排除(系统字段 + 主表黑白名单 + 所在明细表的黑白名单)
389
395
  let fieldKeyName =
390
396
  (this.field.options.keyNameEnabled && this.field.options.keyName) ||
@@ -1,92 +1,120 @@
1
- <template>
2
- <static-content-wrapper
3
- :designer="designer"
4
- :field="field"
5
- :design-state="designState"
6
- :display-style="field.options.displayStyle"
7
- :parent-widget="parentWidget"
8
- :parent-list="parentList"
9
- :index-of-parent-list="indexOfParentList"
10
- >
11
- <el-button
12
- :type="field.options.type"
13
- class="button-sty"
14
- size="mini"
15
- icon="el-icon-upload2"
16
- @click="toDo('exportItem')"
17
- :disabled="field.options.disabled"
18
- >{{ getI18nLabel(field.options.label) }}
19
- </el-button>
20
- </static-content-wrapper>
21
- </template>
22
- <script>
23
- import emitter from "../../../utils/emitter";
24
- import i18n from "../../../utils/i18n";
25
- import fieldMixin from "./fieldMixin";
26
- import StaticContentWrapper from "./static-content-wrapper.vue";
27
-
28
- export default {
29
- name: "select-export-item-button-widget",
30
- components: { StaticContentWrapper },
31
- componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
32
- mixins: [emitter, fieldMixin, i18n],
33
- props: {
34
- field: Object,
35
- parentWidget: Object,
36
- parentList: Array,
37
- indexOfParentList: Number,
38
- designer: Object,
39
- designState: {
40
- type: Boolean,
41
- default: false,
42
- },
43
- },
44
- data() {
45
- return {};
46
- },
47
- beforeCreate() {
48
- /* 这里不能访问方法和属性!! */
49
- },
50
-
51
- created() {
52
- /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
53
- 需要在父组件created中初始化!! */
54
- this.registerToRefList();
55
- this.initEventHandler();
56
-
57
- this.handleOnCreated();
58
- },
59
-
60
- mounted() {
61
- this.handleOnMounted();
62
- },
63
-
64
- beforeDestroy() {
65
- this.unregisterFromRefList();
66
- },
67
-
68
- methods: {
69
- toDo(type = null) {
70
- if (this.designState) {
71
- return;
72
- }
73
- let opt = {
74
- title: this.field.options.exportFileName || null,
75
- targetRef: this.field.options.tableRef || null,
76
- pageSize: this.field.options.exportPageSize || null,
77
- showImageAtTable: this.field.options.showImageAtTable || null,
78
- };
79
- let tableExportParam = this.handleCustomEvent(this.field.options.tableExportParam);
80
- let options = { ...opt, ...tableExportParam, type: type };
81
- let tableRef = options?.targetRef;
82
- delete options.targetRef;
83
- let tableWidget = this.getWidgetRef(tableRef);
84
- tableWidget.exportData(options);
85
- },
86
- },
87
- };
88
- </script>
89
-
90
- <style lang="scss" scoped>
91
- @import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
92
- </style>
1
+ <template>
2
+ <static-content-wrapper
3
+ :designer="designer"
4
+ :field="field"
5
+ :design-state="designState"
6
+ :display-style="field.options.displayStyle"
7
+ :parent-widget="parentWidget"
8
+ :parent-list="parentList"
9
+ :index-of-parent-list="indexOfParentList"
10
+ >
11
+ <el-dropdown
12
+ v-if="field.options.exportItemConditionEnabled"
13
+ trigger="hover"
14
+ :disabled="field.options.disabled"
15
+ >
16
+ <el-button :type="field.options.type" class="button-sty" size="mini">
17
+ <span>{{ getI18nLabel(field.options.label) }}</span
18
+ ><span class="line"></span> <i class="el-icon-arrow-down el-icon--right"></i>
19
+ </el-button>
20
+ <el-dropdown-menu slot="dropdown">
21
+ <el-dropdown-item icon="el-icon-upload2" @click.native="toConditionExport">
22
+ {{ getI18nLabel("条件导出") }}
23
+ </el-dropdown-item>
24
+ <el-dropdown-item icon="el-icon-upload2" @click.native="toSelectedExport">
25
+ {{ getI18nLabel("选择导出") }}
26
+ </el-dropdown-item>
27
+ </el-dropdown-menu>
28
+ </el-dropdown>
29
+ <el-button
30
+ v-else
31
+ :type="field.options.type"
32
+ class="button-sty"
33
+ size="mini"
34
+ icon="el-icon-upload2"
35
+ @click="toSelectedExport"
36
+ :disabled="field.options.disabled"
37
+ >{{ getI18nLabel(field.options.label) }}
38
+ </el-button>
39
+ </static-content-wrapper>
40
+ </template>
41
+ <script>
42
+ import emitter from "../../../utils/emitter";
43
+ import i18n from "../../../utils/i18n";
44
+ import fieldMixin from "./fieldMixin";
45
+ import StaticContentWrapper from "./static-content-wrapper.vue";
46
+ import { EXPORT_TYPE } from "../../../../excelExport/exportType";
47
+
48
+ export default {
49
+ name: "select-export-item-button-widget",
50
+ components: { StaticContentWrapper },
51
+ componentName: "FieldWidget", //必须固定为FieldWidget,用于接收父级组件的broadcast事件
52
+ mixins: [emitter, fieldMixin, i18n],
53
+ props: {
54
+ field: Object,
55
+ parentWidget: Object,
56
+ parentList: Array,
57
+ indexOfParentList: Number,
58
+ designer: Object,
59
+ designState: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ },
64
+ data() {
65
+ return {};
66
+ },
67
+ beforeCreate() {
68
+ /* 这里不能访问方法和属性!! */
69
+ },
70
+
71
+ created() {
72
+ /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
73
+ 需要在父组件created中初始化!! */
74
+ this.registerToRefList();
75
+ this.initEventHandler();
76
+
77
+ this.handleOnCreated();
78
+ },
79
+
80
+ mounted() {
81
+ this.handleOnMounted();
82
+ },
83
+
84
+ beforeDestroy() {
85
+ this.unregisterFromRefList();
86
+ },
87
+
88
+ methods: {
89
+ /** 明细·条件导出:按当前搜索条件导出,无需勾选。仅在开启「支持条件导出」时可达。 */
90
+ toConditionExport() {
91
+ this.toDo(EXPORT_TYPE.ITEM_CONDITION);
92
+ },
93
+ /** 明细·选择导出:以勾选行为范围,历史默认行为。 */
94
+ toSelectedExport() {
95
+ this.toDo(EXPORT_TYPE.ITEM_SELECTED);
96
+ },
97
+ toDo(type = null) {
98
+ if (this.designState) {
99
+ return;
100
+ }
101
+ let opt = {
102
+ title: this.field.options.exportFileName || null,
103
+ targetRef: this.field.options.tableRef || null,
104
+ pageSize: this.field.options.exportPageSize || null,
105
+ showImageAtTable: this.field.options.showImageAtTable || null,
106
+ };
107
+ let tableExportParam = this.handleCustomEvent(this.field.options.tableExportParam);
108
+ let options = { ...opt, ...tableExportParam, type: type };
109
+ let tableRef = options?.targetRef;
110
+ delete options.targetRef;
111
+ let tableWidget = this.getWidgetRef(tableRef);
112
+ tableWidget.exportData(options);
113
+ },
114
+ },
115
+ };
116
+ </script>
117
+
118
+ <style lang="scss" scoped>
119
+ @import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
120
+ </style>