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 CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://freeeis.aslancer.com" target="_blank">
2
+ <a href="https://www.freeeis.com" target="_blank">
3
3
  <img
4
4
  src="https://user-images.githubusercontent.com/33030594/227073920-03ed137f-c4f7-4ed7-ae05-d781dd1991f7.png"
5
5
  alt="FreeEIS"
@@ -22,7 +22,7 @@
22
22
 
23
23
  简体中文 | [English](https://github.com/freeeis/.github/blob/main/profile/README.en-us.md)
24
24
 
25
- [更多文档](https://freeeis.aslancer.com)(完善中……)
25
+ [更多文档](https://www.freeeis.com)(完善中……)
26
26
 
27
27
  FreeEIS,是一种可扩展的、企业级系统统一开发框架。FreeEIS旨在解决越来越流行的远程协作开发中,系统拆分及组装的问题。并且通过积累越来越多的功能模块,使得系统的搭建更快捷。
28
28
 
@@ -242,7 +242,7 @@ export default defineComponent({
242
242
  // this.textValid = this.validateFunc(this.textContent);
243
243
  // if (!this.textValid) return;
244
244
  // }
245
- if (!this.validate()) {
245
+ if (!this.canOK || !this.validate()) {
246
246
  return;
247
247
  }
248
248
 
@@ -265,6 +265,8 @@ export default defineComponent({
265
265
  }
266
266
  },
267
267
  btnCancel() {
268
+ if (!this.canCancel) return;
269
+
268
270
  this.$emit('cancel');
269
271
 
270
272
  if (this.timer) {
@@ -37,7 +37,7 @@
37
37
  <q-space />
38
38
  <div class="sliding-news-right"
39
39
  :style="`line-height: ${heightString}`">
40
- {{filter('normalDate',(carouse.PublishDate || carouse.LastUpdateDate))}}
40
+ {{$filter('normalDate',(carouse.PublishDate || carouse.LastUpdateDate))}}
41
41
  </div>
42
42
  </div>
43
43
  </q-carousel-slide>
@@ -105,7 +105,6 @@ export default defineComponent({
105
105
  return {
106
106
  visible: true,
107
107
  slide: 0,
108
- timer: undefined,
109
108
  };
110
109
  },
111
110
  computed: {
@@ -119,18 +118,18 @@ export default defineComponent({
119
118
 
120
119
  return this.height;
121
120
  },
122
- },
123
- localData() {
124
- const fks = Object.keys(this.fields || {});
125
- return (this.data || []).map((dd) => {
126
- const ret = {};
127
- for (let i = 0; i < fks.length; i += 1) {
128
- const fk = fks[i];
129
- ret[fk] = dd[this.fields[fk]];
130
- }
121
+ localData() {
122
+ const fks = Object.keys(this.fields || {});
123
+ return (this.data || []).map((dd) => {
124
+ const ret = {};
125
+ for (let i = 0; i < fks.length; i += 1) {
126
+ const fk = fks[i];
127
+ ret[fk] = dd[this.fields[fk]];
128
+ }
131
129
 
132
- return { ...dd, ...ret };
133
- });
130
+ return { ...dd, ...ret };
131
+ });
132
+ },
134
133
  },
135
134
  methods: {
136
135
  newsClicked(news) {
@@ -142,16 +141,6 @@ export default defineComponent({
142
141
  this.router.push({ path: url });
143
142
  }
144
143
  },
145
- // carouselNext() {
146
- // if (!this.data || this.data.length < 2 || !this.$refs.carousel) {
147
- // return;
148
- // }
149
-
150
- // this.$refs.carousel.next();
151
- // },
152
144
  },
153
- // beforeUnmount() {
154
- // clearInterval(this.timer);
155
- // },
156
145
  });
157
146
  </script>
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, getCurrentInstance, h, ref, watchEffect } from 'vue';
2
- import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
2
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField';
3
3
  import ReadonlyContent from '../composible/readonlyContent';
4
4
 
5
5
  export default defineComponent({
@@ -54,9 +54,6 @@ export default defineComponent({
54
54
  props: {
55
55
  ...freeFieldProps,
56
56
  },
57
- methods: {
58
- ...useFreeFieldMethods,
59
- },
60
57
  setup(props, { slots }){
61
58
  if (!props.Field) return {};
62
59
 
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, ref } from 'vue';
2
- import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
2
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField';
3
3
  import { QToggle } from 'quasar';
4
4
  import freeFieldLabel from '../composible/freeFieldLabel';
5
5
 
@@ -69,9 +69,6 @@ export default defineComponent({
69
69
  ...freeFieldProps,
70
70
  },
71
71
  emits: ['input'],
72
- methods: {
73
- ...useFreeFieldMethods,
74
- },
75
72
  setup(props, { emit, slots }){
76
73
  if (!props.Field) return {};
77
74
 
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, ref } from 'vue';
2
- import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
2
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField';
3
3
  import { QCheckbox } from 'quasar';
4
4
  import freeFieldLabel from '../composible/freeFieldLabel';
5
5
 
@@ -69,9 +69,6 @@ export default defineComponent({
69
69
  ...freeFieldProps,
70
70
  },
71
71
  emits: ['input'],
72
- methods: {
73
- ...useFreeFieldMethods,
74
- },
75
72
  setup(props, { emit, slots }){
76
73
  if (!props.Field) return {};
77
74
 
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div class="input-field-column column" :class="columnClasses">
3
+ <input-field
4
+ v-for="(field, idx) in Field.Options.List"
5
+ :Field="field"
6
+ :values="fieldData"
7
+ :key="idx"
8
+ @input="$emit('input')"></input-field>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ import { InputFieldMixin } from 'eis-admin-mixins';
14
+
15
+ export default {
16
+ name: 'InputFieldColumn',
17
+ mixins: [InputFieldMixin],
18
+ fieldInfo: {
19
+ Category: 'Container',
20
+ Label: '列',
21
+ Value: 'Column',
22
+ Extra: [
23
+ {
24
+ Label: '不换行',
25
+ Name: 'Options.NoWrap',
26
+ Type: 'Bollean',
27
+ },
28
+ {
29
+ Label: '横向对齐',
30
+ Name: 'Options.ItemsAlign',
31
+ Type: 'Select',
32
+ Options: [
33
+ {
34
+ Label: '居上',
35
+ Value: 'items-start',
36
+ },
37
+ {
38
+ Label: '居中',
39
+ Value: 'items-center',
40
+ },
41
+ {
42
+ Label: '居下',
43
+ Value: 'items-end',
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ Label: '竖向对齐',
49
+ Name: 'Options.JustifyAlign',
50
+ Type: 'Select',
51
+ Options: [
52
+ {
53
+ Label: '居左',
54
+ Value: 'justify-start',
55
+ },
56
+ {
57
+ Label: '居中',
58
+ Value: 'justify-center',
59
+ },
60
+ {
61
+ Label: '居右',
62
+ Value: 'justify-end',
63
+ },
64
+ {
65
+ Label: '围绕',
66
+ Value: 'justify-around',
67
+ },
68
+ {
69
+ Label: '之间',
70
+ Value: 'justify-between',
71
+ },
72
+ {
73
+ Label: '均匀',
74
+ Value: 'justify-evently',
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ Label: '字段',
80
+ Name: 'Options.List',
81
+ Type: 'FieldList',
82
+ Options: {
83
+ Columns: [
84
+ {
85
+ Label: '#',
86
+ Name: 'Index',
87
+ sortable: true,
88
+ },
89
+ {
90
+ Label: '类型',
91
+ Name: 'Type',
92
+ style: 'max-width: 120px;',
93
+ sortable: true,
94
+ },
95
+ {
96
+ Label: '名称',
97
+ Name: 'Name',
98
+ style: 'max-width: 200px;',
99
+ },
100
+ {
101
+ Label: '默认',
102
+ Name: 'Default',
103
+ style: 'max-width: 200px;',
104
+ },
105
+ {
106
+ Label: '标题',
107
+ Name: 'Label',
108
+ style: 'max-width: 200px;',
109
+ sortable: true,
110
+ },
111
+ ],
112
+ },
113
+ },
114
+ ],
115
+ Description: '',
116
+ },
117
+ computed: {
118
+ columnClasses() {
119
+ return '';
120
+ },
121
+ },
122
+ };
123
+ </script>
124
+
125
+ <style lang="scss" scoped>
126
+ </style>
@@ -1,6 +1,6 @@
1
1
  import { ref, defineComponent, getCurrentInstance, h, computed } from 'vue';
2
2
  import { QInput, QIcon, QPopupProxy, QDate } 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
 
@@ -38,9 +38,6 @@ export default defineComponent({
38
38
  ...freeFieldProps,
39
39
  },
40
40
  emits: ['input'],
41
- methods: {
42
- ...useFreeFieldMethods,
43
- },
44
41
  setup(props, { emit, slots, expose }){
45
42
  if (!props.Field) return {};
46
43
 
@@ -1,6 +1,6 @@
1
1
  import { ref, defineComponent, getCurrentInstance, h, computed, watch, watchEffect } from 'vue';
2
2
  import { QInput, QIcon, QPopupProxy, QDate } 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
 
@@ -38,9 +38,6 @@ export default defineComponent({
38
38
  ...freeFieldProps,
39
39
  },
40
40
  emits: ['input'],
41
- methods: {
42
- ...useFreeFieldMethods,
43
- },
44
41
  setup(props, { emit, slots, expose }){
45
42
  if (!props.Field) return {};
46
43
 
@@ -1,6 +1,6 @@
1
1
  import { ref, defineComponent, getCurrentInstance, h, computed, watchEffect } from 'vue';
2
2
  import { QTable, QTh, QTd, QTr, QIcon } 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 FreeField from '../composible/fieldWrapper';
6
6
  import { useFormValidator} from '../../composible/useFormValidator';
@@ -177,9 +177,6 @@ export default defineComponent({
177
177
  selection: { type: String, default: 'none' },
178
178
  },
179
179
  emits: ['input', 'add', 'delete'],
180
- methods: {
181
- ...useFreeFieldMethods,
182
- },
183
180
  setup(props, { emit, slots, expose }){
184
181
  if (!props.Field) {
185
182
  return () => null;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, h, watch, 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';
@@ -93,9 +93,6 @@ export default defineComponent({
93
93
  ...freeFieldProps,
94
94
  },
95
95
  emits: ['input'],
96
- methods: {
97
- ...useFreeFieldMethods,
98
- },
99
96
  setup(props, { emit, slots , expose }){
100
97
  if (!props.Field) return {};
101
98
 
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <span class="input-field-number-range simple-field">
3
+ <span v-if="Field.ReadOnly">
4
+ <span
5
+ :class="`field-label field-label-readonly ${(Field.Label && Field.Label.trim().length)
6
+ ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
7
+ v-if="Field.Label"
8
+ >
9
+ <q-tooltip v-if="Field.Description" anchor="top right">{{Field.Description}}</q-tooltip>
10
+ {{Field.Label || ''}}
11
+ <span v-if="Field.Required" class="required-mark">*</span>
12
+ </span>
13
+ <span class="readonly-content">{{fieldData}}</span>
14
+ </span>
15
+ <span v-else class="row items-center no-wrap">
16
+ <q-input
17
+ :readonly="Field.ReadOnly"
18
+ v-bind="$attrs"
19
+ :placeholder="$attrs.placeholder || $t(getModule('field-components').config['defaultInputFieldPlaceholder'])"
20
+ v-on="$listeners"
21
+ hide-bottom-space
22
+ @input="rangeChanged"
23
+ type="number"
24
+ v-model.number="range.min"
25
+ :ref="`input_field_validator_${Field.Name || Field.Label}`"
26
+ :maxlength="maxlength"
27
+ >
28
+ <template
29
+ v-slot:prepend
30
+ v-if="Field.Options && Field.Options.Prefix"
31
+ >
32
+ <span class="prefix">{{Field.Options.Prefix}}</span>
33
+ </template>
34
+
35
+ <template
36
+ v-slot:append
37
+ v-if="Field.Options && Field.Options.Postfix"
38
+ >
39
+ <span class="postfix">{{Field.Options.Postfix}}</span>
40
+ </template>
41
+ </q-input>
42
+ <span class="input-field-range-separator">{{`${Field.Separator || '~'}`}}</span>
43
+ <q-input
44
+ :readonly="Field.ReadOnly"
45
+ v-bind="$attrs"
46
+ :placeholder="$attrs.placeholder || $t(getModule('field-components').config['defaultInputFieldPlaceholder'])"
47
+ v-on="$listeners"
48
+ hide-bottom-space
49
+ @input="rangeChanged"
50
+ type="number"
51
+ v-model.number="range.max"
52
+ :ref="`input_field_validator_${Field.Name || Field.Label}2`"
53
+ :maxlength="maxlength"
54
+ >
55
+ <template
56
+ v-slot:prepend
57
+ v-if="Field.Options && Field.Options.Prefix"
58
+ >
59
+ <span class="prefix">{{Field.Options.Prefix}}</span>
60
+ </template>
61
+
62
+ <template
63
+ v-slot:append
64
+ v-if="Field.Options && Field.Options.Postfix"
65
+ >
66
+ <span class="postfix">{{Field.Options.Postfix}}</span>
67
+ </template>
68
+ </q-input>
69
+ </span>
70
+
71
+ <slot name="warning"></slot>
72
+ </span>
73
+ </template>
74
+
75
+ <script>
76
+ import { InputFieldMixin } from 'eis-admin-mixins';
77
+
78
+ export default {
79
+ name: 'InputFieldNumberRange',
80
+ mixins: [InputFieldMixin],
81
+ fieldInfo: {
82
+ Category: 'Simple',
83
+ Label: '数字范围',
84
+ Value: 'NumberRange',
85
+ Extra: [
86
+ {
87
+ Type: 'String',
88
+ Label: '最小值',
89
+ Name: 'MinValue',
90
+ },
91
+ {
92
+ Type: 'String',
93
+ Label: '最大值',
94
+ Name: 'MaxValue',
95
+ },
96
+ ],
97
+ Description: '',
98
+ },
99
+ data() {
100
+ return {
101
+ range: {
102
+ min: 0,
103
+ max: 0,
104
+ },
105
+ };
106
+ },
107
+ watch: {
108
+ fieldData() {
109
+ const yl = (this.fieldData || '').split(this.Field.Separator || '~');
110
+ [this.range.min, this.range.max] = yl;
111
+ },
112
+ },
113
+ computed: {
114
+ maxlength() {
115
+ if (this.Field && this.Field.Options && this.Field.Options.MaxLength) {
116
+ return this.Field.Options.MaxLength;
117
+ }
118
+
119
+ return '';
120
+ },
121
+ },
122
+ methods: {
123
+ rangeChanged() {
124
+ let min = Number(this.range.min);
125
+ let max = Number(this.range.max);
126
+ if (!min && min !== 0 && !max && max !== 0) return;
127
+
128
+ const minValue = this.Field.MinValue !== void 0 && Number(this.Field.MinValue) || -Infinity;
129
+ const maxValue = this.Field.MaxValue !== void 0 && Number(this.Field.MaxValue) || Infinity;
130
+
131
+ min = Math.max(min, minValue);
132
+ min = Math.min(min, maxValue);
133
+
134
+ max = Math.max(max, minValue);
135
+ max = Math.min(max, maxValue);
136
+
137
+ this.fieldData = [min, max].join(
138
+ this.Field.Separator || '~',
139
+ );
140
+
141
+ this.$emit('input');
142
+ },
143
+ },
144
+ };
145
+ </script>
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, h, ref, computed } from 'vue';
2
2
  import { QInput, QIcon } 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
 
@@ -29,9 +29,6 @@ export default defineComponent({
29
29
  ...freeFieldProps,
30
30
  },
31
31
  emits: ['input'],
32
- methods: {
33
- ...useFreeFieldMethods,
34
- },
35
32
  setup(props, { emit, slots, expose }){
36
33
  if (!props.Field) return {};
37
34
 
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <div class="input-field-row row" :class="rowClasses">
3
+ <input-field
4
+ v-for="(field, idx) in Field.Options.List"
5
+ :Field="field"
6
+ :values="fieldData"
7
+ :key="idx"
8
+ @input="$emit('input')"></input-field>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ import { InputFieldMixin } from 'eis-admin-mixins';
14
+
15
+ export default {
16
+ name: 'InputFieldRow',
17
+ mixins: [InputFieldMixin],
18
+ fieldInfo: {
19
+ Category: 'Container',
20
+ Label: '行',
21
+ Value: 'Row',
22
+ Extra: [
23
+ {
24
+ Label: '不换行',
25
+ Name: 'Options.NoWrap',
26
+ Type: 'Bollean',
27
+ },
28
+ {
29
+ Label: '竖向对齐',
30
+ Name: 'Options.ItemsAlign',
31
+ Type: 'Select',
32
+ Options: [
33
+ {
34
+ Label: '居上',
35
+ Value: 'items-start',
36
+ },
37
+ {
38
+ Label: '居中',
39
+ Value: 'items-center',
40
+ },
41
+ {
42
+ Label: '居下',
43
+ Value: 'items-end',
44
+ },
45
+ ],
46
+ },
47
+ {
48
+ Label: '横向对齐',
49
+ Name: 'Options.JustifyAlign',
50
+ Type: 'Select',
51
+ Options: [
52
+ {
53
+ Label: '居左',
54
+ Value: 'justify-start',
55
+ },
56
+ {
57
+ Label: '居中',
58
+ Value: 'justify-center',
59
+ },
60
+ {
61
+ Label: '居右',
62
+ Value: 'justify-end',
63
+ },
64
+ {
65
+ Label: '围绕',
66
+ Value: 'justify-around',
67
+ },
68
+ {
69
+ Label: '之间',
70
+ Value: 'justify-between',
71
+ },
72
+ {
73
+ Label: '均匀',
74
+ Value: 'justify-evently',
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ Label: '字段',
80
+ Name: 'Options.List',
81
+ Type: 'FieldList',
82
+ Options: {
83
+ Columns: [
84
+ {
85
+ Label: '#',
86
+ Name: 'Index',
87
+ sortable: true,
88
+ },
89
+ {
90
+ Label: '类型',
91
+ Name: 'Type',
92
+ style: 'max-width: 120px;',
93
+ sortable: true,
94
+ },
95
+ {
96
+ Label: '名称',
97
+ Name: 'Name',
98
+ style: 'max-width: 200px;',
99
+ },
100
+ {
101
+ Label: '默认',
102
+ Name: 'Default',
103
+ style: 'max-width: 200px;',
104
+ },
105
+ {
106
+ Label: '标题',
107
+ Name: 'Label',
108
+ style: 'max-width: 200px;',
109
+ sortable: true,
110
+ },
111
+ ],
112
+ },
113
+ },
114
+ ],
115
+ Description: '',
116
+ },
117
+ computed: {
118
+ rowClasses() {
119
+ return '';
120
+ },
121
+ },
122
+ };
123
+ </script>
124
+
125
+ <style lang="scss" scoped>
126
+ </style>
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, computed } from 'vue';
2
- import { useFreeField, freeFieldProps, useFreeFieldMethods } from '../composible/useFreeField';
2
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField';
3
3
  import { QInput } from 'quasar';
4
4
  import ReadonlyContent from '../composible/readonlyContent';
5
5
  import freeFieldLabel from '../composible/freeFieldLabel';
@@ -49,9 +49,6 @@ export default defineComponent({
49
49
  ...freeFieldProps,
50
50
  },
51
51
  emits: ['input'],
52
- methods: {
53
- ...useFreeFieldMethods,
54
- },
55
52
  setup(props, { emit, slots, expose }){
56
53
  if (!props.Field) return {};
57
54