zh
2024-11-25 e176ec0f4e2e35342bef6c909786c31d7fd8316f
src/views/index.vue
@@ -36,7 +36,10 @@
                  />
                </el-select>
              </el-form-item>
              <el-form-item label="投资金额" style="margin-right: 50px">
                            <el-form-item
                                label="投资金额"
                                style="margin-right: 50px"
                            >
                <div class="from_input">
                  <el-input
                    v-model="queryParams.start"
@@ -56,10 +59,15 @@
                </div>
              </el-form-item>
              <el-form-item style="margin-right: 20px">
                <el-button icon="Search" type="primary" @click="handleQuery"
                                <el-button
                                    icon="Search"
                                    type="primary"
                                    @click="handleQuery"
                  >搜索</el-button
                >
                <el-button icon="Refresh" @click="resetQuery">重置</el-button>
                                <el-button icon="Refresh" @click="resetQuery"
                                    >重置</el-button
                                >
              </el-form-item>
            </div>
          </el-form>
@@ -86,7 +94,7 @@
      </div>
      <!-- 地图 -->
    </div>
    <div class="mt-[10px] min-w-[1600px]">
        <div style="margin-top: 10px">
      <el-card>
        <div>
          <div class="search-form">
@@ -100,14 +108,19 @@
                />
              </el-form-item>
              <el-form-item style="margin-right: 0px">
                <el-button icon="Search" type="primary" @click="searchList"
                                <el-button
                                    icon="Search"
                                    type="primary"
                                    @click="searchList"
                  >搜索</el-button
                >
                <el-button icon="Refresh" @click="mapQuery">重置</el-button>
                                <el-button icon="Refresh" @click="mapQuery"
                                    >重置</el-button
                                >
              </el-form-item>
            </el-form>
          </div>
          <div class="flex w-full h-[500px] border border-[#DBDEEA]">
                    <div class="map_div">
            <Map
              id="DangerSourceId"
              ref="mapRef"
@@ -133,6 +146,7 @@
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() {
@@ -140,7 +154,6 @@
      queryParams: {},
      timeMerge: [],
      sys_administrative_divisions: [],
      calculation: [],
      countExceptionProjectData: {},
      searchForm: {},
      tableDatas: [
@@ -159,6 +172,16 @@
          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: {
@@ -168,6 +191,9 @@
    TidingsTable,
    Map,
  },
    created() {
        this.handleQuery()
    },
  methods: {
    dataPickerChange(val) {
      if (!val) {
@@ -176,20 +202,21 @@
        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,
@@ -197,7 +224,6 @@
          statistics: item.type,
          statisticsMun: item.amount,
        }));
        // 创建一个对象,以便根据 text 属性快速查找 newArr 中的对象
        const newArrLookup = newArr.reduce((lookup, item) => {
          lookup[item.text] = item;
@@ -205,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);
    },
    // 获取异常数据
@@ -318,12 +345,12 @@
::v-deep.el-select__placeholder {
  font-size: 12px;
}
::v-deep input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
::v-deep input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
input[type='number'] {
  -moz-appearance: textfield;
}
.search_from {
@@ -344,5 +371,11 @@
  gap: 10px;
  font-size: 12px;
}
.map_div {
    display: flex;
    width: 100%;
    height: 500px;
    border: #dbdeea;
}
</style>