From 22f9f05b3f1c452325b04f0a5ed9c5f4ad992f3b Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 16 一月 2025 22:33:29 +0800
Subject: [PATCH] 地图上项目查询

---
 src/views/index.vue |  627 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 310 insertions(+), 317 deletions(-)

diff --git a/src/views/index.vue b/src/views/index.vue
index 513d018..0b72951 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -1,145 +1,135 @@
 <template>
-    <div class="home">
-        <div class="overview">
-            <div class="overview-top">
-                <div class="title">椤圭洰鎬昏</div>
-                <div class="qurey">
-                    <el-form ref="queryFormRef" :model="queryParams">
-                        <div class="search_from">
-                            <el-form-item label="鏃ユ湡">
-                                <el-date-picker
-                                    style="width: 300px"
-                                    v-model="timeMerge"
-                                    clearable
-                                    end-placeholder="缁撴潫鏃堕棿"
-                                    format="YYYY-MM-DD"
-                                    placeholder="璇烽�夋嫨鏃ユ湡"
-                                    size="default"
-                                    start-placeholder="寮�濮嬫椂闂�"
-                                    type="daterange"
-                                    value-format="YYYY-MM-DD"
-                                    @change="dataPickerChange"
-                                />
-                            </el-form-item>
-                            <el-form-item label="琛屾斂鍖哄垝">
-                                <el-select
-                                    v-model="queryParams.area"
-                                    clearable
-                                    placeholder="璇烽�夋嫨鍖哄垝"
-                                    style="width: 180px"
-                                >
-                                    <el-option
-                                        v-for="item in sys_administrative_divisions"
-                                        :key="item.value"
-                                        :label="item.label"
-                                        :value="item.value"
-                                    />
-                                </el-select>
-                            </el-form-item>
-                            <el-form-item
-                                label="鎶曡祫閲戦"
-                                style="margin-right: 50px"
-                            >
-                                <div class="from_input">
-                                    <el-input
-                                        v-model="queryParams.start"
-                                        clearable
-                                        placeholder="璇疯緭鍏�"
-                                        style="width: 100px"
-                                        type="number"
-                                    />
-                                    鑷�
-                                    <el-input
-                                        v-model="queryParams.end"
-                                        clearable
-                                        placeholder="璇疯緭鍏�"
-                                        style="width: 100px"
-                                        type="number"
-                                    />
-                                </div>
-                            </el-form-item>
-                            <el-form-item style="margin-right: 20px">
-                                <el-button
-                                    icon="Search"
-                                    type="primary"
-                                    @click="handleQuery"
-                                    >鎼滅储</el-button
-                                >
-                                <el-button icon="Refresh" @click="resetQuery"
-                                    >閲嶇疆</el-button
-                                >
-                            </el-form-item>
-                        </div>
-                    </el-form>
+  <div class="home">
+    <div class="overview">
+      <div class="overview-top">
+        <div class="title">椤圭洰鎬昏</div>
+        <div class="qurey">
+          <el-form ref="queryFormRef" :model="queryParams">
+            <div class="search_from">
+              <el-form-item label="鏃ユ湡">
+                <el-date-picker
+                  style="width: 300px"
+                  v-model="timeMerge"
+                  clearable
+                  end-placeholder="缁撴潫鏃堕棿"
+                  format="YYYY-MM-DD"
+                  placeholder="璇烽�夋嫨鏃ユ湡"
+                  size="default"
+                  start-placeholder="寮�濮嬫椂闂�"
+                  type="daterange"
+                  value-format="YYYY-MM-DD"
+                  @change="dataPickerChange"
+                />
+              </el-form-item>
+              <el-form-item label="琛屾斂鍖哄垝">
+                <el-select
+                  v-model="queryParams.area"
+                  clearable
+                  placeholder="璇烽�夋嫨鍖哄垝"
+                  style="width: 180px"
+                >
+                  <el-option
+                    v-for="item in sys_administrative_divisions"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="鎶曡祫閲戦" style="margin-right: 50px">
+                <div class="from_input">
+                  <el-input
+                    v-model="queryParams.start"
+                    clearable
+                    placeholder="璇疯緭鍏�"
+                    style="width: 100px"
+                    type="number"
+                  />
+                  鑷�
+                  <el-input
+                    v-model="queryParams.end"
+                    clearable
+                    placeholder="璇疯緭鍏�"
+                    style="width: 100px"
+                    type="number"
+                  />
                 </div>
+              </el-form-item>
+              <el-form-item style="margin-right: 20px">
+                <el-button icon="Search" type="primary" @click="handleQuery"
+                  >鎼滅储</el-button
+                >
+                <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+              </el-form-item>
             </div>
-            <!-- 缁熻鎯呭喌 -->
-            <ProjectOverview
-                :calculation="calculation"
-                :countExceptionProjectData="countExceptionProjectData"
-            />
+          </el-form>
         </div>
-        <!-- 浠e姙浜嬮」 -->
-        <div class="flex">
-            <div class="flex_card">
-                <el-card>
-                    <NoticeTable style="height: 340px" />
-                </el-card>
-            </div>
-            <!-- 娑堟伅閫氱煡 -->
-            <div class="flex_card">
-                <el-card>
-                    <TidingsTable style="height: 340px" />
-                </el-card>
-            </div>
-            <!-- 鍦板浘 -->
-        </div>
-        <div style="margin-top: 10px">
-            <el-card>
-                <div>
-                    <div class="search-form">
-                        <el-form :model="searchForm" inline size="small">
-                            <el-form-item label=" ">
-                                <el-input
-                                    v-model="searchForm.name"
-                                    clearable
-                                    placeholder="璇疯緭鍏ラ」鐩悕绉版垨椤圭洰浠g爜"
-                                    style="width: 180px"
-                                />
-                            </el-form-item>
-                            <el-form-item style="margin-right: 0px">
-                                <el-button
-                                    clearable
-                                    @clear="searchList"
-                                    icon="Search"
-                                    type="primary"
-                                    @click="searchList"
-                                    >鎼滅储</el-button
-                                >
-                                <el-button icon="Refresh" @click="mapQuery"
-                                    >閲嶇疆</el-button
-                                >
-                            </el-form-item>
-                        </el-form>
-                    </div>
-                    <div class="map_div">
-                        <Map
-                            id="DangerSourceId"
-                            ref="mapRef"
-                            :is-show-control="true"
-                            :list-type="true"
-                            :map-list="tableDatas"
-                            :map-type="true"
-                            class="w-full h-full border-r border-[#DBDEEA]"
-                            @label-click="showDetails"
-                            @mark-click="showDetails"
-                            @current-label-style-change="labelStyleChange"
-                        />
-                    </div>
-                </div>
-            </el-card>
-        </div>
+      </div>
+      <!-- 缁熻鎯呭喌 -->
+      <ProjectOverview
+        :calculation="calculation"
+        :countExceptionProjectData="countExceptionProjectData"
+      />
     </div>
+    <!-- 浠e姙浜嬮」 -->
+    <div class="flex">
+      <div class="flex_card">
+        <el-card>
+          <NoticeTable style="height: 340px" />
+        </el-card>
+      </div>
+      <!-- 娑堟伅閫氱煡 -->
+      <div class="flex_card">
+        <el-card>
+          <TidingsTable style="height: 340px" />
+        </el-card>
+      </div>
+      <!-- 鍦板浘 -->
+    </div>
+    <div style="margin-top: 10px">
+      <el-card>
+        <div>
+          <div class="search-form">
+            <el-form :model="searchForm" inline size="small">
+              <el-form-item label="">
+                <el-input
+                  v-model="searchForm.name"
+                  clearable
+                  placeholder="璇疯緭鍏ラ」鐩悕绉版垨椤圭洰浠g爜"
+                  style="width: 240px"
+                />
+              </el-form-item>
+              <el-form-item style="margin-right: 0px">
+                <el-button
+                  clearable
+                  @clear="searchList"
+                  icon="Search"
+                  type="primary"
+                  @click="searchList"
+                  >鎼滅储</el-button
+                >
+                <el-button icon="Refresh" @click="mapQuery">閲嶇疆</el-button>
+              </el-form-item>
+            </el-form>
+          </div>
+          <div class="map_div">
+            <Map
+              id="DangerSourceId"
+              ref="mapRef"
+              :is-show-control="true"
+              :list-type="true"
+              :map-list="tableDatas"
+              :map-type="true"
+              class="w-full h-full border-r border-[#DBDEEA]"
+              @label-click="showDetails"
+              @mark-click="showDetails"
+              @current-label-style-change="labelStyleChange"
+            />
+          </div>
+        </div>
+      </el-card>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -148,235 +138,238 @@
 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';
+import { getCalculatioln, getAbnormalData } from "@/api/login";
+import { searchByKey } from "@/api/projectEngineering/projectInfo";
+
 export default {
-    name: "Index",
-    data() {
-        return {
-            queryParams: {},
-            timeMerge: [],
-            sys_administrative_divisions: [],
-            countExceptionProjectData: {},
-            searchForm: {},
-            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' }
-            ]
-        };
+  name: "Index",
+  data() {
+    return {
+      queryParams: {},
+      timeMerge: [],
+      sys_administrative_divisions: [],
+      countExceptionProjectData: {},
+      searchForm: {},
+      tableDatas: [],
+      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,
+    Map,
+  },
+  created() {
+    this.handleQuery();
+    this.searchList();
+  },
+  methods: {
+    dataPickerChange(val) {
+      if (!val) {
+        this.queryParams.startTime = "";
+        this.queryParams.endTime = "";
+        return;
+      }
+
+      this.queryParams.startTime = this.timeMerge[0];
+      this.queryParams.endTime = this.timeMerge[1];
     },
-    components: {
-        SvgIcon,
-        ProjectOverview,
-        NoticeTable,
-        TidingsTable,
-        Map,
+    handleQuery() {
+      const obj = {
+        startDate: this.queryParams.startTime,
+        endDate: this.queryParams.endTime,
+        areaCode: this.queryParams.area,
+        minInvestment: this.queryParams.start,
+        maxInvestment: this.queryParams.end,
+      };
+
+      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,
+        }));
+        // 鍒涘缓涓�涓璞★紝浠ヤ究鏍规嵁 text 灞炴�у揩閫熸煡鎵� newArr 涓殑瀵硅薄
+        const newArrLookup = newArr.reduce((lookup, item) => {
+          lookup[item.text] = item;
+          return lookup;
+        }, {});
+
+        // 鏇存柊 calculation 鏁扮粍锛屼繚鎸佸叾鍘熷椤哄簭
+        this.calculation = this.calculation.map((item) => {
+          const newItem = newArrLookup[item.text];
+          return newItem ? newItem : item; // 濡傛灉 newItem 瀛樺湪锛屽垯杩斿洖 newItem锛屽惁鍒欒繑鍥炲師濮� item
+        });
+      });
+
+      this.abnormalData(obj);
     },
-    created() {
-        this.handleQuery()
+
+    // 鑾峰彇寮傚父鏁版嵁
+    async abnormalData(obj) {
+      const res = await getAbnormalData(obj);
+      this.countExceptionProjectData = res.data;
     },
-    methods: {
-        dataPickerChange(val) {
-            if (!val) {
-                this.queryParams.startTime = "";
-                this.queryParams.endTime = "";
-                return;
-            }
 
-            this.queryParams.startTime = this.timeMerge[0];
-            this.queryParams.endTime = this.timeMerge[1];
-        },
-        handleQuery() {
-            const obj = {
-                startDate: this.queryParams.startTime,
-                endDate: this.queryParams.endTime,
-                areaCode: this.queryParams.area,
-                minInvestment: this.queryParams.start,
-                maxInvestment: this.queryParams.end,
-            };
-
-            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,
-                }));
-                // 鍒涘缓涓�涓璞★紝浠ヤ究鏍规嵁 text 灞炴�у揩閫熸煡鎵� newArr 涓殑瀵硅薄
-                const newArrLookup = newArr.reduce((lookup, item) => {
-                    lookup[item.text] = item;
-                    return lookup;
-                }, {});
-
-                // 鏇存柊 calculation 鏁扮粍锛屼繚鎸佸叾鍘熷椤哄簭
-                this.calculation = this.calculation.map((item) => {
-                    const newItem = newArrLookup[item.text];
-                    return newItem ? newItem : item; // 濡傛灉 newItem 瀛樺湪锛屽垯杩斿洖 newItem锛屽惁鍒欒繑鍥炲師濮� item
-                });
-
-            });
-
-            this.abnormalData(obj);
-        },
-
-        // 鑾峰彇寮傚父鏁版嵁
-        async abnormalData(obj) {
-            const res = await getAbnormalData(obj);
-            this.countExceptionProjectData = res.data;
-        },
-
-        //鍦板浘璇︽儏
-        showDetails(row) {
-            console.log(row);
-        },
-
-        labelStyleChange(currentLabel) {
-            if (lastLabel) {
-                lastLabel.setBackgroundColor("#fff");
-                lastLabel.setFontColor("var(--el-color-primary)");
-            }
-            currentLabel.setBackgroundColor("var(--el-color-primary)");
-            currentLabel.setFontColor("#fff");
-            lastLabel = currentLabel;
-        },
-        resetQuery() {
-            this.queryParams = {
-                area: "",
-                start: "",
-                end: "",
-                startTime: "",
-                endTime: "",
-            };
-            this.timeMerge = [];
-            this.handleQuery();
-        },
-
-        // 鍦板浘鎼滅储
-        async searchList() {
-            // await search()
-            this.mapRef.moveTo(105.37281, 30.87145);
-        },
-        mapQuery() { },
+    //鍦板浘璇︽儏
+    showDetails(row) {
+      console.log(row);
     },
+
+    labelStyleChange(currentLabel) {
+      if (lastLabel) {
+        lastLabel.setBackgroundColor("#fff");
+        lastLabel.setFontColor("var(--el-color-primary)");
+      }
+      currentLabel.setBackgroundColor("var(--el-color-primary)");
+      currentLabel.setFontColor("#fff");
+      lastLabel = currentLabel;
+    },
+    resetQuery() {
+      this.queryParams = {
+        area: "",
+        start: "",
+        end: "",
+        startTime: "",
+        endTime: "",
+      };
+      this.timeMerge = [];
+      this.handleQuery();
+    },
+
+    // 鍦板浘鎼滅储
+    searchList() {
+      var _this = this;
+      searchByKey({ wordKey: this.searchForm.name }).then((res) => {
+        if (res.code == 200) {
+          if (res.data.length > 0) {
+            // this.$refs["mapRef"].showProjectInfo(res.data);
+            // _this.tableDatas = res.data;
+            setTimeout(() => {
+              _this.$refs["mapRef"].makeAllMask(res.data);
+            }, 2000);
+          } else {
+            _this.$message.error("鏈煡璇㈠埌瀵瑰簲椤圭洰");
+          }
+        } else {
+          _this.$message.error(res.msg);
+        }
+      });
+    },
+    mapQuery() {},
+  },
 };
 </script>
 
 <style scoped lang="scss">
 .home {
-    padding: 10px;
-    background-color: #f3f7fc;
-    min-height: calc(100vh - 85px);
-    overflow-x: auto;
+  padding: 10px;
+  background-color: #f3f7fc;
+  min-height: calc(100vh - 85px);
+  overflow-x: auto;
 
-    .overview {
-        padding: 10px 0 0 10px;
-        height: 280px;
-        min-width: 1600px;
-        background-color: #fff;
-        border-radius: 6px;
+  .overview {
+    padding: 10px 0 0 10px;
+    height: 280px;
+    min-width: 1600px;
+    background-color: #fff;
+    border-radius: 6px;
 
-        .overview-top {
-            display: flex;
-            justify-content: space-between;
+    .overview-top {
+      display: flex;
+      justify-content: space-between;
 
-            .title {
-                font-size: 16px;
-            }
+      .title {
+        font-size: 16px;
+      }
 
-            .qurey {
-                font-size: 12px;
-                font-weight: 100;
-            }
-        }
+      .qurey {
+        font-size: 12px;
+        font-weight: 100;
+      }
     }
+  }
 
-    .search-form {
-        display: flex;
-        justify-content: flex-end;
-    }
+  .search-form {
+    padding: 5px;
+    position: absolute;
+    z-index: 999;
+    display: flex;
+    justify-content: flex-end;
+  }
 }
 // ::v-deep .el-form-item {
 //     display: inline-block !important;
 //     margin-right: 10px;
 // }
 ::v-deep .el-form-item--medium .el-form-item__content {
-    display: inline-block !important;
+  display: inline-block !important;
 }
 ::v-deep .el-form-item__label {
-    font-size: 12px;
-    font-weight: 400;
+  font-size: 12px;
+  font-weight: 400;
 }
 
 ::v-deep .el-button {
-    font-size: 12px;
+  font-size: 12px;
 }
 
 ::v-deep.el-input__inner {
-    font-size: 12px;
-    height: 32px;
+  font-size: 12px;
+  height: 32px;
 }
 
 ::v-deep.el-range-input {
-    font-size: 12px;
+  font-size: 12px;
 }
 
 ::v-deep.el-select__placeholder {
-    font-size: 12px;
+  font-size: 12px;
 }
-::v-deep input[type='number']::-webkit-inner-spin-button,
-input[type='number']::-webkit-outer-spin-button {
-    -webkit-appearance: none;
-    margin: 0;
+::v-deep input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+  -webkit-appearance: none;
+  margin: 0;
 }
-input[type='number'] {
-    -moz-appearance: textfield;
+input[type="number"] {
+  -moz-appearance: textfield;
 }
 .search_from {
-    display: flex;
-    justify-self: justify-end;
-    gap: 10px;
+  display: flex;
+  justify-self: justify-end;
+  gap: 10px;
 }
 .flex {
-    display: flex;
-    gap: 2%;
+  display: flex;
+  gap: 2%;
 }
 .flex_card {
-    width: 49%;
-    margin: 10px 0px;
+  width: 49%;
+  margin: 10px 0px;
 }
 .from_input {
-    display: flex;
-    gap: 10px;
-    font-size: 12px;
+  display: flex;
+  gap: 10px;
+  font-size: 12px;
 }
 .map_div {
-    display: flex;
-    width: 100%;
-    height: 500px;
-    border: #dbdeea;
+  display: flex;
+  width: 100%;
+  height: 500px;
+  border: #dbdeea;
 }
 </style>
 

--
Gitblit v1.8.0