vue2-client 1.10.6 → 1.10.7
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 +3 -0
- package/src/base-client/components/common/XAddNativeForm/demo.vue +3 -2
- package/src/base-client/components/common/XForm/XFormItem.vue +24 -1
- package/src/base-client/components/common/XFormCol/XFormCol.vue +20 -9
- package/src/base-client/components/common/XFormTable/demo.vue +2 -2
- package/src/bootstrap.js +2 -2
- package/src/router/async/router.map.js +2 -2
package/package.json
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
:disabled="itemDisabled(item)"
|
|
47
47
|
:read-only="readonly(item)"
|
|
48
48
|
:files="files"
|
|
49
|
+
v-bind="formItemLayoutGen"
|
|
49
50
|
:style="layout === 'inline' ? { marginTop:'5px' } : undefined"
|
|
50
51
|
:form="form"
|
|
51
52
|
:images="images"
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
:disabled="itemDisabled(item)"
|
|
71
72
|
:readonly="readonly(item)"
|
|
72
73
|
:files="files"
|
|
74
|
+
v-bind="formItemLayoutGen"
|
|
73
75
|
:style="layout ==='inline'?{marginTop:'5px'}:undefined"
|
|
74
76
|
:form="form[groupItem.model]"
|
|
75
77
|
:images="images"
|
|
@@ -99,6 +101,7 @@
|
|
|
99
101
|
:disabled="itemDisabled(formItem)"
|
|
100
102
|
:readonly="readonly(formItem)"
|
|
101
103
|
:files="files"
|
|
104
|
+
v-bind="formItemLayoutGen"
|
|
102
105
|
:style="layout ==='inline'?{marginTop:'5px'}:undefined"
|
|
103
106
|
:form="form[groupItem.model]"
|
|
104
107
|
:images="images"
|
|
@@ -6,13 +6,14 @@ export default {
|
|
|
6
6
|
name: 'Demo',
|
|
7
7
|
components: { XAddNativeForm },
|
|
8
8
|
mounted () {
|
|
9
|
-
getConfigByNameAsync('
|
|
9
|
+
getConfigByNameAsync('bedManageCRUD', 'af-his').then(res => {
|
|
10
10
|
this.$refs.xAddFrom.init(Object.assign(res, {
|
|
11
11
|
modifyModelData: {
|
|
12
12
|
data: {
|
|
13
13
|
f_f_type: 2
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
layout: 'horizontal'
|
|
16
17
|
}))
|
|
17
18
|
})
|
|
18
19
|
},
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<x-form-col
|
|
4
4
|
v-if="attr.type === 'input' && show"
|
|
5
5
|
:occupyCol="attr.occupyCol"
|
|
6
|
+
:labelCol="labelCol"
|
|
6
7
|
:flex="attr.flex">
|
|
7
8
|
<a-form-model-item
|
|
8
9
|
:ref="attr.model"
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
<!-- 下拉框 -->
|
|
78
79
|
<x-form-col
|
|
79
80
|
v-else-if="(attr.type === 'select' || (attr.type === 'rate' && mode==='查询')) && show"
|
|
81
|
+
:labelCol="labelCol"
|
|
80
82
|
:flex="attr.flex">
|
|
81
83
|
<a-form-model-item
|
|
82
84
|
v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
|
|
@@ -206,6 +208,7 @@
|
|
|
206
208
|
<!-- 多选框 -->
|
|
207
209
|
<x-form-col
|
|
208
210
|
v-else-if="attr.type === 'checkbox' && show"
|
|
211
|
+
:labelCol="labelCol"
|
|
209
212
|
:flex="attr.flex">
|
|
210
213
|
<a-form-model-item
|
|
211
214
|
v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
|
|
@@ -291,6 +294,7 @@
|
|
|
291
294
|
<!-- 单选框 -->
|
|
292
295
|
<x-form-col
|
|
293
296
|
v-else-if="attr.type === 'radio' && show"
|
|
297
|
+
:labelCol="labelCol"
|
|
294
298
|
:flex="attr.flex">
|
|
295
299
|
<a-form-model-item
|
|
296
300
|
v-if="!attr.showMode || attr.type === 'radio' "
|
|
@@ -344,6 +348,7 @@
|
|
|
344
348
|
<!-- 时间 日期 框整合 -->
|
|
345
349
|
<x-form-col
|
|
346
350
|
v-else-if="['datePicker', 'rangePicker', 'yearPicker', 'monthPicker', 'yearRangePicker', 'monthRangePicker'].includes(attr.type) && show"
|
|
351
|
+
:labelCol="labelCol"
|
|
347
352
|
:flex="attr.flex">
|
|
348
353
|
<a-form-model-item
|
|
349
354
|
:ref="attr.model"
|
|
@@ -360,7 +365,10 @@
|
|
|
360
365
|
</a-form-model-item>
|
|
361
366
|
</x-form-col>
|
|
362
367
|
<!-- 文本域 -->
|
|
363
|
-
<x-form-col
|
|
368
|
+
<x-form-col
|
|
369
|
+
v-else-if="attr.type === 'textarea' && show"
|
|
370
|
+
:labelCol="labelCol"
|
|
371
|
+
:flex="attr.flex">
|
|
364
372
|
<!-- :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"-->
|
|
365
373
|
<a-form-model-item
|
|
366
374
|
:ref="attr.model"
|
|
@@ -377,6 +385,7 @@
|
|
|
377
385
|
<!-- 文件上传 -->
|
|
378
386
|
<x-form-col
|
|
379
387
|
v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
|
|
388
|
+
:labelCol="labelCol"
|
|
380
389
|
:flex="attr.flex">
|
|
381
390
|
<a-form-model-item
|
|
382
391
|
:ref="attr.model"
|
|
@@ -394,6 +403,7 @@
|
|
|
394
403
|
<!-- 省市区选择框 -->
|
|
395
404
|
<x-form-col
|
|
396
405
|
v-else-if="attr.type === 'citySelect' && show"
|
|
406
|
+
:labelCol="labelCol"
|
|
397
407
|
:flex="attr.flex">
|
|
398
408
|
<a-form-model-item
|
|
399
409
|
:ref="attr.model"
|
|
@@ -411,6 +421,7 @@
|
|
|
411
421
|
<!-- 地点搜索框 -->
|
|
412
422
|
<x-form-col
|
|
413
423
|
v-else-if="attr.type === 'addressSearch' && show"
|
|
424
|
+
:labelCol="labelCol"
|
|
414
425
|
:occupyCol="attr.occupyCol"
|
|
415
426
|
:flex="attr.flex">
|
|
416
427
|
<a-form-model-item
|
|
@@ -433,6 +444,7 @@
|
|
|
433
444
|
<!-- 人员选择框 -->
|
|
434
445
|
<x-form-col
|
|
435
446
|
v-else-if="attr.type === 'personSetting' && show"
|
|
447
|
+
:labelCol="labelCol"
|
|
436
448
|
:flex="attr.flex">
|
|
437
449
|
<a-form-model-item
|
|
438
450
|
:ref="attr.model"
|
|
@@ -444,6 +456,7 @@
|
|
|
444
456
|
<!-- 树形选择框 -->
|
|
445
457
|
<x-form-col
|
|
446
458
|
v-else-if="attr.type === 'treeSelect' && show"
|
|
459
|
+
:labelCol="labelCol"
|
|
447
460
|
:flex="attr.flex">
|
|
448
461
|
<x-tree-select
|
|
449
462
|
@onChange="attr.dataChangeFunc && debouncedDataChangeFunc()"
|
|
@@ -456,6 +469,7 @@
|
|
|
456
469
|
<!-- 列表选择框 -->
|
|
457
470
|
<x-form-col
|
|
458
471
|
v-else-if="attr.type === 'listSelect' && show"
|
|
472
|
+
:labelCol="labelCol"
|
|
459
473
|
:flex="attr.flex">
|
|
460
474
|
<a-form-model-item
|
|
461
475
|
:ref="attr.model"
|
|
@@ -515,6 +529,7 @@
|
|
|
515
529
|
<!-- 评分框 -->
|
|
516
530
|
<x-form-col
|
|
517
531
|
v-else-if="attr.type === 'rate' && show"
|
|
532
|
+
:labelCol="labelCol"
|
|
518
533
|
:flex="attr.flex">
|
|
519
534
|
<a-form-model-item
|
|
520
535
|
:ref="attr.model"
|
|
@@ -529,6 +544,7 @@
|
|
|
529
544
|
<!-- 区间选择器 -->
|
|
530
545
|
<x-form-col
|
|
531
546
|
v-else-if="attr.type === 'intervalPicker' && show"
|
|
547
|
+
:labelCol="labelCol"
|
|
532
548
|
:flex="attr.flex">
|
|
533
549
|
<a-form-model-item
|
|
534
550
|
:ref="attr.model"
|
|
@@ -565,6 +581,7 @@
|
|
|
565
581
|
<!-- 车牌号选择 -->
|
|
566
582
|
<x-form-col
|
|
567
583
|
v-else-if="attr.type === 'licensePlate' && show"
|
|
584
|
+
:labelCol="labelCol"
|
|
568
585
|
:flex="attr.flex">
|
|
569
586
|
<a-form-model-item
|
|
570
587
|
:ref="attr.model"
|
|
@@ -592,6 +609,7 @@
|
|
|
592
609
|
<!-- 录音 -->
|
|
593
610
|
<x-form-col
|
|
594
611
|
v-else-if="attr.type === 'recording' && show"
|
|
612
|
+
:labelCol="labelCol"
|
|
595
613
|
:flex="attr.flex">
|
|
596
614
|
<recording
|
|
597
615
|
ref="recording"
|
|
@@ -602,6 +620,7 @@
|
|
|
602
620
|
<!-- 表格录入 -->
|
|
603
621
|
<x-form-col
|
|
604
622
|
v-else-if="attr.type === 'rowEdit' && show"
|
|
623
|
+
:labelCol="labelCol"
|
|
605
624
|
:flex="attr.flex">
|
|
606
625
|
<a-form-model-item
|
|
607
626
|
:ref="attr.model"
|
|
@@ -766,6 +785,10 @@ export default {
|
|
|
766
785
|
() => {
|
|
767
786
|
return true
|
|
768
787
|
}
|
|
788
|
+
},
|
|
789
|
+
labelCol: {
|
|
790
|
+
type: Object,
|
|
791
|
+
default: () => { return { span: 8 } }
|
|
769
792
|
}
|
|
770
793
|
},
|
|
771
794
|
provide () {
|
|
@@ -55,6 +55,14 @@ export default {
|
|
|
55
55
|
type: Number,
|
|
56
56
|
default: 1,
|
|
57
57
|
},
|
|
58
|
+
layout: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'horizontal',
|
|
61
|
+
},
|
|
62
|
+
labelCol: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: () => { return { span: 8 } }
|
|
65
|
+
}
|
|
58
66
|
},
|
|
59
67
|
computed: {
|
|
60
68
|
computedFlex () {
|
|
@@ -67,16 +75,19 @@ export default {
|
|
|
67
75
|
const columnsCount = 24 / realFlex
|
|
68
76
|
// 2. 计算基准列宽
|
|
69
77
|
const baseColumnWidth = (this.parentWidth / columnsCount) - ((columnsCount - 1) * 16)
|
|
70
|
-
// console.log('调试信息:', {
|
|
71
|
-
// parentWidth: this.parentWidth,
|
|
72
|
-
// computedFlex: realFlex,
|
|
73
|
-
// columnsCount,
|
|
74
|
-
// baseColumnWidth,
|
|
75
|
-
// })
|
|
76
78
|
// 3. 计算label宽度
|
|
77
|
-
const labelWidth = Math.max(baseColumnWidth /
|
|
79
|
+
const labelWidth = Math.max(baseColumnWidth / (24 / this.labelCol.span), 80)
|
|
80
|
+
// 计算左右偏移量
|
|
81
|
+
const offset = this.labelCol.offset ? (this.labelCol.offset / 24) * 100 : 0
|
|
82
|
+
if (this.layout === 'vertical') {
|
|
83
|
+
return {
|
|
84
|
+
'--form-label-width': '',
|
|
85
|
+
'--form-offset': '',
|
|
86
|
+
}
|
|
87
|
+
}
|
|
78
88
|
return {
|
|
79
89
|
'--form-label-width': `${labelWidth}px`,
|
|
90
|
+
'--form-offset': `${offset}%`,
|
|
80
91
|
}
|
|
81
92
|
},
|
|
82
93
|
computedStyles () {
|
|
@@ -138,8 +149,8 @@ export default {
|
|
|
138
149
|
.ant-form-item-label {
|
|
139
150
|
max-width: var(--form-label-width);
|
|
140
151
|
}
|
|
141
|
-
.ant-form-item-control-wrapper{
|
|
142
|
-
width: calc(100% - var(--form-label-width));
|
|
152
|
+
.ant-form-item-control-wrapper {
|
|
153
|
+
width: calc(100% - var(--form-label-width) - var(--form-offset) - var(--form-offset));
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
title="示例表单"
|
|
7
7
|
:queryParamsName="queryParamsName"
|
|
8
8
|
:fixedAddForm="fixedAddForm"
|
|
9
|
-
service-name="af-
|
|
9
|
+
service-name="af-revenue"
|
|
10
10
|
@action="action"
|
|
11
11
|
@columnClick="columnClick"
|
|
12
12
|
ref="xFormTable">
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
data () {
|
|
26
26
|
return {
|
|
27
27
|
// 查询配置文件名
|
|
28
|
-
queryParamsName: '
|
|
28
|
+
queryParamsName: 'ChargeQueryCRUD',
|
|
29
29
|
// 查询配置左侧tree
|
|
30
30
|
// xTreeConfigName: 'addressType',
|
|
31
31
|
// 新增表单固定值
|
package/src/bootstrap.js
CHANGED
|
@@ -20,8 +20,8 @@ async function bootstrap ({ router, store, i18n, message }) {
|
|
|
20
20
|
if (store) {
|
|
21
21
|
await getConfigByName('webConfig', undefined, res => {
|
|
22
22
|
localStorage.setItem(process.env.VUE_APP_WEB_CONFIG_KEY, JSON.stringify(res))
|
|
23
|
-
if (res
|
|
24
|
-
Vue.$store.commit('setting/setSetting', res
|
|
23
|
+
if (res?.setting) {
|
|
24
|
+
Vue.$store.commit('setting/setSetting', res?.setting)
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
}
|
|
@@ -84,9 +84,9 @@ routerResource.example = {
|
|
|
84
84
|
path: 'default',
|
|
85
85
|
name: '示例页面',
|
|
86
86
|
// component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
|
|
87
|
-
component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
87
|
+
// component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
|
|
88
88
|
// component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
|
|
89
|
-
|
|
89
|
+
component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
|
|
90
90
|
// component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
|
|
91
91
|
// component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
|
|
92
92
|
// component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
|