vue2-client 1.8.436 → 1.8.438
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 +1 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +18 -8
- package/src/base-client/components/common/XForm/XFormItem.vue +28 -8
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +1 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +2 -1
- package/src/router/async/router.map.js +2 -1
package/package.json
CHANGED
|
@@ -201,20 +201,21 @@ export default {
|
|
|
201
201
|
methods: {
|
|
202
202
|
init (params) {
|
|
203
203
|
const {
|
|
204
|
-
configName, configContent, formItems, viewMode, isHandleFormKey = true,
|
|
204
|
+
configName, configContent, formItems, formJson, viewMode, isHandleFormKey = true,
|
|
205
205
|
showSubmitBtn = true, serviceName, isTableTemp = false, isKeyHandle = true,
|
|
206
206
|
modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {},
|
|
207
|
-
simpleFormJsonData = {}, env = 'prod', layout = 'horizontal'
|
|
207
|
+
simpleFormJsonData = {}, env = 'prod', layout, xAddFormLayout = 'horizontal'
|
|
208
208
|
} = params
|
|
209
209
|
this.loaded = false
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (typeof formItems === 'string') {
|
|
214
|
-
this.formItems = JSON.parse(formItems)
|
|
210
|
+
// 兼容需要省略 传递 layout: res.xAddFormLayout 可以使用 ...res 展开运算符 直接转递
|
|
211
|
+
if (xAddFormLayout && !layout) {
|
|
212
|
+
this.layout = xAddFormLayout
|
|
215
213
|
} else {
|
|
216
|
-
this.
|
|
214
|
+
this.layout = layout
|
|
217
215
|
}
|
|
216
|
+
this.configName = configName
|
|
217
|
+
this.configContent = configContent
|
|
218
|
+
this.formItems = this.getFromItem(formItems, formJson)
|
|
218
219
|
this.viewMode = viewMode
|
|
219
220
|
this.isHandleFormKey = isHandleFormKey
|
|
220
221
|
this.showSubmitBtn = showSubmitBtn
|
|
@@ -266,6 +267,15 @@ export default {
|
|
|
266
267
|
}
|
|
267
268
|
this.loaded = true
|
|
268
269
|
},
|
|
270
|
+
// 兼容需要省略 传递 [formItems: res.formJson ] 可以使用 ...res 展开运算符 直接转递
|
|
271
|
+
getFromItem (formItems, formJson) {
|
|
272
|
+
const _formItems = formItems || formJson
|
|
273
|
+
if (typeof formItems === 'string') {
|
|
274
|
+
this.formItems = JSON.parse(_formItems)
|
|
275
|
+
} else {
|
|
276
|
+
this.formItems = JSON.parse(JSON.stringify(_formItems))
|
|
277
|
+
}
|
|
278
|
+
},
|
|
269
279
|
// 时间组件赋默认值
|
|
270
280
|
getDateRange (type, defaultValue) {
|
|
271
281
|
// const format = type === 'datePicker' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
:disabled="disabled && !readOnly"
|
|
22
22
|
:whitespace="true"
|
|
23
23
|
style="flex: 1; width: auto; min-width: 0;"
|
|
24
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
24
25
|
:suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
|
|
25
26
|
@blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
|
|
26
27
|
:placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
|
|
78
79
|
v-model="form[attr.model]"
|
|
79
80
|
:disabled="disabled"
|
|
81
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
80
82
|
:filter-option="filterOption"
|
|
81
83
|
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
|
82
84
|
:placeholder="attr.placeholder ? attr.placeholder : '请选择'"
|
|
@@ -139,6 +141,7 @@
|
|
|
139
141
|
v-else
|
|
140
142
|
v-model="form[attr.model]"
|
|
141
143
|
:disabled="disabled"
|
|
144
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
142
145
|
:filter-option="filterOption"
|
|
143
146
|
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
|
144
147
|
:placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
|
|
@@ -174,6 +177,7 @@
|
|
|
174
177
|
:filter-option="filterOption"
|
|
175
178
|
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
|
176
179
|
:placeholder="attr.placeholder ? attr.placeholder : '请选择'"
|
|
180
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
177
181
|
mode="multiple"
|
|
178
182
|
show-search
|
|
179
183
|
allowClear
|
|
@@ -213,6 +217,7 @@
|
|
|
213
217
|
:getPopupContainer=" triggerNode => { return triggerNode.parentNode } "
|
|
214
218
|
:placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
|
|
215
219
|
mode="multiple"
|
|
220
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
216
221
|
show-search
|
|
217
222
|
allowClear
|
|
218
223
|
@search="fetchFunction"
|
|
@@ -234,7 +239,10 @@
|
|
|
234
239
|
:ref="attr.model"
|
|
235
240
|
:label="attr.name"
|
|
236
241
|
:prop="attr.prop ? attr.prop : attr.model">
|
|
237
|
-
<a-radio-group
|
|
242
|
+
<a-radio-group
|
|
243
|
+
v-model="form[attr.model]"
|
|
244
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
245
|
+
>
|
|
238
246
|
<template v-if="attr.keys">
|
|
239
247
|
<a-radio v-for="(item,index) in attr.keys" :key="index" :value="item.value">
|
|
240
248
|
{{ item.label }}
|
|
@@ -263,6 +271,7 @@
|
|
|
263
271
|
:flex="attr.flex">
|
|
264
272
|
<a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
|
|
265
273
|
<a-date-picker
|
|
274
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
266
275
|
v-if="mode === '新增/修改'"
|
|
267
276
|
v-model="form[attr.model]"
|
|
268
277
|
:disabled="disabled"
|
|
@@ -271,6 +280,7 @@
|
|
|
271
280
|
valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
|
272
281
|
<a-range-picker
|
|
273
282
|
v-else
|
|
283
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
274
284
|
v-model="form[attr.model]"
|
|
275
285
|
:disabled="disabled"
|
|
276
286
|
:show-time="true"
|
|
@@ -285,6 +295,7 @@
|
|
|
285
295
|
:flex="attr.flex">
|
|
286
296
|
<a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
|
|
287
297
|
<a-month-picker
|
|
298
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
288
299
|
v-model="form[attr.model]"
|
|
289
300
|
:disabled="disabled"
|
|
290
301
|
:show-time="true"
|
|
@@ -299,6 +310,7 @@
|
|
|
299
310
|
:flex="attr.flex">
|
|
300
311
|
<a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
|
|
301
312
|
<a-date-picker
|
|
313
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
302
314
|
v-model="form[attr.model]"
|
|
303
315
|
:disabled="disabled"
|
|
304
316
|
format="YYYY"
|
|
@@ -317,6 +329,7 @@
|
|
|
317
329
|
:flex="attr.flex">
|
|
318
330
|
<a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
|
|
319
331
|
<a-range-picker
|
|
332
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
320
333
|
v-if="mode === '查询' && attr.queryType === 'BETWEEN' "
|
|
321
334
|
v-model="form[attr.model]"
|
|
322
335
|
:disabled="disabled"
|
|
@@ -325,6 +338,7 @@
|
|
|
325
338
|
format="YYYY-MM-DD"
|
|
326
339
|
valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
|
327
340
|
<a-date-picker
|
|
341
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
328
342
|
v-else-if="mode === '查询'"
|
|
329
343
|
v-model="form[attr.model]"
|
|
330
344
|
:disabled="disabled"
|
|
@@ -332,6 +346,7 @@
|
|
|
332
346
|
valueFormat="YYYY-MM-DD"/>
|
|
333
347
|
<a-date-picker
|
|
334
348
|
v-else
|
|
349
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
335
350
|
v-model="form[attr.model]"
|
|
336
351
|
:disabled="disabled"
|
|
337
352
|
style="width: 100%;"
|
|
@@ -394,6 +409,7 @@
|
|
|
394
409
|
:flex="attr.flex">
|
|
395
410
|
<a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.prop ? attr.prop : attr.model">
|
|
396
411
|
<citySelect
|
|
412
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
397
413
|
ref="citySelect"
|
|
398
414
|
v-model="form[attr.model]"
|
|
399
415
|
:contexts="attr.contexts"
|
|
@@ -446,6 +462,7 @@
|
|
|
446
462
|
v-else-if="attr.type === 'treeSelect' && show"
|
|
447
463
|
:flex="attr.flex">
|
|
448
464
|
<x-tree-select
|
|
465
|
+
@onChange="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
449
466
|
v-model="form[attr.model]"
|
|
450
467
|
:attr="attr"
|
|
451
468
|
ref="xTreeSelect">
|
|
@@ -459,7 +476,10 @@
|
|
|
459
476
|
:ref="attr.model"
|
|
460
477
|
:label="attr.name"
|
|
461
478
|
:prop="attr.prop ? attr.prop : attr.model">
|
|
462
|
-
<a-rate
|
|
479
|
+
<a-rate
|
|
480
|
+
v-model="form[attr.model]"
|
|
481
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
482
|
+
/>
|
|
463
483
|
</a-form-model-item>
|
|
464
484
|
</x-form-col>
|
|
465
485
|
<!-- 区间选择器 -->
|
|
@@ -518,7 +538,11 @@
|
|
|
518
538
|
@blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
|
|
519
539
|
:placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
|
|
520
540
|
:ref="`${attr.model}input`"/>
|
|
521
|
-
<x-license-plate
|
|
541
|
+
<x-license-plate
|
|
542
|
+
v-else
|
|
543
|
+
v-model="form[attr.model]"
|
|
544
|
+
@change="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
545
|
+
></x-license-plate>
|
|
522
546
|
</a-form-model-item>
|
|
523
547
|
</x-form-col>
|
|
524
548
|
</template>
|
|
@@ -706,15 +730,11 @@ export default {
|
|
|
706
730
|
deep: true
|
|
707
731
|
},
|
|
708
732
|
form: {
|
|
709
|
-
handler (newVal) {
|
|
733
|
+
handler (newVal, oldVal) {
|
|
710
734
|
// 如果是从函数获取 options
|
|
711
735
|
if (this.attr.keyName && (this.attr.keyName.toString().indexOf('async ') !== -1 || this.attr.keyName.toString().indexOf('function') !== -1)) {
|
|
712
736
|
this.debouncedUpdateOptions()
|
|
713
737
|
}
|
|
714
|
-
// 如果有自定义函数变更函数
|
|
715
|
-
if (this.attr.dataChangeFunc) {
|
|
716
|
-
this.debouncedDataChangeFunc()
|
|
717
|
-
}
|
|
718
738
|
// 如果有自定义是否展示表单项函数
|
|
719
739
|
if (this.attr.showFormItemFunc) {
|
|
720
740
|
this.debouncedShowFormItemFunc()
|
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
:span="cell.colSpan ? cell.colSpan * 2 : undefined">
|
|
13
13
|
<!-- 插槽渲染 -->
|
|
14
14
|
<template v-if="cell.type === 'slot'">
|
|
15
|
-
<template v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor'].includes(cell.slotType)">
|
|
15
|
+
<template v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab'].includes(cell.slotType)">
|
|
16
16
|
<component
|
|
17
17
|
:is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
|
|
18
18
|
:key="cellIndex"
|
|
19
19
|
:ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
|
|
20
20
|
:serviceName="cell.serviceName"
|
|
21
|
+
:serverName="cell.serviceName"
|
|
21
22
|
v-on="getEventHandlers(cell)"
|
|
22
23
|
@hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
|
|
23
24
|
:queryParamsName="cell.slotConfig"
|
|
@@ -78,7 +78,8 @@ routerResource.example = {
|
|
|
78
78
|
{
|
|
79
79
|
path: 'default',
|
|
80
80
|
name: '示例页面',
|
|
81
|
-
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
81
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
82
|
+
component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|
|
82
83
|
// component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
|
|
83
84
|
meta: {
|
|
84
85
|
// 菜单中不显示
|