dev_xd
姜玉琦 2025-05-31 14:29:45 +08:00
commit a01534c6dc
7 changed files with 521 additions and 335 deletions

View File

@ -79,14 +79,14 @@
</el-col>
<el-col :span="8" class="header-center">
<img class="prj-logo" :src="selProject.setting.orgLogo" v-if="selProject && selProject.setting && selProject.setting.orgLogo" />
{{ selProject?.setting?.orgName || '数字建安施工管理平台' }}
<span class="sp-title">{{ selProject?.setting?.orgName ||selProject?.projectName|| '数字建安施工管理平台' }}</span>
</el-col>
<el-col :span="8">
<div class="head-title-tab" style="display: inline-block">
<div :class="nav == 6 ? 'head-nav active' : 'head-nav'" @click="doNav(6)">绿</div>
</div>
<div class="header-title-user-info" style="display:inline-block;float:right;">
<el-select v-model="selProjectId" popper-class="header-sel-project-pop" style="width: 150px;margin-right: 20px;height:30px;line-height: 30px;" @change="doProjectSelect">
<el-select v-model="selProjectId" popper-class="header-sel-project-pop" @change="doProjectSelect">
<el-option v-for="it in projects" :key="it.id" :label="it.projectName" :value="it.id"></el-option>
</el-select>
<span class="command" @click="doLogout">
@ -262,18 +262,37 @@ export default {
<style lang="less">
.div-header {
line-height: 100px;
.header-title-user-info {
font-size: 20px;
.el-select {
transform: scale(1.25);
margin-right: 30px;
position: relative;
top: -5px;
width: 250px;
right: 10px;
}
}
.sp-title {
line-height: 40px;
display: inline-block;
}
.header-center {
text-align: center;
color: #3da2ff;
font-size: 32px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
height: 113px;
.prj-logo {
width: 40px;
height: 40px;
width: 60px;
height: 60px;
vertical-align: middle;
border-radius: 20px;
border-radius: 30px;
}
}
@ -339,29 +358,31 @@ export default {
top: -8px;
.prj-logo {
width: 40px;
height: 40px;
width: 80px;
height: 80px;
vertical-align: middle;
border-radius: 20px;
border-radius: 40px;
}
}
}
.sp-title {
line-height: 48px !important;
font-size: 36px;
}
.header-center {
font-size: 42px !important;
margin-top: 10px;
padding: 0px 60px;
}
.header-title-user-info {
font-size: 20px;
font-size: 20px !important;
.el-select {
transform: scale(1.5);
transform: scale(1.5) !important;
margin-right: 60px !important;
position: relative;
top: -5px;
width: 260px !important;
right: 10px;
right: 10px !important;
}
}
@ -390,26 +411,26 @@ export default {
@media (min-width: 2561px) {
.header-center {
font-size: 52px !important;
margin-top: 10px;
padding: 0px 60px;
.prj-logo {
width: 50px;
height: 50px;
width: 100px;
height: 100px;
vertical-align: middle;
border-radius: 25px;
border-radius: 50px;
}
}
.sp-title {
line-height: 50px !important;
font-size: 40px;
}
.header-title-user-info {
font-size: 30px;
font-size: 30px !important;
.el-select {
transform: scale(2);
transform: scale(2) !important;
margin-right: 100px !important;
position: relative;
top: -5px;
width: 273px !important;
right: 40px;
right: 40px !important;
}
}

View File

@ -1,5 +1,7 @@
package com.yanzhu.manage.hasor;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.system.api.domain.SysUser;
import net.hasor.core.ApiBinder;
import net.hasor.core.DimModule;
import net.hasor.dataql.DataQL;
@ -33,13 +35,16 @@ public class HasorModule implements SpringModule {
public void loadModule(ApiBinder apiBinder) throws Throwable {
// .DataSource form Spring boot into Hasor
apiBinder.installModule(new JdbcModule(Level.Full, this.dataSource));
InterfaceApiFilter f;
apiBinder.bindSpiListener(PreExecuteChainSpi.class, (apiInfo, future) -> {
try{
Method method = apiInfo.getClass().getMethod("getObj");
Map<FieldDef, String> obj=(Map<FieldDef, String>)method.invoke(apiInfo);
Object a=obj;
SysUser user = SecurityUtils.getLoginUser().getSysUser();
if(user!=null) {
apiInfo.getParameterMap().put("currentUser", user.getUserName() + " " + user.getPhonenumber());
}else{
apiInfo.getParameterMap().put("currentUser", "system");
}
}catch (Exception ex){
}
@ -55,7 +60,7 @@ public class HasorModule implements SpringModule {
apiBinder.bindSpiListener(CompilerSpiListener.class, new CompilerSpiListener() {
@Override
public QIL compiler(ApiInfo apiInfo, String query, DataQL dataQL) throws IOException {
query = "hint FRAGMENT_SQL_COLUMN_CASE=\"hump\"\n hint FRAGMENT_SQL_QUERY_BY_PAGE_NUMBER_OFFSET = 1 \n" + query;
query = "hint FRAGMENT_SQL_COLUMN_CASE=\"hump\"\n hint FRAGMENT_SQL_QUERY_BY_PAGE_NUMBER_OFFSET = 1 \n hint FRAGMENT_SQL_OPEN_PACKAGE = 'off' \n" + query;
return CompilerSpiListener.super.compiler(apiInfo, query, dataQL);
}
});

View File

@ -0,0 +1,33 @@
import request from "@/utils/request";
export function roamingAdd(data) {
return request({
url: "/manage/api/bim/roaming/add",
method: "post",
data: data,
});
}
export function roamingGet(data) {
return request({
url: "/manage/api/bim/roaming/get",
method: "get",
params: data,
});
}
export function roamingUpdateByName(data) {
return request({
url: "/manage/api/bim/roaming/updateName",
method: "post",
data: data,
});
}
export function roamingDeleteById(data) {
return request({
url: "/manage/api/bim/roaming/deleteById",
method: "get",
params: data,
});
}

View File

@ -0,0 +1,93 @@
export function colorHextoRGB(value) {
let color = value.toLowerCase();
//判断第一个字符是否是#
if (color[0] !== "#") {
color = "#" + color;
value = color.toUpperCase();
}
//判断剩余的字符是否是十六进制
for (let i = 1; i < color.length; i += 1) {
let curChar = color[i];
//console.log(curChar);
if (isInHex(curChar) == false) {
color = color.replace(curChar, "");
value = color.toUpperCase();
}
}
// 如果只有三位的值,需变成六位,如:#fff => #ffffff
if (color.length === 4) {
var colorNew = "#";
for (let i = 1; i < 4; i += 1) {
colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
}
color = colorNew;
}
// 处理六位的颜色值转为RGB
var colorChange = [];
for (let i = 1; i < 7; i += 2) {
colorChange.push(parseInt("0x" + color.slice(i, i + 2)));
}
let rgb = "rgba(" + colorChange.join(",") + ",1)";
return rgb;
}
function isInHex(c) {
let hexArr = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"a",
"b",
"c",
"d",
"e",
"f",
];
for (let i = 0; i < hexArr.length; i += 1) {
if (hexArr[i] === c) {
return true;
}
}
return false;
}
export function genlabID(length) {
//随机生成6位数
return Number(Math.random().toString().substr(3, length));
}
export function dateFormat(time) {
var date = new Date(time);
var year = date.getFullYear();
/* 00
* 使用三元表达式在小于10的前面加0以达到格式统一 09:11:05
* */
var month =
date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes =
date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var seconds =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
// 拼接
return (
year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
);
}
export function _isMobile() {
let flag = navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
);
return flag;
}

View File

@ -1,7 +1,7 @@
<template>
<div class="roaming-settings">
<el-tabs v-model="tab" size="small" @tab-click="ChangeTab">
<el-tab-pane label="漫游设置" name="1" class="scroll-box roam-history">
<el-tab-pane label="漫游设置" name="tab1" class="scroll-box roam-history">
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="30%" @reset="handleCancel">
<el-form-item label="漫游名称" prop="name">
<el-input v-model="form.name" style="width: 100%"></el-input>
@ -21,7 +21,7 @@
</el-form-item>
<el-form-item>
<el-button @click="startImmersionRoaming" ghost>开始漫游</el-button>
<el-button @click="endImmersionRoaming" ghost>结束漫游</el-button>
<el-button @click="endImmersionRoaming(99)" ghost>结束漫游</el-button>
</el-form-item>
</el-form>
<el-table :data="data" border style="width: 100%" class="op-table">
@ -33,39 +33,85 @@
<el-table-column prop="title" label="说明"></el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="漫游历史" name="2" class="scroll-box roam-history roam-list-scroll">
<el-table :data="historys" :empty-text="`暂无漫游历史`" :loading="loading" style="width: 100%">
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column label="操作">
<el-tab-pane label="漫游历史" name="tab2" class="scroll-box roam-history roam-list-scroll">
<el-row class="his-tool">
<el-col :span="12">
自动播放:
<el-checkbox v-model="autoPlay" />
</el-col>
<el-col :span="12">
<el-button type="primary" @click="playCancle"></el-button>
</el-col>
</el-row>
<el-table :data="historys" :empty-text="`暂无漫游历史`" :loading="loading" style="width: 100%" height="60vh">
<el-table-column prop="name" label="名称">
<template #default="scope">{{ scope.row.name }}[{{ scope.row.pointCount }}]</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template #default="scope">
<el-tooltip v-if="scope.row.play === 0" content="播放" placement="top">
<el-button icon="el-icon-video-play" circle @click="playIR(scope.row)"></el-button>
<el-button circle @click="playIR(scope.row)">
<el-icon>
<VideoPlay />
</el-icon>
</el-button>
</el-tooltip>
<el-tooltip v-else-if="scope.row.play === 1" content="暂停" placement="top">
<el-button icon="el-icon-video-pause" circle @click="playIRPause(scope.row)"></el-button>
<el-button circle @click="playIRPause(scope.row)">
<el-icon>
<VideoPause />
</el-icon>
</el-button>
</el-tooltip>
<el-tooltip v-else-if="scope.row.play === 2" content="继续" placement="top">
<el-button icon="el-icon-video-play" circle @click="playContinue(scope.row)"></el-button>
<el-button circle @click="playContinue(scope.row)">
<el-icon>
<VideoPlay />
</el-icon>
</el-button>
</el-tooltip>
<el-tooltip content="取消" placement="top">
<el-button icon="el-icon-video-close" circle @click="playCancle(scope.row)"></el-button>
<el-button circle @click="playCancle(scope.row)">
<el-icon>
<Close />
</el-icon>
</el-button>
</el-tooltip>
<el-tooltip content="重命名" placement="top">
<el-button icon="el-icon-edit" circle @click="renamed(scope.row)"></el-button>
<el-button circle @click="renamed(scope.row)">
<el-icon>
<Edit />
</el-icon>
</el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button icon="el-icon-delete" circle @click="delCamera(scope.row, scope.$index)"></el-button>
<el-button circle @click="delCamera(scope.row, scope.$index)">
<el-icon>
<Delete />
</el-icon>
</el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination
v-model:current-page="pagination.current"
v-model:page-size="pagination.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="pagination.total"
layout="total, prev, pager, next"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</el-tab-pane>
</el-tabs>
<el-dialog title="漫游重命名" :visible="visibleRenamed" width="280px" :before-close="() => visibleRenamed = false">
<el-form :model="formRenamed" label-width="80px">
<el-form-item label="漫游名称">
<el-input v-model="formRenamed.name"></el-input>
<el-dialog title="漫游重命名" v-model="visibleRenamed" width="280px" :before-close="() => visibleRenamed = false">
<el-form ref="formRenamedRef" :rules="rulesRenamed" :model="formRenamed" label-width="80px">
<el-form-item label="漫游名称" prop="name">
<el-input v-model="formRenamed.name" maxlength="20" placeholder="请输入名称"></el-input>
</el-form-item>
<el-form-item label="备注" v-show="false">
<el-input type="textarea" v-model="formRenamed.remark" :rows="4" placeholder="备注"></el-input>
@ -82,6 +128,11 @@
</template>
<script>
import { VideoPlay, VideoPause, Close, Edit, Delete } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { roamingAdd, roamingGet, roamingUpdateByName, roamingDeleteById } from '@/api/bim/bim.js'
import useUserStore from '@/store/modules/user'
const data = [
{
option: '鼠标左键',
@ -111,22 +162,52 @@ const data1 = [
title: '下沉',
},
]
export default {
name: 'PersonRoaming',
components: {
VideoPlay,
VideoPause,
Close,
Edit,
Delete,
},
props: {
me: {
type: Object,
default: () => ({}),
},
},
data() {
return {
data,
data1,
visibleRenamed: false,
isRoaming: false,
isRoamingHistory: false,
tab: 1,
data,
data1,
tab: 'tab1',
historys: [],
loading: true,
isMobile: false,
autoPlay: true,
isStop: 0,
currentPrjId: null,
currentComId: null,
modelRenamed: null,
form: {
name: '',
moveRate: 0.5, //
turnRate: 1, //(3°)
moveRate: 0.5,
turnRate: 1,
roamType: 'Third',
},
rulesRenamed: {
name: [
{
required: true,
message: '请输入漫游名称',
},
],
},
rules: {
name: [
{
@ -148,263 +229,52 @@ export default {
],
},
formRenamed: {},
visibleRenamed: false, //
modelRenamed: null,
pagination: {
current: 1,
pageSize: 10,
total: 0,
},
loading: true,
isMobile: false,
}
},
mounted() {
window.xapp = this
//
api.Plugin.addMiniMap()
let options = {
Anchor: 3,
Offset: [70, -380],
Size: 300,
// Height: 1200
}
api.Plugin.updateMiniMap(options)
const userStore = useUserStore()
this.currentPrjId = userStore.currentPrjId
this.currentComId = userStore.currentComId
},
methods: {
ChangeTab(data) {
const that = this
if (data == 2) {
that.historys = []
that.pagination.current = 1
that.pagination.pageSize = Math.ceil(document.getElementsByClassName('roam-history')[0].offsetHeight / 40) + 1
that.getRoamingList()
if (data.paneName === 'tab2') {
this.historys = []
this.pagination.current = 1
this.getRoamingList()
}
},
async getRoamingList() {
const that = this
await getRoamingTrack({
MaxResultCount: that.pagination.pageSize,
SkipCount: (that.pagination.current - 1) * that.pagination.pageSize,
ModelId: that.projectMessage.modelList[0].id,
getRoamingList() {
this.loading = true
roamingGet({
pageSize: this.pagination.pageSize,
pageNum: this.pagination.current,
projectId: this.currentPrjId,
}).then((res) => {
that.loading = false
const pagination = {
...that.pagination,
}
pagination.total = res.totalCount
//
if (res.items.length > 0) res.items.forEach((x) => (x.play = 0))
that.historys = that.historys.concat(res.items)
that.pagination = pagination
if (res.totalCount > that.pagination.current * that.pagination.pageSize) {
that.updated()
this.loading = false
this.pagination.total = res.data.pageInfo.totalCount
if (res.data.rows.length > 0) {
res.data.rows.forEach((x) => (x.play = 0))
}
this.historys = res.data.rows
})
},
updated() {
const that = this
that.$nextTick(() => {
const el = document.querySelector('.roam-list-scroll')
const offsetHeight = el.offsetHeight
el.onscroll = () => {
const scrollTop = el.scrollTop
const scrollHeight = el.scrollHeight
if (offsetHeight + scrollTop - scrollHeight >= -1) {
//
if (that.pagination.total > that.pagination.current * that.pagination.pageSize) {
that.pagination.current++
that.getRoamingList()
}
}
}
})
},
startImmersionRoaming(e) {
//
e.preventDefault()
const that = this
if (!that.form.name) {
that.$message.warning('请输入漫游名称!')
return
}
that.$refs.ruleForm.validate((valid) => {
if (valid) {
that.$message.info('请点击选择漫游起始点')
store.dispatch('GetObtainCoordinates', {
clickStatus: true,
callback: (data) => {
store.dispatch('GetObtainCoordinates', {
clickStatus: false,
})
//
api.Camera.setImmersiveRoamConfig({
roamingMode: that.form.roamType,
moveRate: that.form.moveRate,
turnRate: that.form.turnRate,
bRecordLocus: true,
onIREnd: function (result) {
that.$message.success('漫游结束')
if (result) {
setRoamingTrack({
name: that.form.name,
modelId: that.projectMessage.modelList[0].id,
projectId: that.projectMessage.projectId,
time: 0,
remark: that.form.roamType,
sort: 0,
roamingPoints: result,
}).then((res) => {
res.record = result
res.play = 0
that.historys.push(res) //play 0 1 2
that.form = {
name: '',
moveRate: 0.5,
turnRate: 1,
roamType: that.form.roamType,
}
})
}
},
})
//
that.isRoaming = true
api.Camera.startImmersiveRoam(data)
},
})
}
})
},
endImmersionRoaming() {
if (this.isRoaming) {
this.isRoaming = false
api.Camera.stopImmersiveRoam()
this.projectMessage.camera
? api.Camera.setViewPort(this.projectMessage.camera)
: api.Model.location(this.projectMessage.modelId)
} else {
this.$message.warning('请先开启漫游')
}
},
handleCancel() {
this.endImmersionRoaming()
this.$notification.destroy()
},
playIR(data) {
// play 0 1 2
const that = this
that.isRoamingHistory = true
if (that.historys.findIndex((x) => x.play === 1) > -1) {
//
that.historys.find((x) => x.play === 1).play = 0
}
data.play = 1
let record = typeof data.record == 'string' ? JSON.parse(data.record) : data.record
api.Camera.setImmersiveRoamConfig({
roamingMode: data.remark,
})
api.Camera.playImmersiveRoam({
records: record, //>
isLoopPlay: false,
complete: function () {
data.play = 0
},
})
},
playIRPause(data) {
//
data.play = 2
api.Camera.pauseImmersiveRoam(false)
},
playContinue(data) {
//
data.play = 1
api.Camera.pauseImmersiveRoam(true)
if (this.historys.findIndex((x) => x.play === 1) > -1) {
this.historys.find((x) => x.play === 1).play = 0
}
},
playCancle(data) {
//
if (data.play === 1) {
data.play = 0
}
api.Camera.cancelPlayImmersiveRoam() //
this.isRoamingHistory = false
this.projectMessage.camera
? api.Camera.setViewPort(this.projectMessage.camera)
: api.Model.location(this.projectMessage.modelId)
},
//
renamed(record) {
this.visibleRenamed = true
this.modelRenamed = record
this.$nextTick(() => {
this.formRenamed.setFieldsValue({
name: record.name,
remark: record.remark,
}) //,
})
},
//
handSaveRenamed() {
const that = this
that.formRenamed.validateFields((err, values) => {
if (!err) {
var data = Object.assign(that.modelRenamed, values)
updateRoamingTrack(data).then((res) => {
if (res) {
that.visibleRenamed = false
that.$message.success('保存成功')
} else {
that.$message.error('保存失败')
}
})
}
})
},
delCamera(data, index) {
//
const that = this
that.$confirm({
cancelText: '取消',
okText: '确定',
title: `确定要删除漫游 “${data.name}” 吗?`,
onOk() {
if (that.historys.find((x) => x.id === data.id).play != 0) {
api.Camera.cancelPlayImmersiveRoam()
}
that.historys.splice(index, 1)
deleteRoamingTrack(data.id).then((res) => {})
that.$message.success('删除成功!')
},
})
},
handleKeydown(event) {
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
event.preventDefault()
//
}
},
},
destroyed() {
const that = this
if (that.isRoaming) {
api.Camera.stopImmersiveRoam()
}
if (that.isRoamingHistory) {
api.Camera.cancelPlayImmersiveRoam()
}
api.Plugin.deleteMiniMap()
that.projectMessage.camera ? api.Camera.setViewPort(that.projectMessage.camera) : api.Model.location(that.projectMessage.modelId)
},
methods22: {
doNav(n) {
this.navIndex = n
},
endImmersionRoaming() {
;(this.romingVisible = !0), (this.roamName = '')
},
GetObtainCoordinates({ clickStatus, callback }) {
api.Public.pickupCoordinate(false)
setTimeout(() => {
@ -417,61 +287,220 @@ export default {
})
})
},
doRoaming() {
debugger
let e = this
let that = this
e.$message.warning('请点击模型选择漫游起点!')
this.GetObtainCoordinates({
clickStatus: true,
callback: (data) => {
startImmersionRoaming(e) {
this.me.resetScene()
e.preventDefault()
if (!this.form.name) {
ElMessage.warning('请输入漫游名称!')
return
}
this.$refs.ruleForm.validate((valid) => {
if (valid) {
ElMessage.info('请点击选择漫游起始点')
this.GetObtainCoordinates({
clickStatus: false,
})
//
api.Camera.setImmersiveRoamConfig({
roamingMode: that.form.roamType,
moveRate: that.form.moveRate,
turnRate: that.form.turnRate,
bRecordLocus: true,
onIREnd: function (result) {
that.$message.success('漫游结束')
if (result) {
setRoamingTrack({
name: that.name,
modelId: that.projectMessage.modelList[0].id,
projectId: that.projectMessage.projectId,
time: 0,
remark: that.form.roamType,
sort: 0,
roamingPoints: result,
}).then((res) => {
res.record = result
res.play = 0
that.historys.push(res) //play 0 1 2
that.form = {
name: '',
moveRate: 0.5,
turnRate: 1,
roamType: that.form.roamType,
clickStatus: true,
callback: (data) => {
this.GetObtainCoordinates({
clickStatus: false,
})
this.isStop = 0
api.Camera.setImmersiveRoamConfig({
roamingMode: this.form.roamType,
moveRate: this.form.moveRate,
turnRate: this.form.turnRate,
bRecordLocus: true,
onIREnd: (result) => {
ElMessage.success('漫游结束')
if (this.stop === 0) {
return
}
})
}
let data = {
vo: {
projectId: this.currentPrjId,
comId: this.currentComId,
name: this.form.name,
modelId: api.m_model.keys().toArray().join(','),
roamingMode: this.form.roamType,
moveRate: this.form.moveRate,
turnRate: this.form.turnRate,
points: JSON.stringify(result),
pointCount: result.length,
},
}
roamingAdd(data).then((res) => {
if (res.code == 1) {
ElMessage.success('保存成功!')
}
})
},
})
this.isRoaming = true
api.Camera.startImmersiveRoam(data)
},
})
},
}
})
},
endImmersionRoaming(n) {
if (n) {
this.isStop = 99
} else {
this.isStop = 0
}
if (this.isRoaming) {
this.isRoaming = false
this.me.resetScene()
} else {
ElMessage.warning('请先开启漫游')
}
},
handleCancel() {
this.endImmersionRoaming()
},
playIR(data) {
this.playCancle()
this.isRoamingHistory = true
if (this.historys.findIndex((x) => x.play === 1) > -1) {
this.historys.find((x) => x.play === 1).play = 0
}
data.play = 1
let record = typeof data.points === 'string' ? JSON.parse(data.points) : data.points
this.isStop = 0
api.Camera.setImmersiveRoamConfig({
roamingMode: data.roamingMode,
moveRate: this.form.moveRate,
turnRate: this.form.turnRate,
bRecordLocus: false,
})
this.isRoaming = true
setTimeout(() => {
api.Camera.startImmersiveRoam([65.702301, 670.785328, 851.817162])
setTimeout(() => {
api.Camera.playImmersiveRoam({
records: record,
isLoopPlay: this.autoPlay,
complete: function () {
data.play = 0
},
})
}, 400)
}, 100)
},
playIRPause(data) {
data.play = 2
api.Camera.pauseImmersiveRoam(false)
},
playContinue(data) {
data.play = 1
api.Camera.pauseImmersiveRoam(true)
if (this.historys.findIndex((x) => x.play === 1) > -1) {
this.historys.find((x) => x.play === 1).play = 0
}
},
playCancle(data) {
if (data && data.play === 1) {
data.play = 0
} else {
if (this.historys.findIndex((x) => x.play === 1) > -1) {
this.historys.find((x) => x.play === 1).play = 0
}
}
api.Camera.cancelPlayImmersiveRoam()
this.isRoamingHistory = false
this.me.resetScene()
},
renamed(record) {
this.visibleRenamed = true
this.modelRenamed = record
Object.assign(this.formRenamed, {
name: record.name,
remark: record.remark,
})
},
handSaveRenamed() {
this.$refs.formRenamedRef.validate((d) => {
if (d) {
const data = {
id: this.modelRenamed.id,
name: this.formRenamed.name,
}
roamingUpdateByName(data).then((res) => {
if (res.code === 0) {
this.visibleRenamed = false
this.modelRenamed.name = this.formRenamed.name
ElMessage.success('保存成功')
} else {
ElMessage.error('保存失败')
}
})
}
})
},
delCamera(data, index) {
this.$confirm(`确定要删除漫游 "${data.name}" 吗?`, '提示', {
confirmButtonText: '确 认',
cancelButtonText: '取 消',
type: 'warning',
}).then(() => {
roamingDeleteById({ id: data.id }).then((res) => {
if (res.code === 0) {
this.historys.splice(index, 1)
ElMessage.success('删除成功!')
} else {
ElMessage.error('删除失败!')
}
})
})
},
handleSizeChange(val) {
this.pagination.pageSize = val
this.getRoamingList()
},
handleCurrentChange(val) {
this.pagination.current = val
this.getRoamingList()
},
},
beforeUnmount() {
if (this.isRoaming) {
api.Camera.stopImmersiveRoam()
}
if (this.isRoamingHistory) {
api.Camera.cancelPlayImmersiveRoam()
}
api.Plugin.deleteMiniMap()
api.Model.location(api.m_model.keys().toArray()[0])
},
}
</script>
<style lang="scss">
.roaming-settings {
padding: 0px 10px;
width: 340px;
padding: 0px 10px 10px;
.op-table {
.cell {
font-size: 12px;
}
}
.his-tool {
font-size: 12px;
margin-bottom: 8px;
}
.pagination-container {
margin-top: 10px;
height: 32px;
display: flex;
justify-content: flex-end;
.el-pagination {
font-size: 12px;
.el-pagination__total,
.el-pagination__sizes {
margin-right: 16px;
}
}
}
}
</style>

View File

@ -34,7 +34,7 @@
<el-icon @click="doToolsClose" style="color:#fff" class="tools-close">
<Close />
</el-icon>
<person-roaming v-if="activeMenu===1"></person-roaming>
<person-roaming v-if="activeMenu===1" ref="personRoaming" :me="this"></person-roaming>
</div>
</div>
</template>
@ -45,7 +45,6 @@ import { listBimModel } from '@/api/bim/bimModel'
import ModelFloorTree from './ModelFloorTree.vue'
import PersonRoaming from './PersonRoaming.vue'
import { h } from 'vue'
export default {
components: {
ModelFloorTree,
@ -85,21 +84,27 @@ export default {
this.showModels = api.m_model.keys().toArray()
console.log('--change--')
},
resetScene() {
if (this.$refs.personRoaming) {
this.$refs.personRoaming.isRoaming = false
}
api.Camera.stopImmersiveRoam()
api.Model.location(api.m_model.keys().toArray()[0])
api.Plugin.deleteMiniMap()
},
doMenu(n) {
if (n == this.activeMenu) {
if (n == 0) {
this.resetScene()
}
return
}
this.activeMenu = n
if (n == 0) {
api.Model.location(api.m_model.keys().toArray()[0])
this.resetScene()
}
if (n == 1) {
this.NotificationPopup({
title: '第一人称漫游',
//id: 'PersonRoaming',
//description: h('p', null, [h('span', null, 'Message can be '), h('i', { style: 'color: teal' }, 'VNode')]),
//description: h('p', null, [h(PersonRoaming)]),
})
this.param.title = '第一人称漫游'
}
},
NotificationPopup(parameter) {

View File

@ -11,7 +11,7 @@ function goTarget(url) {
window.open(url, '__blank')
}
request.get('/manage/api/menu/list').then((d) => {
debugger
console.log('服务就绪')
})
</script>