From 7aea7ff13c1b1a12a800d9436799b5698b67702f Mon Sep 17 00:00:00 2001 From: tanghaolin <1723298894@qq.com> Date: 星期四, 20 二月 2025 16:46:45 +0800 Subject: [PATCH] 添加订单支付静态页面 --- src/components/Chart/MultiSpeedChart.vue | 2412 +++++++++++++++++++++++++--------------------------------- 1 files changed, 1,027 insertions(+), 1,385 deletions(-) diff --git a/src/components/Chart/MultiSpeedChart.vue b/src/components/Chart/MultiSpeedChart.vue index e0409ab..f27cf25 100644 --- a/src/components/Chart/MultiSpeedChart.vue +++ b/src/components/Chart/MultiSpeedChart.vue @@ -1,1399 +1,1041 @@ <template> - <!-- 鍙橀�熸洸绾� --> - <div id="chartBox" style="width: 100%; height: 100%" class="performanceCurveBox" v-loading="state.m_loadingPage"> - <div class="chartBar" v-if="false"> - <div class="multispeed-tools-div"> - <!-- 鏇茬嚎鏌ヨ鎸夐挳 --> - <a ref="paramQueryCtrl" v-click-outside="onParamQueryClickOutside" @click="btnClickChartQuery" - class="diagram multispeed_chart_btn default blue-stripe"> - <i class="iconfont iconsearch" style="font-size: 0.12rem"></i> - <span style="margin-left: 0.01rem"> - {{ t("detailPage.parameterQuery.TR") }} - </span> - </a> - <!-- 閫熷害鍒楄〃 --> - <a ref="multiSpeedCtrl" v-click-outside="onDispMenuClickOutside" - class="diagram multispeed_chart_btn default blue-stripe"> - <i class="iconfont iconshebeisheshi" style="font-size: 0.12rem"></i> - <span style="margin-left: 0.01rem">{{ - t("detailPage.speedList.TR") - }}</span> - </a> - <!-- 鏄剧ず璁剧疆 --> - <a ref="dispMenuCtrl" v-click-outside="onDispMenuClickOutside" - class="diagram multispeed_chart_btn default blue-stripe"> - <i class="iconfont iconshebeisheshi" style="font-size: 0.12rem"></i> - <span style="margin-left: 0.01rem">{{ - t("detailPage.displaySettings.TR") - }}</span> - </a> - <!-- 瀵煎嚭鍥捐〃 --> - <el-dropdown placement="bottom"> - <a class="diagram multispeed_chart_btn default blue-stripe"> - <i class="iconfont icondaochu1" style="font-size: 0.12rem"></i> - <span style="margin-left: 0.01rem">{{ - t("detailPage.curveExport.TR") - }}</span> - </a> - <template #dropdown> - <el-dropdown-menu> - <el-dropdown-item @click="btnClickExportChartImage"><i class="iconfont iconshiwutupian" - style="font-size: 0.28rem"></i>{{ t("detailPage.picture.TR") }}</el-dropdown-item> - <el-dropdown-item @click="btnClickExportChartCAD"><i class="iconfont icontubiao_daoruCAD" - style="font-size: 0.28rem"></i>CAD</el-dropdown-item> - </el-dropdown-menu> - </template> - </el-dropdown> - - <!-- 鍙傛暟鏌ヨ鏄剧ず/闅愯棌 --> - <el-popover ref="Param_Query_popoverRef" :virtual-ref="paramQueryCtrl" trigger="click" :show-arrow="false" - :offset="24" virtual-triggering popper-class="paramQuery_popover_style" :hide-after="0"> - <div class="select_menu" tabindex="1"> - <div class="group_select_menu"> - <ul> - <li v-for="(menu_item, menu_index) in state.m_chartDispSettingMenu - .chartQueryMenuOptions" :key="menu_index" style="position: relative"> - <div v-if="menu_item.type == 0" @click="btnClickParamsQuerySetChoiceGrp(menu_item)" - class="group_style" :class="state.m_chartDispSettingMenu.chartQueryMenuId == - menu_item.id - ? 'label_active' - : 'none_active' - "> - <el-icon> - <ArrowRight /> - </el-icon> - <span class="label_name">{{ menu_item.label }}</span> - </div> - <!-- 鍒ゆ柇濡傛灉褰撳墠涓篶heck绫诲瀷骞朵笖鎸夐挳涓哄弬鏁版煡璇� --> - <template v-if=" - menu_item.type == 1 && - menu_item.visible && - (menu_item.id == 'paramsQuery1' || - menu_item.id == 'paramsQuery2') - "> - <el-popover placement="right" width="210" trigger="click" :teleported="false"> - <div class="popover_cell"> - <span class="label_name" style="width: 40%">{{ t("detailPage.parameter_s.TR") }}:</span> - <el-input size="small" style="width: 60%" v-model="state.m_currentParamsQueryValue" - @focus="focusInput(menu_item)"></el-input> - </div> - <div style=" - text-align: right; - margin: 0; - display: flex; - justify-content: flex-end; - "> - <el-button style="min-width: 56px; min-height: 28px" type="primary" size="small" - @click="changeChartQueryValue(menu_item)">{{ - t("detailPage.parameterDetermine.TR") - }}</el-button> - </div> - <template #reference> - <div class="group_style" :class="'none_active'" @click="clickMenuLabel(menu_item)"> - <i class="icon-size"></i> - <span class="label_name">{{ menu_item.label }}</span> - </div> - </template> - </el-popover> - </template> - <!-- 鍒ゆ柇褰撳墠鏄痗heck绫诲瀷鑿滃崟 --> - <div v-else-if="menu_item.type == 1 && menu_item.visible" - @click="btnClickParamsQuerySetCheck(menu_item)" class="group_style setting-menu-title" - :class="menu_item.value ? 'label_active' : 'none_active'"> - <i class="icon-size iconfont" :class="menu_item.value == 1 ? 'iconselect_icon' : ''"></i> - <span class="label_name">{{ menu_item.label }}</span> - </div> - <ul class="chart_disp_menu_style" v-show="state.m_chartDispSettingMenu.chartQueryMenuId == - menu_item.id && menu_item.type == 0 - "> - <li v-for="( - choice_item, choice_index - ) in menu_item.choiceList" @click=" - btnClickParamsQuerySetChoiceMenu(menu_item, choice_item) - " style="position: relative" :key="choice_index" class="node_style" :class="menu_item.choiceValue == choice_item.value - ? 'label_active' - : 'none_active' - "> - <div v-if="choice_item.type == 'text'" style="cursor: pointer"> - <span class="label_name">{{ choice_item.label }}</span> - <i style="position: absolute; left: 0.32rem; top: 0.1rem" :class="menu_item.choiceValue == choice_item.value - ? 'iconfont iconselect_icon' - : '' - "> - </i> - </div> - </li> - </ul> - </li> - </ul> - </div> - </div> - </el-popover> - - <!-- 鏄剧ず閫熷害鍒楄〃 --> - <el-popover ref="SPEED_popoverRef" :virtual-ref="multiSpeedCtrl" trigger="click" :show-arrow="false" - :offset="24" virtual-triggering popper-class="SPEED_popover_style" :hide-after="0"> - <div class="mulit-chart-select_menu" tabindex="1"> - <div class="group_select_menu"> - <ul> - <li v-for="(menu_item, menu_index) in state.m_speedValueMenu.list" :key="menu_index"> - <div class="group_style"> - <span class="speed_input_style">{{ - menu_item.type == 2 ? "鈽�" : "" - }}</span> - <span class="speed_input_style">{{ - menu_item.value.toFixed(1) - }}</span> - <span>{{ menu_item.unit }}</span> - <el-color-picker @change=" - changeSpeedColorValue(menu_item.color, menu_index) - " size="small" v-model="menu_item.color" :teleported="false"></el-color-picker> - <span class="deleted_style"> - <i class="iconfont iconguanbi" @click="detelCurrentSpeedItem(menu_index)"></i> - </span> - </div> - </li> - <el-popover placement="right" @show="popoverShow" @hide="popoverHide" v-model="state.addDialogVisible" - width="220px" trigger="click" :teleported="false"> - <div class="transfer_type" style="margin-bottom: 7px"> - <el-radio v-model="state.m_currentAddType" label="1">{{ - t("selectPage.speed.TR") - }}</el-radio> - <el-radio v-model="state.m_currentAddType" label="2">{{ - t("ebookPage.motorFrequency.TR") - }}</el-radio> - </div> - <!-- 娣诲姞杞�� --> - <template v-if="state.m_currentAddType == '1'"> - <el-input :placeholder="t('detailPage.pleaseEnterSpeed.TR')" v-model="state.addSpeedValue" - clearable></el-input> - </template> - <!-- 娣诲姞棰戠巼 --> - <template v-if="state.m_currentAddType == '2'"> - <el-input :placeholder="t('detailPage.pleaseEnterHz.TR')" v-model="state.addHzValue" - clearable></el-input> - </template> - <div style="text-align: right; margin-top: 7px"> - <!-- <el-button size="small" type="primary" @click="state.addDialogVisible = false">{{ - t("detailPage.cancel.TR") - }}</el-button> --> - <el-button type="primary" style="padding: 7px 10px" size="small" @click="clickBtnAddSpeed">{{ - t("detailPage.define.TR") }}</el-button> - </div> - <template #reference> - <li> - <div class="group_style" :class="state.addSpeedIsActive ? 'add_speed_active' : '' - "> - <span class="label_name" style="text-align: center">{{ - t("detailPage.addPinLv.TR") - }}</span> - <i class="iconfont iconright" style="position: absolute; right: 10px"></i> - </div> - </li> - </template> - </el-popover> - </ul> - </div> - </div> - </el-popover> - - <!-- 鏄剧ず璁剧疆鑿滃崟 --> - <el-popover ref="DispMenu_popoverRef" :virtual-ref="dispMenuCtrl" trigger="click" :show-arrow="false" - :offset="24" virtual-triggering popper-class="multispeed_popover_style" :hide-after="0"> - <div class="mulit-chart-select_menu" tabindex="1"> - <div class="group_select_menu"> - <ul class="setting-menu"> - <li v-for="(menu_item, menu_index) in state.m_chartDispSettingMenu - .options" :key="menu_index" style="position: relative" class="setting-menu-item"> - <!-- 鍚湁缁� --> - <div v-if="menu_item.type == 0" :id="`group_${menu_item.id}`" - @click="btnClickChartDispSetChoiceGrp(menu_item)" class="group_style setting-menu-title" :class="state.m_chartDispSettingMenu.acitveMenuId == menu_item.id - ? 'label_active' - : 'none_active' - "> - <span class="label_name">{{ menu_item.label }}</span> - <el-icon> - <ArrowRight /> - </el-icon> - </div> - <!-- 涓嶅惈鏈夌粍 --> - <div v-else-if="menu_item.type == 1" @click="btnClickChartDispSetCheck(menu_item)" class="group_style" - :class="menu_item.value ? 'label_active' : 'none_active'"> - <span class="label_name">{{ menu_item.label }}</span> - <i class="icon-size iconfont" :class="menu_item.value == 1 ? 'iconselect_icon' : ''"></i> - </div> - - <div class="choice_item_div_style"> - <ul class="chart_disp_menu_style setting-menu" v-show="state.m_chartDispSettingMenu.acitveMenuId == - menu_item.id && menu_item.type == 0 - "> - <li v-for="( - choice_item, choice_index - ) in menu_item.choiceList" style="position: relative" :key="choice_index" - class="setting-menu-item node_style"> - <div @click.stop=" - btnClickChartDispSetChoiceMenu( - menu_item, - choice_item - ) - " v-if="choice_item.type == 'text'" style="cursor: pointer" - class="group_style setting-menu-title" :class="menu_item.choiceValue == choice_item.value - ? 'label_active' - : 'none_active' - "> - <i class="icon-size iconfont" :class="menu_item.choiceValue == choice_item.value - ? 'iconselect_icon' - : '' - "> - </i> - <span class="label_name">{{ - choice_item.label - }}</span> - </div> - <div v-if="choice_item.type == 'input'" style=" - display: flex; - padding: 0px 10px; - box-sizing: border-box; - " class="setting-menu-title"> - <i class="icon-size"></i> - <span class="label_name" style="width: 60%">{{ - choice_item.label - }}</span> - <el-input size="small" @change="changeChoiceValue(choice_item)" style="min-width: 50px" - v-model="choice_item.value"></el-input> - </div> - </li> - </ul> - </div> - </li> - </ul> - </div> - </div> - </el-popover> - </div> - </div> - <!-- 鏇茬嚎瀵煎嚭寮规 --> - <el-dialog :title="t('detailPage.tip.TR')" :modal="false" top="1vh" v-model="state.exportChartDialogVisible" - width="30%"> - <div class="dialog_title_style">{{ t("detailPage.tip.TR") }}</div> - <div class="dialog_content_style"> - {{ t("detailPage.downloadTips.TR") }} - </div> - <template #footer> - <span class="dialog-footer"> - <el-button @click="state.exportChartDialogVisible = false">{{ - t("detailPage.cancel.TR") - }}</el-button> - <el-button type="primary" @click="downClientFile">{{ - t("detailPage.download.TR") - }}</el-button> - </span> - </template> - </el-dialog> - - <!-- 鍥捐〃鍖哄煙 --> - <div style="overflow: hidden; width: 100%; height: calc(100% - 0.36rem)"> - <div class="tubiao"> - <div style="width: 100%; height: calc(100% - 0.1rem)" id="multiSpeedDiagramChart" ref="MultiSpeedChartSVG"> - </div> - </div> - </div> - <div v-if="state.isFullScreen" style=" - position: fixed; - left: 0; - top: 0; - right: 0; - bottom: 0; - background: #fff; - z-index: 9999; - "> - <div style="height: 0.4rem; line-height: 0.4rem; text-align: left"> - <a class="diagram multispeed_chart_btn default blue-stripe" style="margin-left: 0.05rem"> - <i class="iconfont iconfullscreen" style="font-size: 0.12rem"></i> - <span @click="exitFullScreen" style="margin-left: 0.01rem"> - {{ t("detailPage.exitFull.TR") }} - </span> - </a> - </div> - <div style="width: 100%; height: calc(100% - 0.4rem)" id="ChartFullScreen"></div> - </div> - </div> - </template> - - <script setup name="multiSpeedChart"> - import { reactive, onMounted, nextTick, ref, unref } from "vue"; - import { - ElMessage, - ElPopover, - ElInput, - ElButton, - ElDialog, - ElColorPicker, - ClickOutside as vClickOutside, - } from "element-plus"; - import MultiSpeedChartDiagram from "@/components//MultiSpeedChartDiagram.js"; - import UtilsHelper from "@/utils/utils"; - import ConstParas from "@/utils/constParas.js"; - import html2canvas from "html2canvas"; //div鍐呭杞浘鐗� + <!-- 鍙橀�熸洸绾� --> + <div id="chartBox" style="width: 100%; height: 100%" class="performanceCurveBox" v-loading="state.m_loadingPage"> + <!-- 鍥捐〃鍖哄煙 --> + <div style="overflow: hidden; width: 100%; height: calc(100% - 0.36rem)"> + <div class="tubiao"> + <div style="width: 100%; height: calc(100% - 0.1rem)" id="multiSpeedDiagramChart" ref="MultiSpeedChartSVG"></div> + </div> + </div> + </div> +</template> + +<script setup name="multiSpeedChart"> +import { reactive, onMounted, nextTick, ref, unref } from 'vue'; +import { ElMessage, ElPopover, ElInput, ElButton, ElDialog, ElColorPicker, ClickOutside as vClickOutside } from 'element-plus'; +import MultiSpeedChartDiagram from '@/components/Chart/js/MultiSpeedChartDiagram.js'; +import UtilsHelper from '@/utils/utils'; +import ConstParas from '@/utils/constParas.js'; +// import html2canvas from 'html2canvas'; //div鍐呭杞浘鐗� // import waterMarkHelper from "/@/utils/waterMarkHelper"; // import axiosHelper from "/@/utils/axiosHelper.js"; // import { useLogin } from "/@/store/login.js"; - import { useRoute, useRouter } from "vue-router"; +import { useRoute, useRouter } from 'vue-router'; // import { useI18n } from "vue-i18n"; // import { chartConfigStore } from "/@/store/chartConfig.js"; // import { CheckDownChartFile } from '/@/api/checkDown/index.js' - const { t } = useI18n(); +// const { t } = useI18n(); // const chartConfig = chartConfigStore(); // const userStore = useLogin(); // const userInfo = userStore.getUserInfo(); - const MultiSpeedChartSVG = ref(); - - const paramQueryCtrl = ref(); - const Param_Query_popoverRef = ref(); - - const multiSpeedCtrl = ref(); - const SPEED_popoverRef = ref(); - - const dispMenuCtrl = ref(); - const DispMenu_popoverRef = ref(); - const route = useRoute(); - const router = useRouter(); - const emit = defineEmits([ - "cbChangeChartQueryData", - "cbSetDispMSChartQueryData", - ]); - let state = reactive({ - m_chartDiagram: null, //鍥捐〃瀵硅薄 - m_pumpName: "", - m_seriesID: 0, - m_pumpID: 0, - isFullScreen: false, //鏄惁鍏ㄥ睆 - chartBoxHiehgt: 0, //鍥捐〃鐩掑瓙楂樺害 - - exportChartDialogVisible: false, //鏇茬嚎瀵煎嚭瀵硅瘽妗嗘樉闅� - addSpeedValue: "", //娣诲姞鏂扮殑杞�熺殑鍊� - addHzValue: "50", //娣诲姞鏂扮殑棰戠巼鐨勫�� - m_currentAddType: "2", //褰撳墠娣诲姞鐨勫�肩殑绫诲瀷 榛樿2 1鏄浆閫熴��2鏄鐜� - - addDialogVisible: false, //娣诲姞寮规鏄鹃殣鐘舵�� - m_speedValueMenu: { - isVisibleCombox: false, //涓嬫媺鑿滃崟鐨勬樉绀洪殣钘� - list: [], - }, - addSpeedIsActive: false, //娣诲姞杞�熸牱寮� - coordinateBoxVisible: false, //璁剧疆鍧愭爣瀵硅瘽妗嗙殑鏄�/闅� - m_designPointParas: null, - m_chartDispSettingMenu: { - isShowQueryChartBtn: false, //鏄惁鏄剧ず鍥炬爣涓婄殑鏌ヨ鎸夐挳 - isVisibleCombox: false, //涓嬫媺鑿滃崟鐨勬樉绀洪殣钘� - acitveMenuId: "", - chartQueryMenuId: null, - options: [ - { - id: "xianshi", - label: "鍥捐〃棰滆壊", - type: 1, //娌℃湁瀛愯彍鍗� - choiceValue: 0, - choiceList: [ - { - label: "鍗曡壊", - value: 1, - }, - { - label: "褰╄壊", - value: 0, - }, - ], - }, - ], - chartQueryMenuOptions: [], - }, - m_loadingPage:false - }); - onMounted(() => { - nextTick(() => { - refreshWindowSize(); - }); - // window.addEventListener( - // "resize", - // () => { - // return (() => { - // refreshWindowSize(); - // })(); - // }, - // false - // ); - }); - //淇敼绐椾綋灏哄 - const refreshWindowSize = () => { - let totalHeight = 0; - let headerHeight = 0; - let footerHeight = 0; - if (document.querySelector(".page-head-style")) { - headerHeight = document.querySelector(".page-head-style").clientHeight; +const MultiSpeedChartSVG = ref(); + +const paramQueryCtrl = ref(); +const Param_Query_popoverRef = ref(); + +const multiSpeedCtrl = ref(); +const SPEED_popoverRef = ref(); + +const dispMenuCtrl = ref(); +const DispMenu_popoverRef = ref(); +const route = useRoute(); +const router = useRouter(); +const emit = defineEmits(['cbChangeChartQueryData', 'cbSetDispMSChartQueryData']); +let state = reactive({ + m_chartDiagram: null, //鍥捐〃瀵硅薄 + m_pumpName: '', + m_seriesID: 0, + m_pumpID: 0, + isFullScreen: false, //鏄惁鍏ㄥ睆 + chartBoxHiehgt: 0, //鍥捐〃鐩掑瓙楂樺害 + + exportChartDialogVisible: false, //鏇茬嚎瀵煎嚭瀵硅瘽妗嗘樉闅� + addSpeedValue: '', //娣诲姞鏂扮殑杞�熺殑鍊� + addHzValue: '50', //娣诲姞鏂扮殑棰戠巼鐨勫�� + m_currentAddType: '2', //褰撳墠娣诲姞鐨勫�肩殑绫诲瀷 榛樿2 1鏄浆閫熴��2鏄鐜� + + addDialogVisible: false, //娣诲姞寮规鏄鹃殣鐘舵�� + m_speedValueMenu: { + isVisibleCombox: false, //涓嬫媺鑿滃崟鐨勬樉绀洪殣钘� + list: [], + }, + addSpeedIsActive: false, //娣诲姞杞�熸牱寮� + coordinateBoxVisible: false, //璁剧疆鍧愭爣瀵硅瘽妗嗙殑鏄�/闅� + m_designPointParas: null, + m_chartDispSettingMenu: { + isShowQueryChartBtn: false, //鏄惁鏄剧ず鍥炬爣涓婄殑鏌ヨ鎸夐挳 + isVisibleCombox: false, //涓嬫媺鑿滃崟鐨勬樉绀洪殣钘� + acitveMenuId: '', + chartQueryMenuId: null, + options: [ + { + id: 'xianshi', + label: '鍥捐〃棰滆壊', + type: 1, //娌℃湁瀛愯彍鍗� + choiceValue: 0, + choiceList: [ + { + label: '鍗曡壊', + value: 1, + }, + { + label: '褰╄壊', + value: 0, + }, + ], + }, + ], + chartQueryMenuOptions: [], + }, + m_loadingPage: false, +}); +onMounted(() => { + nextTick(() => { + refreshWindowSize(); + }); + // window.addEventListener( + // "resize", + // () => { + // return (() => { + // refreshWindowSize(); + // })(); + // }, + // false + // ); +}); +//淇敼绐椾綋灏哄 +const refreshWindowSize = () => { + let totalHeight = 0; + let headerHeight = 0; + let footerHeight = 0; + if (document.querySelector('.page-head-style')) { + headerHeight = document.querySelector('.page-head-style').clientHeight; + } + if (document.querySelector('#app footer')) { + footerHeight = document.querySelector('#app footer').clientHeight; + } + totalHeight = document.body.clientHeight - headerHeight - footerHeight; + + let el_dom = document.getElementById('multiSpeedDiagramChart'); + let parentDom = el_dom.parentElement; + if (parentDom) { + totalHeight = parentDom.clientHeight; + } + state.chartBoxHiehgt = totalHeight; + if (state.m_chartDiagram) { + var diagramContentWidth = parentDom.clientWidth; + var diagramContentHiehgt = parentDom.clientHeight; + + state.m_chartDiagram.Resize(diagramContentWidth, diagramContentHiehgt); + } +}; +//瀵煎嚭鏇茬嚎鍥� +const btnClickExportChartImage = async () => { + state.m_loadingPage = true; + let checkStatus = await checkDownChartFile('PNG'); + state.m_loadingPage = false; + if (!checkStatus) return; + html2canvas(MultiSpeedChartSVG.value, { backgroundColor: '#fff' }).then((canvas) => { + let file = canvas.toDataURL('image/png'); + waterMarkHelper.addImage(file, null, (base64Url) => { + downChartImageFile(base64Url); + }); + }); +}; +//鐐瑰嚮"鍙傛暟鏌ヨ"鑿滃崟 type=0(甯﹀瓙鑿滃崟鐨�) +const btnClickParamsQuerySetChoiceGrp = (menuItem) => { + if (state.m_chartDispSettingMenu.chartQueryMenuId == menuItem.id) { + state.m_chartDispSettingMenu.chartQueryMenuId = null; + } else { + state.m_chartDispSettingMenu.chartQueryMenuId = menuItem.id; + } +}; +//鐐瑰嚮"鍙傛暟鏌ヨ"鑿滃崟 type=1(checkbox) +const btnClickParamsQuerySetCheck = (menuItem) => { + state.m_chartDispSettingMenu.chartQueryMenuId = menuItem.id; + menuItem.value = menuItem.value == 0 ? 1 : 0; + let dispMSChartQueryData = menuItem.value == 1 ? true : false; + // 褰撳墠鐐瑰嚮鐨勬槸鏌ヨ + if (menuItem.id == 'chaxunquxian') { + if (menuItem.value == 1) { + state.m_chartDiagram.setQueryIndicatVertLineVisible(true, 1); + } else { + state.m_chartDiagram.setQueryIndicatVertLineVisible(false, 1); + } + emit('cbSetDispMSChartQueryData', dispMSChartQueryData); + } +}; +//瀵煎嚭鏇茬嚎鍥綜AD +const btnClickExportChartCAD = async () => { + state.m_loadingPage = true; + let checkStatus = await checkDownChartFile('CAD'); + state.m_loadingPage = false; + if (!checkStatus) return; + + var simuSpeedCurves = state.m_chartDiagram.getSpeedCurveList(); + var list_speed = []; + simuSpeedCurves.forEach((element) => { + list_speed.push(element.speed); + }); + if (list_speed.length <= 1) { + ElMessage.warning('鑷冲皯涓ゆ潯鏇茬嚎鎵嶈兘瀵煎嚭'); + return; + } + let requestData = { + SeriesID: state.m_seriesID, + PumpID: state.m_pumpID, + Speeds: list_speed, + }; + if (state.m_designPointParas != null) { + //requestData.DesignPoint = state.m_designPointParas; + } + axiosHelper + .post({ + version: 3, + controller: 'PumpChart', + action: 'CreateMultiSpeedChartCad', + data: requestData, + apiUrlType: 'main', + isAddUrlSoftType: 'true', + }) + .then((res) => { + let result = res.data; + if (result.Code != 0) { + ElMessage.error(result.Message); + return; + } + let filePath = window.globalConfig.WebApiUrl.FileUrl + 'temp/selectReport/' + result.Data; + // let filePath = window.globalConfig.WebApiUrl.MainUrl + "temp/selectReport/" + result.Data; + UtilsHelper.downloadFile(filePath, UtilsHelper.extractFileExtension(filePath)); + }) + .catch((err) => {}); +}; +// 妫�鏌ュ鍑烘洸绾跨殑鏉冮檺 +const checkDownChartFile = (fileSuffixType) => { + let FileSuffix = { + PNG: 4, + CAD: 3, + PDF: 0, + }; + let isLogin = checkLogin(); + if (!isLogin) return false; + let requestData = { + SeriesID: state.m_seriesID, + ProductID: state.m_pumpID, + FileType: 1, + FileSuffixType: FileSuffix[fileSuffixType], + }; + return new Promise((resolve, reject) => { + CheckDownChartFile(requestData) + .then((res) => { + let result = res.data; + if (result.Code != 0) { + ElMessage.error(result.Message); + resolve(false); + } + resolve(true); + }) + .catch((err) => { + reject(err); + }); + }); +}; + +const downChartImageFile = (filePath) => { + let link = document.createElement('a'); + link.href = filePath; //涓嬭浇閾炬帴 + link.setAttribute('download', `${state.m_pumpName}-鍙橀�熸洸绾�.png`); + link.style.display = 'none'; //a鏍囩闅愯棌 + document.body.appendChild(link); + link.click(); + setTimeout(() => { + link.remove(); + }, 500); +}; +//杞�熸坊鍔� +const clickBtnAddSpeed = () => { + state.addDialogVisible = false; + let type = state.m_currentAddType; + if (type == '1') { + let color = state.m_chartDiagram.AddSpeedCurve(state.addSpeedValue); + if (color == null) return; + state.addSpeedValue = ''; + } + if (type == '2') { + let color = state.m_chartDiagram.AddHzCurve(state.addHzValue); + if (color == null) return; + state.addHzValue = ''; + } +}; +//鐩戝惉璁剧疆鐨勮浆閫熸洸绾跨殑棰滆壊鍊� +const changeSpeedColorValue = (value, index) => { + // console.log(value, index, 747); + if (state.m_chartDiagram == null) return; + //console.log(curve, 602); + let id = state.m_speedValueMenu.list[index].id; + state.m_chartDiagram.editColorById(id, value); +}; +//鍒犻櫎褰撳墠鍒楄〃鑺傜偣 +const detelCurrentSpeedItem = (index) => { + let id = state.m_speedValueMenu.list[index].id; + state.m_speedValueMenu.list.splice(index, 1); + //console.log(id, 434); + state.m_chartDiagram.deleteCurveById(id); +}; +//鑾峰彇淇敼鐨勮浆閫熷�� 鍦ㄥけ鍘荤劍鐐规垨鑰呮寜enter閿殑鏃跺�� 鎵ц璇ヤ唬鐮� +const changeEditSpeedValue = (index) => { + // 寰呬慨鏀�-------- + var speed = state.m_speedValueMenu.list[index].value; + //------------ + speed = parseInt(speed); + let id = state.m_speedValueMenu.list[index].id; + if (speed < 10) return; + var list = state.m_speedValueMenu.list; + list[index].value = speed; + state.m_speedValueMenu.list = list; + state.m_chartDiagram.editSpeedById(id, speed); +}; +//涓嬭浇瀹㈡埛绔� +const downClientFile = () => { + state.exportChartDialogVisible = false; + let filePath = window.pageConfig.IndexPage.DanjiUrl; + if ((filePath = '')) { + return; + } + window.open(filePath, '_blank'); +}; +// 鍒濆鍖栬幏鍙栨车鐨勬暟鎹� +const initPumpInfoData = (langType, pumpInfoData, size) => { + if (pumpInfoData == null) return; + if (pumpInfoData.BaseInfo.PumpStyle != ConstParas.PumpStyle.LXP) { + return; + } + state.m_pumpName = pumpInfoData.BaseInfo.PumpName; + state.m_seriesID = pumpInfoData.BaseInfo.SeriesID; + state.m_pumpID = pumpInfoData.BaseInfo.PumpID; + + initChart(langType, pumpInfoData, size); +}; +//鐐瑰嚮"鍥捐〃鏌ヨ" +const btnClickChartQuery = () => { + //鏌ヨ绾跨殑鏄�/闅� +}; +//鐐瑰嚮"鍥捐〃璁剧疆"鑿滃崟 type=0(甯﹀瓙鑿滃崟鐨�) +const btnClickChartDispSetChoiceGrp = (menuItem) => { + state.m_chartDispSettingMenu.acitveMenuId = menuItem.id; +}; +//鐐瑰嚮"鍥捐〃璁剧疆"鑿滃崟 type=1(checkbox) +const btnClickChartDispSetCheck = (menuItem) => { + menuItem.value = menuItem.value == 0 ? 1 : 0; + state.m_chartDispSettingMenu.isVisibleCombox = false; + //鐐瑰嚮鈥滄爣娉ㄩ鐜団�� + if (menuItem.id == 'dispPinLv') { + let dispPinlv = menuItem.value == 0 ? false : true; + state.m_chartDiagram.setCurveLabelDispHz(dispPinlv); + } + //鐐瑰嚮鈥滄爣娉ㄨ浆閫熲�� + if (menuItem.id == 'dispSpeed') { + let dispSpeed = menuItem.value == 0 ? false : true; + state.m_chartDiagram.setCurveLabelDispSpeed(dispSpeed); + } +}; +//鐐瑰嚮"鍥捐〃璁剧疆"鐨� 瀛愯彍鍗� +const btnClickChartDispSetChoiceMenu = (menuItem, choiceItem) => {}; +//鍒濆鍖� +const initChart = (langType, pumpInfoData, size) => { + //console.log(pumpInfoData, 404); + if (pumpInfoData == null) { + return; + } + + const el = document.getElementById('multiSpeedDiagramChart'); + while (el.firstChild) { + el.removeChild(el.firstChild); } - if (document.querySelector("#app footer")) { - footerHeight = document.querySelector("#app footer").clientHeight; - } - totalHeight = document.body.clientHeight - headerHeight - footerHeight; - - let el_dom = document.getElementById("multiSpeedDiagramChart"); - let parentDom = el_dom.parentElement; - if (parentDom) { - totalHeight = parentDom.clientHeight; - } - state.chartBoxHiehgt = totalHeight; - if (state.m_chartDiagram) { - var diagramContentWidth = parentDom.clientWidth; - var diagramContentHiehgt = parentDom.clientHeight; - - state.m_chartDiagram.Resize(diagramContentWidth, diagramContentHiehgt); - } - }; - //瀵煎嚭鏇茬嚎鍥� - const btnClickExportChartImage =async () => { - state.m_loadingPage = true; - let checkStatus = await checkDownChartFile('PNG') - state.m_loadingPage = false; - if (!checkStatus) return; - html2canvas(MultiSpeedChartSVG.value, { backgroundColor: "#fff" }).then( - (canvas) => { - let file = canvas.toDataURL("image/png"); - waterMarkHelper.addImage(file, null, (base64Url) => { - downChartImageFile(base64Url); - }); - } - ); - }; - //鐐瑰嚮"鍙傛暟鏌ヨ"鑿滃崟 type=0(甯﹀瓙鑿滃崟鐨�) - const btnClickParamsQuerySetChoiceGrp = (menuItem) => { - if (state.m_chartDispSettingMenu.chartQueryMenuId == menuItem.id) { - state.m_chartDispSettingMenu.chartQueryMenuId = null; - } else { - state.m_chartDispSettingMenu.chartQueryMenuId = menuItem.id; - } - }; - //鐐瑰嚮"鍙傛暟鏌ヨ"鑿滃崟 type=1(checkbox) - const btnClickParamsQuerySetCheck = (menuItem) => { - state.m_chartDispSettingMenu.chartQueryMenuId = menuItem.id; - menuItem.value = menuItem.value == 0 ? 1 : 0; - let dispMSChartQueryData = menuItem.value == 1 ? true : false; - // 褰撳墠鐐瑰嚮鐨勬槸鏌ヨ - if (menuItem.id == "chaxunquxian") { - if (menuItem.value == 1) { - state.m_chartDiagram.setQueryIndicatVertLineVisible(true, 1); - } else { - state.m_chartDiagram.setQueryIndicatVertLineVisible(false, 1); - } - emit("cbSetDispMSChartQueryData", dispMSChartQueryData); - } - }; - //瀵煎嚭鏇茬嚎鍥綜AD - const btnClickExportChartCAD = async () => { - state.m_loadingPage = true; - let checkStatus = await checkDownChartFile('CAD') - state.m_loadingPage = false; - if (!checkStatus) return; - - var simuSpeedCurves = state.m_chartDiagram.getSpeedCurveList(); - var list_speed = []; - simuSpeedCurves.forEach((element) => { - list_speed.push(element.speed); - }); - if (list_speed.length <= 1) { - ElMessage.warning("鑷冲皯涓ゆ潯鏇茬嚎鎵嶈兘瀵煎嚭"); - return; - } - let requestData = { - SeriesID: state.m_seriesID, - PumpID: state.m_pumpID, - Speeds: list_speed, - }; - if (state.m_designPointParas != null) { - //requestData.DesignPoint = state.m_designPointParas; - } - axiosHelper - .post({ - version: 3, - controller: "PumpChart", - action: "CreateMultiSpeedChartCad", - data: requestData, - apiUrlType: "main", - isAddUrlSoftType: "true", - }) - .then((res) => { - let result = res.data; - if (result.Code != 0) { - ElMessage.error(result.Message); - return; + + var chart_diagram = new MultiSpeedChartDiagram(); + //璁剧疆璇█ + chart_diagram.setLocalizationType(0); + //璁剧疆瀹瑰櫒 + chart_diagram.setContainerDiv( + 'multiSpeedDiagramChart', //Div鍚嶇О + 1200, + 750 - 30 + ); + //璁剧疆鎻愮ず妗哊ame + chart_diagram.setToolTipName('featCurveTip'); + //鏌ヨ + chart_diagram.setChangeQueryDataCb(function (data) { + // console.log("setChangeQueryDataCb",data); + //_this.$emit("cbChangeChartQueryData", data); //鍥炶皟鐖剁獥浣撲簨浠� + }); + //淇敼浜嗛�熷害鍒楄〃 + chart_diagram.setChangeSpeedListCb(function (list) { + // console.log("setChangeSpeedListCb", list); + var speedList = []; + list.forEach((v) => { + speedList.push({ + id: v.id, + value: v.speed, + text: v.speed + ' rpm', + color: v.color, + unit: 'rpm', + }); + }); + state.m_speedValueMenu.list = speedList; + }); + //鍏ㄥ眬閰嶇疆 + var chartStyle = { + IsMonoColor: false, + IsDispSpectrum: true, + IsOnlyDispWrkCurve: false, + ColorH: '#6396C2', + ColorE: '#a90d41', + ColorP: '#e20df2', + ColorNPSH: '#8e870e', + ColorEquipment: '#013317', + ColorEqualParaCurvesE: '#402db7', + ColorCurveLabel: '#28004D', + }; + + /*_this.m_chartDispSettingMenu.options[0].choiceValue = + chartStyle.IsMonoColor; + _this.m_chartDispSettingMenu.options[1].choiceValue = + chartStyle.IsDispSpectrum; + _this.m_chartDispSettingMenu.options[2].value = + chartStyle.IsOnlyDispWrkCurve; + + //涓婃閰嶇疆 + let chartConfig = _this.$store.state.instante.chartConfig; + + if (chartConfig) { + if (chartConfig.IsMonorColor != null) { + chartStyle.IsMonoColor = chartConfig.IsMonorColor == 1 ? true : false; + + _this.m_chartDispSettingMenu.options[0].choiceValue = + chartConfig.IsMonorColor; } - let filePath = - window.globalConfig.WebApiUrl.FileUrl + - "temp/selectReport/" + - result.Data; - // let filePath = window.globalConfig.WebApiUrl.MainUrl + "temp/selectReport/" + result.Data; - UtilsHelper.downloadFile( - filePath, - UtilsHelper.extractFileExtension(filePath) - ); - }) - .catch((err) => { - }); - }; - // 妫�鏌ュ鍑烘洸绾跨殑鏉冮檺 - const checkDownChartFile = (fileSuffixType) => { - let FileSuffix = { - PNG: 4, - CAD: 3, - PDF: 0 - } - let isLogin = checkLogin(); - if (!isLogin) return false - let requestData = { - SeriesID: state.m_seriesID, - ProductID: state.m_pumpID, - FileType: 1, - FileSuffixType: FileSuffix[fileSuffixType] - }; - return new Promise((resolve, reject) => { - CheckDownChartFile(requestData).then((res) => { - let result = res.data; - if (result.Code != 0) { - ElMessage.error(result.Message); - resolve(false); + + if (chartConfig.IsDispSpectrum != null) { + chartStyle.IsDispSpectrum = + chartConfig.IsDispSpectrum == 1 ? true : false; + + _this.m_chartDispSettingMenu.options[1].choiceValue = + chartConfig.IsDispSpectrum; } - resolve(true); - }) - .catch((err) => { - reject(err) - - }); - }) - }; - - const downChartImageFile = (filePath) => { - let link = document.createElement("a"); - link.href = filePath; //涓嬭浇閾炬帴 - link.setAttribute( - "download", - `${state.m_pumpName}-${t("detailPage.performanceCurve.TR")}.png` - ); - link.style.display = "none"; //a鏍囩闅愯棌 - document.body.appendChild(link); - link.click(); - setTimeout(() => { - link.remove(); - }, 500); - } - //杞�熸坊鍔� - const clickBtnAddSpeed = () => { - state.addDialogVisible = false; - let type = state.m_currentAddType; - if (type == "1") { - var color = state.m_chartDiagram.AddSpeedCurve(state.addSpeedValue); - if (color == null) return; - state.addSpeedValue = ""; - } - if (type == "2") { - var color = state.m_chartDiagram.AddHzCurve(state.addHzValue); - if (color == null) return; - state.addHzValue = ""; - } - }; - //鐩戝惉璁剧疆鐨勮浆閫熸洸绾跨殑棰滆壊鍊� - const changeSpeedColorValue = (value, index) => { - // console.log(value, index, 747); - if (state.m_chartDiagram == null) return; - //console.log(curve, 602); - let id = state.m_speedValueMenu.list[index].id; - state.m_chartDiagram.editColorById(id, value); - }; - //鍒犻櫎褰撳墠鍒楄〃鑺傜偣 - const detelCurrentSpeedItem = (index) => { - let id = state.m_speedValueMenu.list[index].id; - state.m_speedValueMenu.list.splice(index, 1); - //console.log(id, 434); - state.m_chartDiagram.deleteCurveById(id); - }; - //鑾峰彇淇敼鐨勮浆閫熷�� 鍦ㄥけ鍘荤劍鐐规垨鑰呮寜enter閿殑鏃跺�� 鎵ц璇ヤ唬鐮� - const changeEditSpeedValue = (index) => { - // 寰呬慨鏀�-------- - var speed = state.m_speedValueMenu.list[index].value; - //------------ - speed = parseInt(speed); - let id = state.m_speedValueMenu.list[index].id; - if (speed < 10) return; - var list = state.m_speedValueMenu.list; - list[index].value = speed; - state.m_speedValueMenu.list = list; - state.m_chartDiagram.editSpeedById(id, speed); - }; - //涓嬭浇瀹㈡埛绔� - const downClientFile = () => { - state.exportChartDialogVisible = false; - let filePath = window.pageConfig.IndexPage.DanjiUrl; - if ((filePath = "")) { - return; - } - window.open(filePath, "_blank"); - }; - // 鍒濆鍖栬幏鍙栨车鐨勬暟鎹� - const initPumpInfoData = (langType, pumpInfoData, size) => { - if (pumpInfoData == null) return; - if (pumpInfoData.BaseInfo.PumpStyle != ConstParas.PumpStyle.LXP) { - return; - } - state.m_pumpName = pumpInfoData.BaseInfo.PumpName; - state.m_seriesID = pumpInfoData.BaseInfo.SeriesID; - state.m_pumpID = pumpInfoData.BaseInfo.PumpID; - - initChart(langType, pumpInfoData, size); - }; - //鐐瑰嚮"鍥捐〃鏌ヨ" - const btnClickChartQuery = () => { - //鏌ヨ绾跨殑鏄�/闅� - }; - //鐐瑰嚮"鍥捐〃璁剧疆"鑿滃崟 type=0(甯﹀瓙鑿滃崟鐨�) - const btnClickChartDispSetChoiceGrp = (menuItem) => { - state.m_chartDispSettingMenu.acitveMenuId = menuItem.id; - }; - //鐐瑰嚮"鍥捐〃璁剧疆"鑿滃崟 type=1(checkbox) - const btnClickChartDispSetCheck = (menuItem) => { - menuItem.value = menuItem.value == 0 ? 1 : 0; - state.m_chartDispSettingMenu.isVisibleCombox = false; - //鐐瑰嚮鈥滄爣娉ㄩ鐜団�� - if (menuItem.id == "dispPinLv") { - let dispPinlv = menuItem.value == 0 ? false : true; - state.m_chartDiagram.setCurveLabelDispHz(dispPinlv); - } - //鐐瑰嚮鈥滄爣娉ㄨ浆閫熲�� - if (menuItem.id == "dispSpeed") { - let dispSpeed = menuItem.value == 0 ? false : true; - state.m_chartDiagram.setCurveLabelDispSpeed(dispSpeed); - } - }; - //鐐瑰嚮"鍥捐〃璁剧疆"鐨� 瀛愯彍鍗� - const btnClickChartDispSetChoiceMenu = (menuItem, choiceItem) => { }; - //鍒濆鍖� - const initChart = (langType, pumpInfoData, size) => { - if (pumpInfoData == null) { - return; - } - - document.getElementById("multiSpeedDiagramChart").innerHTML = ""; - - var chart_diagram = new MultiSpeedChartDiagram(); - //璁剧疆璇█ - chart_diagram.setLocalizationType(langType); - //璁剧疆瀹瑰櫒 - chart_diagram.setContainerDiv( - "multiSpeedDiagramChart", //Div鍚嶇О - size.width, - size.height - 35 - ); - //璁剧疆鎻愮ず妗哊ame - chart_diagram.setToolTipName("featCurveTip"); - //鏌ヨ - chart_diagram.setChangeQueryDataCb((data) => { - emit("cbChangeChartQueryData", data); //鍥炶皟鐖剁獥浣撲簨浠� - }); - //淇敼浜嗛�熷害鍒楄〃 - chart_diagram.setChangeSpeedListCb((list) => { - let speedList = []; - list.forEach((v) => { - const speed = v.speed; - speedList.push({ - id: v.id, - value: speed, - text: speed + " rpm", - color: v.color, - unit: "rpm", - type: v.type, - }); - }); - state.m_speedValueMenu.list = speedList; - }); - - //鍏ㄥ眬閰嶇疆 - var chartStyle = window.pageConfig.ChartStyle; - - let options = [ - { - id: "dispPinLv", - label: `鏍囨敞棰戠巼`, - type: 1, //娌℃湁瀛愯彍鍗� - value: 1, - }, - { - id: "dispSpeed", - label: `鏍囨敞杞�焋, - type: 1, //娌℃湁瀛愯彍鍗� - value: 1, - }, - ]; - state.m_chartDispSettingMenu.options = options; - - chart_diagram.setCurveLabelDispHz(true); - - // 鏌ヨ鏇茬嚎 - let chartQueryMenuOption = [ - { - id: "chaxunquxian", - label: `${t("detailPage.queryCurve.TR")}`, - type: 1, //1 鏃犲瓙鑿滃崟 - value: 0, - visible: true, - }, - // { - // id: "paramsQuery1", - // label: `${t("detailPage.parameterQuery.TR")}1`, - // type: 1, //1 鏃犲瓙鑿滃崟 - // value: "", - // visible: false, - // }, - // { - // id: "paramsQuery2", - // label: `${t("detailPage.parameterQuery.TR")}2`, - // type: 1, //1 鏃犲瓙鑿滃崟 - // value: "", - // visible: false, - // } - ]; - state.m_chartDispSettingMenu.chartQueryMenuOptions = chartQueryMenuOption; - - /*_this.m_chartDispSettingMenu.options[0].choiceValue = - chartStyle.IsMonoColor; - _this.m_chartDispSettingMenu.options[1].choiceValue = - chartStyle.IsDispSpectrum; - - - //涓婃閰嶇疆 - let chartConfig = _this.$store.state.instante.chartConfig; - - if (chartConfig) { - if (chartConfig.IsMonorColor != null) { - chartStyle.IsMonoColor = chartConfig.IsMonorColor == 1 ? true : false; - - _this.m_chartDispSettingMenu.options[0].choiceValue = - chartConfig.IsMonorColor; - } - - if (chartConfig.IsDispSpectrum != null) { - chartStyle.IsDispSpectrum = - chartConfig.IsDispSpectrum == 1 ? true : false; - - _this.m_chartDispSettingMenu.options[1].choiceValue = - chartConfig.IsDispSpectrum; - } - }*/ - - //鍒濆鍖� - chart_diagram.initialChart(pumpInfoData, chartStyle); - - state.m_chartDiagram = chart_diagram; - setTimeout(() => { - state.m_chartDiagram.Resize(size.width, size.height - 35); - }, 500); - }; - //璁剧疆宸ヤ綔鏇茬嚎 - const setWrkCurveInfo = (dp, curve) => { - if (state.m_chartDiagram == null) return; - - state.m_designPointParas = dp; - state.m_chartDiagram.setWrkCurveInfo(curve); - }; - //鏍规嵁娴侀噺璁$畻鍔熺巼 - const calcPowerByFlow = (flow, unit) => { - if (state.m_chartDiagram == null) return; - - return state.m_chartDiagram.calcPowerByFlow(flow, unit); - }; - //鏍规嵁娴侀噺璁$畻鏁堢巼 - const calcEtaByFlow = (flow, unit) => { - if (state.m_chartDiagram == null) return; - return state.m_chartDiagram.calcEtaByFlow(flow, unit); - }; - //淇敼浜嗗尯鍩熷弬鏁扮殑娴侀噺 - const refreshRegionByFlow = (std_unit_flow, tag) => { - if (state.m_chartDiagram == null) return; - return state.m_chartDiagram.refreshRegionByFlow(std_unit_flow, tag); - }; - - const showCoordinateBox = () => { - //鏄剧ず璁剧疆鍧愭爣瀵硅瘽妗� - state.coordinateBoxVisible = true; - //this.calcCoordinate(); - }; - const onParamQueryClickOutside = () => { - unref(Param_Query_popoverRef).Param_Query_popoverRef?.delayHide?.(); - }; - const onDispMenuClickOutside = () => { - unref(DispMenu_popoverRef).DispMenu_popoverRef?.delayHide?.(); - }; - const getSpeedList = () => { - let speedList = []; - state.m_speedValueMenu.list.forEach((item) => { - speedList.push(item.value); - }); - return speedList.join(","); - }; - //閫�鍑哄叏灞� - const exitFullScreen = () => { - state.isFullScreen = false; - }; - //鍏ㄥ睆 - const fullScreen = () => { - state.isFullScreen = true; - setTimeout(() => { - initFullScreenChart(); - }, 100); - }; - - const initFullScreenChart = () => { - var IdName = "ChartFullScreen"; - }; - // - const popoverShow = () => { - state.addSpeedIsActive = true; - }; - // - const popoverHide = () => { - state.addSpeedIsActive = false; - }; - // - const checkLogin = () => { - //妫�鏌ョ櫥闄� - var Token = userInfo.Token; - if (Token == null || Token == "") { - userStore.login(route.fullPath); - return false; - } - return true; - }; - defineExpose({ - initPumpInfoData, - setWrkCurveInfo, - getSpeedList, - }); - </script> - <style lang="scss"> - .performanceCurveBox { - position: relative; - - .chartBar { - background-color: white; - border-bottom: 0.01rem solid #cecece; - height: 0.35rem; - line-height: 0.35rem; - } - - .el-dialog__header { - display: none; - } - - .el-dialog--center .el-dialog__body { - padding: 0.25rem 0.25rem 0.15rem; - } - - .el-dialog__footer { - padding: 0.05rem 0.05rem; - - .el-button { - padding: 0.06rem 0.12rem; - min-height: 0.3rem; - } - } - - .diagram { - cursor: pointer; - font-size: 0.12rem; - margin-top: 0; - margin-bottom: 0.03rem; - padding-top: 0.05rem; - height: 0.27rem; - - &>span { - font-size: 0.12rem; - font-family: "SourceHanSans-Bold"; - } - } - - .multispeed-tools-div { - font-size: 0.13rem; - font-weight: bold; - display: flex; - height: 100%; - padding: 0.04rem; - box-sizing: border-box; - gap: 0.05rem; - } - - .multispeed_chart_btn { - border-width: 0; - padding: 0.07rem 0.14rem; - font-size: 0.12rem; - outline: none !important; - background-image: none !important; - border-radius: unset !important; - filter: none; - border-radius: 0; - box-shadow: none; - text-shadow: none; - height: 100%; - box-sizing: border-box; - display: flex; - justify-content: center; - align-items: center; - gap: 0.05rem; - - &.default { - color: #333333; - background-color: #e5e5e5; - font-weight: 700; - - &:hover { - background-color: #aaaaaa; + + if (chartConfig.IsOnlyDispWrkCurve != null) { + chartStyle.IsOnlyDispWrkCurve = + chartConfig.IsOnlyDispWrkCurve == 1 ? true : false; + + _this.m_chartDispSettingMenu.options[2].value = + chartConfig.IsOnlyDispWrkCurve; } - } - - &.blue-stripe { - border-left: 0.03rem solid #002c66; - } - } - - .add_speed_active { - color: #4b8df8 !important; - } - - .rightFilterBox { - position: absolute; - right: 0rem; - top: 0rem; - width: auto; - background-color: white; - float: right; - - .showChartInfoDiv { - width: 2rem; - display: block; - } - - .boxHead { - height: 0.34rem; - border-left: none; - border-right: none; - display: flex; - justify-content: space-between; - align-items: center; - background-color: white; - border: 0.01rem solid transparent; - color: #3c763d; - border-color: #d6e9c6; - font-size: 0.14rem; - - i { - font-size: 0.14rem; - } - } - - .panel-heading { - background-color: #f5f5f5; - border-color: #ddd; - margin-bottom: 0.01rem; - - .panel-title { - margin-top: 0; - padding: 0; - height: 0.23rem; - margin-bottom: 0; - font-size: 0.14rem; - background-color: #388cd4 !important; - color: white; - - .right { - transform: rotate(-90deg); - transition: 0.2s; - } - - .down { - transition: 0.2s; - transform: rotate(0deg); - } - } - - .accordion-toggle { - padding: 0.1rem 0.15rem; - } - } - - .panel-collapse { - height: auto; - - .panel-body { - background-color: #545196 !important; - - .el-checkbox { - color: #fff; - } - - .el-checkbox, - .el-radio { - margin-right: 0.1rem; - } - - .el-checkbox__label { - font-size: 0.12rem; - } - - .el-checkbox__input.is-checked+.el-checkbox__label { - color: #fff; - font-size: 0.12rem; - } - - .col-md-12 { - width: 100%; - margin-top: 0.03rem; - display: flex; - justify-content: center; - align-items: center; - - .spectrumLeftParaLabelName { - line-height: 0.25rem; - margin-right: 0.05rem; - font-size: 0.12rem; - float: left; - width: 31%; - color: white; - background-color: #545196 !important; - } - - .spectrumLeftParaLabelUnit { - line-height: 0.25rem; - margin-right: 0.05rem; - font-size: 0.12rem; - float: left; - width: 0.3rem; - color: white; - background-color: #545196 !important; - } - - .el-input { - width: unset; - line-height: 0.3rem; - - .el-input__inner { - height: 0.25rem; - line-height: 0.25rem; - width: 0.65rem; - text-align: right; - } - } - - .pointShow { - .el-input__inner { - height: 0.25rem; - line-height: 0.25rem; - width: 100%; - text-align: center; - } - - .el-input__prefix, - .el-input__suffix { - top: -0.07rem; - } - } - - .chartInfoParaInput { - float: left; - line-height: 0.15rem; - width: 0.48rem !important; - text-align: right; - } - - .form-control { - height: 0.08rem; - padding: 0.06rem 0.12rem; - font-size: 0.14rem; - font-weight: normal; - color: #333333; - background-color: white; - border: 0.01rem solid #b4afaf; - border-radius: 0; - box-shadow: none; - transition: border-color ease-in-out 0.15s, - box-shadow ease-in-out 0.15s; - } - } - } - } - } - - .searchbtn { - border-radius: 0; - border-width: 0; - padding: 0.02rem 0.14rem; - font-size: 0.14rem; - outline: none !important; - background-image: none !important; - filter: none; - box-shadow: none; - text-shadow: none; - display: inline-block; - font-weight: 400; - text-align: center; - vertical-align: middle; - cursor: pointer; - white-space: nowrap; - line-height: 0.2rem; - user-select: none; - margin-top: 0.08rem; - margin-left: 0.2rem; - height: 0.2rem; - margin-bottom: 0.02rem; - width: 0.6rem; - padding-top: 0.02rem; - border: 0.01rem solid #ccc; - } - - .blue { - background-color: #6396c2 !important; - color: #fff; - } - - .setBox { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - - .setGroup { - position: relative; - margin-bottom: 0.01rem !important; - padding: 0.05rem !important; - background-color: white; - border: 0.01rem solid transparent; - border-width: 0.01rem; - border-color: #bce8f1; - color: #31708f; - margin-top: 0.2rem; - - .setTitle { - font-size: 0.18rem; - position: absolute; - top: -0.15rem; - background-color: #fff; - padding: 0 0.05rem; - } - - .set_Option { - display: flex; - justify-content: center; - align-items: center; - - // margin-top: 0.1rem; - .grid-content { - display: flex; - justify-content: center; - align-items: center; - margin-top: 0.05rem; - - label { - width: 1.5rem; - font-size: 0.12rem; - text-align: right; - } - - .el-input__inner { - text-align: right; - height: 0.4rem; - line-height: 0.4rem; - padding: 0 0; - } - } - } - } - } - - .dialog_title_style { - height: 30px; - font-size: 22px; - text-align: left; - text-indent: 20px; - } - - .dialog_content_style { - height: 20px; - text-align: left; - text-indent: 20px; - margin-top: 10px; - } - - .el-color-picker { - line-height: 3; - margin-left: 0.05rem; - height: 0.34rem; - } - - .el-color-picker--mini .el-color-picker__trigger { - width: 0.2rem; - height: 0.2rem; - } - - .el-color-picker__trigger { - padding: unset; - } - - .el-color-picker--mini .el-color-picker__empty, - .el-color-picker--mini .el-color-picker__icon { - color: transparent; - } - - .tubiao { - height: 100%; - width: 100%; - } - - .disp_SetChoiceMenu_style { - position: absolute; - right: -1.77rem; - top: -0.01rem; - background: rgb(255, 255, 255); - border-width: 0.01rem 0.01rem 0.01rem 0.01rem; - border-color: #e5e5e5; - border-style: solid; - } - } - - .mulit-chart-select_menu { - width: 100%; - display: flex; - background: #fff; - border: 0.01rem solid #e5e5e5; - - .group_select_menu { - width: 100%; - border-right: 0.01rem solid #e5e5e5; - - ul { - width: 100%; - list-style: none; - margin: 0; - padding: 0.06rem 0; - - .group_style { - cursor: pointer; - color: #909399; - display: flex; - justify-content: center; - align-items: center; - padding: 0 0.3rem 0 0.2rem; - height: 0.34rem; - line-height: 0.34rem; - outline: none; - position: relative; - gap: 0.05rem; - box-sizing: border-box; - - .label_name { - // flex: 1; - padding: 0 0.1rem; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .speed_input_style { - -webkit-appearance: none; - background-color: transparent; - background-image: none; - border: none; - box-sizing: border-box; - color: #606266; - display: inline-block; - font-size: inherit; - height: 0.34rem; - line-height: 0.34rem; - outline: none; - padding: 0 0rem; - transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); - width: 50%; - text-align: center; - // text-indent: 0.22rem; - } - - .deleted_style { - position: absolute; - right: 0.1rem; - font-size: 0.16rem; - } - - .deleted_style:hover { - color: red; - cursor: pointer; - } - - &:hover { - background: #f5f7fa; - color: #303133; - } - - .node_style { - cursor: pointer; - color: #909399; - display: flex; - align-items: center; - padding: 0 0.3rem 0 0.2rem; - height: 0.34rem; - line-height: 0.34rem; - outline: none; - - .label_name { - // flex: 1; - padding: 0 0.1rem; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - &:hover { - background: #f5f7fa; - color: #303133; - } - } - } - - .label_active { - color: #409eff !important; - font-weight: 700; - } - - .none_active { - color: #909399; - font-weight: unset; - } - } - } - } - - .paramQuery_popover_style { - min-width: 2rem !important; - width: unset !important; - inset: 1.2rem auto auto 2.42rem !important; - padding: unset !important; - } - - .multispeed_popover_style { - min-width: 2rem !important; - width: unset !important; - inset: 1.31rem auto auto 3.4rem !important; - padding: unset !important; - } - - .SPEED_popover_style { - min-width: 1.5rem !important; - width: unset !important; - inset: 1.31rem auto auto 2.42rem !important; - padding: unset !important; - } - </style> - \ No newline at end of file + }*/ + + //鍒濆鍖� + chart_diagram.initialChart(pumpInfoData, chartStyle); + + state.m_chartDiagram = chart_diagram; +}; +//璁剧疆宸ヤ綔鏇茬嚎 +const setWrkCurveInfo = (dp, curve) => { + + if (state.m_chartDiagram == null) return; + + state.m_designPointParas = dp; + state.m_chartDiagram.setWrkCurveInfo(dp); +}; +//鏍规嵁娴侀噺璁$畻鍔熺巼 +const calcPowerByFlow = (flow, unit) => { + if (state.m_chartDiagram == null) return; + + return state.m_chartDiagram.calcPowerByFlow(flow, unit); +}; +//鏍规嵁娴侀噺璁$畻鏁堢巼 +const calcEtaByFlow = (flow, unit) => { + if (state.m_chartDiagram == null) return; + return state.m_chartDiagram.calcEtaByFlow(flow, unit); +}; +//淇敼浜嗗尯鍩熷弬鏁扮殑娴侀噺 +const refreshRegionByFlow = (std_unit_flow, tag) => { + if (state.m_chartDiagram == null) return; + return state.m_chartDiagram.refreshRegionByFlow(std_unit_flow, tag); +}; + +const showCoordinateBox = () => { + //鏄剧ず璁剧疆鍧愭爣瀵硅瘽妗� + state.coordinateBoxVisible = true; + //this.calcCoordinate(); +}; +const onParamQueryClickOutside = () => { + unref(Param_Query_popoverRef).Param_Query_popoverRef?.delayHide?.(); +}; +const onDispMenuClickOutside = () => { + unref(DispMenu_popoverRef).DispMenu_popoverRef?.delayHide?.(); +}; +const getSpeedList = () => { + let speedList = []; + state.m_speedValueMenu.list.forEach((item) => { + speedList.push(item.value); + }); + return speedList.join(','); +}; +//閫�鍑哄叏灞� +const exitFullScreen = () => { + state.isFullScreen = false; +}; +//鍏ㄥ睆 +const fullScreen = () => { + state.isFullScreen = true; + setTimeout(() => { + initFullScreenChart(); + }, 100); +}; + +const initFullScreenChart = () => { + var IdName = 'ChartFullScreen'; +}; +// +const popoverShow = () => { + state.addSpeedIsActive = true; +}; +// +const popoverHide = () => { + state.addSpeedIsActive = false; +}; +// +const checkLogin = () => { + //妫�鏌ョ櫥闄� + var Token = userInfo.Token; + if (Token == null || Token == '') { + userStore.login(route.fullPath); + return false; + } + return true; +}; +defineExpose({ + initPumpInfoData, + setWrkCurveInfo, + getSpeedList, +}); +</script> +<style lang="scss"> +.performanceCurveBox { + position: relative; + + .chartBar { + background-color: white; + border-bottom: 0.01rem solid #cecece; + height: 0.35rem; + line-height: 0.35rem; + } + + .el-dialog__header { + display: none; + } + + .el-dialog--center .el-dialog__body { + padding: 0.25rem 0.25rem 0.15rem; + } + + .el-dialog__footer { + padding: 0.05rem 0.05rem; + + .el-button { + padding: 0.06rem 0.12rem; + min-height: 0.3rem; + } + } + + .diagram { + cursor: pointer; + font-size: 0.12rem; + margin-top: 0; + margin-bottom: 0.03rem; + padding-top: 0.05rem; + height: 0.27rem; + + & > span { + font-size: 0.12rem; + font-family: 'SourceHanSans-Bold'; + } + } + + .multispeed-tools-div { + font-size: 0.13rem; + font-weight: bold; + display: flex; + height: 100%; + padding: 0.04rem; + box-sizing: border-box; + gap: 0.05rem; + } + + .multispeed_chart_btn { + border-width: 0; + padding: 0.07rem 0.14rem; + font-size: 0.12rem; + outline: none !important; + background-image: none !important; + border-radius: unset !important; + filter: none; + border-radius: 0; + box-shadow: none; + text-shadow: none; + height: 100%; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + gap: 0.05rem; + + &.default { + color: #333333; + background-color: #e5e5e5; + font-weight: 700; + + &:hover { + background-color: #aaaaaa; + } + } + + &.blue-stripe { + border-left: 0.03rem solid #002c66; + } + } + + .add_speed_active { + color: #4b8df8 !important; + } + + .rightFilterBox { + position: absolute; + right: 0rem; + top: 0rem; + width: auto; + background-color: white; + float: right; + + .showChartInfoDiv { + width: 2rem; + display: block; + } + + .boxHead { + height: 0.34rem; + border-left: none; + border-right: none; + display: flex; + justify-content: space-between; + align-items: center; + background-color: white; + border: 0.01rem solid transparent; + color: #3c763d; + border-color: #d6e9c6; + font-size: 0.14rem; + + i { + font-size: 0.14rem; + } + } + + .panel-heading { + background-color: #f5f5f5; + border-color: #ddd; + margin-bottom: 0.01rem; + + .panel-title { + margin-top: 0; + padding: 0; + height: 0.23rem; + margin-bottom: 0; + font-size: 0.14rem; + background-color: #388cd4 !important; + color: white; + + .right { + transform: rotate(-90deg); + transition: 0.2s; + } + + .down { + transition: 0.2s; + transform: rotate(0deg); + } + } + + .accordion-toggle { + padding: 0.1rem 0.15rem; + } + } + + .panel-collapse { + height: auto; + + .panel-body { + background-color: #545196 !important; + + .el-checkbox { + color: #fff; + } + + .el-checkbox, + .el-radio { + margin-right: 0.1rem; + } + + .el-checkbox__label { + font-size: 0.12rem; + } + + .el-checkbox__input.is-checked + .el-checkbox__label { + color: #fff; + font-size: 0.12rem; + } + + .col-md-12 { + width: 100%; + margin-top: 0.03rem; + display: flex; + justify-content: center; + align-items: center; + + .spectrumLeftParaLabelName { + line-height: 0.25rem; + margin-right: 0.05rem; + font-size: 0.12rem; + float: left; + width: 31%; + color: white; + background-color: #545196 !important; + } + + .spectrumLeftParaLabelUnit { + line-height: 0.25rem; + margin-right: 0.05rem; + font-size: 0.12rem; + float: left; + width: 0.3rem; + color: white; + background-color: #545196 !important; + } + + .el-input { + width: unset; + line-height: 0.3rem; + + .el-input__inner { + height: 0.25rem; + line-height: 0.25rem; + width: 0.65rem; + text-align: right; + } + } + + .pointShow { + .el-input__inner { + height: 0.25rem; + line-height: 0.25rem; + width: 100%; + text-align: center; + } + + .el-input__prefix, + .el-input__suffix { + top: -0.07rem; + } + } + + .chartInfoParaInput { + float: left; + line-height: 0.15rem; + width: 0.48rem !important; + text-align: right; + } + + .form-control { + height: 0.08rem; + padding: 0.06rem 0.12rem; + font-size: 0.14rem; + font-weight: normal; + color: #333333; + background-color: white; + border: 0.01rem solid #b4afaf; + border-radius: 0; + box-shadow: none; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; + } + } + } + } + } + + .searchbtn { + border-radius: 0; + border-width: 0; + padding: 0.02rem 0.14rem; + font-size: 0.14rem; + outline: none !important; + background-image: none !important; + filter: none; + box-shadow: none; + text-shadow: none; + display: inline-block; + font-weight: 400; + text-align: center; + vertical-align: middle; + cursor: pointer; + white-space: nowrap; + line-height: 0.2rem; + user-select: none; + margin-top: 0.08rem; + margin-left: 0.2rem; + height: 0.2rem; + margin-bottom: 0.02rem; + width: 0.6rem; + padding-top: 0.02rem; + border: 0.01rem solid #ccc; + } + + .blue { + background-color: #6396c2 !important; + color: #fff; + } + + .setBox { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + + .setGroup { + position: relative; + margin-bottom: 0.01rem !important; + padding: 0.05rem !important; + background-color: white; + border: 0.01rem solid transparent; + border-width: 0.01rem; + border-color: #bce8f1; + color: #31708f; + margin-top: 0.2rem; + + .setTitle { + font-size: 0.18rem; + position: absolute; + top: -0.15rem; + background-color: #fff; + padding: 0 0.05rem; + } + + .set_Option { + display: flex; + justify-content: center; + align-items: center; + + // margin-top: 0.1rem; + .grid-content { + display: flex; + justify-content: center; + align-items: center; + margin-top: 0.05rem; + + label { + width: 1.5rem; + font-size: 0.12rem; + text-align: right; + } + + .el-input__inner { + text-align: right; + height: 0.4rem; + line-height: 0.4rem; + padding: 0 0; + } + } + } + } + } + + .dialog_title_style { + height: 30px; + font-size: 22px; + text-align: left; + text-indent: 20px; + } + + .dialog_content_style { + height: 20px; + text-align: left; + text-indent: 20px; + margin-top: 10px; + } + + .el-color-picker { + line-height: 3; + margin-left: 0.05rem; + height: 0.34rem; + } + + .el-color-picker--mini .el-color-picker__trigger { + width: 0.2rem; + height: 0.2rem; + } + + .el-color-picker__trigger { + padding: unset; + } + + .el-color-picker--mini .el-color-picker__empty, + .el-color-picker--mini .el-color-picker__icon { + color: transparent; + } + + .tubiao { + height: 100%; + width: 100%; + } + + .disp_SetChoiceMenu_style { + position: absolute; + right: -1.77rem; + top: -0.01rem; + background: rgb(255, 255, 255); + border-width: 0.01rem 0.01rem 0.01rem 0.01rem; + border-color: #e5e5e5; + border-style: solid; + } +} + +.mulit-chart-select_menu { + width: 100%; + display: flex; + background: #fff; + border: 0.01rem solid #e5e5e5; + + .group_select_menu { + width: 100%; + border-right: 0.01rem solid #e5e5e5; + + ul { + width: 100%; + list-style: none; + margin: 0; + padding: 0.06rem 0; + + .group_style { + cursor: pointer; + color: #909399; + display: flex; + justify-content: center; + align-items: center; + padding: 0 0.3rem 0 0.2rem; + height: 0.34rem; + line-height: 0.34rem; + outline: none; + position: relative; + gap: 0.05rem; + box-sizing: border-box; + + .label_name { + // flex: 1; + padding: 0 0.1rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .speed_input_style { + -webkit-appearance: none; + background-color: transparent; + background-image: none; + border: none; + box-sizing: border-box; + color: #606266; + display: inline-block; + font-size: inherit; + height: 0.34rem; + line-height: 0.34rem; + outline: none; + padding: 0 0rem; + transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); + width: 50%; + text-align: center; + // text-indent: 0.22rem; + } + + .deleted_style { + position: absolute; + right: 0.1rem; + font-size: 0.16rem; + } + + .deleted_style:hover { + color: red; + cursor: pointer; + } + + &:hover { + background: #f5f7fa; + color: #303133; + } + + .node_style { + cursor: pointer; + color: #909399; + display: flex; + align-items: center; + padding: 0 0.3rem 0 0.2rem; + height: 0.34rem; + line-height: 0.34rem; + outline: none; + + .label_name { + // flex: 1; + padding: 0 0.1rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + &:hover { + background: #f5f7fa; + color: #303133; + } + } + } + + .label_active { + color: #409eff !important; + font-weight: 700; + } + + .none_active { + color: #909399; + font-weight: unset; + } + } + } +} + +.paramQuery_popover_style { + min-width: 2rem !important; + width: unset !important; + inset: 1.2rem auto auto 2.42rem !important; + padding: unset !important; +} + +.multispeed_popover_style { + min-width: 2rem !important; + width: unset !important; + inset: 1.31rem auto auto 3.4rem !important; + padding: unset !important; +} + +.SPEED_popover_style { + min-width: 1.5rem !important; + width: unset !important; + inset: 1.31rem auto auto 2.42rem !important; + padding: unset !important; +} +</style> -- Gitblit v1.9.3