free-fe-core-modules 0.0.54 → 0.1.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/components/Basic/EIcon.vue +4 -14
- package/components/Dialog/index.js +1 -1
- package/free-field/Fields/AgreementCheck.js +3 -3
- package/free-field/Fields/DateRange.js +4 -3
- package/free-field/Fields/DynamicList.js +4 -5
- package/free-field/Fields/File.vue +52 -160
- package/free-field/Fields/FileList.vue +47 -156
- package/free-field/Fields/FixedList.vue +17 -49
- package/free-field/Fields/FreeFieldList.vue +17 -64
- package/free-field/Fields/Image.vue +54 -133
- package/free-field/Fields/ImageList.vue +42 -106
- package/free-field/Fields/MixedTable.vue +1 -1
- package/free-field/Fields/Number.js +0 -1
- package/free-field/Fields/Permission.vue +8 -20
- package/free-field/Fields/QueryFilters.vue +4 -8
- package/free-field/Fields/Search.vue +51 -109
- package/free-field/Fields/Select.vue +49 -130
- package/free-field/Fields/SingleList.vue +19 -28
- package/free-field/Fields/YearRange.vue +22 -36
- package/free-field/Fields/pdfviewer.js +5 -6
- package/free-field/composible/fieldWrapper.js +1 -2
- package/free-field/composible/useUploader.js +5 -5
- package/index.js +9 -10
- package/package.json +1 -1
- package/view/dict/index.vue +27 -66
|
@@ -57,9 +57,9 @@ export default {
|
|
|
57
57
|
},
|
|
58
58
|
[
|
|
59
59
|
($q.platform.is.electron || props.type === 'pdfjs')
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
? vm.__renderIFramePDFJS(h)
|
|
62
|
-
|
|
62
|
+
|
|
63
63
|
: vm.__renderObject(h),
|
|
64
64
|
],
|
|
65
65
|
);
|
|
@@ -69,7 +69,7 @@ export default {
|
|
|
69
69
|
};
|
|
70
70
|
},
|
|
71
71
|
methods: {
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
__renderObject(h) {
|
|
74
74
|
return h(
|
|
75
75
|
'object',
|
|
@@ -89,13 +89,13 @@ export default {
|
|
|
89
89
|
},
|
|
90
90
|
[
|
|
91
91
|
// browser object not supported, try iframe
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
this.__renderIFrame(h),
|
|
94
94
|
],
|
|
95
95
|
);
|
|
96
96
|
},
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
__renderIFrame(h) {
|
|
100
100
|
return h(
|
|
101
101
|
'iframe',
|
|
@@ -108,7 +108,6 @@ export default {
|
|
|
108
108
|
);
|
|
109
109
|
},
|
|
110
110
|
|
|
111
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
112
111
|
__renderIFramePDFJS(h) {
|
|
113
112
|
return h(
|
|
114
113
|
'iframe',
|
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
|
|
32
32
|
const localField = computed(() => {
|
|
33
33
|
const lField = Object.clone(props.Field);
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
lField.Rules = lField.Rules || [];
|
|
36
36
|
for (let i = 0; i < lField.Rules.length; i += 1) {
|
|
37
37
|
const rule = lField.Rules[i];
|
|
@@ -70,7 +70,6 @@ export default defineComponent({
|
|
|
70
70
|
`;
|
|
71
71
|
|
|
72
72
|
try {
|
|
73
|
-
// eslint-disable-next-line no-eval
|
|
74
73
|
return eval(funcStr);
|
|
75
74
|
} catch (ex) {
|
|
76
75
|
console.error(ex)
|
|
@@ -8,7 +8,7 @@ function fileSizeStrToNumber (s) {
|
|
|
8
8
|
const sizeMatch = s.match(/^([0-9]*)(k|m|g*)(b*)/);
|
|
9
9
|
|
|
10
10
|
if (sizeMatch) {
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
// const [tmp, num, unit] = sizeMatch;
|
|
13
13
|
const num = sizeMatch[1];
|
|
14
14
|
const unit = sizeMatch[2];
|
|
@@ -58,7 +58,7 @@ function fileSizeNumberToStr (s) {
|
|
|
58
58
|
return `${sizeNum.toFixed(2)}${unit}`;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
function _getFileType (f) {
|
|
63
63
|
if (!f) return {};
|
|
64
64
|
|
|
@@ -100,7 +100,7 @@ function _getFileType (f) {
|
|
|
100
100
|
return {};
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export function useUploader(props
|
|
103
|
+
export function useUploader(props) {
|
|
104
104
|
const { proxy:vm } = getCurrentInstance();
|
|
105
105
|
|
|
106
106
|
const showPreview = ref(false);
|
|
@@ -169,7 +169,7 @@ export function useUploader(props, ctx) {
|
|
|
169
169
|
|
|
170
170
|
switch (fType) {
|
|
171
171
|
case 'image':
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
type = file.id || (file.__img ? file.__img.src : '');
|
|
174
174
|
break;
|
|
175
175
|
case 'audio':
|
|
@@ -269,7 +269,7 @@ export function useUploader(props, ctx) {
|
|
|
269
269
|
if (file.id) {
|
|
270
270
|
url = vm.$filter('serverImage', file.id);
|
|
271
271
|
} else {
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
url = file.__img ? file.__img.src : '';
|
|
274
274
|
}
|
|
275
275
|
break;
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getCurrentInstance } from 'vue';
|
|
2
2
|
import { date as quasarDate } from 'quasar';
|
|
3
3
|
import config from '@/config';
|
|
4
|
-
import useAppStore from '@/stores/app';
|
|
4
|
+
// import useAppStore from '@/stores/app';
|
|
5
5
|
import MsgDialog from './components/Dialog/index';
|
|
6
6
|
|
|
7
7
|
import EIcon from './components/Basic/EIcon.vue';
|
|
8
|
-
import StickyButtons from './components/StickyButtons';
|
|
9
|
-
import SelectLocales from './components/SelectLocales';
|
|
8
|
+
import StickyButtons from './components/StickyButtons/index.vue';
|
|
9
|
+
import SelectLocales from './components/SelectLocales/index.vue';
|
|
10
10
|
import SummaryHead from './components/Basic/SummaryHead.vue';
|
|
11
11
|
import SlidingCarousel from './components/SlidingCarousel/index.vue';
|
|
12
12
|
import SlidingNews from './components/SlidingNews/index.vue';
|
|
@@ -185,7 +185,6 @@ const filters = {
|
|
|
185
185
|
}
|
|
186
186
|
desc = step.Description.find((s) => s.Status === (status || stepStatus || '').toString());
|
|
187
187
|
desc = desc ? desc.Description : '';
|
|
188
|
-
desc = desc;
|
|
189
188
|
}
|
|
190
189
|
|
|
191
190
|
desc = desc || '未知状态';
|
|
@@ -196,10 +195,10 @@ const filters = {
|
|
|
196
195
|
export default (app, root) => {
|
|
197
196
|
root.use(MsgDialog);
|
|
198
197
|
|
|
199
|
-
const appStore = useAppStore();
|
|
198
|
+
// const appStore = useAppStore();
|
|
200
199
|
|
|
201
200
|
const 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);
|
|
202
|
-
const validatorEmail = (d) => !d || /^(([^<>()
|
|
201
|
+
const 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);
|
|
203
202
|
return {
|
|
204
203
|
config: {
|
|
205
204
|
backendDependencies: ["core-modules"],
|
|
@@ -242,7 +241,7 @@ export default (app, root) => {
|
|
|
242
241
|
Dense: true,
|
|
243
242
|
LabelField: 'Name',
|
|
244
243
|
ValueField: 'Locale',
|
|
245
|
-
|
|
244
|
+
Fields: [{
|
|
246
245
|
Name: 'Locale',
|
|
247
246
|
Label: '语言',
|
|
248
247
|
Type: 'String',
|
|
@@ -413,7 +412,7 @@ export default (app, root) => {
|
|
|
413
412
|
validatorOnlyNIZ: (d) => /^([0]|-[1-9][0-9]+)$/.test(d.toString()),
|
|
414
413
|
|
|
415
414
|
//
|
|
416
|
-
validatorUrl: (d) => /^(ht|f)tp(s?)
|
|
415
|
+
validatorUrl: (d) => /^(ht|f)tp(s?):\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-.?,'/\\+&%$#_]*)?/.test(d),
|
|
417
416
|
validatorOfficePhone: (d) => /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{8}$/.test(d),
|
|
418
417
|
validatorChinaZip: (d) => /^[1-9]{1}(\d+){5}$/.test(d),
|
|
419
418
|
|
|
@@ -421,8 +420,8 @@ export default (app, root) => {
|
|
|
421
420
|
validatorPwd0: (d) => /^.*(?=.{6,16}).*$/.test(d),
|
|
422
421
|
validatorPwd1: (d) => /^.{6,16}$/.test(d),
|
|
423
422
|
validatorPwd2: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z]).*$/.test(d),
|
|
424
|
-
validatorPwd3: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[
|
|
425
|
-
validatorPwd4: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{2,})(?=.*[a-z]{2,})(?=.*[
|
|
423
|
+
validatorPwd3: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?()]).*$/.test(d),
|
|
424
|
+
validatorPwd4: (d) => /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{2,})(?=.*[a-z]{2,})(?=.*[!@#$%^&*?()]).*$/.test(d),
|
|
426
425
|
},
|
|
427
426
|
}
|
|
428
427
|
};
|
package/package.json
CHANGED
package/view/dict/index.vue
CHANGED
|
@@ -1,47 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="admin-dictionary-mgmt-wrapper full-height q-pa-md">
|
|
3
|
-
<q-tree
|
|
4
|
-
|
|
5
|
-
ref="dictTree"
|
|
6
|
-
accordion
|
|
7
|
-
no-connectors
|
|
8
|
-
node-key="id"
|
|
9
|
-
label-key="Label"
|
|
10
|
-
@lazy-load="loadSubDicts"
|
|
11
|
-
@update:expanded="onNodeExpanded"
|
|
12
|
-
>
|
|
3
|
+
<q-tree :nodes="(data && data.total) ? data.docs : []" ref="dictTree" accordion no-connectors node-key="id"
|
|
4
|
+
label-key="Label" @lazy-load="loadSubDicts" @update:expanded="onNodeExpanded">
|
|
13
5
|
<template v-slot:default-header="prop">
|
|
14
|
-
<div
|
|
15
|
-
class="dictionary-head row items-center full-width"
|
|
16
|
-
style="border-bottom: solid 1px grey;"
|
|
17
|
-
>
|
|
6
|
+
<div class="dictionary-head row items-center full-width" style="border-bottom: solid 1px grey;">
|
|
18
7
|
<div>
|
|
19
8
|
{{ dictLabel(prop.node) }}
|
|
20
|
-
<span
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
v-if="prop.node.Description"
|
|
26
|
-
caption
|
|
27
|
-
class="description ellipsis-3-lines"
|
|
28
|
-
v-html="prop.node.Description"
|
|
29
|
-
></div>
|
|
9
|
+
<span v-if="prop.node.level === 1 && prop.node.Name" class="dictionary-data-name">({{ prop.node.Name
|
|
10
|
+
}})</span>
|
|
11
|
+
<div v-if="prop.node.Description" caption class="description ellipsis-3-lines"
|
|
12
|
+
v-html="prop.node.Description"></div>
|
|
30
13
|
</div>
|
|
31
14
|
<q-space></q-space>
|
|
32
15
|
|
|
33
16
|
<span class="flex justify-start action-buttons">
|
|
34
|
-
<q-btn v-if="prop.node.addingNew" flat icon="add"
|
|
35
|
-
|
|
36
|
-
<q-btn v-if="!prop.node.addingNew" flat icon="
|
|
37
|
-
@click.stop="
|
|
38
|
-
<q-btn
|
|
39
|
-
v-if="!prop.node.addingNew"
|
|
40
|
-
:disabled="prop.node.BuiltIn"
|
|
41
|
-
flat
|
|
42
|
-
icon="delete"
|
|
43
|
-
@click.stop="deleteNode(prop.node)"
|
|
44
|
-
></q-btn>
|
|
17
|
+
<q-btn v-if="prop.node.addingNew" flat icon="add" @click.stop="addNode(prop.node)"></q-btn>
|
|
18
|
+
<q-btn v-if="!prop.node.addingNew" flat icon="edit" @click.stop="editNode(prop.node)"></q-btn>
|
|
19
|
+
<q-btn v-if="!prop.node.addingNew" :disabled="prop.node.BuiltIn" flat icon="delete"
|
|
20
|
+
@click.stop="deleteNode(prop.node)"></q-btn>
|
|
45
21
|
</span>
|
|
46
22
|
</div>
|
|
47
23
|
</template>
|
|
@@ -49,12 +25,8 @@
|
|
|
49
25
|
<template v-slot:default-body="prop">
|
|
50
26
|
<div v-if="prop.node.id === selectedDictNode.id" class="full-width">
|
|
51
27
|
<div v-for="(field, fIndex) in dictFields || []" :key="fIndex">
|
|
52
|
-
<free-field
|
|
53
|
-
|
|
54
|
-
:values="editingDict"
|
|
55
|
-
:Field="field"
|
|
56
|
-
ref="fieldsToValidate"
|
|
57
|
-
></free-field>
|
|
28
|
+
<free-field v-if="field.Name !== 'Name' || !selectedDictNode.Parent" :values="editingDict" :Field="field"
|
|
29
|
+
ref="fieldsToValidate"></free-field>
|
|
58
30
|
</div>
|
|
59
31
|
|
|
60
32
|
<div class="action-btns full-width row justify-center q-gutter-md">
|
|
@@ -62,20 +34,17 @@
|
|
|
62
34
|
<q-btn :label="$t('cancelButtonText')" class="btn-secondary" @click="onCancelClick" />
|
|
63
35
|
</div>
|
|
64
36
|
|
|
65
|
-
<sticky-buttons
|
|
66
|
-
|
|
67
|
-
{
|
|
37
|
+
<sticky-buttons :actions="[
|
|
38
|
+
{
|
|
68
39
|
Action: 'cancel',
|
|
69
|
-
icon:'cancel',
|
|
40
|
+
icon: 'cancel',
|
|
70
41
|
Label: $t('cancelButtonText')
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@click="stickyButtonClicked"
|
|
78
|
-
></sticky-buttons>
|
|
42
|
+
}, {
|
|
43
|
+
Action: 'save',
|
|
44
|
+
icon: 'save',
|
|
45
|
+
Label: $t('saveButtonText')
|
|
46
|
+
}
|
|
47
|
+
]" @click="stickyButtonClicked"></sticky-buttons>
|
|
79
48
|
</div>
|
|
80
49
|
</template>
|
|
81
50
|
</q-tree>
|
|
@@ -85,12 +54,7 @@
|
|
|
85
54
|
<q-btn flat @click="importTranslates" class="btn-primary">导入翻译</q-btn>
|
|
86
55
|
|
|
87
56
|
<div class="row full-width q-mt-md">
|
|
88
|
-
<q-input v-if="showImportTextArea"
|
|
89
|
-
class="full-width"
|
|
90
|
-
type="textarea"
|
|
91
|
-
autogrow
|
|
92
|
-
v-model="importText"
|
|
93
|
-
placeholder="请输入要导入的内容(tab键分割),如:
|
|
57
|
+
<q-input v-if="showImportTextArea" class="full-width" type="textarea" autogrow v-model="importText" placeholder="请输入要导入的内容(tab键分割),如:
|
|
94
58
|
xxx类型 类型一 en-us Type One
|
|
95
59
|
xxx类型 类型二 en-us Type Two"></q-input>
|
|
96
60
|
</div>
|
|
@@ -99,11 +63,11 @@
|
|
|
99
63
|
</template>
|
|
100
64
|
|
|
101
65
|
<script>
|
|
102
|
-
import { defineComponent
|
|
66
|
+
import { defineComponent } from 'vue';
|
|
103
67
|
import { copyToClipboard } from 'quasar';
|
|
104
68
|
import { requests } from '@/boot/axios';
|
|
105
|
-
import { useObjectData, objectDataProps } from '../../composible/useObjectData';
|
|
106
|
-
import { useFormValidator} from '../../composible/useFormValidator';
|
|
69
|
+
import { useObjectData, objectDataProps } from '../../composible/useObjectData.js';
|
|
70
|
+
import { useFormValidator} from '../../composible/useFormValidator.js';
|
|
107
71
|
|
|
108
72
|
export default defineComponent({
|
|
109
73
|
name: 'DictionaryPage',
|
|
@@ -138,7 +102,7 @@ export default defineComponent({
|
|
|
138
102
|
};
|
|
139
103
|
},
|
|
140
104
|
watch: {
|
|
141
|
-
|
|
105
|
+
|
|
142
106
|
'editingDict.Type': function (v) {
|
|
143
107
|
const valueField = this.dictFields.find((f) => f.Name === 'Value');
|
|
144
108
|
if (valueField) {
|
|
@@ -393,7 +357,6 @@ export default defineComponent({
|
|
|
393
357
|
} else {
|
|
394
358
|
// do the i
|
|
395
359
|
this.postRequest('/dict/import/trans', {c: this.importText}).then((d) => {
|
|
396
|
-
const data = d && d.data;
|
|
397
360
|
if (d && d.msg === 'OK') {
|
|
398
361
|
this.$q.notify('导入成功!');
|
|
399
362
|
}
|
|
@@ -403,8 +366,6 @@ export default defineComponent({
|
|
|
403
366
|
exportTranslates() {
|
|
404
367
|
this.showImportTextArea = false;
|
|
405
368
|
this.getRequest('/dict/export/trans').then((d) => {
|
|
406
|
-
const data = (d && d.data) || {};
|
|
407
|
-
|
|
408
369
|
if (d.data.c) {
|
|
409
370
|
copyToClipboard(d.data.c);
|
|
410
371
|
this.$q.notify('已拷贝到剪切板,可直接粘贴至excel等工具!');
|