free-fe-core-modules 0.0.7 → 0.0.9
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/Basic/SummaryHead.vue +1 -6
- package/components/Dialog/BasicDialog.vue +140 -128
- package/components/SlidingNews/index.vue +12 -23
- package/composible/useFormValidator.js +8 -7
- package/composible/useObjectData.js +2 -2
- 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/Labels.vue +1 -0
- package/free-field/Fields/Number.js +3 -6
- package/free-field/Fields/NumberRange.vue +145 -0
- package/free-field/Fields/Password.js +2 -5
- package/free-field/Fields/Permission.vue +1 -0
- package/free-field/Fields/PermissionEditor.vue +0 -1
- package/free-field/Fields/Row.vue +126 -0
- package/free-field/Fields/Search.vue +7 -10
- package/free-field/Fields/Select.vue +1 -1
- package/free-field/Fields/String.js +1 -4
- package/free-field/Fields/Tabs.vue +161 -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/fieldWrapper.js +1 -1
- package/free-field/composible/useFreeField.js +45 -112
- package/i18n/en-us/index.js +64 -67
- package/index.js +53 -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 +38 -24
- package/view/error/list.vue +17 -20
- package/view/menu/index.vue +0 -3
package/view/dict/index.vue
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
v-if="field.Name !== 'Name' || !selectedDictNode.Parent"
|
|
54
54
|
:values="editingDict"
|
|
55
55
|
:Field="field"
|
|
56
|
+
ref="fieldsToValidate"
|
|
56
57
|
></free-field>
|
|
57
58
|
</div>
|
|
58
59
|
|
|
@@ -98,10 +99,11 @@
|
|
|
98
99
|
</template>
|
|
99
100
|
|
|
100
101
|
<script>
|
|
101
|
-
import { defineComponent } from 'vue';
|
|
102
|
+
import { defineComponent, watch } from 'vue';
|
|
102
103
|
import { copyToClipboard } from 'quasar';
|
|
103
104
|
import { requests } from '@/boot/axios';
|
|
104
105
|
import { useObjectData, objectDataProps } from '../../composible/useObjectData';
|
|
106
|
+
import { useFormValidator} from '../../composible/useFormValidator';
|
|
105
107
|
|
|
106
108
|
export default defineComponent({
|
|
107
109
|
name: 'DictionaryPage',
|
|
@@ -127,9 +129,12 @@ export default defineComponent({
|
|
|
127
129
|
refreshData,
|
|
128
130
|
} = useObjectData(props, ctx);
|
|
129
131
|
|
|
132
|
+
const { validate } = useFormValidator('fieldsToValidate');
|
|
133
|
+
|
|
130
134
|
return {
|
|
131
|
-
data,
|
|
135
|
+
data,
|
|
132
136
|
refreshData,
|
|
137
|
+
validate,
|
|
133
138
|
};
|
|
134
139
|
},
|
|
135
140
|
watch: {
|
|
@@ -166,6 +171,26 @@ export default defineComponent({
|
|
|
166
171
|
}
|
|
167
172
|
},
|
|
168
173
|
methods: {
|
|
174
|
+
makeLabelsName(n) {
|
|
175
|
+
n.Labels = n.Labels || [];
|
|
176
|
+
// check labels according to the locales
|
|
177
|
+
const locales = this.ctx.config.locales || [];
|
|
178
|
+
for(let i = 0; i < locales.length; i += 1) {
|
|
179
|
+
const locale = locales[i];
|
|
180
|
+
const existsLabel = n.Labels.find((l) => l.Locale === locale.locale);
|
|
181
|
+
|
|
182
|
+
if (!existsLabel) {
|
|
183
|
+
n.Labels.push({
|
|
184
|
+
Label: '',
|
|
185
|
+
Locale: locale.locale,
|
|
186
|
+
Description: '',
|
|
187
|
+
Name: locale.name,
|
|
188
|
+
});
|
|
189
|
+
} else {
|
|
190
|
+
existsLabel.Name = locale.name;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
169
194
|
loadSubDicts({ key, done, node /* , fail */ }) {
|
|
170
195
|
this.GetData(key, node.level)
|
|
171
196
|
.then((d) => {
|
|
@@ -189,28 +214,13 @@ export default defineComponent({
|
|
|
189
214
|
Type: 'String',
|
|
190
215
|
};
|
|
191
216
|
}
|
|
217
|
+
|
|
218
|
+
this.makeLabelsName(this.editingDict);
|
|
192
219
|
},
|
|
193
220
|
editNode(n) {
|
|
194
221
|
if (!n) return;
|
|
195
222
|
|
|
196
|
-
|
|
197
|
-
// check labels according to the locales
|
|
198
|
-
const locales = this.ctx.config.locales || [];
|
|
199
|
-
for(let i = 0; i < locales.length; i += 1) {
|
|
200
|
-
const locale = locales[i];
|
|
201
|
-
const existsLabel = n.Labels.find((l) => l.Locale === locale.locale);
|
|
202
|
-
|
|
203
|
-
if (!existsLabel) {
|
|
204
|
-
n.Labels.push({
|
|
205
|
-
Label: '',
|
|
206
|
-
Locale: locale.locale,
|
|
207
|
-
Description: '',
|
|
208
|
-
Name: locale.name,
|
|
209
|
-
});
|
|
210
|
-
} else {
|
|
211
|
-
existsLabel.Name = locale.name;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
223
|
+
this.makeLabelsName(n);
|
|
214
224
|
|
|
215
225
|
if (this.selectedDictNode && this.selectedDictNode.id === n.id) {
|
|
216
226
|
this.selectedDictNode = {};
|
|
@@ -243,6 +253,14 @@ export default defineComponent({
|
|
|
243
253
|
},
|
|
244
254
|
onSaveClick() {
|
|
245
255
|
if (Object.keys(this.editingDict) <= 0) return;
|
|
256
|
+
|
|
257
|
+
if (!this.validate()) return;
|
|
258
|
+
|
|
259
|
+
// clear labels without label
|
|
260
|
+
this.editingDict.Labels = (this.editingDict.Labels || []).filter(
|
|
261
|
+
(l) => l.Label,
|
|
262
|
+
);
|
|
263
|
+
|
|
246
264
|
// if is adding new
|
|
247
265
|
if (this.selectedDictNode.addingNew) {
|
|
248
266
|
this.editingDict = {
|
|
@@ -252,10 +270,6 @@ export default defineComponent({
|
|
|
252
270
|
...this.editingDict,
|
|
253
271
|
};
|
|
254
272
|
|
|
255
|
-
// fix: the default content for number input will be string!!!!????
|
|
256
|
-
// convert to number
|
|
257
|
-
this.editingDict.Index = Number(this.editingDict.Index || '0');
|
|
258
|
-
|
|
259
273
|
this.addDict(this.editingDict).then((r) => {
|
|
260
274
|
if (r && r.msg === 'OK') {
|
|
261
275
|
const parent = this.$refs.dictTree.getNodeByKey(
|
package/view/error/list.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flow-list">
|
|
3
|
-
<summary-head :values="data.summary"
|
|
3
|
+
<summary-head :values="data.summary"></summary-head>
|
|
4
4
|
<q-table
|
|
5
5
|
flat
|
|
6
6
|
bordered
|
|
@@ -23,26 +23,24 @@
|
|
|
23
23
|
<span v-else>
|
|
24
24
|
{{ valueFilters(col, col.value || Object.nestValue(props.row, col.field))}}
|
|
25
25
|
<q-popup-edit
|
|
26
|
+
v-slot="scope"
|
|
26
27
|
v-model="props.row.Message"
|
|
27
28
|
v-if="col.name === 'message'"
|
|
28
|
-
buttons
|
|
29
|
-
persistent
|
|
30
29
|
label-set="保存"
|
|
31
30
|
label-cancel="取消"
|
|
32
|
-
@save="messageChanged(props.row.id, props.row.Message)"
|
|
33
31
|
>
|
|
34
|
-
<q-input v-model="props.row.Message" hide-bottom-space autofocus
|
|
32
|
+
<q-input v-model="props.row.Message" hide-bottom-space autofocus
|
|
33
|
+
@keyup.enter="messageChanged(props.row.id, props.row.Message, scope)"/>
|
|
35
34
|
</q-popup-edit>
|
|
36
35
|
<q-popup-edit
|
|
37
|
-
v-
|
|
36
|
+
v-slot="scope"
|
|
37
|
+
:model-value="props.row.Description"
|
|
38
38
|
v-if="col.name === 'description'"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
label-set="保存"
|
|
42
|
-
label-cancel="取消"
|
|
43
|
-
@save="descriptionChanged(props.row.id, props.row.Description)"
|
|
39
|
+
:label-set="$t('保存')"
|
|
40
|
+
:label-cancel="$t('取消')"
|
|
44
41
|
>
|
|
45
|
-
<q-input v-model="props.row.Description" hide-bottom-space autofocus
|
|
42
|
+
<q-input v-model="props.row.Description" hide-bottom-space autofocus
|
|
43
|
+
@keyup.enter="descriptionChanged(props.row.id, props.row.Description, scope)"/>
|
|
46
44
|
</q-popup-edit>
|
|
47
45
|
</span>
|
|
48
46
|
</q-td>
|
|
@@ -66,7 +64,7 @@
|
|
|
66
64
|
|
|
67
65
|
<template v-slot:no-data>
|
|
68
66
|
<div class="full-width full-height row flex-center q-gutter-sm">
|
|
69
|
-
<span
|
|
67
|
+
<span>{{$t('暂无数据')}}</span>
|
|
70
68
|
</div>
|
|
71
69
|
</template>
|
|
72
70
|
|
|
@@ -106,7 +104,7 @@ export default defineComponent({
|
|
|
106
104
|
} = useObjectData(props, ctx);
|
|
107
105
|
|
|
108
106
|
return {
|
|
109
|
-
data,
|
|
107
|
+
data,
|
|
110
108
|
refreshData,
|
|
111
109
|
};
|
|
112
110
|
},
|
|
@@ -165,10 +163,7 @@ export default defineComponent({
|
|
|
165
163
|
|
|
166
164
|
for (let i = 0; i < filters.length; i += 1) {
|
|
167
165
|
const f = filters[i];
|
|
168
|
-
|
|
169
|
-
if (filter) {
|
|
170
|
-
val = filter(v || col.value);
|
|
171
|
-
}
|
|
166
|
+
val = this.$filter(f, v || col.value)
|
|
172
167
|
}
|
|
173
168
|
}
|
|
174
169
|
|
|
@@ -181,7 +176,8 @@ export default defineComponent({
|
|
|
181
176
|
paginationChanged(p) {
|
|
182
177
|
this.refreshData({ page: p });
|
|
183
178
|
},
|
|
184
|
-
messageChanged(id, msg) {
|
|
179
|
+
messageChanged(id, msg, popup) {
|
|
180
|
+
popup.set();
|
|
185
181
|
updateErrorCode(id, msg).then((d) => {
|
|
186
182
|
if (d && d.msg === 'OK') {
|
|
187
183
|
this.$q.notify(this.$t('notifySaved'));
|
|
@@ -190,7 +186,8 @@ export default defineComponent({
|
|
|
190
186
|
}
|
|
191
187
|
});
|
|
192
188
|
},
|
|
193
|
-
descriptionChanged(id, desc) {
|
|
189
|
+
descriptionChanged(id, desc, popup) {
|
|
190
|
+
popup.set();
|
|
194
191
|
updateDescription(id, desc).then((d) => {
|
|
195
192
|
if (d && d.msg === 'OK') {
|
|
196
193
|
this.$q.notify(this.$t('notifySaved'));
|