free-fe-core-modules 0.0.16 → 0.0.18
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/components/Basic/EIcon.vue +3 -0
- package/composible/useFormValidator.js +4 -0
- package/free-field/Fields/AgreementCheck.js +8 -8
- package/free-field/Fields/ApiCall.js +1 -1
- package/free-field/Fields/Boolean.js +19 -52
- package/free-field/Fields/Category.js +1 -1
- package/free-field/Fields/Check.js +8 -3
- package/free-field/Fields/Column.vue +12 -9
- package/free-field/Fields/Customize.js +1 -1
- package/free-field/Fields/Date.js +11 -2
- package/free-field/Fields/DateRange.js +7 -3
- package/free-field/Fields/DynamicList.js +2 -1
- package/free-field/Fields/File.vue +393 -0
- package/free-field/Fields/FileList.vue +460 -0
- package/free-field/Fields/FileListCombined.vue +172 -0
- package/free-field/Fields/FixedList.vue +4 -3
- package/free-field/Fields/{InputFieldList.vue → FreeFieldList.vue} +34 -11
- package/free-field/Fields/Image.vue +361 -0
- package/free-field/Fields/ImageList.vue +353 -0
- package/free-field/Fields/ImageListCombined.vue +108 -0
- package/free-field/Fields/Labels.vue +3 -5
- package/free-field/Fields/MixedTable.vue +2 -2
- package/free-field/Fields/Number.js +5 -2
- package/free-field/Fields/NumberRange.vue +24 -15
- package/free-field/Fields/Password.js +4 -2
- package/free-field/Fields/Permission.vue +2 -2
- package/free-field/Fields/PermissionEditor.vue +2 -2
- package/free-field/Fields/QueryFilters.vue +1 -1
- package/free-field/Fields/RadioList.vue +4 -3
- package/free-field/Fields/Rich.vue +28 -4
- package/free-field/Fields/Row.vue +13 -10
- package/free-field/Fields/Search.vue +28 -26
- package/free-field/Fields/Select.vue +30 -22
- package/free-field/Fields/SelectionChain.vue +4 -2
- package/free-field/Fields/Separator.js +1 -1
- package/free-field/Fields/SingleList.vue +1 -1
- package/free-field/Fields/Static.js +1 -1
- package/free-field/Fields/String.js +20 -5
- package/free-field/Fields/Tabs.vue +9 -9
- package/free-field/Fields/Text.js +7 -4
- package/free-field/Fields/Time.vue +5 -3
- package/free-field/Fields/TimeRange.vue +7 -4
- package/free-field/Fields/Year.js +4 -2
- package/free-field/Fields/YearRange.vue +6 -3
- package/free-field/Fields/index.js +20 -13
- package/free-field/composible/fieldWrapper.js +137 -11
- package/free-field/composible/readonlyContent.js +1 -1
- package/free-field/composible/useFreeField.js +25 -9
- package/free-field/composible/useUploader.js +320 -0
- package/free-field/style.scss +173 -0
- package/i18n/en-us/index.js +3 -0
- package/i18n/fields/en-us/index.js +1 -0
- package/i18n/fields/zh-cn/index.js +1 -0
- package/i18n/zh-cn/index.js +3 -0
- package/index.js +7 -0
- package/package.json +1 -1
- package/view/menu/index.vue +6 -6
- package/view/system/index.vue +1 -1
- package/free-field/style.sass +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="`
|
|
3
|
-
this.hasError ? '
|
|
2
|
+
<div :class="`free-field-radio-list relative-position ${
|
|
3
|
+
this.hasError ? 'free-field--error' : ''}`">
|
|
4
4
|
<slot name="warning"></slot>
|
|
5
5
|
<q-list>
|
|
6
6
|
<q-item
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
</q-item>
|
|
46
46
|
</q-list>
|
|
47
47
|
<div
|
|
48
|
-
class="
|
|
48
|
+
class="free-field--error-tag"
|
|
49
49
|
v-if="hasError"
|
|
50
50
|
>
|
|
51
51
|
<e-icon name="error"></e-icon>
|
|
@@ -68,6 +68,7 @@ export default defineComponent({
|
|
|
68
68
|
props: {
|
|
69
69
|
...freeFieldProps,
|
|
70
70
|
},
|
|
71
|
+
emits: ['input'],
|
|
71
72
|
setup(props, { expose, emit }) {
|
|
72
73
|
if (!props.Field) return {};
|
|
73
74
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="free-field-rich row no-wrap">
|
|
3
3
|
<span
|
|
4
4
|
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
5
5
|
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
class="required-mark"
|
|
16
16
|
>*</span>
|
|
17
17
|
</span>
|
|
18
|
-
<span class="content relative-position fit" :class="isValid ? '' : '
|
|
18
|
+
<span class="content relative-position fit" :class="isValid ? '' : 'free-field--error'">
|
|
19
19
|
<slot name="warning"></slot>
|
|
20
20
|
|
|
21
|
-
<div class="
|
|
21
|
+
<div class="free-field--error-tag" v-if="!isValid">
|
|
22
22
|
<e-icon name="error"></e-icon>
|
|
23
23
|
</div>
|
|
24
24
|
|
|
@@ -109,6 +109,7 @@ export default defineComponent({
|
|
|
109
109
|
components: {
|
|
110
110
|
tiny,
|
|
111
111
|
},
|
|
112
|
+
emits: ['input'],
|
|
112
113
|
props: {
|
|
113
114
|
...freeFieldProps,
|
|
114
115
|
enableField: { type: Boolean, default: false },
|
|
@@ -183,6 +184,7 @@ export default defineComponent({
|
|
|
183
184
|
'aligncenter',
|
|
184
185
|
'alignright',
|
|
185
186
|
'alignjustify',
|
|
187
|
+
'indent2em',
|
|
186
188
|
'|',
|
|
187
189
|
'numlist',
|
|
188
190
|
'bullist',
|
|
@@ -244,6 +246,28 @@ export default defineComponent({
|
|
|
244
246
|
};
|
|
245
247
|
|
|
246
248
|
const tinySetup = (editor) => {
|
|
249
|
+
// add button for indent 2ems
|
|
250
|
+
editor.on('init', () => {
|
|
251
|
+
editor.formatter.register('indent2em', {
|
|
252
|
+
block: 'p',
|
|
253
|
+
styles: { 'text-indent': '2em' }
|
|
254
|
+
});
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
editor.ui.registry.addToggleButton('indent2em', {
|
|
258
|
+
tooltip: '首行缩进两个字宽度',
|
|
259
|
+
icon: 'indent',
|
|
260
|
+
onAction: function () {
|
|
261
|
+
editor.execCommand('mceToggleFormat', false, 'indent2em');
|
|
262
|
+
},
|
|
263
|
+
onSetup: function (api) {
|
|
264
|
+
editor.formatter.formatChanged('indent2em', function (state) {
|
|
265
|
+
api.setActive(state);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// add button for insert field content
|
|
247
271
|
if (props.enableField) {
|
|
248
272
|
editor.ui.registry.addButton('insertFieldButton', {
|
|
249
273
|
text: '数据字段',
|
|
@@ -345,7 +369,7 @@ export default defineComponent({
|
|
|
345
369
|
// .tox-tinymce-aux
|
|
346
370
|
// z-index: 6001 !important
|
|
347
371
|
|
|
348
|
-
.
|
|
372
|
+
.free-field-rich
|
|
349
373
|
.tox-statusbar__branding
|
|
350
374
|
display: none
|
|
351
375
|
.tox-tinymce
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<
|
|
4
|
-
v-for="(field, idx) in Field.Options
|
|
2
|
+
<div class="free-field-row row" :class="rowClasses" v-if="Field">
|
|
3
|
+
<free-field
|
|
4
|
+
v-for="(field, idx) in Field.Options?.List"
|
|
5
5
|
:Field="field"
|
|
6
6
|
:values="fieldData"
|
|
7
7
|
:key="idx"
|
|
8
|
-
@input="$emit('input')"></
|
|
8
|
+
@input="$emit('input')"></free-field>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script>
|
|
13
|
-
import {
|
|
13
|
+
import { defineComponent } from 'vue';
|
|
14
|
+
import { freeFieldProps } from '../composible/useFreeField';
|
|
14
15
|
|
|
15
|
-
export default {
|
|
16
|
+
export default defineComponent({
|
|
16
17
|
name: 'InputFieldRow',
|
|
17
|
-
|
|
18
|
+
props: {
|
|
19
|
+
...freeFieldProps,
|
|
20
|
+
},
|
|
18
21
|
fieldInfo: {
|
|
19
22
|
Category: 'Container',
|
|
20
23
|
Label: '行',
|
|
@@ -23,7 +26,7 @@ export default {
|
|
|
23
26
|
{
|
|
24
27
|
Label: '不换行',
|
|
25
28
|
Name: 'Options.NoWrap',
|
|
26
|
-
Type: '
|
|
29
|
+
Type: 'Boolean',
|
|
27
30
|
},
|
|
28
31
|
{
|
|
29
32
|
Label: '竖向对齐',
|
|
@@ -116,10 +119,10 @@ export default {
|
|
|
116
119
|
},
|
|
117
120
|
computed: {
|
|
118
121
|
rowClasses() {
|
|
119
|
-
return '';
|
|
122
|
+
return this.Field.Options?.NoWrap ? 'nowrap' : '' + this.Field.Options?.ItemsAlign + ' ' + this.Field.Options?.JustifyAlign;
|
|
120
123
|
},
|
|
121
124
|
},
|
|
122
|
-
};
|
|
125
|
+
});
|
|
123
126
|
</script>
|
|
124
127
|
|
|
125
128
|
<style lang="scss" scoped>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span class="
|
|
3
|
-
<q-dialog v-model="showSearch" class="
|
|
4
|
-
<q-card class="
|
|
2
|
+
<span class="free-field-search">
|
|
3
|
+
<q-dialog v-model="showSearch" class="free-field-search-dialog" persistent>
|
|
4
|
+
<q-card class="free-field-search-dialog-card">
|
|
5
5
|
<q-toolbar>
|
|
6
6
|
<div class="simple-field full-width">
|
|
7
7
|
<q-input
|
|
@@ -9,24 +9,25 @@
|
|
|
9
9
|
v-model="searchKey"
|
|
10
10
|
hide-bottom-space
|
|
11
11
|
:placeholder="Field &&
|
|
12
|
-
((Field.Options
|
|
12
|
+
((Field.Options?.SearchPlaceholder) || Field.Placeholder)"
|
|
13
13
|
@keydown.enter="search()"
|
|
14
14
|
class="full-width"
|
|
15
|
+
v-bind="inputControlSettings"
|
|
15
16
|
>
|
|
16
17
|
<template v-slot:append>
|
|
17
|
-
<q-btn :class="Field.Options
|
|
18
|
+
<q-btn :class="Field.Options?.SearchBtnClasses" :flat="!Field.Options?.SearchBtn3D" :round="!Field.Options?.SearchBtnRect" icon="search" @click="search()" :disabled="Field.ReadOnly">{{Field.Options.SearchBtnText}}</q-btn>
|
|
18
19
|
</template>
|
|
19
20
|
</q-input>
|
|
20
21
|
</div>
|
|
21
22
|
</q-toolbar>
|
|
22
23
|
|
|
23
24
|
<q-card-section :style="`
|
|
24
|
-
width: ${Field.Options
|
|
25
|
-
max-width: ${Field.Options
|
|
25
|
+
width: ${Field.Options?.Width|| '800px'};
|
|
26
|
+
max-width: ${Field.Options?.MaxWidth|| '80vw'};
|
|
26
27
|
overflow-y: scroll`">
|
|
27
28
|
<q-table
|
|
28
|
-
:flat="Field.Options
|
|
29
|
-
:bordered="Field.Options
|
|
29
|
+
:flat="Field.Options?.Flat"
|
|
30
|
+
:bordered="Field.Options?.Bordered"
|
|
30
31
|
:rows="searchData ? searchData.docs : []"
|
|
31
32
|
:columns="searchColumns"
|
|
32
33
|
row-key="id"
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
>
|
|
38
39
|
<template v-slot:header="props">
|
|
39
40
|
<q-tr :props="props">
|
|
40
|
-
<q-th auto-width v-if="!Field.Options
|
|
41
|
+
<q-th auto-width v-if="!Field.Options?.checkOnRight"/>
|
|
41
42
|
<q-th
|
|
42
43
|
v-for="col in props.cols"
|
|
43
44
|
:key="col.name"
|
|
@@ -45,13 +46,13 @@
|
|
|
45
46
|
>
|
|
46
47
|
{{ col.label }}
|
|
47
48
|
</q-th>
|
|
48
|
-
<q-th auto-width v-if="Field.Options
|
|
49
|
+
<q-th auto-width v-if="Field.Options?.checkOnRight"/>
|
|
49
50
|
</q-tr>
|
|
50
51
|
</template>
|
|
51
52
|
<template v-slot:body="props">
|
|
52
53
|
<q-tr class="table-row">
|
|
53
|
-
<q-td auto-width v-if="!Field.Options
|
|
54
|
-
<q-toggle v-model="props.selected" v-if="Field.Options
|
|
54
|
+
<q-td auto-width v-if="!Field.Options?.checkOnRight">
|
|
55
|
+
<q-toggle v-model="props.selected" v-if="Field.Options?.useToggle"/>
|
|
55
56
|
<q-checkbox v-else v-model="props.selected"></q-checkbox>
|
|
56
57
|
</q-td>
|
|
57
58
|
<q-td
|
|
@@ -62,8 +63,8 @@
|
|
|
62
63
|
>
|
|
63
64
|
{{col.value}}
|
|
64
65
|
</q-td>
|
|
65
|
-
<q-td auto-width v-if="Field.Options
|
|
66
|
-
<q-toggle v-model="props.selected" v-if="Field.Options
|
|
66
|
+
<q-td auto-width v-if="Field.Options?.checkOnRight">
|
|
67
|
+
<q-toggle v-model="props.selected" v-if="Field.Options?.useToggle"/>
|
|
67
68
|
<q-checkbox v-else v-model="props.selected"></q-checkbox>
|
|
68
69
|
</q-td>
|
|
69
70
|
</q-tr>
|
|
@@ -92,12 +93,12 @@
|
|
|
92
93
|
<q-card-actions>
|
|
93
94
|
<div class="buttons row full-width justify-center q-ma-sm">
|
|
94
95
|
<q-btn
|
|
95
|
-
:icon="(Field.Options
|
|
96
|
+
:icon="(Field.Options?.CancelIcon) || 'cancel'"
|
|
96
97
|
class="cancel-btn q-mr-md"
|
|
97
98
|
@click="showSearch = false; searchSelected=originalSelected; $emit('input')"
|
|
98
99
|
>{{$t('cancelButtonText')}}</q-btn>
|
|
99
100
|
<q-btn
|
|
100
|
-
:icon="(Field.Options
|
|
101
|
+
:icon="(Field.Options?.OkIcon) || 'check'"
|
|
101
102
|
class="ok-btn" @click="searchOK">{{$t('okButtonText')}}</q-btn>
|
|
102
103
|
</div>
|
|
103
104
|
</q-card-actions>
|
|
@@ -116,16 +117,16 @@
|
|
|
116
117
|
<span v-if="Field.Required" class="required-mark">*</span>
|
|
117
118
|
</span>
|
|
118
119
|
<span class="readonly-content">
|
|
119
|
-
<span :style="(Field.Info
|
|
120
|
+
<span :style="(Field.Info?.Style) ? Field.Info.Style : ''">{{searchDisplay}}</span>
|
|
120
121
|
</span>
|
|
121
122
|
</span>
|
|
122
123
|
<q-input
|
|
123
124
|
v-else
|
|
124
125
|
modelValue=""
|
|
125
|
-
:type="`${Field
|
|
126
|
+
:type="`${Field?.Multiple ? 'textarea' : ''}`"
|
|
126
127
|
hide-bottom-space
|
|
127
128
|
readonly
|
|
128
|
-
:class="`${Field
|
|
129
|
+
:class="`${Field?.Multiple
|
|
129
130
|
? '' : 'simple-field'} ${searchDisplay ? 'has-data' : 'empty'}`"
|
|
130
131
|
ref="fieldToValid"
|
|
131
132
|
@click="searchKey = '';searchData = {}; showSearch = true"
|
|
@@ -142,13 +143,13 @@
|
|
|
142
143
|
>
|
|
143
144
|
<q-tooltip
|
|
144
145
|
anchor="top right"
|
|
145
|
-
>{{selected[(Field.Options
|
|
146
|
-
{{selected[(Field.Options
|
|
146
|
+
>{{selected[(Field.Options?.SearchDisplayField) || 'id']}}</q-tooltip>
|
|
147
|
+
{{selected[(Field.Options?.SearchDisplayField) || 'id']}}
|
|
147
148
|
</q-chip>
|
|
148
149
|
</template>
|
|
149
150
|
<template v-slot:before>
|
|
150
151
|
<span
|
|
151
|
-
:class="`field-label ${(Field.Label
|
|
152
|
+
:class="`field-label ${(Field.Label?.trim().length)
|
|
152
153
|
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
153
154
|
v-if="Field.Label !== void 0"
|
|
154
155
|
>
|
|
@@ -290,7 +291,7 @@ export default defineComponent({
|
|
|
290
291
|
setup(props, { expose }) {
|
|
291
292
|
if (!props.Field) return {};
|
|
292
293
|
|
|
293
|
-
const { fieldData, setFieldData } = useFreeField(props);
|
|
294
|
+
const { fieldData, setFieldData, inputControlSettings } = useFreeField(props);
|
|
294
295
|
|
|
295
296
|
const { validate } = useFormValidator('fieldToValid');
|
|
296
297
|
expose({
|
|
@@ -300,6 +301,7 @@ export default defineComponent({
|
|
|
300
301
|
return {
|
|
301
302
|
fieldData,
|
|
302
303
|
setFieldData,
|
|
304
|
+
inputControlSettings,
|
|
303
305
|
};
|
|
304
306
|
},
|
|
305
307
|
data() {
|
|
@@ -501,11 +503,11 @@ export default defineComponent({
|
|
|
501
503
|
</script>
|
|
502
504
|
|
|
503
505
|
<style lang="sass" scoped>
|
|
504
|
-
.
|
|
506
|
+
.free-field-search-dialog-card
|
|
505
507
|
max-width: unset !important
|
|
506
508
|
max-height: unset !important
|
|
507
509
|
|
|
508
|
-
.
|
|
510
|
+
.free-field-search
|
|
509
511
|
.simple-field
|
|
510
512
|
display: flex
|
|
511
513
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<span :class="(Field && Field.AsCheck) ? '
|
|
3
|
-
'
|
|
2
|
+
<span :class="(Field && Field.AsCheck) ? 'free-field-select' :
|
|
3
|
+
'free-field-select simple-field row'">
|
|
4
4
|
<span
|
|
5
5
|
v-if="!Field.AsCheck"
|
|
6
6
|
class="row no-wrap items-center full-width inline-block"
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
|
|
44
44
|
<q-select
|
|
45
45
|
v-else
|
|
46
|
-
popup-content-class="
|
|
46
|
+
popup-content-class="free-field-select-control"
|
|
47
47
|
hide-bottom-space
|
|
48
48
|
:modelValue="fieldData.value"
|
|
49
|
-
@update:modelValue="
|
|
49
|
+
@update:modelValue="selectChanged"
|
|
50
50
|
:options="Field.Options || []"
|
|
51
51
|
option-value="Value"
|
|
52
52
|
option-label="Label"
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
ref="fieldToValid"
|
|
59
59
|
:use-input="Field && Field.UseInput"
|
|
60
60
|
:use-chip="Field && Field.UseChip"
|
|
61
|
+
v-bind="inputControlSettings"
|
|
62
|
+
:rules="Field.Rules"
|
|
61
63
|
>
|
|
62
64
|
<template v-slot:before>
|
|
63
65
|
<span
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
</span>
|
|
105
107
|
<span
|
|
106
108
|
v-else
|
|
107
|
-
class="
|
|
109
|
+
class="free-field-select-ascheck row items-start no-wrap"
|
|
108
110
|
>
|
|
109
111
|
<span
|
|
110
112
|
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
@@ -127,11 +129,11 @@
|
|
|
127
129
|
</div>
|
|
128
130
|
<div
|
|
129
131
|
class="checkbox-list"
|
|
130
|
-
:class="hasError ? '
|
|
132
|
+
:class="hasError ? 'free-field--error' : ''"
|
|
131
133
|
>
|
|
132
134
|
|
|
133
135
|
<div
|
|
134
|
-
class="
|
|
136
|
+
class="free-field--error-tag"
|
|
135
137
|
v-if="hasError"
|
|
136
138
|
>
|
|
137
139
|
<e-icon name="error"></e-icon>
|
|
@@ -246,7 +248,7 @@ export default defineComponent({
|
|
|
246
248
|
|
|
247
249
|
const { proxy:vm } = getCurrentInstance();
|
|
248
250
|
|
|
249
|
-
const { fieldData, getFieldData, setFieldData } = useFreeField(props);
|
|
251
|
+
const { fieldData, getFieldData, setFieldData, inputControlSettings } = useFreeField(props);
|
|
250
252
|
|
|
251
253
|
const hasError = ref(false);
|
|
252
254
|
const checked = ref([]);
|
|
@@ -296,29 +298,34 @@ export default defineComponent({
|
|
|
296
298
|
});
|
|
297
299
|
|
|
298
300
|
const selfValidate = () => {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return isValid;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return true;
|
|
301
|
+
const isValid = checked.value && checked.value.length > 0;
|
|
302
|
+
hasError.value = !isValid;
|
|
303
|
+
return isValid;
|
|
306
304
|
};
|
|
307
305
|
|
|
308
306
|
const { validate } = useFormValidator('fieldToValid');
|
|
309
307
|
expose ({
|
|
310
|
-
selfValidate,
|
|
311
308
|
validate,
|
|
312
309
|
})
|
|
313
310
|
|
|
311
|
+
if (props.Field.AsCheck && props.Field.Required) {
|
|
312
|
+
expose ({
|
|
313
|
+
selfValidate,
|
|
314
|
+
})
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const selectChanged = (v) => {
|
|
318
|
+
selfValidate();
|
|
319
|
+
setFieldData(v, emit);
|
|
320
|
+
};
|
|
321
|
+
|
|
314
322
|
const checkChanged = (v) => {
|
|
315
323
|
selfValidate();
|
|
316
324
|
|
|
317
325
|
if (!props.Field.Multiple) {
|
|
318
326
|
checked.value = [v];
|
|
319
327
|
}
|
|
320
|
-
setFieldData(checked.value.join(','));
|
|
321
|
-
emit('input');
|
|
328
|
+
setFieldData(checked.value.join(','), emit);
|
|
322
329
|
};
|
|
323
330
|
|
|
324
331
|
const apiCall = () => {
|
|
@@ -347,8 +354,7 @@ export default defineComponent({
|
|
|
347
354
|
if (d.data && d.data.options) {
|
|
348
355
|
selectOptions.value = d.data.options;
|
|
349
356
|
if (d.data.options.findIndex((o) => o.Value === fieldData.value) < 0) {
|
|
350
|
-
setFieldData(undefined);
|
|
351
|
-
emit('input');
|
|
357
|
+
setFieldData(undefined, emit);
|
|
352
358
|
}
|
|
353
359
|
} else {
|
|
354
360
|
selectOptions.value = [];
|
|
@@ -386,14 +392,16 @@ export default defineComponent({
|
|
|
386
392
|
|
|
387
393
|
readonlyContent,
|
|
388
394
|
|
|
395
|
+
selectChanged,
|
|
389
396
|
checkChanged,
|
|
397
|
+
inputControlSettings,
|
|
390
398
|
};
|
|
391
399
|
},
|
|
392
400
|
});
|
|
393
401
|
</script>
|
|
394
402
|
|
|
395
403
|
<style lang="sass">
|
|
396
|
-
.
|
|
404
|
+
.free-field-select
|
|
397
405
|
.q-field__native
|
|
398
406
|
white-space: nowrap
|
|
399
407
|
&>span
|
|
@@ -402,6 +410,6 @@ export default defineComponent({
|
|
|
402
410
|
.checkbox-list
|
|
403
411
|
position: relative
|
|
404
412
|
margin-left: 12px
|
|
405
|
-
&.
|
|
413
|
+
&.free-field--error
|
|
406
414
|
padding-right: 24px
|
|
407
415
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="free-field-select-chain row items-start no-wrap">
|
|
3
3
|
<span
|
|
4
4
|
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
5
5
|
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
emit-value
|
|
36
36
|
@input="selectionChanged(index)"
|
|
37
37
|
ref="fieldsToValid"
|
|
38
|
+
v-bind="inputControlSettings"
|
|
38
39
|
></q-select>
|
|
39
40
|
</span>
|
|
40
41
|
<span v-if="Field && Field.ReadOnly">
|
|
@@ -119,7 +120,7 @@ export default defineComponent({
|
|
|
119
120
|
|
|
120
121
|
const { proxy:vm } = getCurrentInstance();
|
|
121
122
|
|
|
122
|
-
const { fieldData, setFieldData } = useFreeField(props);
|
|
123
|
+
const { fieldData, setFieldData, inputControlSettings } = useFreeField(props);
|
|
123
124
|
|
|
124
125
|
const optionsList = ref([]);
|
|
125
126
|
const valuesList = ref([]);
|
|
@@ -217,6 +218,7 @@ export default defineComponent({
|
|
|
217
218
|
valuesList,
|
|
218
219
|
|
|
219
220
|
selectionChanged,
|
|
221
|
+
inputControlSettings,
|
|
220
222
|
};
|
|
221
223
|
},
|
|
222
224
|
created() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, computed } from 'vue';
|
|
1
|
+
import { defineComponent, h, computed, getCurrentInstance } from 'vue';
|
|
2
2
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
3
3
|
import { QInput } from 'quasar';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
@@ -44,15 +44,26 @@ export default defineComponent({
|
|
|
44
44
|
},
|
|
45
45
|
],
|
|
46
46
|
Description: '',
|
|
47
|
+
demoField: [{
|
|
48
|
+
Type: 'Category',
|
|
49
|
+
Label: '测试一下字符串',
|
|
50
|
+
},{
|
|
51
|
+
Type: 'String',
|
|
52
|
+
Name: 'MyName',
|
|
53
|
+
}],
|
|
54
|
+
demoData: {
|
|
55
|
+
MyName: 'Tom'
|
|
56
|
+
},
|
|
47
57
|
},
|
|
48
58
|
props: {
|
|
49
59
|
...freeFieldProps,
|
|
50
60
|
},
|
|
51
61
|
emits: ['input'],
|
|
52
|
-
setup(props, { emit, slots, expose }){
|
|
62
|
+
setup(props, { emit, slots, expose, attrs }){
|
|
53
63
|
if (!props.Field) return {};
|
|
54
64
|
|
|
55
|
-
const {
|
|
65
|
+
const { proxy:vm } = getCurrentInstance();
|
|
66
|
+
const { fieldData, setFieldData, inputControlSettings } = useFreeField(props);
|
|
56
67
|
|
|
57
68
|
const readonlyNode = () => h(ReadonlyContent, {
|
|
58
69
|
Field: props.Field,
|
|
@@ -78,6 +89,10 @@ export default defineComponent({
|
|
|
78
89
|
hideBottomSpace: true,
|
|
79
90
|
readonly: props.Field?.ReadOnly,
|
|
80
91
|
|
|
92
|
+
...inputControlSettings.value,
|
|
93
|
+
|
|
94
|
+
placeholder: props.Field?.Placeholder || attrs.placeholder || vm.$t(vm.getModule('core-modules').config['defaultInputFieldPlaceholder']),
|
|
95
|
+
|
|
81
96
|
class: 'full-width',
|
|
82
97
|
style: props.Field.Info?.Style,
|
|
83
98
|
|
|
@@ -93,13 +108,13 @@ export default defineComponent({
|
|
|
93
108
|
append,
|
|
94
109
|
}));
|
|
95
110
|
|
|
96
|
-
const { validate } = useFormValidator(inputNode);
|
|
111
|
+
const { validate } = useFormValidator(inputNode.value);
|
|
97
112
|
expose({
|
|
98
113
|
validate,
|
|
99
114
|
})
|
|
100
115
|
|
|
101
116
|
return () => h('div', {
|
|
102
|
-
class: 'simple-field
|
|
117
|
+
class: 'simple-field free-field-string row items-center no-wrap',
|
|
103
118
|
}, [
|
|
104
119
|
props.Field.ReadOnly ? readonlyNode() : inputNode.value,
|
|
105
120
|
slots.warning && slots.warning(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div class="free-field-tabs row no-wrap" v-if="Field">
|
|
3
3
|
<span
|
|
4
4
|
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
5
5
|
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
>*</span>
|
|
17
17
|
</span>
|
|
18
18
|
|
|
19
|
-
<div class="col
|
|
19
|
+
<div class="col free-field-tabs-tabs-wrapper">
|
|
20
20
|
<q-tabs
|
|
21
21
|
class="tabs"
|
|
22
22
|
v-model="tab"
|
|
23
23
|
:shrink="true"
|
|
24
24
|
no-caps
|
|
25
|
-
:vertical="Field.Options
|
|
26
|
-
:align="Field.Options
|
|
27
|
-
:dense="Field.Options
|
|
25
|
+
:vertical="Field.Options?.vertical || false"
|
|
26
|
+
:align="Field.Options?.align || 'left'"
|
|
27
|
+
:dense="Field.Options?.dense">
|
|
28
28
|
<q-tab
|
|
29
29
|
v-for="(t, idx) in fieldData.value" :key="idx"
|
|
30
30
|
:name="idx"
|
|
31
|
-
:label="t[Field.Options
|
|
32
|
-
:dense="Field.Options
|
|
31
|
+
:label="t[Field.Options?.LabelField]"
|
|
32
|
+
:dense="Field.Options?.dense">
|
|
33
33
|
</q-tab>
|
|
34
34
|
</q-tabs>
|
|
35
35
|
<q-tab-panels v-model="tab">
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
v-for="(t, idx) in fieldData.value" :key="idx"
|
|
38
38
|
:name="idx">
|
|
39
39
|
<free-field
|
|
40
|
-
v-for="(field, idx) in Field.Options
|
|
40
|
+
v-for="(field, idx) in Field.Options?.List"
|
|
41
41
|
:Field="field"
|
|
42
42
|
:values="t"
|
|
43
43
|
:key="idx"
|
|
@@ -149,7 +149,7 @@ export default defineComponent({
|
|
|
149
149
|
</script>
|
|
150
150
|
|
|
151
151
|
<style lang="scss" scoped>
|
|
152
|
-
.
|
|
152
|
+
.free-field-tabs {
|
|
153
153
|
&-tabs-wrapper {
|
|
154
154
|
margin-left: 12px;
|
|
155
155
|
border: 1px solid rgba($color: #000000, $alpha: 0.12);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, ref, watchEffect, computed } from 'vue';
|
|
1
|
+
import { defineComponent, h, ref, watchEffect, computed, useAttrs } from 'vue';
|
|
2
2
|
import { QInput } from 'quasar';
|
|
3
3
|
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
@@ -24,10 +24,10 @@ export default defineComponent({
|
|
|
24
24
|
...freeFieldProps,
|
|
25
25
|
},
|
|
26
26
|
emits: ['input'],
|
|
27
|
-
setup(props, { emit, slots, expose }){
|
|
27
|
+
setup(props, { emit, slots, expose, attrs }){
|
|
28
28
|
if (!props.Field) return {};
|
|
29
29
|
|
|
30
|
-
const { fieldData, setFieldData } = useFreeField(props);
|
|
30
|
+
const { fieldData, setFieldData, inputControlSettings } = useFreeField(props);
|
|
31
31
|
|
|
32
32
|
const rows = ref(3);
|
|
33
33
|
|
|
@@ -53,6 +53,8 @@ export default defineComponent({
|
|
|
53
53
|
readonly: props.Field?.ReadOnly,
|
|
54
54
|
rows: rows.value,
|
|
55
55
|
|
|
56
|
+
...inputControlSettings.value,
|
|
57
|
+
|
|
56
58
|
class: 'full-width',
|
|
57
59
|
style: props.Field.Info?.Style,
|
|
58
60
|
|
|
@@ -72,10 +74,11 @@ export default defineComponent({
|
|
|
72
74
|
})
|
|
73
75
|
|
|
74
76
|
return () => h('div', {
|
|
75
|
-
class: '
|
|
77
|
+
class: 'free-field-text',
|
|
76
78
|
}, [
|
|
77
79
|
slots.warning && h('div', {
|
|
78
80
|
class: props.Field.Label ? 'warning-with-label' : 'warning-without-label',
|
|
81
|
+
style: props.Field.Label ? 'margin-left: var(--field-label-width)' : '',
|
|
79
82
|
}, slots.warning()),
|
|
80
83
|
props.Field.ReadOnly ? readonlyNode() : inputNode.value,
|
|
81
84
|
]);
|