homeFile.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <div class="file-wrap">
  3. <div class="file-title">
  4. <img src="@/assets/images/common/chart-yellow.png" alt="" />
  5. 果园档案
  6. </div>
  7. <div class="box-wrap">
  8. <div class="overview-file">
  9. <div class="box-title">总体档案</div>
  10. <div class="base-data">
  11. <div class="base-item" v-for="(item, index) in photoBaseData" :key="item.label">
  12. <span class="label">{{ item.label }}</span>
  13. <div v-if="index === 0" class="value">
  14. <el-select
  15. v-model="item.speciesItemId"
  16. size="small"
  17. @change="changeSelect"
  18. class="type-select"
  19. >
  20. <el-option
  21. v-for="item in selectOptions"
  22. :key="item.speciesItemId"
  23. :label="item.speciesItemName"
  24. :value="item.speciesItemId"
  25. />
  26. </el-select>
  27. </div>
  28. <div v-else class="value">{{ item.value }}</div>
  29. </div>
  30. </div>
  31. <div class="list">
  32. <div class="list-item" v-for="item in photoList" :key="item.key">
  33. <div class="list-name">
  34. <img src="@/assets/images/common/title-icon.png" alt="" />
  35. {{ item.key }}
  36. </div>
  37. {{ item.statement }}
  38. </div>
  39. </div>
  40. </div>
  41. <div class="box-r">
  42. <div class="overview-file">
  43. <div class="box-title">产量详情</div>
  44. <div class="box-wrap">
  45. <div
  46. class="box-item"
  47. v-for="(item, index) in outputBox"
  48. :key="index"
  49. @click="toggleAcitve(item.name)"
  50. :class="{ active: activeOuput === item.name }"
  51. >
  52. <div class="item-name">{{ item.name }}</div>
  53. <div class="item-val">{{ item.value }}<span>{{ item.unit }}</span></div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="overview-file">
  58. <div class="box-title">生态评估</div>
  59. <div class="box-wrap">
  60. <div
  61. class="box-item"
  62. v-for="(item, index) in qualityBox"
  63. :key="index"
  64. @click="toggleQualityAcitve(item.name)"
  65. :class="{ active: activeOuput === item.name }"
  66. >
  67. <div class="item-name">{{ item.name }}</div>
  68. <div class="item-val">{{ item.value }}<span>{{ item.unit }}</span></div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </template>
  76. <script setup>
  77. import eventBus from "@/api/eventBus";
  78. import { onMounted, ref, } from "vue";
  79. const outputBox = ref([
  80. { id: 1, name: "产量估计", value: "1100", unit: "斤/亩" },
  81. { id: 2, name: "高质果率", value: "66", unit: "%" },
  82. ]);
  83. const qualityBox = ref([
  84. { id: 5, name: "通风率", value: "78", unit: "%" },
  85. { id: 6, name: "透光率", value: "56", unit: "%" },
  86. { id: 7, name: "病虫等级", value: "80", unit: "%" },
  87. ]);
  88. const photoBaseData = ref([
  89. {
  90. label: "品种",
  91. value: "桂味",
  92. },
  93. {
  94. label: "冠幅平均表面积",
  95. value: "8.7平方米",
  96. },
  97. {
  98. label: "平均总枝条",
  99. value: "2000",
  100. },
  101. {
  102. label: "平均树龄",
  103. value: "10年",
  104. },
  105. ]);
  106. const photoList = ref([
  107. {key: "物候", statement: "营养老熟 延迟,12月10日 末次老熟"},
  108. {key: "病虫", statement: "病虫 2025年02月19日,发现毛毡病异常1级"},
  109. {key: "异常", statement: "2025年03月17日,发现花量大异常3级"},
  110. {key: "农事", statement: "无营养异常"},
  111. ]);
  112. const activeOuput = ref(1);
  113. // 品种
  114. onMounted(() => {
  115. getSpeciesItemList(766, 2)
  116. })
  117. const selectOptions = ref([])
  118. const getSpeciesItemList = (farmId,regionId) =>{
  119. VE_API.farm.getSpeciesItemList({farmId,regionId}).then(res =>{
  120. selectOptions.value = res.data
  121. selectOptions.value.unshift({speciesItemId:"0",speciesItemName:"全部"})
  122. photoBaseData.value[0].speciesItemId = res.data[0].speciesItemId
  123. })
  124. }
  125. function changeSelect() {}
  126. // 产量详情
  127. function toggleAcitve(name) {
  128. activeOuput.value = name;
  129. eventBus.emit("change:mapPoint", name)
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. .file-wrap {
  134. margin-top: 16px;
  135. background: url("@/assets/images/home/file-bg-w.png") no-repeat top center / 100% 100%;
  136. margin-left: 12px;
  137. padding: 12px 18px 20px 16px;
  138. .file-title {
  139. font-size: 20px;
  140. color: #ffd489;
  141. }
  142. .box-wrap {
  143. display: flex;
  144. .box-r {
  145. padding-left: 24px;
  146. }
  147. }
  148. .overview-file {
  149. padding-top: 20px;
  150. .box-title {
  151. font-size: 16px;
  152. padding-left: 13px;
  153. margin-bottom: 16px;
  154. position: relative;
  155. display: flex;
  156. justify-content: space-between;
  157. color: #fff;
  158. &::before {
  159. content: "";
  160. position: absolute;
  161. left: 0;
  162. top: 3px;
  163. width: 3px;
  164. height: 16px;
  165. background: #fff;
  166. border-radius: 11px;
  167. }
  168. }
  169. .title {
  170. color: #f3c11d;
  171. font-size: 16px;
  172. font-family: "PangMenZhengDao";
  173. margin-bottom: 20px;
  174. .big {
  175. width: 13px;
  176. height: 13px;
  177. margin: -10px 0 0 4px;
  178. }
  179. .small {
  180. width: 7px;
  181. height: 7px;
  182. margin-left: -3px;
  183. }
  184. }
  185. .base-data {
  186. background: rgba(207, 207, 207, 0.1);
  187. border-radius: 4px;
  188. padding: 6px 0;
  189. display: flex;
  190. .base-item {
  191. // flex: 1;
  192. text-align: center;
  193. padding: 0 14px;
  194. .label {
  195. font-size: 12px;
  196. color: #666666;
  197. width: max-content;
  198. display: block;
  199. margin: 0 auto;
  200. padding-bottom: 2px;
  201. }
  202. .value {
  203. padding-top: 2px;
  204. font-size: 16px;
  205. color: #ffffff;
  206. width: max-content;
  207. margin: 0 auto;
  208. }
  209. .type-select {
  210. width: 72px;
  211. ::v-deep {
  212. .el-select__wrapper {
  213. background: rgba(247, 190, 90, 0.1);
  214. box-shadow: 0 0 0 1px #F7BE5A inset;
  215. color: #FFD489;
  216. }
  217. .el-select__placeholder {
  218. color: #FFD489;
  219. }
  220. }
  221. }
  222. }
  223. .base-item + .base-item {
  224. border-left: 1px solid rgba(102, 102, 102, 0.42);
  225. }
  226. }
  227. .list {
  228. margin-top: 15px;
  229. width: max-content;
  230. font-size: 14px;
  231. .list-item {
  232. color: #bbbbbb;
  233. display: flex;
  234. margin-bottom: 8px;
  235. .list-name {
  236. color: #f3c11d;
  237. margin-right: 6px;
  238. img {
  239. width: 17px;
  240. height: 13px;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .overview-file + .overview-file {
  247. margin-top: 8px;
  248. }
  249. .box-wrap {
  250. display: flex;
  251. .box-item {
  252. box-sizing: border-box;
  253. min-width: 110px;
  254. display: flex;
  255. flex-direction: column;
  256. justify-content: center;
  257. align-items: center;
  258. padding: 6px 16px;
  259. background: rgba(207, 207, 207, 0.1);
  260. border-radius: 4px;
  261. border: 1px solid rgba(207, 207, 207, 0.1);
  262. cursor: pointer;
  263. .item-name {
  264. font-size: 12px;
  265. color: #666666;
  266. width: max-content;
  267. }
  268. .item-val {
  269. font-size: 18px;
  270. color: #fff;
  271. width: max-content;
  272. padding-top: 3px;
  273. span {
  274. font-size: 12px;
  275. padding-left: 2px;
  276. }
  277. }
  278. &.active {
  279. background: rgba(255, 212, 137, 0.16);
  280. border: 1px solid #ffd489;
  281. .item-name {
  282. color: #bbbbbb;
  283. }
  284. }
  285. }
  286. .box-item + .box-item {
  287. margin-left: 8px;
  288. }
  289. }
  290. }
  291. </style>