fix: BUG修改
This commit is contained in:
parent
86308e1978
commit
59756c672b
126
public/bimBaseProgressModel.html
Normal file
126
public/bimBaseProgressModel.html
Normal file
@ -0,0 +1,126 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>My first BIMFACE app</title>
|
||||
</head>
|
||||
<style>
|
||||
.view3d-viewer {
|
||||
width: 98% !important;
|
||||
height: 98% !important;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div
|
||||
id="viewer"
|
||||
style="width: 100%; height: 95vh"
|
||||
class="my-obv-viewer"
|
||||
></div>
|
||||
<script
|
||||
src="https://api.cloud.pkpm.cn/bimviewer/viewer/v5/obv.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://api.cloud.pkpm.cn/bimviewer/viewer/v5/obv.css"
|
||||
type="text/css"
|
||||
/>
|
||||
<link
|
||||
href="https://api.cloud.pkpm.cn/bimviewer/viewer/v4/locale/locale.properties"
|
||||
rel="resource"
|
||||
type="application/l10n"
|
||||
/>
|
||||
<script>
|
||||
let configValue = {
|
||||
viewToken: "",
|
||||
urn: "",
|
||||
bimComponent: [],
|
||||
};
|
||||
async function main() {
|
||||
// 创建实例需要传入的参数,部署环境serviceConfig 和 用户有效期getAccessToken
|
||||
const applicationOptions = {
|
||||
// 配置 OBV 服务端(BIMServer)API 服务的 origin,这个适合于私有部署的用户使用
|
||||
getAccessToken: getAccessToken,
|
||||
refreshAccessToken: getAccessToken,
|
||||
serviceConfig: {
|
||||
origin: "https://api.cloud.pkpm.cn",
|
||||
apiContextPath: "/bimserver/viewing/v3",
|
||||
},
|
||||
};
|
||||
// 定义urn,模型的唯一标识
|
||||
let urn = configValue.urn;
|
||||
// 实例化 Builder,用于模型加载
|
||||
const builder = new OBV.Api.ObvBuilder();
|
||||
// 创建 Application 对象
|
||||
const application = await builder.buildApplication(applicationOptions);
|
||||
// 创建 document 管理视图,加载完成后可以调用接口
|
||||
const obvDocument = await builder.loadDocument(application, urn);
|
||||
// 创建 viewer 容器, 创建API
|
||||
const obvApi = await builder.buildViewer3d(
|
||||
application,
|
||||
document.getElementById("viewer")
|
||||
);
|
||||
// 获取三维模型视图
|
||||
const viewer3dItems = obvDocument.get3dGeometryItems();
|
||||
// 加载模型
|
||||
builder.load3dModels(obvApi, {
|
||||
obvDocument: obvDocument,
|
||||
viewer3dItem: viewer3dItems[0],
|
||||
});
|
||||
// 设置监听事件
|
||||
obvApi.addEventListener(
|
||||
OBV.ViewerEventTypes.V3dSelectionChangedEvent,
|
||||
(event) => {
|
||||
console.log(event);
|
||||
// 往父级传递
|
||||
window.parent.postMessage({ msg: event.nodeIdArray });
|
||||
}
|
||||
);
|
||||
|
||||
// 监听相机改变
|
||||
obvApi.addEventListener(
|
||||
OBV.ViewerEventTypes.V3dCameraChangeEvent,
|
||||
(event) => {
|
||||
console.log("V3dCameraChangeEvent", event);
|
||||
// 操作模型
|
||||
renderConfigModel(obvApi);
|
||||
}
|
||||
);
|
||||
}
|
||||
function renderConfigModel(obvApi) {
|
||||
console.log(obvApi);
|
||||
// 构件着色
|
||||
if (configValue.bimComponent.length > 0) {
|
||||
// 构件着色
|
||||
obvApi.setObjectsColor(configValue.bimComponent, 51, 122, 183, 1);
|
||||
} else {
|
||||
obvApi.restoreObjectsColor();
|
||||
}
|
||||
}
|
||||
// 访问的令牌 getAccessToken 和 令牌有效期 expiresIn
|
||||
function getAccessToken(callBack) {
|
||||
callBack(configValue.viewToken);
|
||||
}
|
||||
|
||||
// 监听父组件的信息传递
|
||||
window.addEventListener("message", async function(e) {
|
||||
// const modelId = e.data.modelId
|
||||
const data = e.data || {};
|
||||
console.log(data);
|
||||
if (data.token && data.urn) {
|
||||
configValue.viewToken = data.token;
|
||||
configValue.urn = data.urn;
|
||||
// removeModel(modelId)
|
||||
document.getElementById("viewer").innerHTML = "";
|
||||
// 调用main函数进行代码的实现
|
||||
main();
|
||||
if (data.bimComponent) {
|
||||
configValue.bimComponent = data.bimComponent;
|
||||
} else {
|
||||
configValue.bimComponent = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -20,7 +20,7 @@ var COMPANY = '' //通用
|
||||
// COMPANY = 'shjg'//上海优益(上海建工)
|
||||
// COMPANY = 'syhy'//沈阳和盈
|
||||
// COMPANY = 'jxwjj'//嘉兴王江泾公用码头项目
|
||||
COMPANY = 'gxbs'//广西百色
|
||||
// COMPANY = 'gxbs'//广西百色
|
||||
|
||||
var PROJECT = {
|
||||
local_test: 'common', // 普通版
|
||||
|
||||
@ -16,8 +16,7 @@
|
||||
let app;
|
||||
let modelState;
|
||||
let configValue = {
|
||||
hideArr: [],
|
||||
colorArr: [],
|
||||
bimComponent: [],
|
||||
};
|
||||
const bimCallback = (viewToken) => {
|
||||
// let viewToken = '11b0d307c09f43bfa5fa3922bcce0342'
|
||||
@ -51,8 +50,8 @@
|
||||
Glodon.Bimface.Viewer.Viewer3DEvent.MouseClicked,
|
||||
(data) => {
|
||||
console.log(data);
|
||||
// 往父级传递
|
||||
window.parent.postMessage({ msg: data.elementId });
|
||||
// 往父级传递
|
||||
window.parent.postMessage({ msg: data.elementId });
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -64,32 +63,27 @@
|
||||
function renderConfigModel() {
|
||||
// 恢复模型状态
|
||||
viewer3D.setState(modelState);
|
||||
model3D.hideComponentsById(configValue.hideArr);
|
||||
configValue.colorArr.map((item) => {
|
||||
model3D.overrideComponentsColorById(
|
||||
[item.name],
|
||||
new Glodon.Web.Graphics.Color(item.color, 1)
|
||||
);
|
||||
});
|
||||
model3D.overrideComponentsColorById(
|
||||
configValue.bimComponent,
|
||||
new Glodon.Web.Graphics.Color("#337AB7", 1)
|
||||
);
|
||||
viewer3D.render();
|
||||
}
|
||||
// 监听父组件的信息传递
|
||||
window.addEventListener("message", async function(e) {
|
||||
// const modelId = e.data.modelId
|
||||
const data = e.data || {};
|
||||
console.log(data);
|
||||
if (data.token) {
|
||||
// removeModel(modelId)
|
||||
document.getElementById("domId").innerHTML = "";
|
||||
await bimCallback(data.token);
|
||||
if (data.hideArr && data.colorArr) {
|
||||
configValue.hideArr = data.hideArr;
|
||||
configValue.colorArr = data.colorArr;
|
||||
if (data.bimComponent && data.bimComponent.length > 0) {
|
||||
configValue.bimComponent = data.bimComponent;
|
||||
} else {
|
||||
configValue.bimComponent = [];
|
||||
}
|
||||
}
|
||||
// console.log(e.data, '父级页面传来的数据')
|
||||
// setTimeout(() => {
|
||||
// window.parent.postMessage({ msg: 'hello' })
|
||||
// }, 2000)
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
@ -10,6 +10,7 @@ export const getParentChildTaskListApi = data => post('xmgl/taskProgress/getPare
|
||||
export const addTaskProgressApi = data => post('xmgl/taskProgress/add', data);
|
||||
export const deleteTaskProgressApi = data => post('xmgl/taskProgress/delete', data);
|
||||
export const editTaskProgressApi = data => post('xmgl/taskProgress/edit', data);
|
||||
export const editProgressBindComponentApi = data => post('xmgl/taskProgress/editBimComponent', data);
|
||||
export const getTaskProgressPageApi = data => post('xmgl/taskProgress/getParentChildPage', data);
|
||||
|
||||
|
||||
|
||||
@ -53,6 +53,7 @@ export const getJlwConfigApi = data => get('/xmgl/bimface/getConfigStatus', data
|
||||
export const getJlwTokenApi = data => get('/xmgl/bimface/getViewTokenByFileId', data); // 通过文件标识获取ViewToken
|
||||
export const getJlwDetailsApi = data => get('/xmgl/bimface/getDetailsByFileIdAndProjectSn', data); // 通过文件标识获取详情(包括ViewToken)
|
||||
export const saveBimfaceConfig = data => post('/xmgl/bimface/edit', data); // 保存BIMFACE相关配置
|
||||
export const searchEnableModel = data => get('/xmgl/bimface/getEnableModel', data); // 查询启用的模型和token
|
||||
|
||||
// bimBase中心
|
||||
export const addBimBaseConfigApi = data => post('/xmgl/gouliPkpmConfig/add', data); // 添加配置
|
||||
@ -61,7 +62,7 @@ export const projectBimBaseListApi = data => get('/xmgl/gouliPkpmModel/list', da
|
||||
export const addBimBaseUploadApi = data => post('/xmgl/gouliPkpmModel/add', data); // 添加新模型
|
||||
export const updateBimBaseUploadApi = data => post('/xmgl/gouliPkpmModel/edit', data); // 编辑模型
|
||||
export const deleteBimBaseUploadApi = data => post('/xmgl/gouliPkpmModel/delete', data); // 删除模型
|
||||
export const startBimBaseApi = data => get('/xmgl/gouliPkpmModel/setEnableMainModel', data); // 启用所对应的bim
|
||||
export const startBimBaseApi = data => post('/xmgl/gouliPkpmModel/setEnableMainModel', data); // 启用所对应的bim
|
||||
export const getBimBaseDetailsApi = data => get('/xmgl/gouliPkpmModel/getBimTokenByProjectSn', data); // 通过文件标识获取ViewToken
|
||||
export const getBimBaseDetails = data => get('/xmgl/gouliPkpmModel/queryById', data); // 通过文件标识获取详情
|
||||
|
||||
|
||||
@ -82,12 +82,12 @@ if (process.env.NODE_ENV == 'development') {
|
||||
// axios.defaults.baseURL ='http://huli.zjzhiliao.com/jxjgdapi/' //金林湾测试线上
|
||||
// axios.defaults.baseURL ='http://101.43.164.214:45001/' //上海张江
|
||||
// axios.defaults.baseURL ='http://101.43.164.214:45011/' //上海优益(上海建工)
|
||||
// axios.defaults.baseURL = 'http://192.168.34.221:30002/' //郭圣雄本地
|
||||
axios.defaults.baseURL = 'http://192.168.34.221:28888/' //郭圣雄本地
|
||||
// axios.defaults.baseURL ='http://192.168.34.221:30012/' //郭圣雄本地
|
||||
// axios.defaults.baseURL = 'http://182.90.224.237:51234' //郭圣雄远程
|
||||
// axios.defaults.baseURL ='http://101.43.164.214:45020/' //沈阳和盈
|
||||
// axios.defaults.baseURL ='http://183.249.224.118:9000/' //嘉兴王江泾公用码头
|
||||
axios.defaults.baseURL ='http://101.43.164.214:11111/' // 百色三标段项目
|
||||
// axios.defaults.baseURL ='http://101.43.164.214:11111/' // 百色三标段项目
|
||||
// axios.defaults.baseURL = 'http://125.88.207.86:8088/'//中建四局线上(最新)地址
|
||||
|
||||
|
||||
|
||||
3740
src/router/index.js
3740
src/router/index.js
File diff suppressed because it is too large
Load Diff
469
src/views/projectFront/BIMBASECenter/progressManagement.vue
Normal file
469
src/views/projectFront/BIMBASECenter/progressManagement.vue
Normal file
@ -0,0 +1,469 @@
|
||||
<template>
|
||||
<div class="fullHeight">
|
||||
<div>
|
||||
<div class="searchBox whiteBlock">
|
||||
<el-form
|
||||
:inline="true"
|
||||
size="medium"
|
||||
:model="queryInfo"
|
||||
class="demo-form-inline"
|
||||
>
|
||||
<el-form-item label="分部分项工程名称">
|
||||
<el-input
|
||||
v-model="queryInfo.taskName"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="queryInfo.status" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="(item, index) in options"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="实际完成日期">
|
||||
<el-date-picker
|
||||
v-model="daterange"
|
||||
@change="changeDate"
|
||||
type="daterange"
|
||||
:range-separator="$t('message.energyManage.to')"
|
||||
:start-placeholder="$t('message.energyManage.start')"
|
||||
:end-placeholder="$t('message.energyManage.end')"
|
||||
value-format="yyyy-MM-dd"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain @click="getProgressListData"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="warning" plain @click="refreshBtn">刷新</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="table_wrap whiteBlock">
|
||||
<vue-scroll>
|
||||
<el-table
|
||||
height="650"
|
||||
class="tables"
|
||||
:data="listData"
|
||||
lazy
|
||||
row-key="id"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children' }"
|
||||
>
|
||||
<el-table-column
|
||||
width="200"
|
||||
prop="taskName"
|
||||
label="分部分项工程名称"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
:title="scope.row.taskName"
|
||||
style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 150px;position: absolute;"
|
||||
>
|
||||
{{ scope.row.taskName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="startDate"
|
||||
label="计划开始时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="finishDate"
|
||||
label="计划完成时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="actualStartDate"
|
||||
label="实际开始时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="actualFinishDate"
|
||||
label="实际完成时间"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="dutyUserName"
|
||||
label="负责人"
|
||||
></el-table-column>
|
||||
<el-table-column align="center" prop="progressRatio" label="进度">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.progressRatio + "%"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" align="center" label="执行状态">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.status == 0
|
||||
? "未开始"
|
||||
: scope.row.status == 1
|
||||
? "进行中"
|
||||
: scope.row.status == 2
|
||||
? "已完成"
|
||||
: "未开始"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="beginWarning"
|
||||
align="center"
|
||||
label="开始预警"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div
|
||||
style="color: #fe6565;"
|
||||
v-if="scope.row.beginWarning === 3"
|
||||
>
|
||||
{{
|
||||
scope.row.beginWarning == 1
|
||||
? "提前"
|
||||
: scope.row.beginWarning == 2
|
||||
? "正常"
|
||||
: "逾期"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{
|
||||
scope.row.beginWarning == 1
|
||||
? "提前"
|
||||
: scope.row.beginWarning == 2
|
||||
? "正常"
|
||||
: "逾期"
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="endWarning" align="center" label="结束预警">
|
||||
<template slot-scope="scope">
|
||||
<div style="color: #fe6565;" v-if="scope.row.endWarning === 3">
|
||||
{{
|
||||
scope.row.endWarning == 1
|
||||
? "提前"
|
||||
: scope.row.endWarning == 2
|
||||
? "正常"
|
||||
: "逾期"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{
|
||||
scope.row.endWarning == 1
|
||||
? "提前"
|
||||
: scope.row.endWarning == 2
|
||||
? "正常"
|
||||
: "逾期"
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="300" label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click.native.stop="relativeComponent(scope.row)"
|
||||
>
|
||||
关联构件
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</vue-scroll>
|
||||
<el-pagination
|
||||
class="pagerBox"
|
||||
style="position: absolute; top: 85%; left: 40%"
|
||||
@size-change="SizeChange"
|
||||
@current-change="CurrentChange"
|
||||
:current-page="pagInfo.pageNo"
|
||||
:page-sizes="$store.state.PAGESIZRS"
|
||||
:page-size="pagInfo.pageSize"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
:total="Number(pagInfo.total)"
|
||||
background
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 关联构件 -->
|
||||
<el-dialog
|
||||
width="80%"
|
||||
:modal-append-to-body="false"
|
||||
:visible.sync="showRelative"
|
||||
title="关联构件"
|
||||
>
|
||||
<div class="data-show">
|
||||
<span>选中的数据值:</span>
|
||||
<div class="selected-box">
|
||||
<template v-show="selectedList.length > 0">
|
||||
<div v-for="(item, index) in selectedList" :key="index">
|
||||
<span>{{ item ? item.dbId : "" }}</span>
|
||||
<i class="el-icon-close" @click="deleteSelected(index)"></i>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-button type="primary" size="small" @click="saveSelected"
|
||||
>保存</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="model-box">
|
||||
<iframe
|
||||
:src="url"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
id="iframe"
|
||||
style="flex: 1"
|
||||
></iframe>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getTaskProgressPageApi,
|
||||
editProgressBindComponentApi,
|
||||
} from "@/assets/js/api/progressManagement";
|
||||
import {
|
||||
getBimBaseDetailsApi,
|
||||
projectBimBaseListApi,
|
||||
} from "@/assets/js/api/project";
|
||||
export default {
|
||||
mounted() {},
|
||||
data() {
|
||||
return {
|
||||
urn: "",
|
||||
token: "",
|
||||
url: "",
|
||||
iframe: "",
|
||||
selectedList: [],
|
||||
showRelative: false,
|
||||
rowData: {},
|
||||
options: [
|
||||
{
|
||||
label: "未开始",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: "进行中",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: "已完成",
|
||||
value: 2,
|
||||
},
|
||||
// {
|
||||
// label: '已逾期',
|
||||
// value: 3
|
||||
// },
|
||||
],
|
||||
pagInfo: {
|
||||
pageNo: 1, //页数
|
||||
pageSize: 10, //条数
|
||||
total: 0, //总条数
|
||||
},
|
||||
daterange: [],
|
||||
projectSn: "",
|
||||
listData: [],
|
||||
queryInfo: {
|
||||
taskName: "",
|
||||
status: "",
|
||||
actualStartDate: "",
|
||||
actualFinishDate: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.projectSn = this.$store.state.projectSn;
|
||||
this.getProgressListData();
|
||||
},
|
||||
mounted() {
|
||||
this.url = window.location.origin + "/bimBaseProgressModel.html";
|
||||
window.addEventListener("message", this.getIframeMessage);
|
||||
// this.getModelList()
|
||||
},
|
||||
methods: {
|
||||
getIframeMessage(e) {
|
||||
console.log("Message from iframe:", e.data.msg);
|
||||
if (e.data.msg) {
|
||||
let dataIndex = null;
|
||||
dataIndex = this.selectedList.find((item) => {
|
||||
return item.dbId == e.data.msg[0].dbId;
|
||||
});
|
||||
if (!dataIndex) {
|
||||
this.selectedList.push({
|
||||
...e.data.msg[0],
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 保存选中数据
|
||||
saveSelected() {
|
||||
let that = this;
|
||||
editProgressBindComponentApi({
|
||||
id: this.rowData.id,
|
||||
bimComponent: JSON.stringify(this.selectedList),
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("操作成功");
|
||||
that.getProgressListData();
|
||||
that.iframe.contentWindow.postMessage({
|
||||
token: that.token,
|
||||
urn: that.urn,
|
||||
bimComponent: that.selectedList,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除选中数据
|
||||
deleteSelected(index) {
|
||||
this.selectedList.splice(index, 1);
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 关联构件
|
||||
async relativeComponent(row) {
|
||||
let that = this;
|
||||
this.rowData = row;
|
||||
console.log(row);
|
||||
if (row.bimComponent) {
|
||||
this.selectedList = JSON.parse(row.bimComponent);
|
||||
} else {
|
||||
this.selectedList = [];
|
||||
}
|
||||
this.showRelative = true;
|
||||
const res = await getBimBaseDetailsApi({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
});
|
||||
if (res && res.result) {
|
||||
that.token = res.result;
|
||||
}
|
||||
const res2 = await projectBimBaseListApi({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
isEnable: 1,
|
||||
});
|
||||
if (res2.result && res2.result.length > 0) {
|
||||
res2.result.forEach((item, index) => {
|
||||
if (item.isEnable == 1) {
|
||||
item.isEnable = false;
|
||||
that.urn = item.urn;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error("未启用模型");
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.iframe = document.getElementById("iframe");
|
||||
this.iframe.contentWindow.postMessage({
|
||||
token: that.token,
|
||||
urn: that.urn,
|
||||
bimComponent: JSON.parse(row.bimComponent),
|
||||
});
|
||||
});
|
||||
},
|
||||
//获取列表数据
|
||||
getProgressListData() {
|
||||
let data = {
|
||||
projectSn: this.projectSn,
|
||||
pageNo: this.pagInfo.pageNo,
|
||||
pageSize: this.pagInfo.pageSize,
|
||||
taskName: this.queryInfo.taskName,
|
||||
status: this.queryInfo.status,
|
||||
actualFinishDate_begin: this.queryInfo.actualStartDate,
|
||||
actualFinishDate_end: this.queryInfo.actualFinishDate,
|
||||
};
|
||||
getTaskProgressPageApi(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.listData = res.result.records;
|
||||
this.pagInfo.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
//刷新
|
||||
refreshBtn() {
|
||||
this.daterange = [];
|
||||
this.pagInfo.pageNo = 1;
|
||||
this.pagInfo.pageSize = 10;
|
||||
this.queryInfo = {
|
||||
status: "",
|
||||
actualStartDate: "",
|
||||
actualFinishDate: "",
|
||||
taskName: "",
|
||||
};
|
||||
this.getProgressListData();
|
||||
},
|
||||
SizeChange(val) {
|
||||
this.pagInfo.pageSize = val;
|
||||
this.getProgressListData();
|
||||
},
|
||||
CurrentChange(val) {
|
||||
this.pagInfo.pageNo = val;
|
||||
this.getProgressListData();
|
||||
},
|
||||
changeDate() {
|
||||
if (this.daterange) {
|
||||
this.queryInfo.actualStartDate = this.daterange[0];
|
||||
this.queryInfo.actualFinishDate = this.daterange[1];
|
||||
} else {
|
||||
this.queryInfo.actualStartDate = "";
|
||||
this.queryInfo.actualFinishDate = "";
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@mixin flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.table_wrap {
|
||||
height: 800px;
|
||||
overflow: auto;
|
||||
}
|
||||
.data-show {
|
||||
width: max-content;
|
||||
max-width: 100%;
|
||||
@include flex;
|
||||
margin-top: 10px;
|
||||
.selected-box {
|
||||
flex: 1%;
|
||||
min-width: 208px;
|
||||
min-height: 32px;
|
||||
border: 1px solid #c0c4cc;
|
||||
border-radius: 4px;
|
||||
@include flex;
|
||||
flex-wrap: wrap;
|
||||
padding-left: 6px;
|
||||
margin-right: 15px;
|
||||
> div {
|
||||
@include flex;
|
||||
background-color: #f4f4f5;
|
||||
padding: 3px 5px;
|
||||
margin: 3px 6px 3px 0;
|
||||
span {
|
||||
color: #909399;
|
||||
margin-right: 3px;
|
||||
}
|
||||
.el-icon-close {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.model-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
border: 1px solid #ccc;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -195,7 +195,7 @@
|
||||
</div>
|
||||
<!-- 关联构件 -->
|
||||
<el-dialog
|
||||
width="80%"
|
||||
width="80%"
|
||||
:modal-append-to-body="false"
|
||||
:visible.sync="showRelative"
|
||||
title="关联构件"
|
||||
@ -216,22 +216,22 @@
|
||||
</div>
|
||||
<div class="model-box">
|
||||
<iframe
|
||||
:src="url"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
id="iframe"
|
||||
style="flex: 1"
|
||||
:src="url"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
id="iframe"
|
||||
style="flex: 1"
|
||||
></iframe>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script
|
||||
src="https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js"
|
||||
charset="utf-8"
|
||||
></script>
|
||||
<script>
|
||||
import { getTaskProgressPageApi } from "@/assets/js/api/progressManagement";
|
||||
import {
|
||||
getTaskProgressPageApi,
|
||||
editProgressBindComponentApi,
|
||||
} from "@/assets/js/api/progressManagement";
|
||||
import { searchEnableModel } from "@/assets/js/api/project";
|
||||
export default {
|
||||
mounted() {},
|
||||
data() {
|
||||
@ -280,25 +280,64 @@ export default {
|
||||
this.getProgressListData();
|
||||
},
|
||||
mounted() {
|
||||
(this.url = window.location.origin + "./progressModel.html"),
|
||||
(this.iframe = document.getElementById("iframe"));
|
||||
this.iframe.contentWindow.postMessage({
|
||||
token,
|
||||
hideArr: this.selectedHideList,
|
||||
colorArr: this.selectedColorList,
|
||||
});
|
||||
this.url = window.location.origin + "/progressModel.html";
|
||||
window.addEventListener("message", this.getIframeMessage);
|
||||
// this.getModelList()
|
||||
},
|
||||
methods: {
|
||||
getIframeMessage(e) {
|
||||
console.log("Message from iframe:", e.data.msg);
|
||||
if (e.data.msg) {
|
||||
let dataIndex = null;
|
||||
dataIndex = this.selectedList.find((item) => {
|
||||
return item == e.data.msg;
|
||||
});
|
||||
if (!dataIndex) {
|
||||
this.selectedList.push(e.data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 保存选中数据
|
||||
saveSelected() {
|
||||
let that = this;
|
||||
editProgressBindComponentApi({
|
||||
id: this.rowData.id,
|
||||
bimComponent: JSON.stringify(this.selectedList),
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success("操作成功");
|
||||
that.getProgressListData();
|
||||
that.iframe.contentWindow.postMessage({
|
||||
token: res.result.viewToken,
|
||||
bimComponent: that.selectedList,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除选中数据
|
||||
deleteSelected(index) {
|
||||
this.selectedList.splice(index, 1);
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// 关联构件
|
||||
relativeComponent(row) {
|
||||
async relativeComponent(row) {
|
||||
this.rowData = row;
|
||||
console.log(row);
|
||||
if (row.bimComponent) {
|
||||
this.selectedList = JSON.parse(row.bimComponent);
|
||||
} else {
|
||||
this.selectedList = [];
|
||||
}
|
||||
this.showRelative = true;
|
||||
const res = await searchEnableModel({ projectSn: this.projectSn });
|
||||
console.log(res);
|
||||
this.$nextTick(() => {
|
||||
this.iframe = document.getElementById("iframe");
|
||||
this.iframe.contentWindow.postMessage({
|
||||
token: res.result.viewToken,
|
||||
bimComponent: JSON.parse(row.bimComponent),
|
||||
});
|
||||
});
|
||||
},
|
||||
//获取列表数据
|
||||
getProgressListData() {
|
||||
@ -390,10 +429,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.model-box{
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
border: 1px solid #ccc;
|
||||
margin-top: 10px;
|
||||
.model-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
min-height: 500px;
|
||||
border: 1px solid #ccc;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user