index.vue 35 KB

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