free-fe-core-modules 0.0.1
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 +7 -0
- package/components/.gitkeep +0 -0
- package/components/Basic/BreadCrumbs.vue +87 -0
- package/components/Basic/EIcon.vue +84 -0
- package/components/Basic/LeveledMenus.vue +92 -0
- package/components/Basic/SummaryHead.vue +312 -0
- package/components/Dialog/BasicDialog.vue +442 -0
- package/components/Dialog/index.js +38 -0
- package/components/Dialog/index1.js +49 -0
- package/components/FloatingWindow/index.vue +140 -0
- package/components/SelectLocales/index.vue +47 -0
- package/components/SlidingCarousel/index.vue +86 -0
- package/components/SlidingNews/index.vue +138 -0
- package/components/StickyButtons/index.vue +98 -0
- package/components/ThemeSwitch/index.vue +77 -0
- package/field-components/Display/index.js +3 -0
- package/field-components/Fields/AgreementCheck.vue +161 -0
- package/field-components/Fields/ApiCall.vue +139 -0
- package/field-components/Fields/Boolean.vue +112 -0
- package/field-components/Fields/Category.vue +33 -0
- package/field-components/Fields/Check.vue +131 -0
- package/field-components/Fields/Customize.vue +103 -0
- package/field-components/Fields/Date.vue +142 -0
- package/field-components/Fields/DateRange.vue +199 -0
- package/field-components/Fields/DynamicList.vue +575 -0
- package/field-components/Fields/FieldEditor.vue +379 -0
- package/field-components/Fields/File.vue +382 -0
- package/field-components/Fields/FileList.vue +405 -0
- package/field-components/Fields/FileListCombined.vue +142 -0
- package/field-components/Fields/FixedList.vue +372 -0
- package/field-components/Fields/Image.vue +328 -0
- package/field-components/Fields/ImageList.vue +285 -0
- package/field-components/Fields/ImageListCombined.vue +76 -0
- package/field-components/Fields/InputFieldList.vue +299 -0
- package/field-components/Fields/Labels.vue +182 -0
- package/field-components/Fields/MixedTable.vue +367 -0
- package/field-components/Fields/Number.vue +247 -0
- package/field-components/Fields/Password.vue +79 -0
- package/field-components/Fields/Permission.vue +83 -0
- package/field-components/Fields/PermissionEditor.vue +205 -0
- package/field-components/Fields/QueryFilters.vue +162 -0
- package/field-components/Fields/RadioList.vue +81 -0
- package/field-components/Fields/Rich.vue +369 -0
- package/field-components/Fields/Search.vue +499 -0
- package/field-components/Fields/Select.vue +376 -0
- package/field-components/Fields/SelectionChain.vue +198 -0
- package/field-components/Fields/Separator.vue +26 -0
- package/field-components/Fields/SingleList.vue +125 -0
- package/field-components/Fields/Static.vue +22 -0
- package/field-components/Fields/String.vue +185 -0
- package/field-components/Fields/Text.vue +89 -0
- package/field-components/Fields/Time.vue +160 -0
- package/field-components/Fields/TimeRange.vue +348 -0
- package/field-components/Fields/UltimateFile.vue +100 -0
- package/field-components/Fields/Year.vue +124 -0
- package/field-components/Fields/YearRange.vue +188 -0
- package/field-components/Fields/components/FieldTypeOptions.vue +248 -0
- package/field-components/Fields/index.js +117 -0
- package/field-components/components/FieldComponents.vue +246 -0
- package/field-components/index.js +13 -0
- package/field-components/style.sass +11 -0
- package/free-fields/AutoHide.js +66 -0
- package/free-fields/CenterContent.js +15 -0
- package/free-fields/Draggable.js +30 -0
- package/free-fields/Droppable.js +114 -0
- package/free-fields/EditableString.js +63 -0
- package/free-fields/FieldCategory.js +83 -0
- package/free-fields/FieldTypeSelect.js +94 -0
- package/free-fields/fieldEditors/arrayEditor.js +3 -0
- package/free-fields/fieldEditors/boolEditor.js +22 -0
- package/free-fields/fieldEditors/dateEditor.js +23 -0
- package/free-fields/fieldEditors/datetimeEditor.js +23 -0
- package/free-fields/fieldEditors/index.js +21 -0
- package/free-fields/fieldEditors/jsonEditor.js +371 -0
- package/free-fields/fieldEditors/labeledField.js +74 -0
- package/free-fields/fieldEditors/numberEditor.js +51 -0
- package/free-fields/fieldEditors/objectEditor.js +3 -0
- package/free-fields/fieldEditors/selectEditor.js +0 -0
- package/free-fields/fieldEditors/stringEditor.js +49 -0
- package/free-fields/fieldEditors/textEditor.js +50 -0
- package/free-fields/fieldEditors/timeEditor.js +23 -0
- package/free-fields/index.js +402 -0
- package/i18n/en-us/index.js +73 -0
- package/i18n/fields/en-us/index.js +9 -0
- package/i18n/fields/zh-cn/index.js +9 -0
- package/i18n/zh-cn/index.js +73 -0
- package/index.js +367 -0
- package/package.json +11 -0
- package/router/dict/api.js +18 -0
- package/router/dict/data.js +48 -0
- package/router/dict/index.js +7 -0
- package/router/error/api.js +14 -0
- package/router/error/data.js +33 -0
- package/router/error/index.js +9 -0
- package/router/index.js +13 -0
- package/router/menu/api.js +24 -0
- package/router/menu/data.js +85 -0
- package/router/menu/index.js +7 -0
- package/router/system/api.js +10 -0
- package/router/system/data.js +46 -0
- package/router/system/index.js +7 -0
- package/stores/index.js +17 -0
- package/stores/module-mourning/actions.js +3 -0
- package/stores/module-mourning/getters.js +1 -0
- package/stores/module-mourning/index.js +11 -0
- package/stores/module-mourning/state.js +3 -0
- package/stores/mourning.js +3 -0
- package/view/dict/index.vue +284 -0
- package/view/error/list.vue +197 -0
- package/view/menu/index.vue +332 -0
- package/view/mourning/mourning.vue +45 -0
- package/view/system/index.vue +149 -0
|
@@ -0,0 +1,379 @@
|
|
|
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>
|