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.
- package/package.json +3 -1
- package/src/components/baseTabs/mixins.js +11 -12
- package/src/components/bizTab/BizBillActions.vue +129 -0
- package/src/components/bizTab/BizTabListPage.vue +391 -0
- package/src/components/bizTab/README.md +378 -0
- package/src/components/bizTab/billTableUtil.js +48 -0
- package/src/components/bizTab/billValidators.js +136 -0
- package/src/components/bizTab/bizBillDetailMixin.js +687 -0
- package/src/components/bizTab/index.js +24 -0
- package/src/components/excelExport/exportFieldDialog.vue +373 -367
- package/src/components/excelExport/exportType.js +49 -0
- package/src/components/excelExport/mixins.js +1153 -1141
- package/src/components/vb-tabs/x-tabs.vue +167 -143
- package/src/components/wf/wfUtil.js +327 -292
- package/src/components/xform/form-designer/designer.js +56 -8
- package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +60 -8
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +8 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -92
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +63 -94
- package/src/components/xform/form-designer/index.vue +0 -1
- package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -602
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +13 -13
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -585
- package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1154 -1154
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -80
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -75
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -344
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -84
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -97
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -188
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +237 -237
- package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -71
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +2 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
- package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +178 -178
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/index.vue +3 -1
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +55 -13
- package/src/components/xform/form-render/container-item/data-table-mixin copy.js +5910 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +59 -13
- package/src/components/xform/form-render/container-item/detail-item.vue +52 -11
- package/src/components/xform/form-render/container-item/tab-item.vue +6 -2
- package/src/components/xform/form-render/indexMixin.js +56 -16
- package/src/components/xform/lang/zh-CN.js +2 -1
- package/src/components/xform/utils/attachmentValueUtil.js +239 -0
- package/src/components/xform/utils/util.js +27 -0
- package/src/mixins/wf/index.js +40 -38
- package/src/router/modules/customer.js +50 -0
- package/src/store/config/index.js +46 -0
- package/src/utils/scrollUtil.js +25 -0
- package/src/views/demo/bizTab/bill/billConfig.js +41 -0
- package/src/views/demo/bizTab/bill/detail.vue +436 -0
- package/src/views/demo/bizTab/bill/list.vue +288 -0
- package/src/views/demo/bizTab/bill/productDialog.vue +176 -0
- package/src/views/demo/bizTab/simple/billApi.js +123 -0
- package/src/views/demo/bizTab/simple/detail.vue +407 -0
- package/src/views/demo/bizTab/simple/list.vue +217 -0
- package/src/views/demo/bizTab/standalone/index.vue +121 -0
- package/src/views/demo/bizTab/wf/billConfig.js +44 -0
- package/src/views/demo/bizTab/wf/detail.vue +661 -0
- package/src/views/demo/bizTab/wf/list.vue +242 -0
- package/src/views/user/outLink/cc_form_view.vue +185 -0
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-form-item label="点击绑定事件">
|
|
4
|
-
<el-select v-model="optionModel.clickBindEvent" clearable @change="onActionChange">
|
|
5
|
-
<el-option v-for="action in actions" :key="action.value"
|
|
6
|
-
:value="action.value" :label="action.label"></el-option>
|
|
7
|
-
</el-select>
|
|
8
|
-
</el-form-item>
|
|
9
|
-
<el-form-item label="点击前置事件" label-width="150px">
|
|
10
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
11
|
-
@click="editEventHandler('onBeforeClickButton', evnentParams)">
|
|
12
|
-
<span>{{ optionModel.onBeforeClickButton }}</span>
|
|
13
|
-
<i class="el-icon-edit"></i>
|
|
14
|
-
</a>
|
|
15
|
-
</el-form-item>
|
|
16
|
-
<!-- 子编辑器由注册表的 editorName 决定,新增动作不用再加 v-if 分支 -->
|
|
17
|
-
<component v-if="currentAction && currentAction.editorName"
|
|
18
|
-
:is="currentAction.editorName"
|
|
19
|
-
:designer="designer" :selectedWidget="selectedWidget"
|
|
20
|
-
:optionModel.sync="optionModel"
|
|
21
|
-
:actionValue="optionModel.clickBindEvent"></component>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
<script>
|
|
25
|
-
import searchDialogEventEditor from "./search-dialog-event-editor.vue";
|
|
26
|
-
import addTableDataEventEditor from "./addTableData-event-editor.vue";
|
|
27
|
-
import formHostEventEditor from "./form-host-event-editor.vue";
|
|
28
|
-
import {
|
|
29
|
-
clickBindActions,
|
|
30
|
-
getClickBindAction,
|
|
31
|
-
} from "./clickBindActions";
|
|
32
|
-
|
|
33
|
-
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
34
|
-
import eventMixin
|
|
35
|
-
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
name: "clickBindEvent-editor",
|
|
39
|
-
mixins: [i18n, eventMixin],
|
|
40
|
-
props: {
|
|
41
|
-
designer: Object,
|
|
42
|
-
selectedWidget: Object,
|
|
43
|
-
optionModel: Object,
|
|
44
|
-
},
|
|
45
|
-
components: {
|
|
46
|
-
searchDialogEventEditor,
|
|
47
|
-
addTableDataEventEditor,
|
|
48
|
-
formHostEventEditor
|
|
49
|
-
},
|
|
50
|
-
data() {
|
|
51
|
-
return {
|
|
52
|
-
actions: clickBindActions,
|
|
53
|
-
evnentParams: ["dataId", "formCode", "done"]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
computed: {
|
|
57
|
-
currentAction() {
|
|
58
|
-
return getClickBindAction(this.optionModel.clickBindEvent);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
created() {
|
|
62
|
-
// 存量模板兜底:只补当前已选动作的配置块,不再无条件塞两份空壳
|
|
63
|
-
this.ensureActionConfig(this.optionModel.clickBindEvent);
|
|
64
|
-
},
|
|
65
|
-
methods: {
|
|
66
|
-
// 切换动作时惰性注入配置:已有则保留("3"↔"4" 共用 formHostConfig,互切不丢配置)
|
|
67
|
-
onActionChange(value) {
|
|
68
|
-
this.ensureActionConfig(value);
|
|
69
|
-
},
|
|
70
|
-
ensureActionConfig(value) {
|
|
71
|
-
let action = getClickBindAction(value);
|
|
72
|
-
if (!action || !action.configKey) return;
|
|
73
|
-
if (!this.optionModel[action.configKey]) {
|
|
74
|
-
this.$set(
|
|
75
|
-
this.optionModel,
|
|
76
|
-
action.configKey,
|
|
77
|
-
action.defaultConfig({widgetType: this.selectedWidget.type})
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
// 存量模板可能缺 multipleChoices,沿用原判定补上
|
|
81
|
-
if (
|
|
82
|
-
action.configKey === "searchDialogConfig"
|
|
83
|
-
&& this.optionModel.searchDialogConfig.multipleChoices === void 0
|
|
84
|
-
) {
|
|
85
|
-
this.$set(
|
|
86
|
-
this.optionModel.searchDialogConfig,
|
|
87
|
-
"multipleChoices",
|
|
88
|
-
this.selectedWidget.type !== "vabsearch"
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
</script>
|
|
95
|
-
<style scoped>
|
|
96
|
-
|
|
97
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item class="form-item-label-top" label="点击绑定事件">
|
|
4
|
+
<el-select v-model="optionModel.clickBindEvent" clearable @change="onActionChange">
|
|
5
|
+
<el-option v-for="action in actions" :key="action.value"
|
|
6
|
+
:value="action.value" :label="action.label"></el-option>
|
|
7
|
+
</el-select>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="点击前置事件" label-width="150px">
|
|
10
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
11
|
+
@click="editEventHandler('onBeforeClickButton', evnentParams)">
|
|
12
|
+
<span>{{ optionModel.onBeforeClickButton }}</span>
|
|
13
|
+
<i class="el-icon-edit"></i>
|
|
14
|
+
</a>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
<!-- 子编辑器由注册表的 editorName 决定,新增动作不用再加 v-if 分支 -->
|
|
17
|
+
<component v-if="currentAction && currentAction.editorName"
|
|
18
|
+
:is="currentAction.editorName"
|
|
19
|
+
:designer="designer" :selectedWidget="selectedWidget"
|
|
20
|
+
:optionModel.sync="optionModel"
|
|
21
|
+
:actionValue="optionModel.clickBindEvent"></component>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script>
|
|
25
|
+
import searchDialogEventEditor from "./search-dialog-event-editor.vue";
|
|
26
|
+
import addTableDataEventEditor from "./addTableData-event-editor.vue";
|
|
27
|
+
import formHostEventEditor from "./form-host-event-editor.vue";
|
|
28
|
+
import {
|
|
29
|
+
clickBindActions,
|
|
30
|
+
getClickBindAction,
|
|
31
|
+
} from "./clickBindActions";
|
|
32
|
+
|
|
33
|
+
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
34
|
+
import eventMixin
|
|
35
|
+
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "clickBindEvent-editor",
|
|
39
|
+
mixins: [i18n, eventMixin],
|
|
40
|
+
props: {
|
|
41
|
+
designer: Object,
|
|
42
|
+
selectedWidget: Object,
|
|
43
|
+
optionModel: Object,
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
searchDialogEventEditor,
|
|
47
|
+
addTableDataEventEditor,
|
|
48
|
+
formHostEventEditor
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
actions: clickBindActions,
|
|
53
|
+
evnentParams: ["dataId", "formCode", "done"]
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
computed: {
|
|
57
|
+
currentAction() {
|
|
58
|
+
return getClickBindAction(this.optionModel.clickBindEvent);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
created() {
|
|
62
|
+
// 存量模板兜底:只补当前已选动作的配置块,不再无条件塞两份空壳
|
|
63
|
+
this.ensureActionConfig(this.optionModel.clickBindEvent);
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
// 切换动作时惰性注入配置:已有则保留("3"↔"4" 共用 formHostConfig,互切不丢配置)
|
|
67
|
+
onActionChange(value) {
|
|
68
|
+
this.ensureActionConfig(value);
|
|
69
|
+
},
|
|
70
|
+
ensureActionConfig(value) {
|
|
71
|
+
let action = getClickBindAction(value);
|
|
72
|
+
if (!action || !action.configKey) return;
|
|
73
|
+
if (!this.optionModel[action.configKey]) {
|
|
74
|
+
this.$set(
|
|
75
|
+
this.optionModel,
|
|
76
|
+
action.configKey,
|
|
77
|
+
action.defaultConfig({widgetType: this.selectedWidget.type})
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
// 存量模板可能缺 multipleChoices,沿用原判定补上
|
|
81
|
+
if (
|
|
82
|
+
action.configKey === "searchDialogConfig"
|
|
83
|
+
&& this.optionModel.searchDialogConfig.multipleChoices === void 0
|
|
84
|
+
) {
|
|
85
|
+
this.$set(
|
|
86
|
+
this.optionModel.searchDialogConfig,
|
|
87
|
+
"multipleChoices",
|
|
88
|
+
this.selectedWidget.type !== "vabsearch"
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
<style scoped>
|
|
96
|
+
|
|
97
|
+
</style>
|
|
@@ -1,188 +1,188 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-form-item label-width="0">
|
|
4
|
-
<el-divider class="custom-divider">{{ drawerMode ? '表单抽屉配置' : '表单弹框配置' }}</el-divider>
|
|
5
|
-
</el-form-item>
|
|
6
|
-
<el-form-item label="表单编码">
|
|
7
|
-
<el-input type="text" v-model="eventConfig.formCode"></el-input>
|
|
8
|
-
</el-form-item>
|
|
9
|
-
<el-form-item label="表单编码脚本" label-width="150px">
|
|
10
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
11
|
-
@click="editEventHandler('formCodeScript', scriptParams, optionFormCode)">
|
|
12
|
-
<span>{{ eventConfig.formCodeScript }}</span>
|
|
13
|
-
<i class="el-icon-edit"></i>
|
|
14
|
-
</a>
|
|
15
|
-
</el-form-item>
|
|
16
|
-
<el-form-item label="以列表页承载">
|
|
17
|
-
<el-switch v-model="listHost"></el-switch>
|
|
18
|
-
<span class="tips">开启后按「常规/列表」页签的列表页打开</span>
|
|
19
|
-
</el-form-item>
|
|
20
|
-
<el-form-item label="标题">
|
|
21
|
-
<el-input type="text" v-model="eventConfig.title" placeholder="缺省取表单模板名称"></el-input>
|
|
22
|
-
</el-form-item>
|
|
23
|
-
|
|
24
|
-
<template v-if="!listHost">
|
|
25
|
-
<el-form-item label="打开方式">
|
|
26
|
-
<el-select v-model="eventConfig.openMode">
|
|
27
|
-
<el-option value="1" label="新增"></el-option>
|
|
28
|
-
<el-option value="2" label="详情"></el-option>
|
|
29
|
-
</el-select>
|
|
30
|
-
</el-form-item>
|
|
31
|
-
<template v-if="eventConfig.openMode === '2'">
|
|
32
|
-
<el-form-item label="单据ID来源">
|
|
33
|
-
<el-select v-model="eventConfig.dataIdFrom">
|
|
34
|
-
<el-option value="1" label="当前控件值"></el-option>
|
|
35
|
-
<el-option value="2" label="指定表单字段"></el-option>
|
|
36
|
-
<el-option value="3" label="当前表格行字段"></el-option>
|
|
37
|
-
<el-option value="4" label="脚本"></el-option>
|
|
38
|
-
</el-select>
|
|
39
|
-
</el-form-item>
|
|
40
|
-
<el-form-item label="来源字段名"
|
|
41
|
-
v-if="eventConfig.dataIdFrom === '2' || eventConfig.dataIdFrom === '3'">
|
|
42
|
-
<el-input type="text" v-model="eventConfig.dataIdField"></el-input>
|
|
43
|
-
</el-form-item>
|
|
44
|
-
<el-form-item label="单据ID脚本" label-width="150px" v-if="eventConfig.dataIdFrom === '4'">
|
|
45
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
46
|
-
@click="editEventHandler('dataIdScript', scriptParams, optionDataId)">
|
|
47
|
-
<span>{{ eventConfig.dataIdScript }}</span>
|
|
48
|
-
<i class="el-icon-edit"></i>
|
|
49
|
-
</a>
|
|
50
|
-
</el-form-item>
|
|
51
|
-
</template>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<el-form-item label="查询参数" label-width="150px" v-if="!listHost">
|
|
55
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
56
|
-
@click="editEventHandler('queryParamScript', scriptParams, optionQueryParam)">
|
|
57
|
-
<span>{{ eventConfig.queryParamScript }}</span>
|
|
58
|
-
<i class="el-icon-edit"></i>
|
|
59
|
-
</a>
|
|
60
|
-
<span class="tips">脚本返回对象合并进目标表单查询表格的请求参数;按业务字段过滤写
|
|
61
|
-
<code>return {'{'} condition: {'{'} status: 1 {'}'} {'}'}</code>(追加进查询区条件,同字段以脚本为准)</span>
|
|
62
|
-
</el-form-item>
|
|
63
|
-
<el-form-item label="自定义参数" label-width="150px">
|
|
64
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
65
|
-
@click="editEventHandler('paramScript', scriptParams, optionParam)">
|
|
66
|
-
<span>{{ eventConfig.paramScript }}</span>
|
|
67
|
-
<i class="el-icon-edit"></i>
|
|
68
|
-
</a>
|
|
69
|
-
<span class="tips">脚本返回对象 → 目标表单的 param,只给模板脚本用,不参与请求</span>
|
|
70
|
-
</el-form-item>
|
|
71
|
-
<el-form-item label="只读">
|
|
72
|
-
<el-switch v-model="eventConfig.readonly"></el-switch>
|
|
73
|
-
<span class="tips">{{ drawerMode ? '只读态渲染,底部仅保留「关闭」' : '整表禁用,底部按钮不变' }}</span>
|
|
74
|
-
</el-form-item>
|
|
75
|
-
<el-form-item label="显示底部按钮">
|
|
76
|
-
<el-switch v-model="eventConfig.showFooter"></el-switch>
|
|
77
|
-
<span class="tips">按钮由目标表单的「表单操作按钮」决定</span>
|
|
78
|
-
</el-form-item>
|
|
79
|
-
|
|
80
|
-
<!-- 形态字段:弹框/抽屉各一组 -->
|
|
81
|
-
<template v-if="drawerMode">
|
|
82
|
-
<el-form-item label="素身详情">
|
|
83
|
-
<el-switch v-model="eventConfig.plain"></el-switch>
|
|
84
|
-
<span class="tips">不渲染详情标题栏与模块导航</span>
|
|
85
|
-
</el-form-item>
|
|
86
|
-
<el-form-item label="抽屉尺寸">
|
|
87
|
-
<el-input type="text" v-model="eventConfig.drawerSize" placeholder="缺省 62%,列表页 85%"></el-input>
|
|
88
|
-
</el-form-item>
|
|
89
|
-
<el-form-item label="弹出方向">
|
|
90
|
-
<el-select v-model="eventConfig.drawerDirection" clearable placeholder="缺省 右侧滑出">
|
|
91
|
-
<el-option value="rtl" label="右侧滑出"></el-option>
|
|
92
|
-
<el-option value="ltr" label="左侧滑出"></el-option>
|
|
93
|
-
<el-option value="ttb" label="顶部滑出"></el-option>
|
|
94
|
-
<el-option value="btt" label="底部滑出"></el-option>
|
|
95
|
-
</el-select>
|
|
96
|
-
</el-form-item>
|
|
97
|
-
</template>
|
|
98
|
-
<template v-else>
|
|
99
|
-
<el-form-item label="弹框宽度">
|
|
100
|
-
<el-input type="text" v-model="eventConfig.dialogWidth" placeholder="缺省 1200px"></el-input>
|
|
101
|
-
</el-form-item>
|
|
102
|
-
<el-form-item label="全屏">
|
|
103
|
-
<el-switch v-model="eventConfig.fullscreen"></el-switch>
|
|
104
|
-
</el-form-item>
|
|
105
|
-
</template>
|
|
106
|
-
|
|
107
|
-
<el-form-item label="关闭后事件" label-width="150px">
|
|
108
|
-
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
109
|
-
@click="editEventHandler('onCloseScript', closeScriptParams, optionClose)">
|
|
110
|
-
<span>{{ eventConfig.onCloseScript }}</span>
|
|
111
|
-
<i class="el-icon-edit"></i>
|
|
112
|
-
</a>
|
|
113
|
-
</el-form-item>
|
|
114
|
-
</div>
|
|
115
|
-
</template>
|
|
116
|
-
|
|
117
|
-
<script>
|
|
118
|
-
import i18n from "../../../../../../components/xform/utils/i18n"
|
|
119
|
-
import eventMixin
|
|
120
|
-
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin"
|
|
121
|
-
import {CLICK_BIND} from "./clickBindActions";
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 「打开表单弹框 / 打开表单抽屉」共用配置编辑器(optionModel.formHostConfig)。
|
|
125
|
-
* 两个动作共用一份配置,形态字段按 actionValue 切换,弹框/抽屉互切时配置不丢。
|
|
126
|
-
*/
|
|
127
|
-
export default {
|
|
128
|
-
mixins: [i18n, eventMixin],
|
|
129
|
-
props: {
|
|
130
|
-
designer: Object,
|
|
131
|
-
selectedWidget: Object,
|
|
132
|
-
optionModel: Object,
|
|
133
|
-
actionValue: String,
|
|
134
|
-
},
|
|
135
|
-
data() {
|
|
136
|
-
return {
|
|
137
|
-
optionFormCode: this.buildScriptOption("formCodeScript"),
|
|
138
|
-
optionDataId: this.buildScriptOption("dataIdScript"),
|
|
139
|
-
optionQueryParam: this.buildScriptOption("queryParamScript"),
|
|
140
|
-
optionParam: this.buildScriptOption("paramScript"),
|
|
141
|
-
optionClose: this.buildScriptOption("onCloseScript"),
|
|
142
|
-
// 脚本可用参数:dataId/formCode 由 getEventParam 统一注入,这里只列附加项
|
|
143
|
-
scriptParams: ["dataId", "formCode", "rowData"],
|
|
144
|
-
closeScriptParams: ["dataId", "formCode", "formRef", "result"],
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
computed: {
|
|
148
|
-
drawerMode() {
|
|
149
|
-
return this.actionValue === CLICK_BIND.FORM_DRAWER;
|
|
150
|
-
},
|
|
151
|
-
eventConfig() {
|
|
152
|
-
return this.optionModel.formHostConfig || {};
|
|
153
|
-
},
|
|
154
|
-
// 列表页承载时不需要新增/详情与素身设置,统一按开关处理
|
|
155
|
-
listHost: {
|
|
156
|
-
get() {
|
|
157
|
-
return this.eventConfig.host === "list";
|
|
158
|
-
},
|
|
159
|
-
set(val) {
|
|
160
|
-
this.eventConfig.host = val ? "list" : null;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
methods: {
|
|
165
|
-
buildScriptOption(key) {
|
|
166
|
-
return {
|
|
167
|
-
customCode: () => {
|
|
168
|
-
return this.eventConfig[key];
|
|
169
|
-
},
|
|
170
|
-
callback: (code) => {
|
|
171
|
-
// $set 而非直接赋值:存量模板的 formHostConfig 没有后加的字段(如 queryParamScript),
|
|
172
|
-
// 直接赋值不会变成响应式,编辑器里改完不刷新
|
|
173
|
-
this.$set(this.eventConfig, key, code);
|
|
174
|
-
this.$forceUpdate();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
</script>
|
|
181
|
-
|
|
182
|
-
<style scoped>
|
|
183
|
-
.tips {
|
|
184
|
-
margin-left: 8px;
|
|
185
|
-
color: #909399;
|
|
186
|
-
font-size: 12px;
|
|
187
|
-
}
|
|
188
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-form-item label-width="0">
|
|
4
|
+
<el-divider class="custom-divider">{{ drawerMode ? '表单抽屉配置' : '表单弹框配置' }}</el-divider>
|
|
5
|
+
</el-form-item>
|
|
6
|
+
<el-form-item class="form-item-label-top" label="表单编码">
|
|
7
|
+
<el-input type="text" v-model="eventConfig.formCode"></el-input>
|
|
8
|
+
</el-form-item>
|
|
9
|
+
<el-form-item label="表单编码脚本" label-width="150px">
|
|
10
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
11
|
+
@click="editEventHandler('formCodeScript', scriptParams, optionFormCode)">
|
|
12
|
+
<span>{{ eventConfig.formCodeScript }}</span>
|
|
13
|
+
<i class="el-icon-edit"></i>
|
|
14
|
+
</a>
|
|
15
|
+
</el-form-item>
|
|
16
|
+
<el-form-item label="以列表页承载">
|
|
17
|
+
<el-switch v-model="listHost"></el-switch>
|
|
18
|
+
<span class="tips">开启后按「常规/列表」页签的列表页打开</span>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
<el-form-item class="form-item-label-top" label="标题">
|
|
21
|
+
<el-input type="text" v-model="eventConfig.title" placeholder="缺省取表单模板名称"></el-input>
|
|
22
|
+
</el-form-item>
|
|
23
|
+
|
|
24
|
+
<template v-if="!listHost">
|
|
25
|
+
<el-form-item class="form-item-label-top" label="打开方式">
|
|
26
|
+
<el-select v-model="eventConfig.openMode">
|
|
27
|
+
<el-option value="1" label="新增"></el-option>
|
|
28
|
+
<el-option value="2" label="详情"></el-option>
|
|
29
|
+
</el-select>
|
|
30
|
+
</el-form-item>
|
|
31
|
+
<template v-if="eventConfig.openMode === '2'">
|
|
32
|
+
<el-form-item class="form-item-label-top" label="单据ID来源">
|
|
33
|
+
<el-select v-model="eventConfig.dataIdFrom">
|
|
34
|
+
<el-option value="1" label="当前控件值"></el-option>
|
|
35
|
+
<el-option value="2" label="指定表单字段"></el-option>
|
|
36
|
+
<el-option value="3" label="当前表格行字段"></el-option>
|
|
37
|
+
<el-option value="4" label="脚本"></el-option>
|
|
38
|
+
</el-select>
|
|
39
|
+
</el-form-item>
|
|
40
|
+
<el-form-item class="form-item-label-top" label="来源字段名"
|
|
41
|
+
v-if="eventConfig.dataIdFrom === '2' || eventConfig.dataIdFrom === '3'">
|
|
42
|
+
<el-input type="text" v-model="eventConfig.dataIdField"></el-input>
|
|
43
|
+
</el-form-item>
|
|
44
|
+
<el-form-item label="单据ID脚本" label-width="150px" v-if="eventConfig.dataIdFrom === '4'">
|
|
45
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
46
|
+
@click="editEventHandler('dataIdScript', scriptParams, optionDataId)">
|
|
47
|
+
<span>{{ eventConfig.dataIdScript }}</span>
|
|
48
|
+
<i class="el-icon-edit"></i>
|
|
49
|
+
</a>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
</template>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<el-form-item label="查询参数" label-width="150px" v-if="!listHost">
|
|
55
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
56
|
+
@click="editEventHandler('queryParamScript', scriptParams, optionQueryParam)">
|
|
57
|
+
<span>{{ eventConfig.queryParamScript }}</span>
|
|
58
|
+
<i class="el-icon-edit"></i>
|
|
59
|
+
</a>
|
|
60
|
+
<span class="tips">脚本返回对象合并进目标表单查询表格的请求参数;按业务字段过滤写
|
|
61
|
+
<code>return {'{'} condition: {'{'} status: 1 {'}'} {'}'}</code>(追加进查询区条件,同字段以脚本为准)</span>
|
|
62
|
+
</el-form-item>
|
|
63
|
+
<el-form-item label="自定义参数" label-width="150px">
|
|
64
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
65
|
+
@click="editEventHandler('paramScript', scriptParams, optionParam)">
|
|
66
|
+
<span>{{ eventConfig.paramScript }}</span>
|
|
67
|
+
<i class="el-icon-edit"></i>
|
|
68
|
+
</a>
|
|
69
|
+
<span class="tips">脚本返回对象 → 目标表单的 param,只给模板脚本用,不参与请求</span>
|
|
70
|
+
</el-form-item>
|
|
71
|
+
<el-form-item label="只读">
|
|
72
|
+
<el-switch v-model="eventConfig.readonly"></el-switch>
|
|
73
|
+
<span class="tips">{{ drawerMode ? '只读态渲染,底部仅保留「关闭」' : '整表禁用,底部按钮不变' }}</span>
|
|
74
|
+
</el-form-item>
|
|
75
|
+
<el-form-item label="显示底部按钮">
|
|
76
|
+
<el-switch v-model="eventConfig.showFooter"></el-switch>
|
|
77
|
+
<span class="tips">按钮由目标表单的「表单操作按钮」决定</span>
|
|
78
|
+
</el-form-item>
|
|
79
|
+
|
|
80
|
+
<!-- 形态字段:弹框/抽屉各一组 -->
|
|
81
|
+
<template v-if="drawerMode">
|
|
82
|
+
<el-form-item label="素身详情">
|
|
83
|
+
<el-switch v-model="eventConfig.plain"></el-switch>
|
|
84
|
+
<span class="tips">不渲染详情标题栏与模块导航</span>
|
|
85
|
+
</el-form-item>
|
|
86
|
+
<el-form-item class="form-item-label-top" label="抽屉尺寸">
|
|
87
|
+
<el-input type="text" v-model="eventConfig.drawerSize" placeholder="缺省 62%,列表页 85%"></el-input>
|
|
88
|
+
</el-form-item>
|
|
89
|
+
<el-form-item class="form-item-label-top" label="弹出方向">
|
|
90
|
+
<el-select v-model="eventConfig.drawerDirection" clearable placeholder="缺省 右侧滑出">
|
|
91
|
+
<el-option value="rtl" label="右侧滑出"></el-option>
|
|
92
|
+
<el-option value="ltr" label="左侧滑出"></el-option>
|
|
93
|
+
<el-option value="ttb" label="顶部滑出"></el-option>
|
|
94
|
+
<el-option value="btt" label="底部滑出"></el-option>
|
|
95
|
+
</el-select>
|
|
96
|
+
</el-form-item>
|
|
97
|
+
</template>
|
|
98
|
+
<template v-else>
|
|
99
|
+
<el-form-item class="form-item-label-top" label="弹框宽度">
|
|
100
|
+
<el-input type="text" v-model="eventConfig.dialogWidth" placeholder="缺省 1200px"></el-input>
|
|
101
|
+
</el-form-item>
|
|
102
|
+
<el-form-item label="全屏">
|
|
103
|
+
<el-switch v-model="eventConfig.fullscreen"></el-switch>
|
|
104
|
+
</el-form-item>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<el-form-item label="关闭后事件" label-width="150px">
|
|
108
|
+
<a href="javascript:void(0);" class="a-link link-oneLind"
|
|
109
|
+
@click="editEventHandler('onCloseScript', closeScriptParams, optionClose)">
|
|
110
|
+
<span>{{ eventConfig.onCloseScript }}</span>
|
|
111
|
+
<i class="el-icon-edit"></i>
|
|
112
|
+
</a>
|
|
113
|
+
</el-form-item>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<script>
|
|
118
|
+
import i18n from "../../../../../../components/xform/utils/i18n"
|
|
119
|
+
import eventMixin
|
|
120
|
+
from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin"
|
|
121
|
+
import {CLICK_BIND} from "./clickBindActions";
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 「打开表单弹框 / 打开表单抽屉」共用配置编辑器(optionModel.formHostConfig)。
|
|
125
|
+
* 两个动作共用一份配置,形态字段按 actionValue 切换,弹框/抽屉互切时配置不丢。
|
|
126
|
+
*/
|
|
127
|
+
export default {
|
|
128
|
+
mixins: [i18n, eventMixin],
|
|
129
|
+
props: {
|
|
130
|
+
designer: Object,
|
|
131
|
+
selectedWidget: Object,
|
|
132
|
+
optionModel: Object,
|
|
133
|
+
actionValue: String,
|
|
134
|
+
},
|
|
135
|
+
data() {
|
|
136
|
+
return {
|
|
137
|
+
optionFormCode: this.buildScriptOption("formCodeScript"),
|
|
138
|
+
optionDataId: this.buildScriptOption("dataIdScript"),
|
|
139
|
+
optionQueryParam: this.buildScriptOption("queryParamScript"),
|
|
140
|
+
optionParam: this.buildScriptOption("paramScript"),
|
|
141
|
+
optionClose: this.buildScriptOption("onCloseScript"),
|
|
142
|
+
// 脚本可用参数:dataId/formCode 由 getEventParam 统一注入,这里只列附加项
|
|
143
|
+
scriptParams: ["dataId", "formCode", "rowData"],
|
|
144
|
+
closeScriptParams: ["dataId", "formCode", "formRef", "result"],
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
computed: {
|
|
148
|
+
drawerMode() {
|
|
149
|
+
return this.actionValue === CLICK_BIND.FORM_DRAWER;
|
|
150
|
+
},
|
|
151
|
+
eventConfig() {
|
|
152
|
+
return this.optionModel.formHostConfig || {};
|
|
153
|
+
},
|
|
154
|
+
// 列表页承载时不需要新增/详情与素身设置,统一按开关处理
|
|
155
|
+
listHost: {
|
|
156
|
+
get() {
|
|
157
|
+
return this.eventConfig.host === "list";
|
|
158
|
+
},
|
|
159
|
+
set(val) {
|
|
160
|
+
this.eventConfig.host = val ? "list" : null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
methods: {
|
|
165
|
+
buildScriptOption(key) {
|
|
166
|
+
return {
|
|
167
|
+
customCode: () => {
|
|
168
|
+
return this.eventConfig[key];
|
|
169
|
+
},
|
|
170
|
+
callback: (code) => {
|
|
171
|
+
// $set 而非直接赋值:存量模板的 formHostConfig 没有后加的字段(如 queryParamScript),
|
|
172
|
+
// 直接赋值不会变成响应式,编辑器里改完不刷新
|
|
173
|
+
this.$set(this.eventConfig, key, code);
|
|
174
|
+
this.$forceUpdate();
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</script>
|
|
181
|
+
|
|
182
|
+
<style scoped>
|
|
183
|
+
.tips {
|
|
184
|
+
margin-left: 8px;
|
|
185
|
+
color: #909399;
|
|
186
|
+
font-size: 12px;
|
|
187
|
+
}
|
|
188
|
+
</style>
|