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) {
if (this.event[eventName]) {
this.event[eventName] = {};
this.event[eventName] = [];
}
}

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

@ -9,9 +9,14 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
></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>
</div>
</div>
@ -46,8 +51,14 @@
<div class="echarts-box-list">
<div class="title">问题等级分析</div>
<div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div>
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div>
<div
class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div>
</div>
@ -55,7 +66,10 @@
<div class="title">问题处置对比分析</div>
<div class="flex">
<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>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils";
import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({
resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data;
return getV2PatrolStatisticChart({
group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null,
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null,
startTime: paramsData.value.timeRange[0]
? 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,
code: props.resCode,
});
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
},
],
seriesOptions: {},
}),
})
);
});
}
@ -219,7 +241,9 @@ function getTableData() {
if (res) {
if (res.yaxis?.length) {
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(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px;
position: relative;
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;
&::after {
position: absolute;
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;
height: 64px;
right: -12px;

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

@ -9,9 +9,14 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
></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>
</div>
</div>
@ -46,8 +51,14 @@
<div class="echarts-box-list">
<div class="title">缺陷问题等级分析</div>
<div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div>
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div>
<div
class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div>
</div>
@ -55,7 +66,10 @@
<div class="title">缺陷养护对比分析</div>
<div class="flex">
<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>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils";
import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({
resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data;
return getV2PatrolStatisticChart({
group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null,
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null,
startTime: paramsData.value.timeRange[0]
? 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,
code: props.resCode,
});
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
},
],
seriesOptions: {},
}),
})
);
});
}
@ -219,7 +241,9 @@ function getTableData() {
if (res) {
if (res.yaxis?.length) {
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(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px;
position: relative;
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;
&::after {
position: absolute;
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;
height: 64px;
right: -12px;

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

@ -1,5 +1,9 @@
<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>
<Tree
ref="layerTreeRef"
@ -18,7 +22,11 @@
<template v-slot:default="{ data, onMouseoverTip }">
<div class="item-name">
<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="" />
</div>
<span class="name" @mouseover="onMouseoverTip($event)">
@ -27,8 +35,16 @@
</div>
</template>
<template v-slot:right="{ data }">
<span 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
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>
</template>
</Tree>
@ -37,7 +53,14 @@
</template>
<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 { useProjectStore } from "@/store/modules/project";
import { useLayer } from "@/hooks/web/useProject";
@ -121,7 +144,7 @@ watch(
}, 500);
});
}
},
}
);
onMounted(() => {

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

@ -9,9 +9,14 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
value-format="YYYY-MM-DD"
></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>
</div>
</div>
@ -46,8 +51,14 @@
<div class="echarts-box-list">
<div class="title">缺陷问题等级分析</div>
<div class="flex">
<div class="echarts-box echarts-box-left" ref="flawProblemPieRef"></div>
<div class="echarts-box echarts-box-right" ref="flawProblemBarRef"></div>
<div
class="echarts-box echarts-box-left"
ref="flawProblemPieRef"
></div>
<div
class="echarts-box echarts-box-right"
ref="flawProblemBarRef"
></div>
</div>
</div>
@ -55,7 +66,10 @@
<div class="title">缺陷养护对比分析</div>
<div class="flex">
<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>
@ -65,7 +79,11 @@
import { ref, onMounted, nextTick, onBeforeUnmount } from "vue";
import * as echarts from "echarts";
import { getV2PatrolStatisticChart } from "@/api/dike";
import { initCommonBarLineOptions, initCommonPieRingOptions, initCommonAngleAxisOptions } from "@/utils/echartsUtils";
import {
initCommonBarLineOptions,
initCommonPieRingOptions,
initCommonAngleAxisOptions,
} from "@/utils/echartsUtils";
const props = defineProps({
resCode: {
@ -96,8 +114,12 @@ function requestFunc(data: any) {
const { group } = data;
return getV2PatrolStatisticChart({
group,
startTime: paramsData.value.timeRange[0] ? paramsData.value.timeRange[0] + " 00:00:00" : null,
endTime: paramsData.value.timeRange[1] ? paramsData.value.timeRange[1] + " 23:59:59" : null,
startTime: paramsData.value.timeRange[0]
? 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,
code: props.resCode,
});
@ -126,7 +148,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
flawProblemPie.value?.dispose();
@ -209,7 +231,7 @@ function getTableData() {
},
],
seriesOptions: {},
}),
})
);
});
}
@ -219,7 +241,9 @@ function getTableData() {
if (res) {
if (res.yaxis?.length) {
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(() => {
@ -234,7 +258,7 @@ function getTableData() {
seriesOptions: {
barWidth: 20,
},
}),
})
);
//
yhComparePie.value?.dispose();
@ -347,12 +371,18 @@ onBeforeUnmount(() => {
border-radius: 10px;
position: relative;
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;
&::after {
position: absolute;
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;
height: 64px;
right: -12px;

14
src/views/Main/index.vue

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

4
vite.config.ts

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

Loading…
Cancel
Save