"use strict"; const common_vendor = require("../../common/vendor.js"); if (!Array) { const _component_u_icon = common_vendor.resolveComponent("u-icon"); const _component_circle = common_vendor.resolveComponent("circle"); const _component_path = common_vendor.resolveComponent("path"); const _component_svg = common_vendor.resolveComponent("svg"); const _component_line = common_vendor.resolveComponent("line"); (_component_u_icon + _component_circle + _component_path + _component_svg + _component_line)(); } const _sfc_main = { __name: "index", setup(__props) { const userData = common_vendor.ref({ nickname: "张三", selectedPlot: "南地块" }); const showPlotSelector = common_vendor.ref(false); common_vendor.ref([ { name: "南地块", id: 1 }, { name: "西北区域", id: 2 }, { name: "稻田", id: 3 }, { name: "东区试验田", id: 4 }, { name: "温室大棚", id: 5 } ]); const farmData = common_vendor.ref({ plotCount: 5, deviceCount: 12, deviceOnlineRate: 85, taskCompletionRate: 76, recentActivities: [ { title: "稻田水稻施肥", date: "2023-05-15", status: "pending", id: 1, executor: "李四" }, { title: "南地块除草", date: "2023-05-12", status: "completed", id: 2, executor: "王五" }, { title: "西北区域杀虫", date: "2023-05-08", status: "completed", id: 3, executor: "张三" } ] }); const coreStats = common_vendor.computed(() => [ { label: "地块总数", value: farmData.value.plotCount, icon: "map", bgColor: "linear-gradient(135deg, #4CAF50, #2E7D32)" }, { label: "设备数量", value: farmData.value.deviceCount, icon: "setting", bgColor: "linear-gradient(135deg, #42A5F5, #1976D2)" }, { label: "设备在线率", value: farmData.value.deviceOnlineRate + "%", icon: "wifi", bgColor: "linear-gradient(135deg, #26C6DA, #00838F)" }, { label: "农事完成率", value: farmData.value.taskCompletionRate + "%", icon: "checkmark-circle", bgColor: "linear-gradient(135deg, #66BB6A, #388E3C)" } ]); const weatherData = common_vendor.ref({ temperature: 28, description: "晴朗", humidity: 65, windLevel: 3, rainfall: 0, advice: "今日适宜进行春玉米防虫作业,注意水分管理。" }); common_vendor.ref({ operation: { workCount: 36, workArea: 128, mainCrops: ["小麦", "玉米"] }, machine: { totalHours: 172, mainEquipment: ["无人拖拉机", "播种机"] }, irrigation: { irrigationArea: 85, fertilizationCount: 12, waterUsage: 230 }, pest: { totalReports: 5, handled: 4, pending: 1 } }); const navigateToProfile = () => { common_vendor.index.navigateTo({ url: "/pages/profile/index" }); }; const handleSwitchPlot = () => { showPlotSelector.value = true; }; const navigateToActivity = (activity) => { common_vendor.index.navigateTo({ url: `/pages/activity/detail?id=${activity.id}` }); }; const navigateToAllActivities = () => { common_vendor.index.navigateTo({ url: "/pages/activity/list" }); }; const fetchStatsData = async () => { try { common_vendor.index.__f__("log", "at pages/dashboard/index.vue:429", "统计数据加载成功"); } catch (error) { common_vendor.index.__f__("error", "at pages/dashboard/index.vue:431", "获取统计数据失败", error); common_vendor.index.showToast({ title: "数据加载失败", icon: "none" }); } }; common_vendor.onMounted(() => { fetchStatsData(); }); return (_ctx, _cache) => { return { a: common_vendor.t(userData.value.nickname), b: common_vendor.t(userData.value.selectedPlot), c: common_vendor.p({ name: "arrow-down-fill", color: "#ffffff", size: "14" }), d: common_vendor.o(handleSwitchPlot), e: common_vendor.p({ cx: "45", cy: "45", r: "45", fill: "#E1F5E9" }), f: common_vendor.p({ d: "M15 35C15 35 25 25 35 35C45 45 65 25 75 35", stroke: "#4CAF50", ["stroke-width"]: "2", ["stroke-opacity"]: "0.3" }), g: common_vendor.p({ d: "M20 30L20 40", stroke: "#4CAF50", ["stroke-width"]: "2", ["stroke-opacity"]: "0.3" }), h: common_vendor.p({ d: "M35 30L35 45", stroke: "#4CAF50", ["stroke-width"]: "2", ["stroke-opacity"]: "0.3" }), i: common_vendor.p({ d: "M50 30L50 40", stroke: "#4CAF50", ["stroke-width"]: "2", ["stroke-opacity"]: "0.3" }), j: common_vendor.p({ d: "M65 30L65 45", stroke: "#4CAF50", ["stroke-width"]: "2", ["stroke-opacity"]: "0.3" }), k: common_vendor.p({ cx: "45", cy: "35", r: "15", fill: "#4CAF50" }), l: common_vendor.p({ d: "M25 82C25 67 34 55 45 55C56 55 65 67 65 82H25Z", fill: "#4CAF50" }), m: common_vendor.p({ d: "M25 30C25 30 35 20 45 20C55 20 65 30 65 30C65 30 55 25 45 25C35 25 25 30 25 30Z", fill: "#8BC34A" }), n: common_vendor.p({ cx: "38", cy: "32", r: "2", fill: "white", ["fill-opacity"]: "0.7" }), o: common_vendor.p({ cx: "52", cy: "32", r: "2", fill: "white", ["fill-opacity"]: "0.7" }), p: common_vendor.p({ d: "M40 40C40 40 43 42 45 42C47 42 50 40 50 40", stroke: "white", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), q: common_vendor.p({ d: "M70 15C70 15 75 20 75 25", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), r: common_vendor.p({ d: "M73 18L77 20", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), s: common_vendor.p({ d: "M72 22L76 24", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), t: common_vendor.p({ d: "M20 15C20 15 15 20 15 25", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), v: common_vendor.p({ d: "M17 18L13 20", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), w: common_vendor.p({ d: "M18 22L14 24", stroke: "#8BC34A", ["stroke-width"]: "1.5", ["stroke-linecap"]: "round" }), x: common_vendor.p({ width: "100%", height: "100%", viewBox: "0 0 90 90", fill: "none", xmlns: "http://www.w3.org/2000/svg" }), y: common_vendor.o(navigateToProfile), z: common_vendor.f(coreStats.value, (stat, index, i0) => { return { a: common_vendor.t(stat.value), b: common_vendor.t(stat.label), c: index }; }), A: common_vendor.p({ name: "arrow-right", color: "#4CAF50", size: "14" }), B: common_vendor.o(navigateToAllActivities), C: common_vendor.f(farmData.value.recentActivities, (item, index, i0) => { return { a: common_vendor.t(item.title), b: common_vendor.t(item.executor), c: common_vendor.t(item.date), d: "a869e244-21-" + i0, e: index, f: common_vendor.o(($event) => navigateToActivity(item), index) }; }), D: common_vendor.p({ name: "arrow-right", color: "#CCCCCC", size: "16" }), E: common_vendor.p({ cx: "100", cy: "100", r: "65", fill: "rgba(255, 193, 7, 0.1)" }), F: common_vendor.p({ cx: "100", cy: "100", r: "45", fill: "#FFC107" }), G: common_vendor.p({ x1: "100", y1: "25", x2: "100", y2: "5", stroke: "#FFC107", ["stroke-width"]: "8", ["stroke-linecap"]: "round" }), H: common_vendor.p({ x1: "100", y1: "195", x2: "100", y2: "175", stroke: "#FFC107", ["stroke-width"]: "8", ["stroke-linecap"]: "round" }), I: common_vendor.p({ x1: "25", y1: "100", x2: "5", y2: "100", stroke: "#FFC107", ["stroke-width"]: "8", ["stroke-linecap"]: "round" }), J: common_vendor.p({ x1: "195", y1: "100", x2: "175", y2: "100", stroke: "#FFC107", ["stroke-width"]: "8", ["stroke-linecap"]: "round" }), K: common_vendor.p({ cx: "100", cy: "100", r: "35", fill: "#FF9800" }), L: common_vendor.p({ width: "48", height: "48", viewBox: "0 0 200 200", fill: "none", xmlns: "http://www.w3.org/2000/svg" }), M: common_vendor.t(weatherData.value.temperature), N: common_vendor.t(weatherData.value.description), O: common_vendor.p({ name: "account", color: "#666666", size: "32" }), P: common_vendor.t(weatherData.value.advice), Q: common_vendor.t(weatherData.value.humidity), R: common_vendor.t(weatherData.value.windLevel), S: common_vendor.t(weatherData.value.rainfall) }; }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-a869e244"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/dashboard/index.js.map