free-fe-core-modules 0.0.7 → 0.0.9
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/README.md +2 -2
- package/components/Basic/SummaryHead.vue +1 -6
- package/components/Dialog/BasicDialog.vue +140 -128
- package/components/SlidingNews/index.vue +12 -23
- package/composible/useFormValidator.js +8 -7
- package/composible/useObjectData.js +2 -2
- package/free-field/Fields/ApiCall.js +1 -4
- package/free-field/Fields/Boolean.js +1 -4
- package/free-field/Fields/Check.js +1 -4
- package/free-field/Fields/Column.vue +126 -0
- package/free-field/Fields/Date.js +1 -4
- package/free-field/Fields/DateRange.js +1 -4
- package/free-field/Fields/DynamicList.js +1 -4
- package/free-field/Fields/Labels.vue +1 -0
- package/free-field/Fields/Number.js +3 -6
- package/free-field/Fields/NumberRange.vue +145 -0
- package/free-field/Fields/Password.js +2 -5
- package/free-field/Fields/Permission.vue +1 -0
- package/free-field/Fields/PermissionEditor.vue +0 -1
- package/free-field/Fields/Row.vue +126 -0
- package/free-field/Fields/Search.vue +7 -10
- package/free-field/Fields/Select.vue +1 -1
- package/free-field/Fields/String.js +1 -4
- package/free-field/Fields/Tabs.vue +161 -0
- package/free-field/Fields/Text.js +1 -4
- package/free-field/Fields/Year.js +1 -4
- package/free-field/Fields/index.js +2 -38
- package/free-field/composible/fieldWrapper.js +1 -1
- package/free-field/composible/useFreeField.js +45 -112
- package/i18n/en-us/index.js +64 -67
- package/index.js +53 -50
- package/package.json +1 -1
- package/router/dict/data.js +0 -4
- package/router/error/data.js +0 -4
- package/router/menu/data.js +0 -4
- package/router/system/data.js +3 -4
- package/view/dict/index.vue +38 -24
- package/view/error/list.vue +17 -20
- package/view/menu/index.vue +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, defineComponent, getCurrentInstance, h, computed, watch, watchEffect } from 'vue';
|
|
2
2
|
import { QInput, QIcon, QPopupProxy, QDate } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
5
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
6
|
|
|
@@ -38,9 +38,6 @@ export default defineComponent({
|
|
|
38
38
|
...freeFieldProps,
|
|
39
39
|
},
|
|
40
40
|
emits: ['input'],
|
|
41
|
-
methods: {
|
|
42
|
-
...useFreeFieldMethods,
|
|
43
|
-
},
|
|
44
41
|
setup(props, { emit, slots, expose }){
|
|
45
42
|
if (!props.Field) return {};
|
|
46
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, defineComponent, getCurrentInstance, h, computed, watchEffect } from 'vue';
|
|
2
2
|
import { QTable, QTh, QTd, QTr, QIcon } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
5
|
import FreeField from '../composible/fieldWrapper';
|
|
6
6
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
@@ -177,9 +177,6 @@ export default defineComponent({
|
|
|
177
177
|
selection: { type: String, default: 'none' },
|
|
178
178
|
},
|
|
179
179
|
emits: ['input', 'add', 'delete'],
|
|
180
|
-
methods: {
|
|
181
|
-
...useFreeFieldMethods,
|
|
182
|
-
},
|
|
183
180
|
setup(props, { emit, slots, expose }){
|
|
184
181
|
if (!props.Field) {
|
|
185
182
|
return () => null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, watch, computed } from 'vue';
|
|
2
2
|
import { QInput } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
5
5
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
6
6
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
@@ -93,9 +93,6 @@ export default defineComponent({
|
|
|
93
93
|
...freeFieldProps,
|
|
94
94
|
},
|
|
95
95
|
emits: ['input'],
|
|
96
|
-
methods: {
|
|
97
|
-
...useFreeFieldMethods,
|
|
98
|
-
},
|
|
99
96
|
setup(props, { emit, slots , expose }){
|
|
100
97
|
if (!props.Field) return {};
|
|
101
98
|
|
|
@@ -115,7 +112,7 @@ export default defineComponent({
|
|
|
115
112
|
v = Number(props.Field.MaxValue);
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
setFieldData(v);
|
|
115
|
+
setFieldData(Number(v));
|
|
119
116
|
})
|
|
120
117
|
|
|
121
118
|
const readonlyNode = () => h(ReadonlyContent, {
|
|
@@ -150,7 +147,7 @@ export default defineComponent({
|
|
|
150
147
|
|
|
151
148
|
modelValue: fieldData.value,
|
|
152
149
|
'onUpdate:modelValue': (v) => {
|
|
153
|
-
setFieldData(v, emit);
|
|
150
|
+
setFieldData(Number(v), emit);
|
|
154
151
|
},
|
|
155
152
|
}, {
|
|
156
153
|
before,
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="input-field-number-range simple-field">
|
|
3
|
+
<span v-if="Field.ReadOnly">
|
|
4
|
+
<span
|
|
5
|
+
:class="`field-label field-label-readonly ${(Field.Label && Field.Label.trim().length)
|
|
6
|
+
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
7
|
+
v-if="Field.Label"
|
|
8
|
+
>
|
|
9
|
+
<q-tooltip v-if="Field.Description" anchor="top right">{{Field.Description}}</q-tooltip>
|
|
10
|
+
{{Field.Label || ''}}
|
|
11
|
+
<span v-if="Field.Required" class="required-mark">*</span>
|
|
12
|
+
</span>
|
|
13
|
+
<span class="readonly-content">{{fieldData}}</span>
|
|
14
|
+
</span>
|
|
15
|
+
<span v-else class="row items-center no-wrap">
|
|
16
|
+
<q-input
|
|
17
|
+
:readonly="Field.ReadOnly"
|
|
18
|
+
v-bind="$attrs"
|
|
19
|
+
:placeholder="$attrs.placeholder || $t(getModule('field-components').config['defaultInputFieldPlaceholder'])"
|
|
20
|
+
v-on="$listeners"
|
|
21
|
+
hide-bottom-space
|
|
22
|
+
@input="rangeChanged"
|
|
23
|
+
type="number"
|
|
24
|
+
v-model.number="range.min"
|
|
25
|
+
:ref="`input_field_validator_${Field.Name || Field.Label}`"
|
|
26
|
+
:maxlength="maxlength"
|
|
27
|
+
>
|
|
28
|
+
<template
|
|
29
|
+
v-slot:prepend
|
|
30
|
+
v-if="Field.Options && Field.Options.Prefix"
|
|
31
|
+
>
|
|
32
|
+
<span class="prefix">{{Field.Options.Prefix}}</span>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<template
|
|
36
|
+
v-slot:append
|
|
37
|
+
v-if="Field.Options && Field.Options.Postfix"
|
|
38
|
+
>
|
|
39
|
+
<span class="postfix">{{Field.Options.Postfix}}</span>
|
|
40
|
+
</template>
|
|
41
|
+
</q-input>
|
|
42
|
+
<span class="input-field-range-separator">{{`${Field.Separator || '~'}`}}</span>
|
|
43
|
+
<q-input
|
|
44
|
+
:readonly="Field.ReadOnly"
|
|
45
|
+
v-bind="$attrs"
|
|
46
|
+
:placeholder="$attrs.placeholder || $t(getModule('field-components').config['defaultInputFieldPlaceholder'])"
|
|
47
|
+
v-on="$listeners"
|
|
48
|
+
hide-bottom-space
|
|
49
|
+
@input="rangeChanged"
|
|
50
|
+
type="number"
|
|
51
|
+
v-model.number="range.max"
|
|
52
|
+
:ref="`input_field_validator_${Field.Name || Field.Label}2`"
|
|
53
|
+
:maxlength="maxlength"
|
|
54
|
+
>
|
|
55
|
+
<template
|
|
56
|
+
v-slot:prepend
|
|
57
|
+
v-if="Field.Options && Field.Options.Prefix"
|
|
58
|
+
>
|
|
59
|
+
<span class="prefix">{{Field.Options.Prefix}}</span>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<template
|
|
63
|
+
v-slot:append
|
|
64
|
+
v-if="Field.Options && Field.Options.Postfix"
|
|
65
|
+
>
|
|
66
|
+
<span class="postfix">{{Field.Options.Postfix}}</span>
|
|
67
|
+
</template>
|
|
68
|
+
</q-input>
|
|
69
|
+
</span>
|
|
70
|
+
|
|
71
|
+
<slot name="warning"></slot>
|
|
72
|
+
</span>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script>
|
|
76
|
+
import { InputFieldMixin } from 'eis-admin-mixins';
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
name: 'InputFieldNumberRange',
|
|
80
|
+
mixins: [InputFieldMixin],
|
|
81
|
+
fieldInfo: {
|
|
82
|
+
Category: 'Simple',
|
|
83
|
+
Label: '数字范围',
|
|
84
|
+
Value: 'NumberRange',
|
|
85
|
+
Extra: [
|
|
86
|
+
{
|
|
87
|
+
Type: 'String',
|
|
88
|
+
Label: '最小值',
|
|
89
|
+
Name: 'MinValue',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
Type: 'String',
|
|
93
|
+
Label: '最大值',
|
|
94
|
+
Name: 'MaxValue',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
Description: '',
|
|
98
|
+
},
|
|
99
|
+
data() {
|
|
100
|
+
return {
|
|
101
|
+
range: {
|
|
102
|
+
min: 0,
|
|
103
|
+
max: 0,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
watch: {
|
|
108
|
+
fieldData() {
|
|
109
|
+
const yl = (this.fieldData || '').split(this.Field.Separator || '~');
|
|
110
|
+
[this.range.min, this.range.max] = yl;
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
maxlength() {
|
|
115
|
+
if (this.Field && this.Field.Options && this.Field.Options.MaxLength) {
|
|
116
|
+
return this.Field.Options.MaxLength;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return '';
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
rangeChanged() {
|
|
124
|
+
let min = Number(this.range.min);
|
|
125
|
+
let max = Number(this.range.max);
|
|
126
|
+
if (!min && min !== 0 && !max && max !== 0) return;
|
|
127
|
+
|
|
128
|
+
const minValue = this.Field.MinValue !== void 0 && Number(this.Field.MinValue) || -Infinity;
|
|
129
|
+
const maxValue = this.Field.MaxValue !== void 0 && Number(this.Field.MaxValue) || Infinity;
|
|
130
|
+
|
|
131
|
+
min = Math.max(min, minValue);
|
|
132
|
+
min = Math.min(min, maxValue);
|
|
133
|
+
|
|
134
|
+
max = Math.max(max, minValue);
|
|
135
|
+
max = Math.min(max, maxValue);
|
|
136
|
+
|
|
137
|
+
this.fieldData = [min, max].join(
|
|
138
|
+
this.Field.Separator || '~',
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
this.$emit('input');
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, ref, computed } from 'vue';
|
|
2
2
|
import { QInput, QIcon } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
5
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
6
|
|
|
@@ -29,9 +29,6 @@ export default defineComponent({
|
|
|
29
29
|
...freeFieldProps,
|
|
30
30
|
},
|
|
31
31
|
emits: ['input'],
|
|
32
|
-
methods: {
|
|
33
|
-
...useFreeFieldMethods,
|
|
34
|
-
},
|
|
35
32
|
setup(props, { emit, slots, expose }){
|
|
36
33
|
if (!props.Field) return {};
|
|
37
34
|
|
|
@@ -50,7 +47,7 @@ export default defineComponent({
|
|
|
50
47
|
},
|
|
51
48
|
});
|
|
52
49
|
|
|
53
|
-
const inputNode = () =>
|
|
50
|
+
const inputNode = computed(() => h(QInput, {
|
|
54
51
|
type: isPwd.value ? 'password' : 'text',
|
|
55
52
|
maxlength: props.Field.Options?.MaxLength,
|
|
56
53
|
autocomplete: props.Field.Options?.autocomplete ? '' : 'new-password',
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-field-row row" :class="rowClasses">
|
|
3
|
+
<input-field
|
|
4
|
+
v-for="(field, idx) in Field.Options.List"
|
|
5
|
+
:Field="field"
|
|
6
|
+
:values="fieldData"
|
|
7
|
+
:key="idx"
|
|
8
|
+
@input="$emit('input')"></input-field>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { InputFieldMixin } from 'eis-admin-mixins';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'InputFieldRow',
|
|
17
|
+
mixins: [InputFieldMixin],
|
|
18
|
+
fieldInfo: {
|
|
19
|
+
Category: 'Container',
|
|
20
|
+
Label: '行',
|
|
21
|
+
Value: 'Row',
|
|
22
|
+
Extra: [
|
|
23
|
+
{
|
|
24
|
+
Label: '不换行',
|
|
25
|
+
Name: 'Options.NoWrap',
|
|
26
|
+
Type: 'Bollean',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
Label: '竖向对齐',
|
|
30
|
+
Name: 'Options.ItemsAlign',
|
|
31
|
+
Type: 'Select',
|
|
32
|
+
Options: [
|
|
33
|
+
{
|
|
34
|
+
Label: '居上',
|
|
35
|
+
Value: 'items-start',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
Label: '居中',
|
|
39
|
+
Value: 'items-center',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
Label: '居下',
|
|
43
|
+
Value: 'items-end',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
Label: '横向对齐',
|
|
49
|
+
Name: 'Options.JustifyAlign',
|
|
50
|
+
Type: 'Select',
|
|
51
|
+
Options: [
|
|
52
|
+
{
|
|
53
|
+
Label: '居左',
|
|
54
|
+
Value: 'justify-start',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
Label: '居中',
|
|
58
|
+
Value: 'justify-center',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Label: '居右',
|
|
62
|
+
Value: 'justify-end',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
Label: '围绕',
|
|
66
|
+
Value: 'justify-around',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
Label: '之间',
|
|
70
|
+
Value: 'justify-between',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
Label: '均匀',
|
|
74
|
+
Value: 'justify-evently',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
Label: '字段',
|
|
80
|
+
Name: 'Options.List',
|
|
81
|
+
Type: 'FieldList',
|
|
82
|
+
Options: {
|
|
83
|
+
Columns: [
|
|
84
|
+
{
|
|
85
|
+
Label: '#',
|
|
86
|
+
Name: 'Index',
|
|
87
|
+
sortable: true,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
Label: '类型',
|
|
91
|
+
Name: 'Type',
|
|
92
|
+
style: 'max-width: 120px;',
|
|
93
|
+
sortable: true,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
Label: '名称',
|
|
97
|
+
Name: 'Name',
|
|
98
|
+
style: 'max-width: 200px;',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
Label: '默认',
|
|
102
|
+
Name: 'Default',
|
|
103
|
+
style: 'max-width: 200px;',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
Label: '标题',
|
|
107
|
+
Name: 'Label',
|
|
108
|
+
style: 'max-width: 200px;',
|
|
109
|
+
sortable: true,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
Description: '',
|
|
116
|
+
},
|
|
117
|
+
computed: {
|
|
118
|
+
rowClasses() {
|
|
119
|
+
return '';
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="scss" scoped>
|
|
126
|
+
</style>
|
|
@@ -350,9 +350,9 @@ export default defineComponent({
|
|
|
350
350
|
},
|
|
351
351
|
},
|
|
352
352
|
watch: {
|
|
353
|
-
fieldData(n, o) {
|
|
353
|
+
'fieldData.value': function(n, o) {
|
|
354
354
|
// init search data from exist id
|
|
355
|
-
if (
|
|
355
|
+
if (this.fieldData.value === void 0) {
|
|
356
356
|
this.searchSelected = [];
|
|
357
357
|
this.searchData = {};
|
|
358
358
|
this.searchDisplay = '';
|
|
@@ -406,14 +406,11 @@ export default defineComponent({
|
|
|
406
406
|
},
|
|
407
407
|
},
|
|
408
408
|
created() {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
}
|
|
409
|
+
this.searchColumns.forEach((col) => {
|
|
410
|
+
if (col.filters) {
|
|
411
|
+
col.format = (d) => this.$filter(col.filters, d);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
417
414
|
},
|
|
418
415
|
methods: {
|
|
419
416
|
search(p) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, h, computed } from 'vue';
|
|
2
|
-
import { useFreeField, freeFieldProps
|
|
2
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
3
3
|
import { QInput } from 'quasar';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
5
5
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
@@ -49,9 +49,6 @@ export default defineComponent({
|
|
|
49
49
|
...freeFieldProps,
|
|
50
50
|
},
|
|
51
51
|
emits: ['input'],
|
|
52
|
-
methods: {
|
|
53
|
-
...useFreeFieldMethods,
|
|
54
|
-
},
|
|
55
52
|
setup(props, { emit, slots, expose }){
|
|
56
53
|
if (!props.Field) return {};
|
|
57
54
|
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="input-field-tabs row no-wrap" v-if="Field">
|
|
3
|
+
<span
|
|
4
|
+
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
5
|
+
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
6
|
+
v-if="Field.Label !== void 0"
|
|
7
|
+
>
|
|
8
|
+
<q-tooltip
|
|
9
|
+
v-if="Field.Description"
|
|
10
|
+
anchor="top right"
|
|
11
|
+
>{{Field.Description}}</q-tooltip>
|
|
12
|
+
{{Field.Label || ''}}
|
|
13
|
+
<span
|
|
14
|
+
v-if="Field.Required"
|
|
15
|
+
class="required-mark"
|
|
16
|
+
>*</span>
|
|
17
|
+
</span>
|
|
18
|
+
|
|
19
|
+
<div class="col input-field-tabs-tabs-wrapper">
|
|
20
|
+
<q-tabs
|
|
21
|
+
class="tabs"
|
|
22
|
+
v-model="tab"
|
|
23
|
+
:shrink="true"
|
|
24
|
+
no-caps
|
|
25
|
+
:vertical="Field.Options.vertical || false"
|
|
26
|
+
:align="Field.Options.align || 'left'"
|
|
27
|
+
:dense="Field.Options && Field.Options.dense">
|
|
28
|
+
<q-tab
|
|
29
|
+
v-for="(t, idx) in fieldData.value" :key="idx"
|
|
30
|
+
:name="idx"
|
|
31
|
+
:label="t[Field.Options.LabelField]"
|
|
32
|
+
:dense="Field.Options && Field.Options.dense">
|
|
33
|
+
</q-tab>
|
|
34
|
+
</q-tabs>
|
|
35
|
+
<q-tab-panels v-model="tab">
|
|
36
|
+
<q-tab-panel
|
|
37
|
+
v-for="(t, idx) in fieldData.value" :key="idx"
|
|
38
|
+
:name="idx">
|
|
39
|
+
<free-field
|
|
40
|
+
v-for="(field, idx) in Field.Options.List"
|
|
41
|
+
:Field="field"
|
|
42
|
+
:values="t"
|
|
43
|
+
:key="idx"
|
|
44
|
+
ref="fieldsToValidate"
|
|
45
|
+
@input="fieldChanged"></free-field>
|
|
46
|
+
</q-tab-panel>
|
|
47
|
+
</q-tab-panels>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import { defineComponent, ref } from 'vue';
|
|
54
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
55
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
56
|
+
|
|
57
|
+
export default defineComponent({
|
|
58
|
+
name: 'InputFieldTabs',
|
|
59
|
+
fieldInfo: {
|
|
60
|
+
DataType: 'Array',
|
|
61
|
+
Category: 'Container',
|
|
62
|
+
Label: '标签页',
|
|
63
|
+
Value: 'Tabs',
|
|
64
|
+
Extra: [
|
|
65
|
+
{
|
|
66
|
+
Type: 'String',
|
|
67
|
+
Label: '标签字段名',
|
|
68
|
+
Name: 'Options.LabelField',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
Type: 'String',
|
|
72
|
+
Label: '数值字段名',
|
|
73
|
+
Name: 'Options.ValueField',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
Label: '字段',
|
|
77
|
+
Name: 'Options.List',
|
|
78
|
+
Type: 'FieldList',
|
|
79
|
+
Options: {
|
|
80
|
+
Columns: [
|
|
81
|
+
{
|
|
82
|
+
Label: '#',
|
|
83
|
+
Name: 'Index',
|
|
84
|
+
sortable: true,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
Label: '类型',
|
|
88
|
+
Name: 'Type',
|
|
89
|
+
style: 'max-width: 120px;',
|
|
90
|
+
sortable: true,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
Label: '名称',
|
|
94
|
+
Name: 'Name',
|
|
95
|
+
style: 'max-width: 200px;',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
Label: '默认',
|
|
99
|
+
Name: 'Default',
|
|
100
|
+
style: 'max-width: 200px;',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
Label: '标题',
|
|
104
|
+
Name: 'Label',
|
|
105
|
+
style: 'max-width: 200px;',
|
|
106
|
+
sortable: true,
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
Description: '',
|
|
113
|
+
},
|
|
114
|
+
props: {
|
|
115
|
+
...freeFieldProps,
|
|
116
|
+
},
|
|
117
|
+
emits: ['input'],
|
|
118
|
+
setup(props, { emit }) {
|
|
119
|
+
if(!props.Field) return () => null;
|
|
120
|
+
|
|
121
|
+
const { fieldData, setFieldData } = useFreeField(props);
|
|
122
|
+
const { validate } = useFormValidator('fieldsToValidate');
|
|
123
|
+
|
|
124
|
+
const tab = ref(0);
|
|
125
|
+
|
|
126
|
+
if (!Array.isArray(fieldData.value)) {
|
|
127
|
+
setFieldData([{}], emit)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (props.Field.Options?.ValueField && props.Field.Default) {
|
|
131
|
+
const defaultTab = fieldData.value.findIndex((d) => d[props.Field.Options?.ValueField] === props.Field.Default);
|
|
132
|
+
|
|
133
|
+
if (defaultTab >= 0) {
|
|
134
|
+
tab.value = defaultTab;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
tab,
|
|
140
|
+
fieldData,
|
|
141
|
+
|
|
142
|
+
fieldChanged: () => {
|
|
143
|
+
emit('input');
|
|
144
|
+
},
|
|
145
|
+
validate,
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style lang="scss" scoped>
|
|
152
|
+
.input-field-tabs {
|
|
153
|
+
&-tabs-wrapper {
|
|
154
|
+
margin-left: 12px;
|
|
155
|
+
border: 1px solid rgba($color: #000000, $alpha: 0.12);
|
|
156
|
+
.tabs {
|
|
157
|
+
border-bottom: 1px solid;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, ref, watchEffect, computed } from 'vue';
|
|
2
2
|
import { QInput } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import ReadonlyContent from '../composible/readonlyContent';
|
|
5
5
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
6
6
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
@@ -24,9 +24,6 @@ export default defineComponent({
|
|
|
24
24
|
...freeFieldProps,
|
|
25
25
|
},
|
|
26
26
|
emits: ['input'],
|
|
27
|
-
methods: {
|
|
28
|
-
...useFreeFieldMethods,
|
|
29
|
-
},
|
|
30
27
|
setup(props, { emit, slots, expose }){
|
|
31
28
|
if (!props.Field) return {};
|
|
32
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, computed } from 'vue';
|
|
2
2
|
import { QSelect } from 'quasar';
|
|
3
|
-
import { useFreeField, freeFieldProps
|
|
3
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
4
4
|
import freeFieldLabel from '../composible/freeFieldLabel';
|
|
5
5
|
import { useFormValidator} from '../../composible/useFormValidator';
|
|
6
6
|
|
|
@@ -72,9 +72,6 @@ export default defineComponent({
|
|
|
72
72
|
...freeFieldProps,
|
|
73
73
|
},
|
|
74
74
|
emits: ['input'],
|
|
75
|
-
methods: {
|
|
76
|
-
...useFreeFieldMethods,
|
|
77
|
-
},
|
|
78
75
|
setup(props, { emit, slots, expose }){
|
|
79
76
|
if (!props.Field) return {};
|
|
80
77
|
|