cloud-web-corejs 1.0.94 → 1.0.95
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 +39 -30
- package/src/components/wf/content.vue +2 -0
- package/src/components/wf/setCandidateDialog.vue +1 -0
- package/src/components/xform/form-designer/designer.js +1 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +2 -1
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +3 -0
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +77 -0
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +106 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +7 -2
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +176 -0
- package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +5 -2
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +2 -1
- package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +3 -2
- package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +2 -170
- package/src/components/xform/form-designer/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +260 -38
- package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +8 -3
- 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/container-data-table/columnRenderDialog.vue +3 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +0 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +111 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +0 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +26 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +7 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +8 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +47 -28
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +13 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +722 -467
- package/src/components/xform/form-designer/setting-panel/property-editor/formulaEnabled-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +19 -14
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +159 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +51 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +2 -30
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +220 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +5 -0
- package/src/components/xform/form-designer/toolbar-panel/index.vue +8 -4
- package/src/components/xform/form-designer/widget-panel/index.vue +21 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +3 -2
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +489 -132
- package/src/components/xform/form-render/container-item/data-table-item.vue +7 -4
- package/src/components/xform/form-render/container-item/data-table-mixin.js +4 -1
- package/src/components/xform/form-render/container-item/data-table-mixin2.js +2169 -0
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1 -9
- package/src/components/xform/form-render/container-item/list-h5-item2.vue +1 -8
- package/src/components/xform/form-render/indexMixin.js +7 -3
- package/src/components/xform/lang/zh-CN.js +13 -3
- package/src/components/xform/mixins/defaultHandle.js +1 -1
- package/src/components/xform/mixins/scriptHttp.js +1 -1
- package/src/components/xform/utils/format.js +21 -30
- package/src/components/xform/utils/formula-util.js +669 -0
- package/src/components/xform/utils/util.js +1 -1
- package/src/mixins/selectDialog/index.js +1 -1
- package/src/store/modules/permission.js +1 -1
- package/src/store/modules/settings.js +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import FormItemWrapper from '@base/components/xform/form-designer/form-widget/field-widget/form-item-wrapper'
|
|
2
|
+
import emitter from '@base/components/xform/utils/emitter'
|
|
3
|
+
import i18n from "@base/components/xform/utils/i18n";
|
|
4
|
+
import {deepClone} from "@base/components/xform/utils/util";
|
|
5
|
+
import fieldMixin from "@base/components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
9
|
+
props: {
|
|
10
|
+
field: Object,
|
|
11
|
+
parentWidget: Object,
|
|
12
|
+
parentList: Array,
|
|
13
|
+
indexOfParentList: Number,
|
|
14
|
+
designer: Object,
|
|
15
|
+
|
|
16
|
+
designState: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
columnConfig: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: null
|
|
23
|
+
},
|
|
24
|
+
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
|
25
|
+
type: Number,
|
|
26
|
+
default: -1
|
|
27
|
+
},
|
|
28
|
+
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
|
29
|
+
type: Number,
|
|
30
|
+
default: -1
|
|
31
|
+
},
|
|
32
|
+
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
components: {
|
|
38
|
+
FormItemWrapper
|
|
39
|
+
},
|
|
40
|
+
data() {
|
|
41
|
+
let multipleChoices = this.field.options.multipleChoices || false;
|
|
42
|
+
let defaultValue = !multipleChoices ? null : [];
|
|
43
|
+
return {
|
|
44
|
+
oldFieldValue: defaultValue, //field组件change之前的值
|
|
45
|
+
fieldModel: defaultValue,
|
|
46
|
+
showValue2: null,
|
|
47
|
+
rules: [],
|
|
48
|
+
showSearchialog: false,
|
|
49
|
+
dialogContent: null,
|
|
50
|
+
showSysSearchialog: false,
|
|
51
|
+
systemDialogParam: {},
|
|
52
|
+
showVformDialog: false,
|
|
53
|
+
code: null,
|
|
54
|
+
formDialogOption: {}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
fieldModel(val) {
|
|
59
|
+
this.handleChangeEvent(val);
|
|
60
|
+
},
|
|
61
|
+
showValue(val) {
|
|
62
|
+
this.setShowValue(val);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
computed: {
|
|
66
|
+
showValue() {
|
|
67
|
+
let currentData = this.currentData;
|
|
68
|
+
let fieldKeyName = this.fieldKeyName;
|
|
69
|
+
let vabSearchName = this.field.options.vabSearchName;
|
|
70
|
+
let multipleChoices = this.field.options.multipleChoices || false;
|
|
71
|
+
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
72
|
+
let value = null;
|
|
73
|
+
if (!multipleChoices) {
|
|
74
|
+
value = currentData[labelField] ?? null;
|
|
75
|
+
} else {
|
|
76
|
+
if (this.fieldModel) {
|
|
77
|
+
value = this.fieldModel.map(item => item[labelField]).join(",");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
this.showValue2 = value;
|
|
81
|
+
return value
|
|
82
|
+
},
|
|
83
|
+
tableRow() {
|
|
84
|
+
let tableParam = this.tableParam;
|
|
85
|
+
return tableParam && tableParam.row ? tableParam.row : null;
|
|
86
|
+
},
|
|
87
|
+
currentData() {
|
|
88
|
+
let tableParam = this.tableParam;
|
|
89
|
+
return tableParam && tableParam.row ? tableParam.row : this.formModel;
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
beforeCreate() {
|
|
93
|
+
/* 这里不能访问方法和属性!! */
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
created() {
|
|
97
|
+
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
|
98
|
+
需要在父组件created中初始化!! */
|
|
99
|
+
if (this.field.options.readonly == undefined) {
|
|
100
|
+
this.$set(this.field.options, "readonly", true);
|
|
101
|
+
}
|
|
102
|
+
this.initFieldModel()
|
|
103
|
+
this.registerToRefList()
|
|
104
|
+
this.initEventHandler()
|
|
105
|
+
this.buildFieldRules()
|
|
106
|
+
|
|
107
|
+
this.handleOnCreated()
|
|
108
|
+
// this.initValue();
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
mounted() {
|
|
112
|
+
this.handleOnMounted()
|
|
113
|
+
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
beforeDestroy() {
|
|
117
|
+
this.unregisterFromRefList()
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
setShowValue(val = null) {
|
|
121
|
+
let multipleChoices = this.field.options.multipleChoices || false;
|
|
122
|
+
if (!multipleChoices) {
|
|
123
|
+
let fieldKeyName = this.fieldKeyName;
|
|
124
|
+
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
125
|
+
// this.$set(this.currentData, labelField, val)
|
|
126
|
+
|
|
127
|
+
this.currentData[labelField] = val
|
|
128
|
+
this.showValue2 = val;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
setValue: function (e) {
|
|
132
|
+
if (this.field.formItemFlag) {
|
|
133
|
+
let data = this.tableRow || this.formModel;
|
|
134
|
+
var t = deepClone(this.fieldModel);
|
|
135
|
+
this.fieldModel = e,
|
|
136
|
+
this.initFileList(),
|
|
137
|
+
this.syncUpdateFormModel(e),
|
|
138
|
+
this.emitFieldDataChange(e, t);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
clearHandle() {
|
|
142
|
+
let multipleChoices = this.field.options.multipleChoices || false;
|
|
143
|
+
let defaultValue = !multipleChoices ? null : [];
|
|
144
|
+
this.setShowValue(null)
|
|
145
|
+
this.setValue(defaultValue)
|
|
146
|
+
if (this.field.options.onSearchClear) {
|
|
147
|
+
let tableParam = this.tableParam;
|
|
148
|
+
let eventParamNames = [];
|
|
149
|
+
let eventParamValues = [];
|
|
150
|
+
if (tableParam) {
|
|
151
|
+
eventParamNames = ['rowData', 'rowIndex'];
|
|
152
|
+
eventParamValues = [tableParam.row, tableParam.rowIndex];
|
|
153
|
+
}
|
|
154
|
+
this.handleCustomEvent(this.field.options.onSearchClear, eventParamNames, eventParamValues)
|
|
155
|
+
|
|
156
|
+
/* var e = new Function(this.field.options.onSearchClear);
|
|
157
|
+
e.call(this);*/
|
|
158
|
+
}
|
|
159
|
+
this.handleClearSearchDialog();
|
|
160
|
+
},
|
|
161
|
+
changeShowValue2(val) {
|
|
162
|
+
if (this.field.options.readonly === false) {
|
|
163
|
+
let multipleChoices = this.field.options.multipleChoices || false;
|
|
164
|
+
if (!multipleChoices) {
|
|
165
|
+
let fieldKeyName = this.fieldKeyName;
|
|
166
|
+
let vabSearchName = this.field.options.vabSearchName;
|
|
167
|
+
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
168
|
+
this.currentData[labelField] = val;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
fieldModelLabel() {
|
|
173
|
+
return this.showValue;
|
|
174
|
+
},
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
|
+
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
|
+
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
5
|
+
:sub-form-row-id="subFormRowId">
|
|
6
|
+
<el-input
|
|
7
|
+
class="search-input"
|
|
8
|
+
max="200"
|
|
9
|
+
v-model="showValue2"
|
|
10
|
+
@clear="clearHandle"
|
|
11
|
+
v-el-readonly="field.options.readonly"
|
|
12
|
+
clearable
|
|
13
|
+
:disabled="field.options.disabled"
|
|
14
|
+
@change="changeShowValue2"
|
|
15
|
+
>
|
|
16
|
+
<i slot="suffix" class="el-input__icon el-icon-search" @click="emitAppendButtonClick"></i>
|
|
17
|
+
<span v-show="false">{{ showValue }}</span>
|
|
18
|
+
</el-input>
|
|
19
|
+
</form-item-wrapper>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import mixins from "@base/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: "multiSearch-widget",
|
|
27
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
28
|
+
mixins: [mixins],
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
@import "~@/styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
|
|
34
|
+
|
|
35
|
+
.full-width-input {
|
|
36
|
+
width: 100% !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.hideUploadDiv {
|
|
40
|
+
::v-deep div.el-upload--picture-card { /* 隐藏最后的图片上传按钮 */
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
::v-deep div.el-upload--text { /* 隐藏最后的文件上传按钮 */
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
::v-deep div.el-upload__tip { /* 隐藏最后的文件上传按钮提示 */
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
</style>
|
|
@@ -152,10 +152,13 @@ export default {
|
|
|
152
152
|
[tagFormLabelField]: item[tagLabelField] ?? null,
|
|
153
153
|
}
|
|
154
154
|
})*/
|
|
155
|
-
let
|
|
155
|
+
let queryParam = null;
|
|
156
|
+
if (this.field.options.tagFormParam) {
|
|
157
|
+
queryParam = this.handleCustomEvent(this.field.options.tagFormParam)
|
|
158
|
+
}
|
|
156
159
|
this.getFormRef().openSearchDialog({
|
|
157
160
|
formCode,
|
|
158
|
-
|
|
161
|
+
queryParam,
|
|
159
162
|
// rows: checkRows,
|
|
160
163
|
multiple: true,
|
|
161
164
|
confirm: (rows) => {
|
package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:index-of-parent-list="indexOfParentList"
|
|
6
6
|
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
7
7
|
:sub-form-row-id="subFormRowId">
|
|
8
|
-
<el-button class="button-sty" @click="handleButtonWidgetClick" icon="el-icon-search">
|
|
8
|
+
<el-button class="button-sty" @click="handleButtonWidgetClick" icon="el-icon-search" :disabled="!designState &&field.options.disabled">
|
|
9
9
|
{{ field.options.label }}
|
|
10
10
|
</el-button>
|
|
11
11
|
</static-content-wrapper>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:default-first-option="allowDefaultFirstOption"
|
|
13
13
|
:automatic-dropdown="field.options.automaticDropdown"
|
|
14
14
|
:multiple="field.options.multiple" :multiple-limit="field.options.multipleLimit"
|
|
15
|
+
:collapse-tags="!field.options.flatCollapseTags"
|
|
15
16
|
:placeholder="getI18nLabel(field.options.placeholder || '请选择')"
|
|
16
17
|
:remote="field.options.remote" :remote-method="remoteQuery"
|
|
17
18
|
@focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
|
|
@@ -108,7 +109,7 @@ export default {
|
|
|
108
109
|
this.buildFieldRules()
|
|
109
110
|
|
|
110
111
|
this.handleOnCreated()
|
|
111
|
-
this.
|
|
112
|
+
this.initOptionItemsHandle()
|
|
112
113
|
},
|
|
113
114
|
|
|
114
115
|
mounted() {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form-item-wrapper :designer="designer" :field="field" :rules="rules" :design-state="designState"
|
|
3
|
+
:parent-widget="parentWidget" :parent-list="parentList" :index-of-parent-list="indexOfParentList"
|
|
4
|
+
:sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
|
|
5
|
+
:sub-form-row-id="subFormRowId">
|
|
6
|
+
<el-input
|
|
7
|
+
class="search-input"
|
|
8
|
+
max="200"
|
|
9
|
+
v-model="showValue2"
|
|
10
|
+
@clear="clearHandle"
|
|
11
|
+
v-el-readonly="field.options.readonly"
|
|
12
|
+
clearable
|
|
13
|
+
:disabled="field.options.disabled"
|
|
14
|
+
@change="changeShowValue2"
|
|
15
|
+
>
|
|
16
|
+
<i slot="suffix" class="el-input__icon el-icon-search" @click="emitAppendButtonClick"></i>
|
|
17
|
+
<span v-show="false">{{ showValue }}</span>
|
|
18
|
+
</el-input>
|
|
19
|
+
</form-item-wrapper>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import mixins from "@base/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: "singerSearch-widget",
|
|
27
|
+
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
28
|
+
mixins: [mixins],
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
@import "~@/styles/global.scss"; //* form-item-wrapper已引入,还需要重复引入吗? *//
|
|
34
|
+
|
|
35
|
+
.full-width-input {
|
|
36
|
+
width: 100% !important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.hideUploadDiv {
|
|
40
|
+
::v-deep div.el-upload--picture-card { /* 隐藏最后的图片上传按钮 */
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
::v-deep div.el-upload--text { /* 隐藏最后的文件上传按钮 */
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
::v-deep div.el-upload__tip { /* 隐藏最后的文件上传按钮提示 */
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
</style>
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import emitter from '../../../../../components/xform/utils/emitter'
|
|
13
13
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
14
14
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
15
|
-
import FormItemWrapper
|
|
15
|
+
import FormItemWrapper
|
|
16
|
+
from "../../../../../components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue";
|
|
16
17
|
|
|
17
18
|
export default {
|
|
18
19
|
name: "status-widget",
|
|
@@ -104,7 +105,7 @@ export default {
|
|
|
104
105
|
let value = null;
|
|
105
106
|
let statusParam = this.field.options.statusParam;
|
|
106
107
|
if (statusParam.length) {
|
|
107
|
-
value = statusParam[0].value ?? 0
|
|
108
|
+
value = this.field.options.defaultValue ?? (statusParam[0].value ?? 0)
|
|
108
109
|
} else {
|
|
109
110
|
value = 0;
|
|
110
111
|
}
|
|
@@ -20,180 +20,12 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script>
|
|
23
|
-
import
|
|
24
|
-
import emitter from '../../../../../components/xform/utils/emitter'
|
|
25
|
-
import i18n from "../../../../../components/xform/utils/i18n";
|
|
26
|
-
import {deepClone} from "../../../../../components/xform/utils/util";
|
|
27
|
-
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
23
|
+
import mixins from "@base/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin";
|
|
28
24
|
|
|
29
25
|
export default {
|
|
30
26
|
name: "vabsearch-widget",
|
|
31
27
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
32
|
-
mixins: [
|
|
33
|
-
props: {
|
|
34
|
-
field: Object,
|
|
35
|
-
parentWidget: Object,
|
|
36
|
-
parentList: Array,
|
|
37
|
-
indexOfParentList: Number,
|
|
38
|
-
designer: Object,
|
|
39
|
-
|
|
40
|
-
designState: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
columnConfig: {
|
|
45
|
-
type: Object,
|
|
46
|
-
default: null
|
|
47
|
-
},
|
|
48
|
-
subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
|
|
49
|
-
type: Number,
|
|
50
|
-
default: -1
|
|
51
|
-
},
|
|
52
|
-
subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
|
|
53
|
-
type: Number,
|
|
54
|
-
default: -1
|
|
55
|
-
},
|
|
56
|
-
subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
|
|
57
|
-
type: String,
|
|
58
|
-
default: ''
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
components: {
|
|
62
|
-
FormItemWrapper
|
|
63
|
-
},
|
|
64
|
-
data() {
|
|
65
|
-
let multipleChoices = this.field.options.multipleChoices || false;
|
|
66
|
-
let defaultValue = !multipleChoices ? null : [];
|
|
67
|
-
return {
|
|
68
|
-
oldFieldValue: defaultValue, //field组件change之前的值
|
|
69
|
-
fieldModel: defaultValue,
|
|
70
|
-
showValue2: null,
|
|
71
|
-
rules: [],
|
|
72
|
-
showSearchialog: false,
|
|
73
|
-
dialogContent: null,
|
|
74
|
-
showSysSearchialog: false,
|
|
75
|
-
systemDialogParam: {},
|
|
76
|
-
showVformDialog: false,
|
|
77
|
-
code: null,
|
|
78
|
-
formDialogOption: {}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
watch: {
|
|
82
|
-
fieldModel(val) {
|
|
83
|
-
this.handleChangeEvent(val);
|
|
84
|
-
},
|
|
85
|
-
showValue(val) {
|
|
86
|
-
this.setShowValue(val);
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
computed: {
|
|
90
|
-
showValue() {
|
|
91
|
-
let currentData = this.currentData;
|
|
92
|
-
let fieldKeyName = this.fieldKeyName;
|
|
93
|
-
let vabSearchName = this.field.options.vabSearchName;
|
|
94
|
-
let multipleChoices = this.field.options.multipleChoices || false;
|
|
95
|
-
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
96
|
-
let value = null;
|
|
97
|
-
if (!multipleChoices) {
|
|
98
|
-
value = currentData[labelField] ?? null;
|
|
99
|
-
} else {
|
|
100
|
-
if (this.fieldModel) {
|
|
101
|
-
value = this.fieldModel.map(item => item[labelField]).join(",");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
this.showValue2 = value;
|
|
105
|
-
return value
|
|
106
|
-
},
|
|
107
|
-
tableRow() {
|
|
108
|
-
let tableParam = this.tableParam;
|
|
109
|
-
return tableParam && tableParam.row ? tableParam.row : null;
|
|
110
|
-
},
|
|
111
|
-
currentData() {
|
|
112
|
-
let tableParam = this.tableParam;
|
|
113
|
-
return tableParam && tableParam.row ? tableParam.row : this.formModel;
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
beforeCreate() {
|
|
117
|
-
/* 这里不能访问方法和属性!! */
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
created() {
|
|
121
|
-
/* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
|
|
122
|
-
需要在父组件created中初始化!! */
|
|
123
|
-
if (this.field.options.readonly == undefined) {
|
|
124
|
-
this.$set(this.field.options, "readonly", true);
|
|
125
|
-
}
|
|
126
|
-
this.initFieldModel()
|
|
127
|
-
this.registerToRefList()
|
|
128
|
-
this.initEventHandler()
|
|
129
|
-
this.buildFieldRules()
|
|
130
|
-
|
|
131
|
-
this.handleOnCreated()
|
|
132
|
-
// this.initValue();
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
mounted() {
|
|
136
|
-
this.handleOnMounted()
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
beforeDestroy() {
|
|
141
|
-
this.unregisterFromRefList()
|
|
142
|
-
},
|
|
143
|
-
methods: {
|
|
144
|
-
setShowValue(val = null) {
|
|
145
|
-
let multipleChoices = this.field.options.multipleChoices || false;
|
|
146
|
-
if (!multipleChoices) {
|
|
147
|
-
let fieldKeyName = this.fieldKeyName;
|
|
148
|
-
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
149
|
-
// this.$set(this.currentData, labelField, val)
|
|
150
|
-
|
|
151
|
-
this.currentData[labelField] = val
|
|
152
|
-
this.showValue2 = val;
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
setValue: function (e) {
|
|
156
|
-
if (this.field.formItemFlag) {
|
|
157
|
-
let data = this.tableRow || this.formModel;
|
|
158
|
-
var t = deepClone(this.fieldModel);
|
|
159
|
-
this.fieldModel = e,
|
|
160
|
-
this.initFileList(),
|
|
161
|
-
this.syncUpdateFormModel(e),
|
|
162
|
-
this.emitFieldDataChange(e, t);
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
clearHandle() {
|
|
166
|
-
let multipleChoices = this.field.options.multipleChoices || false;
|
|
167
|
-
let defaultValue = !multipleChoices ? null : [];
|
|
168
|
-
this.setShowValue(null)
|
|
169
|
-
this.setValue(defaultValue)
|
|
170
|
-
if (this.field.options.onSearchClear) {
|
|
171
|
-
let tableParam = this.tableParam;
|
|
172
|
-
let eventParamNames = [];
|
|
173
|
-
let eventParamValues = [];
|
|
174
|
-
if (tableParam) {
|
|
175
|
-
eventParamNames = ['rowData', 'rowIndex'];
|
|
176
|
-
eventParamValues = [tableParam.row, tableParam.rowIndex];
|
|
177
|
-
}
|
|
178
|
-
this.handleCustomEvent(this.field.options.onSearchClear, eventParamNames, eventParamValues)
|
|
179
|
-
|
|
180
|
-
/* var e = new Function(this.field.options.onSearchClear);
|
|
181
|
-
e.call(this);*/
|
|
182
|
-
}
|
|
183
|
-
this.handleClearSearchDialog();
|
|
184
|
-
},
|
|
185
|
-
changeShowValue2(val) {
|
|
186
|
-
if (this.field.options.readonly === false) {
|
|
187
|
-
let multipleChoices = this.field.options.multipleChoices || false;
|
|
188
|
-
if (!multipleChoices) {
|
|
189
|
-
let fieldKeyName = this.fieldKeyName;
|
|
190
|
-
let vabSearchName = this.field.options.vabSearchName;
|
|
191
|
-
let labelField = this.field.options.vabSearchName || fieldKeyName;
|
|
192
|
-
this.currentData[labelField] = val;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
28
|
+
mixins: [mixins],
|
|
197
29
|
}
|
|
198
30
|
</script>
|
|
199
31
|
|