|
|
@@ -66,6 +66,7 @@ import AssemblyDetailModal from './AssemblyDetailModal.vue';
|
|
|
import InterfaceDetailModal from './InterfaceDetailModal.vue';
|
|
|
import { getResViewInfo } from '/@/api/resource/plat';
|
|
|
import { listApproved } from '/@/api/dataAdmin/assembly';
|
|
|
+import { getFileUrl } from '/@/api/resource/files';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'VersionResModal',
|
|
|
@@ -247,9 +248,8 @@ export default defineComponent({
|
|
|
}
|
|
|
// 浏览资源
|
|
|
const handleFetchRes = (record) => {
|
|
|
- // 浏览资源
|
|
|
- const handleFetchRes = (record) => {
|
|
|
- if (currentResType.value === 'SR') {
|
|
|
+ // 组件
|
|
|
+ if (currentType.value === 'SR') {
|
|
|
listApproved('').then(res => {
|
|
|
res.forEach(async (item) => {
|
|
|
if (item.SERVICEID == record.SERVICEID) {
|
|
|
@@ -262,28 +262,54 @@ export default defineComponent({
|
|
|
// window.open(`./mapview.html?onlineIde_${res.servicebase.servicealiasname}`, '_blank')
|
|
|
// })
|
|
|
}
|
|
|
- else if (currentResType.value === 'interface') {
|
|
|
-
|
|
|
+ // 地图
|
|
|
+ else if (currentType.value === 'MR') {
|
|
|
+ window.open(
|
|
|
+ `http://192.168.119.143:8080/onemapV5.0/mapview.html?${record.SERVICEID}`,
|
|
|
+ 'target',
|
|
|
+ ''
|
|
|
+ );
|
|
|
}
|
|
|
- else {
|
|
|
+ // 文件
|
|
|
+ else if (currentType.value === 'DR') {
|
|
|
getResViewInfo(record.SERVICEID).then(res => {
|
|
|
- console.log(res);
|
|
|
- window.open(`./mapview.html?${res.servicebase.serviceid}`, '_blank')
|
|
|
+ console.log(res)
|
|
|
+ const obj = {
|
|
|
+ id: res.servicebase.fileid,
|
|
|
+ userid: res.metadata.userid,
|
|
|
+ parentId: session.getItem('sysFild').dirId,
|
|
|
+ };
|
|
|
+ handleUpload(obj)
|
|
|
})
|
|
|
}
|
|
|
+ // 场景
|
|
|
+ else {
|
|
|
+ window.open(
|
|
|
+ `http://192.168.119.143:8080/onemapV5.0/sceneview.html?${record.SERVICEID}`,
|
|
|
+ 'target',
|
|
|
+ ''
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
+ async function handleUpload(obj) {
|
|
|
+ const res = await getFileUrl(obj);
|
|
|
+ if (res) {
|
|
|
+ const fileName = res.fileName;
|
|
|
+ const url = res.url;
|
|
|
+ window.open(url);
|
|
|
+ }
|
|
|
}
|
|
|
// 查看资源
|
|
|
const handleLookRes = (record) => {
|
|
|
console.log(record)
|
|
|
console.log(currentType.value)
|
|
|
resId.value = record.SERVICEID || record.SERVERID
|
|
|
- if (currentResType.value === 'SR') {
|
|
|
+ if (currentType.value === 'SR') {
|
|
|
openAssemblyDetailModal(true,{
|
|
|
resId: resId.value
|
|
|
})
|
|
|
}
|
|
|
- else if (currentResType.value === 'interface') {
|
|
|
+ else if (currentType.value === 'interface') {
|
|
|
openInterfaceModal(true,{
|
|
|
resId: resId.value
|
|
|
})
|