Merge remote-tracking branch 'origin/main' into main

main
zhangxiaodi1 9 months ago
commit 03af7e5875

@ -3,6 +3,7 @@ import mammoth from 'mammoth';
import "@vue-office/docx/lib/index.css";
import { reactive,ref } from "vue";
import { useRoute } from 'vue-router';
import {queryFileFlowRepTemplateApi} from '@/api/reporting/RepTemplate/RepTemplate';
const route = useRoute();
// 线
//
@ -13,10 +14,9 @@ let htmlContent = ref("");
const fetchDocFile = async ()=>{
try {
// APIDOC
// const response = await axios.get('/api/get-doc-file', {
// responseType: 'blob' // blob
// });
const arrayBuffer = new Blob(fileData).arrayBuffer();
const response = await queryFileFlowRepTemplateApi(fileData);
console.log(response,"response文件流信息");
const arrayBuffer = response.data.arrayBuffer();
// 使FileReader
// const reader = new FileReader();
// reader.onload = function(event) {

@ -23,7 +23,9 @@ import { useValidator } from '@/hooks/web/useValidator'
import { getOrganTree } from '@/api/common'
import { getLoginOrganCodeByUserInfo } from '@/utils/auth'
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate'
import { useRouter } from 'vue-router';
const router = useRouter()
const { t } = useI18n();
const { required } = useValidator();
//
@ -87,7 +89,7 @@ const tableColumns = reactive<TableColumn[]>([
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'detail')}>
{'生成'}
</ElLink>
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'detail')}>
<ElLink type="primary" underline={false} onClick={() => ShowPreViewFile(data.row)}>
{'预览'}
</ElLink>
</>
@ -192,6 +194,23 @@ const action = async (row: TableData, type: string) => {
dialogVisible.value = true
}
}
/** 预览 **/
const ShowPreViewFile = (data)=>{
console.log(data);
router.push({
name:'PreViewFile',
query:{
fileData:data.tId,
}
})
// const routeData = router.resolve({
// name:'PreViewFile',
// query:{
// fileData:JSON.stringify(data),
// }
// })
// window.open(routeData.href,'_blank')
}
const AddAction = () => {
dialogTitle.value = t('tableDemo.add')

Loading…
Cancel
Save