free-fe-core-modules 0.0.2 → 0.0.4
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 +2 -4
- package/components/Basic/LeveledMenus.vue +0 -5
- package/components/Basic/SummaryHead.vue +23 -3
- package/components/Dialog/BasicDialog.vue +2 -3
- package/components/SlidingCarousel/index.vue +13 -3
- package/components/SlidingNews/index.vue +13 -3
- package/components/ThemeSwitch/index.vue +7 -5
- package/composible/useObjectData.js +69 -0
- package/free-field/Fields/AgreementCheck.js +170 -0
- package/free-field/Fields/ApiCall.js +123 -0
- package/{field-components/Fields/Boolean.vue → free-field/Fields/Boolean.js} +40 -46
- package/free-field/Fields/Category.js +28 -0
- package/free-field/Fields/Check.js +106 -0
- package/free-field/Fields/Customize.js +87 -0
- package/free-field/Fields/Date.js +133 -0
- package/free-field/Fields/DateRange.js +226 -0
- package/free-field/Fields/DynamicList.js +565 -0
- package/{field-components → free-field}/Fields/FixedList.vue +78 -83
- package/free-field/Fields/InputFieldList.vue +324 -0
- package/{field-components → free-field}/Fields/Labels.vue +24 -15
- package/{field-components → free-field}/Fields/MixedTable.vue +53 -61
- package/free-field/Fields/Number.js +167 -0
- package/free-field/Fields/Password.js +81 -0
- package/{field-components → free-field}/Fields/Permission.vue +17 -13
- package/{field-components → free-field}/Fields/PermissionEditor.vue +62 -105
- package/{field-components → free-field}/Fields/QueryFilters.vue +65 -48
- package/{field-components → free-field}/Fields/RadioList.vue +36 -12
- package/{field-components → free-field}/Fields/Rich.vue +104 -114
- package/{field-components → free-field}/Fields/Search.vue +35 -26
- package/{field-components → free-field}/Fields/Select.vue +116 -87
- package/{field-components → free-field}/Fields/SelectionChain.vue +89 -67
- package/{field-components/Fields/Separator.vue → free-field/Fields/Separator.js} +11 -16
- package/{field-components → free-field}/Fields/SingleList.vue +27 -21
- package/free-field/Fields/Static.js +27 -0
- package/free-field/Fields/String.js +105 -0
- package/free-field/Fields/Text.js +80 -0
- package/{field-components → free-field}/Fields/Time.vue +59 -43
- package/{field-components → free-field}/Fields/TimeRange.vue +107 -92
- package/free-field/Fields/Year.js +137 -0
- package/{field-components → free-field}/Fields/YearRange.vue +63 -73
- package/{field-components → free-field}/Fields/index.js +28 -30
- package/free-field/composible/fieldWrapper.js +221 -0
- package/free-field/composible/freeFieldLabel.js +22 -0
- package/free-field/composible/readonlyContent.js +36 -0
- package/free-field/composible/useFileSizeUtils.js +52 -0
- package/free-field/composible/useFreeField.js +143 -0
- package/{field-components → free-field}/index.js +3 -3
- package/i18n/en-us/index.js +1 -1
- package/i18n/zh-cn/index.js +1 -1
- package/index.js +1 -4
- package/package.json +2 -2
- package/router/error/data.js +4 -1
- package/view/dict/index.vue +13 -2
- package/view/error/list.vue +22 -14
- package/view/menu/index.vue +19 -4
- package/view/system/index.vue +15 -2
- package/field-components/Fields/AgreementCheck.vue +0 -161
- package/field-components/Fields/ApiCall.vue +0 -139
- package/field-components/Fields/Category.vue +0 -33
- package/field-components/Fields/Check.vue +0 -131
- package/field-components/Fields/Customize.vue +0 -103
- package/field-components/Fields/Date.vue +0 -142
- package/field-components/Fields/DateRange.vue +0 -199
- package/field-components/Fields/DynamicList.vue +0 -575
- package/field-components/Fields/FieldEditor.vue +0 -379
- package/field-components/Fields/File.vue +0 -382
- package/field-components/Fields/FileList.vue +0 -405
- package/field-components/Fields/FileListCombined.vue +0 -142
- package/field-components/Fields/Image.vue +0 -328
- package/field-components/Fields/ImageList.vue +0 -285
- package/field-components/Fields/ImageListCombined.vue +0 -76
- package/field-components/Fields/InputFieldList.vue +0 -299
- package/field-components/Fields/Number.vue +0 -247
- package/field-components/Fields/Password.vue +0 -79
- package/field-components/Fields/Static.vue +0 -22
- package/field-components/Fields/String.vue +0 -185
- package/field-components/Fields/Text.vue +0 -89
- package/field-components/Fields/UltimateFile.vue +0 -100
- package/field-components/Fields/Year.vue +0 -124
- package/field-components/Fields/components/FieldTypeOptions.vue +0 -248
- package/field-components/components/FieldComponents.vue +0 -246
- package/free-fields/AutoHide.js +0 -66
- package/free-fields/CenterContent.js +0 -15
- package/free-fields/Draggable.js +0 -30
- package/free-fields/Droppable.js +0 -114
- package/free-fields/EditableString.js +0 -63
- package/free-fields/FieldCategory.js +0 -83
- package/free-fields/FieldTypeSelect.js +0 -94
- package/free-fields/fieldEditors/arrayEditor.js +0 -3
- package/free-fields/fieldEditors/boolEditor.js +0 -22
- package/free-fields/fieldEditors/dateEditor.js +0 -23
- package/free-fields/fieldEditors/datetimeEditor.js +0 -23
- package/free-fields/fieldEditors/index.js +0 -21
- package/free-fields/fieldEditors/jsonEditor.js +0 -371
- package/free-fields/fieldEditors/labeledField.js +0 -74
- package/free-fields/fieldEditors/numberEditor.js +0 -51
- package/free-fields/fieldEditors/objectEditor.js +0 -3
- package/free-fields/fieldEditors/selectEditor.js +0 -0
- package/free-fields/fieldEditors/stringEditor.js +0 -49
- package/free-fields/fieldEditors/textEditor.js +0 -50
- package/free-fields/fieldEditors/timeEditor.js +0 -23
- package/free-fields/index.js +0 -402
- /package/{field-components/Display → free-field/Layout}/index.js +0 -0
- /package/{field-components → free-field}/style.sass +0 -0
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="input-field-list">
|
|
3
|
-
<dynamic-list
|
|
4
|
-
:Field="localField"
|
|
5
|
-
:values="data"
|
|
6
|
-
readonly
|
|
7
|
-
ref="fieldList"
|
|
8
|
-
selection="multiple"
|
|
9
|
-
>
|
|
10
|
-
<template v-slot:top>
|
|
11
|
-
<q-btn-group class="action-buttons">
|
|
12
|
-
<q-btn
|
|
13
|
-
icon="content_copy"
|
|
14
|
-
@click="copy"
|
|
15
|
-
>
|
|
16
|
-
<q-tooltip>拷贝选中</q-tooltip>
|
|
17
|
-
</q-btn>
|
|
18
|
-
<q-btn
|
|
19
|
-
icon="content_paste"
|
|
20
|
-
@click="paste"
|
|
21
|
-
>
|
|
22
|
-
<q-tooltip>粘贴</q-tooltip>
|
|
23
|
-
</q-btn>
|
|
24
|
-
<q-btn
|
|
25
|
-
icon="update"
|
|
26
|
-
@click="batch"
|
|
27
|
-
v-if="$refs.fieldList && $refs.fieldList.selected.length > 0"
|
|
28
|
-
>
|
|
29
|
-
<q-tooltip>批量修改</q-tooltip>
|
|
30
|
-
</q-btn>
|
|
31
|
-
</q-btn-group>
|
|
32
|
-
</template>
|
|
33
|
-
<template v-slot:header-actions>
|
|
34
|
-
<q-btn
|
|
35
|
-
flat
|
|
36
|
-
round
|
|
37
|
-
icon="add"
|
|
38
|
-
@click="addField"
|
|
39
|
-
></q-btn>
|
|
40
|
-
</template>
|
|
41
|
-
<template v-slot:body-actions="props">
|
|
42
|
-
<q-btn
|
|
43
|
-
flat
|
|
44
|
-
round
|
|
45
|
-
icon="edit"
|
|
46
|
-
@click="editingField=props.row"
|
|
47
|
-
></q-btn>
|
|
48
|
-
<q-btn
|
|
49
|
-
flat
|
|
50
|
-
round
|
|
51
|
-
icon="delete"
|
|
52
|
-
@click="deleteField(props)"
|
|
53
|
-
></q-btn>
|
|
54
|
-
</template>
|
|
55
|
-
<template v-slot:warning>
|
|
56
|
-
<slot name="warning"></slot>
|
|
57
|
-
</template>
|
|
58
|
-
</dynamic-list>
|
|
59
|
-
|
|
60
|
-
<free-field
|
|
61
|
-
:Field="editingFieldField"
|
|
62
|
-
:values="editingField"
|
|
63
|
-
@cancel="editingField = undefined; $emit('cancel')"
|
|
64
|
-
@save="saveField"
|
|
65
|
-
@input="$emit('input')"
|
|
66
|
-
@update:field="editingFieldChanged"
|
|
67
|
-
></free-field>
|
|
68
|
-
</div>
|
|
69
|
-
</template>
|
|
70
|
-
|
|
71
|
-
<script>
|
|
72
|
-
import { defineComponent } from 'vue';
|
|
73
|
-
import mixins from 'free-fe-mixins';
|
|
74
|
-
import DynamicList from './DynamicList';
|
|
75
|
-
|
|
76
|
-
const clipBoardStore = {
|
|
77
|
-
content: '',
|
|
78
|
-
items: [],
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// const DynamicList = { ...DList };
|
|
82
|
-
// DynamicList.mixins = (DynamicList.mixins || []).concat(InputFieldMixin.mixins);
|
|
83
|
-
// DynamicList.props = { ...InputFieldMixin.props, ...DynamicList.props };
|
|
84
|
-
// DynamicList.computed = {
|
|
85
|
-
|
|
86
|
-
// ...InputFieldMixin.computed,
|
|
87
|
-
// ...DynamicList.computed,
|
|
88
|
-
// };
|
|
89
|
-
// DynamicList.methods = {
|
|
90
|
-
|
|
91
|
-
// ...InputFieldMixin.methods,
|
|
92
|
-
// ...DynamicList.methods,
|
|
93
|
-
// };
|
|
94
|
-
// DynamicList.created = DynamicList.created || InputFieldMixin.created;
|
|
95
|
-
|
|
96
|
-
export default defineComponent({
|
|
97
|
-
name: 'InputFieldList',
|
|
98
|
-
mixins: [mixins.InputFieldMixin],
|
|
99
|
-
emits:['save', 'delete', 'cancel','paste:fields', 'batch:fields'],
|
|
100
|
-
fieldInfo: {
|
|
101
|
-
Category: 'Advanced',
|
|
102
|
-
Label: '字段列表',
|
|
103
|
-
Value: 'FieldList',
|
|
104
|
-
Description: '',
|
|
105
|
-
},
|
|
106
|
-
components: {
|
|
107
|
-
DynamicList,
|
|
108
|
-
},
|
|
109
|
-
data() {
|
|
110
|
-
return {
|
|
111
|
-
editingField: undefined,
|
|
112
|
-
changedFields: [],
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
computed: {
|
|
116
|
-
editingFieldField() {
|
|
117
|
-
return {
|
|
118
|
-
Type: 'FieldEditor',
|
|
119
|
-
Name: '',
|
|
120
|
-
show: !!this.editingField,
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
localField() {
|
|
124
|
-
return {
|
|
125
|
-
Type: 'DynamicList',
|
|
126
|
-
showTop: true,
|
|
127
|
-
Name: this.Field && this.Field.Name ? this.Field.Name : 'Fields',
|
|
128
|
-
Options: {
|
|
129
|
-
Columns:
|
|
130
|
-
this.Field && this.Field.Options && this.Field.Options.Columns
|
|
131
|
-
? this.Field.Options.Columns
|
|
132
|
-
: [
|
|
133
|
-
{
|
|
134
|
-
Label: '#',
|
|
135
|
-
Name: 'Index',
|
|
136
|
-
sortable: true,
|
|
137
|
-
style: 'max-width: 100px;',
|
|
138
|
-
},
|
|
139
|
-
// {
|
|
140
|
-
// Label: '日期',
|
|
141
|
-
// Name: 'LastUpdateDate',
|
|
142
|
-
// style: 'max-width: 160px;',
|
|
143
|
-
// sortable: true,
|
|
144
|
-
// Options: {
|
|
145
|
-
// Filters: 'normalDate',
|
|
146
|
-
// },
|
|
147
|
-
// },
|
|
148
|
-
{
|
|
149
|
-
Label: '名称',
|
|
150
|
-
Name: 'Name',
|
|
151
|
-
style: 'max-width: 300px; overflow: hidden',
|
|
152
|
-
sortable: true,
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
Label: '标题',
|
|
156
|
-
Name: 'Label',
|
|
157
|
-
style: 'max-width: 300px; min-width: 100px',
|
|
158
|
-
sortable: true,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
Label: '类型',
|
|
162
|
-
Name: 'Type',
|
|
163
|
-
style: 'max-width: 200px; min-width: 100px',
|
|
164
|
-
sortable: true,
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
methods: {
|
|
172
|
-
addField() {
|
|
173
|
-
let newIndex = 1;
|
|
174
|
-
|
|
175
|
-
if (this.data) {
|
|
176
|
-
const fName = this.Field && this.Field.Name ? this.Field.Name : 'Fields';
|
|
177
|
-
const fData = this.data[fName];
|
|
178
|
-
|
|
179
|
-
if (fData && fData.length) {
|
|
180
|
-
newIndex = fData[fData.length - 1].Index + 1;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
this.editingField = {
|
|
185
|
-
Index: newIndex,
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
saveField() {
|
|
189
|
-
if (!this.editingField) return;
|
|
190
|
-
const theField = { ...this.editingField };
|
|
191
|
-
|
|
192
|
-
if (theField.isBatchEditing) {
|
|
193
|
-
if (this.$refs.fieldList.selected.length > 0) {
|
|
194
|
-
const items = [];
|
|
195
|
-
for (let i = 0; i < this.$refs.fieldList.selected.length; i += 1) {
|
|
196
|
-
const item = this.$refs.fieldList.selected[i];
|
|
197
|
-
|
|
198
|
-
if (item && item.id) {
|
|
199
|
-
items.push(item.id);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const newFld = {};
|
|
204
|
-
for (let i = 0; i < this.changedFields.length; i += 1) {
|
|
205
|
-
const fld = this.changedFields[i];
|
|
206
|
-
if (fld && typeof theField[fld] !== 'undefined') {
|
|
207
|
-
newFld[fld] = theField[fld];
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
this.editingField = undefined;
|
|
211
|
-
this.$emit(
|
|
212
|
-
'batch:fields',
|
|
213
|
-
{ ...newFld, ids: items.join(',') },
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
} else {
|
|
217
|
-
if (typeof theField.auto__index === 'undefined') {
|
|
218
|
-
// adding new
|
|
219
|
-
this.$refs.fieldList.addRow(theField);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
this.editingField = undefined;
|
|
223
|
-
|
|
224
|
-
this.$emit('save', theField);
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
deleteField(p) {
|
|
228
|
-
this.$refs.fieldList.deleteRow(p);
|
|
229
|
-
this.$emit('delete', p.row);
|
|
230
|
-
},
|
|
231
|
-
copy() {
|
|
232
|
-
clipBoardStore.items = [];
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
!this.$refs.fieldList
|
|
236
|
-
|| !this.$refs.fieldList.selected
|
|
237
|
-
|| this.$refs.fieldList.selected.length <= 0
|
|
238
|
-
) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
const items = [];
|
|
243
|
-
for (let i = 0; i < this.$refs.fieldList.selected.length; i += 1) {
|
|
244
|
-
const item = this.$refs.fieldList.selected[i];
|
|
245
|
-
|
|
246
|
-
if (item) {
|
|
247
|
-
items.push(item.id);
|
|
248
|
-
}
|
|
249
|
-
clipBoardStore.items.push(item);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (items.length <= 0) return;
|
|
253
|
-
|
|
254
|
-
clipBoardStore.content = `EIS_FLOW_FIELD_COPY:${items.join(',')}`;
|
|
255
|
-
},
|
|
256
|
-
paste() {
|
|
257
|
-
// local paste
|
|
258
|
-
if (clipBoardStore.items && clipBoardStore.items.length > 0) {
|
|
259
|
-
const fName = (this.Field && this.Field.Name) ? this.Field.Name : 'Fields';
|
|
260
|
-
this.data[fName] = this.data[fName] || [];
|
|
261
|
-
this.data[fName] = this.data[fName].concat(clipBoardStore.items.map((i) => {
|
|
262
|
-
delete i.id;
|
|
263
|
-
delete i.auto__index;
|
|
264
|
-
return i;
|
|
265
|
-
})).sort((a, b) => a.Index - b.Index);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// emit to parent
|
|
269
|
-
if (
|
|
270
|
-
clipBoardStore.content
|
|
271
|
-
&& clipBoardStore.content.startsWith('EIS_FLOW_FIELD_COPY:')
|
|
272
|
-
) {
|
|
273
|
-
this.$emit(
|
|
274
|
-
'paste:fields',
|
|
275
|
-
clipBoardStore.content.substr('EIS_FLOW_FIELD_COPY:'.length),
|
|
276
|
-
clipBoardStore.items,
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
editingFieldChanged(f) {
|
|
281
|
-
if (!f) return;
|
|
282
|
-
this.changedFields.push(f);
|
|
283
|
-
},
|
|
284
|
-
batch() {
|
|
285
|
-
if (
|
|
286
|
-
!this.$refs.fieldList
|
|
287
|
-
|| !this.$refs.fieldList.selected
|
|
288
|
-
|| this.$refs.fieldList.selected.length <= 0
|
|
289
|
-
) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
this.editingField = {
|
|
294
|
-
isBatchEditing: true,
|
|
295
|
-
};
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
});
|
|
299
|
-
</script>
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span
|
|
3
|
-
class="simple-field input-field-number row items-center no-wrap"
|
|
4
|
-
v-if="Field"
|
|
5
|
-
>
|
|
6
|
-
<span
|
|
7
|
-
v-if="Field.ReadOnly"
|
|
8
|
-
class="full-width"
|
|
9
|
-
>
|
|
10
|
-
<span
|
|
11
|
-
:class="`field-label field-label-readonly ${(Field.Label && Field.Label.trim().length)
|
|
12
|
-
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
13
|
-
v-if="typeof Field.Label !== 'undefined'"
|
|
14
|
-
>
|
|
15
|
-
<q-tooltip
|
|
16
|
-
v-if="Field.Description"
|
|
17
|
-
anchor="top right"
|
|
18
|
-
>{{Field.Description}}</q-tooltip>
|
|
19
|
-
{{Field.Label || ''}}
|
|
20
|
-
<span
|
|
21
|
-
v-if="Field.Required"
|
|
22
|
-
class="required-mark"
|
|
23
|
-
>*</span>
|
|
24
|
-
</span>
|
|
25
|
-
<span class="readonly-content">
|
|
26
|
-
<span
|
|
27
|
-
class="prefix"
|
|
28
|
-
v-if="Field.Options && Field.Options.Prefix"
|
|
29
|
-
>{{Field.Options.Prefix}}</span>
|
|
30
|
-
<span :style="(Field.Info && Field.Info.Style) ? Field.Info.Style : ''">{{fieldData}}</span>
|
|
31
|
-
<span
|
|
32
|
-
class="postfix"
|
|
33
|
-
v-if="Field.Options && Field.Options.Postfix"
|
|
34
|
-
>{{Field.Options.Postfix}}</span>
|
|
35
|
-
</span>
|
|
36
|
-
</span>
|
|
37
|
-
<q-input
|
|
38
|
-
v-else
|
|
39
|
-
:readonly="Field.ReadOnly"
|
|
40
|
-
v-bind="$attrs"
|
|
41
|
-
hide-bottom-space
|
|
42
|
-
@input="valueChanged"
|
|
43
|
-
type="number"
|
|
44
|
-
v-model.number="localData"
|
|
45
|
-
:ref="`input_field_validator_${Field.Name || Field.Label}`"
|
|
46
|
-
:maxlength="maxlength"
|
|
47
|
-
>
|
|
48
|
-
<template v-slot:before>
|
|
49
|
-
<span
|
|
50
|
-
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
51
|
-
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
52
|
-
v-if="typeof Field.Label !== 'undefined'"
|
|
53
|
-
>
|
|
54
|
-
<q-tooltip
|
|
55
|
-
v-if="Field.Description"
|
|
56
|
-
anchor="top right"
|
|
57
|
-
>{{Field.Description}}</q-tooltip>
|
|
58
|
-
{{Field.Label || ''}}
|
|
59
|
-
<span
|
|
60
|
-
v-if="Field.Required"
|
|
61
|
-
class="required-mark"
|
|
62
|
-
>*</span>
|
|
63
|
-
</span>
|
|
64
|
-
</template>
|
|
65
|
-
|
|
66
|
-
<template
|
|
67
|
-
v-slot:prepend
|
|
68
|
-
v-if="Field.Options && Field.Options.Prefix"
|
|
69
|
-
>
|
|
70
|
-
<span class="prefix">{{Field.Options.Prefix}}</span>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<template
|
|
74
|
-
v-slot:append
|
|
75
|
-
v-if="Field.Options && Field.Options.Postfix"
|
|
76
|
-
>
|
|
77
|
-
<span class="postfix">{{Field.Options.Postfix}}</span>
|
|
78
|
-
</template>
|
|
79
|
-
</q-input>
|
|
80
|
-
<slot name="warning"></slot>
|
|
81
|
-
</span>
|
|
82
|
-
</template>
|
|
83
|
-
|
|
84
|
-
<script>
|
|
85
|
-
import { defineComponent } from 'vue';
|
|
86
|
-
import mixins from 'free-fe-mixins';
|
|
87
|
-
|
|
88
|
-
export default defineComponent({
|
|
89
|
-
name: 'InputFieldNumber',
|
|
90
|
-
mixins: [mixins.InputFieldMixin],
|
|
91
|
-
emits:['input'],
|
|
92
|
-
fieldInfo: {
|
|
93
|
-
Category: 'Simple',
|
|
94
|
-
Label: '数字',
|
|
95
|
-
Value: 'Number',
|
|
96
|
-
Extra: [
|
|
97
|
-
{
|
|
98
|
-
Type: 'String',
|
|
99
|
-
Label: '前缀',
|
|
100
|
-
Name: 'Options.Prefix',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
Type: 'String',
|
|
104
|
-
Label: '后缀',
|
|
105
|
-
Name: 'Options.Postfix',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
Type: 'Number',
|
|
109
|
-
Label: '最小值',
|
|
110
|
-
Name: 'MinValue',
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
Type: 'Number',
|
|
114
|
-
Label: '最大值',
|
|
115
|
-
Name: 'MaxValue',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
Type: 'Number',
|
|
119
|
-
Label: '最大长度',
|
|
120
|
-
Name: 'Options.MaxLength',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
Type: 'DynamicList',
|
|
124
|
-
Label: '附加字段',
|
|
125
|
-
Name: 'Options.Extra',
|
|
126
|
-
Options: {
|
|
127
|
-
Columns: [
|
|
128
|
-
{
|
|
129
|
-
Label: '值范围',
|
|
130
|
-
Name: 'Value',
|
|
131
|
-
Type: 'Labels',
|
|
132
|
-
Options: {
|
|
133
|
-
Batch: true,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
Label: '不在其中时',
|
|
138
|
-
Type: 'Boolean',
|
|
139
|
-
Name: 'WhenNotIn',
|
|
140
|
-
Default: false,
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
Label: '字段',
|
|
144
|
-
Name: 'List',
|
|
145
|
-
Type: 'FieldList',
|
|
146
|
-
Options: {
|
|
147
|
-
Columns: [
|
|
148
|
-
{
|
|
149
|
-
Label: '#',
|
|
150
|
-
Name: 'Index',
|
|
151
|
-
sortable: true,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
Label: '名称',
|
|
155
|
-
Name: 'Name',
|
|
156
|
-
style: 'max-width: 200px;',
|
|
157
|
-
sortable: true,
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
Label: '标题',
|
|
161
|
-
Name: 'Label',
|
|
162
|
-
style: 'max-width: 200px;',
|
|
163
|
-
sortable: true,
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
Description: '',
|
|
173
|
-
},
|
|
174
|
-
data() {
|
|
175
|
-
return {
|
|
176
|
-
localData: 0,
|
|
177
|
-
};
|
|
178
|
-
},
|
|
179
|
-
watch: {
|
|
180
|
-
fieldData() {
|
|
181
|
-
this.localData = this.fieldData;
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
created() {
|
|
185
|
-
this.localData = this.fieldData;
|
|
186
|
-
},
|
|
187
|
-
computed: {
|
|
188
|
-
maxlength() {
|
|
189
|
-
if (this.Field && this.Field.Options && this.Field.Options.MaxLength) {
|
|
190
|
-
return this.Field.Options.MaxLength;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return '';
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
methods: {
|
|
197
|
-
valueChanged(d) {
|
|
198
|
-
if (!d) return;
|
|
199
|
-
|
|
200
|
-
if (!Number(d) && Number(d) !== 0) return;
|
|
201
|
-
|
|
202
|
-
let v = d;
|
|
203
|
-
if (typeof this.Field.MinValue !== 'undefined' && Number(this.Field.MinValue) > v) {
|
|
204
|
-
v = Number(this.Field.MinValue);
|
|
205
|
-
}
|
|
206
|
-
if (typeof this.Field.MaxValue !== 'undefined' && Number(this.Field.MaxValue) < v) {
|
|
207
|
-
v = Number(this.Field.MaxValue);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this.localData = v;
|
|
211
|
-
this.fieldData = v;
|
|
212
|
-
|
|
213
|
-
this.$emit('input');
|
|
214
|
-
},
|
|
215
|
-
initExtra() {
|
|
216
|
-
if (
|
|
217
|
-
this.Field
|
|
218
|
-
&& this.Field.Options
|
|
219
|
-
&& this.Field.Options.Extra
|
|
220
|
-
&& this.Field.Options.Extra.length > 0
|
|
221
|
-
&& this.fieldData
|
|
222
|
-
) {
|
|
223
|
-
const extraList = [];
|
|
224
|
-
const dataValue = this.fieldData ? this.fieldData.toString() : '';
|
|
225
|
-
for (let i = 0; i < this.Field.Options.Extra.length; i += 1) {
|
|
226
|
-
const extra = this.Field.Options.Extra[i];
|
|
227
|
-
|
|
228
|
-
if (extra.Value && extra.Value.length > 0) {
|
|
229
|
-
const hasIndex = extra.Value.indexOf(dataValue);
|
|
230
|
-
if ((extra.WhenNotIn && hasIndex < 0)
|
|
231
|
-
|| (!extra.WhenNotIn && hasIndex >= 0)) {
|
|
232
|
-
for (let j = 0; j < extra.List.length; j += 1) {
|
|
233
|
-
const fld = extra.List[j];
|
|
234
|
-
// if (extraList.findIndex(f => f.Name === fld.Name && f.Label === fld.Label) < 0) {
|
|
235
|
-
extraList.push(fld);
|
|
236
|
-
// }
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return extraList;
|
|
242
|
-
}
|
|
243
|
-
return [];
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
});
|
|
247
|
-
</script>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span class="simple-field input-field-password row items-center no-wrap">
|
|
3
|
-
<q-input
|
|
4
|
-
v-model="fieldData"
|
|
5
|
-
v-bind="$attrs"
|
|
6
|
-
hide-bottom-space
|
|
7
|
-
:readonly="Field.ReadOnly"
|
|
8
|
-
:type="isPwd ? 'password' : 'text'"
|
|
9
|
-
:autocomplete="(Field.Options && Field.Options.autocomplete) ? '' : 'new-password'"
|
|
10
|
-
@input="$emit('input')"
|
|
11
|
-
:ref="`input_field_validator_${Field.Name || Field.Label}`"
|
|
12
|
-
:maxlength="maxlength"
|
|
13
|
-
>
|
|
14
|
-
<template v-slot:before>
|
|
15
|
-
<span
|
|
16
|
-
:class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
17
|
-
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
18
|
-
v-if="typeof Field.Label !== 'undefined'">
|
|
19
|
-
<q-tooltip v-if="Field.Description" anchor="top right">{{Field.Description}}</q-tooltip>
|
|
20
|
-
{{Field.Label || ''}}
|
|
21
|
-
<span v-if="Field.Required" class="required-mark">*</span>
|
|
22
|
-
</span>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<template v-slot:append>
|
|
26
|
-
<e-icon
|
|
27
|
-
:name="isPwd ? 'visibility_off' : 'visibility'"
|
|
28
|
-
class="cursor-pointer"
|
|
29
|
-
@click="isPwd = !isPwd"
|
|
30
|
-
/>
|
|
31
|
-
</template>
|
|
32
|
-
</q-input>
|
|
33
|
-
<slot name="warning"></slot>
|
|
34
|
-
</span>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<script>
|
|
38
|
-
import { defineComponent } from 'vue';
|
|
39
|
-
import mixins from 'free-fe-mixins';
|
|
40
|
-
|
|
41
|
-
export default defineComponent({
|
|
42
|
-
name: 'InputFieldPassword',
|
|
43
|
-
mixins: [mixins.InputFieldMixin],
|
|
44
|
-
fieldInfo: {
|
|
45
|
-
Category: 'Simple',
|
|
46
|
-
Label: '密码',
|
|
47
|
-
Value: 'Password',
|
|
48
|
-
Description: '',
|
|
49
|
-
Extra: [
|
|
50
|
-
{
|
|
51
|
-
Type: 'Boolean',
|
|
52
|
-
Label: '自动填入',
|
|
53
|
-
Name: 'Options.autocomplete',
|
|
54
|
-
Default: 'false',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
Type: 'Number',
|
|
58
|
-
Label: '最大长度',
|
|
59
|
-
Name: 'Options.MaxLength',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
isPwd: true,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
computed: {
|
|
69
|
-
maxlength() {
|
|
70
|
-
if (this.Field && this.Field.Options
|
|
71
|
-
&& this.Field.Options.MaxLength) {
|
|
72
|
-
return this.Field.Options.MaxLength;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return '';
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="input-field-static">
|
|
3
|
-
<slot name="warning"></slot>
|
|
4
|
-
{{fieldData}}
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { defineComponent } from 'vue';
|
|
10
|
-
import mixins from 'free-fe-mixins';
|
|
11
|
-
|
|
12
|
-
export default defineComponent({
|
|
13
|
-
name: 'InputFieldStatic',
|
|
14
|
-
mixins: [mixins.InputFieldMixin],
|
|
15
|
-
fieldInfo: {
|
|
16
|
-
Category: 'Static',
|
|
17
|
-
Label: '固定内容',
|
|
18
|
-
Value: 'Static',
|
|
19
|
-
Description: '',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
</script>
|