From 4ebbd3cbd7112004242843a3eff761fcbbdfdee0 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 26 十一月 2024 15:52:41 +0800
Subject: [PATCH] 项目库新增路由
---
src/views/index.vue | 117 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 75 insertions(+), 42 deletions(-)
diff --git a/src/views/index.vue b/src/views/index.vue
index 82171b7..b4cd025 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -94,7 +94,7 @@
</div>
<!-- 鍦板浘 -->
</div>
- <div class="mt-[10px] min-w-[1600px]">
+ <div style="margin-top: 10px">
<el-card>
<div>
<div class="search-form">
@@ -120,8 +120,8 @@
</el-form-item>
</el-form>
</div>
- <div class="flex w-full h-[500px] border border-[#DBDEEA]">
- <!-- <Map
+ <div class="map_div">
+ <Map
id="DangerSourceId"
ref="mapRef"
:is-show-control="true"
@@ -132,7 +132,7 @@
@label-click="showDetails"
@mark-click="showDetails"
@current-label-style-change="labelStyleChange"
- /> -->
+ />
</div>
</div>
</el-card>
@@ -141,11 +141,12 @@
</template>
<script>
-import SvgIcon from '@/components/SvgIcon/index.vue';
-import ProjectOverview from './components/projectOverview.vue';
-import NoticeTable from './components/noticeTable.vue';
-import TidingsTable from './components/tidingsTable.vue';
-// import Map from './components/Map/index.vue';
+import SvgIcon from "@/components/SvgIcon/index.vue";
+import ProjectOverview from "./components/projectOverview.vue";
+import NoticeTable from "./components/noticeTable.vue";
+import TidingsTable from "./components/tidingsTable.vue";
+import Map from "./components/Map/index.vue";
+import { getCalculatioln, getAbnormalData } from '@/api/login';
export default {
name: "Index",
data() {
@@ -153,49 +154,76 @@
queryParams: {},
timeMerge: [],
sys_administrative_divisions: [],
- calculation: [],
countExceptionProjectData: {},
searchForm: {},
- tableDatas: []
+ tableDatas: [
+ {
+ name: "灏勬椽甯�",
+ value: 105.37281,
+ lat: 30.87145,
+ lon: 105.37281,
+ id: "222222222",
+ },
+ {
+ name: "xxxx",
+ value: 105.22332,
+ lat: 31.52421,
+ lon: 106.22332,
+ id: "11112",
+ },
+ ],
+ calculation: [
+ { text: '鍌�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '寤�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '鐪�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '甯�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '鏂�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '绔�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '鍘�', mun: 0, statistics: '', statisticsMun: '0' },
+ { text: '鏅�', mun: 0, statistics: '', statisticsMun: '0' }
+ ]
};
},
components: {
SvgIcon,
ProjectOverview,
NoticeTable,
- TidingsTable
+ TidingsTable,
+ Map,
+ },
+ created() {
+ this.handleQuery()
},
methods: {
-
dataPickerChange(val) {
if (!val) {
- this.queryParams.startTime = '';
- this.queryParams.endTime = '';
+ this.queryParams.startTime = "";
+ this.queryParams.endTime = "";
return;
}
- this.queryParams.startTime = timeMerge[0];
- this.queryParams.endTime = timeMerge[1];
+ this.queryParams.startTime = this.timeMerge[0];
+ this.queryParams.endTime = this.timeMerge[1];
},
handleQuery() {
- console.log(queryParams);
+ console.log(this.queryParams);
const obj = {
- startDate: queryParams.startTime,
- endDate: queryParams.endTime,
- areaCode: queryParams.area,
- minInvestment: queryParams.start,
- maxInvestment: queryParams.end
+ startDate: this.queryParams.startTime,
+ endDate: this.queryParams.endTime,
+ areaCode: this.queryParams.area,
+ minInvestment: this.queryParams.start,
+ maxInvestment: this.queryParams.end,
};
- this.getCalculatioln(obj).then((res) => {
+ getCalculatioln(obj).then((res) => {
+
const arr = res.data.proPhaseCountVO?.concat(res.data.impTypeCountVO);
const newArr = arr.map((item) => ({
text: item.text,
mun: item.count,
statistics: item.type,
- statisticsMun: item.amount
+ statisticsMun: item.amount,
}));
-
// 鍒涘缓涓�涓璞★紝浠ヤ究鏍规嵁 text 灞炴�у揩閫熸煡鎵� newArr 涓殑瀵硅薄
const newArrLookup = newArr.reduce((lookup, item) => {
lookup[item.text] = item;
@@ -203,13 +231,14 @@
}, {});
// 鏇存柊 calculation 鏁扮粍锛屼繚鎸佸叾鍘熷椤哄簭
- calculation.value = calculation.value.map((item) => {
+ this.calculation = this.calculation.map((item) => {
const newItem = newArrLookup[item.text];
return newItem ? newItem : item; // 濡傛灉 newItem 瀛樺湪锛屽垯杩斿洖 newItem锛屽惁鍒欒繑鍥炲師濮� item
});
+
});
- abnormalData(obj);
+ this.abnormalData(obj);
},
// 鑾峰彇寮傚父鏁版嵁
@@ -225,20 +254,20 @@
labelStyleChange(currentLabel) {
if (lastLabel) {
- lastLabel.setBackgroundColor('#fff');
- lastLabel.setFontColor('var(--el-color-primary)');
+ lastLabel.setBackgroundColor("#fff");
+ lastLabel.setFontColor("var(--el-color-primary)");
}
- currentLabel.setBackgroundColor('var(--el-color-primary)');
- currentLabel.setFontColor('#fff');
+ currentLabel.setBackgroundColor("var(--el-color-primary)");
+ currentLabel.setFontColor("#fff");
lastLabel = currentLabel;
},
resetQuery() {
this.queryParams = {
- area: '',
- start: '',
- end: '',
- startTime: '',
- endTime: ''
+ area: "",
+ start: "",
+ end: "",
+ startTime: "",
+ endTime: "",
};
this.timeMerge = [];
this.handleQuery();
@@ -249,11 +278,9 @@
// await search()
this.mapRef.moveTo(105.37281, 30.87145);
},
- mapQuery() {
-
- }
- }
-}
+ mapQuery() { },
+ },
+};
</script>
<style scoped lang="scss">
@@ -344,5 +371,11 @@
gap: 10px;
font-size: 12px;
}
+.map_div {
+ display: flex;
+ width: 100%;
+ height: 500px;
+ border: #dbdeea;
+}
</style>
--
Gitblit v1.8.0