free-fe-core-modules 0.1.21 → 0.1.23
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/free-field/Fields/AgreementCheck.js +2 -0
- package/free-field/Fields/File.vue +1 -1
- package/free-field/Fields/FileList.vue +1 -1
- package/free-field/Fields/Image.vue +1 -1
- package/free-field/Fields/ImageList.vue +1 -1
- package/free-field/composible/useUploader.js +10 -1
- package/package.json +1 -1
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<div v-else-if="!!fieldData.value?.id" class="file-list row items-start justify-start">
|
|
53
53
|
<q-card flat class="file-list-item">
|
|
54
|
-
<e-icon class="file-image" :name="fileThumb(fieldData.value)" thumb
|
|
54
|
+
<e-icon class="file-image" :name="fileThumb(fieldData.value, ctx)" thumb
|
|
55
55
|
:relative="filePreviewType(fieldData.value) !== 'image'" @click="preview(fieldData.value)">
|
|
56
56
|
<div class="view-btn-wrapper absolute-full justify-center text-center">
|
|
57
57
|
<q-btn flat class="view-btn full-height full-width">查看</q-btn>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<div v-if="Array.isArray(allFiles) && allFiles.length"
|
|
78
78
|
class="file-list file-list-card row items-start justify-start q-gutter-xl">
|
|
79
79
|
<q-card flat class="file-list-item" v-for="(file, index) in allFiles || []" :key="index">
|
|
80
|
-
<e-icon class="file-image" :name="fileThumb(file)" thumb :relative="filePreviewType(file) !== 'image'"
|
|
80
|
+
<e-icon class="file-image" :name="fileThumb(file, ctx)" thumb :relative="filePreviewType(file) !== 'image'"
|
|
81
81
|
@click="preview(file)">
|
|
82
82
|
<div class="view-btn-wrapper absolute-full justify-center text-center">
|
|
83
83
|
<q-btn flat class="view-btn full-height full-width">查看</q-btn>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
<div v-else-if="fieldData.value?.id" class="file-list row items-start justify-start">
|
|
63
63
|
<q-card flat class="file-list-item">
|
|
64
|
-
<e-icon class="file-image" :name="fileThumb(fieldData.value)" :thumb="!Field?.Options?.NoThumb"
|
|
64
|
+
<e-icon class="file-image" :name="fileThumb(fieldData.value, ctx)" :thumb="!Field?.Options?.NoThumb"
|
|
65
65
|
:relative="filePreviewType(fieldData.value) !== 'image'" @click="preview(fieldData.value)">
|
|
66
66
|
<div class="view-btn-wrapper absolute-full justify-center text-center">
|
|
67
67
|
<q-btn flat class="view-btn full-height full-width" @click="preview(fieldData.value)">查看</q-btn>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<div v-if="Array.isArray(allFiles) && allFiles.length"
|
|
28
28
|
class="file-list row items-start justify-start q-gutter-xl">
|
|
29
29
|
<q-card flat class="file-list-item" v-for="(file, index) in allFiles" :key="index">
|
|
30
|
-
<e-icon class="file-image" :name="fileThumb(file)" thumb :relative="filePreviewType(file) !== 'image'"
|
|
30
|
+
<e-icon class="file-image" :name="fileThumb(file, ctx)" thumb :relative="filePreviewType(file) !== 'image'"
|
|
31
31
|
@click="preview(file)">
|
|
32
32
|
<div class="view-btn-wrapper absolute-full justify-center text-center">
|
|
33
33
|
<q-btn flat class="view-btn full-height full-width" @click="preview(file)">查看</q-btn>
|
|
@@ -158,10 +158,19 @@ export function useUploader(props) {
|
|
|
158
158
|
return typeList.join(',');
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
const fileThumb = computed(() => (file) => {
|
|
161
|
+
const fileThumb = computed(() => (file, app) => {
|
|
162
162
|
const unknownType = 'insert_drive_file';
|
|
163
163
|
if (!file) return unknownType;
|
|
164
164
|
|
|
165
|
+
if (app?.config?.['core-modules']?.fileTypeIconMap) {
|
|
166
|
+
const { fType, fExt } = _getFileType(file);
|
|
167
|
+
const key = `${fType}.${fExt}`;
|
|
168
|
+
const icon = app.config['core-modules'].fileTypeIconMap[key];
|
|
169
|
+
if (icon) {
|
|
170
|
+
return icon;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
165
174
|
let type = '';
|
|
166
175
|
// const fTypes = file.type.split('/');
|
|
167
176
|
// const [fType, fExt] = fTypes;
|