0393487f by xukangle

fix

1 parent 289bbea2
......@@ -370,11 +370,28 @@ const downloadTemplate = async (url) => {
refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
return;
}
// obsDownloadRequest(refSignInfo?.data).then((res: any) => {
// if (res && !res.msg) {
// let urlNames = url.split('/');
// let name = urlNames.at(-1);
// var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
// download(res, name, fileSuffix);
// } else {
// res?.msg && ElMessage.error(res?.msg);
// }
// });
obsDownloadRequest(refSignInfo?.data).then((res: any) => {
if (res && !res.msg) {
let urlNames = url.split('/');
let name = urlNames.at(-1);
// 移除查询参数
if (name.includes('?')) {
name = name.split('?')[0];
}
// 解码文件名
name = decodeURIComponent(name);
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
console.log(name, res, fileSuffix, '-------------------name');
download(res, name, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
......
......@@ -70,7 +70,7 @@ const getDetailInfo = () => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
detailInfo.value = data;
// detailInfo.value.damTypeName = damTypes.find(d => d.value == detailInfo.value.damType)?.label;
// detailInfo.value.damTypeName = damTypes.find(d => d.value == detailInfo.value.damType)?.label;
detailInfo.value.dataSourcesName = dataSourcesList.find(d => d.value == detailInfo.value.dataSources)?.label;
baseInfoFormItems.value.forEach(item => {
item.default = detailInfo.value[item.field]
......@@ -171,7 +171,7 @@ const handleTableViewData = (scope) => {
<div class="title1">{{ detailInfo.damName ?? '--' }}</div>
<div class="dataLabel">{{ detailInfo.damTypeName }}</div>
<div class="dataLabel">{{ detailInfo.subjectDomainName || detailInfo.subjectDomain }}</div>
<div class="dataLabel dataLabel1">{{ detailInfo.databaseType }}</div>
<div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div>
<div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div>
</div>
</div>
......@@ -179,7 +179,8 @@ const handleTableViewData = (scope) => {
:style="{ 'margin-right': (isTruncated && !isExpanded) ? '30px' : '0px', WebkitLineClamp: (!isTruncated ? 'inherit' : (isExpanded ? 'inherit' : 1)), WebkitBoxOrient: 'vertical' }">
{{ '覆盖地域:' + (detailInfo.coverageArea?.[0]?.[0] == 'all' ? '全国' : (detailInfo.coverageAreaName?.map(c =>
c.join('/')).join(',') ?? '--')) }}<span v-if="isTruncated" class="text_btn expand_btn"
:style="{ position: isExpanded ? 'inherit' : 'absolute', 'margin-left': isExpanded ? '4px' : '0px' }" @click="handleExpand()" v-preReClick>{{
:style="{ position: isExpanded ? 'inherit' : 'absolute', 'margin-left': isExpanded ? '4px' : '0px' }"
@click="handleExpand()" v-preReClick>{{
isExpanded
?
'收起' : '展开' }}</span></div>
......@@ -374,4 +375,4 @@ const handleTableViewData = (scope) => {
padding-right: 8px;
}
}
</style>
\ No newline at end of file
</style>
......
......@@ -190,7 +190,7 @@ const getTableData = () => {
pageIndex: pageInfo.value.curr,
damName: pageInfo.value.damName,
damType: pageInfo.value.damType,
subjectDomain: pageInfo.value.subjectDomain,
subjectDomain: pageInfo.value.subjectDomain || [],
tenantGuid: pageInfo.value.tenantGuid,
dataSources: pageInfo.value.dataSources,
isRegister: pageInfo.value.isRegister,
......
......@@ -30,7 +30,7 @@ import {
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
import useDataAssetStore from "@/store/modules/dataAsset";
import { changeNum, getDownloadUrl, download } from '@/utils/common';
import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common';
const assetStore = useDataAssetStore();
......@@ -410,43 +410,43 @@ const getTenantDetail = () => {
});
}
const onUploadFilePreview = (file) => {
let url = file.url;
getImageContent(url).then((res: any) => {
if (res && !res.msg) {
let name = file.name;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1).toLowerCase() : '';
if (fileSuffix === 'png' || fileSuffix === 'jpeg' || fileSuffix === 'jpg' || fileSuffix === 'pdf') { //浏览器可以支持图片和pdf预览
let fileUrl = <string>getDownloadUrl(res, name, fileSuffix);
let win = window.open(fileUrl, name);
win && (win.document.title = name);
} else {
download(res, name, fileSuffix);
}
// if (fileSuffix === 'png' || fileSuffix === 'jpeg' || fileSuffix === 'jpg' || fileSuffix === 'pdf' || fileSuffix === 'zip' || fileSuffix === 'rar') {
// let win = window.open(fileUrl, name);
// win && (win.document.title = name);
// return win;
// }
// window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(fileUrl));
} else {
res?.msg && ElMessage.error(res?.msg);
}
})
}
const onUploadFileDownload = (file) => {
let url = file.url;
getImageContent(url).then((res: any) => {
if (res && !res.msg) {
let name = file.name;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
download(res, name, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
}
})
}
// const onUploadFilePreview = (file) => {
// let url = file.url;
// getImageContent(url).then((res: any) => {
// if (res && !res.msg) {
// let name = file.name;
// var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1).toLowerCase() : '';
// if (fileSuffix === 'png' || fileSuffix === 'jpeg' || fileSuffix === 'jpg' || fileSuffix === 'pdf') { //浏览器可以支持图片和pdf预览
// let fileUrl = <string>getDownloadUrl(res, name, fileSuffix);
// let win = window.open(fileUrl, name);
// win && (win.document.title = name);
// } else {
// download(res, name, fileSuffix);
// }
// // if (fileSuffix === 'png' || fileSuffix === 'jpeg' || fileSuffix === 'jpg' || fileSuffix === 'pdf' || fileSuffix === 'zip' || fileSuffix === 'rar') {
// // let win = window.open(fileUrl, name);
// // win && (win.document.title = name);
// // return win;
// // }
// // window.open('https://view.officeapps.live.com/op/view.aspx?src=' + encodeURIComponent(fileUrl));
// } else {
// res?.msg && ElMessage.error(res?.msg);
// }
// })
// }
// const onUploadFileDownload = (file) => {
// let url = file.url;
// getImageContent(url).then((res: any) => {
// if (res && !res.msg) {
// let name = file.name;
// var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
// download(res, name, fileSuffix);
// } else {
// res?.msg && ElMessage.error(res?.msg);
// }
// })
// }
const toolBtns: any = computed(() => {
let btnsArr: any = [{
......@@ -1321,7 +1321,7 @@ const handleClickDamCatalogDetail = () => {
</div>
</span>
</div>
<div class="list_item is_block isFile" :style="{ width: '40%' }"
<!-- <div class="list_item is_block isFile" :style="{ width: '40%' }"
v-if="(detailType != 'asset' || assetDetailInfo.isEvaluationAssessment == 'Y') && assetDetailInfo.registerAttachment?.qualityEvaluationFile?.length">
<span class="item_label" :style="{ width: 'auto', 'text-align': 'left' }">数据质量评价收集</span>
<span v-for="(item) in (assetDetailInfo.registerAttachment?.qualityEvaluationFile || [])"
......@@ -1358,11 +1358,11 @@ const handleClickDamCatalogDetail = () => {
<div :style="{ right: '0px' }" class="file-preview" @click="onUploadFileDownload(item)">下载</div>
</div>
</span>
</div>
</div> -->
<div class="list_item is_block isFile" :style="{ width: '40%', 'margin-right': '28px' }"
v-if="(detailType != 'asset' && detailType != 'qualityEvaluate' || assetDetailInfo.isEvaluationAssessment == 'Y') && assetDetailInfo.registerAttachment?.costAssessmentFile?.length">
v-if="assetDetailInfo.registerAttachment?.assessmentFile?.length">
<span class="item_label" :style="{ width: 'auto', 'text-align': 'left' }">数据价值评估</span>
<span v-for="(item) in (assetDetailInfo.registerAttachment?.costAssessmentFile || [])" class="item_value"
<span v-for="(item) in (assetDetailInfo.registerAttachment?.assessmentFile || [])" class="item_value"
:style="{ 'padding-left': '0px' }">
<div class="file-operate">
<template
......@@ -1397,11 +1397,11 @@ const handleClickDamCatalogDetail = () => {
</div>
</span>
</div>
<div class="list_item is_block isFile" :style="{ width: '40%' }"
v-if="(detailType == 'asset' && assetDetailInfo.isQualityAssessment == 'Y') && assetDetailInfo.registerAttachment?.qualityEvaluationFile?.length">
<div class="list_item is_block isFile" :style="{ width: '40%', 'margin-right': '28px' }"
v-if="assetDetailInfo.registerAttachment?.evaluationFile?.length">
<span class="item_label" :style="{ width: 'auto', 'text-align': 'left' }">质量评估报告</span>
<span v-for="(item) in (assetDetailInfo.registerAttachment?.qualityEvaluationFile || [])"
class="item_value" :style="{ 'padding-left': '0px' }">
<span v-for="(item) in (assetDetailInfo.registerAttachment?.evaluationFile || [])" class="item_value"
:style="{ 'padding-left': '0px' }">
<div class="file-operate">
<template
v-if="item.name.substring(item.name.lastIndexOf('.') + 1) == 'xls' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'xlsx' || item.name.substring(item.name.lastIndexOf('.') + 1) == 'csv'">
......
......@@ -458,7 +458,7 @@ const formInfo = ref<any>({
type: 'upload-file',
placeholder: '请选择',
field: 'commitmentLetterInfo',
templateUrl: 'http://www.baidu.com',
templateUrl: '',
default: [],
limit: 1,
block: true,
......@@ -472,7 +472,7 @@ const formInfo = ref<any>({
type: 'upload-file',
placeholder: '请选择',
field: 'accreditFileInfo',
templateUrl: 'http://www.baidu.com',
templateUrl: '',
default: [],
limit: 1,
block: true,
......@@ -486,7 +486,7 @@ const formInfo = ref<any>({
type: 'upload-file',
placeholder: '请选择',
field: 'productDetailInfo',
templateUrl: 'http://www.baidu.com',
templateUrl: '',
default: [],
limit: 1,
block: true,
......@@ -1427,10 +1427,19 @@ onBeforeMount(() => {
// 获取模板信息
const getTemplateInfo = () => {
console.log(userData, '--------route.query.exchangeGuid---------');
getTemplateFile({ tenantGuid: userData.tenantGuid }).then((res: any) => {
getTemplateFile({ tenantGuid: route.query.exchangeGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
formInfo.value.items.forEach(item => {
if (item.field == 'commitmentLetterInfo') {
item.templateUrl = res.data.commitment_letter || '';
}
if (item.field == 'accreditFileInfo') {
item.templateUrl = res.data.authorization_file || '';
}
if (item.field == 'productDetailInfo') {
item.templateUrl = res.data.detail_file || '';
}
})
} else {
ElMessage({
type: "error",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!