Browse Source

优化企业运行数据企业名称搜索、优化行业水平分布、企业水平分布增加企业分类

littleblue55 1 month ago
parent
commit
07211c34a3

+ 9 - 0
src/api/industry_run/industry_run.js

@@ -8,6 +8,15 @@ export function listIndustry_run(query) {
     params: query
   })
 }
+// 查询industry_run列表模糊
+export function listIndustry_run_like(query) {
+  return request({
+    url: '/industry_run/industry_run/listMOHU',
+    method: 'get',
+    params: query
+  })
+}
+
 
 // 查询industry_run详细
 export function getIndustry_run(enterpriseName) {

+ 17 - 12
src/views/dashboard/sandianscore.vue

@@ -34,11 +34,7 @@
           </el-select></el-form-item
         >
         <el-form-item label="企业分类">
-          <el-select
-            v-model="typeNum"
-            style="width: 100%"
-            clearable
-          >
+          <el-select v-model="typeNum" style="width: 100%" clearable>
             <el-option
               v-for="item in enterTypeList"
               :key="item.number"
@@ -216,7 +212,7 @@ export default {
       detectMax: null,
       tableData: [],
       enterTypeList: [],
-      typeNum: null
+      typeNum: null,
     };
   },
   mounted() {
@@ -268,7 +264,7 @@ export default {
         .catch((error) => {
           console.error("Error fetching data:", error);
         });
-      this.getEtypeAll()
+      this.getEtypeAll();
     },
     getEtypeAll() {
       return listEtypeAll().then((res) => {
@@ -298,10 +294,20 @@ export default {
       }
       let filteredData = this.chartData;
       if (this.selectedYear) {
-        filteredData = filteredData.filter(
-          (item) =>
-            item.year === this.selectedYear && item.code === this.selectedCode
-        );
+        if (this.typeNum && this.typeNum != "") {
+          console.log(this.typeNum, 999);
+          filteredData = filteredData.filter(
+            (item) =>
+              item.year === this.selectedYear &&
+              item.code === this.selectedCode &&
+              item.typeNum === this.typeNum
+          );
+        } else {
+          filteredData = filteredData.filter(
+            (item) =>
+              item.year === this.selectedYear && item.code === this.selectedCode
+          );
+        }
       }
       const values = filteredData.map((item) => item[this.selectedDataKey]);
       const minVal = Math.min(...values).toFixed(2);
@@ -377,7 +383,6 @@ export default {
       //---------------------------修改后正态分布-----------------------------
       // 获取基础数据:最大值,最小值,平均值,标准差
       function getBebeQ(numbers, digit = 2) {
-
         let sum = numbers.reduce(
           (acc, num) => acc.add(new Decimal(num)),
           new Decimal(0)

+ 27 - 16
src/views/dashboard/zhifangbasedata.vue

@@ -24,7 +24,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="年度" style="margin-bottom: 0">
-          <el-select v-model="selectedYear" style="width: 100%" >
+          <el-select v-model="selectedYear" style="width: 100%">
             <el-option v-for="year in availableYears" :key="year" :value="year">
               {{ year }}
             </el-option>
@@ -39,11 +39,7 @@
           />
         </el-form-item>
         <el-form-item label="企业分类">
-          <el-select
-            v-model="typeNum"
-            style="width: 100%"
-            clearable
-          >
+          <el-select v-model="typeNum" style="width: 100%" clearable>
             <el-option
               v-for="item in enterTypeList"
               :key="item.number"
@@ -66,9 +62,13 @@
             {{ industryMap.get(selectedCode) }}
           </div>
         </el-form-item>
-        
+
         <el-form-item style="margin-bottom: 0">
-          <el-button type="primary" icon="el-icon-search" @click="updateChart" size="mini"
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            @click="updateChart"
+            size="mini"
             >搜索</el-button
           >
         </el-form-item>
@@ -126,7 +126,10 @@
 
 <script>
 import * as echarts from "echarts";
-import { listBase_data_year, listBase_data_year_all} from "@/api/base_data_year/base_data_year";
+import {
+  listBase_data_year,
+  listBase_data_year_all,
+} from "@/api/base_data_year/base_data_year";
 import { listAllIndustry } from "@/api/industry/industry"; // 导入行业数据的接口
 import { listEtypeAll } from "@/api/etype/etype";
 require("echarts/theme/macarons"); // echarts theme
@@ -225,7 +228,7 @@ export default {
       selectedRange: 300, // 不能为 0
       tableData: [],
       enterTypeList: [],
-      typeNum: null
+      typeNum: null,
     };
   },
   mounted() {
@@ -269,7 +272,7 @@ export default {
         .catch((error) => {
           console.error("Error fetching data:", error);
         });
-      this.getEtypeAll()
+      this.getEtypeAll();
     },
     getEtypeAll() {
       return listEtypeAll().then((res) => {
@@ -294,10 +297,18 @@ export default {
       }
       let filteredData = this.chartData;
       if (this.selectedYear) {
-        filteredData = filteredData.filter(
-          (item) =>
-            item.year === this.selectedYear && item.code === this.selectedCode
-        );
+        if (this.typeNum && this.typeNum != "") {
+          console.log(this.typeNum, 999);
+          filteredData = filteredData.filter(
+            (item) =>
+              item.year === this.selectedYear && item.code === this.selectedCode && item.typeNum === this.typeNum
+          );
+        } else {
+          filteredData = filteredData.filter(
+            (item) =>
+              item.year === this.selectedYear && item.code === this.selectedCode
+          );
+        }
       }
       const values = filteredData.map((item) => item[this.selectedDataKey]);
       const minVal = 0;
@@ -485,7 +496,7 @@ export default {
   watch: {
     // littlegreen - 关闭监测数值变化
     selectedDataKey() {
-      this.label = "评估指标值"+this.keyToUnit[this.selectedDataKey]
+      this.label = "评估指标值" + this.keyToUnit[this.selectedDataKey];
     },
     // selectedYear() {
     //   this.updateChart();

+ 26 - 6
src/views/industry_run/index.vue

@@ -2,12 +2,22 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="企业名称" prop="enterpriseName">
-        <el-input
+        <!-- <el-input
           v-model="queryParams.enterpriseName"
           placeholder="请输入企业名称"
           clearable
           @keyup.enter.native="handleQuery"
-        />
+        /> -->
+        <el-select v-model="queryParams.enterpriseName" style="width: 100%" filterable clearable>
+            <el-option
+              
+              v-for="item in allEnterpriseList"
+              :key="item.enterpriseName"
+              :value="item.enterpriseName"
+              :label="item.enterpriseName"
+            >
+            </el-option>
+          </el-select>
       </el-form-item>
       <el-form-item label="坐落地" prop="location">
         <el-input
@@ -210,8 +220,8 @@
 </template>
 
 <script>
-import { listIndustry_run, getIndustry_run, delIndustry_run, addIndustry_run, updateIndustry_run } from "@/api/industry_run/industry_run";
-
+import { listIndustry_run,listIndustry_run_like, getIndustry_run, delIndustry_run, addIndustry_run, updateIndustry_run } from "@/api/industry_run/industry_run";
+import { listAllEnterprise } from '@/api/enterprise/enterprise';
 export default {
   name: "Industry_run",
   data() {
@@ -264,22 +274,32 @@ export default {
         season: [
           { required: true, message: "季节不能为空", trigger: "blur" }
         ],
-      }
+      },
+      allEnterpriseList:[]
     };
   },
   created() {
     this.getList();
+    this.getEnterpriseListAll();
   },
   methods: {
     /** 查询industry_run列表 */
     getList() {
       this.loading = true;
-      listIndustry_run(this.queryParams).then(response => {
+      listIndustry_run_like(this.queryParams).then(response => {
         this.industry_runList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
+    getEnterpriseListAll(){
+      listAllEnterprise().then(response => {
+        if(response && response?.rows){
+          this.allEnterpriseList = response.rows;
+        }
+        // console.log(response);
+      })
+    },
     // 取消按钮
     cancel() {
       this.open = false;