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.
@@ -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, useFreeFieldMethods } from '../composible/useFreeField';
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, useFreeFieldMethods } from '../composible/useFreeField';
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
- // Static: () => import('./Static.vue'),
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
- };
@@ -1,73 +1,70 @@
1
1
  export default {
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',
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
- validatorNotEmptyName: "非空",
12
- validatorNotEmptyDescription: "不能为空",
13
- validatorMobilePhoneName: "手机号",
14
- validatorMobilePhoneDescription: "中国手机号码格式",
15
- validatorEmailName: "邮箱",
16
- validatorEmailDescription: "",
17
- validatorPhoneOrEmailName: "手机号或邮箱",
18
- validatorPhoneOrEmailDescription: "",
19
- validatorChinaIDNumberName: "中国身份证号码",
20
- validatorChinaIDNumberDescription: "",
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
- validatorOnlyNumberName: "只能是数字",
23
- validatorOnlyNumberDescription: "",
24
- validatorOnlyCharName: "只能是字母",
25
- validatorOnlyCharDescription: "",
26
- validatorOnlyUpCharName: "只能是大写字母",
27
- validatorOnlyUpCharDescription: "",
28
- validatorOnlyLowerCharName: "只能是小写字母",
29
- validatorOnlyLowerCharDescription: "",
30
- validatorOnlyChineseName: "只能是中文",
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
- validatorOnlyIntegerName: "只能是整数",
45
- validatorOnlyIntegerDescription: "",
46
- validatorOnlyPIName: "只能是正整数",
47
- validatorOnlyPIDescription: "",
48
- validatorOnlyPIZName: "只能是正整数或零",
49
- validatorOnlyPIZDescription: "",
50
- validatorOnlyNIName: "只能是负整数",
51
- validatorOnlyNIDescription: "",
52
- validatorOnlyNIZName: "只能是负整数或零",
53
- validatorOnlyNIZDescription: "",
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
- validatorUrlName: "URL地址",
56
- validatorUrlDescription: "",
57
- validatorOfficePhoneName: "固定电话号码",
58
- validatorOfficePhoneDescription: "固定电话号码(区号-号码)",
59
- validatorChinaZipName: "中国邮政编码",
60
- validatorChinaZipDescription: "",
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
- validatorPwd1Name: "密码(强度一)",
63
- validatorPwd1Description: "长度在6-16位之间的任意密码",
64
- validatorPwd2Name: "密码(强度二)",
65
- validatorPwd2Description:
66
- "长度在6-16位的密码,必须包含数字、大写字母、小写字母",
67
- validatorPwd3Name: "密码(强度三)",
68
- validatorPwd3Description:
69
- "长度在6-16位的密码,必须包含数字、大写字母、小写字母、特殊字符",
70
- validatorPwd4Name: "密码(强度四)",
71
- validatorPwd4Description:
72
- "长度在6-16位的密码,必须包含数字、至少2个大写字母、至少2个小写字母、特殊字符",
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
- } if (diff < 60) {
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
- Locale: appStore.locale || app.config.defaultLocale,
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: { Dense: false, AsLink: false, Ext: 'jpg,png,pdf,doc,docx,zip' },
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
- menuFields: [
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
- d && d.length > 0 && d.trim().length > 0,
331
- validatorMobilePhone: (d) =>
332
- !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(
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\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/.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\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/.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
- /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z]).*$/.test(d),
384
- validatorPwd3: (d) =>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",
@@ -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
  };
@@ -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
  };
@@ -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
  };