|
|
@@ -26,8 +26,8 @@
|
|
|
{{ file.name }}
|
|
|
</template>
|
|
|
|
|
|
- <ViewerPDFFromFile v-if="doc_type === 'pdf'" :file="file" :doc_width="DOC_WIDTH" :positions="positions" />
|
|
|
- <ViewerDocxFromFile v-if="doc_type === 'doc'" :file="file" :doc_width="DOC_WIDTH" :positions="positions" />
|
|
|
+ <ViewerPDFFromFile v-if="doc_type === 'pdf'" :file="file" :doc_width="DOC_WIDTH" />
|
|
|
+ <ViewerDocxFromFile v-if="doc_type === 'doc'" :file="file" :doc_width="DOC_WIDTH" />
|
|
|
</a-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -41,6 +41,8 @@ import FileItemRemoveBtn from './FileItemRemoveBtn.vue';
|
|
|
import ViewerPDFFromFile from '../viewer-pdf/ViewerPDFFromFile.vue';
|
|
|
import ViewerDocxFromFile from '../viewer-docx/ViewerDocxFromFile.vue';
|
|
|
|
|
|
+import { getFileSuffix } from '../../utils/file-utils';
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
file: Object,
|
|
|
enable_remove: Boolean
|
|
|
@@ -59,9 +61,11 @@ const doc_type = computed(() => {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
- const arr = doc_name.split('.');
|
|
|
- const len = arr.length;
|
|
|
- const end_fix = arr[len - 1];
|
|
|
+ // const arr = doc_name.split('.');
|
|
|
+ // const len = arr.length;
|
|
|
+ // const end_fix = arr[len - 1];
|
|
|
+
|
|
|
+ const end_fix = getFileSuffix(doc_name);
|
|
|
|
|
|
if (end_fix === 'pdf') {
|
|
|
return 'pdf';
|
|
|
@@ -103,8 +107,10 @@ const file_end_fix = computed(() => {
|
|
|
|
|
|
const file_name = file.name || '';
|
|
|
|
|
|
- const name_info_arr = file_name.split('.');
|
|
|
- const end_fix = name_info_arr[name_info_arr.length - 1];
|
|
|
+ // const name_info_arr = file_name.split('.');
|
|
|
+ // const end_fix = name_info_arr[name_info_arr.length - 1];
|
|
|
+
|
|
|
+ const end_fix = getFileSuffix(file_name);
|
|
|
|
|
|
return end_fix;
|
|
|
});
|
|
|
@@ -113,8 +119,6 @@ const file_end_fix = computed(() => {
|
|
|
* 移除
|
|
|
*/
|
|
|
const handleRemove = () => {
|
|
|
- console.log('移除文件');
|
|
|
-
|
|
|
emit('delete');
|
|
|
};
|
|
|
|