dev_xd
姜玉琦 2025-07-28 09:52:52 +08:00
commit 5eba348c3d
43 changed files with 1740 additions and 1032 deletions

View File

@ -1 +1 @@
java -Dfile.encoding=utf-8 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar ruoyi-modules/ruoyi-job/target/yanzhu-modules-job.jar
java -Dfile.encoding=utf-8 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar yanzhu-modules/yanzhu-job/target/yanzhu-modules-job.jar

View File

@ -1,3 +1,5 @@
import bimTools from "./bimTools";
const options = {
taskMapping: {
progress: "percent",
@ -192,6 +194,7 @@ function initEngine(that) {
showAxes: true, // 是否显示XYZ轴线
};
bim4DApi.Plugin.initNavCube(mapOptions);
bimTools.initBimGis(that, bim4DApi)
}
);
}
@ -231,6 +234,7 @@ function initLoadModel(that) {
item.gis = JSON.parse(item.gisJson);
addModel(that, item.lightweightName);
});
bimTools.initLoadModel(that, bim4DApi)
}
});
}
@ -242,7 +246,7 @@ function addModel(that, modelId, cb) {
api.Model.add(
url,
modelId,
() => {},
() => { },
() => {
cb && cb();
console.log("加载模型成功");
@ -255,7 +259,14 @@ function addModel(that, modelId, cb) {
});
}
that.modelLoaded = true;
that.initPlay();
let fnInit = () => {
if (that.planLoaded) {
that.initPlay();
} else {
setTimeout(fnInit, 100);
}
};
fnInit();
}, 1000);
}
);
@ -279,6 +290,7 @@ function showBim(that, index) {
});
}
}
console.log(index, showFeatureIds, currFeatureIds)
if (showFeatureIds.length > 0) {
setFeatueVisible(showFeatureIds, true);
}

View File

@ -0,0 +1,94 @@
function initBimCfg(that) {
if (!that.bimCfg) {
that.bimCfg = {}
}
if (!that.hideParts) {
that.hideParts = [];
}
let config = that.$tryToJson(that.selProject?.bimConfig, {})
that.bimCfg.background = config.background || ''
that.bimCfg.showGis = config.showGis || false
that.bimCfg.clientApi = config.clientApi || false
}
function initBimGis(that, api) {
if (that.bimCfg.showGis) {
api.Public.setGisState(true);
api.Public.setTerrainState(false, "http://113.201.2.107:9304/layer.json", false)
api.Public.setGisState(true);
} else if (that.bimCfg.background) {
api.Public.setGisState(false, that.bimCfg.background);
}
}
function initLoadModel(that, api) {
let fnInit = () => {
if (api.m_model.size > 0) {
setTimeout(() => {
initModelPosition(that, api)
}, 1000)
} else {
setTimeout(fnInit, 1000);
}
}
fnInit();
}
function initModelPosition(that, api) {
that.models.forEach(modelInfo => {
if (modelInfo) {
let modelId = modelInfo.lightweightName
let cfg = that.$tryToJson(modelInfo.bimConfig, {});
let x = cfg?.x || 0;
let y = cfg?.y || 0;
let z = cfg?.z || 0;
let rotateZ = cfg?.rotateZ || 0;
if (x * 1 + y * 1 + z * 1 != 0) {
console.log("移动模型", modelId, x, y, z)
api.Model.moveToPosition([x, y, z], 0, modelId)
}
if (rotateZ * 1 != 0) {
api.Model.rotate(0, 0, rotateZ, modelId)
}
if (cfg && cfg.hideParts) {
cfg.hideParts.forEach(it => {
that.hideParts.push(it);
})
}
setTimeout(() => {
api.Model.location(modelId);
setTimeout(() => {
that.resetScene();
}, 1000);
}, 1000);
}
initHideParts(that, api)
});
}
function initHideParts(that, api) {
let hideCnt = 0;
let hideFn = () => {
hideCnt++;
if (hideCnt > 30) {
return;
}
setTimeout(() => {
let featureIds = (that.hideParts || []).map(it => it.featureId);
if (featureIds.length > 0) {
api.Feature.setVisible(featureIds.join("#"), false);
}
hideFn();
}, 100)
};
hideFn();
}
export default {
initBimCfg,
initBimGis,
initLoadModel,
initModelPosition,
initHideParts
}

View File

@ -73,6 +73,7 @@ import debounce from "lodash.debounce";
import ganttElastic from "gantt-elastic";
import ganttHeader from "gantt-elastic-header";
import bim4DTools from "./bim/bim4DTools";
import bimTools from "./bim/bimTools";
export default {
components: {
@ -98,6 +99,7 @@ export default {
playTime: 500,
showPlan: true,
lastFeatureIds: [],
planLoaded:false,
};
},
beforeDestroy() {
@ -166,6 +168,7 @@ export default {
},
initEngine() {
this.elId++;
bimTools.initBimCfg(this);
setTimeout(() => {
bim4DTools.initEngine(this);
}, 10);
@ -174,11 +177,13 @@ export default {
this.showPlan = !this.showPlan;
},
initPlay() {
if (!bim4DTools.getFirstFeatureId(this)) {
this.$message.error("未配置计划进度,无法播放!");
return;
}
let playIndex = bim4DTools.getCurrentTaskIndex(this);
console.log("--初始化播放---",playIndex)
if (playIndex > 0) {
bim4DTools.preparePlay(this);
this.doPlayPan(playIndex);
@ -211,6 +216,7 @@ export default {
return o;
});
this.hasLoad = true;
this.planLoaded=true;
});
}
},

View File

@ -12,19 +12,10 @@
模型结构树
</div>
<div class="model-tree scroll">
<el-tree
:key="treeKey"
ref="tree"
:default-expanded-keys="treeExpendedKeys"
:props="{
children: 'children',
label: 'title',
}"
node-key="key"
@check="onCheckTree"
:load="loadNode"
lazy
show-checkbox></el-tree>
<el-tree :key="treeKey" ref="tree" :default-expanded-keys="treeExpendedKeys" :props="{
children: 'children',
label: 'title',
}" node-key="key" @check="onCheckTree" :load="loadNode" lazy show-checkbox></el-tree>
</div>
</div>
</div>
@ -119,7 +110,8 @@
<div class="hide-item-state">{{ item.show ? "隐藏" : "显示" }}</div>
<el-switch v-model="item.show" @change="changeSwitch(item)"></el-switch>
<div class="hide-item-id">{{ item.id }}</div>
<div class="hide-item-delete"><i class="el-icon-delete command" @click="deleteFeature(item)" /></div>
<div class="hide-item-delete"><i class="el-icon-delete command" @click="deleteFeature(item)" />
</div>
</div>
</div>
</template>
@ -227,6 +219,8 @@ import debounce from "lodash.debounce";
import { MergeArray, DelArray } from "@/utils/tools";
import briefingTools from "./bim/briefingTools";
import SvgIcon from "@/components/SvgIcon.vue";
import BimTools from './bim/bimTools'
import bimTools from "./bim/bimTools";
export default {
components: { SvgIcon },
name: "BimBriefing",
@ -288,7 +282,7 @@ export default {
});
this.hideFeatureIds = [];
})
.catch(() => {});
.catch(() => { });
},
changeSwitch(item) {
let api = bimBriefingApi;
@ -371,10 +365,10 @@ export default {
},
doSelectMenu(index) {
this.selectMenu = index;
if(index==0){
if (index == 0) {
briefingTools.clearEvent(this);
this.showClipping = false;
briefingTools.clearSelectFeature(this);
briefingTools.clearSelectFeature(this);
}
switch (index) {
case 0:
@ -513,6 +507,7 @@ export default {
this.viewPoint = [];
this.info = [];
this.attributeInformation = "";
bimTools.initBimCfg(this);
setTimeout(() => {
this.loadEngine();
}, 10);
@ -566,11 +561,12 @@ export default {
showAxes: true, // XYZ线
};
bimBriefingApi.Plugin.initNavCube(mapOptions);
bimTools.initBimGis(this, bimBriefingApi)
}
);
},
initLoadModel() {
this.$api.bim.getDefaultViewPoint(this.selProject.id, 1).then((d) => {
this.$api.bim.getDefaultViewPoint(this.selProject.id, 1).then((d) => {
let pt = "";
if (d.data && d.data.length > 0) {
pt = d.data[0].viewPosition;
@ -608,11 +604,12 @@ export default {
}, 3000);
});
this.treeKey++;
bimTools.initLoadModel(this, bimBriefingApi)
}
});
this.init();
},
init() {},
init() { },
loadModelTree() {
this.modelTrees = [
{
@ -675,17 +672,17 @@ export default {
},
addModel(modelId, cb) {
let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
let api=bimBriefingApi
let api = bimBriefingApi
console.log(modelId, url);
api.Model.add(
url,
modelId,
() => {},
() => { },
() => {
cb && cb();
console.log("加载模型成功");
setTimeout(() => {
if (this.viewPoint) {
if (this.viewPoint) {
api.Camera.setViewPort(this.viewPoint);
} else {
api.Camera.getViewPort((p) => {
@ -715,30 +712,37 @@ export default {
.bim-briefing {
height: 100%;
position: relative;
#bimBriefing {
height: 100%;
#bimBriefingContainer {
height: 100%;
}
}
.div-left {
top: 10vh;
left: 5%;
position: absolute;
height: 70vh;
width: 14%;
&.isHide {
left: 0%;
wdith: 0%;
#arrowLeft {
left: 0px !important;
}
}
#arrowLeft {
top: calc(50% - 50px);
right: -21px;
left: unset !important;
}
.div-row {
height: 100%;
}
@ -750,45 +754,56 @@ export default {
position: absolute;
height: 70vh;
width: 14%;
&.isHide {
right: 0%;
width: 0%;
}
#arrowRight {
top: calc(50% - 50px);
left: -21px;
}
.div-row {
&.r33 {
height: 180px;
}
&.r66 {
height: calc(100% - 180px);
}
&.r100 {
height: 100%;
}
}
.clear-all-btn {
margin: 10px;
}
.hide-list {
height: calc(100% - 60px);
overflow-y: auto;
padding: 0px 10px;
.hide-item {
font-size: 12px;
display: flex;
margin-bottom: 8px;
align-items: center;
.hide-item-state {
color: #e4e7edcc;
}
.hide-item-id {
flex-grow: 1;
margin: 0px 10px;
color: #22d3f4;
}
.hide-item-delete {
font-size: 20px;
color: #48f800;
@ -799,14 +814,17 @@ export default {
.data-content {
height: 100%;
.div-row {
border: solid 1px #75fbfdaa;
background-color: #06445b81;
.row-title {
background: linear-gradient(0deg, #105696, #c0dafb00, #1765ae);
padding-left: 10px;
height: 36px;
line-height: 36px;
.svg-icon {
fill: #75fbfd;
}
@ -822,23 +840,28 @@ export default {
display: flex;
background: #00000080;
border-radius: 10px;
.tool-item {
display: flex;
flex-flow: column;
padding: 10px;
align-items: center;
cursor: pointer;
&.is-selected {
.icon {
background: #097fca94;
.svg-icon {
fill: #75fbfd;
}
}
.sp-text {
color: #75fbfd;
}
}
.icon {
width: 30px;
height: 30px;
@ -847,11 +870,13 @@ export default {
justify-content: center;
align-items: center;
border-radius: 15px;
.svg-icon {
width: 20px;
height: 20px;
}
}
.sp-text {
margin-top: 4px;
font-size: 12px;
@ -862,21 +887,26 @@ export default {
.model-tree {
height: calc(100% - 36px);
overflow-y: auto;
.el-tree {
background: transparent;
color: #eee;
.el-checkbox {
color: #45fdfe;
}
.el-tree-node {
&:focus {
& > .el-tree-node__content {
&>.el-tree-node__content {
background: #3489d966;
&:hover {
background: #3489d966;
}
}
}
.el-tree-node__content:hover {
background: #3489d966;
}
@ -888,19 +918,24 @@ export default {
height: calc(100% - 46px);
overflow-y: auto;
padding-bottom: 10px;
.model-property-nav {
text-align: left;
margin: 8px;
}
.model-property-list {
padding: 0px 10px;
}
.info-list {
padding: 10px;
}
}
.model-progress {
padding: 10px;
.el-progress-bar {
.el-progress-bar__innerText {
color: #fff !important;
@ -915,17 +950,22 @@ export default {
text-align: center;
color: #edffff85;
}
.group-info {
padding: 4px 0px;
.svg-icon {
fill: #45fdfe;
}
span {
font-size: 14px;
}
}
.my-table {
border-collapse: collapse;
td,
th {
border: solid 1px #0e0f0f88;
@ -934,19 +974,23 @@ export default {
font-size: 12px;
text-align: left;
}
th {
color: #22d3f4;
}
}
@media (min-width: 2561px) {
.data-content {
.div-row {
&.r33 {
height: 210px;
}
&.r66 {
height: calc(100% - 210px);
}
.row-title {
height: 48px;
line-height: 48px;
@ -954,36 +998,45 @@ export default {
}
}
}
.div-right {
.clear-all-btn {
font-size: 20px;
margin: 12px;
}
.hide-list {
height: calc(100% - 80px);
.hide-item {
font-size: 20px;
margin-bottom: 12px;
.hide-item-delete {
font-size: 24px;
}
}
}
}
.div-tools {
margin-left: -300px;
border-radius: 10px;
.tool-item {
padding: 10px 20px;
.icon {
width: 60px;
height: 60px;
border-radius: 30px;
.svg-icon {
width: 40px;
height: 40px;
}
}
.sp-text {
margin-top: 10px;
font-size: 24px;
@ -994,18 +1047,23 @@ export default {
.model-tree {
.el-tree {
font-size: 24px;
.el-tree-node__content {
height: 36px;
}
.el-tree-node__expand-icon {
font-size: 24px;
}
.el-checkbox {
font-size: 24px;
}
.el-tree-node__label {
font-size: 24px;
}
.el-tree__empty-text {
font-size: 24px;
}
@ -1017,6 +1075,7 @@ export default {
width: 30px;
height: 30px;
}
span {
font-size: 20px;
position: relative;
@ -1025,6 +1084,7 @@ export default {
}
.my-table {
td,
th {
font-size: 20px;

File diff suppressed because it is too large Load Diff

View File

@ -12,20 +12,11 @@
模型结构树
</div>
<div class="model-tree scroll">
<el-tree
:key="treeKey"
ref="tree"
:default-expanded-keys="treeExpendedKeys"
:props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}"
node-key="key"
@check="onCheckTree"
:load="loadNode"
lazy
show-checkbox></el-tree>
<el-tree :key="treeKey" ref="tree" :default-expanded-keys="treeExpendedKeys" :props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}" node-key="key" @check="onCheckTree" :load="loadNode" lazy show-checkbox></el-tree>
</div>
</div>
</div>
@ -43,7 +34,8 @@
</div>
<div class="roaming-list scroll">
<div v-if="roamingLoading" class="loading"></div>
<div v-for="(item, index) in roamingList" :key="index" :class="{ 'is-selected': item.play != 0 }" class="roaming-item">
<div v-for="(item, index) in roamingList" :key="index" :class="{ 'is-selected': item.play != 0 }"
class="roaming-item">
<el-tooltip :content="item.name">
<span class="roam-text">{{ item.name }}</span>
</el-tooltip>
@ -72,7 +64,9 @@
</div>
<div class="view-point-list scroll">
<div v-if="viewPointLoading" class="loading"></div>
<div v-for="(item, index) in viewpointList" :key="index" :class="{ 'is-selected': selectedViewpoint == item }" class="viewpoint-item" @click="ZoomViewpoint(item)">
<div v-for="(item, index) in viewpointList" :key="index"
:class="{ 'is-selected': selectedViewpoint == item }" class="viewpoint-item"
@click="ZoomViewpoint(item)">
<div class="viewpoint-content">
<el-image :src="item.imgPath" alt class="viewpoint-image" fit="scale-down" />
<el-tooltip :content="item.remark" v-if="item.remark">
@ -102,6 +96,7 @@
<script>
import debounce from "lodash.debounce";
import { MergeArray, DelArray } from "@/utils/tools";
import bimTools from './bim/bimTools'
export default {
name: "BIMRoaming",
data() {
@ -377,8 +372,12 @@ export default {
initEngine() {
this.elId++;
this.activeMenu = 0;
bimTools.initBimCfg(this);
setTimeout(() => {
this.loadEngine();
if (this.bimCfg.clientApi) {
} else {
this.loadEngine();
}
}, 10);
},
loadEngine() {
@ -430,6 +429,7 @@ export default {
showAxes: true, // XYZ线
};
bimRoadmApi.Plugin.initNavCube(mapOptions);
bimTools.initBimGis(this, bimRoadmApi)
}
);
},
@ -471,6 +471,9 @@ export default {
}, 3000);
});
this.treeKey++;
bimTools.initLoadModel(this, bimRoadmApi)
}
});
this.init();
@ -586,7 +589,7 @@ export default {
api.Model.add(
url,
modelId,
() => {},
() => { },
() => {
cb && cb();
console.log("加载模型成功");
@ -621,8 +624,10 @@ export default {
.bim-roaming {
height: 100%;
position: relative;
#bimRoaming {
height: 100%;
#bimRoamingContainer {
height: 100%;
}
@ -634,40 +639,49 @@ export default {
position: absolute;
height: 70vh;
width: 14%;
&.isHide {
left: 0%;
wdith: 0%;
#arrowLeft {
left: 0px !important;
}
}
#arrowLeft {
top: calc(50% - 50px);
right: -21px;
left: unset !important;
}
.div-row {
height: 100%;
}
}
.div-right {
top: 10vh;
right: 5%;
position: absolute;
height: 70vh;
width: 14%;
&.isHide {
right: 0%;
width: 0%;
}
#arrowRight {
top: calc(50% - 50px);
left: -21px;
}
.div-row {
&.r33 {
height: 33.33%;
}
&.r66 {
height: 66.66%;
}
@ -676,14 +690,17 @@ export default {
.data-content {
height: 100%;
.div-row {
border: solid 1px #75fbfdaa;
background-color: #06445b81;
.row-title {
background: linear-gradient(0deg, #105696, #c0dafb00, #1765ae);
padding-left: 10px;
height: 36px;
line-height: 36px;
.svg-icon {
fill: #75fbfd;
}
@ -699,23 +716,28 @@ export default {
display: flex;
background: #00000080;
border-radius: 10px;
.tool-item {
display: flex;
flex-flow: column;
padding: 10px;
align-items: center;
cursor: pointer;
&.is-active {
.icon {
background: #097fca94;
.svg-icon {
fill: #75fbfd;
}
}
.sp-text {
color: #75fbfd;
}
}
.icon {
width: 30px;
height: 30px;
@ -724,61 +746,74 @@ export default {
justify-content: center;
align-items: center;
border-radius: 15px;
.svg-icon {
width: 20px;
height: 20px;
}
}
.sp-text {
margin-top: 4px;
font-size: 12px;
}
}
}
.model-tree {
height: calc(100% - 36px);
overflow-y: auto;
.el-tree {
background: transparent;
color: #eee;
.el-checkbox {
color: #75fbfd;
}
.el-tree-node {
&:focus {
& > .el-tree-node__content {
&>.el-tree-node__content {
background: #3489d966;
&:hover {
background: #3489d966;
}
}
}
.el-tree-node__content:hover {
background: #3489d966;
}
}
}
}
.view-point-list {
height: calc(100% - 36px);
overflow-y: auto;
.viewpoint-item {
margin: 10px 10px 0px;
&.is-selected {
.viewpoint-content {
background: #3489d966;
border: solid 1px #75fbfd;
}
}
.viewpoint-content {
position: relative;
border-radius: 4px;
background: #ffffff2e;
.el-image {
height: 120px;
width: 100%;
}
.viewpoint-title {
position: absolute;
bottom: 0px;
@ -796,9 +831,11 @@ export default {
}
}
}
.roaming-list {
height: calc(100% - 36px);
overflow-y: auto;
.roaming-item {
display: flex;
flex-flow: row;
@ -809,9 +846,11 @@ export default {
padding: 0px 10px;
font-size: 14px;
position: relative;
&.is-selected {
background: #00aaff;
}
.roam-text {
color: #fff;
flex-grow: 1;
@ -819,10 +858,12 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.roam-tool {
margin-left: 10px;
display: flex;
align-items: center;
.svg-icon {
margin-right: 5px;
fill: #75fbfd;
@ -830,6 +871,7 @@ export default {
}
}
}
.loading {
height: 50px;
margin: 10px;
@ -838,12 +880,13 @@ export default {
color: #edffff85;
}
@media (max-width: 1920px) {
}
@media (max-width: 1920px) {}
@media (min-width: 2561px) {
.data-content {
.div-row {
min-height: 420px;
.row-title {
height: 48px;
line-height: 48px;
@ -851,20 +894,25 @@ export default {
}
}
}
.div-tools {
margin-left: -68px;
border-radius: 10px;
.tool-item {
padding: 10px 20px;
.icon {
width: 60px;
height: 60px;
border-radius: 30px;
.svg-icon {
width: 40px;
height: 40px;
}
}
.sp-text {
margin-top: 10px;
font-size: 24px;
@ -875,23 +923,29 @@ export default {
.model-tree {
.el-tree {
font-size: 24px;
.el-tree-node__content {
height: 36px;
}
.el-tree-node__expand-icon {
font-size: 24px;
}
.el-checkbox {
font-size: 24px;
}
.el-tree-node__label {
font-size: 24px;
}
.el-tree__empty-text {
font-size: 24px;
}
}
}
.view-point-list {
height: calc(100% - 48px);
@ -900,10 +954,12 @@ export default {
.viewpoint-content {
border-radius: 4px;
.el-image {
height: 160px;
width: 100%;
}
.viewpoint-title {
width: calc(100% - 10px);
line-height: 30px;
@ -915,20 +971,25 @@ export default {
}
}
}
.roaming-list {
height: calc(100% - 48px);
.roaming-item {
margin: 10px;
line-height: 48px;
border-radius: 10px;
padding: 0px 10px;
font-size: 14px;
.roam-text {
max-width: calc(100% - 40px);
font-size: 24px;
}
.roam-tool {
margin-left: 10px;
.svg-icon {
margin-right: 5px;
width: 24px;
@ -937,6 +998,7 @@ export default {
}
}
}
.loading {
font-size: 24px;
}

View File

@ -68,6 +68,16 @@ public class BimModelInfo extends BaseEntity
private String projectName;
private String deptName;
private String bimConfig;
public String getBimConfig() {
return bimConfig;
}
public void setBimConfig(String bimConfig) {
this.bimConfig = bimConfig;
}
public Double getUnit() {
return unit;
}

View File

@ -97,6 +97,16 @@ public class ProPlan extends BaseEntity
@Excel(name = "班组ID")
private Long groupId;
private String noBim;
public String getNoBim() {
return noBim;
}
public void setNoBim(String noBim) {
this.noBim = noBim;
}
/** 班组名称 */
@Excel(name = "班组名称")
private String groupName;

View File

@ -55,10 +55,6 @@ public class ProPlanSchedule extends BaseEntity
@Excel(name = "任务名称")
private String taskName;
/** BIM构建 */
@Excel(name = "BIM构建")
private String bimId;
/** 进度百分比 */
@Excel(name = "进度百分比")
private Long schedulePercent;
@ -184,15 +180,7 @@ public class ProPlanSchedule extends BaseEntity
{
return taskName;
}
public void setBimId(String bimId)
{
this.bimId = bimId;
}
public String getBimId()
{
return bimId;
}
public Double getTaskDuation() {
return taskDuation;
@ -325,7 +313,6 @@ public class ProPlanSchedule extends BaseEntity
.append("taskId", getTaskId())
.append("taskUniqueId", getTaskUniqueId())
.append("taskName", getTaskName())
.append("bimId", getBimId())
.append("schedulePercent", getSchedulePercent())
.append("finishDate", getFinishDate())
.append("description", getDescription())

View File

@ -238,6 +238,19 @@ public class ProProjectInfo extends BaseEntity
@Excel(name = "删除标识")
private Long isDel;
/**
* BIM
*/
private String bimConfig;
public String getBimConfig() {
return bimConfig;
}
public void setBimConfig(String bimConfig) {
this.bimConfig = bimConfig;
}
private ProProjectInfoSetting setting;
private List<ProProjectInfoDepts> projectDeptsList;

View File

@ -91,4 +91,20 @@ public interface ProProjectInfoMapper
* @param sysRoleDept
*/
public void insertProRoleDept(SysRoleDept sysRoleDept);
/**
* BIM
*
* @param id
* @return
*/
public String getProjectBimConfig(Long id);
/**
* BIM
*
* @param proProjectInfo
* @return
*/
public int updateProjectBimConfig(ProProjectInfo proProjectInfo);
}

View File

@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="bimConfig" column="bim_config" />
</resultMap>
<sql id="selectBimModelInfoVo">
@ -35,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sp.dept_name projectName,
sd.dept_name com_name,pd.sub_dept_name dept_name,bmi.unit,
bmi.dept_id, bmi.model_name, bmi.lightweightName, bmi.gis_json, bmi.model_status, bmi.model_type,
bmi.file_type, bmi.file_size, bmi.show_sand, bmi.status, bmi.remark, bmi.create_by, bmi.create_time, bmi.update_by, bmi.update_time,bmi.is_del
bmi.file_type, bmi.file_size, bmi.show_sand, bmi.status, bmi.remark, bmi.create_by, bmi.create_time, bmi.update_by, bmi.update_time,bmi.is_del,bmi.bim_config
from bim_model_info bmi
left join sys_dept sp on sp.dept_id = bmi.project_id
left join sys_dept sd on sd.dept_id = bmi.com_id
@ -117,7 +118,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="modelName != null">model_name = #{modelName},</if>
<if test="lightweightName != null">lightweightName = #{lightweightName},</if>
<if test="gisJson != null">gis_json = #{gisJson},</if>
<if test="modelStatus != null">model_status = #{modelStatus},</if>
<if test="modelType != null">model_type = #{modelType},</if>
@ -132,8 +132,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="bimConfig != null">bim_config = #{bimConfig},</if>
</trim>
where model_id = #{modelId}
where lightweightName = #{lightweightName}
</update>
<delete id="deleteBimModelInfoByModelId" parameterType="Long">

View File

@ -38,10 +38,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nowMonth" column="nowMonth" />
</resultMap>
<sql id="selectProPlanVo">
<sql id="selectProPlanVoNoBim">
select pp.id, pp.comid, pp.project_id, pp.task_id, pp.task_unique_id, pp.parent_id, pp.task_type,
pp.task_outline_level, pp.task_name, pp.task_duation, pp.start_date, pp.finish_date,
pp.predecessors, pp.plan_start_date, pp.plan_finish_date, pp.bim_id, pp.operator, pp.operator_id,
pp.predecessors, pp.plan_start_date, pp.plan_finish_date,
<if test="not (noBim != null and noBim != '')">
pp.bim_id,
</if>
<if test="noBim != null and noBim != ''">
left(ifnull(pp.bim_id,''),10) bim_id,
</if>
pp.operator, pp.operator_id,
pp.group_id, pp.group_name, pp.schedule_node, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
dp.`dept_name` comp_name,pi.`project_name`,
CASE
@ -69,8 +77,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN pro_project_info pi ON pp.`project_id`=pi.`id`
</sql>
<sql id="selectProPlanVo">
select pp.id, pp.comid, pp.project_id, pp.task_id, pp.task_unique_id, pp.parent_id, pp.task_type,
pp.task_outline_level, pp.task_name, pp.task_duation, pp.start_date, pp.finish_date,
pp.predecessors, pp.plan_start_date, pp.plan_finish_date,
pp.bim_id,
pp.operator, pp.operator_id,
pp.group_id, pp.group_name, pp.schedule_node, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
dp.`dept_name` comp_name,pi.`project_name`,
CASE
WHEN pp.start_date IS NULL THEN
'wks'
WHEN pp.start_date IS NOT NULL
AND pp.finish_date IS NOT NULL
AND date(pp.plan_finish_date) <![CDATA[ >= ]]> date(pp.finish_date) THEN
'zcwc'
WHEN pp.start_date IS NOT NULL
AND pp.finish_date IS NOT NULL
AND date(pp.plan_finish_date) <![CDATA[ < ]]> date(pp.finish_date) THEN
'zhwc'
WHEN pp.start_date IS NOT NULL
AND pp.finish_date IS NULL
AND date(pp.plan_finish_date) <![CDATA[ >= ]]> date(NOW()) THEN
'zcjxz'
WHEN pp.start_date IS NOT NULL
AND pp.finish_date IS NULL
AND date(pp.plan_finish_date) <![CDATA[ < ]]> date(NOW()) THEN
'zhjxz'
END AS task_status
from pro_plan pp
LEFT JOIN sys_dept dp ON pp.`comid`=dp.`dept_id`
LEFT JOIN pro_project_info pi ON pp.`project_id`=pi.`id`
</sql>
<select id="selectProPlanList" parameterType="ProPlan" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
<include refid="selectProPlanVoNoBim"/>
<where>
<if test="comid != null "> and pp.comid = #{comid}</if>
<if test="projectId != null "> and pp.project_id = #{projectId}</if>
@ -97,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectProPlanListView" parameterType="ProPlan" resultMap="ProPlanResult">
<include refid="selectProPlanVo"/>
<include refid="selectProPlanVoNoBim"/>
<where>
<if test="comid != null "> and pp.comid = #{comid}</if>
<if test="projectId != null "> and pp.project_id = #{projectId}</if>
@ -280,8 +323,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskName != null and taskName != ''"> concat(#{taskName}, ' / ', task_name) as task_name,</if>
<if test="taskName == null or taskName == ''"> task_name,</if>
task_duation, start_date, finish_date,
predecessors, plan_start_date, plan_finish_date, bim_id, operator, operator_id,
group_id, group_name, schedule_node, is_del from pro_plan
predecessors, plan_start_date, plan_finish_date, operator, operator_id,
<if test="not (noBim != null and noBim != '')">
bim_id,
</if>
group_id, group_name, schedule_node, is_del
from pro_plan
<where>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="taskId != null "> and task_id = #{taskId}</if>

View File

@ -15,7 +15,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="taskId" column="task_id" />
<result property="taskUniqueId" column="task_unique_id" />
<result property="taskName" column="task_name" />
<result property="bimId" column="bim_id" />
<result property="schedulePercent" column="schedule_percent" />
<result property="taskDuation" column="task_duation" />
<result property="planStartDate" column="plan_start_date" />
@ -33,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProPlanScheduleVo">
select pps.id, (select max(mp.id) from pro_plan_schedule mp where mp.project_id = pps.project_id and mp.is_del=0) as max_id, pps.com_id, sd.dept_name as com_name, pps.project_id, pi.project_name, pps.plan_id, pps.task_id, pps.task_unique_id, pps.task_name, pps.bim_id, pps.schedule_percent, pp.task_duation, pp.plan_start_date, pp.plan_finish_date, pps.finish_date, pps.description, pps.images, pps.is_del, pps.create_by, pps.create_user_id, pps.create_date, pps.update_by, pps.update_date, pps.total_schedule
select pps.id, (select max(mp.id) from pro_plan_schedule mp where mp.project_id = pps.project_id and mp.is_del=0) as max_id, pps.com_id, sd.dept_name as com_name, pps.project_id, pi.project_name, pps.plan_id, pps.task_id, pps.task_unique_id, pps.task_name, pps.schedule_percent, pp.task_duation, pp.plan_start_date, pp.plan_finish_date, pps.finish_date, pps.description, pps.images, pps.is_del, pps.create_by, pps.create_user_id, pps.create_date, pps.update_by, pps.update_date, pps.total_schedule
from pro_plan_schedule pps
left join pro_project_info pi on pi.id = pps.project_id
left join sys_dept sd on sd.dept_id = pps.com_id
@ -52,7 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskId != null "> and pps.task_id = #{taskId}</if>
<if test="taskUniqueId != null and taskUniqueId != ''"> and pps.task_unique_id = #{taskUniqueId}</if>
<if test="taskName != null and taskName != ''"> and pps.task_name like concat('%', #{taskName}, '%')</if>
<if test="bimId != null and bimId != ''"> and pps.bim_id = #{bimId}</if>
<if test="isDel != null "> and pps.is_del = #{isDel}</if>
<if test="createUserId != null "> and pps.create_user_id = #{createUserId}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(pps.create_date) between #{params.beginTime} and #{params.endTime}</if>
@ -76,7 +74,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskId != null">task_id,</if>
<if test="taskUniqueId != null">task_unique_id,</if>
<if test="taskName != null">task_name,</if>
<if test="bimId != null">bim_id,</if>
<if test="schedulePercent != null">schedule_percent,</if>
<if test="finishDate != null">finish_date,</if>
<if test="description != null">description,</if>
@ -96,7 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskId != null">#{taskId},</if>
<if test="taskUniqueId != null">#{taskUniqueId},</if>
<if test="taskName != null">#{taskName},</if>
<if test="bimId != null">#{bimId},</if>
<if test="schedulePercent != null">#{schedulePercent},</if>
<if test="finishDate != null">#{finishDate},</if>
<if test="description != null">#{description},</if>
@ -120,7 +116,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskId != null">task_id = #{taskId},</if>
<if test="taskUniqueId != null">task_unique_id = #{taskUniqueId},</if>
<if test="taskName != null">task_name = #{taskName},</if>
<if test="bimId != null">bim_id = #{bimId},</if>
<if test="schedulePercent != null">schedule_percent = #{schedulePercent},</if>
<if test="finishDate != null">finish_date = #{finishDate},</if>
<if test="description != null">description = #{description},</if>

View File

@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="projectStatus" column="project_status" />
<result property="projectSort" column="project_sort" />
<result property="isDel" column="is_del" />
<result property="bimConfig" column="bim_config" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -82,7 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectProProjectInfoVo">
select pi.id, pi.com_id, sd.dept_name as com_name, pi.dis_dept_id, pi.project_name, pi.project_code,
pi.tech_leader,pi.tech_leader_phone,pi.province,pi.city,pi.district,
pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status, pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark
pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_package, pi.project_address, pi.project_nature, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status, pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time
, pi.remark,pi.bim_config
from pro_project_info pi
left join sys_dept sd on sd.dept_id = pi.com_id
</sql>
@ -123,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time,
pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status,
pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark,
pd.id pd_id,pd.dept_type pd_type,pd.dept_name pd_name,pd.dept_code pd_code,pd.leader pd_leader,pd.phone pd_phone,
pd.id pd_id,pd.dept_type pd_type,pd.dept_name pd_name,pd.dept_code pd_code,pd.leader pd_leader,pd.phone pd_phone,pi.bim_config,
ps.id ps_id,ps.org_name ps_org_name,ps.org_logo ps_org_logo,ps.org_image ps_org_image,ps.org_video ps_org_video,ps.org_plane ps_org_plane,ac.vendors_code
from pro_project_info pi
left join sys_dept sd on sd.dept_id = pi.com_id
@ -396,7 +398,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment,
pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time,
pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status,
pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark,
pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark,pi.bim_config,
ps.id ps_id,ps.org_name ps_org_name,ps.org_logo ps_org_logo,ps.org_image ps_org_image,ps.org_video ps_org_video,ps.org_plane ps_org_plane,cfg.vendors_code
from pro_project_info pi
left join pro_project_info_setting ps on pi.id=ps.project_id
@ -429,4 +431,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="currentUserId != null "> order by psu.sort_by, pi.id desc</if>
</select>
<select id="getProjectBimConfig" parameterType="Long" resultType="String">
select bim_config from pro_project_info where id = #{id}
</select>
<update id="updateProjectBimConfig" parameterType="ProProjectInfo">
update pro_project_info set bim_config = #{bimConfig} where id = #{id}
</update>
</mapper>

View File

@ -1,173 +0,0 @@
package com.yanzhu.job.domain;
import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sys_apply_config
*
* @author JiangYuQi
* @date 2024-01-13
*/
public class SysApplyConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 服务配置主键 */
private Long cfgId;
/** 服务配置类型 */
private String cfgType;
/** 应用主键 */
@Excel(name = "应用主键")
private String appId;
/** 公钥 */
private String publicKey;
/** 私钥 */
private String privateKey;
/** 项目主键 */
@Excel(name = "项目主键")
private Long projectId;
/** 项目名称 */
@Excel(name = "项目名称")
private String projectName;
/** 部门主键 */
@Excel(name = "部门主键")
private Long deptId;
/** 部门名称 */
@Excel(name = "部门名称")
private String deptName;
/** 是否删除 */
@Excel(name = "是否删除")
private String isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAppId(String appId)
{
this.appId = appId;
}
public String getAppId()
{
return appId;
}
public void setPublicKey(String publicKey)
{
this.publicKey = publicKey;
}
public String getPublicKey()
{
return publicKey;
}
public void setPrivateKey(String privateKey)
{
this.privateKey = privateKey;
}
public String getPrivateKey()
{
return privateKey;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Long getCfgId() {
return cfgId;
}
public void setCfgId(Long cfgId) {
this.cfgId = cfgId;
}
public String getCfgType() {
return cfgType;
}
public void setCfgType(String cfgType) {
this.cfgType = cfgType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("cfgId", getCfgId())
.append("cfgType", getCfgType())
.append("appId", getAppId())
.append("publicKey", getPublicKey())
.append("privateKey", getPrivateKey())
.append("projectId", getProjectId())
.append("deptId", getDeptId())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -1,62 +0,0 @@
package com.yanzhu.job.mapper;
import com.yanzhu.job.domain.SysApplyConfig;
import java.util.List;
/**
* Mapper
*
* @author JiangYuQi
* @date 2024-01-13
*/
public interface SysApplyConfigMapper
{
/**
*
*
* @param id
* @return
*/
public SysApplyConfig selectSysApplyConfigById(Long id);
/**
*
*
* @param sysApplyConfig
* @return
*/
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
/**
*
*
* @param sysApplyConfig
* @return
*/
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
/**
*
*
* @param sysApplyConfig
* @return
*/
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
/**
*
*
* @param id
* @return
*/
public int deleteSysApplyConfigById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteSysApplyConfigByIds(Long[] ids);
}

View File

@ -1,67 +0,0 @@
package com.yanzhu.job.service;
import com.yanzhu.job.domain.SysApplyConfig;
import java.util.List;
/**
* Service
*
* @author JiangYuQi
* @date 2024-01-13
*/
public interface ISysApplyConfigService
{
/**
*
*
* @param id
* @return
*/
public SysApplyConfig selectSysApplyConfigById(Long id);
/**
*
*
* @param sysApplyConfig
* @return
*/
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig);
/**
*
*
* @param sysApplyConfig
* @return
*/
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig);
/**
*
*
* @param sysApplyConfig
* @return
*/
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig);
/**
*
*
* @param ids
* @return
*/
public int deleteSysApplyConfigByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteSysApplyConfigById(Long id);
/**
*
*/
public void loadingSysApplyConfigCache();
}

View File

@ -1,161 +0,0 @@
package com.yanzhu.job.service.impl;
import com.yanzhu.common.core.constant.CacheConstants;
import com.yanzhu.common.core.exception.ServiceException;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.RSAUtil;
import com.yanzhu.common.redis.service.RedisService;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.job.domain.SysApplyConfig;
import com.yanzhu.job.mapper.SysApplyConfigMapper;
import com.yanzhu.job.service.ISysApplyConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.security.KeyPair;
import java.util.List;
/**
* Service
*
* @author JiangYuQi
* @date 2024-01-13
*/
@Service
public class SysApplyConfigServiceImpl implements ISysApplyConfigService
{
@Autowired
private RedisService redisCache;
@Autowired
private SysApplyConfigMapper sysApplyConfigMapper;
/**
*
*/
@PostConstruct
public void init()
{
loadingSysApplyConfigCache();
}
/**
*
*/
@Override
public void loadingSysApplyConfigCache()
{
List<SysApplyConfig> configList = sysApplyConfigMapper.selectSysApplyConfigList(new SysApplyConfig());
if(CollectionUtils.isNotEmpty(configList)){
for (SysApplyConfig sysApplyConfig : configList) {
redisCache.setCacheObject(CacheConstants.YANZHU_SYSTEM_CONFIG + sysApplyConfig.getAppId(), sysApplyConfig);
}
}
}
/**
*
*
* @param id
* @return
*/
@Override
public SysApplyConfig selectSysApplyConfigById(Long id)
{
return sysApplyConfigMapper.selectSysApplyConfigById(id);
}
/**
*
*
* @param sysApplyConfig
* @return
*/
@Override
public List<SysApplyConfig> selectSysApplyConfigList(SysApplyConfig sysApplyConfig)
{
return sysApplyConfigMapper.selectSysApplyConfigList(sysApplyConfig);
}
/**
*
*
* @param sysApplyConfig
* @return
*/
@Override
public int insertSysApplyConfig(SysApplyConfig sysApplyConfig)
{
sysApplyConfig.setCreateBy(SecurityUtils.getUsername());
sysApplyConfig.setCreateTime(DateUtils.getNowDate());
try {
// 生成密钥对
KeyPair keyPair = RSAUtil.getKeyPair();
// 公匙
String publicKey = RSAUtil.getPublicKeyBase64(keyPair);
sysApplyConfig.setPublicKey(publicKey);
// 私匙
String privateKey = RSAUtil.getPrivateKeyBase64(keyPair);
sysApplyConfig.setPrivateKey(privateKey);
}catch (Exception e){
throw new ServiceException();
}
int res = sysApplyConfigMapper.insertSysApplyConfig(sysApplyConfig);
if(res>0){
this.loadingSysApplyConfigCache();
}
return res;
}
/**
*
*
* @param sysApplyConfig
* @return
*/
@Override
public int updateSysApplyConfig(SysApplyConfig sysApplyConfig)
{
sysApplyConfig.setUpdateBy(SecurityUtils.getUsername());
sysApplyConfig.setUpdateTime(DateUtils.getNowDate());
int res = sysApplyConfigMapper.updateSysApplyConfig(sysApplyConfig);
if(res>0){
this.loadingSysApplyConfigCache();
}
return res;
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSysApplyConfigByIds(Long[] ids)
{
int res = sysApplyConfigMapper.deleteSysApplyConfigByIds(ids);
if(res>0){
this.loadingSysApplyConfigCache();
}
return res;
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSysApplyConfigById(Long id)
{
int res = sysApplyConfigMapper.deleteSysApplyConfigById(id);
if(res>0){
this.loadingSysApplyConfigCache();
}
return res;
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.job.mapper.SysApplyConfigMapper">
<resultMap type="com.yanzhu.job.domain.SysApplyConfig" id="SysApplyConfigResult">
<result property="id" column="id" />
<result property="cfgType" column="cfg_type" />
<result property="cfgId" column="cfg_id" />
<result property="appId" column="app_id" />
<result property="publicKey" column="public_key" />
<result property="privateKey" column="private_key" />
<result property="projectId" column="project_id" />
<result property="projectName" column="projectName" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="deptName" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysApplyConfigVo">
select sac.id, sac.cfg_type, sac.cfg_id, sac.app_id, sac.public_key, sac.private_key, sac.project_id, sp.project_name, sac.dept_id, sd.dept_name as deptName, sac.is_del, sac.create_by, sac.create_time, sac.update_by, sac.update_time, sac.remark from sys_apply_config sac
left join pro_project_info sp on sac.project_id = sp.id
left join sys_dept sd on sac.dept_id = sd.dept_id
</sql>
<select id="selectSysApplyConfigList" parameterType="com.yanzhu.job.domain.SysApplyConfig" resultMap="SysApplyConfigResult">
<include refid="selectSysApplyConfigVo"/>
<where>
<if test="cfgId != null "> and sac.cfg_id = #{cfgId}</if>
<if test="cfgType != null "> and sac.cfg_type = #{cfgType}</if>
<if test="appId != null "> and sac.app_id like concat('%', #{appId}, '%')</if>
<if test="projectName != null "> and sp.project_name like concat('%', #{projectName}, '%')</if>
<if test="deptName != null "> and sd.dept_name like concat('%', #{deptName}, '%')</if>
<if test="isDel != null and isDel != ''"> and sac.is_del = #{isDel}</if>
</where>
order by sac.id desc
</select>
<select id="selectSysApplyConfigById" parameterType="Long" resultMap="SysApplyConfigResult">
<include refid="selectSysApplyConfigVo"/>
where sac.id = #{id}
</select>
<insert id="insertSysApplyConfig" parameterType="com.yanzhu.job.domain.SysApplyConfig">
insert into sys_apply_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="cfgType != null">cfg_type,</if>
<if test="cfgId != null">cfg_id,</if>
<if test="appId != null">app_id,</if>
<if test="publicKey != null">public_key,</if>
<if test="privateKey != null">private_key,</if>
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="cfgType != null">#{cfgType},</if>
<if test="cfgId != null">#{cfgId},</if>
<if test="appId != null">#{appId},</if>
<if test="publicKey != null">#{publicKey},</if>
<if test="privateKey != null">#{privateKey},</if>
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysApplyConfig" parameterType="com.yanzhu.job.domain.SysApplyConfig">
update sys_apply_config
<trim prefix="SET" suffixOverrides=",">
<if test="cfgType != null">cfg_type = #{cfgType},</if>
<if test="cfgId != null">cfg_id = #{cfgId},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="publicKey != null">public_key = #{publicKey},</if>
<if test="privateKey != null">private_key = #{privateKey},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysApplyConfigById" parameterType="Long">
delete from sys_apply_config where id = #{id}
</delete>
<delete id="deleteSysApplyConfigByIds" parameterType="String">
delete from sys_apply_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -220,10 +220,11 @@ public class ProPlanController extends BaseController
*
*/
@GetMapping(value = "/findPlanDatas/{proId}")
public AjaxResult findPlanDatas(@PathVariable("proId") Long proId)
public AjaxResult findPlanDatas(@PathVariable("proId") Long proId,String noBim)
{
ProPlan planQuery = new ProPlan();
planQuery.setProjectId(proId);
planQuery.setNoBim(noBim);
List<ProPlan> proPlans = proPlanService.findPlanDatas(planQuery);
return success(proPlans);
}

View File

@ -151,4 +151,16 @@ public class ProProjectInfoController extends BaseController
return getDataTable(list);
}
@GetMapping("/getProjectBimConfig/{id}")
public AjaxResult getProjectBimConfig(@PathVariable("id") Long id)
{
return success(proProjectInfoService.getProjectBimConfig(id));
}
@PostMapping("/updateProjectBimConfig")
public AjaxResult updateProjectBimConfig(@RequestBody ProProjectInfo proProjectInfo)
{
return toAjax(proProjectInfoService.updateProjectBimConfig(proProjectInfo));
}
}

View File

@ -77,4 +77,18 @@ public interface IProProjectInfoService
* @return
*/
public List<ProProjectInfo> selectMyProjectList(com.yanzhu.manage.domain.ProProjectInfo proProjectInfo);
/**
* BIM
* @param id
* @return
*/
String getProjectBimConfig(Long id);
/**
* BIM
* @param proProjectInfo
* @return
*/
int updateProjectBimConfig(ProProjectInfo proProjectInfo);
}

View File

@ -42,7 +42,7 @@ import java.util.stream.Collectors;
* @date 2024-08-25
*/
@Service
public class ProProjectInfoServiceImpl implements IProProjectInfoService
public class ProProjectInfoServiceImpl implements IProProjectInfoService
{
@Autowired
private WxMaService wxMaService;
@ -100,6 +100,28 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
return proProjectInfoMapper.selectMyProjectList(proProjectInfo);
}
/**
* BIM
*
* @param id
* @return
*/
@Override
public String getProjectBimConfig(Long id) {
return proProjectInfoMapper.getProjectBimConfig(id);
}
/**
* BIM
*
* @param proProjectInfo
* @return
*/
@Override
public int updateProjectBimConfig(ProProjectInfo proProjectInfo) {
return proProjectInfoMapper.updateProjectBimConfig(proProjectInfo);
}
/**
*
*

View File

@ -20,6 +20,13 @@
<script src="/cdn/echarts/echarts.min.js"></script>
<script src="/cdn/bim/sapi/BIMGISEngine.js"></script>
<script src="/cdn/bim/sapi/config.js?v=20240415"></script>
<link rel="stylesheet" href="/cesium/Widgets/widgets.css" />
<!-- <script src="/cesium/jquery-3.0.0.min.js"></script> -->
<script src="/cesium/Cesium.js?v=20230913"></script>
<script src="/cesium/BIMGISEngine-min.js?v=20230920"></script>
<script src="/cesium/initApi.js?v=20230920"></script>
<!--[if lt IE 11
]><script>
window.location.href = "/html/ie.html";

View File

@ -52,9 +52,9 @@ export function findOnlyPlan(proId) {
}
// 查询计划管理
export function findPlanDatas(proId) {
export function findPlanDatas(proId,noBim) {
return request({
url: '/manage/plan/findPlanDatas/' + proId,
url: '/manage/plan/findPlanDatas/' + proId+"?noBim="+(noBim||''),
method: 'get'
})
}

View File

@ -50,4 +50,24 @@ export function delProProjectInfo(id) {
url: '/manage/proProjectInfo/' + id,
method: 'delete'
})
}
// 获取项目BIM配置信息
export function getProjectBimConfig(id){
return request({
url: '/manage/proProjectInfo/getProjectBimConfig/'+id,
method: 'get'
})
}
// 获取项目BIM配置信息
export function updateProjectBimConfig(id,data){
return request({
url: '/manage/proProjectInfo/updateProjectBimConfig',
method: 'post',
data: {
id:id,
bimConfig:JSON.stringify(data)
}
})
}

View File

@ -42,8 +42,8 @@ export default {
openStatus: 2,
},
form: {
longitude: '108.88',
latitude: '34.2',
longitude: '34.2',
latitude: '108.88',
},
formRules: {
longitude: [{ required: true, message: '请输入经度值' }],

View File

@ -0,0 +1,75 @@
<template>
<el-dialog title="项目BIM设置" width="300" :modal-append-to-body="false" :close-on-click-modal="false" v-model="show"
class="bim-config-dialog footer-center noscroll">
<el-form ref="form" :model="cfg" label-width="120px">
<el-form-item label="是否显示GIS" prop="showGis">
<el-switch v-model="cfg.showGis" active-text="是" inactive-text="否"></el-switch>
</el-form-item>
<el-form-item label="背景色" prop="background" v-show="!cfg.showGis" :key="cfg.showGis">
<el-color-picker v-model="cfg.background" show-alpha />
</el-form-item>
<el-form-item label="客户端渲染" prop="clientApi">
<el-switch v-model="cfg.clientApi" active-text="是" inactive-text="否"></el-switch>
</el-form-item>
</el-form>
<div class="footer-btn" style="text-align: center;">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="onCancel"></el-button>
</div>
</el-dialog>
</template>
<script>
import useUserStore from "@/store/modules/user";
import { getProjectBimConfig,updateProjectBimConfig } from "@/api/manage/proProjectInfo.js";
export default {
data() {
return {
show: false,
currentPrjId: null,
cfg:{
showGis:false,
background:"",
clientApi:false,
}
}
},
methods: {
onSubmit(){
this.$modal.confirm("确定保存吗?").then(() => {
updateProjectBimConfig(this.currentPrjId,{
showGis:this.cfg.showGis,
background:this.cfg.background,
clientApi:this.cfg.clientApi,
}).then(res=>{
this.$message.success("保存成功");
this.show=false;
})
})
},
onCancel(){
this.show=false;
},
showDialog() {
this.userStore = useUserStore();
this.currentPrjId = this.userStore.currentPrjId;
this.show = true
this.loadData();
},
loadData(){
getProjectBimConfig(this.currentPrjId).then(d=>{
if(d.msg){
let config=this.$tryToJson(d.msg,{});
this.cfg.background=config.background||"";
this.cfg.showGis=config.showGis||false;
this.cfg.clientApi=config.clientApi||false;
}
})
}
}
}
</script>
<style></style>

View File

@ -24,6 +24,7 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" v-if="data.isAdmin" @click="handleAdd"></el-button>
<el-button type="primary" plain icon="Plus" v-if="data.isAdmin" @click="handleUpload"></el-button>
<el-button type="primary" plain icon="Plus" v-if="data.isAdmin" @click="doBimConfig">BIM</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -101,6 +102,7 @@
<modelSelectDialog ref="selDlg" @select="doModelSelect" />
<uploadModelDialog ref="uploadDlg" />
<modelDialog ref="mDlg"></modelDialog>
<bimConfigDialog ref="configDlg"></bimConfigDialog>
</div>
</template>
@ -113,6 +115,7 @@ import { onMounted } from "vue";
import modelSelectDialog from "./modelSelectDialog.vue";
import uploadModelDialog from "./uploadModelDialog.vue";
import modelDialog from "./modelDialog2.vue";
import bimConfigDialog from "./bimConfigDialog.vue";
import { fileSize } from "@/utils";
const { proxy } = getCurrentInstance();
const unitInfos = [
@ -137,6 +140,7 @@ const title = ref("");
const selDlg = ref();
const uploadDlg = ref();
const mDlg = ref();
const configDlg = ref();
const data = reactive({
form: {},
queryParams: {
@ -167,6 +171,10 @@ const data = reactive({
});
const { queryParams, form, rules } = toRefs(data);
function doBimConfig(){
configDlg.value.showDialog();
}
function showModel(row) {
mDlg.value.showDialog(JSON.parse(row.gisJson));
}

View File

@ -398,8 +398,8 @@ export default {
if (that.srs.split(":").length == 2) {
let current = that.srs.split(":")[1].split(",");
if (current.length == 2) {
_paras.longitude = (Math.PI / 180) * current[1];
_paras.latitude = (Math.PI / 180) * current[0];
_paras.longitude = (Math.PI / 180) * current[0];
_paras.latitude = (Math.PI / 180) * current[1];
}
}
}
@ -437,6 +437,7 @@ export default {
// _paras.draco = that.draco;
// _paras.compressionLevel = values.compressionLevel;
_paras.isLod = that.isLod;
_paras.srs = ""
if (_paras.isLod) {
_paras.lodNAryTreeXYZ = [
that.modelValue.xCount,

View File

@ -0,0 +1,165 @@
<template>
<div class="hide-features">
<div style="padding: 0px 10px 10px" v-show="hideParts.length > 0">
<el-button @click="delAllDelList"></el-button>
<el-button @click="doSaveHide"></el-button>
</div>
<div class="sel-list scroll hide-list" :key="hideEl">
<div v-for="(it, idx) in hideParts" :key="idx" class="div-sel-item">
<el-tooltip placement="bottom" :content="it.info">
<div class="sel-item-info">{{ it.info }}</div>
</el-tooltip>
<el-button link @click="delHideItem(idx)"></el-button>
</div>
</div>
</div>
</template>
<script>
import {
getModelFeatureInfos,updateBimModel
} from "@/api/bim/bimModel";
export default {
props: {
me: {
type: Object,
default: () => ({}),
},
},
data() {
return {
hideParts: [],
hideEl: 0,
}
},
watch:{
hideParts(val){
this.me.hideParts=val;
}
},
methods: {
doSaveHide(){
this.$modal.confirm("确定保存吗?").then(() => {
let obj={};
this.hideParts.forEach(it=>{
let modelId=it.modelId;
if(!obj[modelId]){
obj[modelId]=[];
}
obj[modelId].push({
featureId:it.featureId,
externalId:it.externalId,
modelId:it.modelId,
info:it.info
});
})
for(let modelId in obj){
let modelInfo=this.me.models.find(it=>it.modelId==modelId);
if(modelInfo){
modelInfo.bimCfg.hideParts=obj[modelId];
modelInfo.bimConfig=JSON.stringify(modelInfo.bimCfg);
updateBimModel(modelInfo).then(res => {
this.$message.success("保存成功");
});
}
}
});
},
delAllDelList() {
this.$modal.confirm("确定删除吗?").then(() => {
api.Feature.setVisible(this.hideParts.map(it => it.featureId).join("#"), true);
this.hideParts = [];
this.hideEl++;
});
},
delHideItem(idx) {
api.Feature.setVisible(this.hideParts[idx].featureId, true);
this.hideParts.splice(idx, 1);
},
doHideFeatures(hideParts) {
let that = this;
this.hideParts=hideParts||[];
api.Public.clearHandler();
api.Feature.getByEvent(false);
api.Feature.getByEvent(true, async (n) => {
if (n && n["id"]) {
let featureId = n.id;
let datas = await that.getServerFeatureInfos(that, [featureId]);
datas.forEach(it => {
that.hideParts.push(it);
});
//that.hideParts.push(featureId);
api.Feature.setVisible(featureId, false);
that.hideEl++;
}
});
},
async getServerFeatureInfos(that, ids) {
if (ids.length == 0) {
return;
}
let tmps = ids[0].split("^");
if (tmps.length < 2) {
return;
}
let modelId = tmps[0];
let externalIds = ids.map((it) => it.split("^")[1]);
let res = await getModelFeatureInfos(modelId, externalIds);
return (res.data || []).map((o) => {
o = this.convertFeatureInfo(o, modelId);
return o;
});
},
convertFeatureInfo(o, modelId) {
o.modelId = modelId;
o.featureId = o.modelId + "^" + o.externalId;
o.name = o.name || "";
o.name = o.name.replaceAll('"', "").replaceAll("'", "").replaceAll("\\", "");
o.info = `[${o.externalId}]${o.groupname}-${o.name}`;
return o;
}
}
}
</script>
<style lang="scss">
.hide-features {
padding: 0px 0px 20px;
height: 80vh;
.sel-list {
padding: 0px 10px 10px;
height: 100%;
overflow-y: auto;
&.hide-list {
height: calc(100% - 40px);
}
.div-sel-item {
background-color: #f7f7f975;
position: relative;
color: #555;
line-height: 30px;
padding: 0px 10px;
margin-top: 5px;
.sel-item-info {
width: calc(100% - 40px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.el-button {
position: absolute;
right: 10px;
top: 4px;
color: #f40606;
}
}
}
}
</style>

View File

@ -10,19 +10,11 @@
</span>
</div>
<div class="scroll-box model-tree">
<el-tree
:key="treeKey"
ref="tree"
:props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}"
node-key="key"
@check="onCheckTree"
:load="loadNode"
lazy
show-checkbox></el-tree>
<el-tree :key="treeKey" ref="tree" :props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}" node-key="key" @check="onCheckTree" :load="loadNode" lazy show-checkbox></el-tree>
</div>
</div>
</template>
@ -31,6 +23,10 @@
import { getModelTree, getTreeAllLeafChild } from "@/api/bim/bimModel";
export default {
props: {
me: {
type: Object,
default: () => ({}),
},
projectMessage: {
type: Object,
default: undefined,
@ -89,7 +85,7 @@ export default {
});
});
this.expandedKeys = ["root"];
this.$nextTick(() => {});
this.$nextTick(() => { });
},
methods: {
loadNode(node, resolve) {
@ -148,7 +144,6 @@ export default {
let o = this.convertFeatureInfo(it, data.modelId);
return o;
});
//addToAllFeatures(that, tmps);
resolve(tmps);
});
},
@ -194,12 +189,34 @@ export default {
api.Model.add(
url,
modelId,
() => {},
() => {
console.log("加载模型成功2");
},
() => {
console.log("加载模型成功");
let modelInfo = this.projectMessage.find(m => m.modelId == modelId);
if (modelInfo) {
let cfg = modelInfo.bimCfg;
let x = cfg?.x || 0;
let y = cfg?.y || 0;
let z = cfg?.z || 0;
let rotateZ = cfg?.rotateZ || 0;
if (x * 1 + y * 1 + z * 1 != 0) {
api.Model.moveToPosition([x, y, z], 0, modelId)
}
if (rotateZ * 1 != 0) {
api.Model.rotate(0, 0, rotateZ, modelId)
}
if (cfg && cfg.hideParts) {
cfg.hideParts.forEach(it => {
this.me.hideParts.push(it);
})
}
}
cb && cb();
this.$emit("change");
setTimeout(() => {
api.Model.location(modelId);
if (this.$parent.viewPoint) {
api.Camera.setViewPort(this.$parent.viewPoint);
} else {
@ -207,6 +224,22 @@ export default {
this.$emit("modelAdd", p);
});
}
let hideCnt = 0;
let hideFn = () => {
hideCnt++;
if(hideCnt>30){
return;
}
setTimeout(() => {
let featureIds = (this.me.hideParts || []).map(it => it.featureId);
if (featureIds.length > 0) {
console.log(featureIds.join("#"))
api.Feature.setVisible(featureIds.join("#"), false);
}
hideFn();
}, 100)
};
hideFn();
}, 1000);
}
);
@ -235,16 +268,24 @@ export default {
return;
}
if (checkNode.type == "model") {
if (checked) {
api.Model.setVisible(checkNode.modelId, true);
api.Model.original(checkNode.modelId);
this.projectMessage.find((mm) => mm.modelId == checkNode.modelId).visible = true;
this.$emit("change");
} else {
api.Model.setVisible(checkNode.modelId, false);
this.projectMessage.find((mm) => mm.modelId == checkNode.modelId).visible = false;
this.$emit("change");
let func = () => {
if (checked) {
api.Model.setVisible(checkNode.modelId, true);
api.Model.original(checkNode.modelId);
this.projectMessage.find((mm) => mm.modelId == checkNode.modelId).visible = true;
this.$emit("change");
} else {
api.Model.setVisible(checkNode.modelId, false);
this.projectMessage.find((mm) => mm.modelId == checkNode.modelId).visible = false;
this.$emit("change");
}
}
if (!api.m_model.has(checkNode.modelId)) {
this.addModel(checkNode.modelId, func);
} else {
func();
}
return;
}
this.showItem(checkNode, event);
@ -324,33 +365,41 @@ export default {
left: 20px;
color: #fff;
background: #274754;
&.hide-tree {
height: 50px;
.ant-tree {
display: none;
}
}
.nav-header {
border-bottom: solid 1px #fff;
line-height: 40px;
padding: 0px 10px;
position: relative;
.title {
color: rgb(0, 255, 212);
font-weight: bold;
}
.toolbar {
position: absolute;
right: 10px;
.el-icon {
cursor: pointer;
}
}
}
.ant-tree {
background: transparent;
color: #fff;
}
.scroll-box {
margin-top: 15px;
height: 64vh;
@ -379,6 +428,7 @@ export default {
.ant-tree-node-content-wrapper {
color: #ffffff;
white-space: nowrap;
&.ant-tree-node-selected {
background: #409eff54 !important;
}
@ -389,24 +439,30 @@ export default {
text-align: left;
}
}
.model-tree {
height: calc(100% - 60px);
overflow-y: auto;
.el-tree {
background: transparent;
color: #eee;
.el-checkbox {
color: #45fdfe;
}
.el-tree-node {
&:focus {
& > .el-tree-node__content {
&>.el-tree-node__content {
background: #3489d966;
&:hover {
background: #3489d966;
}
}
}
.el-tree-node__content:hover {
background: #3489d966;
}

View File

@ -0,0 +1,194 @@
<template>
<div class="move-model">
<el-form ref="form" :model="form" label-width="40px">
<div class="move-button">
<el-button type="primary" @click="doModelMove">
<svg-icon icon-class="position" /> 在地图上移动模型
</el-button>
</div>
<div class="nav-title">位置
</div>
<el-form-item label="经度">
<el-input v-model="form.x"></el-input>
</el-form-item>
<el-form-item label="纬度">
<el-input v-model="form.y"></el-input>
</el-form-item>
<el-form-item label="高度">
<el-input v-model="form.z"></el-input>
</el-form-item>
<div class="button-group">
<el-button type="primary" @click="updatePosition"></el-button>
</div>
<div class="nav-title">旋转</div>
<el-form-item label="绕X轴">
<el-slider v-model="form.rotateZ" :min="-180" :max="180"></el-slider>
<el-input-number v-model="form.rotateZ" placeholder="请输入旋转角度" :min="-180" :max="180"></el-input-number>
</el-form-item>
<div class="button-group">
<el-button type="primary" @click="updateRotate"></el-button>
</div>
<div class="footer-btn">
<el-button @click="resetRotate"></el-button>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="onCancel"></el-button>
</div>
</el-form>
</div>
</template>
<script>
import { ElMessage, ElTooltip } from 'element-plus';
import { updateBimModel } from "@/api/bim/bimModel"
import SAPITools from './sapiTools.js'
import APITools from './apiTools.js'
export default {
props: {
me: {
type: Object,
default: () => ({}),
},
},
data() {
return {
modelId: null,
movePoint: null,
form: {
x: 0,
y: 0,
z: 0,
rotateZ: 0
},
saveData: {
x: 0,
y: 0,
z: 0,
rotateZ: 0
},
movePoint: null
}
},
methods: {
doModelMove() {
ElMessage.info("左键单击选择移动位置,右键单击结束操作!");
if(this.me.bimCfg.clientApi){
APITools.moveToPosition(this);
}else{
APITools.moveToPosition(this);
}
},
onCancel() {
this.resetPosition();
this.me.showMove = false;
this.me.activeMenu = -1;
},
onSubmit() {
this.$modal.confirm("确定保存吗?").then(() => {
let model = this.me.models.find(model => model.modelId == this.modelId);
if (model) {
model.bimConfig = JSON.stringify(this.saveData);
model.bimCfg = this.saveData;
updateBimModel(model).then(res => {
this.$message.success("保存成功");
this.me.showMove = false;
this.me.activeMenu = -1;
});
}
});
},
initData(modelId) {
this.modelId = modelId;
let modelInfo = this.me.models.find(m => m.modelId == modelId);
if (modelInfo) {
let cfg = modelInfo.bimCfg;
this.form.x = cfg?.x || 0;
this.form.y = cfg?.y || 0;
this.form.z = cfg?.z || 0;
this.form.rotateZ = cfg?.rotateZ || 0;
} else {
this.$message.error("模型信息不存在");
}
this.saveData.x = this.form.x;
this.saveData.y = this.form.y;
this.saveData.z = this.form.z;
this.saveData.rotateZ = this.form.rotateZ;
},
resetPosition() {
let modelInfo = this.me.models.find(model => model.modelId == this.modelId);
if (modelInfo) {
let cfg = modelInfo.bimCfg;
let x = cfg?.x || 0;
let y = cfg?.y || 0;
let z = cfg?.z || 0;
let rotateZ = cfg?.rotateZ || 0;
if (x * 1 + y * 1 + z * 1 != 0) {
api.Model.moveToPosition([x, y, z], 0, this.modelId)
}
if (rotateZ * 1 != 0) {
api.Model.rotate(0, 0, rotateZ, this.modelId)
}
}
},
updatePosition() {
api.Model.moveToPosition([this.form.x, this.form.y, this.form.z], 0, this.modelId)
this.saveData.x = this.form.x;
this.saveData.y = this.form.y;
this.saveData.z = this.form.z;
if (this.saveData.rotateZ != 0) {
api.Model.rotate(0, 0, this.saveData.rotateZ, this.modelId)
}
},
updateRotate() {
api.Model.rotate(0, 0, this.form.rotateZ, this.modelId)
this.saveData.rotateZ = this.form.rotateZ;
},
resetRotate() {
api.Model.clearRotation(this.modelId)
this.saveData = {
x: 0,
y: 0,
z: 0,
rotateZ: 0
}
},
}
}
</script>
<style lang="scss">
.move-model {
padding: 0px 10px 20px;
.move-button {
position: absolute;
right: 10px;
top: 45px;
}
.nav-title {
background: linear-gradient(45deg, #00000033, transparent);
line-height: 40px;
padding-left: 10px;
margin-bottom: 10px;
}
.button-group {
margin-bottom: 10px;
text-align: right;
}
.footer-btn {
text-align: center;
}
}
</style>

View File

@ -0,0 +1,64 @@
import { ElMessage, ElTooltip } from 'element-plus';
//初始化
function initEngine(that) {
let opt = {
container: "bimSettingContainer", //[必须]容器id
showfps: false, //[可选]显示fps
openearth: true, //[可选]开启gis场景
// imageryprovider: "tianditu_image", //[可选]gis底图
openterrain: false, //[可选]开启gis地形
maxspaceerror: 5000, //[可选]模型可视距离; 建议设置常规BIM时3000或更大、BIM启用LOD时100~1000、倾斜摄影,点云数据时0.1~0.5
loading: false, //[可选]gis模式加载动画
bgcolor: "#87CEFA", //[可选]bim模式场景背景色
selectedcolor: "#FFFF00", //[可选]选中构件颜色
throughwall: true, //[可选]相机是否穿墙
sitepath: "../Cesium/",//[可选]设置天空盒路径指向Cesium文件夹
editmode: true, //[可选]是否开启编辑模式
searchbox: true, //[可选]gis模型是否显示搜索框
mapbox: true, //[可选]gis模型是否显示地图选择
isRequestWebgl2: true, //[可选]是否使用webgl2进行渲染
colorBlendMode: 1, //0:HIGHLIGHT 1:REPLACE 2:MIX ,构件选中后的着色模式
secretkey: window.config.secretKey,
language: "zh-CN", // 语言国际化 中文简体(zh-CN)、中文繁体(zh-TW)、英文(en), 默认中文简体
targetFrameRate: 20, //目标渲染帧率 默认20
};
window.api = new API(opt);
console.log("初始化成功");
if (that.bimCfg.showGis) {
that.showGis = true;
that.doChangeGis();
} else if (that.bimCfg.background) {
api.Public.setGisState(false, that.bimCfg.background);
}
}
//模型偏移管理
function doModelMove(that) {
api.Public.pickupCoordinate(false);
api.Public.event("LEFT_CLICK", (t) => {
api.Feature.GetFeatureByEvent(t.position, e => {
if (e && e["id"]) {
let modelId = e.id.split("^")[0];
that.showMove = true;
that.$refs.moveModel.initData(modelId)
} else {
ElMessage.warning("请在模型上选点!");
}
});
});
}
//在地图上移动模型
function moveToPosition(that){
api.Public.event("LEFT_CLICK",(n)=>{
api.Public.pickupCoordinate(n.position,e=>{
api.Public.convertWorldToCartographicLocation(e,m=>{
console.log(e,m)
});
});
});
}
export default {
initEngine,
doModelMove,
moveToPosition
}

View File

@ -1,7 +1,11 @@
<template>
<div class="bim-setting-page app-container2">
<div id="bimSettingContainer"></div>
<model-floor-tree ref="modelFloorTree" @change="doChange" @modelAdd="modelAdded" :projectMessage="models" v-if="showTree"></model-floor-tree>
<div class="bim-cfg-tools">
<el-switch v-model="showGis" @change="doChangeGis"></el-switch>GIS
</div>
<model-floor-tree ref="modelFloorTree" :me="this" @change="doChange" @modelAdd="modelAdded" :projectMessage="models"
v-if="showTree"></model-floor-tree>
<div class="footer-box" v-if="showModels.length > 0">
<el-tooltip placement="top" content="主视图">
<div class="footer-btn" @click="doMenu(0)" :class="activeMenu == 0 ? 'is-active' : ''">
@ -28,8 +32,13 @@
<svg-icon icon-class="hide" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="模型偏移">
<div class="footer-btn" @click="doMenu(5)" :class="activeMenu == 5 ? 'is-active' : ''">
<svg-icon icon-class="position" />
</div>
</el-tooltip>
</div>
<div class="bim-setting-tools" v-show="activeMenu > 0">
<div class="bim-setting-tools" v-show="(activeMenu > 0 && activeMenu != 5)">
<div class="tools-title">
<svg-icon icon-class="roam" v-if="activeMenu == 1" />
<svg-icon icon-class="view" v-if="activeMenu == 2" />
@ -43,26 +52,46 @@
<person-roaming v-if="activeMenu == 1" ref="personRoaming" :me="this"></person-roaming>
<custom-viewpoint v-if="activeMenu == 2" ref="customViewpoint" :me="this"></custom-viewpoint>
<viewpoint v-if="activeMenu == 3" ref="viewpoint" :me="this"></viewpoint>
<HideFeature v-show="activeMenu == 4" ref="hideFeature" :me="this"></HideFeature>
</div>
<div class="bim-setting-tools" v-show="showMove">
<div class="tools-title">
<svg-icon icon-class="position" />
{{ param.title }}
</div>
<el-icon @click="doCloseMove" style="color: #000; font-size: 20px; cursor: pointer" class="tools-close">
<Close />
</el-icon>
<MoveModel ref="moveModel" :me="this"></MoveModel>
</div>
</div>
</template>
<script>
import useUserStore from "@/store/modules/user";
import { listBimModel } from "@/api/bim/bimModel";
import {getDefaultViewPoint} from '@/api/bim/bim';
import { getDefaultViewPoint } from '@/api/bim/bim';
import ModelFloorTree from "./ModelFloorTree.vue";
import PersonRoaming from "./PersonRoaming.vue";
import CustomViewpoint from "./CustomViewpoint.vue";
import Viewpoint from "./Viewpoint.vue";
import MoveModel from "./MoveModel.vue";
import HideFeature from "./HideFeature.vue";
import { ElMessage, ElTooltip } from 'element-plus';
import { getProjectBimConfig } from "@/api/manage/proProjectInfo.js";
import SAPITools from './sapiTools.js'
import APITools from './apiTools.js'
export default {
components: {
ModelFloorTree,
PersonRoaming,
CustomViewpoint,
Viewpoint,
ElTooltip
ElTooltip,
MoveModel,
HideFeature,
},
data() {
return {
@ -79,7 +108,14 @@ export default {
activeMenu: 0,
showModels: [],
param: {},
viewPoint:null,
viewPoint: null,
showGis: false,
movePoint: null,
moveModelId: null,
isMove: false,
showMove: false,
hideParts: [],
bimCfg: {}
};
},
beforeUnmount() {
@ -92,12 +128,45 @@ export default {
this.currentPrjId = this.userStore.currentPrjId;
this.currentComId = this.userStore.currentComId;
this.initLoadModel();
this.initEngine();
getProjectBimConfig(this.currentPrjId).then(d => {
let config = this.$tryToJson(d.msg, {});
this.bimCfg = {
background: config.background || "",
showGis: config.showGis || false,
clientApi: config.clientApi || false
}
if (this.bimCfg.clientApi) {
APITools.initEngine(this);
} else {
SAPITools.initEngine(this);
}
});
},
methods: {
modelAdded(point){
if(this.viewPoint!=null){
this.viewPoint=point;
doCloseMove() {
this.$refs.moveModel.resetPosition();
this.showMove = false;
this.activeMenu = -1;
},
modelAdded(point) {
if (this.viewPoint != null) {
this.viewPoint = point;
}
},
doChangeGis() {
if (this.showGis) {
if (this.bimCfg.clientApi) {
api.Public.setGisState(true);
} else {
api.Public.setGisState(true);
api.Public.setTerrainState(false, "http://113.201.2.107:9304/layer.json", false)
api.Public.setGisState(true);
}
} else {
let color = this.bimCfg.background || "rgba(135 ,206 ,250,1)"
api.Public.setGisState(false, color);
api.Public.setSkyBoxState(0)
}
},
doChange() {
@ -111,20 +180,33 @@ export default {
api.Camera.stopImmersiveRoam();
api.Model.location(api.m_model.keys().toArray()[0]);
api.Plugin.deleteMiniMap();
if(this.viewPoint){
if (this.viewPoint) {
api.Camera.setViewPort(this.viewPoint);
}
},
doMenu(n) {
if (this.activeMenu == 4) {
api.Public.clearHandler();
api.Feature.getByEvent(false);
}
if (n == this.activeMenu) {
if (n == 0) {
this.resetScene();
if (this.isMove) {
this.activeMenu = 5;
}
}
return;
}
if (this.activeMenu == 5) {
this.doCloseMove()
}
this.activeMenu = n;
if (n == 0) {
this.resetScene();
if (this.isMove) {
this.activeMenu = 5;
}
}
if (n == 1) {
this.param.title = "第一人称漫游";
@ -135,25 +217,38 @@ export default {
if (n == 3) {
this.param.title = "视点管理";
}
if (n == 4) {
this.param.title = "构件隐藏管理";
setTimeout(() => {
this.$refs.hideFeature.doHideFeatures(this.hideParts);
}, 800);
}
if (n == 5) {
this.param.title = "模型偏移管理";
this.isMove = true;
this.doModelMove();
} else {
if (this.isMove) {
this.isMove = false;
this.showMove = false;
api.Public.clearHandler(),
api.Public.pickupCoordinate(false);
}
}
},
doModelMove() {
ElMessage.info("请在场景中选择要移动的模型!");
if(this.bimCfg.clientApi){
APITools.doModelMove(this);
}else{
SAPITools.doModelMove(this);
}
},
NotificationPopup(parameter) {
this.param = parameter;
// const that = this
// that.$notification.open({
// key: 'EngineKey',
// message: parameter.title,
// description: parameter.description,
// class: 'engine-notification ' + (parameter.tips ? parameter.tips : ''),
// duration: null,
// placement: parameter.placement ? parameter.placement : that.isMobile ? 'bottomLeft' : 'topRight',
// style: {
// top: parameter.top ? parameter.top : '50px',
// width: parameter.width ? parameter.width : '360px',
// marginRight: `20px`,
// borderRadius: '0px',
// },
// onClose: this.notifClose,
// })
},
doToolsClose() {
this.activeMenu = 0;
@ -162,64 +257,16 @@ export default {
notifClose() {
this.activeMenu = -1;
},
initEngine() {
window.api = new SAPI(
{
serverIP: window.config.serverIP, //ip
port: window.config.port, //HTTP
useHttps: window.config.useHttps, //使Https
container: "bimSettingContainer", //[]id
secretKey: window.config.secretKey,
openEarth: window.config.openEarth, //[]Gis
bgColor: window.config.bgColor, //[]bim,
tintColor: window.config.tintColor, //[]osgb
sceneTime: window.config.sceneTime, //[]
cadMode: window.config.cadMode, // Cad
},
() => {
this.initSuccess = true;
console.log("初始化成功");
let mapOptions = {
imgs: {
//
top: "/cdn/bim/sapi/img/top.png",
bottom: "/cdn/bim/sapi/img/under.png",
east: "/cdn/bim/sapi/img/east.png",
south: "/cdn/bim/sapi/img/south.png",
west: "/cdn/bim/sapi/img/west.png",
north: "/cdn/bim/sapi/img/north.png",
},
offset: {
//
corner: GLENavigationCube.RightTop,
x: 25,
y: 20,
},
cube: {
hoverColor: "#7193dc", //
size: 32, //
hotPointSize: 7, //
cubeTextColor: "#4c4c4ccc", // cube
cubeStrokeColor: "#374769cc", // cube
cubeFillColor: "#374769cc", // cube
},
zoomRatios: 1, //
show: true, //
showAxes: true, // XYZ线
};
api.Plugin.initNavCube(mapOptions);
}
);
},
initLoadModel() {
getDefaultViewPoint(this.currentPrjId,1).then(d=>{
let pt="";
if(d.data && d.data.length>0){
pt=d.data[0].viewPosition;
pt=this.$tryToJson(pt,null);
getDefaultViewPoint(this.currentPrjId, 1).then(d => {
let pt = "";
if (d.data && d.data.length > 0) {
pt = d.data[0].viewPosition;
pt = this.$tryToJson(pt, null);
}
if(pt){
this.viewPoint=pt;
if (pt) {
this.viewPoint = pt;
}
});
listBimModel({
@ -228,9 +275,10 @@ export default {
comId: this.currentComId,
projectId: this.currentPrjId,
}).then((d) => {
this.models = (d.rows || []).map((it) => {
this.models = (d.rows || []).map((it) => {
it.modelId = it.lightweightName;
it.visible=false;
it.bimCfg = this.$tryToJson(it.bimConfig || "{}", {});
it.visible = false;
it.checked = true;
it.gis = this.$tryToJson(it.gisJson || "{}", {});
return it;
@ -250,9 +298,17 @@ export default {
.bim-setting-page {
position: relative;
height: 100%;
.bim-cfg-tools {
position: absolute;
left: 340px;
top: 20px;
}
#bimSettingContainer {
height: 100%;
}
.footer-box {
position: absolute;
bottom: 10vh;
@ -260,6 +316,7 @@ export default {
margin-left: -75px;
background: #274754;
border-radius: 4px;
.footer-btn {
display: inline-flex;
width: 40px;
@ -267,14 +324,17 @@ export default {
justify-content: center;
align-items: center;
cursor: pointer;
svg {
width: 20px;
height: 20px;
fill: #fff;
}
&:hover {
background: #408edb97;
}
&.is-active {
svg {
fill: rgb(0, 255, 174);
@ -282,6 +342,7 @@ export default {
}
}
}
.bim-setting-tools {
position: absolute;
top: 80px;
@ -290,11 +351,13 @@ export default {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
min-width: 300px;
min-height: 400px;
.tools-title {
padding: 10px;
color: #114c5f;
size: 24px;
}
.tools-close {
position: absolute;
top: 10px;

View File

@ -0,0 +1,109 @@
import { ElMessage, ElTooltip } from 'element-plus';
//初始化
function initEngine(that) {
window.api = new SAPI(
{
serverIP: window.config.serverIP, //服务ip地址
port: window.config.port, //HTTP端口
useHttps: window.config.useHttps, //使用Https
container: "bimSettingContainer", //[必须]容器id
secretKey: window.config.secretKey,
openEarth: window.config.openEarth, //[可选]开启Gis场景
bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒
tintColor: window.config.tintColor, //[可选]osgb单体化颜色
sceneTime: window.config.sceneTime, //[可选]分别为当前时间、日出时间、日落时间
cadMode: window.config.cadMode, // 是否是Cad图纸预览模式
},
() => {
that.initSuccess = true;
console.log("初始化成功");
let mapOptions = {
imgs: {
// 六面图片
top: "/cdn/bim/sapi/img/top.png",
bottom: "/cdn/bim/sapi/img/under.png",
east: "/cdn/bim/sapi/img/east.png",
south: "/cdn/bim/sapi/img/south.png",
west: "/cdn/bim/sapi/img/west.png",
north: "/cdn/bim/sapi/img/north.png",
},
offset: {
// 屏幕坐标偏移
corner: GLENavigationCube.RightTop,
x: 25,
y: 20,
},
cube: {
hoverColor: "#7193dc", // 立方导航快鼠标移过显示颜色
size: 32, // 导航立方尺寸
hotPointSize: 7, // 导航立方棱角热点区域尺寸
cubeTextColor: "#4c4c4ccc", // cube 各个面文字颜色
cubeStrokeColor: "#374769cc", // cube 各个面边框颜色
cubeFillColor: "#374769cc", // cube 各个面填充颜色
},
zoomRatios: 1, // 缩放倍率
show: true, // 是否显示
showAxes: true, // 是否显示XYZ轴线
};
api.Plugin.initNavCube(mapOptions);
if (that.bimCfg.showGis) {
that.showGis = true;
that.doChangeGis();
} else if (that.bimCfg.background) {
api.Public.setGisState(false, that.bimCfg.background);
}
}
);
}
//模型偏移管理
function doModelMove(that) {
api.Public.pickupCoordinate(false);
api.Public.event("LEFT_CLICK", (e) => {
api.Feature.getByPosition([e.x, e.y], (n) => {
if (n && n["id"]) {
let modelId = n.id.split("^")[0];
that.showMove = true;
that.$refs.moveModel.initData(modelId)
} else {
ElMessage.warning("请在模型上选点!");
}
});
});
}
//在地图上移动模型
function moveToPosition(that){
api.Public.event("LEFT_CLICK", ((n) => {
api.Public.pickupCoordinate(true, ((n) => {
api.Public.convertWorldToCartographicLocation(n, m => {
api.Model.moveToPosition(m, 0, that.modelId)
if (that.saveData.rotateZ != 0) {
api.Model.rotate(0, 0, that.saveData.rotateZ, that.modelId)
}
that.movePoint = m;
});
}
))
}
)),
api.Public.event("RIGHT_CLICK", ((n) => {
api.Public.clearHandler(),
api.Public.pickupCoordinate(false);
ElMessage.info("已结束模型移动!"),
that.activeMenu = -1;
let pt = that.movePoint;
that.form.x = pt[0]
that.form.y = pt[1]
that.form.z = pt[2]
that.saveData.x = that.form.x;
that.saveData.y = that.form.y;
that.saveData.z = that.form.z;
}));
}
export default {
initEngine,
doModelMove,
moveToPosition
}

View File

@ -124,7 +124,8 @@ function initBim(that) {
if (that.plan) {
planId = that.plan.id;
}
let tmps = that.allBimData.filter((it) => it.id == planId);
//let tmps = [that.plan]//that.allBimData.filter((it) => it.id == planId);
let tmps =that.allBimData.filter((it) => it.id == planId);
if (tmps.length > 0) {
tmps[0].bim.forEach((it) => {
if (
@ -516,7 +517,7 @@ function makePlanTree(that) {
datas.forEach((data) => {
data.checked = false;
data.bim = that.$tryToJson(data.bimId || "[]", []);
data.hasBim = data.bim && data.bim.length > 0;
data.hasBim = data.bimId && data.bimId.length > 0;
data.children = that.planList.filter((it) => it.parentId == data.taskId);
func(data.children);
});

View File

@ -1,47 +1,24 @@
<template>
<el-dialog
v-model="show"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="title"
modal-class="bim-selection-dialog3"
>
<el-dialog v-model="show" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" :title="title"
modal-class="bim-selection-dialog3">
<div id="bimSelectionDlg">
<div
id="bimSelectionDlgContainer3"
class="bimSelectionDlgContainer"
></div>
<div id="bimSelectionDlgContainer3" class="bimSelectionDlgContainer"></div>
</div>
<div class="div-left" :class="{ 'is-hide': !leftExpend }">
<div class="div-left-title">
<el-tabs v-model="activeTab">
<el-tab-pane label="结构树" name="a1">
<div class="model-tree scroll" :key="treeKey">
<el-tree
:key="treeKey"
ref="tree"
:default-expanded-keys="treeExpendedKeys"
:props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}"
node-key="key"
@check="onCheckTree"
:load="loadNode"
lazy
show-checkbox
></el-tree>
<el-tree :key="treeKey" ref="tree" :default-expanded-keys="treeExpendedKeys" :props="{
children: 'children',
label: 'title',
isLeaf: 'leaf',
}" node-key="key" @check="onCheckTree" :load="loadNode" lazy show-checkbox></el-tree>
</div>
</el-tab-pane>
<el-tab-pane label="已关联" name="a2">
<div class="sel-list scroll" :key="selEl">
<div
v-for="(it, idx) in selectItems"
:key="idx"
class="div-sel-item"
>
<div v-for="(it, idx) in selectItems" :key="idx" class="div-sel-item">
<el-tooltip placement="bottom" :content="it.info">
<div class="sel-item-info">{{ it.info }}</div>
</el-tooltip>
@ -54,11 +31,7 @@
<el-button @click="delAllDelList"></el-button>
</div>
<div class="sel-list scroll hide-list" :key="hideEl">
<div
v-for="(it, idx) in getSelectItems(hideParts)"
:key="idx"
class="div-sel-item"
>
<div v-for="(it, idx) in getSelectItems(hideParts)" :key="idx" class="div-sel-item">
<el-tooltip placement="bottom" :content="it.info">
<div class="sel-item-info">{{ it.info }}</div>
</el-tooltip>
@ -88,32 +61,18 @@
<span v-else></span>
</div>
<div class="plan-tree scroll" :key="planTreeKey" v-if="showPlan">
<el-tree
ref="planTree"
:data="planTree"
node-key="id"
:props="{
children: 'children',
label: 'taskName',
isLeaf: 'leaf',
}"
default-expand-all
>
<el-tree ref="planTree" :data="planTree" node-key="id" :props="{
children: 'children',
label: 'taskName',
isLeaf: 'leaf',
}" default-expand-all>
<template #default="{ node, data }">
<span class="custom-tree-node" @click="nodeClick(node, data)">
<span>{{ node.label }}</span>
<span
v-if="node.isLeaf"
class="bind-bim"
:class="{ 'has-bim': data.hasBim }"
>
<span v-if="node.isLeaf" class="bind-bim" :class="{ 'has-bim': data.hasBim }">
<svg-icon icon-class="position" style="cursor: pointer" />
[{{ data.hasBim ? "已" : "未" }}绑定]
<svg-icon
v-if="data.checked"
icon-class="checkbox"
style="cursor: pointer"
/>
<svg-icon v-if="data.checked" icon-class="checkbox" style="cursor: pointer" />
</span>
</span>
</template>
@ -123,65 +82,37 @@
<div v-show="bimLoaded">
<div class="footer-box" v-if="models.length > 0">
<el-tooltip placement="top" content="主视图">
<div
class="footer-btn"
@click="doMenu(0)"
:class="activeMenu == 0 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(0)" :class="activeMenu == 0 ? 'is-active' : ''">
<svg-icon icon-class="home" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="取消所有关联">
<div
class="footer-btn"
@click="doMenu(1)"
:class="activeMenu == 1 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(1)" :class="activeMenu == 1 ? 'is-active' : ''">
<svg-icon icon-class="cancel" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="点选">
<div
class="footer-btn"
@click="doMenu(2)"
:class="activeMenu == 2 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(2)" :class="activeMenu == 2 ? 'is-active' : ''">
<svg-icon icon-class="pointselect" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="框选">
<div
class="footer-btn"
@click="doMenu(3)"
:class="activeMenu == 3 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(3)" :class="activeMenu == 3 ? 'is-active' : ''">
<svg-icon icon-class="boundselect" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="全选树上所有已选择构件">
<div
class="footer-btn"
@click="doMenu(5)"
:class="activeMenu == 5 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(5)" :class="activeMenu == 5 ? 'is-active' : ''">
<svg-icon icon-class="skill" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="隐藏构件">
<div
class="footer-btn"
@click="doMenu(4)"
:class="activeMenu == 4 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(4)" :class="activeMenu == 4 ? 'is-active' : ''">
<svg-icon icon-class="hide" />
</div>
</el-tooltip>
<el-tooltip placement="top" content="保存绑定">
<div
class="footer-btn"
@click="doMenu(6)"
:class="activeMenu == 6 ? 'is-active' : ''"
>
<div class="footer-btn" @click="doMenu(6)" :class="activeMenu == 6 ? 'is-active' : ''">
<svg-icon icon-class="save" />
</div>
</el-tooltip>
@ -189,15 +120,8 @@
</div>
<div class="div-mode">
<el-switch
v-model="showMode"
class="ml-2"
inline-prompt
active-text="显示模式"
inactive-text="隐藏模式"
@change="doModeChange"
style="--el-switch-off-color: #336699"
/>
<el-switch v-model="showMode" class="ml-2" inline-prompt active-text="" inactive-text=""
@change="doModeChange" style="--el-switch-off-color: #336699" />
</div>
</el-dialog>
</template>
@ -207,10 +131,12 @@ import { listBimModel } from "@/api/bim/bimModel";
import bimTools from "./bimSelectTools3";
import {
updateBimInfo,
getPlanAllBimInfo,
getDefaultViewPoint,
} from "@/api/bim/bim";
import { ElMessage, ElMessageBox, ElStep } from "element-plus";
import {
getPlan,listPlan
} from "@/api/manage/plan";
import { ElMessage } from "element-plus";
export default {
data() {
return {
@ -266,8 +192,19 @@ export default {
this.planList.forEach((it) => {
it.checked = it == data;
});
this.plan = data;
bimTools.showPlanFeatchure(this);
if (!data.hasLoadBim) {
getPlan(data.id).then((response) => {
data.bimId = response.data.bimId;
data.bim = this.$tryToJson(data.bimId || "[]", []);
data.hasBim = data.bim && data.bim.length > 0;
data.hadLoadBim = true;
this.plan = data;
bimTools.showPlanFeatchure(this);
});
} else {
this.plan = data;
bimTools.showPlanFeatchure(this);
}
},
loadNode(node, resolve) {
bimTools.loadNode(this, node, resolve);
@ -325,7 +262,7 @@ export default {
if (res.success) {
this.plan.bimId = text;
this.plan.bim = this.$tryToJson(text || "[]", []);
this.plan.hasBim = this.plan && this.plan.bim.length > 0;
this.plan.hasBim = text && text.length > 0;
ElMessage.success("保存成功");
bimTools.showPlanFeatchure(this);
this.$emit("success");
@ -397,9 +334,26 @@ export default {
this.loadedModelCount = 0;
bimTools.makePlanTree(this);
this.allBimData = this.planList.filter((d) => d.hasBim);
//this.allBimData = this.planList.filter((d) => d.hasBim);
this.loadAllBimData();
this.initEngine();
},
loadAllBimData() {
let postData={
projectId: this.currentPrjId,
pageNum:1,
pageSize:10000
};
listPlan(postData).then((d) => {
let tmps = (d.data || []).filter(it=>it.bmId).map(it=>{
it.bim=this.$tryToJson(it.bimId||"[]",[]);
it.hasBim=it.bim && it.bim.length>0;
return it;
});
this.allBimData=tmps.filter(item=>item.hasBim);
this.$message.info("数据准备就绪!");
});
},
initEngine() {
this.elId++;
setTimeout(() => {
@ -503,7 +457,7 @@ export default {
api.Model.add(
url,
modelId,
() => {},
() => { },
() => {
cb && cb();
console.log("加载模型成功");
@ -568,18 +522,23 @@ export default {
&.plan-list {
left: unset;
right: 96px;
&.plan-hide {
height: 40px;
.plan-tree-icon {
right: 5px;
top: 5px;
}
.plan-info {
color: #fff;
line-height: 40px;
padding-left: 20px;
.bind-bim {
color: #2cff00;
&.has-bim {
color: #edfd06;
font-weight: bold;
@ -587,12 +546,14 @@ export default {
}
}
}
.plan-tree-icon {
position: absolute;
right: 10px;
top: 10px;
z-index: 999;
cursor: pointer;
.svg-icon {
width: 30px;
height: 30px;
@ -622,6 +583,7 @@ export default {
}
.el-tabs__nav-wrap {
.el-tabs__nav-prev,
.el-tabs__nav-next {
display: none;
@ -735,9 +697,11 @@ export default {
.plan-tree {
height: calc(100% - 0px);
}
.model-tree {
height: calc(100% - 36px);
}
.model-tree,
.plan-tree {
overflow-y: auto;
@ -749,28 +713,33 @@ export default {
.el-checkbox {
color: #45fdfe;
}
.custom-tree-node {
cursor: pointer;
}
.bind-bim {
cursor: pointer;
font-size: 12px;
color: #2cff00;
&.has-bim {
color: #edfd06;
font-weight: bold;
}
.svg-icon {
color: #45fdfe;
}
}
.el-text {
color: #fff;
}
.el-tree-node {
&:focus {
& > .el-tree-node__content {
&>.el-tree-node__content {
background: #3489d966;
&:hover {

View File

@ -1,34 +1,15 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="项目" prop="projectId">
<el-select
:disabled="data.projectId ? true : false"
v-model="queryParams.projectId"
placeholder="请选择项目"
style="width: 192px"
clearable
@change="handleQuery"
>
<el-option
v-for="prj in data.projects"
:key="prj.id"
:label="prj.projectName"
:value="prj.id"
>
<el-select :disabled="data.projectId ? true : false" v-model="queryParams.projectId" placeholder="请选择项目"
style="width: 192px" clearable @change="handleQuery">
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>搜索</el-button
>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
@ -48,109 +29,48 @@
</el-col>
-->
<el-col :span="1.5">
<el-upload
ref="uploadRef"
:limit="1"
accept=".mpp"
:headers="upload.headers"
:action="
upload.url +
'?compId=' +
data.compId +
'&projectId=' +
queryParams.projectId
"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="true"
>
<el-button type="primary" v-loading="upload.isUploading"
>导入(Project)</el-button
>
<el-upload ref="uploadRef" :limit="1" accept=".mpp" :headers="upload.headers" :action="upload.url +
'?compId=' +
data.compId +
'&projectId=' +
queryParams.projectId
" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
:auto-upload="true">
<el-button type="primary" v-loading="upload.isUploading">(Project)</el-button>
</el-upload>
</el-col>
<el-col :span="1.5" v-if="planList.length > 0">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['manage:plan:export']"
>导出(Project)</el-button
>
<el-button @click="handleBindBim" v-if="planList.length > 0"
>关联Bim</el-button
>
<el-button type="warning" plain icon="Download" @click="handleExport"
v-hasPermi="['manage:plan:export']">导出(Project)</el-button>
<el-button @click="handleBindBim" v-if="planList.length > 0">Bim</el-button>
</el-col>
<right-toolbar
:showSearch="showSearch"
@queryTable="getList"
v-if="1 == 2"
></right-toolbar>
<right-toolbar :showSearch="showSearch" @queryTable="getList" v-if="1 == 2"></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="planList"
row-key="taskId"
default-expand-all
>
<el-table v-loading="loading" :data="planList" row-key="taskId" default-expand-all>
<el-table-column label="任务名称" align="left" prop="taskName" />
<el-table-column
label="任务工期"
align="center"
prop="taskDuation"
width="120"
>
<el-table-column label="任务工期" align="center" prop="taskDuation" width="120">
<template #default="scope">{{ scope.row.taskDuation }}d</template>
</el-table-column>
<el-table-column
label="计划开始时间"
align="center"
prop="planStartDate"
width="180"
>
<el-table-column label="计划开始时间" align="center" prop="planStartDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.planStartDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="计划结束时间"
align="center"
prop="planFinishDate"
width="180"
>
<el-table-column label="计划结束时间" align="center" prop="planFinishDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.planFinishDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="BIM ID" align="center" prop="bimId" width="120">
<template #default="scope">
<template
v-if="!scope.row.children || scope.row.children.length == 0"
>
<span
@click="handleBim(scope.row)"
style="color: red"
v-if="scope.row.bimId"
>已关联BIM</span
>
<span @click="handleBim(scope.row)" v-else style="color: #8e9aaf"
>未关联BIM</span
>
<span
@click="handleBim(scope.row)"
style="margin-left: 8px; cursor: pointer"
>
<template v-if="!scope.row.children || scope.row.children.length == 0">
<span @click="handleBim(scope.row)" style="color: red" v-if="scope.row.bimId">BIM</span>
<span @click="handleBim(scope.row)" v-else style="color: #8e9aaf">未关联BIM</span>
<span @click="handleBim(scope.row)" style="margin-left: 8px; cursor: pointer">
<el-tooltip append-to="" content="关联BIM模型" placement="top">
<span>
<svg-icon
icon-class="position"
style="cursor: pointer"
class="icon-blue"
@click="handleBim(scope.row)"
/>
<svg-icon icon-class="position" style="cursor: pointer" class="icon-blue" />
</span>
</el-tooltip>
</span>
@ -158,23 +78,10 @@
</template>
</el-table-column>
<el-table-column
label="负责人"
align="center"
prop="operator"
width="120"
/>
<el-table-column
label="班组名称"
align="center"
prop="groupName"
width="120"
/>
<el-table-column label="负责人" align="center" prop="operator" width="120" />
<el-table-column label="班组名称" align="center" prop="groupName" width="120" />
</el-table>
<bim-selection-dialog
ref="bimDlg"
@success="doSelectSuccess"
></bim-selection-dialog>
<bim-selection-dialog ref="bimDlg" @success="doSelectSuccess"></bim-selection-dialog>
<bim-selection-dialog3 ref="bimDlg3" @success="doSelectSuccess" />
</div>
</template>
@ -272,6 +179,7 @@ function buildTree(all, id) {
/** 查询计划管理列表 */
function getList() {
queryParams.value.projectId = userStore.currentPrjId;
queryParams.value.noBim = 'Y'
if (!queryParams.value.projectId) {
planList.value = [];
loading.value = false;
@ -288,7 +196,20 @@ function getList() {
}
function handleBim(row) {
bimDlg.value.showDialog(row, data.planAll);
if(row.hasLoadBim){
bimDlg.value.showDialog(row, data.planAll);
return;
}
loading.value = true;
getPlan(row.id).then((response) => {
row.bimId = response.data.bimId;
row.hadLoadBim=true;
row.bim = proxy.$tryToJson(row.bimId || "[]", []);
row.hasBim =row.bimId && row.bimId.length > 0;
loading.value = false;
bimDlg.value.showDialog(row, data.planAll);
});
}
function handleBindBim() {
@ -435,7 +356,7 @@ function handleDelete(row) {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
.catch(() => { });
}
/** 导出按钮操作 */

View File

@ -164,7 +164,6 @@ const data = reactive({
taskId: null,
taskUniqueId: null,
taskName: null,
bimId: null,
isDel: null,
createUserId: null,
},
@ -208,7 +207,6 @@ function reset() {
taskId: null,
taskUniqueId: null,
taskName: null,
bimId: null,
schedulePercent: null,
finishDate: null,
description: null,
@ -338,7 +336,6 @@ function initPlan(proId) {
form.value.taskId = res.data.taskId;
form.value.taskUniqueId = res.data.taskUniqueId;
form.value.taskName = res.data.taskName;
form.value.bimId = res.data.bimId;
initPreviousSchedule(res.data.id);
});
}
@ -355,7 +352,7 @@ function buildTree(all, id) {
/** 初始化计划管理 */
function initPlanDatas(proId) {
findPlanDatas(proId).then((res) => {
findPlanDatas(proId,'Y').then((res) => {
data.allData = res.data || [];
let treeDatas = buildTree(res.data, 1);
planOptions.value = treeDatas;
@ -369,7 +366,6 @@ function handleChangePlan(value) {
form.value.taskId = res.data.taskId;
form.value.taskUniqueId = res.data.taskUniqueId;
form.value.taskName = res.data.taskName;
form.value.bimId = res.data.bimId;
});
}

View File

@ -55,6 +55,20 @@ export default defineConfig(({ mode, command }) => {
"^/statics": "/",
},
},
"/cesium": {
target: `http://62.234.3.186`,
changeOrigin: true,
pathRewrite: {
"^/cesium": "/",
},
},
"/bimdata": {
target: `http://62.234.3.186`,
changeOrigin: true,
pathRewrite: {
"^/bimdata": "/",
},
},
"/cdn": {
target: `http://62.234.3.186`,
changeOrigin: true,