free-fe-core-modules 0.0.55 → 0.1.2
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 +1 -2
- package/free-field/Fields/File.vue +46 -152
- 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 +50 -128
- package/free-field/Fields/ImageList.vue +42 -107
- package/free-field/Fields/Number.js +0 -1
- package/free-field/Fields/Permission.vue +8 -20
- 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 +8 -9
- package/package.json +1 -1
- package/view/dict/index.vue +27 -66
|
@@ -1,69 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="free-field-fixed-list row">
|
|
3
|
-
<span
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
<q-tooltip v-if="Field.Description" anchor="top right">{{Field.Description}}</q-tooltip>
|
|
9
|
-
{{Field.Label || ''}}
|
|
3
|
+
<span :class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
4
|
+
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label !== void 0">
|
|
5
|
+
<q-tooltip v-if="Field.Description" anchor="top right">{{ Field.Description }}</q-tooltip>
|
|
6
|
+
{{ Field.Label || '' }}
|
|
10
7
|
<span v-if="Field.Required" class="required-mark">*</span>
|
|
11
8
|
</span>
|
|
12
|
-
<q-table
|
|
13
|
-
class="
|
|
14
|
-
:rows="tableData"
|
|
15
|
-
:columns="columns"
|
|
16
|
-
row-key="Name"
|
|
17
|
-
:hide-bottom="!summaryContent"
|
|
18
|
-
separator="cell"
|
|
19
|
-
:pagination="{rowsPerPage:100000}"
|
|
20
|
-
table-header-class="row-zebra-even"
|
|
21
|
-
>
|
|
9
|
+
<q-table class="q-ma-xs col" :rows="tableData" :columns="columns" row-key="Name" :hide-bottom="!summaryContent"
|
|
10
|
+
separator="cell" :pagination="{ rowsPerPage: 100000 }" table-header-class="row-zebra-even">
|
|
22
11
|
<template v-slot:top v-if="Field.Warning">
|
|
23
12
|
<slot name="warning"></slot>
|
|
24
13
|
</template>
|
|
25
14
|
<template v-slot:body-cell="props">
|
|
26
|
-
<q-td
|
|
27
|
-
:props="props"
|
|
28
|
-
style="text-align: center;padding:0;margin:0;height:auto;width:auto;"
|
|
29
|
-
v-if="props.col.List &&
|
|
15
|
+
<q-td :props="props" style="text-align: center;padding:0;margin:0;height:auto;width:auto;" v-if="props.col.List &&
|
|
30
16
|
(props.col.List.length === 1) &&
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
>/</q-td>
|
|
34
|
-
<q-td
|
|
35
|
-
:props="props"
|
|
36
|
-
v-else-if="showCell(props)"
|
|
37
|
-
:colspan="props.value && props.value.colspan || 1"
|
|
17
|
+
props.row[props.col.List[0].Name] === 'NaN'" :class="tableTdClass(props.rowIndex)">/</q-td>
|
|
18
|
+
<q-td :props="props" v-else-if="showCell(props)" :colspan="props.value && props.value.colspan || 1"
|
|
38
19
|
:rowspan="props.value && props.value.rowspan || 1"
|
|
39
20
|
:class="`items-center justify-center ${tableTdClass(props.rowIndex)}`"
|
|
40
|
-
style="padding:0;margin:0;height:auto;width:auto;"
|
|
41
|
-
>
|
|
21
|
+
style="padding:0;margin:0;height:auto;width:auto;">
|
|
42
22
|
<span v-if="props.col.List && props.col.List.length > 1" class="full-width full-height">
|
|
43
|
-
<free-field
|
|
44
|
-
|
|
45
|
-
:key="index"
|
|
46
|
-
:Field="columnField(col, true, props.col)"
|
|
47
|
-
:values="props.row"
|
|
48
|
-
@input="cellChanged()"
|
|
49
|
-
ref="fieldsToValid"
|
|
50
|
-
></free-field>
|
|
23
|
+
<free-field v-for="(col, index) in props.col.List" :key="index" :Field="columnField(col, true, props.col)"
|
|
24
|
+
:values="props.row" @input="cellChanged()" ref="fieldsToValid"></free-field>
|
|
51
25
|
</span>
|
|
52
26
|
<span v-else class="full-width full-height">
|
|
53
|
-
<free-field
|
|
54
|
-
|
|
55
|
-
:values="props.row"
|
|
56
|
-
@input="cellChanged()"
|
|
57
|
-
borderless
|
|
58
|
-
ref="fieldToValid"
|
|
59
|
-
></free-field>
|
|
27
|
+
<free-field :Field="columnField(props.col, false)" :values="props.row" @input="cellChanged()" borderless
|
|
28
|
+
ref="fieldToValid"></free-field>
|
|
60
29
|
</span>
|
|
61
30
|
</q-td>
|
|
62
31
|
</template>
|
|
63
32
|
|
|
64
33
|
<template v-slot:bottom>
|
|
65
34
|
<q-tr class="summary-tr">
|
|
66
|
-
<q-td colspan="100%" class="text-right summary-row">{{summaryContent}}</q-td>
|
|
35
|
+
<q-td colspan="100%" class="text-right summary-row">{{ summaryContent }}</q-td>
|
|
67
36
|
</q-tr>
|
|
68
37
|
</template>
|
|
69
38
|
</q-table>
|
|
@@ -72,8 +41,8 @@
|
|
|
72
41
|
|
|
73
42
|
<script>
|
|
74
43
|
import { defineComponent, watchEffect, ref, computed } from 'vue';
|
|
75
|
-
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
76
|
-
import { useFormValidator} from '../../composible/useFormValidator';
|
|
44
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
|
|
45
|
+
import { useFormValidator} from '../../composible/useFormValidator.js';
|
|
77
46
|
|
|
78
47
|
export default defineComponent({
|
|
79
48
|
name: 'InputFieldFixedList',
|
|
@@ -235,7 +204,6 @@ export default defineComponent({
|
|
|
235
204
|
const showCell = (p) => {
|
|
236
205
|
const colNum = Number(p.col.name);
|
|
237
206
|
|
|
238
|
-
// eslint-disable-next-line no-restricted-globals
|
|
239
207
|
if (isNaN(colNum)) return true;
|
|
240
208
|
|
|
241
209
|
if (p.row.rowSize !== void 0) {
|
|
@@ -1,94 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="free-field-list row full-width">
|
|
3
|
-
<span
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
|
|
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>
|
|
3
|
+
<span :class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
4
|
+
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label !== void 0">
|
|
5
|
+
<q-tooltip v-if="Field.Description" anchor="top right">{{ Field.Description }}</q-tooltip>
|
|
6
|
+
{{ Field.Label || '' }}
|
|
7
|
+
<span v-if="Field.Required" class="required-mark">*</span>
|
|
17
8
|
</span>
|
|
18
9
|
|
|
19
|
-
<dynamic-list
|
|
20
|
-
class="col"
|
|
21
|
-
:Field="localField"
|
|
22
|
-
:values="values"
|
|
23
|
-
readonly
|
|
24
|
-
ref="fieldList"
|
|
25
|
-
selection="multiple"
|
|
26
|
-
>
|
|
10
|
+
<dynamic-list class="col" :Field="localField" :values="values" readonly ref="fieldList" selection="multiple">
|
|
27
11
|
<template v-slot:top>
|
|
28
12
|
<q-btn-group class="action-buttons">
|
|
29
|
-
<q-btn
|
|
30
|
-
icon="content_copy"
|
|
31
|
-
@click="copy"
|
|
32
|
-
>
|
|
13
|
+
<q-btn icon="content_copy" @click="copy">
|
|
33
14
|
<q-tooltip>拷贝选中</q-tooltip>
|
|
34
15
|
</q-btn>
|
|
35
|
-
<q-btn
|
|
36
|
-
icon="content_paste"
|
|
37
|
-
@click="paste"
|
|
38
|
-
>
|
|
16
|
+
<q-btn icon="content_paste" @click="paste">
|
|
39
17
|
<q-tooltip>粘贴</q-tooltip>
|
|
40
18
|
</q-btn>
|
|
41
|
-
<q-btn
|
|
42
|
-
icon="update"
|
|
43
|
-
@click="batch"
|
|
44
|
-
v-if="fieldListLength > 1"
|
|
45
|
-
>
|
|
19
|
+
<q-btn icon="update" @click="batch" v-if="fieldListLength > 1">
|
|
46
20
|
<q-tooltip>批量修改</q-tooltip>
|
|
47
21
|
</q-btn>
|
|
48
22
|
</q-btn-group>
|
|
49
23
|
</template>
|
|
50
24
|
<template v-slot:header-actions>
|
|
51
|
-
<q-btn
|
|
52
|
-
flat
|
|
53
|
-
round
|
|
54
|
-
icon="add"
|
|
55
|
-
@click="addField"
|
|
56
|
-
></q-btn>
|
|
25
|
+
<q-btn flat round icon="add" @click="addField"></q-btn>
|
|
57
26
|
</template>
|
|
58
27
|
<template v-slot:body-actions="props">
|
|
59
|
-
<q-btn
|
|
60
|
-
|
|
61
|
-
round
|
|
62
|
-
icon="edit"
|
|
63
|
-
@click="editField(props.row)"
|
|
64
|
-
></q-btn>
|
|
65
|
-
<q-btn
|
|
66
|
-
flat
|
|
67
|
-
round
|
|
68
|
-
icon="delete"
|
|
69
|
-
@click="deleteField(props)"
|
|
70
|
-
></q-btn>
|
|
28
|
+
<q-btn flat round icon="edit" @click="editField(props.row)"></q-btn>
|
|
29
|
+
<q-btn flat round icon="delete" @click="deleteField(props)"></q-btn>
|
|
71
30
|
</template>
|
|
72
31
|
<template v-slot:warning>
|
|
73
32
|
<slot name="warning"></slot>
|
|
74
33
|
</template>
|
|
75
34
|
</dynamic-list>
|
|
76
35
|
|
|
77
|
-
<free-field
|
|
78
|
-
:
|
|
79
|
-
:values="editingField"
|
|
80
|
-
@cancel="editorCancelled"
|
|
81
|
-
@save="saveField"
|
|
82
|
-
@input="editorInput"
|
|
83
|
-
@update:field="editingFieldChanged"
|
|
84
|
-
></free-field>
|
|
36
|
+
<free-field :Field="editingFieldField" :values="editingField" @cancel="editorCancelled" @save="saveField"
|
|
37
|
+
@input="editorInput" @update:field="editingFieldChanged"></free-field>
|
|
85
38
|
</div>
|
|
86
39
|
</template>
|
|
87
40
|
|
|
88
41
|
<script>
|
|
89
|
-
import { defineComponent, ref, unref, computed
|
|
90
|
-
import { useFreeField, freeFieldProps } from '../composible/useFreeField';
|
|
91
|
-
import DynamicList from './DynamicList';
|
|
42
|
+
import { defineComponent, ref, unref, computed } from 'vue';
|
|
43
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
|
|
44
|
+
import DynamicList from './DynamicList.js';
|
|
92
45
|
|
|
93
46
|
const clipBoardStore = {
|
|
94
47
|
content: '',
|
|
@@ -1,152 +1,89 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="row free-field-image" v-if="Field">
|
|
3
|
-
<span
|
|
4
|
-
:
|
|
5
|
-
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
|
|
6
|
-
v-if="Field.Label && !Field.dense">
|
|
3
|
+
<span :class="`field-label ${(Field.Label && Field.Label.trim().length)
|
|
4
|
+
? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label && !Field.dense">
|
|
7
5
|
<q-tooltip v-if="Field.Description" anchor="top right">
|
|
8
6
|
{{
|
|
9
|
-
|
|
7
|
+
Field.Description
|
|
10
8
|
}}
|
|
11
9
|
</q-tooltip>
|
|
12
10
|
{{ Field.Label || '' }}
|
|
13
11
|
<span v-if="Field.Required" class="required-mark">*</span>
|
|
14
12
|
</span>
|
|
15
|
-
<q-uploader
|
|
16
|
-
|
|
17
|
-
@removed="removeFile"
|
|
18
|
-
@rejected="filesRejected"
|
|
19
|
-
ref="uploader"
|
|
20
|
-
:factory="factoryFn"
|
|
21
|
-
auto-upload
|
|
22
|
-
:max-file-size="maxFileSize"
|
|
23
|
-
:class="(Field.dense ?
|
|
13
|
+
<q-uploader @uploaded="uploaded" @removed="removeFile" @rejected="filesRejected" ref="uploader" :factory="factoryFn"
|
|
14
|
+
auto-upload :max-file-size="maxFileSize" :class="(Field.dense ?
|
|
24
15
|
`no-shadow dense` : `${Field.onlyIcon ? 'only-icon' : ''}`)
|
|
25
|
-
|
|
26
|
-
>
|
|
16
|
+
+ (hasError ? ' free-field--error' : '')">
|
|
27
17
|
<template v-slot:list="scope">
|
|
28
18
|
<div class="uploader-btns row no-wrap items-center" v-if="!Field.dense && !(Field.onlyIcon || onlyIcon)">
|
|
29
19
|
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
|
30
|
-
<q-btn
|
|
31
|
-
|
|
32
|
-
type="a"
|
|
33
|
-
icon="cloud_upload"
|
|
34
|
-
dense
|
|
35
|
-
flat
|
|
36
|
-
class="upload-btn"
|
|
37
|
-
label="点击上传"
|
|
38
|
-
:disabled="Field.ReadOnly"
|
|
39
|
-
>
|
|
20
|
+
<q-btn v-if="!scope.isUploading" type="a" icon="cloud_upload" dense flat class="upload-btn" label="点击上传"
|
|
21
|
+
:disabled="Field.ReadOnly">
|
|
40
22
|
<q-uploader-add-trigger v-if="!Field.ReadOnly" />
|
|
41
23
|
</q-btn>
|
|
42
|
-
<q-btn
|
|
43
|
-
|
|
44
|
-
icon="clear"
|
|
45
|
-
@click="scope.abort"
|
|
46
|
-
round
|
|
47
|
-
class="clear-btn"
|
|
48
|
-
dense
|
|
49
|
-
flat
|
|
50
|
-
:disabled="Field.ReadOnly"
|
|
51
|
-
></q-btn>
|
|
24
|
+
<q-btn v-if="scope.isUploading" icon="clear" @click="scope.abort" round class="clear-btn" dense flat
|
|
25
|
+
:disabled="Field.ReadOnly"></q-btn>
|
|
52
26
|
<slot name="warning"></slot>
|
|
53
27
|
</div>
|
|
54
28
|
|
|
55
|
-
<q-btn
|
|
56
|
-
|
|
57
|
-
type="a"
|
|
58
|
-
:icon="fieldData?.value?.id ? 'check' : 'cloud_upload'"
|
|
59
|
-
dense
|
|
60
|
-
flat
|
|
61
|
-
:disabled="Field.ReadOnly"
|
|
62
|
-
>
|
|
29
|
+
<q-btn v-if="(Field.onlyIcon || onlyIcon) && (!fieldData.value || !fieldData.value || !fieldData.value.id)"
|
|
30
|
+
type="a" :icon="fieldData?.value?.id ? 'check' : 'cloud_upload'" dense flat :disabled="Field.ReadOnly">
|
|
63
31
|
<q-uploader-add-trigger />
|
|
64
32
|
</q-btn>
|
|
65
33
|
|
|
66
34
|
<div v-else-if="(Field.onlyIcon || onlyIcon) && fieldData.value && fieldData.value?.id">
|
|
67
|
-
<q-img
|
|
68
|
-
|
|
69
|
-
style="width:32px; max-height:32px;min-height:32px;"
|
|
70
|
-
>
|
|
35
|
+
<q-img :src="$filter(Field?.Options?.NoThumb ? 'serverImage' : 'serverThumb', `${fieldData.value.id}`)"
|
|
36
|
+
style="width:32px; max-height:32px;min-height:32px;">
|
|
71
37
|
</q-img>
|
|
72
|
-
<q-uploader-add-trigger/>
|
|
38
|
+
<q-uploader-add-trigger />
|
|
73
39
|
</div>
|
|
74
40
|
|
|
75
41
|
<q-item v-else-if="Field.dense" class="items-center q-pa-none">
|
|
76
42
|
<q-item-section v-if="fieldData.value.id" thumbnail>
|
|
77
|
-
<q-img
|
|
78
|
-
:src="`${ctx.config.thumbUrlBase}${fieldData.value.id}`"
|
|
79
|
-
style="width: 48px; max-height: 48px;"
|
|
80
|
-
>
|
|
43
|
+
<q-img :src="`${ctx.config.thumbUrlBase}${fieldData.value.id}`" style="width: 48px; max-height: 48px;">
|
|
81
44
|
</q-img>
|
|
82
45
|
<q-uploader-add-trigger v-if="!Field.ReadOnly" />
|
|
83
46
|
</q-item-section>
|
|
84
47
|
|
|
85
|
-
<q-item-section v-if="
|
|
48
|
+
<q-item-section v-if="fieldData.value.__img" thumbnail class="gt-xs">
|
|
86
49
|
<q-img :src="fieldData.value.__img.src">
|
|
87
50
|
</q-img>
|
|
88
51
|
<q-uploader-add-trigger v-if="!Field.ReadOnly" />
|
|
89
52
|
</q-item-section>
|
|
90
53
|
|
|
91
54
|
<q-item-section v-if="!fieldData.value?.id">
|
|
92
|
-
<q-btn
|
|
93
|
-
|
|
94
|
-
type="a"
|
|
95
|
-
icon="cloud_upload"
|
|
96
|
-
class="upload-btn"
|
|
97
|
-
dense
|
|
98
|
-
flat
|
|
99
|
-
:disabled="Field.ReadOnly"
|
|
100
|
-
>
|
|
55
|
+
<q-btn v-if="!scope.isUploading" type="a" icon="cloud_upload" class="upload-btn" dense flat
|
|
56
|
+
:disabled="Field.ReadOnly">
|
|
101
57
|
<q-uploader-add-trigger v-if="!Field.ReadOnly" />
|
|
102
58
|
</q-btn>
|
|
103
59
|
</q-item-section>
|
|
104
60
|
</q-item>
|
|
105
61
|
|
|
106
62
|
<div v-else-if="fieldData.value?.id" class="file-list row items-start justify-start">
|
|
107
|
-
<q-card
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
</div>
|
|
122
|
-
</e-icon>
|
|
123
|
-
<span class="file-name full-width ellipsis">
|
|
124
|
-
<a
|
|
125
|
-
v-if="fieldData.value && fieldData.value.id"
|
|
126
|
-
target="_blank"
|
|
127
|
-
:href="$filter('serverPath', fieldData.value.id)"
|
|
128
|
-
:download="fieldData.value.name">
|
|
129
|
-
{{ fieldData.value.name }}
|
|
130
|
-
</a>
|
|
131
|
-
<span v-else-if="fieldData.value && fieldData.value.name">
|
|
132
|
-
{{fieldData.value.name}}
|
|
133
|
-
</span>
|
|
134
|
-
<q-tooltip>{{ fieldData.value.name }}</q-tooltip>
|
|
63
|
+
<q-card flat class="file-list-item">
|
|
64
|
+
<e-icon class="file-image" :name="fileThumb(fieldData.value)" :thumb="!Field?.Options?.NoThumb"
|
|
65
|
+
:relative="filePreviewType(fieldData.value) !== 'image'" @click="preview(fieldData.value)">
|
|
66
|
+
<div class="view-btn-wrapper absolute-full justify-center text-center">
|
|
67
|
+
<q-btn flat class="view-btn full-height full-width" @click="preview(fieldData.value)">查看</q-btn>
|
|
68
|
+
</div>
|
|
69
|
+
</e-icon>
|
|
70
|
+
<span class="file-name full-width ellipsis">
|
|
71
|
+
<a v-if="fieldData.value && fieldData.value.id" target="_blank"
|
|
72
|
+
:href="$filter('serverPath', fieldData.value.id)" :download="fieldData.value.name">
|
|
73
|
+
{{ fieldData.value.name }}
|
|
74
|
+
</a>
|
|
75
|
+
<span v-else-if="fieldData.value && fieldData.value.name">
|
|
76
|
+
{{ fieldData.value.name }}
|
|
135
77
|
</span>
|
|
78
|
+
<q-tooltip>{{ fieldData.value.name }}</q-tooltip>
|
|
79
|
+
</span>
|
|
136
80
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
81
|
+
<span class="file-size full-width ellipsis">
|
|
82
|
+
Size: {{ fieldData.value.sizeLabel || fieldData.value.__sizeLabel }}
|
|
83
|
+
</span>
|
|
140
84
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
dense
|
|
144
|
-
round
|
|
145
|
-
class="delete-btn"
|
|
146
|
-
icon="close"
|
|
147
|
-
@click="scope.removeFile(fieldData.value)"
|
|
148
|
-
:disabled="Field.ReadOnly"
|
|
149
|
-
/>
|
|
85
|
+
<q-btn flat dense round class="delete-btn" icon="close" @click="scope.removeFile(fieldData.value)"
|
|
86
|
+
:disabled="Field.ReadOnly" />
|
|
150
87
|
</q-card>
|
|
151
88
|
</div>
|
|
152
89
|
|
|
@@ -155,32 +92,18 @@
|
|
|
155
92
|
</div>
|
|
156
93
|
</template>
|
|
157
94
|
</q-uploader>
|
|
158
|
-
<q-dialog class="image-preview-dialog"
|
|
159
|
-
flat
|
|
160
|
-
full-width full-height v-model="showPreview"
|
|
95
|
+
<q-dialog class="image-preview-dialog" flat full-width full-height v-model="showPreview"
|
|
161
96
|
style="background: rgba(0,0,0,0)">
|
|
162
97
|
<div class="image-preview">
|
|
163
|
-
<q-icon name="close"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
@click="showPreview=false"></q-icon>
|
|
168
|
-
<q-img
|
|
169
|
-
fit="contain"
|
|
170
|
-
v-if="previewType === 'image'"
|
|
171
|
-
:src="previewFile"
|
|
172
|
-
@click="showPreview=false"
|
|
98
|
+
<q-icon name="close" class="absolute cursor-pointer bg-white text-primary"
|
|
99
|
+
style="border-radius: 6px;border: 1px solid primary;right: 0;" round size="20px"
|
|
100
|
+
@click="showPreview = false"></q-icon>
|
|
101
|
+
<q-img fit="contain" v-if="previewType === 'image'" :src="previewFile" @click="showPreview = false"
|
|
173
102
|
style="max-height: 100%; max-width: 100%;">
|
|
174
103
|
</q-img>
|
|
175
104
|
|
|
176
|
-
<q-pdfviewer
|
|
177
|
-
|
|
178
|
-
v-model="showPreview"
|
|
179
|
-
@click="showPreview=false"
|
|
180
|
-
:src="previewFile"
|
|
181
|
-
type="pdfjs"
|
|
182
|
-
style="height: 100%; max-width: 100%;"
|
|
183
|
-
/>
|
|
105
|
+
<q-pdfviewer v-if="previewType === 'pdf'" v-model="showPreview" @click="showPreview = false" :src="previewFile"
|
|
106
|
+
type="pdfjs" style="height: 100%; max-width: 100%;" />
|
|
184
107
|
</div>
|
|
185
108
|
</q-dialog>
|
|
186
109
|
</div>
|
|
@@ -188,9 +111,9 @@
|
|
|
188
111
|
|
|
189
112
|
<script>
|
|
190
113
|
import { defineComponent, getCurrentInstance, ref } from 'vue';
|
|
191
|
-
import { useFreeField, freeFieldProps } from '
|
|
192
|
-
import { useFormValidator} from '
|
|
193
|
-
import { useUploader } from '
|
|
114
|
+
import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
|
|
115
|
+
import { useFormValidator} from '../../composible/useFormValidator.js';
|
|
116
|
+
import { useUploader } from '../composible/useUploader.js';
|
|
194
117
|
|
|
195
118
|
export default defineComponent({
|
|
196
119
|
name: 'InputFieldImage',
|
|
@@ -297,7 +220,6 @@ export default defineComponent({
|
|
|
297
220
|
if (res && res.msg === 'OK') {
|
|
298
221
|
setFieldData({
|
|
299
222
|
id: res.data.id,
|
|
300
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
301
223
|
sizeLabel: file.__sizeLabel,
|
|
302
224
|
name: file.name,
|
|
303
225
|
size: file.size,
|