cloud-web-corejs 1.0.54-dev.794 → 1.0.54-dev.796

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 (23) hide show
  1. package/package.json +1 -1
  2. package/src/components/formDialog/README.md +32 -6
  3. package/src/components/luckysheet/dialog.vue +1 -1
  4. package/src/components/wf/wfButtonName.js +60 -0
  5. package/src/components/xform/form-designer/designer.js +2 -1
  6. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +65 -29
  7. package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +3 -0
  8. package/src/components/xform/form-designer/setting-panel/form-setting.vue +111 -8
  9. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +0 -1
  10. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js +253 -0
  11. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +49 -40
  12. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +175 -0
  13. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +20 -5
  14. package/src/components/xform/form-designer/widget-panel/indexMixin.js +2 -1
  15. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +3 -0
  16. package/src/components/xform/form-render/container-item/data-table-mixin.js +5 -11
  17. package/src/components/xform/form-render/container-item/detail-item.vue +116 -3
  18. package/src/components/xform/form-render/index.vue +0 -7
  19. package/src/components/xform/form-render/indexMixin.js +65 -31
  20. package/src/components/xform/mixins/defaultHandle.js +50 -38
  21. package/src/components/xform/utils/util.js +7 -0
  22. package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +2 -0
  23. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -307
@@ -1,307 +0,0 @@
1
- <template>
2
- <el-drawer v-bind="dialogConfig" @close="close" :visible.sync="showDialog">
3
- <!-- host:"list" —— 承载列表宿主页(自带「常规(详情)/列表」页签),行点击进详情等行为与整页一致。
4
- list.vue 根节点自带 #containt,本分支不再套 id,避免嵌套重复。 -->
5
- <div class="cont fd-list-host" v-bind="bodyConfig" v-if="listHost">
6
- <list-view-host :formCode="listFormCode" :param="dialogParam"/>
7
- </div>
8
- <div class="cont" v-bind="bodyConfig" id="containt" v-else>
9
- <v-form-render :form-json.sync="formJson" :form-data="formData" :option-data="optionData" ref="vFormRef"
10
- :reportTemplate.sync="formTemplate" :conditionParam.sync="conditionParam"
11
- :formInsData.sync="formInsData" v-if="showRender" visible-key="showRender" :parent-target="_self"
12
- @reload="reload" :param="dialogParam"
13
- class="data-table_height" @hook:mounted="handleFormMounted"/>
14
- </div>
15
- <span class="dialog-footer" v-if="option.showFooter!==false" v-bind="option.footerConfig">
16
- <el-button type="primary" plain class="button-sty" @click="close">
17
- <i class="el-icon-close el-icon"></i>
18
- {{ $t2('取 消', 'system.button.cancel2') }}
19
- </el-button>
20
- <!-- 模板配了 formConfig.actionButtons 时,用配置按钮替代「确定」(取消保持不变) -->
21
- <template v-if="visibleFooterButtons">
22
- <el-button v-for="btn in visibleFooterButtons" :key="btn.code" :type="btn.type || 'primary'"
23
- :plain="btn.plain === true" class="button-sty" :loading="!!btnLoadingMap[btn.code]"
24
- @click="handleActionButton(btn)">
25
- <i v-if="btn.icon" :class="[btn.icon, 'el-icon']"></i>
26
- {{ btnLabel(btn) }}
27
- </el-button>
28
- </template>
29
- <el-button v-else type="primary" @click="dialogSubmit" class="button-sty">
30
- <i class="el-icon-check el-icon"></i>
31
- {{ $t2('确 定', 'system.button.confirm2') }}
32
- </el-button>
33
- </span>
34
- </el-drawer>
35
- </template>
36
-
37
- <script>
38
- import VFormRender from "../../../../../components/xform/form-render/index.vue";
39
- import {
40
- resolveActionButtons,
41
- hasButtonPermission,
42
- isButtonVisible,
43
- runActionButton,
44
- } from "@base/components/formDialog/actionButtons";
45
-
46
- export default {
47
- components: {
48
- VFormRender,
49
- // 列表宿主页(x-tabs:常规/列表/其他页签/多标签编辑),仅 host:"list" 时加载
50
- ListViewHost: () =>
51
- import(
52
- /* webpackChunkName: "form-list-host" */ "@base/views/user/form/view/list.vue"
53
- ),
54
- },
55
- props: {
56
- visiable: Boolean,
57
- option: Object
58
- },
59
- mixins: [],
60
- inject: ["getFormConfig"],
61
- mounted() {
62
-
63
- },
64
- data() {
65
- var that = this;
66
- return {
67
- showFormField: "_tt",
68
- showDialog: true,
69
- falseValue: false,
70
- selectMulti: true,
71
-
72
- formJson: {},
73
- formData: {},
74
- optionData: {},
75
- showRender: false,
76
- formTemplate: {},
77
- /* formCode: null,*/
78
- layoutType: null,
79
- conditionParam: null,
80
- formInsData: null,
81
- $grid: null,
82
- currentLayoutType: null,
83
- // 模板 formConfig.actionButtons(权限过滤后);为空则底部保持默认「确定」
84
- customButtons: null,
85
- btnLoadingMap: {},
86
- formRefMounted: false
87
- };
88
- },
89
- computed: {
90
- formCode() {
91
- return this.option.formCode;
92
- },
93
- dialogParam() {
94
- return this.option?.param;
95
- },
96
- // host:"list" —— 用列表宿主页承载(带「常规/列表」页签),而非直接渲染单个表单
97
- listHost() {
98
- return this.option?.host === "list";
99
- },
100
- listFormCode() {
101
- return this.option?.formCode;
102
- },
103
- dialogConfig() {
104
- let customClass = "dialog-style list-dialog dialog-checkbox pd_0";
105
- if (this.option.dialogConfig?.customClass) {
106
- customClass = customClass + " " + this.option.dialogConfig.customClass
107
- }
108
- let config = {
109
- title: this.formTemplate.formName,
110
- appendToBody: false,
111
- // modalAppendToBody: true,
112
- // closeOnClickModal: false,
113
- modal: false,
114
- destroyOnClose:true,
115
- // width: "1200px",
116
- // fullscreen: this.option.fullscreen,
117
- size:"80%",
118
- direction:"btt"
119
- };
120
- config = Object.assign({}, config, this.option.dialogConfig, {customClass});
121
- config.title = this.$t1(config.title);
122
- return config;
123
- },
124
- // 自定义按钮渲染列表:权限已在 initCustomButtons 过滤,此处按 visible 脚本过滤
125
- visibleFooterButtons() {
126
- if (!this.customButtons || !this.customButtons.length) return null;
127
- this.formRefMounted; // eslint-disable-line no-unused-expressions
128
- let buttons = this.customButtons.filter((btn) =>
129
- isButtonVisible(btn, this.$refs.vFormRef)
130
- );
131
- return buttons.length ? buttons : null;
132
- },
133
- bodyConfig() {
134
- let config = {};
135
- let classStr = this.currentLayoutType
136
- if (this.option.bodyConfig?.class) {
137
- classStr = classStr + " " + this.option.bodyConfig.class;
138
- }
139
- if (this.option.showFooter == false) {
140
- classStr = classStr + " nfootBtn";
141
- }
142
- config = Object.assign({}, config, this.option.bodyConfig, {class: classStr});
143
- return config;
144
- }
145
- },
146
- created() {
147
- let currentFormConfig = this.getFormConfig();
148
- this.currentLayoutType = currentFormConfig.layoutType
149
-
150
- this.selectMulti = this.option.multiple ?? true;
151
- // 列表宿主页自己会加载模板;仅在未指定标题时补取一次模板名做抽屉标题
152
- if (this.listHost && this.option.dialogConfig?.title) return;
153
- this.getReportTemplate();
154
- },
155
- methods: {
156
- reload(){
157
- this.showRender = false;
158
- return this.getReportTemplate();
159
- },
160
- async getReportTemplate() {
161
- let param = {
162
- objTypeCode: this.$attrs.objTypeCode,
163
- objId: this.$attrs.objId,
164
- taskId: this.$attrs.taskId
165
- };
166
- this.conditionParam = param;
167
- let url, data;
168
- url = USER_PREFIX + `/formTemplate/getByFormCode`;
169
- data = {stringOne: this.formCode}
170
-
171
- let that = this;
172
- return this.$http({
173
- url: url,
174
- method: `post`,
175
- data: data,
176
- isLoading: true,
177
- loadingTarget: document.body,
178
- modalStrictly: true,
179
- success: res => {
180
- let formTemplate = res.objx || {};
181
- this.formTemplate = formTemplate;
182
- // 列表宿主模式:只借模板名做标题,渲染与按钮均由宿主页自己负责
183
- if (this.listHost) return;
184
- this.formJson = formTemplate.formViewContent ? JSON.parse(formTemplate.formViewContent) : {};
185
- this.layoutType = this.formJson.formConfig.layoutType
186
- let formConfig = this.formJson.formConfig;
187
- if (formConfig.searchDialogUniqueField) {
188
- this.fieldKey = formConfig.searchDialogUniqueField;
189
- }
190
- this.initCustomButtons(formConfig);
191
-
192
- this.showRender = true;
193
-
194
-
195
- }
196
- });
197
- },
198
- // 模板 actionButtons:option.buttons 可覆盖;权限 formCode:authName 在此一次性过滤
199
- initCustomButtons(formConfig) {
200
- let buttons = resolveActionButtons(this.option?.buttons, formConfig);
201
- this.customButtons = buttons
202
- ? buttons.filter((btn) => hasButtonPermission(btn, this.formCode, this))
203
- : null;
204
- },
205
- handleFormMounted() {
206
- this.formRefMounted = true;
207
- },
208
- btnLabel(btn) {
209
- return this.$t1 ? this.$t1(btn.label) : btn.label;
210
- },
211
- /**
212
- * 自定义按钮点击:校验 → onClick 脚本 → done/closeAfter 收口。
213
- * 收口时优先回调 option.onAction(payload, formRef, vm);
214
- * 未提供则仅按 closeAfter 关闭(按钮自身脚本即业务处理,不再走 option.confirm)。
215
- */
216
- handleActionButton(btn) {
217
- let formRef = this.$refs.vFormRef;
218
- if (!formRef || this.btnLoadingMap[btn.code]) return;
219
- this.$set(this.btnLoadingMap, btn.code, true);
220
- let clearLoading = () => this.$set(this.btnLoadingMap, btn.code, false);
221
- runActionButton(btn, {
222
- formRef,
223
- host: this,
224
- getSelection: () => [],
225
- onSettle: (payload, close) => {
226
- if (typeof this.option.onAction === "function") {
227
- this.option.onAction(payload, formRef, this);
228
- }
229
- if (close) this.close();
230
- },
231
- }).then(clearLoading, clearLoading);
232
- },
233
- close() {
234
- let formRef = this.$refs.vFormRef;
235
- this.showDialog = false;
236
- this.$emit('update:visiable', false);
237
- this.option.close && this.option.close(formRef, this);
238
- },
239
- dialogSubmit() {
240
- let formRef = this.$refs.vFormRef;
241
- if (this.option.confirm) {
242
- if (this.option.confirm(formRef, this) !== false) {
243
- this.close();
244
- }
245
- } else {
246
- this.close();
247
- }
248
- }
249
- }
250
- }
251
- </script>
252
-
253
- <style lang="scss" scoped>
254
- ::v-deep .H5 .h5-fixed-bottom-btns {
255
- bottom: 95px;
256
- }
257
-
258
- .list-dialog {
259
- .el-dialog__body {
260
- height: calc(100% - 42px);
261
-
262
- // host:"list":.cont 已有确定高度,把它传给 list.vue 根节点 #containt,
263
- // .tab-box 自身是 height:100%,父链没高度页签内容区会塌成一条
264
- .cont.fd-list-host {
265
- padding: 0;
266
-
267
- ::v-deep > #containt {
268
- height: 100%;
269
- }
270
- }
271
-
272
- .cont {
273
- height: calc(100vh - 210px);
274
-
275
- &.nfootBtn {
276
- height: calc(100vh - 158px)
277
- }
278
-
279
- &#containt {
280
- padding: 0;
281
-
282
- ::v-deep .grid-container {
283
- outline: none;
284
-
285
- &.detail-wrap .d-cont {
286
- //height: calc(100vh - 150px);
287
-
288
- .title .field-wrapper {
289
- display: inline-block !important
290
- }
291
- }
292
- }
293
- }
294
- }
295
- }
296
-
297
- &.is-fullscreen .el-dialog__body {
298
- .cont {
299
- height: calc(100vh - 110px);
300
-
301
- &.nfootBtn {
302
- height: calc(100vh - var(--xform-dialog-body-offset, 58px))
303
- }
304
- }
305
- }
306
- }
307
- </style>