| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628 |
- <template>
- <div class="dialogModal" id="detailModal">
- <div class="modal-top">
- <span class="pointer-events-auto" @click="redictTo">
- <i>
- <SvgIcon class="icon" size="14" name="inner-kd" />
- </i>
- <span class="modal-title"> {{ title }}</span>
- </span>
- <span class="close" @click="getClose">✕</span>
- </div>
- <div class="modal-card">
- <div class="card-box" v-for="(item, index) in modalCard" :key="index">
- <div class="card-pic">
- <img :src="item.imgSrc" alt="" />
- </div>
- <div class="card-content">
- <div class="content-label">{{ item.label }}</div>
- <div class="content-value">{{ item.value }}</div>
- </div>
- </div>
- </div>
- <div class="modal-card1">
- <div class="left-modal">
- <div class="value-m">{{ valueM }}</div>
- <div class="label-m">{{ labelM }}</div>
- </div>
- <div class="right-modal">
- <div class="modal-zl" v-for="(item, index) in zlList" :key="index">
- <div class="left-zl">
- <div class="label-left">
- <span class="pic"></span>
- <span>{{ item.label }}</span>
- </div>
- <div class="value-left">
- <span class="text">{{ item.value }}</span>
- <span>Pa</span>
- </div>
- </div>
- <div class="right-zl">
- <span class="text"> {{ item.percent }}</span>
- <span>%</span>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-card2">
- <div class="modal-wind" v-for="(item, index) in windLfList" :key="index">
- <span class="text">{{ item.label }}</span>
- <span class="num">{{ item.value }}</span>
- <span class="dw">%</span>
- </div>
- </div>
- <!-- <div class="modal-card3">
- <div class="warn-left">
- <div class="vent-l">
- <span class="warn-label">{{ vent.value }}</span>
- <span class="warn-value">{{ vent.label }}</span>
- </div>
- <div class="gas-l">
- <span class="warn-label">{{ gas.value }}</span>
- <span class="warn-value">{{ gas.label }}</span>
- </div>
- </div>
- <div class="warn-c">
- <div class="warn-icon"></div>
- </div>
- <div class="warn-right">
- <div class="fire-r">
- <span class="warn-value">{{ fire.label }}</span>
- <span class="warn-label">{{ fire.value }}</span>
- </div>
- <div class="dust-r">
- <span class="warn-value">{{ dust.label }}</span>
- <span class="warn-label">{{ dust.value }}</span>
- </div>
- </div>
- </div> -->
- </div>
- </template>
- <script lang="ts" setup>
- import { ref, reactive, defineProps, watch } from 'vue';
- import { SvgIcon } from '/@/components/Icon';
- import { useAutoLogin } from '/@/hooks/vent/useAutoLogin';
- import { getAssetURL } from '/@/utils/ui';
- // const globalConfig = inject('globalConfig');
- let props = defineProps({
- centerDetail: {
- type: Object,
- default: () => {
- return {};
- },
- },
- title: {
- type: String,
- default: '布尔台矿',
- },
- });
- const { open } = useAutoLogin();
- // let modalTitle = ref('布尔台矿');
- // let modalTitle = ref('yjl');
- let modalCard = reactive([
- { imgSrc: getAssetURL('company/home/hang.png'), label: '巷道长度', value: 0 },
- { imgSrc: getAssetURL('company/home/people.png'), label: '人员总数', value: 0 },
- { imgSrc: getAssetURL('company/home/car.png'), label: '车辆总数', value: 0 },
- ]);
- let valueM = ref(0);
- let labelM = ref('');
- let zlList = reactive([
- { label: '关键阻力——进风', value: 0, percent: '0' },
- { label: '关键阻力——用风', value: 0, percent: '0' },
- { label: '关键阻力——回风', value: 0, percent: '0' },
- ]);
- let windLfList = reactive([
- { label: '有效风量率', value: '0' },
- { label: '矿井漏风率', value: '0' },
- ]);
- // let vent = reactive({
- // label: '通风风险性',
- // value: '低风险',
- // });
- // let gas = reactive({
- // label: '瓦斯风险性',
- // value: '低风险',
- // });
- // let fire = reactive({
- // label: '火灾风险性',
- // value: '低风险',
- // });
- // let dust = reactive({
- // label: '粉尘风险性',
- // value: '低风险',
- // });
- // let vent = reactive({
- // // label: '总进风',
- // label: '总阻力',
- // value: 0,
- // });
- // let gas = reactive({
- // label: '总风量',
- // value: 0,
- // });
- // let fire = reactive({
- // label: '等积孔',
- // value: 0,
- // });
- // let dust = reactive({
- // label: '粉尘风险性',
- // value: '低风险',
- // });
- // 选取各项数据是引用的索引,有些矿井存在多个关键阻力路线等,需要轮播
- const pickIndex = ref(0);
- const emit = defineEmits(['closeDialog']);
- function getClose() {
- emit('closeDialog', false);
- }
- // 根据新的数据更新依赖数据,核心方法
- function update(newC) {
- if (JSON.stringify(newC) != '{}') {
- modalCard[0]['value'] = newC.sys_data.totallength || 0;
- modalCard[1]['value'] = newC.sys_data.personCount || 0;
- modalCard[2]['value'] = newC.sys_data.vehicleCount || 0;
- // 根据目前轮播索引确定要展示的数据index
- const majorIndex = pickIndex.value % newC.majorpath_data.length;
- labelM.value = newC.majorpath_data[majorIndex].deviceName;
- valueM.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
- zlList[0]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_1;
- zlList[1]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_2;
- zlList[2]['value'] = newC.majorpath_data[majorIndex].majorpath.drag_3;
- zlList[0]['percent'] = ((zlList[0]['value'] / valueM.value) * 100).toFixed(2);
- zlList[1]['percent'] = ((zlList[1]['value'] / valueM.value) * 100).toFixed(2);
- zlList[2]['percent'] = ((zlList[2]['value'] / valueM.value) * 100).toFixed(2);
- windLfList[0].value = newC.sys_data.useM3Perent || '0';
- const base = parseFloat(newC.sys_data.zongfengliang);
- windLfList[1].value = (((base - parseFloat(newC.sys_data.zongjinfeng)) / base) * 100).toFixed(2);
- // vent.value = newC.majorpath_data[majorIndex].majorpath.drag_total;
- // gas.value = newC.majorpath_data[majorIndex].majorpath.m3_total;
- // fire.value = Math.round(((1.19 * gas.value) / 60 / Math.sqrt(vent.value)) * 100) / 100;
- }
- }
- watch(
- () => props.centerDetail,
- (newC) => {
- // 轮播 index + 1,这样 update 取值是可以根据该 index 取值,对 1000 取余是为了处理 Infinity 后无法轮播的情况(虽然不可能出现)
- pickIndex.value = (pickIndex.value + 1) % 1000;
- update(newC);
- },
- {
- immediate: true,
- deep: true,
- }
- );
- // 重新向到新的页面,业务上讲是公司端跳转矿端
- function redictTo() {
- if (!props.centerDetail.ip) return;
- const url = `http://${props.centerDetail.ip}:8092/login`;
- open(url, '/micro-vent-3dModal/dashboard/analysis');
- }
- </script>
- <style lang="less" scoped>
- @font-face {
- font-family: 'douyuFont';
- src: url('/@/assets/font/douyuFont.otf');
- }
- .dialogModal {
- position: relative;
- width: 568px;
- height: 340px;
- background: url('/@/assets/images/company/area-card2.png') no-repeat;
- background-size: 100% 100%;
- pointer-events: none;
- z-index: 1000;
- .modal-top {
- position: absolute;
- left: 32px;
- top: 15px;
- height: 30px;
- line-height: 30px;
- width: 90%;
- .icon {
- cursor: pointer;
- }
- .modal-title {
- font-size: 14px;
- font-family: 'douyuFont';
- color: #fff;
- margin-left: 10px;
- }
- .close {
- position: absolute;
- right: 12px;
- color: #2cb6ff;
- cursor: pointer;
- pointer-events: auto;
- }
- }
- .modal-card {
- position: absolute;
- top: 45px;
- left: 50%;
- transform: translate(-50%, 0);
- height: 46px;
- width: 90%;
- margin-top: 15px;
- display: flex;
- justify-content: space-between;
- background: url('../../../../../assets/images/company/modal-card.png') no-repeat center;
- background-size: 100% 100%;
- .card-box {
- display: flex;
- flex: 1;
- height: 100%;
- justify-content: center;
- align-items: center;
- &:first-child {
- margin-left: 15px;
- }
- &:last-child {
- margin-right: 10px;
- }
- .card-pic {
- margin-right: 10px;
- }
- .card-content {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .content-label {
- font-size: 14px;
- color: #ccd6df;
- }
- .content-value {
- font-family: 'douyuFont';
- font-size: 14px;
- color: #fff;
- text-align: center;
- }
- }
- }
- }
- .modal-card1 {
- position: absolute;
- top: 121px;
- left: 50%;
- transform: translate(-50%, 0);
- height: 116px;
- width: 90%;
- padding: 0px 10px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: url('../../../../../assets/images/company/area3.png') no-repeat center;
- background-size: 100% 100%;
- .left-modal {
- position: relative;
- width: 95px;
- height: 95px;
- background: url('../../../../../assets/images/company/zfx.png') no-repeat center;
- background-size: 100% 100%;
- .value-m {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- font-family: 'douyuFont';
- font-size: 14px;
- color: #3df6ff;
- }
- .label-m {
- position: absolute;
- bottom: 2px;
- width: 100%;
- font-size: 10px;
- text-align: center;
- color: #fff;
- }
- }
- .right-modal {
- width: calc(100% - 105px);
- height: 95px;
- margin-left: 10px;
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- .modal-zl {
- height: 24px;
- display: flex;
- justify-content: space-between;
- .left-zl {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: calc(80% - 10px);
- padding: 0px 10px;
- margin-right: 10px;
- box-sizing: border-box;
- background-color: rgba(6, 57, 97, 0.3);
- .label-left {
- .pic {
- display: inline-block;
- width: 6px;
- height: 6px;
- border-radius: 50%;
- margin-right: 5px;
- }
- span {
- color: #ccd6df;
- font-size: 14px;
- }
- }
- .value-left {
- .text {
- font-family: 'douyuFont';
- font-size: 14px;
- margin-right: 5px;
- }
- span {
- font-size: 12px;
- color: #ccd6df;
- }
- }
- }
- &:nth-child(1) .left-zl .pic {
- background-color: #51cfff;
- }
- &:nth-child(2) .left-zl .pic {
- background-color: #ffb85b;
- }
- &:nth-child(3) .left-zl .pic {
- background-color: #a091ff;
- }
- &:nth-child(1) .left-zl .text {
- color: #51cfff;
- }
- &:nth-child(2) .left-zl .text {
- color: #ffb85b;
- }
- &:nth-child(3) .left-zl .text {
- color: #a091ff;
- }
- .right-zl {
- width: 20%;
- display: flex;
- justify-content: center;
- align-items: center;
- background-color: rgba(6, 57, 97, 0.3);
- .text {
- font-family: 'douyuFont';
- font-size: 14px;
- }
- span {
- margin-left: 5px;
- }
- }
- &:nth-child(1) .right-zl {
- color: #51cfff;
- }
- &:nth-child(2) .right-zl {
- color: #ffb85b;
- }
- &:nth-child(3) .right-zl {
- color: #a091ff;
- }
- }
- }
- }
- .modal-card2 {
- position: absolute;
- top: 240px;
- left: 50%;
- transform: translate(-50%, 0);
- height: 60px;
- width: 90%;
- margin: 10px 0;
- padding: 0 10px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- box-sizing: border-box;
- background: url('../../../../../assets/images/company/area3.png') no-repeat center;
- background-size: 100% 100%;
- .modal-wind {
- position: relative;
- width: 50%;
- height: 34px;
- .text {
- position: absolute;
- top: 50%;
- left: 40px;
- transform: translate(0, -50%);
- color: #fff;
- font-size: 14px;
- }
- .num {
- position: absolute;
- top: 50%;
- right: 45px;
- transform: translate(0, -50%);
- color: #fff;
- font-family: 'douyuFont';
- font-size: 14px;
- }
- .dw {
- position: absolute;
- top: 50%;
- right: 12px;
- transform: translate(0, -50%);
- color: #fff;
- }
- &:nth-child(1) {
- background: url('../../../../../assets/images/company/green.png') no-repeat center;
- background-size: 100% 100%;
- }
- &:nth-child(2) {
- background: url('../../../../../assets/images/company/purple.png') no-repeat center;
- background-size: 100% 100%;
- }
- &:nth-child(1) .num {
- color: #31fbcc;
- }
- &:nth-child(2) .num {
- color: #97a3fa;
- }
- }
- }
- .modal-card3 {
- position: absolute;
- top: 302px;
- left: 50%;
- transform: translate(-50%, 0);
- height: 110px;
- width: 90%;
- padding: 0px 10px;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: url('../../../../../assets/images/company/area3.png') no-repeat center;
- background-size: 100% 100%;
- .warn-left {
- position: relative;
- width: 206px;
- height: 85px;
- background: url('../../../../../assets/images/company/warn-left.png') no-repeat center;
- .vent-l {
- position: absolute;
- top: 10px;
- left: 0;
- width: 80%;
- display: flex;
- justify-content: space-around;
- }
- .gas-l {
- position: absolute;
- top: 52px;
- left: 0;
- width: 80%;
- display: flex;
- justify-content: space-around;
- }
- }
- .warn-c {
- position: relative;
- width: 90px;
- height: 92px;
- background: url('../../../../../assets/images/company/warn-center.png') no-repeat center;
- .warn-icon {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -85%);
- width: 50px;
- height: 50px;
- background: url('../../../../../assets/images/company/icon1.png') no-repeat center;
- }
- }
- .warn-right {
- position: relative;
- width: 206px;
- height: 85px;
- background: url('../../../../../assets/images/company/warn-right.png') no-repeat center;
- .fire-r {
- position: absolute;
- top: 10px;
- right: 0;
- width: 80%;
- display: flex;
- justify-content: space-around;
- }
- .dust-r {
- position: absolute;
- top: 52px;
- right: 0;
- width: 80%;
- display: flex;
- justify-content: space-around;
- }
- }
- .warn-label {
- font-family: 'douyuFont';
- font-size: 14px;
- color: #31fbcc;
- line-height: 27px;
- }
- .warn-value {
- color: #fff;
- font-size: 14px;
- }
- }
- }
- </style>
|