|
|
@@ -1,175 +1,300 @@ |
|
|
|
<template> |
|
|
|
<div class="watch-all-page"> |
|
|
|
<app-header backBtnTitle="我的项目" theme="basis" |
|
|
|
:title="joinProjName" :showUserCenter="false" :showBackBtn="true" |
|
|
|
:onBackBtnClick="backToIndex"/> |
|
|
|
<ChangeModelBtn ref="topModelBtn" :titleList="titleList" |
|
|
|
v-show="!isShowLeftPage" class="top-change-model-btn" |
|
|
|
@changeModelBtnClick="changeModelBtnClick"/> |
|
|
|
<app-header |
|
|
|
backBtnTitle="我的项目" |
|
|
|
theme="basis" |
|
|
|
:title="joinProjName" |
|
|
|
:showUserCenter="false" |
|
|
|
:showBackBtn="true" |
|
|
|
:onBackBtnClick="backToIndex" |
|
|
|
/> |
|
|
|
<ChangeModelBtn |
|
|
|
ref="topModelBtn" |
|
|
|
:titleList="titleList" |
|
|
|
v-show="!isShowLeftPage" |
|
|
|
class="top-change-model-btn" |
|
|
|
@changeModelBtnClick="changeModelBtnClick" |
|
|
|
/> |
|
|
|
<div class="main-content"> |
|
|
|
<div class="control-btn" @click.stop="changeShowLeftPageClick" :style="{left: btnLeft }"><img src="static/img/收起与弹出.svg" alt :style="iconRotateStyle"/></div> |
|
|
|
<div class="left-page" v-show="isShowLeftPage"> |
|
|
|
<ChangeModelBtn ref="leftModelBtn" :titleList="titleList" |
|
|
|
@changeModelBtnClick="changeModelBtnClick" |
|
|
|
class="left-change-model-btn"/> |
|
|
|
<div v-for="(textNote, ti) in textData" :key="ti + '1'"> |
|
|
|
<div |
|
|
|
class="control-btn" |
|
|
|
@click.stop="changeShowLeftPageClick" |
|
|
|
:style="{left: btnLeft }" |
|
|
|
><img |
|
|
|
src="static/img/收起与弹出.svg" |
|
|
|
alt |
|
|
|
:style="iconRotateStyle" |
|
|
|
/></div> |
|
|
|
<div |
|
|
|
class="left-page" |
|
|
|
v-show="isShowLeftPage" |
|
|
|
> |
|
|
|
<ChangeModelBtn |
|
|
|
ref="leftModelBtn" |
|
|
|
:titleList="titleList" |
|
|
|
@changeModelBtnClick="changeModelBtnClick" |
|
|
|
class="left-change-model-btn" |
|
|
|
/> |
|
|
|
<!-- <div v-for="(textNote, ti) in textData" :key="ti + '1'"> |
|
|
|
<TextItem :textItem="textNote"/> |
|
|
|
</div> |
|
|
|
<div v-for="(progressNote, pi) in progressData" :key="pi + '2'"> |
|
|
|
</div> --> |
|
|
|
<Introduce |
|
|
|
:content="config.projectIntroduce" |
|
|
|
:style="{ height: `${896 - 58}px` }" |
|
|
|
@updateIntroduce="updateIntroduce" |
|
|
|
/> |
|
|
|
<!-- <div v-for="(progressNote, pi) in progressData" :key="pi + '2'"> |
|
|
|
<ProgressItem :progressItem="progressNote"/> |
|
|
|
</div> |
|
|
|
<div v-for="(graphNote, gi) in graphData" :key="gi + '3'"> |
|
|
|
</div> --> |
|
|
|
<!-- <div v-for="(graphNote, gi) in graphData" :key="gi + '3'"> |
|
|
|
<GraphItem :graphItem="graphNote"/> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
<div class="right-show-area"> |
|
|
|
<iframe :src="rightPartUrl" frameborder="0"></iframe> |
|
|
|
</div> |
|
|
|
<el-carousel ref="watchCarousel" class="watch-carousel" height="100%" :autoplay="false" indicator-position="none" arrow="never"> |
|
|
|
<el-carousel-item key="forge"> |
|
|
|
<iframe v-if="config.forgeUrl" :key="config.forgeUrl" :src="config.forgeUrl" frameborder="0" /> |
|
|
|
</el-carousel-item> |
|
|
|
<el-carousel-item key="supermap"> |
|
|
|
<iframe v-if="config.gsUrl" :key="config.gsUrl" :src="config.gsUrl" frameborder="0" /> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
|
|
|
|
<!-- <iframe :src="rightPartUrl" frameborder="0"></iframe> --> |
|
|
|
<el-popover |
|
|
|
placement="top-start" |
|
|
|
:width="400" |
|
|
|
:offset="500" |
|
|
|
ref="urlModal" |
|
|
|
trigger="click"> |
|
|
|
<el-form :model="urlForm"> |
|
|
|
<el-form-item label="forgeURL"> |
|
|
|
<el-input v-model="urlForm.forgeUrl" placeholder="http://" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="超图URL"> |
|
|
|
<el-input v-model="urlForm.gsUrl" placeholder="http://" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click.stop="onChangeUrl">修改</el-button> |
|
|
|
<el-button @click.stop="resetUrl">取消</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-button slot="reference" class="popover-btn" type="primary" size="mini">设置URL</el-button> |
|
|
|
</el-popover> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import AppHeader from "@/components/app-header"; |
|
|
|
import ChangeModelBtn from './components/ChangeModelBtn'; |
|
|
|
import TextItem from "./components/TextItem"; |
|
|
|
import ProgressItem from "./components/ProgressItem"; |
|
|
|
import GraphItem from "./components/GraphItem"; |
|
|
|
import { getDetailTextData, getProgressData, getGraphData, getGraphData2 } from "./service"; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
AppHeader, |
|
|
|
ChangeModelBtn, |
|
|
|
TextItem, |
|
|
|
ProgressItem, |
|
|
|
GraphItem |
|
|
|
}, |
|
|
|
data() { |
|
|
|
import AppHeader from "@/components/app-header"; |
|
|
|
import ChangeModelBtn from "./components/ChangeModelBtn"; |
|
|
|
import TextItem from "./components/TextItem"; |
|
|
|
import { pick } from 'lodash'; |
|
|
|
// import ProgressItem from "./components/ProgressItem"; |
|
|
|
// import GraphItem from "./components/GraphItem"; |
|
|
|
import { |
|
|
|
getDetailTextData, |
|
|
|
getProgressData, |
|
|
|
getGraphData, |
|
|
|
getGraphData2, |
|
|
|
} from "./service"; |
|
|
|
import Introduce from "./components/Introduce.vue"; |
|
|
|
import { firstCharToLowerCase, firstCharToUpperCase } from '@/utils/tool'; |
|
|
|
import { wrapErrorHint } from '@/utils/request'; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
AppHeader, |
|
|
|
ChangeModelBtn, |
|
|
|
// TextItem, |
|
|
|
Introduce, |
|
|
|
// ProgressItem, |
|
|
|
// GraphItem |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
projectId: sessionStorage.projId, |
|
|
|
titleList: ["forge模型", "超图"], |
|
|
|
joinProjName: `观全局-${sessionStorage.projName}`, |
|
|
|
textData: [], |
|
|
|
progressData: [], |
|
|
|
graphData: [], |
|
|
|
isShowLeftPage: true, //是否显示左边部分的信息 |
|
|
|
btnLeft: 24, //控制按钮的位置 |
|
|
|
iconRotateDeg: 90, |
|
|
|
// rightPartUrl: "", |
|
|
|
// superMapUrl: "http://www.lockingos.org:9001/?scene=http://cim.azut.cn:8090/iserver/services/3D-FuHuaYuan/rest/realspace", |
|
|
|
// forgeModelUrl: "http://www.lockingos.org:9000/fhy-model/fhy/index.html", |
|
|
|
// temp: ["341999987607363584", "341984912360235008", "342002217261621248"], |
|
|
|
// 概览配置 |
|
|
|
config: {}, |
|
|
|
urlForm: { |
|
|
|
gsUrl: '', |
|
|
|
forgeUrl: '', |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getWatchAllGeneralData(); |
|
|
|
this.rightPartUrl = this.temp.includes(sessionStorage.projId) |
|
|
|
? "http://www.lockingos.org:9000/fhy-model/forgemd2020120603/index.html" |
|
|
|
: "http://www.lockingos.org:9000/fhy-model/fhy/index.html"; |
|
|
|
this.forgeModelUrl = this.temp.includes(sessionStorage.projId) |
|
|
|
? "http://www.lockingos.org:9000/fhy-model/forgemd2020120603/index.html" |
|
|
|
: "http://www.lockingos.org:9000/fhy-model/fhy/index.html"; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
iconRotateStyle() { |
|
|
|
return { |
|
|
|
titleList: ['forge模型', '超图'], |
|
|
|
joinProjName:`观全局-${sessionStorage.projName}`, |
|
|
|
textData: [], |
|
|
|
progressData: [], |
|
|
|
graphData: [], |
|
|
|
isShowLeftPage: true,//是否显示左边部分的信息 |
|
|
|
btnLeft: 24,//控制按钮的位置 |
|
|
|
iconRotateDeg: 90, |
|
|
|
rightPartUrl: '', |
|
|
|
superMapUrl: 'http://www.lockingos.org:9001/?scene=http://cim.azut.cn:8090/iserver/services/3D-FuHuaYuan/rest/realspace', |
|
|
|
forgeModelUrl: 'http://www.lockingos.org:9000/fhy-model/fhy/index.html', |
|
|
|
temp:['341999987607363584','341984912360235008','342002217261621248'], |
|
|
|
transform: `rotate(${this.iconRotateDeg}deg)`, |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async getWatchAllGeneralData() { |
|
|
|
const [configRes, res1, res2, res3, res4] = await Promise.all([ |
|
|
|
this.$fetchApi('project/queryProjectGobalConfig', { id: this.projectId }), |
|
|
|
getDetailTextData(), |
|
|
|
getProgressData(), |
|
|
|
getGraphData(), |
|
|
|
getGraphData2(), |
|
|
|
]); |
|
|
|
|
|
|
|
this.config = firstCharToLowerCase(configRes.Data || { id: this.projectId }); |
|
|
|
this.urlForm = pick(this.config, ['gsUrl', 'forgeUrl']); |
|
|
|
this.textData = [{ ...res1 }]; |
|
|
|
this.progressData = [{ ...res2 }]; |
|
|
|
this.graphData = [{ ...res3 }]; |
|
|
|
this.graphData.push(res4); |
|
|
|
this.graphData = [...this.graphData]; |
|
|
|
}, |
|
|
|
async updateIntroduce(introStr, callback) { |
|
|
|
const res = await this.updateConfig({ projectIntroduce: introStr }); |
|
|
|
callback(res); |
|
|
|
}, |
|
|
|
async updateConfig(partialConfig) { |
|
|
|
const nextCfg = {...this.config, ...partialConfig }; |
|
|
|
const res = await this.$fetchApi('project/addProjectGobalConfig', firstCharToUpperCase(nextCfg)); |
|
|
|
if(!res.Code) { |
|
|
|
this.config = nextCfg; |
|
|
|
} |
|
|
|
return res; |
|
|
|
}, |
|
|
|
async onChangeUrl() { |
|
|
|
const res = await this.updateConfig(this.urlForm); |
|
|
|
wrapErrorHint(res); |
|
|
|
if(res.Code) { return; } |
|
|
|
this.$refs.urlModal.doClose(); |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getWatchAllGeneralData(); |
|
|
|
this.rightPartUrl = this.temp.includes(sessionStorage.projId) ? 'http://www.lockingos.org:9000/fhy-model/forgemd2020120603/index.html' : 'http://www.lockingos.org:9000/fhy-model/fhy/index.html'; |
|
|
|
this.forgeModelUrl = this.temp.includes(sessionStorage.projId) ? 'http://www.lockingos.org:9000/fhy-model/forgemd2020120603/index.html' : 'http://www.lockingos.org:9000/fhy-model/fhy/index.html'; |
|
|
|
resetUrl() { |
|
|
|
// console.log(this.$refs.urlModal); |
|
|
|
this.$refs.urlModal.doClose(); |
|
|
|
this.urlForm = pick(this.config, ['gsUrl', 'forgeUrl']); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
iconRotateStyle() { |
|
|
|
return { |
|
|
|
'transform': `rotate(${this.iconRotateDeg}deg)` |
|
|
|
} |
|
|
|
// 切换左边部分显示 |
|
|
|
changeShowLeftPageClick() { |
|
|
|
this.isShowLeftPage = !this.isShowLeftPage; |
|
|
|
this.btnLeft = this.isShowLeftPage ? "24px" : "0"; |
|
|
|
if (this.btnLeft == "24px") { |
|
|
|
this.iconRotateDeg = 90; |
|
|
|
} else { |
|
|
|
this.iconRotateDeg = -90; |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getWatchAllGeneralData() { |
|
|
|
let res = Promise.all([ |
|
|
|
getDetailTextData(), |
|
|
|
getProgressData(), |
|
|
|
getGraphData(), |
|
|
|
getGraphData2() |
|
|
|
]).then(([res1, res2, res3, res4]) => { |
|
|
|
this.textData = [{...res1}]; |
|
|
|
this.progressData = [{...res2}]; |
|
|
|
this.graphData = [{...res3}]; |
|
|
|
this.graphData.push(res4); |
|
|
|
this.graphData = [...this.graphData]; |
|
|
|
// 保持两个切换模型的组件是一致的 |
|
|
|
changeModelBtnClick(i) { |
|
|
|
// this.viewType = i == 0 ? 'forge' : 'supermap'; |
|
|
|
this.$refs.topModelBtn.currentIndex = i; |
|
|
|
this.$refs.leftModelBtn.currentIndex = i; |
|
|
|
this.$refs.watchCarousel.setActiveItem(i); |
|
|
|
// if (i == 0) { |
|
|
|
// this.rightPartUrl = this.forgeModelUrl; |
|
|
|
// } else if (i == 1) { |
|
|
|
// this.rightPartUrl = this.superMapUrl; |
|
|
|
// } |
|
|
|
}, |
|
|
|
// 按到后退按钮返回主界面 |
|
|
|
backToIndex() { |
|
|
|
this.$router |
|
|
|
.push({ |
|
|
|
path: "index", |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 切换左边部分显示 |
|
|
|
changeShowLeftPageClick() { |
|
|
|
this.isShowLeftPage = !this.isShowLeftPage; |
|
|
|
this.btnLeft = this.isShowLeftPage ? '24px' : '0'; |
|
|
|
if(this.btnLeft == '24px') { |
|
|
|
this.iconRotateDeg = 90; |
|
|
|
} else { |
|
|
|
this.iconRotateDeg = -90; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 保持两个切换模型的组件是一致的 |
|
|
|
changeModelBtnClick(i) { |
|
|
|
this.$refs.topModelBtn.currentIndex = i; |
|
|
|
this.$refs.leftModelBtn.currentIndex = i; |
|
|
|
if(i == 0) { |
|
|
|
this.rightPartUrl = this.forgeModelUrl; |
|
|
|
} else if(i == 1) { |
|
|
|
this.rightPartUrl = this.superMapUrl; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 按到后退按钮返回主界面 |
|
|
|
backToIndex() { |
|
|
|
this.$router.push({ |
|
|
|
path: 'index' |
|
|
|
}).catch(err => { |
|
|
|
.catch((err) => { |
|
|
|
console.log(err); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.watch-all-page { |
|
|
|
background-color: #f6f6f6; |
|
|
|
} |
|
|
|
.watch-all-page .main-content { |
|
|
|
position: relative; |
|
|
|
display: flex; |
|
|
|
margin: 18px 0 0 0; |
|
|
|
padding: 0 64px; |
|
|
|
} |
|
|
|
.top-change-model-btn { |
|
|
|
margin: 0 auto 20px; |
|
|
|
width: 22.4%; |
|
|
|
} |
|
|
|
.left-change-model-btn { |
|
|
|
margin: 0 0 26px 0; |
|
|
|
} |
|
|
|
.control-btn { |
|
|
|
position: fixed; |
|
|
|
top: 352px; |
|
|
|
width: 32px; |
|
|
|
left: 24px; |
|
|
|
height: 56px; |
|
|
|
border-radius: 8px; |
|
|
|
margin-right: 8px; |
|
|
|
background-color: rgba(252, 252, 252, 1); |
|
|
|
box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1); |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.control-btn img { |
|
|
|
/* 位置和大小要根据图标再修正 */ |
|
|
|
display: block; |
|
|
|
width: 22px; |
|
|
|
margin: 18px auto; |
|
|
|
} |
|
|
|
.left-page { |
|
|
|
width: 22.4%; |
|
|
|
margin: 0 32px 0 0; |
|
|
|
} |
|
|
|
.right-show-area { |
|
|
|
flex: 1; |
|
|
|
border-radius: 16px; |
|
|
|
margin: 0 0 64px 0; |
|
|
|
background-color: #ededed; |
|
|
|
height: 896px; |
|
|
|
min-width: 1%; |
|
|
|
overflow: hidden; |
|
|
|
<style lang="less" scoped> |
|
|
|
.watch-all-page { |
|
|
|
background-color: #f6f6f6; |
|
|
|
} |
|
|
|
.watch-all-page .main-content { |
|
|
|
position: relative; |
|
|
|
display: flex; |
|
|
|
margin: 18px 0 0 0; |
|
|
|
padding: 0 64px; |
|
|
|
} |
|
|
|
.top-change-model-btn { |
|
|
|
margin: 0 auto 20px; |
|
|
|
width: 22.4%; |
|
|
|
} |
|
|
|
.left-change-model-btn { |
|
|
|
margin: 0 0 26px 0; |
|
|
|
} |
|
|
|
.control-btn { |
|
|
|
position: fixed; |
|
|
|
top: 352px; |
|
|
|
width: 32px; |
|
|
|
left: 24px; |
|
|
|
height: 56px; |
|
|
|
border-radius: 8px; |
|
|
|
margin-right: 8px; |
|
|
|
background-color: rgba(252, 252, 252, 1); |
|
|
|
box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1), |
|
|
|
0px 1px 3px 0px rgba(0, 0, 0, 0.1); |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
.control-btn img { |
|
|
|
/* 位置和大小要根据图标再修正 */ |
|
|
|
display: block; |
|
|
|
width: 22px; |
|
|
|
margin: 18px auto; |
|
|
|
} |
|
|
|
.left-page { |
|
|
|
width: 22.4%; |
|
|
|
margin: 0 32px 0 0; |
|
|
|
} |
|
|
|
.right-show-area { |
|
|
|
position: relative; |
|
|
|
flex: 1; |
|
|
|
border-radius: 16px; |
|
|
|
margin: 0 0 64px 0; |
|
|
|
background-color: #ededed; |
|
|
|
height: 896px; |
|
|
|
min-width: 1%; |
|
|
|
/* overflow: hidden; */ |
|
|
|
.watch-carousel { |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
.right-show-area iframe { |
|
|
|
iframe { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
border-radius: 16px; |
|
|
|
} |
|
|
|
&:hover { |
|
|
|
.popover-btn { |
|
|
|
display: block; |
|
|
|
} |
|
|
|
} |
|
|
|
.popover-btn { |
|
|
|
display: none; |
|
|
|
position: absolute; |
|
|
|
bottom: -24px; |
|
|
|
right: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |