更新视点管理
parent
1e91636366
commit
c327578d33
|
@ -188,4 +188,11 @@ aside {
|
|||
}
|
||||
.fred{
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
.el-dialog{
|
||||
&.body-noscroll{
|
||||
.el-dialog__body{
|
||||
overflow: hidden !important;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,17 @@
|
|||
</el-card>
|
||||
<el-empty description="暂无视点数据" v-else />
|
||||
</div>
|
||||
<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-dialog
|
||||
title="保存视点"
|
||||
:width="400"
|
||||
|
@ -60,13 +71,30 @@
|
|||
<el-button type="primary" @click="SaveViewpoint">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="视点重命名" class="body-noscroll" v-model="visibleRenamed" width="400px" :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="备注">
|
||||
<el-input type="textarea" v-model="formRenamed.remark" :rows="4" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visibleRenamed = false">取消</el-button>
|
||||
<el-button type="primary" @click="handSaveRenamed">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { _isMobile } from '@/utils/public'
|
||||
import { Delete, Picture, Edit } from '@element-plus/icons-vue'
|
||||
import { viewpointGet, viewpointAdd } from '@/api/bim/bim.js'
|
||||
import { viewpointGet, viewpointAdd, viewpointUpdateByName, viewpointDeleteById } from '@/api/bim/bim.js'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
export default {
|
||||
|
@ -101,6 +129,23 @@ export default {
|
|||
pageSize: 10,
|
||||
total: 0,
|
||||
},
|
||||
editData: {
|
||||
item: null,
|
||||
index: null,
|
||||
},
|
||||
visibleRenamed: false,
|
||||
rulesRenamed: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入漫游名称',
|
||||
},
|
||||
],
|
||||
},
|
||||
formRenamed: {
|
||||
name: '',
|
||||
remark: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -111,6 +156,14 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
this.pagination.pageSize = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pagination.current = val
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
const that = this
|
||||
viewpointGet({
|
||||
|
@ -156,8 +209,51 @@ export default {
|
|||
api.Camera.setViewPort(JSON.parse(item.viewPosition))
|
||||
}
|
||||
},
|
||||
editViewPoint(item, index) {
|
||||
this.editData.item = item
|
||||
this.editData.index = index
|
||||
this.formRenamed.name = item.name
|
||||
this.formRenamed.remark = item.remark
|
||||
this.visibleRenamed = true
|
||||
},
|
||||
handSaveRenamed() {
|
||||
this.$refs.formRenamedRef.validate((valid) => {
|
||||
if (valid) {
|
||||
let data = {
|
||||
id: this.editData.item.id,
|
||||
name: this.formRenamed.name,
|
||||
remark: this.formRenamed.remark,
|
||||
}
|
||||
viewpointUpdateByName(data).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.visibleRenamed = false
|
||||
ElMessage.success('修改成功')
|
||||
this.getList()
|
||||
} else {
|
||||
ElMessage.error('修改失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
DefaultViewpoint(item, index) {},
|
||||
DelViewpoint(item, index) {},
|
||||
DelViewpoint(item, index) {
|
||||
let that = this
|
||||
ElMessageBox.confirm(`确定要删除漫游 “${item.name}” 吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
viewpointDeleteById({ id: item.id }).then((res) => {
|
||||
if (res.code == 0) {
|
||||
that.getList()
|
||||
ElMessage.success('删除成功')
|
||||
} else {
|
||||
ElMessage.error('删除失败')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
SaveViewpoint() {
|
||||
const that = this
|
||||
that.$refs.form.validate((valid) => {
|
||||
|
@ -196,6 +292,7 @@ export default {
|
|||
that.resetScane()
|
||||
that.$refs.form.resetFields()
|
||||
that.visible = false
|
||||
that.getList()
|
||||
} else {
|
||||
ElMessage.error('保存失败!')
|
||||
}
|
||||
|
@ -224,6 +321,10 @@ export default {
|
|||
top: 10px;
|
||||
right: 40px;
|
||||
}
|
||||
.pagination-container {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.viewpoint-list {
|
||||
margin-bottom: 10px;
|
||||
max-height: 500px;
|
||||
|
|
|
@ -179,7 +179,7 @@ export default {
|
|||
},
|
||||
cube: {
|
||||
hoverColor: '#7193dc', // 立方导航快鼠标移过显示颜色
|
||||
size: 75, // 导航立方尺寸
|
||||
size: 32, // 导航立方尺寸
|
||||
hotPointSize: 7, // 导航立方棱角热点区域尺寸
|
||||
cubeTextColor: '#4c4c4ccc', // cube 各个面文字颜色
|
||||
cubeStrokeColor: '#374769cc', // cube 各个面边框颜色
|
||||
|
@ -250,7 +250,7 @@ export default {
|
|||
}
|
||||
.bim-setting-tools {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
top: 80px;
|
||||
right: 10px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
|
|
Loading…
Reference in New Issue