Browse Source

fix: 修复bug和隐藏界面

feature-v1.0.0
panyuyi 1 month ago
parent
commit
8939c530a1
  1. 2
      src/utils/eventBus.ts
  2. 58
      src/views/Main/Dike/components/PestAnimalAnalysis.vue
  3. 58
      src/views/Main/Dike/components/StatisticsAnalysis.vue
  4. 35
      src/views/Main/Map/components/LayerTree.vue
  5. 58
      src/views/Main/Sluice/components/StatisticsAnalysis.vue
  6. 14
      src/views/Main/index.vue
  7. 4
      vite.config.ts

2
src/utils/eventBus.ts

@ -25,7 +25,7 @@ class EventBus {
// 移除监听 // 移除监听
$off(eventName: string) { $off(eventName: string) {
if (this.event[eventName]) { if (this.event[eventName]) {
this.event[eventName] = {}; this.event[eventName] = [];
} }
} }

58
src/views/Main/Dike/components/PestAnimalAnalysis.vue

@ -9,9 +9,14 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="YYYY-MM-DD"
></el-date-picker> ></el-date-picker>
<el-button class="search-btn !ml-12" type="primary" @click="handleSearch()">查询</el-button> <el-button
class="search-btn !ml-12"
type="primary"
@click="handleSearch()"
>查询</el-button
>
<el-button @click="resetSearch()">重置</el-button> <el-button @click="resetSearch()">重置</el-button>
</div> </div>
</div> </div>
@ -46,8 +51,14 @@
<div class="echarts-box-list"> <div class="echarts-box-list">
<div class="title">问题等级分析</div> <div class="title">问题等级分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div> <div
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div> class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div> </div>
</div> </div>
@ -55,7 +66,10 @@
<div class="title">问题处置对比分析</div> <div class="title">问题处置对比分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div> <div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div>
<div class="echarts-box echarts-box-right" ref="yhCompareBarRef"></div> <div
class="echarts-box echarts-box-right"
ref="yhCompareBarRef"
></div>
</div> </div>
</div> </div>
</div> </div>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue"; import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike"; import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils"; import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({ const props = defineProps({
resCode: { resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data; const { group } = data;
return getV2PatrolStatisticChart({ return getV2PatrolStatisticChart({
group, group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null, startTime: paramsData.value.timeRange[0]
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null, ? paramsData.value.timeRange[0] + " 00:00:00"
: null,
endTime: paramsData.value.timeRange[1]
? paramsData.value.timeRange[1] + " 23:59:59"
: null,
adcd: paramsData.value.adcd, adcd: paramsData.value.adcd,
code: props.resCode, code: props.resCode,
}); });
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
flawProblemPie.value?.dispose(); flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
}, },
], ],
seriesOptions: {}, seriesOptions: {},
}), })
); );
}); });
} }
@ -219,7 +241,9 @@ function getTableData() {
if (res) { if (res) {
if (res.yaxis?.length) { if (res.yaxis?.length) {
yhSum.value = Number( yhSum.value = Number(
res.yaxis.flatMap((v: any) => v.series)?.find((v: any) => v.code === "DF_BD_YH_SUM")?.sum ?? null, res.yaxis
.flatMap((v: any) => v.series)
?.find((v: any) => v.code === "DF_BD_YH_SUM")?.sum ?? null
); );
} }
nextTick(() => { nextTick(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
yhComparePie.value?.dispose(); yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px; border-radius: 10px;
position: relative; position: relative;
padding: 16px 24px; padding: 16px 24px;
background: linear-gradient(180deg, #eafffc 0%, rgba(222, 255, 250, 0) 100%), #ffffff; background: linear-gradient(
180deg,
#eafffc 0%,
rgba(222, 255, 250, 0) 100%
),
#ffffff;
overflow: hidden; overflow: hidden;
&::after { &::after {
position: absolute; position: absolute;
content: ""; content: "";
background: url("@/assets/img/icon-attr-bg.png") no-repeat center center; background: url("@/assets/img/icon-attr-bg.png") no-repeat center
center;
width: 64px; width: 64px;
height: 64px; height: 64px;
right: -12px; right: -12px;

58
src/views/Main/Dike/components/StatisticsAnalysis.vue

@ -9,9 +9,14 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="YYYY-MM-DD"
></el-date-picker> ></el-date-picker>
<el-button class="search-btn !ml-12" type="primary" @click="handleSearch()">查询</el-button> <el-button
class="search-btn !ml-12"
type="primary"
@click="handleSearch()"
>查询</el-button
>
<el-button @click="resetSearch()">重置</el-button> <el-button @click="resetSearch()">重置</el-button>
</div> </div>
</div> </div>
@ -46,8 +51,14 @@
<div class="echarts-box-list"> <div class="echarts-box-list">
<div class="title">缺陷问题等级分析</div> <div class="title">缺陷问题等级分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div> <div
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div> class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div> </div>
</div> </div>
@ -55,7 +66,10 @@
<div class="title">缺陷养护对比分析</div> <div class="title">缺陷养护对比分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div> <div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div>
<div class="echarts-box echarts-box-right" ref="yhCompareBarRef"></div> <div
class="echarts-box echarts-box-right"
ref="yhCompareBarRef"
></div>
</div> </div>
</div> </div>
</div> </div>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue"; import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike"; import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils"; import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({ const props = defineProps({
resCode: { resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data; const { group } = data;
return getV2PatrolStatisticChart({ return getV2PatrolStatisticChart({
group, group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null, startTime: paramsData.value.timeRange[0]
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null, ? paramsData.value.timeRange[0] + " 00:00:00"
: null,
endTime: paramsData.value.timeRange[1]
? paramsData.value.timeRange[1] + " 23:59:59"
: null,
adcd: paramsData.value.adcd, adcd: paramsData.value.adcd,
code: props.resCode, code: props.resCode,
}); });
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
flawProblemPie.value?.dispose(); flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
}, },
], ],
seriesOptions: {}, seriesOptions: {},
}), })
); );
}); });
} }
@ -219,7 +241,9 @@ function getTableData() {
if (res) { if (res) {
if (res.yaxis?.length) { if (res.yaxis?.length) {
yhSum.value = Number( yhSum.value = Number(
res.yaxis.flatMap((v: any) => v.series)?.find((v: any) => v.code === "DF_BD_YH_SUM")?.sum ?? null, res.yaxis
.flatMap((v: any) => v.series)
?.find((v: any) => v.code === "DF_BD_YH_SUM")?.sum ?? null
); );
} }
nextTick(() => { nextTick(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
yhComparePie.value?.dispose(); yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px; border-radius: 10px;
position: relative; position: relative;
padding: 16px 24px; padding: 16px 24px;
background: linear-gradient(180deg, #eafffc 0%, rgba(222, 255, 250, 0) 100%), #ffffff; background: linear-gradient(
180deg,
#eafffc 0%,
rgba(222, 255, 250, 0) 100%
),
#ffffff;
overflow: hidden; overflow: hidden;
&::after { &::after {
position: absolute; position: absolute;
content: ""; content: "";
background: url("@/assets/img/icon-attr-bg.png") no-repeat center center; background: url("@/assets/img/icon-attr-bg.png") no-repeat center
center;
width: 64px; width: 64px;
height: 64px; height: 64px;
right: -12px; right: -12px;

35
src/views/Main/Map/components/LayerTree.vue

@ -1,5 +1,9 @@
<template> <template>
<SyDialog dialog-class="layer-tree-dialog" :dialog-show="showDialog" :style="style"> <SyDialog
dialog-class="layer-tree-dialog"
:dialog-show="showDialog"
:style="style"
>
<template #body> <template #body>
<Tree <Tree
ref="layerTreeRef" ref="layerTreeRef"
@ -18,7 +22,11 @@
<template v-slot:default="{ data, onMouseoverTip }"> <template v-slot:default="{ data, onMouseoverTip }">
<div class="item-name"> <div class="item-name">
<div class="icon"> <div class="icon">
<img v-if="data && !data.iconCls" src="@/assets/map/icon-layer.png" alt="" /> <img
v-if="data && !data.iconCls"
src="@/assets/map/icon-layer.png"
alt=""
/>
<img v-else src="@/assets/map/icon-folder.png" alt="" /> <img v-else src="@/assets/map/icon-folder.png" alt="" />
</div> </div>
<span class="name" @mouseover="onMouseoverTip($event)"> <span class="name" @mouseover="onMouseoverTip($event)">
@ -27,8 +35,16 @@
</div> </div>
</template> </template>
<template v-slot:right="{ data }"> <template v-slot:right="{ data }">
<span class="btn-item" v-if="data && !data.iconCls" @click.stop="flyTo(data)"> <span
<iconpark-icon size="16" name="location" color="rgba(0,0,0,0.9)"></iconpark-icon> class="btn-item"
v-if="data && !data.iconCls"
@click.stop="flyTo(data)"
>
<iconpark-icon
size="16"
name="location"
color="rgba(0,0,0,0.9)"
></iconpark-icon>
</span> </span>
</template> </template>
</Tree> </Tree>
@ -37,7 +53,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, computed, nextTick, onMounted, onBeforeUnmount } from "vue"; import {
ref,
watch,
computed,
nextTick,
onMounted,
onBeforeUnmount,
} from "vue";
import SyDialog from "@/components/Dialog/index.vue"; import SyDialog from "@/components/Dialog/index.vue";
import { useProjectStore } from "@/store/modules/project"; import { useProjectStore } from "@/store/modules/project";
import { useLayer } from "@/hooks/web/useProject"; import { useLayer } from "@/hooks/web/useProject";
@ -121,7 +144,7 @@ watch(
}, 500); }, 500);
}); });
} }
}, }
); );
onMounted(() => { onMounted(() => {

58
src/views/Main/Sluice/components/StatisticsAnalysis.vue

@ -9,9 +9,14 @@
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd" value-format="YYYY-MM-DD"
></el-date-picker> ></el-date-picker>
<el-button class="search-btn !ml-12" type="primary" @click="handleSearch()">查询</el-button> <el-button
class="search-btn !ml-12"
type="primary"
@click="handleSearch()"
>查询</el-button
>
<el-button @click="resetSearch()">重置</el-button> <el-button @click="resetSearch()">重置</el-button>
</div> </div>
</div> </div>
@ -46,8 +51,14 @@
<div class="echarts-box-list"> <div class="echarts-box-list">
<div class="title">缺陷问题等级分析</div> <div class="title">缺陷问题等级分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div> <div
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div> class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div> </div>
</div> </div>
@ -55,7 +66,10 @@
<div class="title">缺陷养护对比分析</div> <div class="title">缺陷养护对比分析</div>
<div class="flex"> <div class="flex">
<div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div> <div class="echarts-box echarts-box-left" ref="yhComparePieRef"></div>
<div class="echarts-box echarts-box-right" ref="yhCompareBarRef"></div> <div
class="echarts-box echarts-box-right"
ref="yhCompareBarRef"
></div>
</div> </div>
</div> </div>
</div> </div>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue"; import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike"; import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils"; import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({ const props = defineProps({
resCode: { resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data; const { group } = data;
return getV2PatrolStatisticChart({ return getV2PatrolStatisticChart({
group, group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null, startTime: paramsData.value.timeRange[0]
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null, ? paramsData.value.timeRange[0] + " 00:00:00"
: null,
endTime: paramsData.value.timeRange[1]
? paramsData.value.timeRange[1] + " 23:59:59"
: null,
adcd: paramsData.value.adcd, adcd: paramsData.value.adcd,
code: props.resCode, code: props.resCode,
}); });
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
flawProblemPie.value?.dispose(); flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
}, },
], ],
seriesOptions: {}, seriesOptions: {},
}), })
); );
}); });
} }
@ -219,7 +241,9 @@ function getTableData() {
if (res) { if (res) {
if (res.yaxis?.length) { if (res.yaxis?.length) {
yhSum.value = Number( yhSum.value = Number(
res.yaxis.flatMap((v: any) => v.series)?.find((v: any) => v.code === "SZ_BD_YH_SUM")?.sum ?? null, res.yaxis
.flatMap((v: any) => v.series)
?.find((v: any) => v.code === "SZ_BD_YH_SUM")?.sum ?? null
); );
} }
nextTick(() => { nextTick(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: { seriesOptions: {
barWidth: 20, barWidth: 20,
}, },
}), })
); );
// //
yhComparePie.value?.dispose(); yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px; border-radius: 10px;
position: relative; position: relative;
padding: 16px 24px; padding: 16px 24px;
background: linear-gradient(180deg, #eafffc 0%, rgba(222, 255, 250, 0) 100%), #ffffff; background: linear-gradient(
180deg,
#eafffc 0%,
rgba(222, 255, 250, 0) 100%
),
#ffffff;
overflow: hidden; overflow: hidden;
&::after { &::after {
position: absolute; position: absolute;
content: ""; content: "";
background: url("@/assets/img/icon-attr-bg.png") no-repeat center center; background: url("@/assets/img/icon-attr-bg.png") no-repeat center
center;
width: 64px; width: 64px;
height: 64px; height: 64px;
right: -12px; right: -12px;

14
src/views/Main/index.vue

@ -1,13 +1,13 @@
<template> <template>
<LeftPanel> <LeftPanel v-if="showLeftDrawer">
<Drawer style="width: 458px" v-if="showLeftDrawer"> <Drawer style="width: 458px">
<ProjectCountCard /> <ProjectCountCard />
<MonitoringCard /> <MonitoringCard />
<InspectionCard /> <InspectionCard />
</Drawer> </Drawer>
<RegionSelect /> <RegionSelect />
</LeftPanel> </LeftPanel>
<RightPanel> <RightPanel v-if="showRightDrawer">
<div class="right-panel-left"> <div class="right-panel-left">
<div class="top"> <div class="top">
<MapSearch /> <MapSearch />
@ -18,7 +18,7 @@
<LayerTree :showDialog="showLayerTree" /> <LayerTree :showDialog="showLayerTree" />
</div> </div>
</div> </div>
<Drawer style="width: 460px" v-if="showRightDrawer"> <Drawer style="width: 460px">
<SafetyOverviewCard /> <SafetyOverviewCard />
</Drawer> </Drawer>
</RightPanel> </RightPanel>
@ -91,6 +91,7 @@ onMounted(() => {
window.$bus.$on("open-reservoir-dialog", (data: any) => { window.$bus.$on("open-reservoir-dialog", (data: any) => {
window.$bus.$emit("close-left-panel"); window.$bus.$emit("close-left-panel");
window.$bus.$emit("close-right-panel"); window.$bus.$emit("close-right-panel");
window.$bus.$emit("close-bottom-panel");
showReservoir.value = true; showReservoir.value = true;
reservoirData.value = data; reservoirData.value = data;
}); });
@ -98,6 +99,7 @@ onMounted(() => {
if (!showSluice.value && !showDike.value) { if (!showSluice.value && !showDike.value) {
window.$bus.$emit("open-left-panel"); window.$bus.$emit("open-left-panel");
window.$bus.$emit("open-right-panel"); window.$bus.$emit("open-right-panel");
window.$bus.$emit("open-bottom-panel");
} }
showReservoir.value = false; showReservoir.value = false;
reservoirData.value = {}; reservoirData.value = {};
@ -106,6 +108,7 @@ onMounted(() => {
window.$bus.$on("open-sluice-dialog", (data: any) => { window.$bus.$on("open-sluice-dialog", (data: any) => {
window.$bus.$emit("close-left-panel"); window.$bus.$emit("close-left-panel");
window.$bus.$emit("close-right-panel"); window.$bus.$emit("close-right-panel");
window.$bus.$emit("close-bottom-panel");
showSluice.value = true; showSluice.value = true;
sluiceData.value = data; sluiceData.value = data;
}); });
@ -113,6 +116,7 @@ onMounted(() => {
if (!showReservoir.value && !showDike.value) { if (!showReservoir.value && !showDike.value) {
window.$bus.$emit("open-left-panel"); window.$bus.$emit("open-left-panel");
window.$bus.$emit("open-right-panel"); window.$bus.$emit("open-right-panel");
window.$bus.$emit("open-bottom-panel");
} }
showSluice.value = false; showSluice.value = false;
sluiceData.value = {}; sluiceData.value = {};
@ -121,6 +125,7 @@ onMounted(() => {
window.$bus.$on("open-dike-dialog", (data: any) => { window.$bus.$on("open-dike-dialog", (data: any) => {
window.$bus.$emit("close-left-panel"); window.$bus.$emit("close-left-panel");
window.$bus.$emit("close-right-panel"); window.$bus.$emit("close-right-panel");
window.$bus.$emit("close-bottom-panel");
showDike.value = true; showDike.value = true;
dikeData.value = data; dikeData.value = data;
}); });
@ -128,6 +133,7 @@ onMounted(() => {
if (!showSluice.value && !showReservoir.value) { if (!showSluice.value && !showReservoir.value) {
window.$bus.$emit("open-left-panel"); window.$bus.$emit("open-left-panel");
window.$bus.$emit("open-right-panel"); window.$bus.$emit("open-right-panel");
window.$bus.$emit("open-bottom-panel");
} }
showDike.value = false; showDike.value = false;
dikeData.value = {}; dikeData.value = {};

4
vite.config.ts

@ -86,8 +86,8 @@ export default defineConfig(({ mode }) => {
rewrite: (path) => path.replace(/^\/api\/iserver/, "/iserver"), rewrite: (path) => path.replace(/^\/api\/iserver/, "/iserver"),
}, },
"/api/run": { "/api/run": {
// target: "http://shuili.product.dev.com:30115/", target: "http://shuili.product.dev.com:30115/",
target: "http://172.16.34.80:18082", // target: "http://172.16.34.80:18082",
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, "/tianhui-admin-web"), rewrite: (path) => path.replace(/^\/api/, "/tianhui-admin-web"),
}, },

Loading…
Cancel
Save