<template>
|
<div ref="pagebox" class="DetailByParamsBox">
|
<!-- 头部导航栏 -->
|
<van-nav-bar style="position: fixed; top: 0px; width: 100%">
|
<template #left>
|
<van-icon @click="pageBack" name="arrow-left" size="18" />
|
</template>
|
<template #title>
|
<label>{{ pagetitle }}</label>
|
</template>
|
<template #right>
|
<!-- <van-icon name="search" size="18" /> -->
|
<van-icon
|
@click="popupShow = true"
|
size="16"
|
style="line-height: 24px"
|
name="ellipsis"
|
/>
|
</template>
|
</van-nav-bar>
|
<div class="DetailByParamsMain">
|
<van-overlay style="z-index: 999" :show="isShowLoadingFrm">
|
<div class="wrapper">
|
<van-loading
|
style="
|
position: fixed;
|
top: calc(50% - 25px);
|
left: calc(50% - 25px);
|
"
|
type="spinner"
|
color="#1989fa"
|
size="24px"
|
vertical
|
>Loading...</van-loading
|
>
|
</div>
|
</van-overlay>
|
|
<div class="swipe_box" v-if="isShowSwiperImg">
|
<van-swipe
|
class="picture_swiper"
|
width="100%"
|
height="100%"
|
:autoplay="3000"
|
indicator-color="white"
|
>
|
<van-swipe-item
|
v-if="mainSetting.structFilePart.path"
|
style="positiion: relative; background: #fff"
|
>
|
<van-image
|
:src="mainSetting.structFilePart.path"
|
@click="previewImg(mainSetting.structFilePart.path)"
|
fit="scale-down"
|
/>
|
<p class="slider-title">
|
{{ $t("detailPage.structureDrawing.TR") }}
|
</p>
|
</van-swipe-item>
|
<van-swipe-item
|
v-if="mainSetting.realFilePart.path"
|
style="positiion: relative; background: #fff"
|
>
|
<van-image
|
:src="mainSetting.realFilePart.path"
|
@click="previewImg(mainSetting.realFilePart.path)"
|
fit="scale-down"
|
/>
|
<p class="slider-title">{{ $t("detailPage.modelDrawing.TR") }}</p>
|
</van-swipe-item>
|
|
<van-swipe-item v-if="false"></van-swipe-item>
|
</van-swipe>
|
</div>
|
<van-tabs offset-top="46px" v-model="active" scrollspy sticky>
|
<van-tab
|
v-if="mainSetting.featCurve.ctrVisible"
|
:title="$t('detailPage.curve.TR')"
|
>
|
<LXBChart
|
ref="lxbChartCtrl"
|
v-show="PumpStyle == 0"
|
@cbChangeChartQueryStatus="cbChangeChartQueryStatus"
|
@cbChangeChartQueryData="cbChangeChartQueryData"
|
></LXBChart>
|
|
<ZLBChart v-show="PumpStyle == 1" ref="zlbChartCtrl"></ZLBChart>
|
</van-tab>
|
<van-tab :title="$t('detailPage.parameter.TR')">
|
<LXBSelectMainPoint
|
v-show="PumpStyle == 0"
|
ref="lxbSelectPointCtrl"
|
@cbChangeMotorPower="cbChangeMotorPowerInMainGrid"
|
@cbRefreshByDp="refreshByDp"
|
></LXBSelectMainPoint>
|
<LXBChartPointParas
|
v-show="PumpStyle == 0"
|
ref="lxbChartPointParasCtrl"
|
></LXBChartPointParas>
|
</van-tab>
|
<van-tab :title="$t('detailPage.properties.TR')">
|
<Prop ref="propCtrl"></Prop>
|
</van-tab>
|
<van-tab
|
:title="$t('detailPage.modelDrawing.TR')"
|
v-if="!isShowSwiperImg"
|
>
|
<van-image
|
:src="mainSetting.realFilePart.path"
|
style="height: 242px"
|
@click="previewImg(mainSetting.realFilePart.path)"
|
fit="scale-down"
|
/>
|
</van-tab>
|
<van-tab :title="$t('detailPage.assemblyDrawing.TR')">
|
<van-image
|
:src="mainSetting.assemFilePart.path"
|
style="min-height: 200px"
|
@click="previewImg(mainSetting.assemFilePart.path)"
|
fit="scale-down"
|
/>
|
</van-tab>
|
<van-tab
|
:title="$t('detailPage.material.TR')"
|
v-if="mainSetting.material.tabVisible"
|
>
|
<Material ref="materialCtrl"></Material>
|
</van-tab>
|
<van-tab
|
:title="
|
mainSetting.seriesDoc.ctrVisible
|
? $t('detailPage.document.TR')
|
: $t('detailPage.DocumentNone.TR')
|
"
|
>
|
<Doc v-show="mainSetting.seriesDoc.ctrVisible" ref="docCtrl"></Doc>
|
</van-tab>
|
<van-tab
|
v-show="mainSetting.model3d.tabVisible"
|
:title="$t('detailPage.Model.TR')"
|
>
|
<model3D
|
style="width: 100%; height: 560px"
|
ref="model3dCtrl"
|
></model3D>
|
</van-tab>
|
<!-- <van-tab title="产品属性">
|
</van-tab>-->
|
</van-tabs>
|
<van-popup
|
v-model:show="popupShow"
|
position="right"
|
:style="{
|
height: '100%',
|
width: '200px',
|
overflow: 'auto',
|
backgroundColor: '#ebedf0',
|
}"
|
>
|
<div>
|
<van-collapse v-model="popupActiveNames">
|
<van-collapse-item :title="$t('header.collect.TR')" name="1">
|
<div class="leftMenuItem">
|
<van-cell
|
is-link
|
:title="$t('header.addCollect.TR')"
|
@click="addCollectLocalStorage"
|
icon="add-o"
|
/>
|
<van-cell
|
is-link
|
:title="$t('header.deleteCollect.TR')"
|
@click="deleteCollectLocalStorage"
|
icon="delete-o"
|
/>
|
<van-cell
|
is-link
|
:title="$t('indexPage.myCollection.TR')"
|
@click="toCollectList"
|
icon="star-o"
|
/>
|
</div>
|
</van-collapse-item>
|
<van-collapse-item :title="$t('header.compare.TR')" name="2">
|
<div class="leftMenuItem">
|
<van-cell
|
is-link
|
:title="$t('header.addCompare.TR')"
|
@click="addCompareLocalStorage"
|
icon="add-o"
|
/>
|
<van-cell
|
is-link
|
:title="$t('header.deleteCompare.TR')"
|
@click="deleteCompareLocalStorage"
|
icon="delete-o"
|
/>
|
<van-cell
|
is-link
|
:title="
|
$t('indexPage.compareList.TR') +
|
'(' +
|
compareList.length +
|
')'
|
"
|
@click="toCompareList"
|
>
|
<template #icon>
|
<i class="iconfont iconplus-listview" />
|
</template>
|
</van-cell>
|
</div>
|
</van-collapse-item>
|
</van-collapse>
|
<van-cell
|
v-show="isVisibleReport"
|
title="报告"
|
@click="clickToReport"
|
is-link
|
>
|
<template #icon>
|
<i class="iconfont iconplus-listview" />
|
</template>
|
</van-cell>
|
</div>
|
</van-popup>
|
</div>
|
<div
|
class="compare_icon"
|
v-if="!isAddCompare"
|
@click.stop="addCompareLocalStorage"
|
>
|
<van-icon style="font-size: 28px" name="add-o" />
|
</div>
|
<div class="compare_icon" v-else @click.stop="deleteCompareLocalStorage">
|
<van-icon style="font-size: 28px" name="delete-o" />
|
</div>
|
<div class="backTop" v-show="backtopshow" @click="backTop">
|
<div class="iconfont iconfanhuidingbu3"></div>
|
<div>{{ $t("indexPage.top.TR") }}</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import ConstParas from "@/utils/constParas";
|
import Prop from "./components/Prop.vue"; //属性
|
import Material from "./components/Material.vue"; //材质
|
import LXBChart from "./components/LXBChart.vue";
|
import ZLBChart from "./components/ZLBChart.vue";
|
import LXBSelectMainPoint from "./components/LXBSelectMainPoint.vue"; //右侧详情顶部参数选型表格 -- 离心泵
|
import LXBChartPointParas from "./components/LXBChartPointParas.vue"; //右侧详情底部工作点、最有区域表格 -- 离心泵
|
import Doc from "./components/productDoc.vue"; //文档
|
import { ImagePreview } from "vant"; //图片预览
|
import waterMarkHelper from "@/utils/waterMarkHelper";
|
import model3D from "@/components/model3DContainer.vue";
|
import languageMixin from "@/mixin/language";
|
|
import spumpCorpHelper from "@/utils/spumpCorp";
|
|
export default {
|
mixins: [languageMixin],
|
data() {
|
return {
|
active: 0, //tabs 激活页面下标
|
m_motorAllowMaxPtDict: null, //不同电机 对应不同最大运行区域点
|
|
isAddCompare: false, //是否已经加入比较
|
isVisibleReport: false,
|
pagetitle: "详情", //当前页面的名称
|
pageHeight: 0, //页面高度
|
m_chartDiagram: null, //页面图表对象
|
isShowLoadingFrm: true, //loading
|
propList4Disp: [], //属性列表数据
|
propList4DispOld: [], //属性列表数据
|
backtopshow: false, //返回顶部按钮是否显示
|
images: [],
|
PumpStyle: 0, //当前泵的类型 0表示离心泵 1 表示轴流泵
|
m_pumpBaseInfo: {},
|
isShowSwiperImg: true,
|
m_model3dSetting: {
|
//三维模型设置
|
BimFileLaws: null,
|
CurrentViewModelPath: null, //fbx文件
|
NextViewModelPath: null, //
|
CurrentDsModelPath: null, //rfa文件
|
isInitialFinish: false, //是否加载过
|
IsHaveDim: false, //是否有尺寸
|
LawID: 0,
|
},
|
mainSetting: {
|
featCurve: { tabVisible: true, ctrVisible: true },
|
assemFilePart: {
|
isShowPictrue: false,
|
tabVisible: true,
|
ctrVisible: false,
|
path: "",
|
tabText: "安装图",
|
},
|
assemFileSys: {
|
isShowPictrue: false,
|
tabVisible: false,
|
ctrVisible: false,
|
path: "",
|
tabText: "安装图(机组)",
|
},
|
structFilePart: {
|
isShowPictrue: false,
|
tabVisible: false,
|
ctrVisible: false,
|
path: "",
|
tabText: "结构图",
|
},
|
realFilePart: {
|
isShowPictrue: false,
|
tabVisible: true,
|
ctrVisible: false,
|
path: "",
|
},
|
realFileSys: {
|
isShowPictrue: false,
|
tabVisible: false,
|
ctrVisible: false,
|
path: "",
|
},
|
jiezhi: { tabVisible: false, ctrVisible: false, tabText: " " },
|
seriesDoc: { tabVisible: true, ctrVisible: false, tabText: "文档" },
|
|
material: { tabVisible: false, ctrVisible: false, tabText: " " },
|
chartPoint: { tabVisible: true, ctrVisible: true, tabText: " " },
|
prop: { tabVisible: true, ctrVisible: false, tabText: " " },
|
model3d: { tabVisible: false, ctrVisible: true, tabText: " " },
|
},
|
|
popupShow: false, //右侧弹出层是否显示
|
popupActiveNames: ["1", "2"], //折叠面板展开列表
|
collectList: [], //收藏列表
|
compareList: [], //比较列表
|
};
|
},
|
components: {
|
Prop,
|
Material,
|
LXBChart,
|
ZLBChart,
|
LXBSelectMainPoint,
|
LXBChartPointParas,
|
Doc,
|
model3D,
|
},
|
provide() {
|
return {
|
//cbRefreshByDp: this.refreshByDp, //给子窗体回调
|
cbRefreshByRegionQ: this.refreshRegionByFlow, //给子窗体回调
|
};
|
},
|
created() {
|
let height = document.querySelector("body").clientHeight - 80;
|
this.pageHeight = height > 0 ? height : 500;
|
setTimeout(() => {
|
this.images.splice(0, 1);
|
}, 1000 * 5);
|
},
|
computed: {},
|
mounted() {
|
//判断是否登录
|
var userID = this.$store.state.instante.account.UserID;
|
var viewPageNumber = this.getPageViewNumber(); //浏览次数
|
// if (window.pageConfig.PumpDetailPage.IsMustLogin || viewPageNumber == 0) {
|
// console.log("111")
|
// if (userID == null || userID == 0) {
|
// this.m_isShowLoadingFrm = false;
|
// this.$store.commit(
|
// "instante/account/preLoginPageRoute",
|
// this.$route.fullPath
|
// );
|
// this.$store.dispatch("instante/account/logout");
|
// return;
|
// }
|
// }
|
//从本地存储读取收藏数据
|
let collectList = localStorage.getItem("collectList");
|
collectList = collectList != null ? JSON.parse(collectList) : [];
|
this.collectList = collectList;
|
|
//从本地存储读取比较数据
|
let compareList = localStorage.getItem("compareList");
|
compareList = compareList != null ? JSON.parse(compareList) : [];
|
this.compareList = compareList;
|
|
this.isShowSwiperImg = window.pageConfig.PumpDetailPage.isShowSwiperImg;
|
// console.log(this.$route.query, 22);
|
this.intialPageDetailData();
|
|
this.$nextTick(function () {
|
//移除滚动事件
|
document.removeEventListener("scroll", this.setBackShow, true);
|
//添加滚动事件
|
document.addEventListener("scroll", this.setBackShow, true);
|
});
|
|
// console.log(this.$route,344)
|
},
|
methods: {
|
//修改了区域参数的流量(表示单位)
|
refreshRegionByFlow(std_unit_flow, tag) {
|
//console.log(user_unit_flow,tag,414)
|
var _this = this;
|
//判断当前是否是离心泵
|
if (this.PumpStyle == ConstParas.PumpStyle.LXP) {
|
var grp_pt = _this.$refs.lxbChartCtrl.refreshRegionByFlow(
|
std_unit_flow,
|
tag
|
);
|
// console.log("refreshRegionByFlow", grp_pt);
|
if (grp_pt != null) {
|
this.$refs.lxbChartPointParasCtrl.refreshRegionPtParas(grp_pt, tag);
|
}
|
|
// _this.calcChartPointGrid();
|
}
|
},
|
getPageViewNumber() {
|
//获取进入页面的次数
|
//console.log(this.$route.fullPath,372)
|
let ViewPageNumber = localStorage.getItem("ViewPageNumber");
|
//console.log(ViewPageNumber, 300);
|
if (ViewPageNumber) {
|
if (ViewPageNumber > 0) {
|
localStorage.setItem("ViewPageNumber", ViewPageNumber - 1);
|
}
|
} else {
|
localStorage.setItem(
|
"ViewPageNumber",
|
window.pageConfig.PumpDetailPage.ViewPageNumber - 1
|
);
|
ViewPageNumber = localStorage.getItem("ViewPageNumber");
|
}
|
return ViewPageNumber;
|
},
|
//跳转到我的收藏页面
|
toCollectList() {
|
this.gotoPage("Collect/Index", "", null);
|
// this.$router.push({
|
// path: `/${this.$getCurrentLanguageUrl()}/Collect/Index`
|
// });
|
},
|
//加入收藏
|
addCollectLocalStorage() {
|
let userID = this.$store.state.instante.account.UserID;
|
// if (userID == null || userID == 0) {
|
// this.$store.commit(
|
// "instante/account/preLoginPageRoute",
|
// this.$route.fullPath
|
// );
|
// this.$store.dispatch("instante/account/logout");
|
// return;
|
// }
|
|
let id = this.$route.query.PID;
|
if (id == "") {
|
return;
|
}
|
let collectItem = {
|
PumpName: this.pagetitle,
|
PID: id,
|
SID: this.$route.query.SID,
|
from: this.$route.query.from,
|
pur: this.$route.query.pur,
|
};
|
// 获取
|
let collectList = localStorage.getItem("collectList");
|
collectList = collectList != null ? JSON.parse(collectList) : [];
|
// console.log(collectList, 218);
|
let ids = collectList.map((item) => {
|
return item.PID;
|
});
|
|
let index = ids.indexOf(id);
|
if (index != -1) {
|
this.$toast({
|
message: `${this.$t("header.collecExists.TR")}`,
|
type: "fail",
|
});
|
return;
|
}
|
collectList.push(collectItem);
|
if (collectList.length > 15) {
|
// collectList.splice(0, 1);
|
}
|
let json = JSON.stringify(collectList);
|
//存储
|
localStorage.setItem("collectList", json);
|
this.collectList = collectList;
|
this.$toast({
|
message: `${this.$t("header.collectSuccess.TR")}`,
|
type: "success",
|
});
|
},
|
//清除收藏
|
deleteCollectLocalStorage() {
|
this.$dialog
|
.confirm({
|
message: `${this.$t("header.confirmClearCollect.TR")}`,
|
})
|
.then(() => {
|
localStorage.removeItem("collectList");
|
this.collectList = [];
|
this.$toast({
|
message: `${this.$t("header.clearCollectSueecss.TR")}`,
|
type: "success",
|
});
|
})
|
.catch(() => {
|
// on cancel
|
});
|
},
|
//跳转比较列表页面
|
toCompareList() {
|
if (this.compareList.length < 2) {
|
this.$toast({
|
message: `${this.$t("header.compareTip.TR")}`,
|
type: "fail",
|
});
|
return;
|
}
|
this.gotoPage("/Compare/Index", "", null);
|
|
// this.$router.push({
|
// path: `/${this.$getCurrentLanguageUrl()}/Compare/Index`
|
// });
|
},
|
//加入比较
|
addCompareLocalStorage() {
|
let userID = this.$store.state.instante.account.UserID;
|
// if (userID == null || userID == 0) {
|
// this.$store.commit(
|
// "instante/account/preLoginPageRoute",
|
// this.$route.fullPath
|
// );
|
// this.$store.dispatch("instante/account/logout");
|
// return;
|
// }
|
|
let id = this.$route.query.PID;
|
if (id == "") {
|
return;
|
}
|
this.isAddCompare = true;
|
let compareItem = {
|
PumpName: this.pagetitle,
|
PID: id,
|
SID: this.$route.query.SID,
|
from: this.$route.query.from,
|
pur: this.$route.query.pur,
|
};
|
// 获取
|
let compareList = localStorage.getItem("compareList");
|
compareList = compareList != null ? JSON.parse(compareList) : [];
|
// console.log(collectList, 218);
|
let ids = compareList.map((item) => {
|
return item.PID;
|
});
|
|
let index = ids.indexOf(id);
|
if (index != -1) {
|
this.$toast({
|
message: `${this.$t("header.comparisonAdded.TR")}`,
|
type: "fail",
|
});
|
return;
|
}
|
compareList.push(compareItem);
|
if (compareList.length > 15) {
|
// compareList.splice(0, 1);
|
}
|
let json = JSON.stringify(compareList);
|
//存储
|
localStorage.setItem("compareList", json);
|
this.compareList = compareList;
|
this.$toast({
|
message: `${this.$t("header.addComparSueecss.TR")}`,
|
type: "success",
|
});
|
},
|
//清除比较
|
deleteCompareLocalStorage() {
|
this.$dialog
|
.confirm({
|
message: `${this.$t("header.clearComparList.TR")}`,
|
})
|
.then(() => {
|
localStorage.removeItem("compareList");
|
this.compareList = [];
|
this.isAddCompare = false;
|
this.$toast({
|
message: `${this.$t("header.clearComparSuccess.TR")}`,
|
type: "success",
|
});
|
})
|
.catch(() => {
|
// on cancel
|
});
|
},
|
|
deleteCollect(i) {
|
//删除单个收藏
|
// console.log(i, 97);
|
this.$dialog
|
.confirm({
|
message: `${this.$t("header.confirmDelCollect.TR")}?`,
|
})
|
.then(() => {
|
this.collectList.splice(i, 1);
|
let json = JSON.stringify(this.collectList);
|
localStorage.setItem("collectList", json);
|
this.$toast({
|
message: `${this.$t("header.deleteSuccess.TR")}`,
|
type: "success",
|
});
|
})
|
.catch(() => {
|
// on cancel
|
});
|
},
|
//点击跳转到报告页面
|
clickToReport() {
|
this.gotoPage("/SelectReport", "", null);
|
|
// this.$router.push({
|
// path: `/${this.$getCurrentLanguageUrl()}/SelectReport`
|
// });
|
},
|
|
//获取整个页面初始的详情数据
|
intialPageDetailData() {
|
// console.log(this.$route.query,242)
|
this.m_pageFrom = this.$route.query.from;
|
this.m_pagePurpose = this.$route.query.pur;
|
|
let _this = this;
|
//var config = DetailConfig.detailPageConfig; //详情页面配置文件
|
|
var jieZhiParas = {
|
ID: 0,
|
MiDu: 1000,
|
NianDu: 1,
|
Name: "water",
|
isNdCor: false,
|
};
|
|
jieZhiParas.ID = this.$route.query.jzid || "0";
|
jieZhiParas.MiDu = this.$route.query.jzmd || 1000;
|
jieZhiParas.NianDu = this.$route.query.jznd || 1;
|
jieZhiParas.Name = this.$route.query.jzmz || "water";
|
jieZhiParas.isNdCor = this.$route.query.isndc || false;
|
|
_this.jieZhiParas = jieZhiParas;
|
|
let requestData = {
|
Purpose: this.m_pagePurpose || "",
|
SID: this.$route.query.SID || 2,
|
PID: this.$route.query.PID || 1,
|
SubID: this.$route.query.SubID || "",
|
|
DpQ: this.$route.query.DpQ || "",
|
DpH: this.$route.query.DpH || "",
|
DpQu: this.$route.query.DpQu || "0",
|
DpHu: this.$route.query.DpHu || "1",
|
|
FirePumpType: this.$route.query.fpt || "0",
|
DriveType: "",
|
DriveSpeed: "",
|
jzID: jieZhiParas.ID || "",
|
jzMiDu: jieZhiParas.jzMiDu || "1000",
|
jzNianDu: jieZhiParas.jzNianDu || "1",
|
jzName: jieZhiParas.jzName || "",
|
isNdCor: jieZhiParas.isNdCor || false,
|
|
UID: this.$store.state.instante.account.UserID || 0,
|
UType: this.$store.state.instante.account.UserType || 0,
|
Lang: this.getCurrentLanguageType(),
|
// TolGrade: this.$route.query.TGrade || 0,
|
// TolRatioMinQ: this.$route.query.TRatioMinQ || 0,
|
// TolRatioMaxQ: this.$route.query.TRatioMaxQ || 0,
|
// TolRatioMinH: this.$route.query.TRatioMinH || 0,
|
// TolRatioMaxH: this.$route.query.TRatioMaxH || 0,
|
|
SoftType: this.$globalConfig.SoftType,
|
SystemInfo: "",
|
};
|
|
let url =
|
this.$globalConfig.WebApiUrl.MainUrl +
|
"v1/Mobile/PumpDetailByPara/InitialInfo";
|
//console.log(url,326)
|
this.$axios({
|
url: url,
|
method: "post",
|
data: requestData,
|
}).then(function (res) {
|
_this.isShowLoadingFrm = false;
|
|
let resdata = res.data;
|
// console.log(res.data, 462);
|
if (resdata.Code != 0) {
|
_this.$toast.fail(resdata.Message);
|
return;
|
}
|
var pumpInfoData = resdata.Data; //泵详细所有数据
|
if (pumpInfoData == null) {
|
return;
|
}
|
|
let pumpBaseInfo = pumpInfoData.BaseInfo;
|
if (pumpBaseInfo == null) {
|
return;
|
}
|
//console.log(pumpInfoData, 467);
|
|
var pumpBaseInfo_g = {};
|
pumpBaseInfo_g.SeriesID = pumpBaseInfo.SeriesID;
|
pumpBaseInfo_g.PumpID = pumpBaseInfo.PumpID;
|
pumpBaseInfo_g.SubID = pumpBaseInfo.SubID;
|
pumpBaseInfo_g.CatalogName = pumpBaseInfo.CatalogName || "";
|
pumpBaseInfo_g.SeriesName = pumpBaseInfo.SeriesName || "";
|
pumpBaseInfo_g.PumpName = pumpBaseInfo.PumpName || "";
|
pumpBaseInfo_g.FirePumpType = pumpBaseInfo.FirePumpType || 0;
|
pumpBaseInfo_g.DriveType = requestData.DriveType; //驱动方式
|
pumpBaseInfo_g.DriveSpeed = requestData.DriveSpeed; //柴油机转速
|
pumpBaseInfo_g.PumpStyle = pumpBaseInfo.PumpStyle;
|
pumpBaseInfo_g.CorpID = pumpBaseInfo.CorpID;
|
|
_this.m_pumpBaseInfo = pumpBaseInfo_g;
|
|
_this.PumpStyle = pumpBaseInfo.PumpStyle;
|
_this.pagetitle = pumpBaseInfo.PumpName;
|
document.title = _this.pagetitle;
|
|
//三维模型
|
_this.m_model3dSetting.BimFileLaws = pumpInfoData.BimFileLaws;
|
|
//产品属性
|
_this.$refs.propCtrl.setImageFilePath(function (type, file) {
|
// console.log(type,file,649)
|
_this.setImageFile(type, file);
|
});
|
_this.$refs.propCtrl.setChangePartPropListCb(function (propList) {
|
//修改了产品属性
|
_this.setBimFileByChangeProp(propList); //BIM 文件
|
});
|
_this.$refs.propCtrl.initialData(
|
pumpBaseInfo,
|
pumpInfoData.PartFullInfo
|
);
|
|
//
|
var attacheList = resdata.Data.AttachFiles;
|
if (attacheList.length > 0) {
|
//console.log(attacheList,403)
|
_this.mainSetting.seriesDoc.tabVisible = true;
|
_this.mainSetting.seriesDoc.ctrVisible = true;
|
_this.$refs.docCtrl.initAttachFiles(
|
attacheList,
|
pumpBaseInfo.SeriesID
|
);
|
_this.$refs.docCtrl.getSeriesID(pumpBaseInfo.SeriesID);
|
} else {
|
_this.mainSetting.seriesDoc.tabVisible = false;
|
_this.mainSetting.seriesDoc.ctrVisible = false;
|
}
|
|
//材料
|
var allMaterialGrpList = pumpInfoData.MaterialGrpList;
|
if (allMaterialGrpList && allMaterialGrpList.length > 0) {
|
_this.mainSetting.material.tabVisible = true;
|
_this.$nextTick(function () {
|
_this.$refs.materialCtrl.initialData(allMaterialGrpList);
|
});
|
} else {
|
_this.mainSetting.material.tabVisible = false;
|
}
|
//图表控件
|
if (pumpBaseInfo.PumpStyle == ConstParas.PumpStyle.LXP) {
|
// _this.m_motorAllowMaxPtDict =
|
// pumpInfoData.ChartPointPara.MotorAllowMaxPtDict;
|
|
_this.m_motorAllowMaxPtDict =
|
pumpInfoData.ChartPointPara.MotorAllowMaxPtDict;
|
|
//判断当前是否是离心泵
|
_this.$refs.lxbChartCtrl.initPumpInfoData(pumpInfoData);
|
_this.$refs.lxbSelectPointCtrl.initPumpInfoData(pumpInfoData);
|
_this.$refs.lxbChartPointParasCtrl.initPumpInfoData(pumpInfoData);
|
} else if (pumpBaseInfo.PumpStyle == ConstParas.PumpStyle.ZLP) {
|
//判断当前是否是轴流泵
|
//console.log( _this.$refs.zlbChartCtrl);
|
_this.$refs.zlbChartCtrl.initPumpInfoData(pumpInfoData);
|
}
|
});
|
},
|
//子组件 修改设计点 刷新页面
|
refreshByDp(designPointParas) {
|
//console.log(designPointParas, 673);
|
if (designPointParas == null) return;
|
if (designPointParas.DpQ == null) return;
|
if (designPointParas.DpH == null) return;
|
|
let UserType = this.$store.state.instante.account.UserType;
|
let UserID = this.$store.state.instante.account.UserID;
|
|
let _this = this;
|
|
//console.log(_this, 275);
|
|
let requestData = {
|
SID: _this.m_pumpBaseInfo.SeriesID,
|
PID: _this.m_pumpBaseInfo.PumpID,
|
SubID: _this.m_pumpBaseInfo.SubID,
|
|
DpQ: designPointParas.DpQ,
|
DpH: designPointParas.DpH,
|
DpQu: designPointParas.DpQu,
|
DpHu: designPointParas.DpHu,
|
|
jzID: _this.jieZhiParas.jzID || "0",
|
jzMiDu: _this.jieZhiParas.jzMiDu || "1000",
|
jzNianDu: _this.jieZhiParas.jzNianDu || "1",
|
jzName: _this.jieZhiParas.jzName || "",
|
isNdCor: _this.jieZhiParas.isNdCor || false,
|
|
FirePumpType: _this.m_pumpBaseInfo.FirePumpType || "0",
|
|
DriveType: _this.m_pumpBaseInfo.DriveType || "", //驱动方式
|
DriveSpeed: _this.m_pumpBaseInfo.DriveSpeed || "", //柴油机转速
|
|
UID: UserID,
|
UType: UserType,
|
Lang: _this.getCurrentLanguageType(),
|
};
|
//console.log(requestData)
|
let url =
|
this.$globalConfig.WebApiUrl.MainUrl +
|
"v1/Mobile/PumpDetailByPara/CalcByDp";
|
|
_this.m_isShowLoadingFrm = true;
|
this.$axios({
|
url: url,
|
method: "post",
|
data: requestData,
|
}).then(function (res) {
|
_this.m_isShowLoadingFrm = false;
|
|
let resdata = res.data;
|
if (resdata.Code != 0) {
|
_this.$message(resdata.Message);
|
return;
|
}
|
|
let pumpInfoData = resdata.Data;
|
if (pumpInfoData == null) {
|
_this.$message("error:684");
|
return;
|
}
|
|
if (pumpInfoData.ChartPointPara) {
|
_this.m_motorAllowMaxPtDict =
|
pumpInfoData.ChartPointPara.MotorAllowMaxPtDict;
|
}
|
//获取数据后调用离心泵图表组件的方法重新绘制图表
|
if (_this.PumpStyle == ConstParas.PumpStyle.LXP) {
|
// console.log(pumpInfoData, "刷新后的数据");
|
_this.$refs.lxbChartCtrl.refreshByDp(pumpInfoData);
|
_this.$refs.lxbSelectPointCtrl.refreshPumpInfoData(pumpInfoData);
|
_this.$refs.lxbChartPointParasCtrl.refreshPumpInfoData(pumpInfoData);
|
}
|
//获取数据后调用离心泵图表组件的方法重新绘制图表
|
else if (_this.PumpStyle == ConstParas.PumpStyle.ZLP) {
|
// console.log(pumpInfoData, "刷新后的数据");
|
_this.$refs.zlbChartCtrl.refreshByDp(pumpInfoData);
|
_this.$refs.zlbSelectPointCtrl.refreshPumpInfoData(pumpInfoData);
|
_this.$refs.zlbChartPointParasCtrl.refreshPumpInfoData(pumpInfoData);
|
}
|
});
|
},
|
//修改参数选型电机功率下拉的值
|
cbChangeMotorPowerInMainGrid(val) {
|
// console.log(val,762)
|
if (this.PumpStyle == ConstParas.PumpStyle.LXP) {
|
//通知属性
|
this.$refs.propCtrl.setMotorPowerValue(val);
|
if (this.m_motorAllowMaxPtDict != null) {
|
var allowMaxPointQ = this.m_motorAllowMaxPtDict[val];
|
if (allowMaxPointQ != null) {
|
/*var userUnit_flow =
|
this.$refs.lxbChartCtrl.convertFlowToUserUnit(allowMaxPointQ);*/
|
this.refreshRegionByFlow(allowMaxPointQ, "AllowMaxPointQ");
|
}
|
}
|
}
|
if (this.PumpStyle == ConstParas.PumpStyle.ZLP) {
|
//通知属性
|
this.$refs.propCtrl.setMotorPowerValue(val);
|
|
if (this.m_motorAllowMaxPtDict != null) {
|
var allowMaxPointQ = this.m_motorAllowMaxPtDict[val];
|
if (allowMaxPointQ != null) {
|
/*var userUnit_flow =
|
this.$refs.lxbChartCtrl.convertFlowToUserUnit(allowMaxPointQ);*/
|
this.refreshRegionByFlow(allowMaxPointQ, "AllowMaxPointQ");
|
}
|
}
|
}
|
},
|
//修改查询状态(给子控件调用)
|
cbChangeChartQueryStatus(val) {
|
if (this.PumpStyle == ConstParas.PumpStyle.LXP) {
|
this.$refs.lxbChartPointParasCtrl.setChartQueryStatus(val);
|
}
|
},
|
//修改查询值(给子控件调用)
|
cbChangeChartQueryData(val) {
|
if (this.PumpStyle == ConstParas.PumpStyle.LXP) {
|
this.$refs.lxbSelectPointCtrl.buildChartQueryData(val);
|
}
|
},
|
//设置BIM文件
|
setBimFileByChangeProp(propList) {
|
var bimFileLaws = this.m_model3dSetting.BimFileLaws;
|
if (bimFileLaws == null || bimFileLaws.length == 0) return;
|
if (propList == null || propList.length == 0) return;
|
var ok_bimFileLaw = null;
|
if (bimFileLaws.length == 1) {
|
ok_bimFileLaw = bimFileLaws[0];
|
} else {
|
bimFileLaws.forEach((bimFileLaw) => {
|
var propFilters = bimFileLaw.PropFilters;
|
var isAllAcoord = true;
|
if (propFilters != null) {
|
for (var i = 0; i < propFilters.length; i++) {
|
var isAccordPropValue = false;
|
for (var j = 0; j < propList.length; j++) {
|
if (
|
propFilters[i].ID == propList[j].ID &&
|
propFilters[i].Value == propList[j].PropValue
|
) {
|
isAccordPropValue = true;
|
break;
|
}
|
}
|
if (!isAccordPropValue) {
|
isAllAcoord = false;
|
break;
|
}
|
}
|
}
|
if (isAllAcoord) {
|
ok_bimFileLaw = bimFileLaw;
|
return false;
|
}
|
});
|
}
|
if (ok_bimFileLaw == null) return;
|
if (ok_bimFileLaw.FileLaw4View == null) return;
|
|
var isHaveDim = ok_bimFileLaw.IsHaveDim;
|
var view_file_path = this.BuildBimFilePath(
|
propList,
|
ok_bimFileLaw.FileLaw4View
|
);
|
var ds_file_path = this.BuildBimFilePath(
|
propList,
|
ok_bimFileLaw.FileLaw4Ds
|
);
|
if (view_file_path == null || view_file_path == "") return;
|
if (view_file_path.indexOf(".") <= 0) {
|
view_file_path = view_file_path + ".fbx";
|
}
|
if (isHaveDim == null) this.m_model3dSetting.IsHaveDim = false;
|
else this.m_model3dSetting.IsHaveDim = isHaveDim;
|
this.m_model3dSetting.LawID = ok_bimFileLaw.ID;
|
this.m_model3dSetting.NextViewModelPath =
|
spumpCorpHelper.buildSeriesFileUrl(
|
this.m_pumpBaseInfo.SeriesID,
|
"/BIM/" + view_file_path
|
);
|
|
if (ds_file_path) {
|
if (!ds_file_path.endsWith(".rfa")) {
|
ds_file_path = ds_file_path + ".rfa";
|
}
|
this.m_model3dSetting.CurrentDsModelPath =
|
spumpCorpHelper.buildSeriesFileUrl(
|
this.m_pumpBaseInfo.SeriesID,
|
"/BIM/" + ds_file_path
|
);
|
} else {
|
this.m_model3dSetting.CurrentDsModelPath = null;
|
}
|
|
this.mainSetting.model3d.tabVisible = true;
|
if (this.mainSetting.model3d.ctrVisible) this.loadModel3DFile();
|
},
|
//模型组件内点击下载按钮调用函数
|
downloadModel3D() {
|
var _this = this;
|
let FilePath = _this.m_model3dSetting.CurrentDsModelPath;
|
if (FilePath == null) return false;
|
var userID = this.$store.state.instante.account.UserID;
|
var userType = this.$store.state.instante.account.UserType;
|
|
if (userID == null || userID == 0) {
|
this.gotoLoginPage();
|
return;
|
}
|
//
|
//if (userType != ConstParas.UserType.Employee) {
|
this.$message("你没有下载权限,请联系 管理员 开通权限后下载");
|
return;
|
// }
|
|
// let a = document.createElement("a"); // 生成一个a元素
|
// let event = new MouseEvent("click"); // 创建一个单击事件
|
// a.href = FilePath; // 将生成的URL设置为a.href属性
|
// a.dispatchEvent(event); // 触发a的单击事件
|
},
|
//构建BIM路径
|
BuildBimFilePath(propList, fileLawList) {
|
if (fileLawList == null) return null;
|
if (fileLawList == null) return null;
|
var fileName_law = "";
|
for (var i in fileLawList) {
|
var law = fileLawList[i];
|
if (law.ItemType == 0 && law.PropID != null) {
|
//产品属性
|
}
|
if (law.ItemType == 1 && this.m_pumpBaseInfo.PumpName) {
|
//产品型号
|
var pumpName = this.m_pumpBaseInfo.PumpName.replace("/", "-")
|
.replace("\\", "-")
|
.replace("*", "-");
|
fileName_law += pumpName;
|
if (fileLawList.length > 1) {
|
fileName_law += this.GetFilePrefix(law);
|
}
|
}
|
if (law.ItemType == 2 && this.m_pumpBaseInfo.PartNO) {
|
//产品编号
|
fileName_law += this.m_pumpBaseInfo.PartNO;
|
if (fileLawList.length > 1) {
|
fileName_law += this.GetFilePrefix(law);
|
}
|
}
|
if (law.ItemType == 3 && this.m_pumpBaseInfo.PartCode) {
|
//产品图号
|
fileName_law += this.m_pumpBaseInfo.PartCode;
|
if (fileLawList.length > 1) {
|
fileName_law += this.GetFilePrefix(law);
|
}
|
}
|
if (law.ItemType == 4) {
|
//固定
|
if (law.CodeLawList != null && law.CodeLawList.length > 0) {
|
fileName_law += law.CodeLawList[0].Key;
|
fileName_law += this.GetFilePrefix(law);
|
}
|
}
|
}
|
|
var lastStr = fileName_law[fileName_law.length - 1];
|
if (
|
lastStr == "\\" ||
|
lastStr == "/" ||
|
lastStr == "_" ||
|
lastStr == "-"
|
) {
|
fileName_law = fileName_law.substring(0, fileName_law.length - 1);
|
}
|
|
return fileName_law;
|
},
|
//
|
GetFilePrefix(law) {
|
var FilePrefix = law.FilePrefix;
|
if (FilePrefix == "\\") return "/";
|
else return FilePrefix;
|
},
|
//设置图片
|
setImageFile(type, file) {
|
//
|
if (type == "AssemImagePart") {
|
if (file) {
|
this.mainSetting.assemFilePart.tabVisible = true;
|
//console.log(file)
|
waterMarkHelper.addImage(file, null, (base64Url) => {
|
this.mainSetting.assemFilePart.path = base64Url;
|
});
|
}
|
}
|
if (type == "AssemImageSys") {
|
if (file) {
|
this.mainSetting.assemFileSys.tabVisible = true;
|
waterMarkHelper.addImage(file, null, (base64Url) => {
|
this.mainSetting.assemFileSys.path = base64Url;
|
});
|
} else {
|
this.mainSetting.assemFileSys.tabVisible = false;
|
}
|
}
|
if (type == "RealImagePart") {
|
if (file) {
|
//this.mainSetting.realFilePart.path = file;
|
waterMarkHelper.addImage(file, null, (base64Url) => {
|
this.mainSetting.realFilePart.path = base64Url;
|
});
|
}
|
}
|
if (type == "StructImagePart") {
|
if (file) {
|
// this.mainSetting.structFilePart.path = file;
|
waterMarkHelper.addImage(file, null, (base64Url) => {
|
this.mainSetting.structFilePart.path = base64Url;
|
});
|
}
|
}
|
},
|
//加载三维模型
|
loadModel3DFile() {
|
let _this = this;
|
var model3dSetting = this.m_model3dSetting;
|
if (
|
model3dSetting.CurrentViewModelPath == model3dSetting.NextViewModelPath
|
)
|
return;
|
model3dSetting.CurrentViewModelPath = model3dSetting.NextViewModelPath;
|
//console.log(model3dSetting.CurrentViewModelPath)
|
this.m_model3dSetting = model3dSetting;
|
|
if (this.m_model3dSetting.isInitialFinish == false) {
|
//下载三维模型
|
_this.$refs.model3dCtrl.setLoadModelCommandCb(function () {
|
return _this.downloadModel3D();
|
});
|
}
|
/*const loading = _this.$loading({
|
target: document.querySelector("body"),
|
lock: true,
|
background: "rgba(0, 0, 0, 0.7)",
|
});*/
|
|
//加载三维模型
|
this.$refs.model3dCtrl.loadModel(
|
model3dSetting.CurrentViewModelPath,
|
true,
|
function (val) {
|
// console.log(val);
|
_this.mainSetting.model3d.isInitialFinish = true; //
|
//loading.close();
|
var corp_api_url = spumpCorpHelper.getCorpMainApiRurl(
|
_this.m_pumpBaseInfo.CorpID
|
);
|
if (corp_api_url == null) {
|
return;
|
}
|
var corp_sei_id = spumpCorpHelper.getIdByCSID(
|
_this.m_pumpBaseInfo.SeriesID
|
);
|
if (corp_sei_id == null) {
|
//loading_frm.close();
|
return;
|
}
|
|
if (model3dSetting.IsHaveDim && model3dSetting.LawID > 0) {
|
//console.log(corp_api_url + "v1/ModelLibrary/GetProductDimList");
|
let fileName = _this.m_pumpBaseInfo.PumpName.replace("/", "-");
|
_this
|
.$axios({
|
url: corp_api_url + "v1/ModelLibrary/GetProductDimList",
|
method: "get",
|
params: {
|
SeriesID: corp_sei_id.SeriesID,
|
LawID: model3dSetting.LawID,
|
FileName: fileName,
|
Lang: 0,
|
},
|
})
|
.then((res) => {
|
//
|
if (res.data.Code != 0) {
|
_this.$refs.model3dCtrl.setDimDisplay(false);
|
_this.$message(res.data.Message);
|
return;
|
}
|
|
_this.$refs.model3dCtrl.updateSizeValue(res.data.Data);
|
_this.$refs.model3dCtrl.setDimDisplay(true);
|
})
|
.catch((err) => {
|
console.log("校验失败");
|
return;
|
});
|
}
|
}
|
);
|
},
|
|
//图片预览
|
previewImg(path) {
|
// console.log(path,439)
|
let imgViewList = [];
|
imgViewList.push(path);
|
ImagePreview({ images: imgViewList, closeable: true });
|
},
|
//返回上一页
|
pageBack() {
|
let routerPath = this.$route.query;
|
// console.log(routerPath, 783);
|
this.$router.go(-1);
|
},
|
setBackShow() {
|
if (this.$refs.pagebox) {
|
let top = this.$refs.pagebox.getBoundingClientRect().top;
|
// console.log(top)
|
if (top < -700) {
|
this.backtopshow = true;
|
} else {
|
this.backtopshow = false;
|
}
|
}
|
},
|
backTop() {
|
let timer = setInterval(function () {
|
//获取滚动条的滚动高度
|
var osTop =
|
document.documentElement.scrollTop || document.body.scrollTop;
|
//用于设置速度差,产生缓动的效果
|
var speed = Math.floor(-osTop / 6);
|
document.documentElement.scrollTop = document.body.scrollTop =
|
osTop + speed;
|
// let isTop = true; //用于阻止滚动事件清除定时器
|
if (osTop == 0) {
|
clearInterval(timer);
|
}
|
}, 30);
|
},
|
},
|
watch: {
|
$route(to, from) {
|
// console.log(to, from, 714);
|
if (to.fullPath != from.fullPath) {
|
this.$router.go(0);
|
}
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss">
|
.DetailByParamsBox {
|
background: #ebedf0;
|
width: 100%;
|
height: 100vh;
|
.DetailByParamsMain {
|
width: 100%;
|
height: 100%;
|
padding-top: 46px;
|
box-sizing: border-box;
|
.swipe_box {
|
height: 250px;
|
width: 100%;
|
.van-image {
|
height: 100%;
|
width: 100%;
|
}
|
.picture_swiper {
|
height: 100%;
|
width: 100%;
|
img {
|
height: 100%;
|
width: 100%;
|
}
|
}
|
}
|
.van-image__error,
|
.van-image__loading {
|
background: #fff;
|
}
|
.van-tabs__content {
|
background: #ebedf0;
|
}
|
|
.van-tab__panel,
|
.van-tab__panel-wrapper {
|
margin: 10px;
|
border: 1px solid #ccc;
|
width: calc(100% - 20px);
|
background-color: #fff;
|
border-radius: 10px;
|
padding: 5px;
|
}
|
|
.custom_table {
|
border: 1px solid #cecece;
|
}
|
|
.custom_table > thead > tr > th {
|
border: 1px solid #cecece;
|
height: 30px;
|
text-align: center;
|
background-color: #f7f7f7;
|
}
|
|
.custom_table > tbody > tr > td {
|
border: 1px solid #cecece;
|
height: 30px;
|
text-align: center;
|
}
|
|
.kuaiDiv {
|
position: relative;
|
width: 100%;
|
border-top: 1px solid #ccc;
|
padding: 0px;
|
margin-bottom: 10px;
|
}
|
.kuaiDiv:first-of-type {
|
border-top: 0px;
|
}
|
.chanPinTitle {
|
margin-bottom: 0;
|
margin-top: 0;
|
padding: 4px;
|
position: absolute;
|
// border-top: 1px solid #ccc;
|
padding-left: 10px;
|
font-family: "Open Sans", sans-serif;
|
font-weight: 600;
|
}
|
.chanPinDiv {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
width: 100%;
|
margin: 5px 0;
|
padding: 0;
|
font-weight: 500;
|
}
|
.chanPinContent {
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-weight: 500;
|
font-size: 14px;
|
padding-left: 20px;
|
line-height: 20px;
|
.van-cell {
|
padding: 0;
|
line-height: 18px;
|
}
|
}
|
}
|
.backTop {
|
position: fixed;
|
width: 50px;
|
height: 50px;
|
right: 10px;
|
bottom: 30px;
|
border-radius: 100%;
|
text-align: center;
|
background-color: #fff;
|
}
|
|
.backTop > div:first-of-type {
|
height: 25px;
|
font-size: 28px;
|
text-align: center;
|
}
|
|
.backTop > div:last-of-type {
|
height: 20px;
|
line-height: 18px;
|
font-size: 10px;
|
text-align: center;
|
}
|
.slider-title {
|
position: absolute;
|
line-height: 30px;
|
font-size: 14px;
|
background: #528abe;
|
color: #ffffff;
|
z-index: 10;
|
bottom: 0px;
|
margin: 0px;
|
width: 100%;
|
text-align: start;
|
opacity: 0.6;
|
}
|
.compare_icon {
|
position: fixed;
|
right: 15px;
|
font-size: 22px;
|
bottom: 215px;
|
width: 40px;
|
height: 40px;
|
color: #ffffff;
|
border-radius: 50%;
|
line-height: 50px;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
opacity: 0.6;
|
}
|
}
|
.DetailByParamsBox .DetailByParamsMain .van-tab__pane {
|
margin: 10px;
|
border: 1px solid #ccc;
|
width: calc(100% - 20px);
|
background-color: #fff;
|
border-radius: 10px;
|
padding: 5px;
|
}
|
</style>
|