|
@@ -1,72 +1,73 @@
|
|
|
<template>
|
|
|
<div class="fertilizer-input-form">
|
|
|
- <el-card shadow="always" class="form-card">
|
|
|
+ <!-- 输入表单部分 -->
|
|
|
+ <el-card v-if="showInputForm" shadow="always" class="form-card">
|
|
|
<div class="card-content">
|
|
|
<div class="input-section">
|
|
|
<el-form label-width="250px" label-position="top">
|
|
|
<div class="form-section">
|
|
|
- <div class="input-group">
|
|
|
+ <div class="input-group">
|
|
|
<el-form-item label="氮肥镉含量平均值 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="nitrogenCdContent" placeholder="0.05"></el-input>
|
|
|
+ <el-input v-model="formData.f3_nitrogen_cd_content" placeholder="0.05"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="氮肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="nitrogenUsage" placeholder="0.05"></el-input>
|
|
|
+ <el-input v-model="formData.nf_nitrogen_usage" placeholder="0.05"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="磷肥镉含量平均值 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="phosphorusCdContent" placeholder="0.158"></el-input>
|
|
|
+ <el-input v-model="formData.f4_phosphorus_cd_content" placeholder="0.158"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="磷肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="phosphorusUsage" placeholder="0.158"></el-input>
|
|
|
+ <el-input v-model="formData.pf_phosphorus_usage" placeholder="0.158"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="钾肥镉含量平均值 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="potassiumCdContent" placeholder="0.06"></el-input>
|
|
|
+ <el-input v-model="formData.f5_potassium_cd_content" placeholder="0.06"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="钾肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="potassiumUsage" placeholder="0.06"></el-input>
|
|
|
+ <el-input v-model="formData.kf_potassium_usage" placeholder="0.06"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="复合肥镉含量平均值 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="compoundFertilizerCdContent" placeholder="0.065"></el-input>
|
|
|
+ <el-input v-model="formData.f6_compound_cd_content" placeholder="0.065"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="复合肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="compoundFertilizerUsage" placeholder="0.065"></el-input>
|
|
|
+ <el-input v-model="formData.cf_compound_usage" placeholder="0.065"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="有机肥镉含量平均值 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="organicFertilizerCdContent" placeholder="0.6"></el-input>
|
|
|
+ <el-input v-model="formData.f7_organic_cd_content" placeholder="0.6"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="有机肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="organicFertilizerUsage" placeholder="0.6"></el-input>
|
|
|
+ <el-input v-model="formData.of_organic_usage" placeholder="0.6"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="农药镉含量 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="pesticideCdContent" placeholder="0.25"></el-input>
|
|
|
+ <el-input v-model="formData.f8_pesticide_cd_content" placeholder="0.25"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="农药单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="pesticideUsage" placeholder="0.25"></el-input>
|
|
|
+ <el-input v-model="formData.p_pesticide_usage" placeholder="0.25"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="农家肥镉含量 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="farmYardManureCdContent" placeholder="0.35"></el-input>
|
|
|
+ <el-input v-model="formData.f9_farmyard_cd_content" placeholder="0.35"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="农家肥单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="farmYardManureUsage" placeholder="0.35"></el-input>
|
|
|
+ <el-input v-model="formData.ff_farmyard_usage" placeholder="0.35"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="input-group">
|
|
|
<el-form-item label="农膜镉含量 (mg/kg)" class="form-item">
|
|
|
- <el-input v-model="agriFilmCdContent" placeholder="0.25"></el-input>
|
|
|
+ <el-input v-model="formData.f10_film_cd_content" placeholder="0.25"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="农膜(存留)单位面积使用量 (t/ha/a)" class="form-item">
|
|
|
- <el-input v-model="agriFilmResidueUsage" placeholder="0.6"></el-input>
|
|
|
+ <el-input v-model="formData.af_film_usage" placeholder="0.6"></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,50 +75,348 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="button-section">
|
|
|
- <!-- 按钮区域背景图 -->
|
|
|
<div class="button-bg"></div>
|
|
|
- <!-- 底部半透明层 -->
|
|
|
<div class="bottom-overlay"></div>
|
|
|
- <el-button class="calculate-btn">
|
|
|
+ <el-button
|
|
|
+ class="calculate-btn"
|
|
|
+ @click="calculateAll"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
<span class="btn-text">农产品输入通量计算</span>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
+
|
|
|
+ <!-- 结果页面部分 -->
|
|
|
+ <div v-if="!showInputForm" class="results-page">
|
|
|
+ <!-- 返回按钮 -->
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="back-button"
|
|
|
+ @click="showInputForm = true"
|
|
|
+ >
|
|
|
+ 返回计算
|
|
|
+ </el-button>
|
|
|
+ <!-- 结果页面标题 -->
|
|
|
+ <h2 class="results-title">农业输入通量计算结果</h2>
|
|
|
+
|
|
|
+ <!-- 自定义数据计算结果卡片 -->
|
|
|
+ <el-card class="result-card" v-if="customResult.success">
|
|
|
+ <h3>当前地区农业投入Cd通量计算结果</h3>
|
|
|
+ <p>总通量: {{ customResult.data.total_cd_flux }} g/ha/a</p>
|
|
|
+ <el-table :data="customResultDetails" border>
|
|
|
+ <el-table-column prop="type" label="投入类型"></el-table-column>
|
|
|
+ <el-table-column prop="flux" label="Cd通量(g/ha/a)"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="chart-container">
|
|
|
+ <div ref="customPieChart" style="width: 100%; height: 400px;"></div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <!-- 所有地区统计结果卡片 -->
|
|
|
+ <el-card class="result-card" v-if="allAreasResult.success">
|
|
|
+ <h3>所有地区农业投入Cd通量统计结果</h3>
|
|
|
+ <p>平均通量: {{ allAreasResult.data.summary.average_cd_flux }} g/ha/a</p>
|
|
|
+ <p>最高通量: {{ allAreasResult.data.summary.max_cd_flux.total_cd_flux }} g/ha/a ({{ allAreasResult.data.summary.max_cd_flux.area }})</p>
|
|
|
+ <p>最低通量: {{ allAreasResult.data.summary.min_cd_flux.total_cd_flux }} g/ha/a ({{ allAreasResult.data.summary.min_cd_flux.area }})</p>
|
|
|
+
|
|
|
+ <el-table :data="allAreasList" border>
|
|
|
+ <el-table-column prop="area" label="地区"></el-table-column>
|
|
|
+ <el-table-column prop="total_cd_flux" label="Cd通量(g/ha/a)"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="chart-container">
|
|
|
+ <div ref="allAreasPieChart" style="width: 100%; height: 400px;"></div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import axios from 'axios';
|
|
|
+import * as echarts from 'echarts';
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- nitrogenCdContent: '0.05',
|
|
|
- nitrogenUsage: '0.05',
|
|
|
- phosphorusCdContent: '0.158',
|
|
|
- phosphorusUsage: '0.158',
|
|
|
- potassiumCdContent: '0.06',
|
|
|
- potassiumUsage: '0.06',
|
|
|
- compoundFertilizerCdContent: '0.065',
|
|
|
- compoundFertilizerUsage: '0.065',
|
|
|
- organicFertilizerCdContent: '0.6',
|
|
|
- organicFertilizerUsage: '0.6',
|
|
|
- pesticideCdContent: '0.25',
|
|
|
- pesticideUsage: '0.25',
|
|
|
- farmYardManureCdContent: '0.35',
|
|
|
- farmYardManureUsage: '0.35',
|
|
|
- agriFilmCdContent: '0.25',
|
|
|
- agriFilmResidueUsage: '0.6'
|
|
|
+ // 控制显示输入表单或结果页面
|
|
|
+ showInputForm: true,
|
|
|
+
|
|
|
+ // 表单数据 - 使用API定义的字段名
|
|
|
+ formData: {
|
|
|
+ f3_nitrogen_cd_content: "0.12",
|
|
|
+ f4_phosphorus_cd_content: "0.85",
|
|
|
+ f5_potassium_cd_content: "0.05",
|
|
|
+ f6_compound_cd_content: "0.45",
|
|
|
+ f7_organic_cd_content: "0.22",
|
|
|
+ f8_pesticide_cd_content: "0.08",
|
|
|
+ f9_farmyard_cd_content: "0.15",
|
|
|
+ f10_film_cd_content: "0.03",
|
|
|
+ nf_nitrogen_usage: "0.25",
|
|
|
+ pf_phosphorus_usage: "0.15",
|
|
|
+ kf_potassium_usage: "0.12",
|
|
|
+ cf_compound_usage: "0.30",
|
|
|
+ of_organic_usage: "2.50",
|
|
|
+ p_pesticide_usage: "0.02",
|
|
|
+ ff_farmyard_usage: "1.80",
|
|
|
+ af_film_usage: "0.05",
|
|
|
+ description: "自定义数据计算结果"
|
|
|
+ },
|
|
|
+
|
|
|
+ // 结果数据
|
|
|
+ loading: false,
|
|
|
+ customResult: {},
|
|
|
+ allAreasResult: {},
|
|
|
+
|
|
|
+ // ECharts实例
|
|
|
+ customPieChart: null,
|
|
|
+ allAreasPieChart: null
|
|
|
};
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 将自定义数据结果详情转换为表格数据
|
|
|
+ customResultDetails() {
|
|
|
+ if (!this.customResult.data || !this.customResult.data.details) return [];
|
|
|
+ return Object.entries(this.customResult.data.details).map(([type, flux]) => ({
|
|
|
+ type: this.getTypeName(type),
|
|
|
+ flux: flux
|
|
|
+ }));
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取所有地区列表
|
|
|
+ allAreasList() {
|
|
|
+ if (!this.allAreasResult.data || !this.allAreasResult.data.results) return [];
|
|
|
+ return this.allAreasResult.data.results.map(area => ({
|
|
|
+ area: area.area,
|
|
|
+ total_cd_flux: area.total_cd_flux
|
|
|
+ }));
|
|
|
+ },
|
|
|
+ // 获取当前地区饼图数据
|
|
|
+ customPieData() {
|
|
|
+ if (!this.customResult.data || !this.customResult.data.details) return [];
|
|
|
+ return Object.entries(this.customResult.data.details).map(([type, value]) => ({
|
|
|
+ name: this.getTypeName(type),
|
|
|
+ value: value
|
|
|
+ }));
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取所有地区饼图数据(取前8个地区)
|
|
|
+ allAreasPieData() {
|
|
|
+ if (!this.allAreasList || this.allAreasList.length === 0) return [];
|
|
|
+
|
|
|
+ // 复制并排序
|
|
|
+ const sortedAreas = [...this.allAreasList].sort((a, b) => b.total_cd_flux - a.total_cd_flux);
|
|
|
+
|
|
|
+ // 取前8个地区
|
|
|
+ return sortedAreas.slice(0, 8).map(area => ({
|
|
|
+ name: area.area,
|
|
|
+ value: area.total_cd_flux
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 计算所有数据
|
|
|
+ async calculateAll() {
|
|
|
+ try {
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ // 准备自定义数据请求体
|
|
|
+ const requestBody = {
|
|
|
+ ...this.formData,
|
|
|
+ // 将字符串值转换为数字
|
|
|
+ f3_nitrogen_cd_content: parseFloat(this.formData.f3_nitrogen_cd_content),
|
|
|
+ f4_phosphorus_cd_content: parseFloat(this.formData.f4_phosphorus_cd_content),
|
|
|
+ f5_potassium_cd_content: parseFloat(this.formData.f5_potassium_cd_content),
|
|
|
+ f6_compound_cd_content: parseFloat(this.formData.f6_compound_cd_content),
|
|
|
+ f7_organic_cd_content: parseFloat(this.formData.f7_organic_cd_content),
|
|
|
+ f8_pesticide_cd_content: parseFloat(this.formData.f8_pesticide_cd_content),
|
|
|
+ f9_farmyard_cd_content: parseFloat(this.formData.f9_farmyard_cd_content),
|
|
|
+ f10_film_cd_content: parseFloat(this.formData.f10_film_cd_content),
|
|
|
+ nf_nitrogen_usage: parseFloat(this.formData.nf_nitrogen_usage),
|
|
|
+ pf_phosphorus_usage: parseFloat(this.formData.pf_phosphorus_usage),
|
|
|
+ kf_potassium_usage: parseFloat(this.formData.kf_potassium_usage),
|
|
|
+ cf_compound_usage: parseFloat(this.formData.cf_compound_usage),
|
|
|
+ of_organic_usage: parseFloat(this.formData.of_organic_usage),
|
|
|
+ p_pesticide_usage: parseFloat(this.formData.p_pesticide_usage),
|
|
|
+ ff_farmyard_usage: parseFloat(this.formData.ff_farmyard_usage),
|
|
|
+ af_film_usage: parseFloat(this.formData.af_film_usage)
|
|
|
+ };
|
|
|
+
|
|
|
+ // 同时调用两个API
|
|
|
+ const [customResponse, allAreasResponse] = await Promise.all([
|
|
|
+ axios.post(
|
|
|
+ 'http://localhost:8000/api/agricultural-input/calculate-with-custom-data',
|
|
|
+ requestBody
|
|
|
+ ),
|
|
|
+ axios.get(
|
|
|
+ 'http://localhost:8000/api/agricultural-input/calculate-all-areas'
|
|
|
+ )
|
|
|
+ ]);
|
|
|
+
|
|
|
+ // 处理自定义数据结果
|
|
|
+ this.customResult = customResponse.data;
|
|
|
+ if (!this.customResult.success) {
|
|
|
+ this.$message.error(this.customResult.message || '自定义数据计算失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理所有地区结果
|
|
|
+ this.allAreasResult = allAreasResponse.data;
|
|
|
+ if (!this.allAreasResult.success) {
|
|
|
+ this.$message.error(this.allAreasResult.message || '计算所有地区失败');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 切换到结果页面
|
|
|
+ this.showInputForm = false;
|
|
|
+
|
|
|
+ // 等待DOM更新
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initCharts();
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ console.error('API调用错误:', error);
|
|
|
+ this.$message.error('计算失败,请检查网络连接');
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取类型的中文名称
|
|
|
+ getTypeName(type) {
|
|
|
+ const typeNames = {
|
|
|
+ 'nitrogen_fertilizer': '氮肥',
|
|
|
+ 'phosphorus_fertilizer': '磷肥',
|
|
|
+ 'potassium_fertilizer': '钾肥',
|
|
|
+ 'compound_fertilizer': '复合肥',
|
|
|
+ 'organic_fertilizer': '有机肥',
|
|
|
+ 'pesticide': '农药',
|
|
|
+ 'farmyard_manure': '农家肥',
|
|
|
+ 'agricultural_film': '农膜'
|
|
|
+ };
|
|
|
+ return typeNames[type] || type;
|
|
|
+ },
|
|
|
+ // 初始化图表
|
|
|
+ initCharts() {
|
|
|
+ // 销毁已有实例
|
|
|
+ if (this.customPieChart) {
|
|
|
+ this.customPieChart.dispose();
|
|
|
+ }
|
|
|
+ if (this.allAreasPieChart) {
|
|
|
+ this.allAreasPieChart.dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 创建新的图表实例
|
|
|
+ this.customPieChart = echarts.init(this.$refs.customPieChart);
|
|
|
+ this.allAreasPieChart = echarts.init(this.$refs.allAreasPieChart);
|
|
|
+
|
|
|
+ // 设置图表选项
|
|
|
+ this.customPieChart.setOption(this.getPieChartOption('当前地区各项投入通量占比', this.customPieData));
|
|
|
+ this.allAreasPieChart.setOption(this.getPieChartOption('各地区通量占比', this.allAreasPieData));
|
|
|
+
|
|
|
+ // 响应窗口大小变化
|
|
|
+ window.addEventListener('resize', this.onResize);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取饼图配置
|
|
|
+ getPieChartOption(title, data) {
|
|
|
+ return {
|
|
|
+ title: {
|
|
|
+ text: title,
|
|
|
+ left: 'center',
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 16,
|
|
|
+ fontWeight: 'bold'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: '{a} <br/>{b}: {c} g/ha/a ({d}%)'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ orient: 'vertical',
|
|
|
+ right: 10,
|
|
|
+ top: 'center',
|
|
|
+ data: data.map(item => item.name)
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: title,
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['40%', '70%'],
|
|
|
+ center: ['40%', '50%'],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ itemStyle: {
|
|
|
+ borderRadius: 10,
|
|
|
+ borderColor: '#fff',
|
|
|
+ borderWidth: 2
|
|
|
+ },
|
|
|
+ label: {
|
|
|
+ show: false,
|
|
|
+ position: 'center'
|
|
|
+ },
|
|
|
+ emphasis: {
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ fontSize: '16',
|
|
|
+ fontWeight: 'bold',
|
|
|
+ formatter: '{b}\n{c} g/ha/a\n{d}%'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ data: data
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ // 响应窗口大小变化
|
|
|
+ onResize() {
|
|
|
+ if (this.customPieChart) {
|
|
|
+ this.customPieChart.resize();
|
|
|
+ }
|
|
|
+ if (this.allAreasPieChart) {
|
|
|
+ this.allAreasPieChart.resize();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 当结果数据变化时更新图表
|
|
|
+ customPieData() {
|
|
|
+ if (this.customPieChart) {
|
|
|
+ this.customPieChart.setOption(this.getPieChartOption('当前地区各项投入通量占比', this.customPieData));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ allAreasPieData() {
|
|
|
+ if (this.allAreasPieChart) {
|
|
|
+ this.allAreasPieChart.setOption(this.getPieChartOption('各地区通量占比', this.allAreasPieData));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeUnmount() {
|
|
|
+ // 组件销毁前移除事件监听
|
|
|
+ window.removeEventListener('resize', this.onResize);
|
|
|
+
|
|
|
+ // 销毁图表实例
|
|
|
+ if (this.customPieChart) {
|
|
|
+ this.customPieChart.dispose();
|
|
|
+ }
|
|
|
+ if (this.allAreasPieChart) {
|
|
|
+ this.allAreasPieChart.dispose();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+/* 原有样式保持不变 */
|
|
|
.fertilizer-input-form {
|
|
|
padding: 20px;
|
|
|
display: flex;
|
|
|
- justify-content: center;
|
|
|
- background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ background-color: rgba(255, 255, 255, 0.8);
|
|
|
}
|
|
|
|
|
|
.form-card {
|
|
@@ -152,20 +451,17 @@ export default {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
-/* 按钮区域背景图 - 使用本地图片 */
|
|
|
.button-bg {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
- /* 请替换为您的本地图片路径 */
|
|
|
background: url('@/assets/images/fertilizer-bg.jpg') no-repeat center center;
|
|
|
background-size: cover;
|
|
|
z-index: 0;
|
|
|
}
|
|
|
|
|
|
-/* 底部半透明层 */
|
|
|
.bottom-overlay {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
@@ -210,28 +506,23 @@ export default {
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
-/* 使用 :deep() 替代已弃用的 >>> */
|
|
|
:deep(.el-input) .el-input__inner {
|
|
|
width: 100% !important;
|
|
|
padding: 12px 0;
|
|
|
border: none;
|
|
|
border-radius: 0;
|
|
|
background: transparent;
|
|
|
- /* 底部边框效果 */
|
|
|
border-bottom: 1px solid #dcdfe6;
|
|
|
- /* 底部阴影效果 */
|
|
|
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
|
|
|
transition: all 0.3s ease;
|
|
|
}
|
|
|
|
|
|
:deep(.el-input) .el-input__inner:focus {
|
|
|
border-bottom: 2px solid #409EFF;
|
|
|
- /* 聚焦时底部阴影加强 */
|
|
|
box-shadow: 0 2px 0 rgba(64, 158, 255, 0.2);
|
|
|
background: rgba(64, 158, 255, 0.03);
|
|
|
}
|
|
|
|
|
|
-/* 占位符样式 */
|
|
|
:deep(.el-input) .el-input__inner::placeholder {
|
|
|
color: #a0a0a0;
|
|
|
font-style: italic;
|
|
@@ -247,11 +538,8 @@ export default {
|
|
|
font-weight: bold;
|
|
|
transition: all 0.4s ease;
|
|
|
position: relative;
|
|
|
- z-index: 2; /* 确保按钮在覆盖层之上 */
|
|
|
-
|
|
|
- /* 渐变背景色 */
|
|
|
+ z-index: 2;
|
|
|
background: linear-gradient(to right, #8DF9F0, #26B046);
|
|
|
- /* 按钮整体阴影 */
|
|
|
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
|
|
|
0 4px 10px rgba(38, 176, 70, 0.3) inset;
|
|
|
}
|
|
@@ -280,4 +568,83 @@ export default {
|
|
|
text-align: center;
|
|
|
line-height: 1.4;
|
|
|
}
|
|
|
+
|
|
|
+/* 结果页面样式 */
|
|
|
+.results-page {
|
|
|
+ width: 90%;
|
|
|
+ max-width: 1200px;
|
|
|
+ padding: 30px;
|
|
|
+ background: linear-gradient(135deg, #FAFDFF, #FFFAA2);
|
|
|
+ border-radius: 12px;
|
|
|
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.results-title {
|
|
|
+ text-align: center;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ font-size: 28px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 结果卡片样式 */
|
|
|
+.result-card {
|
|
|
+ width: 90%;
|
|
|
+ max-width: 1200px;
|
|
|
+ margin: 0 auto;
|
|
|
+ background: linear-gradient(135deg, #FAFDFF, #FFFAA2);
|
|
|
+ border: 1px solid #e6e6e6;
|
|
|
+ border-radius: 12px;
|
|
|
+ overflow: hidden;
|
|
|
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.result-card h3 {
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+
|
|
|
+.result-card p {
|
|
|
+ margin: 10px 0;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 表格样式 */
|
|
|
+.result-table {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.result-table .el-table {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 15px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+/* 图表容器 */
|
|
|
+.chart-container {
|
|
|
+ margin-top: 20px;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 10px;
|
|
|
+ background: #f9f9f9;
|
|
|
+}
|
|
|
+
|
|
|
+/* 返回按钮样式 */
|
|
|
+.back-button {
|
|
|
+ position: absolute;
|
|
|
+ top: 20px;
|
|
|
+ left: 20px;
|
|
|
+ width: 120px;
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 10px;
|
|
|
+ background: linear-gradient(to right, #8DF9F0, #26B046);
|
|
|
+ color: white;
|
|
|
+ border: none;
|
|
|
+ border-radius: 20px;
|
|
|
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.back-button:hover {
|
|
|
+ background: linear-gradient(to right, #7de8df, #20a03d);
|
|
|
+}
|
|
|
</style>
|