@dhccmobile/vue3-lo-form 0.1.2 → 0.1.5
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/dist/vue3-lo-form.common.js +125 -103
- package/dist/vue3-lo-form.common.js.map +1 -1
- package/dist/vue3-lo-form.css +1 -1
- package/dist/vue3-lo-form.umd.js +125 -103
- package/dist/vue3-lo-form.umd.js.map +1 -1
- package/dist/vue3-lo-form.umd.min.js +5 -5
- package/dist/vue3-lo-form.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/components/form/DvFormLayout.vue +49 -9
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<div class="lo-input">
|
|
103
103
|
<!--styleMode="credit-rd" :formId="'773549593606574080'"-->
|
|
104
104
|
<dy-form v-if="showForm" :formId="'961203806267904000'" v-model:edit="formApi.edit" v-model:formApi="formApi" @change="onChange($event)" @click="onClick($event)" @focus="onFocus($event)" @blur="onBlur($event)" @addon-before="onAddonBeforeHandler($event)" @addon-after="onAddonAfterHandler($event)" @add-item="selectAddItem($event)">
|
|
105
|
-
<template #combinationSelector
|
|
105
|
+
<template #combinationSelector="{ control, onChange }">
|
|
106
106
|
<div class="lo-custom-control-box">
|
|
107
107
|
<a-input v-model:value="control.formControl.value" @input="onChange(control.formControl)" v-if="control && control.formControl" />
|
|
108
108
|
<!-- <a-input-number style="flex-grow: 1" v-model="control.formControl.value" :min="1" :max="100" @change="onChange(control)" />
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
:colon="colon"
|
|
12
12
|
:labelAlign="labelAlign"
|
|
13
13
|
:required="required && provideInjectData.edit"
|
|
14
|
-
:has-feedback="hasFeedback && provideInjectData.edit"
|
|
15
14
|
:validate-status="validateResult.validateStatus"
|
|
16
15
|
:help="provideInjectData.edit ? validateResult.errorMsg : null"
|
|
17
16
|
:class="{
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
<template v-slot:suffix v-if="$slots['input:suffix:' + formControl.key]">
|
|
85
84
|
<slot :name="'input:suffix:' + formControl.key"></slot>
|
|
86
85
|
</template>
|
|
87
|
-
<template v-slot:addonBefore v-if="$slots['input:addonBefore:' + formControl.key] || controlAttr.bindingPrefix || controlAttr.builtInFrontLabel"
|
|
86
|
+
<template v-slot:addonBefore v-if="$slots['input:addonBefore:' + formControl.key] || controlAttr.bindingPrefix || controlAttr.builtInFrontLabel">
|
|
88
87
|
<template v-if="$slots['input:addonBefore:' + formControl.key]">
|
|
89
88
|
<slot :name="'input:addonBefore:' + formControl.key"> </slot>
|
|
90
89
|
</template>
|
|
@@ -94,8 +93,9 @@
|
|
|
94
93
|
<template v-else-if="controlAttr.builtInFrontLabel">
|
|
95
94
|
<ordered-list-outlined class="addon-icon" />
|
|
96
95
|
</template>
|
|
96
|
+
<span class="addon-inner" @click="onAddonBeforeHandler(control)"></span>
|
|
97
97
|
</template>
|
|
98
|
-
<template v-slot:addonAfter v-if="$slots['input:addonAfter:' + formControl.key] || controlAttr.bindingSuffix || controlAttr.builtInPostLabel"
|
|
98
|
+
<template v-slot:addonAfter v-if="$slots['input:addonAfter:' + formControl.key] || controlAttr.bindingSuffix || controlAttr.builtInPostLabel">
|
|
99
99
|
<template v-if="$slots['input:addonAfter:' + formControl.key]">
|
|
100
100
|
<slot :name="'input:addonAfter:' + formControl.key"></slot>
|
|
101
101
|
</template>
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
<template v-else-if="controlAttr.builtInPostLabel">
|
|
106
106
|
<ordered-list-outlined class="addon-icon" />
|
|
107
107
|
</template>
|
|
108
|
+
<span class="addon-inner" @click="onAddonAfterHandler(control)"></span>
|
|
108
109
|
</template>
|
|
109
110
|
</component>
|
|
110
111
|
</template>
|
|
@@ -170,6 +171,7 @@
|
|
|
170
171
|
:placeholder="controlAttr.placeholder"
|
|
171
172
|
@change="onChange(control)"
|
|
172
173
|
@click="onClick(control)"
|
|
174
|
+
:get-popup-container="getPopupContainer"
|
|
173
175
|
:filter-option="filterOption"
|
|
174
176
|
>
|
|
175
177
|
<template #dropdownRender="{ menuNode: menu }">
|
|
@@ -206,20 +208,33 @@
|
|
|
206
208
|
<a-switch v-model:checked="formControl.value" :checked-children="controlAttr.onOpeningText" :un-checked-children="controlAttr.whenClosedText" :disabled="controlAttr.isNotEdit" @change="onChange(control)" @click="onClick(control)" />
|
|
207
209
|
</template>
|
|
208
210
|
<template v-if="control.code === formFieldType.TimePicker.code">
|
|
209
|
-
<a-time-picker class="w-100" :use12-hours="is12Hours" :placeholder="controlAttr.placeholder" :disabled="controlAttr.isNotEdit" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
211
|
+
<a-time-picker class="w-100" :get-popup-container="getPopupContainer" :locale="locale" :use12-hours="is12Hours" :placeholder="controlAttr.placeholder" :disabled="controlAttr.isNotEdit" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
210
212
|
</template>
|
|
211
213
|
<template v-if="control.code === formFieldType.DatePicker.code">
|
|
212
|
-
<a-month-picker v-if="useMonthPicker" :
|
|
213
|
-
<a-date-picker v-else :
|
|
214
|
+
<a-month-picker v-if="useMonthPicker" class="w-100" :get-popup-container="getPopupContainer" :locale="locale" :format="controlAttr.dateFormat" :placeholder="controlAttr.placeholder" :disabled="controlAttr.isNotEdit" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
215
|
+
<a-date-picker v-else class="w-100" :get-popup-container="getPopupContainer" :locale="locale" :showTime="showPickerTime(controlAttr.dateFormat)" :format="controlAttr.dateFormat" :placeholder="controlAttr.placeholder" :disabled="controlAttr.isNotEdit" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
214
216
|
</template>
|
|
215
217
|
<template v-if="control.code === formFieldType.Slider.code">
|
|
216
218
|
<a-slider v-model:value="formControl.value" :disabled="controlAttr.isNotEdit" @change="onChange(control)" @click="onClick(control)" />
|
|
217
219
|
</template>
|
|
218
220
|
<template v-if="control.code === formFieldType.Cascader.code">
|
|
219
|
-
<a-cascader :placeholder="controlAttr.placeholder" :show-search="controlAttr.isSearchable ? { cascaderFilter } : undefined" :disabled="controlAttr.isNotEdit" :options="cascaderOptions" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
221
|
+
<a-cascader :get-popup-container="getPopupContainer" :placeholder="controlAttr.placeholder" :show-search="controlAttr.isSearchable ? { cascaderFilter } : undefined" :disabled="controlAttr.isNotEdit" :options="cascaderOptions" v-model:value="formControl.value" @change="onChange(control)" @click="onClick(control)" />
|
|
220
222
|
</template>
|
|
221
223
|
<template v-if="control.code === formFieldType.TreeSelect.code">
|
|
222
|
-
<a-tree-select
|
|
224
|
+
<a-tree-select
|
|
225
|
+
:get-popup-container="getPopupContainer"
|
|
226
|
+
v-model:value="formControl.value"
|
|
227
|
+
:show-search="controlAttr.isSearchable"
|
|
228
|
+
:treeNodeFilterProp="'title'"
|
|
229
|
+
:disabled="controlAttr.isNotEdit"
|
|
230
|
+
:placeholder="controlAttr.placeholder"
|
|
231
|
+
:dropdown-style="{ maxHeight: '250px', overflow: 'auto' }"
|
|
232
|
+
:tree-data="treeSelectOptions"
|
|
233
|
+
@change="onChange(control)"
|
|
234
|
+
@click="onClick(control)"
|
|
235
|
+
tree-default-expand-all
|
|
236
|
+
>
|
|
237
|
+
</a-tree-select>
|
|
223
238
|
</template>
|
|
224
239
|
<template v-if="control.code === formFieldType.Rate.code">
|
|
225
240
|
<a-rate v-model:value="formControl.value" :disabled="controlAttr.isNotEdit" @change="onChange(control)" @click="onClick(control)" allow-half />
|
|
@@ -233,7 +248,7 @@
|
|
|
233
248
|
</a-upload>
|
|
234
249
|
</template>
|
|
235
250
|
<template v-if="control.code === formFieldType.Custom.code && controlAttr.customFieldName">
|
|
236
|
-
<slot :control="control" :onChange="onChange" :name="
|
|
251
|
+
<slot :control="control" :onChange="onChange" :name="controlAttr.customFieldName"></slot>
|
|
237
252
|
</template>
|
|
238
253
|
</template>
|
|
239
254
|
<template v-else>
|
|
@@ -1283,6 +1298,15 @@ export default class DvFormLayout extends Vue {
|
|
|
1283
1298
|
this.defaultMoneyUnit = this.moneyUnits.find((item) => item.code === e.key);
|
|
1284
1299
|
}
|
|
1285
1300
|
|
|
1301
|
+
/**
|
|
1302
|
+
* @description: 将下拉弹层渲染节点固定在触发器的父元素中
|
|
1303
|
+
* @author ZPFly
|
|
1304
|
+
* @date 2022/8/31 11:30
|
|
1305
|
+
*/
|
|
1306
|
+
getPopupContainer(triggerNode: any) {
|
|
1307
|
+
return triggerNode.parentNode;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1286
1310
|
/**
|
|
1287
1311
|
* @description: 输入事件处理
|
|
1288
1312
|
* @author ChenRui
|
|
@@ -1474,6 +1498,7 @@ export default class DvFormLayout extends Vue {
|
|
|
1474
1498
|
height: 100%;
|
|
1475
1499
|
top: 0;
|
|
1476
1500
|
right: 0;
|
|
1501
|
+
width: fit-content;
|
|
1477
1502
|
.ant-select-arrow-icon {
|
|
1478
1503
|
height: 100%;
|
|
1479
1504
|
display: flex;
|
|
@@ -1522,10 +1547,25 @@ export default class DvFormLayout extends Vue {
|
|
|
1522
1547
|
color: #333333;
|
|
1523
1548
|
}
|
|
1524
1549
|
}
|
|
1550
|
+
:deep(.ant-input-group-addon:last-child) {
|
|
1551
|
+
border-top-left-radius: 0 !important;
|
|
1552
|
+
border-bottom-left-radius: 0 !important;
|
|
1553
|
+
}
|
|
1525
1554
|
.addon-icon {
|
|
1526
1555
|
font-size: 15px;
|
|
1527
1556
|
cursor: pointer;
|
|
1528
1557
|
}
|
|
1558
|
+
.addon-inner {
|
|
1559
|
+
position: absolute;
|
|
1560
|
+
width: 100%;
|
|
1561
|
+
height: 100%;
|
|
1562
|
+
top: 0;
|
|
1563
|
+
left: 0;
|
|
1564
|
+
cursor: pointer;
|
|
1565
|
+
}
|
|
1566
|
+
.addon-inner:active {
|
|
1567
|
+
background: rgba(240, 240, 240, 0.3);
|
|
1568
|
+
}
|
|
1529
1569
|
}
|
|
1530
1570
|
.lo-textarea-count {
|
|
1531
1571
|
position: absolute;
|