|
@@ -1,10 +1,18 @@
|
|
|
<template>
|
|
|
-<!-- 行业水平分布 - littlegreen - 补充form和label -->
|
|
|
+ <!-- 行业水平分布 - littlegreen - 补充form和label -->
|
|
|
<div :class="className" :style="{ height: '100%', width: width }">
|
|
|
<div class="select-container">
|
|
|
- <el-form style="display: grid; grid-template-columns: 1fr 1fr 1fr;align-items: center;grid-gap: 20px;" label-width="100px">
|
|
|
- <el-form-item label="评估指标" style="margin-bottom:0">
|
|
|
- <el-select v-model="selectedDataKey" style="width: 100%" >
|
|
|
+ <el-form
|
|
|
+ style="
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: 1fr 1fr 1fr;
|
|
|
+ align-items: center;
|
|
|
+ grid-gap: 20px;
|
|
|
+ "
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item label="评估指标" style="margin-bottom: 0">
|
|
|
+ <el-select v-model="selectedDataKey" style="width: 100%">
|
|
|
<el-option
|
|
|
v-for="key in dataKeys"
|
|
|
:key="key"
|
|
@@ -15,14 +23,14 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="年度" style="margin-bottom:0">
|
|
|
- <el-select v-model="selectedYear" style="width: 100%" >
|
|
|
+ <el-form-item label="年度" style="margin-bottom: 0">
|
|
|
+ <el-select v-model="selectedYear" style="width: 100%">
|
|
|
<el-option v-for="year in availableYears" :key="year" :value="year">
|
|
|
{{ year }}
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="行业代码" style="margin-bottom:0">
|
|
|
+ <el-form-item label="行业代码" style="margin-bottom: 0">
|
|
|
<el-input
|
|
|
v-model="selectedCode"
|
|
|
placeholder="请输入行业代码"
|
|
@@ -30,7 +38,7 @@
|
|
|
style="width: 100%"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="数据分布区间" style="margin-bottom:0">
|
|
|
+ <el-form-item label="数据分布区间" style="margin-bottom: 0">
|
|
|
<el-input
|
|
|
v-model="selectedRange"
|
|
|
placeholder="请设置数据分布区间"
|
|
@@ -38,15 +46,15 @@
|
|
|
style="width: 100%"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <div>
|
|
|
- 当前行业: {{ industryMap.get(selectedCode) }}
|
|
|
- </div>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- @click="updateChart"
|
|
|
- >搜索</el-button>
|
|
|
+ <el-form-item label="当前行业:" style="margin-bottom: 0">
|
|
|
+ <div>
|
|
|
+ {{ 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
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -81,13 +89,14 @@
|
|
|
|
|
|
</div> -->
|
|
|
</div>
|
|
|
- <div
|
|
|
- ref="chart"
|
|
|
- :style="{ height: height, width: width }"
|
|
|
- ></div>
|
|
|
+ <div ref="chart" :style="{ height: height, width: width }"></div>
|
|
|
<!-- littlegreen - 新增数据展示table -->
|
|
|
- <el-table :data="tableData" border style="width: 100%" >
|
|
|
- <el-table-column prop="industryName" label="行业名称" width="200"></el-table-column>
|
|
|
+ <el-table :data="tableData" border style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="industryName"
|
|
|
+ label="行业名称"
|
|
|
+ width="200"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column prop="year" label="年度" width="200"> </el-table-column>
|
|
|
<el-table-column prop="enterpriseId" label="企业ID"></el-table-column>
|
|
|
<el-table-column
|
|
@@ -388,22 +397,22 @@ export default {
|
|
|
// console.log(param.name); //X轴的值 0-600 1.用-分割获得确定最小值和最大值 2.筛选filteredData中this.selectedDataKey的值符合要求的
|
|
|
const result = param.name.split("-").map(Number);
|
|
|
const filteredArray = filteredData.filter((item) => {
|
|
|
- const isMaxValEqual = result[1] === maxVal;
|
|
|
- const lowerBoundCheck = item[that.selectedDataKey] >= result[0];
|
|
|
- const upperBoundCheck = isMaxValEqual
|
|
|
- ? item[that.selectedDataKey] <= result[1]
|
|
|
- : item[that.selectedDataKey] < result[1];
|
|
|
+ const isMaxValEqual = result[1] === maxVal;
|
|
|
+ const lowerBoundCheck = item[that.selectedDataKey] >= result[0];
|
|
|
+ const upperBoundCheck = isMaxValEqual
|
|
|
+ ? item[that.selectedDataKey] <= result[1]
|
|
|
+ : item[that.selectedDataKey] < result[1];
|
|
|
|
|
|
- return lowerBoundCheck && upperBoundCheck;
|
|
|
- })
|
|
|
- that.tableData = filteredArray.map(item => {
|
|
|
+ return lowerBoundCheck && upperBoundCheck;
|
|
|
+ });
|
|
|
+ that.tableData = filteredArray.map((item) => {
|
|
|
return {
|
|
|
industryName: item.code,
|
|
|
enterpriseId: item.enterpriseName,
|
|
|
year: item.year,
|
|
|
- value: item[that.selectedDataKey]
|
|
|
- }
|
|
|
- })
|
|
|
+ value: item[that.selectedDataKey],
|
|
|
+ };
|
|
|
+ });
|
|
|
console.log(filteredData, result, that.selectedDataKey, filteredArray); //获取自定义的值
|
|
|
});
|
|
|
},
|