|
|
@@ -1,88 +1,61 @@
|
|
|
<template>
|
|
|
<custom-header name="农场信息" bgColor="#f2f3f5"></custom-header>
|
|
|
<div class="farm-details-page">
|
|
|
- <div class="farm-info">
|
|
|
- <div class="map-wrap">
|
|
|
- <div class="map-area" ref="mapContainer"></div>
|
|
|
- <div class="map-text" @click="handleEditMap">点击编辑地块</div>
|
|
|
+ <div class="map-wrap info-card">
|
|
|
+ <div class="map-area" ref="mapContainer"></div>
|
|
|
+ <div class="map-text" @click="handleEditMap">点击编辑地块</div>
|
|
|
+ </div>
|
|
|
+ <div class="info-box info-card">
|
|
|
+ <div class="section-header">
|
|
|
+ <div class="line-title">基本信息</div>
|
|
|
+ <div class="edit-btn-box">
|
|
|
+ <div class="edit-btn" @click="handleAddVariety">新增品种</div>
|
|
|
+ <div class="edit-btn" @click="handleEditFarmInfo">编辑信息</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="info-box">
|
|
|
- <div class="section-header">
|
|
|
- <div class="line-title">基本信息</div>
|
|
|
- <div class="edit-btn" @click="handleEditFarmInfo">点击编辑</div>
|
|
|
+ <div class="info-list">
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">农场名称:</span>
|
|
|
+ <span class="info-value">{{ farmInfo.subjectName }}</span>
|
|
|
</div>
|
|
|
- <div class="info-list">
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">农场名称:</span>
|
|
|
- <span class="info-value">{{ farmInfo.subjectName }}</span>
|
|
|
- </div>
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">联系人:</span>
|
|
|
- <span class="info-value">{{ farmInfo.contactName }}</span>
|
|
|
- </div>
|
|
|
- <div class="info-row center-row">
|
|
|
- <span class="info-label">联系电话:</span>
|
|
|
- <span class="info-value">{{ farmInfo.contactPhone }}</span>
|
|
|
- </div>
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">种植品种:</span>
|
|
|
- <div class="info-value crop-tags">
|
|
|
- <span v-for="crop in farmInfo.regionList" :key="crop.regionId" class="crop-tag">
|
|
|
- {{ crop.regionName }}
|
|
|
- </span>
|
|
|
- <div class="add-variety-btn" @click="handleAddVariety">
|
|
|
- <el-icon size="12">
|
|
|
- <Plus />
|
|
|
- </el-icon>
|
|
|
- <span>新增品种</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">农场位置:</span>
|
|
|
- <span class="info-value">{{ farmInfo.farmAddress }}</span>
|
|
|
- </div>
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">联系人:</span>
|
|
|
+ <span class="info-value">{{ farmInfo.contactName }}</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <el-divider class="info-divider" />
|
|
|
- <div class="info-box">
|
|
|
- <div class="section-header">
|
|
|
- <div class="line-title">农场设施</div>
|
|
|
- <div class="edit-btn" @click="handleEditFarmFacility">点击编辑</div>
|
|
|
+ <div class="info-row center-row">
|
|
|
+ <span class="info-label">联系电话:</span>
|
|
|
+ <span class="info-value">{{ farmInfo.contactPhone }}</span>
|
|
|
</div>
|
|
|
- <div class="info-list">
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">土壤类型:</span>
|
|
|
- <span class="info-value">{{ basicFarmInfo.soil }}</span>
|
|
|
- </div>
|
|
|
- <div class="info-row">
|
|
|
- <span class="info-label">灌溉方式:</span>
|
|
|
- <div class="info-value crop-tags">
|
|
|
- <span v-for="method in basicFarmInfo.irrigation" :key="method.code" class="crop-tag">
|
|
|
- {{ method.name }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="info-row info-row-column">
|
|
|
- <span class="info-label">农机设备:</span>
|
|
|
- <div class="info-value device-value">
|
|
|
- <div class="device-box">
|
|
|
- <div class="device-item" v-for="device in basicFarmInfo.machineryList"
|
|
|
- :key="device.code">
|
|
|
- <span class="device-name">{{ device.name }}</span>
|
|
|
- <span class="device-count">{{ device.quantity || 0 }}{{ device.unit }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">种植面积:</span>
|
|
|
+ <span class="info-value">{{ farmInfo.farmArea }}亩</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">农场位置:</span>
|
|
|
+ <span class="info-value">{{ farmInfo.farmAddress }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">种植品种:</span>
|
|
|
+ <div class="info-value crop-tags">
|
|
|
+ <span v-for="crop in farmInfo.regionList" :key="crop.regionId" class="crop-tag">
|
|
|
+ {{ crop.regionName }}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
- <div class="info-row info-row-column">
|
|
|
- <span class="info-label">希望改善问题:</span>
|
|
|
- <div class="info-value problem-tags">
|
|
|
- <span v-for="item in basicFarmInfo.improvementProblems" :key="item.code"
|
|
|
- class="problem-tag">
|
|
|
- {{ item.name }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="info-box info-card">
|
|
|
+ <div class="section-header">
|
|
|
+ <div class="line-title">农场设施</div>
|
|
|
+ <div class="edit-btn" @click="handleEditFarmFacility">编辑信息</div>
|
|
|
+ </div>
|
|
|
+ <div class="info-list">
|
|
|
+ <div class="info-row">
|
|
|
+ <span class="info-label">灌溉方式:</span>
|
|
|
+ <div class="info-value crop-tags">
|
|
|
+ <span v-for="method in basicFarmInfo.irrigation" :key="method.code" class="crop-tag">
|
|
|
+ {{ method.name }}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -175,10 +148,7 @@ function fetchBasicFarmFormData() {
|
|
|
if (code === 0) {
|
|
|
basicFarmInfo.value = {
|
|
|
...data,
|
|
|
- soil: data.soilTypes.find(item => item.selected).name,
|
|
|
irrigation: data.irrigationMethods.filter(item => item.selected),
|
|
|
- machineryList: data.machinery.filter(item => item.selected),
|
|
|
- improvementProblems: data.improvementAreas.filter(item => item.selected),
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -245,7 +215,7 @@ const handleAddVariety = () => {
|
|
|
<style lang="scss" scoped>
|
|
|
.farm-details-page {
|
|
|
background: #f2f3f5;
|
|
|
- height: calc(100vh - 60px);
|
|
|
+ height: calc(100vh - 40px);
|
|
|
padding: 10px 12px;
|
|
|
overflow: auto;
|
|
|
|
|
|
@@ -267,144 +237,143 @@ const handleAddVariety = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .farm-info {
|
|
|
+ .info-card{
|
|
|
+ margin-top: 12px;
|
|
|
background: #fff;
|
|
|
- border-radius: 8px;
|
|
|
+ border-radius: 6px;
|
|
|
padding: 10px;
|
|
|
+ }
|
|
|
|
|
|
- .map-wrap {
|
|
|
- position: relative;
|
|
|
+ .map-wrap {
|
|
|
+ position: relative;
|
|
|
|
|
|
- .map-area {
|
|
|
- width: 100%;
|
|
|
- height: 142px;
|
|
|
- clip-path: inset(0px round 5px);
|
|
|
- }
|
|
|
+ .map-area {
|
|
|
+ width: 100%;
|
|
|
+ height: 142px;
|
|
|
+ clip-path: inset(0px round 5px);
|
|
|
+ }
|
|
|
|
|
|
- .map-text {
|
|
|
- position: absolute;
|
|
|
- right: 13px;
|
|
|
- bottom: 8px;
|
|
|
- font-size: 12px;
|
|
|
- color: #ffffff;
|
|
|
- background: rgba(0, 0, 0, 0.5);
|
|
|
- padding: 8px 12px;
|
|
|
- border-radius: 25px;
|
|
|
- border: 1px solid rgba(255, 255, 255, 0.5);
|
|
|
- }
|
|
|
+ .map-text {
|
|
|
+ position: absolute;
|
|
|
+ right: 13px;
|
|
|
+ bottom: 16px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #ffffff;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ padding: 8px 12px;
|
|
|
+ border-radius: 25px;
|
|
|
+ border: 1px solid rgba(255, 255, 255, 0.5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .info-box {
|
|
|
+ margin-top: 12px;
|
|
|
+
|
|
|
+ .section-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .edit-btn-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .edit-btn {
|
|
|
+ padding: 4px 12px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #86909c;
|
|
|
+ border-radius: 999px;
|
|
|
+ border: 0.5px solid #d0d3d8;
|
|
|
+ background-color: #ffffff;
|
|
|
}
|
|
|
|
|
|
- .info-box {
|
|
|
- margin-top: 12px;
|
|
|
+ .info-list {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-left: 5px;
|
|
|
|
|
|
- .section-header {
|
|
|
+ .info-row {
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- }
|
|
|
+ align-items: flex-start;
|
|
|
+ margin-bottom: 6px;
|
|
|
|
|
|
- .edit-btn {
|
|
|
- padding: 4px 12px;
|
|
|
- font-size: 12px;
|
|
|
- color: #86909c;
|
|
|
- border-radius: 999px;
|
|
|
- border: 0.5px solid #d0d3d8;
|
|
|
- background-color: #ffffff;
|
|
|
- }
|
|
|
+ &.center-row {
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
|
|
|
- .info-list {
|
|
|
- margin-top: 10px;
|
|
|
- margin-left: 5px;
|
|
|
+ .info-label {
|
|
|
+ min-width: 80px;
|
|
|
+ color: #4E5969;
|
|
|
+ }
|
|
|
|
|
|
- .info-row {
|
|
|
+ .crop-tags {
|
|
|
display: flex;
|
|
|
- align-items: flex-start;
|
|
|
- margin-bottom: 6px;
|
|
|
- &.center-row {
|
|
|
- align-items: center;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 6px;
|
|
|
+
|
|
|
+ .crop-tag {
|
|
|
+ padding: 2px 8px;
|
|
|
+ background: #E8F3FF;
|
|
|
+ color: #2199f8;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 12px;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .info-label {
|
|
|
- min-width: 80px;
|
|
|
- color: #4E5969;
|
|
|
+ .problem-tags {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 6px;
|
|
|
+
|
|
|
+ .problem-tag {
|
|
|
+ padding: 2px 8px;
|
|
|
+ background: rgba(58, 173, 148, 0.1);
|
|
|
+ color: #3AAD94;
|
|
|
+ border-radius: 2px;
|
|
|
+ font-size: 13px;
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ .device-value {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .device-box {
|
|
|
+ padding: 6px;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 0.5px solid rgba(33, 153, 248, 0.2);
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
+ column-gap: 12px;
|
|
|
+ row-gap: 4px;
|
|
|
|
|
|
- .crop-tags {
|
|
|
+ .device-item {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 6px;
|
|
|
- .crop-tag {
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 4px 0;
|
|
|
+ min-width: 0;
|
|
|
+ gap: 8px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #1D2129;
|
|
|
+
|
|
|
+ .device-count {
|
|
|
padding: 2px 8px;
|
|
|
background: #E8F3FF;
|
|
|
color: #2199f8;
|
|
|
border-radius: 2px;
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- .add-variety-btn {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 3px;
|
|
|
- padding: 3px 6px;
|
|
|
- border: 1px solid #DCDCDC;
|
|
|
- border-radius: 3px;
|
|
|
- background: #fff;
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .problem-tags {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 6px;
|
|
|
-
|
|
|
- .problem-tag {
|
|
|
- padding: 2px 8px;
|
|
|
- background: rgba(58, 173, 148, 0.1);
|
|
|
- color: #3AAD94;
|
|
|
- border-radius: 2px;
|
|
|
- font-size: 13px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .device-value {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
-
|
|
|
- .device-box {
|
|
|
- padding: 6px;
|
|
|
- border-radius: 4px;
|
|
|
- border: 0.5px solid rgba(33, 153, 248, 0.2);
|
|
|
- display: grid;
|
|
|
- grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
- column-gap: 12px;
|
|
|
- row-gap: 4px;
|
|
|
-
|
|
|
- .device-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 4px 0;
|
|
|
- min-width: 0;
|
|
|
- gap: 8px;
|
|
|
- font-size: 13px;
|
|
|
- color: #1D2129;
|
|
|
-
|
|
|
- .device-count {
|
|
|
- padding: 2px 8px;
|
|
|
- background: #E8F3FF;
|
|
|
- color: #2199f8;
|
|
|
- border-radius: 2px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- .info-row-column {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- gap: 4px;
|
|
|
- }
|
|
|
+ .info-row-column {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 4px;
|
|
|
}
|
|
|
}
|
|
|
}
|