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,379 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-dialog
|
|
3
|
-
v-model="Field.show"
|
|
4
|
-
persistent
|
|
5
|
-
maximized
|
|
6
|
-
class="q-ma-xl"
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
<q-card
|
|
10
|
-
class="input-field-editor q-ma-xl"
|
|
11
|
-
style="height: calc(100% - 96px)"
|
|
12
|
-
>
|
|
13
|
-
<q-layout
|
|
14
|
-
view="lHh Lpr lFf"
|
|
15
|
-
container
|
|
16
|
-
>
|
|
17
|
-
<div>
|
|
18
|
-
<slot name="warning"></slot>
|
|
19
|
-
</div>
|
|
20
|
-
<q-footer>
|
|
21
|
-
<q-toolbar>
|
|
22
|
-
<q-space></q-space>
|
|
23
|
-
<q-btn
|
|
24
|
-
icon="cancel"
|
|
25
|
-
class="cancel-btn"
|
|
26
|
-
:label="$t('cancelButtonText')"
|
|
27
|
-
@click="$emit('cancel')"
|
|
28
|
-
/>
|
|
29
|
-
<q-btn
|
|
30
|
-
icon="save"
|
|
31
|
-
class="save-btn"
|
|
32
|
-
:label="$t('saveButtonText')"
|
|
33
|
-
@click="$emit('save')"
|
|
34
|
-
/>
|
|
35
|
-
</q-toolbar>
|
|
36
|
-
</q-footer>
|
|
37
|
-
|
|
38
|
-
<q-page-container>
|
|
39
|
-
<q-page padding>
|
|
40
|
-
<span
|
|
41
|
-
v-for="(field, fIndex) in Fields || []"
|
|
42
|
-
:key="fIndex"
|
|
43
|
-
>
|
|
44
|
-
<free-field
|
|
45
|
-
:values="data"
|
|
46
|
-
:Field="field"
|
|
47
|
-
@input="fieldChanged"
|
|
48
|
-
@updateOptions="fieldOptionsChanged"
|
|
49
|
-
></free-field>
|
|
50
|
-
</span>
|
|
51
|
-
</q-page>
|
|
52
|
-
</q-page-container>
|
|
53
|
-
</q-layout>
|
|
54
|
-
</q-card>
|
|
55
|
-
</q-dialog>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script>
|
|
59
|
-
import { defineComponent } from 'vue';
|
|
60
|
-
import mixins from 'free-fe-mixins';
|
|
61
|
-
import FieldTypeOptions from './components/FieldTypeOptions';
|
|
62
|
-
|
|
63
|
-
export default defineComponent({
|
|
64
|
-
name: 'FieldEditor',
|
|
65
|
-
mixins: [mixins.InputFieldMixin],
|
|
66
|
-
emits: ['update:field', 'save', 'cancel'],
|
|
67
|
-
fieldInfo: {
|
|
68
|
-
Category: 'Advanced',
|
|
69
|
-
Label: '字段编辑器',
|
|
70
|
-
Value: 'FieldEditor',
|
|
71
|
-
Description: '',
|
|
72
|
-
},
|
|
73
|
-
data() {
|
|
74
|
-
return {
|
|
75
|
-
visible: true,
|
|
76
|
-
Fields: [
|
|
77
|
-
{
|
|
78
|
-
Label: '基本信息',
|
|
79
|
-
Type: 'Category',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
Type: 'Number',
|
|
83
|
-
Label: '序号',
|
|
84
|
-
Name: 'Index',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
Type: 'String',
|
|
88
|
-
Label: '名称',
|
|
89
|
-
Name: 'Name',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
Type: 'String',
|
|
93
|
-
Label: '标签',
|
|
94
|
-
Name: 'Label',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
Type: 'String',
|
|
98
|
-
Label: '占位内容',
|
|
99
|
-
Name: 'Placeholder',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
Type: 'String',
|
|
103
|
-
Label: '默认值',
|
|
104
|
-
Name: 'Default',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
Type: 'Check',
|
|
108
|
-
Label: '必须',
|
|
109
|
-
Name: 'Required',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
Type: 'Check',
|
|
113
|
-
Label: '只读',
|
|
114
|
-
Name: 'ReadOnly',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
Type: 'Select',
|
|
118
|
-
Label: '类型',
|
|
119
|
-
Name: 'Type',
|
|
120
|
-
Component: FieldTypeOptions,
|
|
121
|
-
Options: [],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
Type: 'Text',
|
|
125
|
-
Label: '描述',
|
|
126
|
-
Name: 'Description',
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
Label: '高级设置',
|
|
130
|
-
Type: 'Category',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
Type: 'Boolean',
|
|
134
|
-
Label: '保持回传',
|
|
135
|
-
Name: 'Info.KeepChanged',
|
|
136
|
-
Description: '保存时,不管用户有没有修改此字段,都当作已经修改',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
Label: '数据校验规则',
|
|
140
|
-
Name: 'Rules',
|
|
141
|
-
Type: 'Select',
|
|
142
|
-
Placeholder: '请选择',
|
|
143
|
-
Multiple: true,
|
|
144
|
-
Options: Object.keys(this.ctx.validators).map((vlk) => {
|
|
145
|
-
const name = this.$t(`${vlk}Name`);
|
|
146
|
-
const desc = this.$t(`${vlk}Description`);
|
|
147
|
-
return {
|
|
148
|
-
Label: name === `${vlk}Name` ? vlk : name,
|
|
149
|
-
Value: vlk,
|
|
150
|
-
Tooltip: desc === `${vlk}Description` ? '' : desc,
|
|
151
|
-
};
|
|
152
|
-
}),
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
Label: '唯一',
|
|
156
|
-
Name: 'Info.Unique',
|
|
157
|
-
Type: 'Boolean',
|
|
158
|
-
Default: false,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
Label: '样式类',
|
|
162
|
-
Name: 'Info.Classes',
|
|
163
|
-
Type: 'String',
|
|
164
|
-
Placeholder: '请填写附加样式类名,多个用空格分割。',
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
Label: '样式',
|
|
168
|
-
Name: 'Info.Style',
|
|
169
|
-
Type: 'Text',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
Label: '不存在或为空时显示占位符',
|
|
173
|
-
Name: 'Info.ShowNaN',
|
|
174
|
-
Type: 'Check',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
Type: 'Text',
|
|
178
|
-
Name: 'Info.ShowWhen',
|
|
179
|
-
Label: '当条件满足时显示',
|
|
180
|
-
Placeholder: '参数名为data的条件语句',
|
|
181
|
-
Warning: '请确保填写正确!!!',
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
Type: 'Boolean',
|
|
185
|
-
Label: '隐藏',
|
|
186
|
-
Name: 'Hidden',
|
|
187
|
-
Extra: [
|
|
188
|
-
{
|
|
189
|
-
Type: 'Check',
|
|
190
|
-
Label: '导出时包含',
|
|
191
|
-
Description: '默认情况下隐藏字段不会被导出,但可勾选此项导出此隐藏字段',
|
|
192
|
-
Name: 'Info.IncludedInExport',
|
|
193
|
-
Default: false,
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
Type: 'Check',
|
|
197
|
-
Label: '只当数据不存在时隐藏',
|
|
198
|
-
Name: 'Info.HideWhenUndefined',
|
|
199
|
-
Default: false,
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
Type: 'Check',
|
|
203
|
-
Label: '空对象或数组将被认为数据不存在',
|
|
204
|
-
Name: 'Info.IncludeEmptyObject',
|
|
205
|
-
Default: false,
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
Type: 'String',
|
|
209
|
-
Label: '哪些字段不存在时隐藏',
|
|
210
|
-
Name: 'Info.HideWhenUndefinedField',
|
|
211
|
-
Placeholder: '多个字段名用逗号分割',
|
|
212
|
-
Description: '默认为当前字段所关联的数据',
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
Type: 'String',
|
|
218
|
-
Label: '警示信息',
|
|
219
|
-
Name: 'Warning',
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
Type: 'DynamicList',
|
|
223
|
-
Label: '提示信息',
|
|
224
|
-
Name: 'Tips',
|
|
225
|
-
Options: {
|
|
226
|
-
Columns: [
|
|
227
|
-
{
|
|
228
|
-
Label: '信息设置',
|
|
229
|
-
Name: 'Text',
|
|
230
|
-
Type: 'Text',
|
|
231
|
-
style: 'min-width: 300px',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
Label: '超链接',
|
|
235
|
-
Name: 'Links',
|
|
236
|
-
Type: 'DynamicList',
|
|
237
|
-
Options: {
|
|
238
|
-
Columns: [
|
|
239
|
-
{
|
|
240
|
-
Label: '显示的文字',
|
|
241
|
-
Name: 'Text',
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
Label: '超链接',
|
|
245
|
-
Name: 'Link',
|
|
246
|
-
style: 'min-width: 260px',
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
Type: 'Select',
|
|
256
|
-
Label: '引用类型',
|
|
257
|
-
Name: 'ReferType',
|
|
258
|
-
Default: '',
|
|
259
|
-
Options: [
|
|
260
|
-
{
|
|
261
|
-
Label: '无',
|
|
262
|
-
Value: '',
|
|
263
|
-
},
|
|
264
|
-
// {
|
|
265
|
-
// Label: '固定引用',
|
|
266
|
-
// Value: 'fixed',
|
|
267
|
-
// Extra: [
|
|
268
|
-
// {
|
|
269
|
-
// Type: 'String',
|
|
270
|
-
// Label: '引用内容',
|
|
271
|
-
// Name: 'ReferTo',
|
|
272
|
-
// },
|
|
273
|
-
// ],
|
|
274
|
-
// },
|
|
275
|
-
{
|
|
276
|
-
Label: '字典引用',
|
|
277
|
-
Value: 'dict',
|
|
278
|
-
Extra: [
|
|
279
|
-
{
|
|
280
|
-
Type: 'String',
|
|
281
|
-
Label: '引用内容',
|
|
282
|
-
Name: 'ReferTo',
|
|
283
|
-
},
|
|
284
|
-
],
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
Label: '数据库引用',
|
|
288
|
-
Value: 'db',
|
|
289
|
-
Extra: [
|
|
290
|
-
{
|
|
291
|
-
Type: 'String',
|
|
292
|
-
Label: '引用内容',
|
|
293
|
-
Name: 'ReferTo',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
Type: 'Check',
|
|
297
|
-
Label: '动态内容',
|
|
298
|
-
Name: 'Info.Dynamic',
|
|
299
|
-
Description: '不保存,每次都重新计算获取',
|
|
300
|
-
},
|
|
301
|
-
],
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
Label: '外键',
|
|
307
|
-
Name: 'Info.Refer',
|
|
308
|
-
Type: 'String',
|
|
309
|
-
},
|
|
310
|
-
// {
|
|
311
|
-
// Type: 'Text',
|
|
312
|
-
// Label: '结构定义',
|
|
313
|
-
// Name: 'Schema',
|
|
314
|
-
//
|
|
315
|
-
// },
|
|
316
|
-
// {
|
|
317
|
-
// Type: 'Text',
|
|
318
|
-
// Label: '自定义选项',
|
|
319
|
-
// Name: 'Options',
|
|
320
|
-
//
|
|
321
|
-
// },
|
|
322
|
-
{
|
|
323
|
-
Type: 'Category',
|
|
324
|
-
Label: '所需权限',
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
Type: 'Permission',
|
|
328
|
-
Label: '需要的权限',
|
|
329
|
-
Name: 'Permission',
|
|
330
|
-
ServiceList: '_service_list',
|
|
331
|
-
},
|
|
332
|
-
],
|
|
333
|
-
};
|
|
334
|
-
},
|
|
335
|
-
watch: {
|
|
336
|
-
// eslint-disable-next-line func-names
|
|
337
|
-
'Field.show': function (v) {
|
|
338
|
-
if (v) {
|
|
339
|
-
this.fieldChanged(this.Fields.find((f) => f.Name === 'Type'));
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
},
|
|
343
|
-
methods: {
|
|
344
|
-
fieldOptionsChanged(field) {
|
|
345
|
-
if (!field || !field.Name || !field.Options) return;
|
|
346
|
-
|
|
347
|
-
const fListField = this.Fields.find((f) => f.Name === field.Name);
|
|
348
|
-
if (fListField) {
|
|
349
|
-
fListField.Options = field.Options;
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
fieldChanged(field) {
|
|
353
|
-
if (!field || !field.Name) return;
|
|
354
|
-
|
|
355
|
-
if (field.Name === 'Type' || field.Name.startsWith('Options.')) {
|
|
356
|
-
// when the field is fixed list, we have to set columns for the default value list
|
|
357
|
-
this.data.Options = this.data.Options || {};
|
|
358
|
-
const fListField = this.Fields.find((f) => f.Name === 'Type');
|
|
359
|
-
if (fListField) {
|
|
360
|
-
const theOpt = fListField.Options.find((op) => op.Value === this.data.Type);
|
|
361
|
-
if (theOpt && theOpt.onOptionsChanged) {
|
|
362
|
-
theOpt.onOptionsChanged(this, this.data, theOpt);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
this.$emit('update:field', field.Name);
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
});
|
|
371
|
-
</script>
|
|
372
|
-
|
|
373
|
-
<style lang="sass" scoped>
|
|
374
|
-
.q-dialog .fullscreen
|
|
375
|
-
background: white
|
|
376
|
-
|
|
377
|
-
.cancel-btn
|
|
378
|
-
margin-right: 12px
|
|
379
|
-
</style>
|