index.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403
  1. <template>
  2. <view class="dashboard-container">
  3. <!-- 顶部用户信息卡片 -->
  4. <view class="user-info-card">
  5. <view class="user-info">
  6. <text class="greeting">您好,{{ userData.nickname }}</text>
  7. <view class="plot-info">
  8. <text class="plot-label">当前地块:</text>
  9. <text class="plot-name">{{ userData.selectedPlot }}</text>
  10. <view class="switch-plot-btn" @click="handleSwitchPlot">
  11. <text>切换</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="avatar-container" @click="navigateToProfile">
  16. <view class="avatar">
  17. <image src="/static/icons/user icon.png" mode="aspectFill"></image>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 顶部统计概览 -->
  22. <view class="stats-overview">
  23. <view class="alert-card" v-for="(alert, index) in alertSummaries" :key="index" @click="navigateToAlertDetail(alert.type)">
  24. <view class="alert-header">
  25. <view class="alert-icon-container">
  26. <image class="custom-icon" :src="alert.iconSrc"></image>
  27. </view>
  28. <text class="alert-title">{{ alert.title }}</text>
  29. </view>
  30. <text class="alert-value">{{ alert.value }}</text>
  31. <text class="alert-description">{{ alert.description }}</text>
  32. </view>
  33. </view>
  34. <!-- 天气卡片 -->
  35. <view class="card weather-card">
  36. <view class="card-header">
  37. <view class="title-section">
  38. <view class="title-line"></view>
  39. <text class="card-title">天气与预报</text>
  40. </view>
  41. </view>
  42. <view class="weather-content">
  43. <view class="current-weather">
  44. <view class="weather-icon-container">
  45. <view class="weather-icon">
  46. <text v-if="weatherData.description === '晴朗'">☀️</text>
  47. <text v-else-if="weatherData.description.includes('雨')">🌧️</text>
  48. <text v-else-if="weatherData.description.includes('云')">⛅</text>
  49. <text v-else>🌤️</text>
  50. </view>
  51. </view>
  52. <view class="weather-details">
  53. <text class="weather-temp">{{ weatherData.temperature }}°C</text>
  54. <text class="weather-desc">{{ weatherData.description }}</text>
  55. </view>
  56. </view>
  57. <view class="weather-metrics">
  58. <view class="weather-metric">
  59. <text class="metric-label">湿度</text>
  60. <text class="metric-value">{{ weatherData.humidity }}%</text>
  61. </view>
  62. <view class="vertical-divider"></view>
  63. <view class="weather-metric">
  64. <text class="metric-label">风力</text>
  65. <text class="metric-value">{{ weatherData.windLevel }} 级</text>
  66. </view>
  67. <view class="vertical-divider"></view>
  68. <view class="weather-metric">
  69. <text class="metric-label">降水量</text>
  70. <text class="metric-value">{{ weatherData.rainfall }} mm</text>
  71. </view>
  72. </view>
  73. <view class="weather-advice">
  74. <view class="advice-header">
  75. <view class="icon-tile small">
  76. <u-icon name="info" color="#ffffff" size="14"></u-icon>
  77. </view>
  78. <text class="advice-title">今日建议:</text>
  79. </view>
  80. <text class="advice-content">{{ weatherData.advice }}</text>
  81. </view>
  82. </view>
  83. </view>
  84. <!-- 农场绩效卡片 -->
  85. <view class="card farm-performance">
  86. <view class="card-header">
  87. <view class="title-section">
  88. <view class="title-line"></view>
  89. <text class="card-title">产值分析</text>
  90. </view>
  91. <view class="period-selector">
  92. <text class="period" :class="{ active: currentPeriod === 'month' }" @click="changePeriod('month')">月</text>
  93. <text class="period" :class="{ active: currentPeriod === 'quarter' }" @click="changePeriod('quarter')">季</text>
  94. <text class="period" :class="{ active: currentPeriod === 'year' }" @click="changePeriod('year')">年</text>
  95. </view>
  96. </view>
  97. <view class="performance-stats">
  98. <view class="metric-column">
  99. <text class="metric-value">128<text class="metric-unit">亩</text></text>
  100. <text class="metric-label">管理面积总计</text>
  101. <view class="growth positive">
  102. <u-icon name="arrow-upward" color="#3BB44A" size="12"></u-icon>
  103. <text>比上月增长12%</text>
  104. </view>
  105. </view>
  106. <view class="metric-divider"></view>
  107. <view class="metric-column">
  108. <text class="metric-value">¥36,480</text>
  109. <text class="metric-label">预计产值</text>
  110. <view class="growth positive">
  111. <u-icon name="arrow-upward" color="#3BB44A" size="12"></u-icon>
  112. <text>比上月增长8.2%</text>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="chart-container">
  117. <view class="chart-header">
  118. <text class="chart-title">产值趋势 (万元)</text>
  119. <view class="chart-legend">
  120. <view class="legend-item">
  121. <view class="legend-color" style="background: #3BB44A;"></view>
  122. <text>今年</text>
  123. </view>
  124. <view class="legend-item">
  125. <view class="legend-color" style="background: #E0E0E0;"></view>
  126. <text>去年</text>
  127. </view>
  128. </view>
  129. </view>
  130. <view class="chart-body">
  131. <view class="y-axis">
  132. <text v-for="(value, index) in [4, 3, 2, 1, 0]" :key="index">{{ value }}</text>
  133. </view>
  134. <view class="bars-container">
  135. <view class="month-group" v-for="(month, index) in farmPerformanceData.months" :key="index">
  136. <view class="bar-wrapper">
  137. <view class="bar last-year" :style="{ height: (farmPerformanceData.lastYearValues[index] / 4) * 100 + '%' }"></view>
  138. <view class="bar this-year" :style="{ height: (farmPerformanceData.thisYearValues[index] / 4) * 100 + '%' }"></view>
  139. </view>
  140. <text class="month-label">{{ month }}</text>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 监控设备概览 -->
  147. <view class="card device-overview">
  148. <view class="card-header">
  149. <view class="title-section">
  150. <view class="title-line"></view>
  151. <text class="card-title">监控设备概览</text>
  152. </view>
  153. </view>
  154. <view class="device-metrics-grid">
  155. <view class="device-metric-card" v-for="(metric, index) in deviceMetrics" :key="index">
  156. <view class="device-metric-header">
  157. <view class="icon-tile" :style="{ background: metric.gradient }">
  158. <u-icon :name="metric.icon" color="#ffffff" size="18"></u-icon>
  159. </view>
  160. <text class="metric-name">{{ metric.name }}</text>
  161. </view>
  162. <view class="device-metric-value">{{ metric.value }}</view>
  163. <view class="device-metric-trend" :class="metric.trend.type">
  164. <u-icon :name="metric.trend.type === 'up' ? 'arrow-upward' : 'arrow-downward'" :color="metric.trend.type === 'up' ? '#3BB44A' : '#FF5252'" size="14"></u-icon>
  165. <text>{{ metric.trend.value }}</text>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <!-- 农业机械活动 -->
  171. <view class="card machinery-activity">
  172. <view class="card-header">
  173. <view class="title-section">
  174. <view class="title-line"></view>
  175. <text class="card-title">农机作业概览</text>
  176. </view>
  177. </view>
  178. <view class="machinery-metrics-grid">
  179. <view class="machinery-metric-card" v-for="(metric, index) in machineryMetrics" :key="index">
  180. <view class="machinery-metric-header">
  181. <view class="icon-tile" :style="{ background: metric.gradient }">
  182. <u-icon :name="metric.icon" color="#ffffff" size="18"></u-icon>
  183. </view>
  184. <text class="metric-name">{{ metric.name }}</text>
  185. </view>
  186. <view class="machinery-metric-value">{{ metric.value }}</view>
  187. <view v-if="metric.trend" class="machinery-metric-trend" :class="metric.trend.type">
  188. <u-icon :name="metric.trend.type === 'up' ? 'arrow-upward' : 'arrow-downward'" :color="metric.trend.type === 'up' ? '#3BB44A' : '#FF5252'" size="14"></u-icon>
  189. <text>{{ metric.trend.value }}</text>
  190. </view>
  191. <view v-else class="machinery-metric-unit">
  192. <text>{{ metric.unit }}</text>
  193. </view>
  194. </view>
  195. </view>
  196. </view>
  197. <!-- 农场活动卡片 -->
  198. <view class="card farm-activities">
  199. <view class="card-header">
  200. <view class="title-section">
  201. <view class="title-line"></view>
  202. <text class="card-title">农事活动</text>
  203. </view>
  204. <view class="action-button">
  205. <text>查看全部</text>
  206. <u-icon name="arrow-right" color="#ffffff" size="14"></u-icon>
  207. </view>
  208. </view>
  209. <view class="activities-list">
  210. <view class="activity-item" v-for="(activity, index) in farmData.recentActivities" :key="index">
  211. <view class="activity-dot" :class="activity.status"></view>
  212. <view class="activity-details">
  213. <view class="activity-title-row">
  214. <text class="activity-title">{{ activity.title }}</text>
  215. <text class="activity-date">{{ activity.date }}</text>
  216. </view>
  217. <view class="activity-meta-row">
  218. <text class="activity-executor">{{ activity.executor }}</text>
  219. <view class="activity-action" @click.stop="navigateToActivity(activity)">
  220. <text class="action-text">查看</text>
  221. <u-icon name="arrow-right" color="#3BB44A" size="14"></u-icon>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. </view>
  229. </template>
  230. <script>
  231. export default {
  232. data() {
  233. return {
  234. // 用户数据
  235. userData: {
  236. nickname: '张三',
  237. selectedPlot: '南地块'
  238. },
  239. // 农场数据
  240. farmData: {
  241. plotCount: 5,
  242. deviceCount: 12,
  243. deviceOnlineRate: 85,
  244. taskCompletionRate: 76,
  245. recentActivities: [
  246. { title: '稻田水稻施肥', date: '2023-05-15', status: 'pending', id: 1, executor: '李四' },
  247. { title: '南地块除草', date: '2023-05-12', status: 'completed', id: 2, executor: '王五' },
  248. { title: '西北区域杀虫', date: '2023-05-08', status: 'completed', id: 3, executor: '张三' }
  249. ]
  250. },
  251. // 天气数据
  252. weatherData: {
  253. temperature: 28,
  254. description: '晴朗',
  255. humidity: 65,
  256. windLevel: 3,
  257. rainfall: 0,
  258. advice: '今日适宜进行春玉米防虫作业,注意水分管理。'
  259. },
  260. // 作物数据
  261. crops: [
  262. { name: '水稻', area: 48, progress: 75, icon: '🌾', bgColor: '#4CAF50' },
  263. { name: '小麦', area: 36, progress: 60, icon: '🌿', bgColor: '#66BB6A' },
  264. { name: '玉米', area: 32, progress: 85, icon: '🌽', bgColor: '#43A047' },
  265. { name: '大豆', area: 12, progress: 40, icon: '🫘', bgColor: '#388E3C' }
  266. ],
  267. // 监控设备指标
  268. deviceMetrics: [
  269. {
  270. name: '在线设备',
  271. value: '28',
  272. icon: 'wifi',
  273. gradient: 'linear-gradient(135deg, #26A69A, #00796B)',
  274. trend: {
  275. type: 'up',
  276. value: '5.2%'
  277. }
  278. },
  279. {
  280. name: '告警设备',
  281. value: '3',
  282. icon: 'error-circle',
  283. gradient: 'linear-gradient(135deg, #FF7043, #E64A19)',
  284. trend: {
  285. type: 'down',
  286. value: '2.1%'
  287. }
  288. },
  289. {
  290. name: '离线设备',
  291. value: '5',
  292. icon: 'close-circle',
  293. gradient: 'linear-gradient(135deg, #78909C, #455A64)',
  294. trend: {
  295. type: 'down',
  296. value: '1.8%'
  297. }
  298. },
  299. {
  300. name: '数据稳定性',
  301. value: '96.3%',
  302. icon: 'checkmark-circle',
  303. gradient: 'linear-gradient(135deg, #66BB6A, #388E3C)',
  304. trend: {
  305. type: 'up',
  306. value: '0.5%'
  307. }
  308. }
  309. ],
  310. // 农业机械指标
  311. machineryMetrics: [
  312. {
  313. name: '今日运行时长',
  314. value: '36.5',
  315. unit: '小时',
  316. icon: 'clock',
  317. gradient: 'linear-gradient(135deg, #42A5F5, #1976D2)'
  318. },
  319. {
  320. name: '今日作业地块',
  321. value: '8',
  322. unit: '块',
  323. icon: 'map',
  324. gradient: 'linear-gradient(135deg, #66BB6A, #388E3C)'
  325. },
  326. {
  327. name: '今日执行任务',
  328. value: '12',
  329. unit: '个',
  330. icon: 'calendar',
  331. gradient: 'linear-gradient(135deg, #FFA726, #F57C00)'
  332. },
  333. {
  334. name: '使用率',
  335. value: '78.2%',
  336. icon: 'star',
  337. gradient: 'linear-gradient(135deg, #5C6BC0, #3949AB)',
  338. trend: {
  339. type: 'up',
  340. value: '3.7%'
  341. }
  342. }
  343. ],
  344. // 当前选择的周期
  345. currentPeriod: 'month',
  346. // 警报摘要数据
  347. alertSummaries: [
  348. {
  349. title: '设备离线',
  350. value: '3 台',
  351. iconSrc: '/static/icons/offline.png',
  352. description: '最长离线时长:26 小时',
  353. type: 'device-offline'
  354. },
  355. {
  356. title: '虫害预警',
  357. value: '稻飞虱|小地老虎',
  358. iconSrc: '/static/icons/Pest_Alert.png',
  359. description: '预警等级:中',
  360. type: 'pest-warning'
  361. },
  362. {
  363. title: '气象预警',
  364. value: '强风(8级)',
  365. iconSrc: '/static/icons/weather_risk.png',
  366. description: '预计:未来 12 小时内',
  367. type: 'weather-risk'
  368. },
  369. {
  370. title: '作业延迟',
  371. value: '5 项',
  372. iconSrc: '/static/icons/task_delay.png',
  373. description: '最长延迟:3 天',
  374. type: 'task-delay'
  375. }
  376. ],
  377. // 农场绩效图表数据 - 月度数据
  378. monthlyData: {
  379. months: ['1月', '2月', '3月', '4月', '5月', '6月'],
  380. thisYearValues: [2.8, 3.4, 2.9, 3.6, 3.8, 3.2],
  381. lastYearValues: [2.5, 2.8, 2.4, 3.0, 3.2, 2.7]
  382. },
  383. // 季度数据
  384. quarterlyData: {
  385. months: ['Q1', 'Q2', 'Q3', 'Q4'],
  386. thisYearValues: [3.2, 3.7, 4.0, 3.5],
  387. lastYearValues: [2.7, 3.3, 3.6, 3.0]
  388. },
  389. // 年度数据
  390. yearlyData: {
  391. months: ['2019', '2020', '2021', '2022', '2023'],
  392. thisYearValues: [2.2, 2.5, 3.0, 3.5, 3.8],
  393. lastYearValues: [2.0, 2.3, 2.7, 3.2, 3.4]
  394. }
  395. };
  396. },
  397. computed: {
  398. // 核心统计数据
  399. coreStats() {
  400. return [
  401. {
  402. label: '地块',
  403. value: this.farmData.plotCount,
  404. icon: 'map',
  405. },
  406. {
  407. label: '设备',
  408. value: this.farmData.deviceCount,
  409. icon: 'setting',
  410. },
  411. {
  412. label: '设备在线',
  413. value: this.farmData.deviceOnlineRate + '%',
  414. icon: 'wifi',
  415. },
  416. {
  417. label: '任务完成',
  418. value: this.farmData.taskCompletionRate + '%',
  419. icon: 'checkmark-circle',
  420. }
  421. ];
  422. },
  423. // 根据当前周期计算要显示的数据
  424. farmPerformanceData() {
  425. if (this.currentPeriod === 'month') {
  426. return this.monthlyData;
  427. } else if (this.currentPeriod === 'quarter') {
  428. return this.quarterlyData;
  429. } else {
  430. return this.yearlyData;
  431. }
  432. }
  433. },
  434. methods: {
  435. // 处理切换地块
  436. handleSwitchPlot() {
  437. uni.showActionSheet({
  438. itemList: ['南地块', '西北区域', '稻田', '东区试验田'],
  439. success: (res) => {
  440. this.userData.selectedPlot = ['南地块', '西北区域', '稻田', '东区试验田'][res.tapIndex];
  441. }
  442. });
  443. },
  444. // 导航到个人资料
  445. navigateToProfile() {
  446. uni.navigateTo({
  447. url: '/pages/profile/index'
  448. });
  449. },
  450. // 导航到活动详情
  451. navigateToActivity(activity) {
  452. uni.navigateTo({
  453. url: `/pages/activity/detail?id=${activity.id}`
  454. });
  455. },
  456. // 导航到警报详情
  457. navigateToAlertDetail(type) {
  458. // 实现导航到警报详情页的逻辑
  459. console.log(`Navigating to alert detail for type: ${type}`);
  460. },
  461. // 切换周期
  462. changePeriod(period) {
  463. this.currentPeriod = period;
  464. }
  465. },
  466. mounted() {
  467. // 页面加载完成后的处理
  468. // 这里可以添加数据加载、初始化等逻辑
  469. }
  470. };
  471. </script>
  472. <style lang="scss" scoped>
  473. .dashboard-container {
  474. padding: 24rpx;
  475. background-color: #F6FDF9;
  476. min-height: 100vh;
  477. }
  478. // 顶部用户信息卡片
  479. .user-info-card {
  480. display: flex;
  481. justify-content: space-between;
  482. align-items: center;
  483. background: white;
  484. border-radius: 20rpx;
  485. padding: 24rpx 28rpx;
  486. margin-bottom: 24rpx;
  487. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04);
  488. .user-info {
  489. flex: 1;
  490. .greeting {
  491. font-size: 32rpx;
  492. font-weight: 600;
  493. color: #2C3E50;
  494. margin-bottom: 8rpx;
  495. }
  496. .plot-info {
  497. display: flex;
  498. align-items: center;
  499. .plot-label {
  500. font-size: 24rpx;
  501. color: #8C9396;
  502. }
  503. .plot-name {
  504. font-size: 24rpx;
  505. color: #2C3E50;
  506. margin: 0 8rpx;
  507. }
  508. .switch-plot-btn {
  509. display: flex;
  510. align-items: center;
  511. justify-content: center;
  512. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  513. border-radius: 16rpx;
  514. padding: 4rpx 16rpx;
  515. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  516. text {
  517. font-size: 22rpx;
  518. color: white;
  519. }
  520. }
  521. }
  522. }
  523. .avatar-container {
  524. .avatar {
  525. width: 80rpx;
  526. height: 80rpx;
  527. border-radius: 50%;
  528. background-color: rgba(59, 180, 74, 0.1);
  529. border: 2px solid rgba(255, 255, 255, 0.8);
  530. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  531. overflow: hidden;
  532. image {
  533. width: 100%;
  534. height: 100%;
  535. object-fit: cover;
  536. }
  537. }
  538. }
  539. }
  540. // Top Stats Overview
  541. .stats-overview {
  542. display: grid;
  543. grid-template-columns: repeat(2, 1fr);
  544. gap: 16rpx;
  545. margin-bottom: 24rpx;
  546. .alert-card {
  547. background: white;
  548. border-radius: 16rpx;
  549. padding: 20rpx;
  550. display: flex;
  551. flex-direction: column;
  552. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  553. position: relative;
  554. overflow: hidden;
  555. transition: transform 0.2s, box-shadow 0.2s;
  556. &:active {
  557. transform: translateY(2rpx);
  558. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  559. }
  560. &::after {
  561. content: "";
  562. position: absolute;
  563. right: 12rpx;
  564. bottom: 12rpx;
  565. width: 16rpx;
  566. height: 16rpx;
  567. border-top: 2rpx solid #E0E0E0;
  568. border-right: 2rpx solid #E0E0E0;
  569. transform: rotate(45deg);
  570. opacity: 0.5;
  571. }
  572. .alert-header {
  573. display: flex;
  574. align-items: center;
  575. margin-bottom: 12rpx;
  576. .alert-icon-container {
  577. margin-right: 12rpx;
  578. width: 40rpx;
  579. height: 40rpx;
  580. display: flex;
  581. align-items: center;
  582. justify-content: center;
  583. .custom-icon {
  584. width: 40rpx;
  585. height: 40rpx;
  586. object-fit: contain;
  587. }
  588. }
  589. .alert-title {
  590. font-size: 26rpx;
  591. color: #333333;
  592. font-weight: 600;
  593. }
  594. }
  595. .alert-value {
  596. font-size: 30rpx;
  597. font-weight: 700;
  598. color: #3BB44A;
  599. margin-bottom: 6rpx;
  600. line-height: 1.2;
  601. padding-left: 52rpx;
  602. }
  603. .alert-description {
  604. font-size: 22rpx;
  605. color: #757575;
  606. padding-left: 52rpx;
  607. }
  608. }
  609. }
  610. // Card Base Styles
  611. .card {
  612. background: white;
  613. border-radius: 20rpx;
  614. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04), 0 1rpx 4rpx rgba(0, 0, 0, 0.02);
  615. margin-bottom: 24rpx;
  616. overflow: hidden;
  617. .card-header {
  618. display: flex;
  619. justify-content: space-between;
  620. align-items: center;
  621. padding: 24rpx 28rpx;
  622. border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  623. .title-section {
  624. display: flex;
  625. align-items: center;
  626. .title-line {
  627. width: 4rpx;
  628. height: 28rpx;
  629. border-radius: 0;
  630. background: linear-gradient(180deg, #3BB44A, #66CC6A);
  631. margin-right: 16rpx;
  632. }
  633. .card-title {
  634. font-size: 28rpx;
  635. font-weight: 600;
  636. color: #2C3E50;
  637. }
  638. }
  639. .period-selector {
  640. display: flex;
  641. background: rgba(0, 0, 0, 0.03);
  642. border-radius: 20rpx;
  643. padding: 2rpx;
  644. .period {
  645. font-size: 22rpx;
  646. color: #8C9396;
  647. padding: 8rpx 16rpx;
  648. border-radius: 16rpx;
  649. &.active {
  650. background: white;
  651. color: #3BB44A;
  652. font-weight: 500;
  653. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
  654. }
  655. }
  656. }
  657. .action-button {
  658. display: flex;
  659. align-items: center;
  660. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  661. border-radius: 24rpx;
  662. padding: 8rpx 16rpx;
  663. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  664. text {
  665. font-size: 22rpx;
  666. color: white;
  667. margin-right: 6rpx;
  668. }
  669. }
  670. }
  671. }
  672. // Farm Performance Card
  673. .farm-performance {
  674. .performance-stats {
  675. display: flex;
  676. padding: 24rpx 28rpx;
  677. .metric-column {
  678. flex: 1;
  679. display: flex;
  680. flex-direction: column;
  681. .metric-value {
  682. font-size: 48rpx;
  683. font-weight: 700;
  684. color: #2C3E50;
  685. margin-bottom: 6rpx;
  686. line-height: 1.1;
  687. .metric-unit {
  688. font-size: 24rpx;
  689. font-weight: 500;
  690. color: #8C9396;
  691. margin-left: 4rpx;
  692. }
  693. }
  694. .metric-label {
  695. font-size: 24rpx;
  696. color: #8C9396;
  697. margin-bottom: 12rpx;
  698. }
  699. .growth {
  700. display: flex;
  701. align-items: center;
  702. font-size: 22rpx;
  703. &.positive {
  704. color: #3BB44A;
  705. }
  706. &.negative {
  707. color: #FF5252;
  708. }
  709. }
  710. }
  711. .metric-divider {
  712. width: 1px;
  713. background: rgba(0, 0, 0, 0.04);
  714. margin: 0 28rpx;
  715. }
  716. }
  717. .chart-container {
  718. padding: 24rpx 28rpx;
  719. .chart-header {
  720. display: flex;
  721. justify-content: space-between;
  722. align-items: center;
  723. margin-bottom: 16rpx;
  724. .chart-title {
  725. font-size: 28rpx;
  726. font-weight: 600;
  727. color: #2C3E50;
  728. }
  729. .chart-legend {
  730. display: flex;
  731. align-items: center;
  732. .legend-item {
  733. display: flex;
  734. align-items: center;
  735. margin-left: 16rpx;
  736. .legend-color {
  737. width: 16rpx;
  738. height: 16rpx;
  739. border-radius: 4rpx;
  740. margin-right: 8rpx;
  741. }
  742. text {
  743. font-size: 22rpx;
  744. color: #8C9396;
  745. }
  746. }
  747. }
  748. }
  749. .chart-body {
  750. display: flex;
  751. height: 240rpx;
  752. position: relative;
  753. margin-top: 12rpx;
  754. .y-axis {
  755. width: 40rpx;
  756. height: 200rpx;
  757. display: flex;
  758. flex-direction: column;
  759. justify-content: space-between;
  760. text-align: right;
  761. padding-right: 16rpx;
  762. margin-bottom: 30rpx;
  763. text {
  764. font-size: 22rpx;
  765. color: #8C9396;
  766. }
  767. }
  768. .bars-container {
  769. flex: 1;
  770. display: flex;
  771. justify-content: space-around;
  772. height: 200rpx;
  773. position: relative;
  774. &::before {
  775. content: "";
  776. position: absolute;
  777. left: 0;
  778. bottom: 0;
  779. width: 100%;
  780. height: 1px;
  781. background-color: #E0E0E0;
  782. }
  783. .month-group {
  784. display: flex;
  785. flex-direction: column;
  786. align-items: center;
  787. width: 14%;
  788. .bar-wrapper {
  789. height: 200rpx;
  790. width: 70%;
  791. display: flex;
  792. justify-content: center;
  793. position: relative;
  794. .bar {
  795. position: absolute;
  796. bottom: 0;
  797. width: 45%;
  798. border-radius: 4rpx 4rpx 0 0;
  799. transition: height 0.3s ease;
  800. }
  801. .last-year {
  802. left: 0;
  803. background: #E0E0E0;
  804. }
  805. .this-year {
  806. right: 0;
  807. background: #3BB44A;
  808. }
  809. }
  810. .month-label {
  811. font-size: 22rpx;
  812. color: #8C9396;
  813. margin-top: 8rpx;
  814. }
  815. }
  816. }
  817. }
  818. }
  819. }
  820. // Crop Portfolio
  821. .crop-portfolio {
  822. .crop-grid {
  823. padding: 16rpx;
  824. display: grid;
  825. grid-template-columns: repeat(2, 1fr);
  826. gap: 16rpx;
  827. }
  828. .crop-item {
  829. padding: 16rpx;
  830. background: rgba(0, 0, 0, 0.01);
  831. border-radius: 16rpx;
  832. display: flex;
  833. align-items: center;
  834. .crop-icon {
  835. width: 48rpx;
  836. height: 48rpx;
  837. border-radius: 12rpx;
  838. display: flex;
  839. align-items: center;
  840. justify-content: center;
  841. margin-right: 16rpx;
  842. .crop-icon-text {
  843. font-size: 24rpx;
  844. }
  845. }
  846. .crop-details {
  847. flex: 1;
  848. .crop-info {
  849. display: flex;
  850. justify-content: space-between;
  851. align-items: center;
  852. margin-bottom: 10rpx;
  853. .crop-name {
  854. font-size: 26rpx;
  855. font-weight: 600;
  856. color: #2C3E50;
  857. }
  858. .crop-area {
  859. font-size: 22rpx;
  860. color: #8C9396;
  861. }
  862. }
  863. .crop-stats {
  864. display: flex;
  865. align-items: center;
  866. .crop-progress-container {
  867. flex: 1;
  868. height: 8rpx;
  869. background: rgba(0, 0, 0, 0.03);
  870. border-radius: 4rpx;
  871. margin-right: 12rpx;
  872. overflow: hidden;
  873. .crop-progress {
  874. height: 100%;
  875. border-radius: 4rpx;
  876. }
  877. }
  878. .crop-progress-text {
  879. font-size: 22rpx;
  880. color: #8C9396;
  881. min-width: 36rpx;
  882. text-align: right;
  883. }
  884. }
  885. }
  886. }
  887. }
  888. // Resource Efficiency
  889. .resource-efficiency {
  890. .resource-grid {
  891. padding: 16rpx;
  892. display: grid;
  893. grid-template-columns: repeat(2, 1fr);
  894. gap: 16rpx;
  895. }
  896. .resource-item {
  897. padding: 16rpx;
  898. background: rgba(0, 0, 0, 0.01);
  899. border-radius: 16rpx;
  900. .resource-header {
  901. display: flex;
  902. align-items: center;
  903. margin-bottom: 12rpx;
  904. .icon-tile {
  905. width: 28rpx;
  906. height: 28rpx;
  907. border-radius: 6rpx;
  908. display: flex;
  909. align-items: center;
  910. justify-content: center;
  911. margin-right: 10rpx;
  912. &.small {
  913. width: 28rpx;
  914. height: 28rpx;
  915. }
  916. }
  917. .resource-name {
  918. font-size: 24rpx;
  919. color: #8C9396;
  920. }
  921. }
  922. .resource-value {
  923. margin-bottom: 12rpx;
  924. .value {
  925. font-size: 36rpx;
  926. font-weight: 700;
  927. color: #2C3E50;
  928. }
  929. .unit {
  930. font-size: 22rpx;
  931. color: #8C9396;
  932. margin-left: 4rpx;
  933. }
  934. }
  935. .resource-progress-container {
  936. .resource-progress-bg {
  937. height: 8rpx;
  938. background: rgba(0, 0, 0, 0.03);
  939. border-radius: 4rpx;
  940. margin-bottom: 8rpx;
  941. overflow: hidden;
  942. .resource-progress {
  943. height: 100%;
  944. border-radius: 4rpx;
  945. }
  946. }
  947. .resource-efficiency {
  948. font-size: 22rpx;
  949. color: #8C9396;
  950. }
  951. }
  952. }
  953. }
  954. // Farm Activities
  955. .farm-activities {
  956. .activities-list {
  957. padding: 8rpx 0;
  958. }
  959. .activity-item {
  960. display: flex;
  961. align-items: center;
  962. padding: 20rpx 28rpx;
  963. border-bottom: 1px solid rgba(0, 0, 0, 0.02);
  964. &:last-child {
  965. border-bottom: none;
  966. }
  967. .activity-dot {
  968. width: 10rpx;
  969. height: 10rpx;
  970. border-radius: 50%;
  971. margin-right: 16rpx;
  972. flex-shrink: 0;
  973. &.completed {
  974. background: #4CAF50;
  975. }
  976. &.pending {
  977. background: #FFC107;
  978. }
  979. &.failed {
  980. background: #FF5252;
  981. }
  982. }
  983. .activity-details {
  984. flex: 1;
  985. .activity-title-row {
  986. display: flex;
  987. justify-content: space-between;
  988. align-items: center;
  989. margin-bottom: 6rpx;
  990. .activity-title {
  991. font-size: 26rpx;
  992. font-weight: 500;
  993. color: #2C3E50;
  994. }
  995. .activity-date {
  996. font-size: 22rpx;
  997. color: #8C9396;
  998. }
  999. }
  1000. .activity-meta-row {
  1001. display: flex;
  1002. justify-content: space-between;
  1003. align-items: center;
  1004. .activity-executor {
  1005. font-size: 22rpx;
  1006. color: #8C9396;
  1007. }
  1008. .activity-action {
  1009. display: flex;
  1010. align-items: center;
  1011. .action-text {
  1012. font-size: 22rpx;
  1013. color: #3BB44A;
  1014. margin-right: 6rpx;
  1015. }
  1016. }
  1017. }
  1018. }
  1019. }
  1020. }
  1021. // Weather Card
  1022. .weather-card {
  1023. .weather-content {
  1024. padding: 20rpx 28rpx;
  1025. }
  1026. .current-weather {
  1027. display: flex;
  1028. align-items: center;
  1029. margin-bottom: 24rpx;
  1030. .weather-icon-container {
  1031. margin-right: 20rpx;
  1032. .weather-icon {
  1033. font-size: 60rpx;
  1034. line-height: 1;
  1035. }
  1036. }
  1037. .weather-details {
  1038. .weather-temp {
  1039. font-size: 48rpx;
  1040. font-weight: 700;
  1041. color: #2C3E50;
  1042. line-height: 1.1;
  1043. }
  1044. .weather-desc {
  1045. font-size: 26rpx;
  1046. color: #8C9396;
  1047. }
  1048. }
  1049. }
  1050. .weather-metrics {
  1051. display: flex;
  1052. justify-content: space-between;
  1053. align-items: center;
  1054. padding: 16rpx 24rpx;
  1055. margin-bottom: 24rpx;
  1056. border-radius: 12rpx;
  1057. background-color: rgba(247, 247, 247, 0.5);
  1058. border: 1px solid rgba(0, 0, 0, 0.03);
  1059. .weather-metric {
  1060. flex: 1;
  1061. display: flex;
  1062. flex-direction: column;
  1063. align-items: center;
  1064. .metric-label {
  1065. font-size: 22rpx;
  1066. color: #8C9396;
  1067. margin-bottom: 6rpx;
  1068. }
  1069. .metric-value {
  1070. font-size: 28rpx;
  1071. font-weight: 600;
  1072. color: #2C3E50;
  1073. }
  1074. }
  1075. .vertical-divider {
  1076. width: 1px;
  1077. height: 36rpx;
  1078. background-color: rgba(0, 0, 0, 0.05);
  1079. }
  1080. }
  1081. .weather-advice {
  1082. background: rgba(59, 180, 74, 0.05);
  1083. border-radius: 16rpx;
  1084. padding: 16rpx;
  1085. .advice-header {
  1086. display: flex;
  1087. align-items: center;
  1088. margin-bottom: 10rpx;
  1089. .icon-tile {
  1090. width: 24rpx;
  1091. height: 24rpx;
  1092. border-radius: 50%;
  1093. background: linear-gradient(135deg, #3BB44A, #66CC6A);
  1094. display: flex;
  1095. align-items: center;
  1096. justify-content: center;
  1097. margin-right: 10rpx;
  1098. box-shadow: 0 2rpx 8rpx rgba(59, 180, 74, 0.25);
  1099. &.small {
  1100. width: 24rpx;
  1101. height: 24rpx;
  1102. }
  1103. }
  1104. .advice-title {
  1105. font-size: 24rpx;
  1106. font-weight: 600;
  1107. color: #2C3E50;
  1108. }
  1109. }
  1110. .advice-content {
  1111. font-size: 24rpx;
  1112. color: #2C3E50;
  1113. line-height: 1.4;
  1114. }
  1115. }
  1116. }
  1117. // For small screens - mobile responsiveness
  1118. @media screen and (max-width: 768px) {
  1119. .stats-overview {
  1120. grid-template-columns: repeat(2, 1fr);
  1121. }
  1122. .crop-grid {
  1123. grid-template-columns: 1fr;
  1124. }
  1125. }
  1126. // 监控设备概览
  1127. .device-overview {
  1128. .device-metrics-grid {
  1129. display: grid;
  1130. grid-template-columns: repeat(2, 1fr);
  1131. gap: 16rpx;
  1132. padding: 16rpx;
  1133. }
  1134. .device-metric-card {
  1135. background: white;
  1136. border-radius: 16rpx;
  1137. padding: 20rpx;
  1138. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  1139. border: 1px solid rgba(0, 0, 0, 0.02);
  1140. .device-metric-header {
  1141. display: flex;
  1142. align-items: center;
  1143. margin-bottom: 16rpx;
  1144. .icon-tile {
  1145. width: 24rpx;
  1146. height: 24rpx;
  1147. border-radius: 50%;
  1148. display: flex;
  1149. align-items: center;
  1150. justify-content: center;
  1151. margin-right: 10rpx;
  1152. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
  1153. }
  1154. .metric-name {
  1155. font-size: 24rpx;
  1156. color: #8C9396;
  1157. }
  1158. }
  1159. .device-metric-value {
  1160. font-size: 44rpx;
  1161. font-weight: 700;
  1162. color: #2C3E50;
  1163. margin-bottom: 12rpx;
  1164. }
  1165. .device-metric-trend {
  1166. display: flex;
  1167. align-items: center;
  1168. font-size: 22rpx;
  1169. &.up {
  1170. color: #3BB44A;
  1171. }
  1172. &.down {
  1173. color: #FF5252;
  1174. }
  1175. text {
  1176. margin-left: 4rpx;
  1177. }
  1178. }
  1179. }
  1180. }
  1181. // 农业机械活动
  1182. .machinery-activity {
  1183. .machinery-metrics-grid {
  1184. display: grid;
  1185. grid-template-columns: repeat(2, 1fr);
  1186. gap: 16rpx;
  1187. padding: 16rpx;
  1188. }
  1189. .machinery-metric-card {
  1190. background: white;
  1191. border-radius: 16rpx;
  1192. padding: 20rpx;
  1193. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
  1194. border: 1px solid rgba(0, 0, 0, 0.02);
  1195. .machinery-metric-header {
  1196. display: flex;
  1197. align-items: center;
  1198. margin-bottom: 16rpx;
  1199. .icon-tile {
  1200. width: 24rpx;
  1201. height: 24rpx;
  1202. border-radius: 50%;
  1203. display: flex;
  1204. align-items: center;
  1205. justify-content: center;
  1206. margin-right: 10rpx;
  1207. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
  1208. }
  1209. .metric-name {
  1210. font-size: 24rpx;
  1211. color: #8C9396;
  1212. }
  1213. }
  1214. .machinery-metric-value {
  1215. font-size: 44rpx;
  1216. font-weight: 700;
  1217. color: #2C3E50;
  1218. margin-bottom: 12rpx;
  1219. }
  1220. .machinery-metric-trend {
  1221. display: flex;
  1222. align-items: center;
  1223. font-size: 22rpx;
  1224. &.up {
  1225. color: #3BB44A;
  1226. }
  1227. &.down {
  1228. color: #FF5252;
  1229. }
  1230. text {
  1231. margin-left: 4rpx;
  1232. }
  1233. }
  1234. .machinery-metric-unit {
  1235. font-size: 22rpx;
  1236. color: #8C9396;
  1237. }
  1238. }
  1239. }
  1240. </style>