free-fe-core-modules 0.0.7 → 0.0.8
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/Dialog/BasicDialog.vue +3 -1
- package/components/SlidingNews/index.vue +12 -23
- 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/Number.js +1 -4
- package/free-field/Fields/NumberRange.vue +145 -0
- package/free-field/Fields/Password.js +1 -4
- package/free-field/Fields/Row.vue +126 -0
- package/free-field/Fields/String.js +1 -4
- package/free-field/Fields/Tabs.vue +162 -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/useFreeField.js +0 -45
- package/i18n/en-us/index.js +64 -67
- package/index.js +32 -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 +14 -2
- package/view/menu/index.vue +0 -3
|
@@ -0,0 +1,162 @@
|
|
|
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([{}])
|
|
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
|
+
console.log('field changed', fieldData.value)
|
|
144
|
+
emit('input');
|
|
145
|
+
},
|
|
146
|
+
validate,
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
|
|
152
|
+
<style lang="scss" scoped>
|
|
153
|
+
.input-field-tabs {
|
|
154
|
+
&-tabs-wrapper {
|
|
155
|
+
margin-left: 12px;
|
|
156
|
+
border: 1px solid rgba($color: #000000, $alpha: 0.12);
|
|
157
|
+
.tabs {
|
|
158
|
+
border-bottom: 1px solid;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
</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
|
|
|
@@ -35,6 +35,7 @@ import fQueryFilters from './QueryFilters.vue';
|
|
|
35
35
|
// import fFileListCombined from './FileListCombined.vue';
|
|
36
36
|
// import fImageListCombined from './ImageListCombined.vue';
|
|
37
37
|
import fApiCall from './ApiCall.js';
|
|
38
|
+
import fTabs from './Tabs.vue';
|
|
38
39
|
|
|
39
40
|
export default {
|
|
40
41
|
Static: fStatic,
|
|
@@ -74,42 +75,5 @@ export default {
|
|
|
74
75
|
// FileListCombined: fFileListCombined,
|
|
75
76
|
// ImageListCombined: fImageListCombined,
|
|
76
77
|
ApiCall: fApiCall,
|
|
77
|
-
|
|
78
|
-
// Select: () => import('./Select.vue'),
|
|
79
|
-
// String: () => import('./String.vue'),
|
|
80
|
-
// Password: () => import('./Password.vue'),
|
|
81
|
-
// Category: () => import('./Category.vue'),
|
|
82
|
-
// Check: () => import('./Check.vue'),
|
|
83
|
-
// Labels: () => import('./Labels.vue'),
|
|
84
|
-
// Number: () => import('./Number.vue'),
|
|
85
|
-
// Permission: () => import('./Permission.vue'),
|
|
86
|
-
// Search: () => import('./Search.vue'),
|
|
87
|
-
// Text: () => import('./Text.vue'),
|
|
88
|
-
// Time: () => import('./Time.vue'),
|
|
89
|
-
// TimeRange: () => import('./TimeRange.vue'),
|
|
90
|
-
// Date: () => import('./Date.vue'),
|
|
91
|
-
// DateRange: () => import('./DateRange.vue'),
|
|
92
|
-
// Year: () => import('./Year.vue'),
|
|
93
|
-
// YearRange: () => import('./YearRange.vue'),
|
|
94
|
-
// RadioList: () => import('./RadioList.vue'),
|
|
95
|
-
// Boolean: () => import('./Boolean.vue'),
|
|
96
|
-
// File: () => import('./File.vue'),
|
|
97
|
-
// FileList: () => import('./FileList.vue'),
|
|
98
|
-
// Image: () => import('./Image.vue'),
|
|
99
|
-
// ImageList: () => import('./ImageList.vue'),
|
|
100
|
-
// FixedList: () => import('./FixedList.vue'),
|
|
101
|
-
// DynamicList: () => import('./DynamicList.vue'),
|
|
102
|
-
// SingleList: () => import('./SingleList.vue'),
|
|
103
|
-
// SelectionChain: () => import('./SelectionChain.vue'),
|
|
104
|
-
// Rich: () => import('./Rich.vue'),
|
|
105
|
-
// FieldEditor: () => import('./FieldEditor.vue'),
|
|
106
|
-
// FieldList: () => import('./InputFieldList.vue'),
|
|
107
|
-
// MixedTable: () => import('./MixedTable.vue'),
|
|
108
|
-
// Customize: () => import('./Customize.vue'),
|
|
109
|
-
// AgreementCheck: () => import('./AgreementCheck.vue'),
|
|
110
|
-
// Separator: () => import('./Separator.vue'),
|
|
111
|
-
// QueryFilters: () => import('./QueryFilters.vue'),
|
|
112
|
-
// FileListCombined: () => import('./FileListCombined.vue'),
|
|
113
|
-
// ImageListCombined: () => import('./ImageListCombined.vue'),
|
|
114
|
-
// ApiCall: () => import('./ApiCall.vue'),
|
|
78
|
+
Tabs: fTabs,
|
|
115
79
|
};
|
|
@@ -96,48 +96,3 @@ export function useFreeField(props) {
|
|
|
96
96
|
},
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
// TODO: make function for validating all fields in the current component
|
|
102
|
-
function validate() {
|
|
103
|
-
if (this.shouldHide) return true;
|
|
104
|
-
|
|
105
|
-
// could have customized validate function in component
|
|
106
|
-
if (this.selfValidate && typeof this.selfValidate === 'function' && !this.selfValidate()) {
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const validators = Object.keys(this.$refs).filter((k) => k.startsWith('input_field_validator_'));
|
|
111
|
-
if (!validators || validators.length <= 0) {
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let hasError = false;
|
|
116
|
-
for (let i = 0; i < validators.length; i += 1) {
|
|
117
|
-
const valid = validators[i];
|
|
118
|
-
|
|
119
|
-
if (this.$refs[valid]) {
|
|
120
|
-
if (Array.isArray(this.$refs[valid])) {
|
|
121
|
-
for (let j = 0; j < this.$refs[valid].length; j += 1) {
|
|
122
|
-
const sv = this.$refs[valid][j];
|
|
123
|
-
|
|
124
|
-
if (sv.shouldHide !== true) {
|
|
125
|
-
if (typeof sv.validate === 'function') {
|
|
126
|
-
hasError = !sv.validate() || hasError;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
} else if (typeof this.$refs[valid].validate === 'function') {
|
|
131
|
-
if (this.$refs[valid].shouldHide !== true) {
|
|
132
|
-
hasError = !this.$refs[valid].validate() || hasError;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return !hasError;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const useFreeFieldMethods = {
|
|
142
|
-
validate,
|
|
143
|
-
};
|
package/i18n/en-us/index.js
CHANGED
|
@@ -1,73 +1,70 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
justNow: 'just now',
|
|
3
|
+
secondsAgo: 'seconds ago',
|
|
4
|
+
minutesAgo: 'minutes ago',
|
|
5
|
+
hoursAgo: 'hours ago',
|
|
6
|
+
daysAgo: 'days ago',
|
|
7
|
+
monthsAgo: 'months ago',
|
|
8
|
+
yearsAgo: 'yearsAgo',
|
|
9
|
+
SwitchTheme: 'Switch Theme',
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
validatorNotEmptyName: "non-empty",
|
|
12
|
+
validatorNotEmptyDescription: "Cannot be empty",
|
|
13
|
+
validatorMobilePhoneName: "Phone Number",
|
|
14
|
+
validatorMobilePhoneDescription: "Chinese Mobile Number Format",
|
|
15
|
+
validatorEmailName: "mailbox",
|
|
16
|
+
validatorEmailDescription: "",
|
|
17
|
+
validatorPhoneOrEmailName: "mobile phone number or email",
|
|
18
|
+
validatorPhoneOrEmailDescription: "",
|
|
19
|
+
validatorChinaIDNumberName: "Chinese ID Number",
|
|
20
|
+
validatorChinaIDNumberDescription: "",
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
validatorOnlyChineseDescription: "",
|
|
32
|
-
validatorOnlyCCName: "只能是中文或字母",
|
|
33
|
-
validatorOnlyCCDescription: "",
|
|
34
|
-
validatorOnlyCCNName: "只能是中文或字母或数字",
|
|
35
|
-
validatorOnlyCCNDescription: "",
|
|
36
|
-
validatorOnlyCNName: "只能是中文或数字",
|
|
37
|
-
validatorOnlyCNDescription: "",
|
|
38
|
-
validatorOnlyCNUName: "只能是中文或数字或下划线",
|
|
39
|
-
validatorOnlyCNUDescription: "",
|
|
40
|
-
validatorOnlyCNSName: "只能是中文或数字或特殊字符",
|
|
41
|
-
validatorOnlyCNSDescription:
|
|
42
|
-
`只能是中文或数字或("."、{'@'}、"<"、">"、"_"、"?")`,
|
|
22
|
+
validatorOnlyNumberName: "number only",
|
|
23
|
+
validatorOnlyNumberDescription: "",
|
|
24
|
+
validatorOnlyCharName: "letters only",
|
|
25
|
+
validatorOnlyCharDescription: "",
|
|
26
|
+
validatorOnlyUpCharName: "uppercase letters only",
|
|
27
|
+
validatorOnlyUpCharDescription: "",
|
|
28
|
+
validatorOnlyLowerCharName: "lowercase letters only",
|
|
29
|
+
validatorOnlyLowerCharDescription: "",
|
|
30
|
+
validatorOnlyChineseName: "Chinese only",
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
validatorOnlyChineseDescription: "",
|
|
33
|
+
validatorOnlyCCName: "Chinese or letters",
|
|
34
|
+
validatorOnlyCCDescription: "",
|
|
35
|
+
validatorOnlyCCNName: "Chinese or letters or numbers",
|
|
36
|
+
validatorOnlyCCNDescription: "",
|
|
37
|
+
validatorOnlyCNName: "Chinese or numbers",
|
|
38
|
+
validatorOnlyCNDescription: "",
|
|
39
|
+
validatorOnlyCNUName: "Chinese or numbers or underscores",
|
|
40
|
+
validatorOnlyCNUDescription: "",
|
|
41
|
+
validatorOnlyCNSName: "Chinese or numbers or special characters",
|
|
42
|
+
validatorOnlyCNSDescription: `Chinese or a number or ("."、{'@'}、"<"、">"、"_"、"?")`,
|
|
54
43
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
validatorOnlyIntegerName: "integer only",
|
|
45
|
+
validatorOnlyIntegerDescription: "",
|
|
46
|
+
validatorOnlyPIName: "a positive integer",
|
|
47
|
+
validatorOnlyPIDescription: "",
|
|
48
|
+
validatorOnlyPIZName: "positive integers or zero",
|
|
49
|
+
validatorOnlyPIZDescription: "",
|
|
50
|
+
validatorOnlyNIName: "negative integers",
|
|
51
|
+
validatorOnlyNIDescription: "",
|
|
52
|
+
validatorOnlyNIZName: "a negative integer or zero",
|
|
53
|
+
validatorOnlyNIZDescription: "",
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
validatorUrlName: "URL address",
|
|
56
|
+
validatorUrlDescription: "",
|
|
57
|
+
validatorOfficePhoneName: "landline",
|
|
58
|
+
validatorOfficePhoneDescription: "landline (area code - number)",
|
|
59
|
+
validatorChinaZipName: "China Postal Code",
|
|
60
|
+
validatorChinaZipDescription: "",
|
|
61
|
+
|
|
62
|
+
validatorPwd1Name: "Password (strength one)",
|
|
63
|
+
validatorPwd1Description: "Any password between 6-16 digits in length",
|
|
64
|
+
validatorPwd2Name: "Password (Strength Two)",
|
|
65
|
+
validatorPwd2Description: "Passwords 6-16 digits in length, must contain numbers, uppercase letters, lowercase letters",
|
|
66
|
+
validatorPwd3Name: "Password (strength three)",
|
|
67
|
+
validatorPwd3Description: "Passwords 6-16 characters in length, must contain numbers, uppercase letters, lowercase letters, special characters",
|
|
68
|
+
validatorPwd4Name: "Password (strength four)",
|
|
69
|
+
validatorPwd4Description: "A password of 6-16 digits in length must contain numbers, at least 2 uppercase letters, at least 2 lowercase letters, special characters",
|
|
70
|
+
}
|
package/index.js
CHANGED
|
@@ -27,17 +27,17 @@ const filters = {
|
|
|
27
27
|
|
|
28
28
|
return url ? `${config.imageUrlBase}${url}` : '';
|
|
29
29
|
},
|
|
30
|
-
serverVideo: (url)
|
|
30
|
+
serverVideo: (url) => {
|
|
31
31
|
if (typeof url === 'string' && url.startsWith('@')) return url.substring(1);
|
|
32
32
|
|
|
33
33
|
return url ? `${config.videoUrlBase}${url}` : '';
|
|
34
34
|
},
|
|
35
|
-
serverThumb: (url)
|
|
35
|
+
serverThumb: (url) => {
|
|
36
36
|
if (typeof url === 'string' && url.startsWith('@')) return url.substring(1);
|
|
37
37
|
|
|
38
38
|
return url ? `${config.thumbUrlBase}${url}` : '';
|
|
39
39
|
},
|
|
40
|
-
serverDocument: (url)
|
|
40
|
+
serverDocument: (url) => {
|
|
41
41
|
if (typeof url === 'string' && url.startsWith('@')) return url.substring(1);
|
|
42
42
|
|
|
43
43
|
return url ? `${config.documentUrlBase}${url}` : '';
|
|
@@ -125,7 +125,8 @@ const filters = {
|
|
|
125
125
|
let diff = quasarDate.getDateDiff(date1, date2, 'seconds');
|
|
126
126
|
if (diff < 1) {
|
|
127
127
|
return diff + Vue.prototype.$t('justNow');
|
|
128
|
-
}
|
|
128
|
+
}
|
|
129
|
+
if (diff < 60) {
|
|
129
130
|
return diff + Vue.prototype.$t('secondsAgo');
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -161,8 +162,7 @@ export default (app, root) => {
|
|
|
161
162
|
return {
|
|
162
163
|
config: {
|
|
163
164
|
backendDependencies: ["core-modules"],
|
|
164
|
-
dictFields: [
|
|
165
|
-
{
|
|
165
|
+
dictFields: [{
|
|
166
166
|
Type: 'Category',
|
|
167
167
|
Label: '字典数据信息',
|
|
168
168
|
},
|
|
@@ -191,17 +191,14 @@ export default (app, root) => {
|
|
|
191
191
|
Type: 'Tabs',
|
|
192
192
|
Label: '显示内容',
|
|
193
193
|
DataType: 'Array',
|
|
194
|
-
Default: [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
],
|
|
194
|
+
Default: [{
|
|
195
|
+
Locale: appStore.locale || app.config.defaultLocale,
|
|
196
|
+
}, ],
|
|
199
197
|
Options: {
|
|
200
198
|
Dense: true,
|
|
201
199
|
LabelField: 'Name',
|
|
202
200
|
ValueField: 'Locale',
|
|
203
|
-
List: [
|
|
204
|
-
{
|
|
201
|
+
List: [{
|
|
205
202
|
Name: 'Locale',
|
|
206
203
|
Label: '语言',
|
|
207
204
|
Type: 'String',
|
|
@@ -242,7 +239,11 @@ export default (app, root) => {
|
|
|
242
239
|
Label: '图片/图标/文件',
|
|
243
240
|
Type: 'File',
|
|
244
241
|
MaxValue: '100m',
|
|
245
|
-
Options: {
|
|
242
|
+
Options: {
|
|
243
|
+
Dense: false,
|
|
244
|
+
AsLink: false,
|
|
245
|
+
Ext: 'jpg,png,pdf,doc,docx,zip'
|
|
246
|
+
},
|
|
246
247
|
Tips: [{
|
|
247
248
|
Text: '文件不可超过100M。格式支持:PNG、JPG、PDF、DOC、DOCX、ZIP。',
|
|
248
249
|
}],
|
|
@@ -255,9 +256,9 @@ export default (app, root) => {
|
|
|
255
256
|
Name: 'Info',
|
|
256
257
|
Label: '附加信息',
|
|
257
258
|
Type: 'Text',
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
menuFields: [{
|
|
261
262
|
Type: "Category",
|
|
262
263
|
Label: "菜单信息",
|
|
263
264
|
},
|
|
@@ -306,6 +307,10 @@ export default (app, root) => {
|
|
|
306
307
|
NoDataScope: true,
|
|
307
308
|
},
|
|
308
309
|
],
|
|
310
|
+
|
|
311
|
+
defaultInputFieldPlaceholder: '',
|
|
312
|
+
defaultSelectFieldPlaceholder: '',
|
|
313
|
+
defaultSearchFieldPlaceholder: '',
|
|
309
314
|
},
|
|
310
315
|
routers,
|
|
311
316
|
filters,
|
|
@@ -326,25 +331,12 @@ export default (app, root) => {
|
|
|
326
331
|
fieldComponents: FieldComponents.fieldComponents,
|
|
327
332
|
|
|
328
333
|
validators: {
|
|
329
|
-
validatorNotEmpty: (d) =>
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
d
|
|
334
|
-
),
|
|
335
|
-
validatorEmail: (d) =>
|
|
336
|
-
!d || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
|
|
337
|
-
d
|
|
338
|
-
),
|
|
339
|
-
validatorPhoneOrEmail: (d) =>
|
|
340
|
-
d !== void 0 &&
|
|
341
|
-
d.length > 0 &&
|
|
342
|
-
(this.validatorMobilePhone(d) || this.validatorEmail(d)),
|
|
334
|
+
validatorNotEmpty: (d) => d !== void 0 && d.length > 0 && d.trim().length > 0,
|
|
335
|
+
validatorMobilePhone: (d) => !d || /^(0|86|17951)?(13[0-9]|14[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9])[0-9]{8}$/.test(d),
|
|
336
|
+
validatorEmail: (d) => !d || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(d),
|
|
337
|
+
validatorPhoneOrEmail: (d) => d !== void 0 && d.length > 0 && (this.validatorMobilePhone(d) || this.validatorEmail(d)),
|
|
343
338
|
// validatorMinLength: (d, len = 0) => d !== undefined && d.length >= len,
|
|
344
|
-
validatorChinaIDNumber: (d) =>
|
|
345
|
-
!d || /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(
|
|
346
|
-
d
|
|
347
|
-
),
|
|
339
|
+
validatorChinaIDNumber: (d) => !d || /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(d),
|
|
348
340
|
// validatorSame: (d, to) => d === to,
|
|
349
341
|
// validatorDifferent: (d, to) => d !== to,
|
|
350
342
|
// validatorGT: (d, to) => d > to,
|
|
@@ -369,26 +361,16 @@ export default (app, root) => {
|
|
|
369
361
|
validatorOnlyNIZ: (d) => /^([0]|-[1-9][0-9]+)$/.test(d.toString()),
|
|
370
362
|
|
|
371
363
|
//
|
|
372
|
-
validatorUrl: (d) =>
|
|
373
|
-
/^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?/.test(
|
|
374
|
-
d
|
|
375
|
-
),
|
|
364
|
+
validatorUrl: (d) => /^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?/.test(d),
|
|
376
365
|
validatorOfficePhone: (d) => /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{8}$/.test(d),
|
|
377
366
|
validatorChinaZip: (d) => /^[1-9]{1}(\d+){5}$/.test(d),
|
|
378
367
|
|
|
379
368
|
// password
|
|
380
369
|
validatorPwd0: (d) => /^.*(?=.{6,16}).*$/.test(d),
|
|
381
370
|
validatorPwd1: (d) => /^.{6,16}$/.test(d),
|
|
382
|
-
validatorPwd2: (d) =>
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
/^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?\(\)]).*$/.test(
|
|
386
|
-
d
|
|
387
|
-
),
|
|
388
|
-
validatorPwd4: (d) =>
|
|
389
|
-
/^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{2,})(?=.*[a-z]{2,})(?=.*[!@#$%^&*?\(\)]).*$/.test(
|
|
390
|
-
d
|
|
391
|
-
),
|
|
371
|
+
validatorPwd2: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z]).*$/.test(d),
|
|
372
|
+
validatorPwd3: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?\(\)]).*$/.test(d),
|
|
373
|
+
validatorPwd4: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{2,})(?=.*[a-z]{2,})(?=.*[!@#$%^&*?\(\)]).*$/.test(d),
|
|
392
374
|
},
|
|
393
375
|
}
|
|
394
|
-
};
|
|
376
|
+
};
|
package/package.json
CHANGED
package/router/dict/data.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
// import Vue from 'vue';
|
|
2
1
|
import {
|
|
3
2
|
getDict,
|
|
4
3
|
createDict, updateDict, deleteDict,
|
|
5
4
|
} from './api';
|
|
6
5
|
|
|
7
|
-
// const bus = new Vue();
|
|
8
|
-
|
|
9
6
|
const CHINA_NUMBERS = ' 一二三四五六七八九十';
|
|
10
7
|
|
|
11
8
|
export default {
|
|
@@ -43,6 +40,5 @@ export default {
|
|
|
43
40
|
addDict: (d) => createDict(d),
|
|
44
41
|
editDict: (d) => updateDict(d),
|
|
45
42
|
deleteDict: (d) => deleteDict(d),
|
|
46
|
-
// Bus: bus,
|
|
47
43
|
}),
|
|
48
44
|
};
|
package/router/error/data.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
// import Vue from 'vue';
|
|
2
1
|
import { getErrorCode } from './api';
|
|
3
2
|
|
|
4
3
|
import { i18n } from '@/boot/i18n';
|
|
5
4
|
const {global:{t}} = i18n;
|
|
6
5
|
|
|
7
|
-
// const bus = new Vue();
|
|
8
|
-
|
|
9
6
|
export default {
|
|
10
7
|
list: (app) => () => ({
|
|
11
8
|
GetData: (o) => getErrorCode(o).then((data) => {
|
|
@@ -31,6 +28,5 @@ export default {
|
|
|
31
28
|
|
|
32
29
|
return d;
|
|
33
30
|
}),
|
|
34
|
-
// Bus: bus,
|
|
35
31
|
}),
|
|
36
32
|
};
|
package/router/menu/data.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
// import Vue from 'vue';
|
|
2
1
|
import {
|
|
3
2
|
getMenus,
|
|
4
3
|
createMenu, updateMenu, deleteMenu,
|
|
5
4
|
} from './api';
|
|
6
5
|
|
|
7
|
-
// const bus = new Vue();
|
|
8
|
-
|
|
9
6
|
const CHINA_NUMBERS = ' 一二三四五六七八九十';
|
|
10
7
|
|
|
11
8
|
export default {
|
|
@@ -80,6 +77,5 @@ export default {
|
|
|
80
77
|
addMenu: (d) => createMenu(d),
|
|
81
78
|
editMenu: (d) => updateMenu(d),
|
|
82
79
|
deleteMenu: (d) => deleteMenu(d),
|
|
83
|
-
// Bus: bus,
|
|
84
80
|
}),
|
|
85
81
|
};
|