|
@@ -1,85 +0,0 @@
|
|
|
-<template>
|
|
|
- <BasicModal
|
|
|
- v-bind="$attrs"
|
|
|
- @register="registerModal"
|
|
|
- title="文档管理"
|
|
|
- width="900px"
|
|
|
- :defaultFullscreen="true"
|
|
|
- :showCancelBtn="false"
|
|
|
- :showOkBtn="false"
|
|
|
- :footer="null"
|
|
|
- destroyOnClose
|
|
|
- >
|
|
|
- <iframe id="kk_file_viewer" class="w-100% h-100%" :src="src"></iframe>
|
|
|
- </BasicModal>
|
|
|
-</template>
|
|
|
-<script lang="ts" setup>
|
|
|
- import { unref, reactive, computed, ref } from 'vue';
|
|
|
- import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
|
- import { onMounted } from 'vue';
|
|
|
- import { CADViewer, useCADViewer } from '/@/components/CADViewer';
|
|
|
- import { useUserStore } from '/@/store/modules/user';
|
|
|
- import { defHttp } from '/@/utils/http/axios';
|
|
|
-
|
|
|
- let props = defineProps({
|
|
|
- fileType: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
- editID: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- const src = ref('');
|
|
|
-
|
|
|
- //表单赋值
|
|
|
- const [registerModal, { setModalProps }] = useModalInner(async ({ record, getBlob }) => {
|
|
|
- //重置表单
|
|
|
- setModalProps({ confirmLoading: false });
|
|
|
- console.log('debug', record);
|
|
|
- const baseUrl = import.meta.env.PROD ? window.location.origin : import.meta.env.VITE_GLOB_DOMAIN_URL;
|
|
|
- const url = `${baseUrl}/ventanaly-sharefile/fileServer/downloadById?id=${record.id}&fullfilename=test.dwg`;
|
|
|
- // const url = URL.createObjectURL(new File([res], 'test.dwg')) + '&fullfilename=test.dwg';
|
|
|
- // const url = URL.createObjectURL(res) + '&fullfilename=test.dwg';
|
|
|
- console.log('debug getBlob: url is ', url);
|
|
|
- window.open('http://182.92.126.35:8012/onlinePreview?url=' + encodeURIComponent(window.btoa(url)));
|
|
|
- return;
|
|
|
- getBlob().then((res: Blob) => {
|
|
|
- console.log('debug getBlob: blob is ', res);
|
|
|
- // CAD 预览器的 DEMO 01 @link https://kkfileview.keking.cn/zh-cn/docs/usage.html
|
|
|
- // const url = 'http://localhost:3100/modelreq/ventanaly-sharefile/fileServer/download&fullfilename=test.dwg';
|
|
|
- const baseUrl = import.meta.env.PROD ? window.location.origin : import.meta.env.VITE_GLOB_DOMAIN_URL;
|
|
|
- defHttp.get({
|
|
|
- url: `${baseUrl}/ventanaly-sharefile/fileServer/downloadById?id=${record.id}`,
|
|
|
- });
|
|
|
- const url = `${baseUrl}/ventanaly-sharefile/fileServer/downloadById?id=${record.id}&fullfilename=test.dwg`;
|
|
|
- // const url = URL.createObjectURL(new File([res], 'test.dwg')) + '&fullfilename=test.dwg';
|
|
|
- // const url = URL.createObjectURL(res) + '&fullfilename=test.dwg';
|
|
|
- console.log('debug getBlob: url is ', url);
|
|
|
- window.open('http://182.92.126.35:8012/onlinePreview?url=' + encodeURIComponent(window.btoa(url)));
|
|
|
- // baseFileUrl.value = ;
|
|
|
-
|
|
|
- // CAD 预览器的 DEMO 02
|
|
|
- // processFile(new File([res], 'test.dwg')).then((path) => {
|
|
|
- // console.log('debug processFile', path);
|
|
|
- // postMessage('MKY_Open_Mxweb', path);
|
|
|
- // });
|
|
|
- });
|
|
|
- // Object.assign(record, data.record);
|
|
|
- });
|
|
|
-
|
|
|
- onMounted(() => {
|
|
|
- console.log('debug mounted');
|
|
|
- });
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped lang="less">
|
|
|
- ::v-deep .suffix {
|
|
|
- height: 32px;
|
|
|
- line-height: 32px;
|
|
|
- margin-left: 5px;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
-</style>
|