cloud-web-corejs 1.0.54-dev.12 → 1.0.54-dev.121

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 (167) hide show
  1. package/package.json +9 -3
  2. package/src/components/Qrcode/fileParse.vue +0 -1
  3. package/src/components/VabUpload/index.vue +2 -1
  4. package/src/components/VabUpload/mixins.js +1 -1
  5. package/src/components/VabUpload/view.vue +2 -1
  6. package/src/components/excelExport/exportFieldDialog.vue +16 -6
  7. package/src/components/excelExport/index.js +2 -1
  8. package/src/components/excelExport/index.vue +8 -6
  9. package/src/components/excelExport/mixins.js +1 -2
  10. package/src/components/excelImport/index.vue +2 -1
  11. package/src/components/excelImport/mixins.js +1 -1
  12. package/src/components/fileLibrary/fileObjAuthDialog.vue +1 -1
  13. package/src/components/fileLibrary/fileObjAuthEditDialog.vue +1 -1
  14. package/src/components/fileLibrary/fileObjNotifyEdit.vue +90 -68
  15. package/src/components/fileLibrary/filterDialog.vue +383 -0
  16. package/src/components/fileLibrary/index.vue +23 -24
  17. package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
  18. package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
  19. package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
  20. package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +15 -10
  21. package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +8 -5
  22. package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +5 -5
  23. package/src/components/fileLibrary/mixins/indexMixins.js +76 -26
  24. package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +63 -3
  25. package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +1 -1
  26. package/src/components/fileLibrary/propertiesDialog.vue +18 -0
  27. package/src/components/fileLibrary/shareDialog.vue +1 -1
  28. package/src/components/jsonImport/mixins.js +1 -1
  29. package/src/components/onlineTalk/index.vue +327 -5
  30. package/src/components/onlineTalk/mixins.js +1 -1
  31. package/src/components/table/index.js +2 -1
  32. package/src/components/table/tableForm.vue +36 -2
  33. package/src/components/table/tableFormMixin.js +222 -1
  34. package/src/components/tempStorage/tempStorageDialog.vue +2 -2
  35. package/src/components/wf/wf.js +1763 -1
  36. package/src/components/wf/wfStartDialog.vue +1 -1
  37. package/src/components/wf/wfUtil.js +279 -1
  38. package/src/components/xform/form-designer/designer.js +1514 -1
  39. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +1 -0
  40. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +1 -0
  41. package/src/components/xform/form-designer/form-widget/dialog/formFieldDialog.vue +2 -2
  42. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +35 -5
  43. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +3 -1
  44. package/src/components/xform/form-designer/form-widget/dialog/preformDialog.vue +2 -2
  45. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +11 -5
  46. package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +2 -2
  47. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +6 -2
  48. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +10 -5
  49. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +1 -0
  50. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  51. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  52. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  53. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1026 -1
  54. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +49 -8
  55. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +61 -88
  56. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +13 -0
  57. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +67 -3
  58. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +9 -4
  59. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +8 -2
  60. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +6 -1
  61. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +80 -0
  62. package/src/components/xform/form-designer/indexMixin.js +773 -1
  63. package/src/components/xform/form-designer/setting-panel/form-setting.vue +59 -36
  64. package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
  65. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
  66. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +9 -0
  67. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
  68. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +595 -299
  69. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
  70. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +32 -0
  71. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +2 -2
  72. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +20 -1
  73. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +27 -0
  74. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +185 -69
  75. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +188 -86
  76. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +84 -39
  77. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +3 -0
  78. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +26 -7
  79. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +39 -1
  80. package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
  81. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +177 -0
  82. package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +2 -1
  83. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
  84. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +1 -1
  85. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +242 -27
  86. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +4 -0
  87. package/src/components/xform/form-designer/toolbar-panel/index.vue +4 -3
  88. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +145 -147
  89. package/src/components/xform/form-render/container-item/data-table-item.vue +6 -5
  90. package/src/components/xform/form-render/container-item/data-table-mixin.js +2122 -18
  91. package/src/components/xform/form-render/indexMixin.js +1792 -1
  92. package/src/components/xform/mixins/defaultHandle.js +120 -1
  93. package/src/components/xform/mixins/scriptHttp.js +82 -1
  94. package/src/components/xform/utils/emitter.js +4 -4
  95. package/src/components/xform/utils/util.js +1631 -1
  96. package/src/layout/components/Sidebar/default.vue +50 -6
  97. package/src/layout/components/TagsView/index.vue +0 -1
  98. package/src/layout/components/extractedCode/createDialog.vue +92 -0
  99. package/src/layout/components/extractedCode/queryDialog.vue +96 -0
  100. package/src/layout/components/extractedCode/viewDialog.vue +192 -0
  101. package/src/mixins/selectDialog/index.js +1 -1
  102. package/src/router/modules/customer.js +15 -0
  103. package/src/store/config/index.js +664 -1
  104. package/src/store/modules/permission.js +1 -1
  105. package/src/store/modules/user.js +1 -1
  106. package/src/utils/index.js +4 -2
  107. package/src/utils/pddLog.js +103 -0
  108. package/src/utils/request.js +28 -28
  109. package/src/utils/vab.js +1 -1
  110. package/src/views/bd/setting/form_import_log/edit.vue +120 -0
  111. package/src/views/bd/setting/form_import_log/list.vue +195 -0
  112. package/src/views/bd/setting/form_script/edit1.vue +1 -1
  113. package/src/views/bd/setting/form_script/mixins/edit.js +167 -1
  114. package/src/views/bd/setting/form_script/mixins/edit1.js +165 -1
  115. package/src/views/bd/setting/form_script/mixins/list.js +176 -1
  116. package/src/views/bd/setting/form_script/mixins/list1.js +345 -14
  117. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +105 -0
  118. package/src/views/bd/setting/form_template/edit.vue +9 -1
  119. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
  120. package/src/views/bd/setting/form_template/list.vue +4 -2
  121. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +4 -0
  122. package/src/views/bd/setting/form_template/mixins/edit.js +170 -1
  123. package/src/views/bd/setting/form_template/mixins/list.js +522 -1
  124. package/src/views/bd/setting/form_template/mixins/wf_list.js +12 -0
  125. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +254 -0
  126. package/src/views/bd/setting/form_template/wf_list.vue +127 -0
  127. package/src/views/bd/setting/menu_kind/mixins/list.js +176 -1
  128. package/src/views/bd/setting/table_model/edit.vue +71 -13
  129. package/src/views/bd/setting/table_model/list.vue +4 -2
  130. package/src/views/bd/setting/table_model/mixins/edit.js +901 -13
  131. package/src/views/bd/setting/table_model/mixins/list.js +345 -14
  132. package/src/views/user/area/dialog.vue +21 -9
  133. package/src/views/user/bill_setting/edit.vue +1 -1
  134. package/src/views/user/bill_setting/list.vue +1 -1
  135. package/src/views/user/common_attribute/itemEdit.vue +2 -2
  136. package/src/views/user/common_attribute/list.vue +1 -1
  137. package/src/views/user/common_script/edit.vue +1 -1
  138. package/src/views/user/common_script/list.vue +1 -1
  139. package/src/views/user/company_info/dialog.vue +19 -9
  140. package/src/views/user/company_info/edit.vue +1 -1
  141. package/src/views/user/extend_datasource/dialog.vue +1 -0
  142. package/src/views/user/extend_datasource/edit.vue +3 -0
  143. package/src/views/user/extend_datasource/list.vue +2 -1
  144. package/src/views/user/file_type/edit.vue +30 -1
  145. package/src/views/user/file_type/list.vue +28 -0
  146. package/src/views/user/form/vform/designer.vue +5 -1
  147. package/src/views/user/groups/edit.vue +2 -0
  148. package/src/views/user/groups/list.vue +1 -0
  149. package/src/views/user/home/default.vue +15 -11
  150. package/src/views/user/home/dev.vue +29 -0
  151. package/src/views/user/home/index.vue +16 -6
  152. package/src/views/user/login/default.vue +4 -2
  153. package/src/views/user/login/index2.vue +131 -0
  154. package/src/views/user/notify_message/dialog.vue +1 -1
  155. package/src/views/user/outLink/form_view.vue +39 -12
  156. package/src/views/user/outLink/index.vue +17 -0
  157. package/src/views/user/outLink/view.vue +39 -13
  158. package/src/views/user/push_setting/list.vue +2 -2
  159. package/src/views/user/user/edit.vue +9 -9
  160. package/src/views/user/user/form_edit.vue +117 -49
  161. package/src/views/user/user/form_info.vue +210 -0
  162. package/src/views/user/user/form_list.vue +1 -0
  163. package/src/views/user/user/list.vue +3 -3
  164. package/src/views/user/wf/wf_manage/list.vue +1 -1
  165. package/src/views/user/wf/wf_manage/wfContentDialog.vue +1 -1
  166. package/src/views/user/wf/wf_obj_config/list.vue +19 -3
  167. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +292 -0
@@ -31,24 +31,45 @@
31
31
  <span>{{ scope.$index + 1 }}</span>
32
32
  </template>
33
33
  </el-table-column>
34
- <el-table-column label="" width="35" fixed="left"><i class="el-icon-s-operation drag-option"></i>
34
+ <el-table-column label="" width="35" fixed="left"
35
+ ><i class="el-icon-s-operation drag-option"></i>
35
36
  </el-table-column>
36
- <el-table-column :label="i18nt('designer.setting.columnLabel')" width="150" prop="label" fixed="left">
37
+ <el-table-column
38
+ :label="i18nt('designer.setting.columnLabel')"
39
+ width="150"
40
+ prop="label"
41
+ fixed="left"
42
+ >
37
43
  <template slot-scope="scope">
38
44
  <el-input v-model="scope.row.label"></el-input>
39
45
  </template>
40
46
  </el-table-column>
41
- <el-table-column :label="i18nt('designer.setting.columnName')" width="150" prop="prop">
47
+ <el-table-column
48
+ :label="i18nt('designer.setting.columnName')"
49
+ width="150"
50
+ prop="prop"
51
+ >
42
52
  <template slot-scope="scope">
43
- <el-input v-model="scope.row.prop" :disabled="'editAttachment' == scope.row.formatS"></el-input>
53
+ <el-input
54
+ v-model="scope.row.prop"
55
+ :disabled="'editAttachment' == scope.row.formatS"
56
+ ></el-input>
44
57
  </template>
45
58
  </el-table-column>
46
- <el-table-column :label="i18nt('designer.setting.columnWidth')" width="100" prop="width">
59
+ <el-table-column
60
+ :label="i18nt('designer.setting.columnWidth')"
61
+ width="100"
62
+ prop="width"
63
+ >
47
64
  <template slot-scope="scope">
48
65
  <el-input v-model="scope.row.width"></el-input>
49
66
  </template>
50
67
  </el-table-column>
51
- <el-table-column :label="i18nt('designer.setting.visibleColumn')" width="70" prop="show">
68
+ <el-table-column
69
+ :label="i18nt('designer.setting.visibleColumn')"
70
+ width="70"
71
+ prop="show"
72
+ >
52
73
  <template slot-scope="scope">
53
74
  <el-switch v-model="scope.row.show"></el-switch>
54
75
  </template>
@@ -58,12 +79,25 @@
58
79
  <el-switch v-model="scope.row.required"></el-switch>
59
80
  </template>
60
81
  </el-table-column>
61
- <el-table-column :label="i18nt('designer.setting.sortableColumn')" width="70" prop="sortable">
82
+ <el-table-column
83
+ :label="i18nt('designer.setting.sortableColumn')"
84
+ width="70"
85
+ prop="sortable"
86
+ >
62
87
  <template slot-scope="scope">
63
88
  <el-switch v-model="scope.row.sortable"></el-switch>
64
89
  </template>
65
90
  </el-table-column>
66
- <el-table-column :label="i18nt('designer.setting.fixedColumn')" width="100" prop="fixed">
91
+ <el-table-column :label="i18nt('明细行')" width="70" prop="sortable">
92
+ <template slot-scope="scope">
93
+ <el-switch v-model="scope.row.isItemLine"></el-switch>
94
+ </template>
95
+ </el-table-column>
96
+ <el-table-column
97
+ :label="i18nt('designer.setting.fixedColumn')"
98
+ width="100"
99
+ prop="fixed"
100
+ >
67
101
  <template slot-scope="scope">
68
102
  <el-select v-model="scope.row.fixed" clearable>
69
103
  <el-option value="left">left</el-option>
@@ -78,57 +112,163 @@
78
112
  </el-select>
79
113
  </template>
80
114
  </el-table-column>-->
81
- <el-table-column :label="i18nt('designer.setting.formatOfColumn')" width="200" prop="formatS">
115
+ <el-table-column
116
+ :label="i18nt('designer.setting.formatOfColumn')"
117
+ width="200"
118
+ prop="formatS"
119
+ >
82
120
  <template slot-scope="scope">
83
- <el-select v-model="scope.row.formatS" @change="changeFormatS(scope.row)" clearable>
84
- <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
121
+ <el-select
122
+ v-model="scope.row.formatS"
123
+ @change="changeFormatS(scope.row)"
124
+ clearable
125
+ >
126
+ <el-option-group
127
+ :label="i18nt('designer.setting.customRenderGroup')"
128
+ >
85
129
  <el-option value="render" label="render"></el-option>
86
130
  </el-option-group>
87
- <el-option-group v-for="t in op" :key="t.label" :label="t.label">
88
- <el-option v-for="e in t.options" :key="e.value" :value="e.value" :label="e.label"></el-option>
131
+ <el-option-group
132
+ v-for="t in op"
133
+ :key="t.label"
134
+ :label="t.label"
135
+ >
136
+ <el-option
137
+ v-for="e in t.options"
138
+ :key="e.value"
139
+ :value="e.value"
140
+ :label="e.label"
141
+ ></el-option>
89
142
  </el-option-group>
90
143
  </el-select>
91
144
  </template>
92
145
  </el-table-column>
93
146
  <el-table-column :label="i18nt('自定义表格列配置')" width="150">
94
147
  <template slot-scope="scope">
95
- <a href="javascript:void(0);" class="a-link link-oneLind"
96
- @click="openTableColumnConfigDialog(scope.row,scope.$index)">
148
+ <a
149
+ href="javascript:void(0);"
150
+ class="a-link link-oneLind"
151
+ @click="openTableColumnConfigDialog(scope.row, scope.$index)"
152
+ >
97
153
  <span>{{ scope.row.tableColumnConfig }}</span>
98
154
  <i class="el-icon-edit"></i>
99
155
  </a>
100
156
  </template>
101
157
  </el-table-column>
102
- <el-table-column :label="i18nt('编辑下拉列')" width="70" prop="sortable">
158
+ <el-table-column :label="i18nt('下拉列')" width="70" prop="sortable">
103
159
  <template slot-scope="scope">
104
160
  <el-switch v-model="scope.row.treeNode"></el-switch>
105
161
  </template>
106
162
  </el-table-column>
107
- <el-table-column :label="i18nt('编辑插槽类型')" width="200" prop="editFormatS">
163
+ <el-table-column
164
+ :label="i18nt('编辑插槽类型')"
165
+ width="200"
166
+ prop="editFormatS"
167
+ >
108
168
  <template slot-scope="scope">
109
- <el-select v-model="scope.row.editFormatS" @change="changeFormatS(scope.row)" clearable>
110
- <el-option v-for="e in editOp" :key="e.value" :value="e.value" :label="e.label"></el-option>
169
+ <el-select
170
+ v-model="scope.row.editFormatS"
171
+ @change="changeFormatS(scope.row)"
172
+ clearable
173
+ >
174
+ <el-option
175
+ v-for="e in editOp"
176
+ :key="e.value"
177
+ :value="e.value"
178
+ :label="e.label"
179
+ ></el-option>
111
180
  </el-select>
112
181
  </template>
113
182
  </el-table-column>
114
- <el-table-column label="编辑插槽配置" width="70" align="center">
183
+ <el-table-column label="编辑插槽配置" width="150" align="center">
184
+ <template slot-scope="scope">
185
+ <el-button
186
+ size="mini"
187
+ plain=""
188
+ round=""
189
+ icon="el-icon-edit"
190
+ @click="openEditFormatConfigDialog(scope.row, scope.$index)"
191
+ :disabled="!scope.row.editFormatS"
192
+ ></el-button>
193
+ </template>
194
+ </el-table-column>
195
+ <el-table-column
196
+ :label="i18nt('导出类型')"
197
+ width="200"
198
+ prop="formatS"
199
+ >
115
200
  <template slot-scope="scope">
116
- <el-button size="mini" plain="" round="" icon="el-icon-edit"
117
- @click="openEditFormatConfigDialog(scope.row,scope.$index)"
118
- :disabled="!scope.row.editFormatS"></el-button>
201
+ <el-select v-model="scope.row.exportType" clearable>
202
+ <el-option value="Image2" label="图片"></el-option>
203
+ <el-option value="Number" label="数值"></el-option>
204
+ </el-select>
119
205
  </template>
120
206
  </el-table-column>
121
- <el-table-column label="格式化配置" width="90" fixed="right" align="center">
207
+
208
+ <el-table-column
209
+ :label="i18nt('表尾统计行类型')"
210
+ width="200"
211
+ prop="formatS"
212
+ >
122
213
  <template slot-scope="scope">
123
- <el-button size="mini" plain="" round="" icon="el-icon-edit"
124
- @click="openFormatConfigDialog(scope.row,scope.$index)"
125
- :disabled="!columnFormatMap[scope.row.formatS]"></el-button>
214
+ <el-select v-model="scope.row.footerDataType" clearable>
215
+ <el-option value="1" label="合计"></el-option>
216
+ <el-option value="2" label="平均"></el-option>
217
+ <el-option value="3" label="自定义"></el-option>
218
+ </el-select>
126
219
  </template>
127
220
  </el-table-column>
128
- <el-table-column :label="i18nt('designer.setting.renderFunction')" width="70" fixed="right" align="center">
221
+ <el-table-column label="表尾统计行配置" width="150" align="center">
129
222
  <template slot-scope="scope">
130
- <el-button :disabled="'render' !== scope.row.formatS" size="mini" plain="" round="" icon="el-icon-edit"
131
- @click="showRenderDialog(scope.row)"></el-button>
223
+ <el-button
224
+ size="mini"
225
+ plain=""
226
+ round=""
227
+ icon="el-icon-edit"
228
+ @click="
229
+ editFormEventHandler(
230
+ scope.row,
231
+ scope.$index,
232
+ 'footerMethodConfg'
233
+ )
234
+ "
235
+ :disabled="scope.row.footerDataType !== '3'"
236
+ ></el-button>
237
+ </template>
238
+ </el-table-column>
239
+
240
+ <el-table-column
241
+ label="格式化配置"
242
+ width="90"
243
+ fixed="right"
244
+ align="center"
245
+ >
246
+ <template slot-scope="scope">
247
+ <el-button
248
+ size="mini"
249
+ plain=""
250
+ round=""
251
+ icon="el-icon-edit"
252
+ @click="openFormatConfigDialog(scope.row, scope.$index)"
253
+ :disabled="!columnFormatMap[scope.row.formatS]"
254
+ ></el-button>
255
+ </template>
256
+ </el-table-column>
257
+ <el-table-column
258
+ :label="i18nt('designer.setting.renderFunction')"
259
+ width="70"
260
+ fixed="right"
261
+ align="center"
262
+ >
263
+ <template slot-scope="scope">
264
+ <el-button
265
+ :disabled="'render' !== scope.row.formatS"
266
+ size="mini"
267
+ plain=""
268
+ round=""
269
+ icon="el-icon-edit"
270
+ @click="showRenderDialog(scope.row)"
271
+ ></el-button>
132
272
  </template>
133
273
  </el-table-column>
134
274
  <el-table-column label="操作" width="150" fixed="right">
@@ -141,7 +281,9 @@
141
281
  placement="top"
142
282
  >
143
283
  <el-button
144
- size="mini" type="" circle=""
284
+ size="mini"
285
+ type=""
286
+ circle=""
145
287
  icon="el-icon-plus"
146
288
  @click="onAddRoot"
147
289
  />
@@ -156,7 +298,9 @@
156
298
  placement="top"
157
299
  >
158
300
  <el-button
159
- size="mini" type="" circle=""
301
+ size="mini"
302
+ type=""
303
+ circle=""
160
304
  icon="el-icon-plus"
161
305
  @click="onAddSibling(row, $index)"
162
306
  />
@@ -170,7 +314,9 @@
170
314
  placement="top"
171
315
  >
172
316
  <el-button
173
- size="mini" type="" circle=""
317
+ size="mini"
318
+ type=""
319
+ circle=""
174
320
  icon="el-icon-circle-plus-outline"
175
321
  @click="onAddChild(row, $index)"
176
322
  />
@@ -183,7 +329,9 @@
183
329
  placement="top"
184
330
  >
185
331
  <el-button
186
- size="mini" type="" circle=""
332
+ size="mini"
333
+ type=""
334
+ circle=""
187
335
  icon="el-icon-delete"
188
336
  @click="onDelete(row, $index)"
189
337
  />
@@ -194,10 +342,15 @@
194
342
  </div>
195
343
  <div class="dialog-footer" slot="footer">
196
344
  <el-button @click="closeHandle" class="button-sty" icon="el-icon-close">
197
- {{ i18nt('designer.hint.cancel') }}
345
+ {{ i18nt("designer.hint.cancel") }}
198
346
  </el-button>
199
- <el-button type="primary" @click="colSubmit" class="button-sty" icon="el-icon-check">
200
- {{ i18nt('designer.hint.confirm') }}
347
+ <el-button
348
+ type="primary"
349
+ @click="colSubmit"
350
+ class="button-sty"
351
+ icon="el-icon-check"
352
+ >
353
+ {{ i18nt("designer.hint.confirm") }}
201
354
  </el-button>
202
355
  </div>
203
356
  </el-dialog>
@@ -214,15 +367,33 @@
214
367
  v-dialog-drag
215
368
  top="7vh"
216
369
  >
217
- <el-alert type="info" :closable="!1" title="function customRender(params,h) {"/>
218
- <code-editor ref="dsResultEditor" mode="javascript" :readonly="!1" v-model="renderJson"></code-editor>
219
- <el-alert type="info" :closable="!1" title="}"/>
370
+ <el-alert
371
+ type="info"
372
+ :closable="!1"
373
+ title="function customRender(params,h) {"
374
+ />
375
+ <code-editor
376
+ ref="dsResultEditor"
377
+ mode="javascript"
378
+ :readonly="!1"
379
+ v-model="renderJson"
380
+ ></code-editor>
381
+ <el-alert type="info" :closable="!1" title="}" />
220
382
  <div class="dialog-footer" slot="footer">
221
- <el-button @click="showRenderDialogFlag = !1" class="button-sty" icon="el-icon-close">
222
- {{ i18nt('designer.hint.cancel') }}
383
+ <el-button
384
+ @click="showRenderDialogFlag = !1"
385
+ class="button-sty"
386
+ icon="el-icon-close"
387
+ >
388
+ {{ i18nt("designer.hint.cancel") }}
223
389
  </el-button>
224
- <el-button type="primary" @click="saveColumnRender" class="button-sty" icon="el-icon-check">
225
- {{ i18nt('designer.hint.confirm') }}
390
+ <el-button
391
+ type="primary"
392
+ @click="saveColumnRender"
393
+ class="button-sty"
394
+ icon="el-icon-check"
395
+ >
396
+ {{ i18nt("designer.hint.confirm") }}
226
397
  </el-button>
227
398
  </div>
228
399
  </el-dialog>
@@ -241,37 +412,99 @@
241
412
  top="5vh"
242
413
  >
243
414
  <div class="cont">
244
- <el-alert type="info" :closable="false" :title="tableColumnConfigHeader"></el-alert>
245
- <code-editor :mode="'javascript'" :readonly="false" v-model="tableColumnConfigCode"
246
- ref="ecEditor"></code-editor>
415
+ <el-alert
416
+ type="info"
417
+ :closable="false"
418
+ :title="tableColumnConfigHeader"
419
+ ></el-alert>
420
+ <code-editor
421
+ :mode="'javascript'"
422
+ :readonly="false"
423
+ v-model="tableColumnConfigCode"
424
+ ref="ecEditor"
425
+ ></code-editor>
426
+ <el-alert type="info" :closable="false" title="}"></el-alert>
427
+ </div>
428
+ <div slot="footer" class="dialog-footer">
429
+ <el-button
430
+ @click="showTableColumnConfigDialog = false"
431
+ class="button-sty"
432
+ icon="el-icon-close"
433
+ >
434
+ {{ i18nt("designer.hint.cancel") }}
435
+ </el-button>
436
+ <el-button
437
+ type="primary"
438
+ @click="saveTableColumnConfigDialog"
439
+ class="button-sty"
440
+ icon="el-icon-check"
441
+ >
442
+ {{ i18nt("designer.hint.confirm") }}
443
+ </el-button>
444
+ </div>
445
+ </el-dialog>
446
+ <el-dialog
447
+ :title="i18nt('designer.setting.editFormEventHandler')"
448
+ :visible.sync="showFormEventDialogFlag"
449
+ v-if="showFormEventDialogFlag"
450
+ :show-close="true"
451
+ custom-class="dialog-style list-dialog"
452
+ v-dialog-drag
453
+ :close-on-click-modal="false"
454
+ :close-on-press-escape="false"
455
+ :destroy-on-close="true"
456
+ :append-to-body="true"
457
+ :modal-append-to-body="true"
458
+ top="5vh"
459
+ >
460
+ <div class="cont">
461
+ <el-alert
462
+ type="info"
463
+ :closable="false"
464
+ :title="'form.' + eventParamsMap[curEventName]"
465
+ ></el-alert>
466
+ <code-editor
467
+ :mode="'javascript'"
468
+ :readonly="false"
469
+ v-model="formEventHandlerCode"
470
+ ref="ecEditor"
471
+ ></code-editor>
247
472
  <el-alert type="info" :closable="false" title="}"></el-alert>
248
473
  </div>
249
474
  <div slot="footer" class="dialog-footer">
250
- <el-button @click="showTableColumnConfigDialog = false" class="button-sty" icon="el-icon-close">
251
- {{ i18nt('designer.hint.cancel') }}
475
+ <el-button
476
+ @click="showFormEventDialogFlag = false"
477
+ class="button-sty"
478
+ icon="el-icon-close"
479
+ >
480
+ {{ i18nt("designer.hint.cancel") }}
252
481
  </el-button>
253
- <el-button type="primary" @click="saveTableColumnConfigDialog" class="button-sty" icon="el-icon-check">
254
- {{ i18nt('designer.hint.confirm') }}
482
+ <el-button
483
+ type="primary"
484
+ @click="saveFormEventHandler"
485
+ class="button-sty"
486
+ icon="el-icon-check"
487
+ >
488
+ {{ i18nt("designer.hint.confirm") }}
255
489
  </el-button>
256
490
  </div>
257
491
  </el-dialog>
258
492
  </div>
259
-
260
493
  </template>
261
494
  <script>
262
495
  import i18n from "../../../../../../components/xform/utils/i18n";
263
496
  import Sortable from "sortablejs";
264
- import {generateId} from "../../../../../../components/xform/utils/util";
497
+ import { generateId } from "../../../../../../components/xform/utils/util";
265
498
 
266
499
  export default {
267
500
  mixins: [i18n],
268
501
  props: {
269
502
  designer: Object,
270
503
  selectedWidget: Object,
271
- optionModel: Object
504
+ optionModel: Object,
272
505
  },
273
506
  components: {},
274
- inject: ['openWidgetPropertyDialog'],
507
+ inject: ["openWidgetPropertyDialog"],
275
508
  data() {
276
509
  return {
277
510
  tableColumnConfigTitle: null,
@@ -282,228 +515,264 @@ export default {
282
515
  dialogVisible: true,
283
516
  alignOptions: [
284
517
  {
285
- value: 'left',
286
- label: 'left'
518
+ value: "left",
519
+ label: "left",
287
520
  },
288
521
  {
289
- value: 'center',
290
- label: 'center'
522
+ value: "center",
523
+ label: "center",
291
524
  },
292
525
  {
293
- value: 'right',
294
- label: 'right'
295
- }
526
+ value: "right",
527
+ label: "right",
528
+ },
296
529
  ],
297
530
  op: [
298
531
  {
299
- label: 'edit Format',
532
+ label: "edit Format",
300
533
  options: [
301
534
  {
302
- value: 'editInput',
303
- label: '文本输入框'
535
+ value: "editInput",
536
+ label: "文本输入框",
304
537
  },
305
538
  {
306
- value: 'editNumber',
307
- label: '数字输入框'
539
+ value: "editNumber",
540
+ label: "数字输入框",
308
541
  },
309
542
  {
310
- value: 'editDate',
311
- label: '日期输入框'
543
+ value: "editDate",
544
+ label: "日期输入框",
312
545
  },
313
546
  {
314
- value: 'editSelect',
315
- label: '下拉框'
547
+ value: "editSelect",
548
+ label: "下拉框",
316
549
  },
317
550
  {
318
- value: 'editAttachment',
319
- label: '附件'
551
+ value: "editAttachment",
552
+ label: "附件",
320
553
  },
321
554
  {
322
- value: 'editSearch',
323
- label: '搜索框'
555
+ value: "editSearch",
556
+ label: "搜索框",
324
557
  },
325
558
  {
326
- value: 'editStatus',
327
- label: '状态'
559
+ value: "editStatus",
560
+ label: "状态",
328
561
  },
329
562
  {
330
- value: 'editDelete',
331
- label: '删除按钮'
563
+ value: "editDelete",
564
+ label: "删除按钮",
332
565
  },
333
566
  {
334
- value: 'editButton',
335
- label: '查看按钮'
567
+ value: "editButton",
568
+ label: "查看按钮",
336
569
  },
337
570
  {
338
- value: 'aText',
339
- label: '超链接文本'
571
+ value: "aText",
572
+ label: "超链接文本",
340
573
  },
341
574
  {
342
- value: 'aLink',
343
- label: '超链接按钮'
575
+ value: "aLink",
576
+ label: "超链接按钮",
344
577
  },
345
578
  {
346
- value: 'button',
347
- label: '按钮'
579
+ value: "button",
580
+ label: "按钮",
348
581
  },
349
582
  {
350
- value: 'editTreeButtonGroup',
351
- label: '编辑行按钮组'
352
- }
353
- ]
583
+ value: "editTreeButtonGroup",
584
+ label: "编辑行按钮组",
585
+ },
586
+ ],
354
587
  },
355
588
  {
356
- label: '树控件',
589
+ label: "树控件",
357
590
  options: [
358
591
  {
359
- value: 'addSiblingEditRow',
360
- label: '新增兄弟节点'
592
+ value: "addSiblingEditRow",
593
+ label: "新增兄弟节点",
361
594
  },
362
595
  {
363
- value: 'addChildTreeRow',
364
- label: '新增子节点'
596
+ value: "addChildTreeRow",
597
+ label: "新增子节点",
365
598
  },
366
599
  {
367
- value: 'moveUpRow',
368
- label: '上移'
600
+ value: "moveUpRow",
601
+ label: "上移",
369
602
  },
370
603
  {
371
- value: 'moveDownRow',
372
- label: '下移'
604
+ value: "moveDownRow",
605
+ label: "下移",
373
606
  },
374
607
  {
375
- value: 'removeTreeRow',
376
- label: '删除树节点'
377
- }
378
- ]
608
+ value: "removeTreeRow",
609
+ label: "删除树节点",
610
+ },
611
+ ],
379
612
  },
380
613
  {
381
- label: 'Date Format',
614
+ label: "Date Format",
382
615
  options: [
383
616
  {
384
- value: 'd1',
385
- label: 'yyyy-MM-dd'
617
+ value: "d1",
618
+ label: "yyyy-MM-dd",
386
619
  },
387
620
  {
388
- value: 'd2',
389
- label: 'yyyy/MM/dd'
621
+ value: "d2",
622
+ label: "yyyy/MM/dd",
390
623
  },
391
624
  {
392
- value: 'd3',
393
- label: 'yyyy年MM月dd日'
625
+ value: "d3",
626
+ label: "yyyy年MM月dd日",
394
627
  },
395
628
  {
396
- value: 'd4',
397
- label: 'yyyy-MM-dd HH:mm:ss'
629
+ value: "d4",
630
+ label: "yyyy-MM-dd HH:mm:ss",
398
631
  },
399
632
  {
400
- value: 'd5',
401
- label: 'yyyy-MM-dd hh:mm:ss'
402
- }
403
- ]
633
+ value: "d5",
634
+ label: "yyyy-MM-dd hh:mm:ss",
635
+ },
636
+ ],
404
637
  },
405
638
  {
406
- label: 'Number Format',
639
+ label: "Number Format",
407
640
  options: [
408
641
  {
409
- value: 'n1',
410
- label: '###,###,###,##0.######'
642
+ value: "n1",
643
+ label: "###,###,###,##0.######",
411
644
  },
412
645
  {
413
- value: 'n2',
414
- label: '###,###,###,##0.00####'
646
+ value: "n2",
647
+ label: "###,###,###,##0.00####",
415
648
  },
416
649
  {
417
- value: 'n3',
418
- label: '###,###,###,##0.000000'
650
+ value: "n3",
651
+ label: "###,###,###,##0.000000",
419
652
  },
420
653
  {
421
- value: 'n4',
422
- label: '###,###,###,##0.000'
654
+ value: "n4",
655
+ label: "###,###,###,##0.000",
423
656
  },
424
657
  {
425
- value: 'n5',
426
- label: '###,###,###,##0.00'
658
+ value: "n5",
659
+ label: "###,###,###,##0.00",
427
660
  },
428
661
  {
429
- value: 'n6',
430
- label: '###,###,###,##0'
662
+ value: "n6",
663
+ label: "###,###,###,##0",
431
664
  },
432
665
  {
433
- value: 'n7',
434
- label: '###,##0.00##%'
435
- }
436
- ]
437
- }
666
+ value: "n7",
667
+ label: "###,##0.00##%",
668
+ },
669
+ ],
670
+ },
438
671
  ],
439
672
  editOp: [
440
673
  {
441
- value: 'editInput',
442
- label: '文本输入框'
674
+ value: "editInput",
675
+ label: "文本输入框",
443
676
  },
444
677
  {
445
- value: 'editNumber',
446
- label: '数字输入框'
678
+ value: "editNumber",
679
+ label: "数字输入框",
447
680
  },
448
681
  {
449
- value: 'editDate',
450
- label: '日期输入框'
682
+ value: "editDate",
683
+ label: "日期输入框",
451
684
  },
452
685
  {
453
- value: 'editSelect',
454
- label: '下拉框'
686
+ value: "editSelect",
687
+ label: "下拉框",
455
688
  },
456
689
  {
457
- value: 'editAttachment',
458
- label: '附件'
690
+ value: "editAttachment",
691
+ label: "附件",
459
692
  },
460
693
  {
461
- value: 'editSearch',
462
- label: '搜索框'
463
- }
694
+ value: "editSearch",
695
+ label: "搜索框",
696
+ },
464
697
  ],
465
698
  showRenderDialogFlag: !1,
466
- renderJson: '',
699
+ renderJson: "",
467
700
  currentTableColumn: null,
468
701
 
469
702
  hideAfter: 1500,
470
703
  openDelay: 500,
471
- tableData: [],//树形结构数据转的数组
704
+ tableData: [], //树形结构数据转的数组
472
705
  tableDataArray: [],
473
706
  dragSort: null,
474
707
  columnFormatMap: {
475
- editInput: 'input',
476
- editNumber: 'number',
477
- editDate: 'date',
478
- editSelect: 'select',
479
- editSearch: 'vabsearch',
480
- editAttachment: 'baseAttachment',
481
- editStatus: 'status',
482
- aText: 'a-text',
483
- aLink: 'a-link',
484
- editDelete: 'a-link',
485
- editButton: 'a-link',
486
- button: 'button',
487
- addSiblingEditRow: 'a-link',
488
- addChildTreeRow: 'a-link',
489
- moveUpRow: 'a-link',
490
- moveDownRow: 'a-link',
491
- removeTreeRow: 'a-link'
708
+ editInput: "input",
709
+ editNumber: "number",
710
+ editDate: "date",
711
+ editSelect: "select",
712
+ editSearch: "vabsearch",
713
+ editAttachment: "baseAttachment",
714
+ editStatus: "status",
715
+ aText: "a-text",
716
+ aLink: "a-link",
717
+ editDelete: "a-link",
718
+ editButton: "a-link",
719
+ button: "button",
720
+ addSiblingEditRow: "a-link",
721
+ addChildTreeRow: "a-link",
722
+ moveUpRow: "a-link",
723
+ moveDownRow: "a-link",
724
+ removeTreeRow: "a-link",
725
+ },
726
+
727
+ showFormEventDialogFlag: false,
728
+ formEventHandlerCode: "",
729
+ curEventName: "",
730
+
731
+ eventParamsMap: {
732
+ footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
492
733
  },
493
- }
734
+ };
494
735
  },
495
736
  beforeDestroy() {
496
- if (this.dragSort) this.dragSort.destroy()
497
- },
498
- created() {
499
-
737
+ if (this.dragSort) this.dragSort.destroy();
500
738
  },
739
+ created() {},
501
740
  mounted() {
502
741
  this.init();
503
742
  },
504
743
  methods: {
744
+ editFormEventHandler(row, index, eventName) {
745
+ this.curEventName = eventName;
746
+ this.curEventIndex = index;
747
+ this.formEventHandlerCode = row[eventName];
748
+ this.showFormEventDialogFlag = true;
749
+ },
750
+
751
+ saveFormEventHandler() {
752
+ const codeHints = this.$refs.ecEditor.getEditorAnnotations();
753
+ let syntaxErrorFlag = false;
754
+ if (!!codeHints && codeHints.length > 0) {
755
+ codeHints.forEach((chItem) => {
756
+ if (chItem.type === "error") {
757
+ syntaxErrorFlag = true;
758
+ }
759
+ });
760
+
761
+ if (syntaxErrorFlag) {
762
+ this.$message.error(
763
+ this.i18nt("designer.setting.syntaxCheckWarning")
764
+ );
765
+ return;
766
+ }
767
+ }
768
+ this.tableData[this.curEventIndex][this.curEventName] =
769
+ this.formEventHandlerCode;
770
+ this.showFormEventDialogFlag = false;
771
+ },
505
772
  init() {
506
- this.tableData = this.$baseLodash.cloneDeep(this.optionModel.tableColumns);
773
+ this.tableData = this.$baseLodash.cloneDeep(
774
+ this.optionModel.tableColumns
775
+ );
507
776
  this.$nextTick(() => {
508
777
  this.rowDrop();
509
778
  });
@@ -514,32 +783,38 @@ export default {
514
783
  this.closeHandle();
515
784
  },
516
785
  showRenderDialog: function (e) {
517
- (this.currentTableColumn = e), (this.renderJson = e.render || ''), (this.showRenderDialogFlag = !0);
786
+ (this.currentTableColumn = e),
787
+ (this.renderJson = e.render || ""),
788
+ (this.showRenderDialogFlag = !0);
518
789
  },
519
790
  saveColumnRender: function () {
520
- this.$set(this.currentTableColumn, 'render', this.renderJson), (this.showRenderDialogFlag = !1);
791
+ this.$set(this.currentTableColumn, "render", this.renderJson),
792
+ (this.showRenderDialogFlag = !1);
521
793
  },
522
794
  closeHandle() {
523
- this.$emit('update:visiable', false);
524
- this.$emit('close');
795
+ this.$emit("update:visiable", false);
796
+ this.$emit("close");
525
797
  },
526
798
  // 添加同级节点
527
799
  onAddSibling(row, index) {
528
- console.log('onAddSibling', row, index)
529
- const parentId = row.parentId || null
800
+ console.log("onAddSibling", row, index);
801
+ const parentId = row.parentId || null;
530
802
  // 先判断是不是根节点
531
803
  if (!parentId) {
532
804
  // 当前节点直接添加
533
805
  // this.tableData.push(this.generateRow(parentId))
534
- let addIndex = this.tableData.filter(item => !item.parentId).findIndex(item => item.columnId == row.columnId) + 1;
535
- this.tableData.splice(addIndex, 0, this.generateRow(parentId))
806
+ let addIndex =
807
+ this.tableData
808
+ .filter((item) => !item.parentId)
809
+ .findIndex((item) => item.columnId == row.columnId) + 1;
810
+ this.tableData.splice(addIndex, 0, this.generateRow(parentId));
536
811
  } else {
537
- this.handleAddOneRow(row, index, 'SIBLING')
812
+ this.handleAddOneRow(row, index, "SIBLING");
538
813
  }
539
814
  },
540
815
  // 添加子节点 todo
541
816
  onAddChild(row, index) {
542
- this.handleAddOneRow(row, index, 'CHILD')
817
+ this.handleAddOneRow(row, index, "CHILD");
543
818
  },
544
819
  /**
545
820
  * 处理添加一行数据
@@ -548,36 +823,36 @@ export default {
548
823
  * @param {string} type 操作类型 SIBLING 同级 / CHILD 子级
549
824
  */
550
825
  handleAddOneRow(row, index, type) {
551
-
552
- const {parentId, columnId} = row
553
- const curId = type === 'SIBLING' ? parentId : columnId
554
- let curRow = {}
826
+ const { parentId, columnId } = row;
827
+ const curId = type === "SIBLING" ? parentId : columnId;
828
+ let curRow = {};
555
829
  // 在 tableData 中,找到当前节点
556
830
  const findRow = (data) => {
557
831
  data.forEach((item) => {
558
832
  if (item.columnId === curId) {
559
- curRow = item
833
+ curRow = item;
560
834
  }
561
835
  if (item.children && item.children.length) {
562
- findRow(item.children)
836
+ findRow(item.children);
563
837
  }
564
- })
565
- }
838
+ });
839
+ };
566
840
 
567
- findRow(this.tableData)
841
+ findRow(this.tableData);
568
842
 
569
- const {columnId: generateParentId, children} = curRow
843
+ const { columnId: generateParentId, children } = curRow;
570
844
 
571
- let newRow = this.generateRow(generateParentId)
845
+ let newRow = this.generateRow(generateParentId);
572
846
  if (children) {
573
- if (type === 'SIBLING') {
574
- let addIndex = children.findIndex(item => item.columnId == row.columnId) + 1;
575
- children.splice(addIndex, 0, newRow)
847
+ if (type === "SIBLING") {
848
+ let addIndex =
849
+ children.findIndex((item) => item.columnId == row.columnId) + 1;
850
+ children.splice(addIndex, 0, newRow);
576
851
  } else {
577
- children.push(newRow)
852
+ children.push(newRow);
578
853
  }
579
854
  } else {
580
- this.$set(curRow, 'children', [newRow])
855
+ this.$set(curRow, "children", [newRow]);
581
856
  }
582
857
  },
583
858
  getUuid() {
@@ -587,7 +862,7 @@ export default {
587
862
  * 生成一行数据
588
863
  */
589
864
  generateRow(parentId) {
590
- let tmpId = 'column' + generateId();
865
+ let tmpId = "column" + generateId();
591
866
  let uuid = this.getUuid();
592
867
  var row = {
593
868
  columnId: uuid,
@@ -597,46 +872,51 @@ export default {
597
872
  width: 150,
598
873
  prop: tmpId,
599
874
  label: tmpId,
600
- align: 'left',
875
+ align: "left",
601
876
  show: true,
602
877
  sortable: true,
603
-
878
+ exportType: null,
879
+ footerDataType: null,
880
+ footerMethodConfg: null,
604
881
  // treeNode: false,
605
-
606
882
  };
607
883
  return row;
608
884
  },
609
885
  // 添加根节点
610
886
  onAddRoot() {
611
- this.tableData.push(this.generateRow())
887
+ this.tableData.push(this.generateRow());
612
888
  },
613
889
  // 删除当前节点及对应子节点数据
614
890
  onDelete(row) {
615
- const {parentId, columnId} = row
891
+ const { parentId, columnId } = row;
616
892
  // 根节点直接删除
617
893
  if (!parentId) {
618
- const delIndex = this.tableData.findIndex((item) => item.columnId === columnId)
619
- this.tableData.splice(delIndex, 1)
894
+ const delIndex = this.tableData.findIndex(
895
+ (item) => item.columnId === columnId
896
+ );
897
+ this.tableData.splice(delIndex, 1);
620
898
  } else {
621
899
  // 找到父节点,通过父节点删除
622
- let parentRow = {}
900
+ let parentRow = {};
623
901
  const findRow = (data) => {
624
902
  data.forEach((item) => {
625
903
  if (item.columnId === parentId) {
626
- parentRow = {...item}
904
+ parentRow = { ...item };
627
905
  }
628
906
  if (item.children && item.children.length) {
629
- findRow(item.children)
907
+ findRow(item.children);
630
908
  }
631
- })
632
- }
633
- findRow(this.tableData)
909
+ });
910
+ };
911
+ findRow(this.tableData);
634
912
 
635
- const {children} = parentRow
913
+ const { children } = parentRow;
636
914
 
637
- const delIndex = children.findIndex((item) => item.columnId === columnId)
915
+ const delIndex = children.findIndex(
916
+ (item) => item.columnId === columnId
917
+ );
638
918
 
639
- children.splice(delIndex, 1)
919
+ children.splice(delIndex, 1);
640
920
  }
641
921
  },
642
922
  // 数据准备 生成 id 和 parentId
@@ -644,30 +924,32 @@ export default {
644
924
  const tableFormat = (tableData, parentId) => {
645
925
  tableData.forEach((item) => {
646
926
  // item.parentId = parentId || null
647
- if (!item.kid) item.kid = item.columnId
927
+ if (!item.kid) item.kid = item.columnId;
648
928
  if (item.children && item.children.length > 0) {
649
- tableFormat(item.children, item.columnId)
929
+ tableFormat(item.children, item.columnId);
650
930
  }
651
- })
652
- }
931
+ });
932
+ };
653
933
 
654
- tableFormat(data)
655
- return data
934
+ tableFormat(data);
935
+ return data;
656
936
  },
657
937
  //drag begin
658
938
  //行拖拽
659
939
  rowDrop() {
660
- if (this.dragSort) this.dragSort.destroy() // 防止在Dom上重复绑定事件
940
+ if (this.dragSort) this.dragSort.destroy(); // 防止在Dom上重复绑定事件
661
941
  // const tbody = document.querySelector('.drag .el-table__body-wrapper tbody');
662
- var tbody = this.$refs.singleTable.$el.querySelectorAll('.el-table__fixed-body-wrapper > table > tbody')[0];
942
+ var tbody = this.$refs.singleTable.$el.querySelectorAll(
943
+ ".el-table__fixed-body-wrapper > table > tbody"
944
+ )[0];
663
945
  const _this = this;
664
946
  this.dragSort = Sortable.create(tbody, {
665
- ghostClass: 'sortable-ghost',
947
+ ghostClass: "sortable-ghost",
666
948
  setData: function (e) {
667
- e.setData('Text', '');
949
+ e.setData("Text", "");
668
950
  },
669
- onEnd({newIndex, oldIndex}) {
670
- _this.rowDropEnd(newIndex, oldIndex)
951
+ onEnd({ newIndex, oldIndex }) {
952
+ _this.rowDropEnd(newIndex, oldIndex);
671
953
  },
672
954
  });
673
955
  },
@@ -678,7 +960,7 @@ export default {
678
960
  data.forEach((item) => {
679
961
  const loop = (data) => {
680
962
  result.push({
681
- ...data
963
+ ...data,
682
964
  });
683
965
  let child = data.children;
684
966
  if (child) {
@@ -694,7 +976,9 @@ export default {
694
976
  //数组转树
695
977
  arrToTree(arr, parentId) {
696
978
  return arr
697
- .filter((item) => (!parentId ? !item.parentId : item.parentId === parentId))
979
+ .filter((item) =>
980
+ !parentId ? !item.parentId : item.parentId === parentId
981
+ )
698
982
  .map((item) => {
699
983
  item.children = this.arrToTree(arr, item.columnId);
700
984
  return item;
@@ -732,13 +1016,7 @@ export default {
732
1016
  let newRow = this.tableDataArray[newIndex];
733
1017
 
734
1018
  //判断是否把该行 拖拽到 自己的底级中
735
- if (
736
- this.isTreeBottom(
737
- this.tableData,
738
- oldRow.columnId,
739
- newRow.columnId
740
- )
741
- ) {
1019
+ if (this.isTreeBottom(this.tableData, oldRow.columnId, newRow.columnId)) {
742
1020
  this.$message({
743
1021
  type: "error",
744
1022
  message: "不能放到子节点",
@@ -784,7 +1062,7 @@ export default {
784
1062
  let isButtontCell = false;
785
1063
  let widgetType = this.columnFormatMap[formatS];
786
1064
  if (widgetType) {
787
- isButtontCell = widgetType === 'a-link' || widgetType === 'button';
1065
+ isButtontCell = widgetType === "a-link" || widgetType === "button";
788
1066
  }
789
1067
  return isButtontCell;
790
1068
  },
@@ -792,20 +1070,20 @@ export default {
792
1070
  changeFormatS(row) {
793
1071
  let isButtontCell = this.getIsButtontCell(row.formatS);
794
1072
  let columnWidgetConfig = this.getColumnWidgetConfig(row, true);
795
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1073
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
796
1074
  if (columnSelectedWidget) {
797
1075
  row.columnOption = columnSelectedWidget.options;
798
1076
  } else {
799
- row.columnOption = {}
1077
+ row.columnOption = {};
800
1078
  }
801
1079
 
802
- if (row.formatS == 'editTreeButtonGroup') {
1080
+ if (row.formatS == "editTreeButtonGroup") {
803
1081
  row.prop = null;
804
1082
  row.label = null;
805
1083
  row.sortable = false;
806
1084
  row.width = 150;
807
1085
  } else if (isButtontCell) {
808
- if (row.formatS == 'aLink' || row.formatS == 'button') {
1086
+ if (row.formatS == "aLink" || row.formatS == "button") {
809
1087
  if (!row.width || row.width == 47) row.width = 150;
810
1088
  } else {
811
1089
  row.width = 47;
@@ -814,13 +1092,13 @@ export default {
814
1092
  row.label = null;
815
1093
  row.sortable = false;
816
1094
  } else {
817
- let tmpId = 'column' + generateId();
1095
+ let tmpId = "column" + generateId();
818
1096
  if (!row.width || row.width == 47) row.width = 150;
819
1097
  if (!row.prop) row.prop = tmpId;
820
1098
  if (!row.label) row.label = tmpId;
821
1099
  row.sortable = true;
822
1100
 
823
- if (row.formatS == 'editAttachment') {
1101
+ if (row.formatS == "editAttachment") {
824
1102
  row.prop = this.designer.createAttachmentKeyName();
825
1103
  } else {
826
1104
  let attachmentPrefix = this.designer.getAttachmentPrefix();
@@ -829,7 +1107,7 @@ export default {
829
1107
  }
830
1108
  },
831
1109
  getColumnWidgetConfig(row, isChange, isEdit) {
832
- let formatS = isEdit ? row.editFormatS : row.formatS
1110
+ let formatS = isEdit ? row.editFormatS : row.formatS;
833
1111
  let columnSelectedWidget = null;
834
1112
  let columnEditFields = null;
835
1113
 
@@ -845,7 +1123,9 @@ export default {
845
1123
 
846
1124
  if (type) {
847
1125
  // columnSelectedWidget = this.$baseLodash.cloneDeep(this.designer.getFieldWidgetByType(type));
848
- columnSelectedWidget = this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type));
1126
+ columnSelectedWidget = this.designer.copyNewFieldWidget(
1127
+ this.designer.getFieldWidgetByType(type)
1128
+ );
849
1129
  /*let tmpId = generateId();
850
1130
  let idVal = row.prop ? row.prop : (type + tmpId);*/
851
1131
  /*columnSelectedWidget.id = idVal;*/
@@ -859,61 +1139,70 @@ export default {
859
1139
  if (!isChange && columnOption && Object.keys(columnOption).length) {
860
1140
  columnOption.required = row.required || false;
861
1141
  columnSelectedWidget.options = columnOption;
862
- if ('editDelete' == formatS) {
863
- columnSelectedWidget.options.hiddenByWf = columnSelectedWidget.options.hiddenByWf ?? true;
864
- columnSelectedWidget.options.prefixIcon = columnSelectedWidget.options.prefixIcon || "el-icon-delete";
865
- } else if ('editButton' == formatS) {
866
- columnSelectedWidget.options.prefixIcon = columnSelectedWidget.options.prefixIcon || "el-icon-edit";
1142
+ if ("editDelete" == formatS) {
1143
+ columnSelectedWidget.options.hiddenByWf =
1144
+ columnSelectedWidget.options.hiddenByWf ?? true;
1145
+ columnSelectedWidget.options.prefixIcon =
1146
+ columnSelectedWidget.options.prefixIcon || "el-icon-delete";
1147
+ } else if ("editButton" == formatS) {
1148
+ columnSelectedWidget.options.prefixIcon =
1149
+ columnSelectedWidget.options.prefixIcon || "el-icon-edit";
867
1150
  }
868
1151
  } else {
869
1152
  columnSelectedWidget.options.required = row.required || false;
870
1153
 
871
- if ('editDelete' == formatS) {
1154
+ if ("editDelete" == formatS) {
872
1155
  columnSelectedWidget.options.prefixIcon = "el-icon-delete";
873
1156
  columnSelectedWidget.options.label = "删除";
874
1157
  columnSelectedWidget.options.labelHidden = true;
875
1158
  columnSelectedWidget.options.hiddenByWf = true;
876
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
877
- } else if ('editButton' == formatS) {
1159
+ columnSelectedWidget.options.onClick =
1160
+ "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
1161
+ } else if ("editButton" == formatS) {
878
1162
  columnSelectedWidget.options.prefixIcon = "el-icon-edit";
879
1163
  columnSelectedWidget.options.label = "查看";
880
1164
  columnSelectedWidget.options.labelHidden = true;
881
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
882
- } else if ('addSiblingEditRow' == formatS) {
1165
+ columnSelectedWidget.options.onClick =
1166
+ "let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
1167
+ } else if ("addSiblingEditRow" == formatS) {
883
1168
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
884
1169
  columnSelectedWidget.options.label = "新增兄弟节点";
885
1170
  columnSelectedWidget.options.labelHidden = false;
886
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
887
- } else if ('addChildTreeRow' == formatS) {
1171
+ columnSelectedWidget.options.onClick =
1172
+ "let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
1173
+ } else if ("addChildTreeRow" == formatS) {
888
1174
  columnSelectedWidget.options.prefixIcon = "el-icon-plus";
889
1175
  columnSelectedWidget.options.label = "新增子节点";
890
1176
  columnSelectedWidget.options.labelHidden = false;
891
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
892
- } else if ('moveUpRow' == formatS) {
1177
+ columnSelectedWidget.options.onClick =
1178
+ "let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
1179
+ } else if ("moveUpRow" == formatS) {
893
1180
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
894
1181
  columnSelectedWidget.options.label = "↑上移";
895
1182
  columnSelectedWidget.options.labelHidden = false;
896
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
897
- } else if ('moveDownRow' == formatS) {
1183
+ columnSelectedWidget.options.onClick =
1184
+ "let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
1185
+ } else if ("moveDownRow" == formatS) {
898
1186
  // columnSelectedWidget.options.prefixIcon = "el-icon-plus";
899
1187
  columnSelectedWidget.options.label = "↓下移";
900
1188
  columnSelectedWidget.options.labelHidden = false;
901
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
902
- } else if ('removeTreeRow' == formatS) {
1189
+ columnSelectedWidget.options.onClick =
1190
+ "let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
1191
+ } else if ("removeTreeRow" == formatS) {
903
1192
  columnSelectedWidget.options.prefixIcon = "el-icon-delete";
904
1193
  columnSelectedWidget.options.label = "删除";
905
1194
  columnSelectedWidget.options.labelHidden = true;
906
- columnSelectedWidget.options.onClick = "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
1195
+ columnSelectedWidget.options.onClick =
1196
+ "let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
907
1197
  }
908
1198
 
909
1199
  columnOption = columnSelectedWidget.options;
910
-
911
1200
  }
912
1201
 
913
1202
  // columnSelectedWidget.options.name = isEdit? (type + row.columnId) : row.prop;
914
1203
  // columnSelectedWidget.options.name = type + row.columnId;
915
1204
  // columnSelectedWidget.options.name = row.prop;
916
- if (columnSelectedWidget.options.hasOwnProperty('keyName')) {
1205
+ if (columnSelectedWidget.options.hasOwnProperty("keyName")) {
917
1206
  columnSelectedWidget.options.keyName = row.prop;
918
1207
  columnSelectedWidget.options.keyNameEnabled = true;
919
1208
  } else {
@@ -925,18 +1214,18 @@ export default {
925
1214
  columnSelectedWidget.options.labelHidden = true;
926
1215
  }
927
1216
  }
928
- return {columnSelectedWidget, columnEditFields};
1217
+ return { columnSelectedWidget, columnEditFields };
929
1218
  },
930
1219
  openFormatConfigDialog(row, index) {
931
1220
  let option = row.columnOption;
932
1221
  let selectedWidget;
933
1222
  let columnWidgetConfig = this.getColumnWidgetConfig(row);
934
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1223
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
935
1224
  if (columnSelectedWidget) {
936
1225
  option = columnSelectedWidget.options;
937
1226
  selectedWidget = columnSelectedWidget;
938
1227
  } else {
939
- option = {}
1228
+ option = {};
940
1229
  selectedWidget = {};
941
1230
  }
942
1231
 
@@ -950,20 +1239,16 @@ export default {
950
1239
  index: index,
951
1240
  columnEditFields: columnEditFields,
952
1241
  callback: (columnOption) => {
953
- this.confirmFormatConfigDialog(columnOption);
954
- }
955
- })
1242
+ this.confirmFormatConfigDialog(columnOption, row);
1243
+ },
1244
+ });
956
1245
  },
957
1246
  getFieldKeyNameByOptions(options) {
958
1247
  let o = options.name;
959
- return (
960
- (options.keyNameEnabled
961
- && options.keyName)
962
- || o
963
- );
1248
+ return (options.keyNameEnabled && options.keyName) || o;
964
1249
  },
965
- confirmFormatConfigDialog(columnOption) {
966
- let row = this.tableData[this.operateIndex];
1250
+ confirmFormatConfigDialog(columnOption, row) {
1251
+ // let row = this.tableData[this.operateIndex];
967
1252
  row.columnOption = columnOption;
968
1253
  let isButtontCell = this.getIsButtontCell(row.formatS);
969
1254
  if (!isButtontCell) {
@@ -976,12 +1261,12 @@ export default {
976
1261
  let option = row.columnOption;
977
1262
  let selectedWidget;
978
1263
  let columnWidgetConfig = this.getColumnWidgetConfig(row, null, true);
979
- let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1264
+ let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
980
1265
  if (columnSelectedWidget) {
981
1266
  option = columnSelectedWidget.options;
982
1267
  selectedWidget = columnSelectedWidget;
983
1268
  } else {
984
- option = {}
1269
+ option = {};
985
1270
  selectedWidget = {};
986
1271
  }
987
1272
 
@@ -995,12 +1280,12 @@ export default {
995
1280
  index: index,
996
1281
  columnEditFields: columnEditFields,
997
1282
  callback: (columnOption) => {
998
- this.confirmEditFormatConfigDialog(columnOption);
999
- }
1000
- })
1283
+ this.confirmEditFormatConfigDialog(columnOption, row);
1284
+ },
1285
+ });
1001
1286
  },
1002
- confirmEditFormatConfigDialog(columnOption) {
1003
- let row = this.tableData[this.operateIndex];
1287
+ confirmEditFormatConfigDialog(columnOption, row) {
1288
+ // let row = this.tableData[this.operateIndex];
1004
1289
  row.editColumnOption = columnOption;
1005
1290
  /*row.prop = columnOption.name;
1006
1291
  row.label = columnOption.label;
@@ -1008,39 +1293,50 @@ export default {
1008
1293
  },
1009
1294
  openTableColumnConfigDialog(row, index) {
1010
1295
  this.operateIndex = index;
1296
+ this.currentTableColumn = row;
1011
1297
  let eventName = "tableColumnConfig";
1012
- let eventParams = ["dataId", "formCode"]
1013
- this.tableColumnConfigHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(', ')}) {`;
1014
- this.tableColumnConfigCode = this.$baseLodash.cloneDeep(row.tableColumnConfig || '');
1298
+ let eventParams = ["dataId", "formCode"];
1299
+ this.tableColumnConfigHeader = `${
1300
+ this.optionModel.name
1301
+ }.${eventName}(${eventParams.join(", ")}) {`;
1302
+ this.tableColumnConfigCode = this.$baseLodash.cloneDeep(
1303
+ row.tableColumnConfig || ""
1304
+ );
1015
1305
 
1016
1306
  this.tableColumnConfigTitle = `自定义表格列属性配置(${row.label})`;
1017
1307
  this.showTableColumnConfigDialog = true;
1018
1308
  },
1019
1309
  saveTableColumnConfigDialog() {
1020
- let row = this.tableData[this.operateIndex];
1310
+ // let row = this.tableData[this.operateIndex];
1311
+ let row = this.currentTableColumn;
1021
1312
  const codeHints = this.$refs.ecEditor.getEditorAnnotations();
1022
1313
  let syntaxErrorFlag = false;
1023
1314
  if (!!codeHints && codeHints.length > 0) {
1024
- codeHints.forEach(chItem => {
1025
- if (chItem.type === 'error') {
1315
+ codeHints.forEach((chItem) => {
1316
+ if (chItem.type === "error") {
1026
1317
  syntaxErrorFlag = true;
1027
1318
  }
1028
1319
  });
1029
1320
 
1030
1321
  if (syntaxErrorFlag) {
1031
- this.$message.error(this.i18nt('designer.setting.syntaxCheckWarning'));
1322
+ this.$message.error(
1323
+ this.i18nt("designer.setting.syntaxCheckWarning")
1324
+ );
1032
1325
  return;
1033
1326
  }
1034
1327
  }
1035
- this.$set(row, 'tableColumnConfig', this.$baseLodash.cloneDeep(this.tableColumnConfigCode))
1328
+ this.$set(
1329
+ row,
1330
+ "tableColumnConfig",
1331
+ this.$baseLodash.cloneDeep(this.tableColumnConfigCode)
1332
+ );
1036
1333
  this.showTableColumnConfigDialog = false;
1037
-
1038
1334
  },
1039
- }
1040
- }
1335
+ },
1336
+ };
1041
1337
  </script>
1042
1338
  <style scoped lang="scss">
1043
1339
  .icon-drag:before {
1044
- content: '\e61d';
1340
+ content: "\e61d";
1045
1341
  }
1046
1342
  </style>