|
|
@@ -0,0 +1,217 @@
|
|
|
+<template>
|
|
|
+ <div class="crop-record-page">
|
|
|
+ <custom-header name="作物档案"></custom-header>
|
|
|
+ <div class="farm-work-timeline">
|
|
|
+ <div
|
|
|
+ class="farm-work-item"
|
|
|
+ v-for="(item, index) in farmWorkData"
|
|
|
+ :key="item.time"
|
|
|
+ :class="{ 'is-estimated': index === farmWorkData.length - 1 }"
|
|
|
+ >
|
|
|
+ <div class="timeline-left">
|
|
|
+ <div class="timeline-dot"></div>
|
|
|
+ <div class="timeline-line"></div>
|
|
|
+ </div>
|
|
|
+ <div class="timeline-right">
|
|
|
+ <div class="farm-work-card" :class="['card-' + item.recordType, { 'is-future': item.isFuture }]">
|
|
|
+ <div class="type-box">{{ getRecordTypeText(item.recordType) }}</div>
|
|
|
+ <div class="farm-work-date">{{ item.time }}</div>
|
|
|
+ <div class="farm-work-desc">
|
|
|
+ <span class="farm-work-action">{{ item.action }}</span>
|
|
|
+ <span class="farm-work-content">{{ item.content }}</span>
|
|
|
+ <span>{{ item.text }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import CustomHeader from '@/components/customHeader.vue';
|
|
|
+import { ref, onMounted } from 'vue';
|
|
|
+
|
|
|
+const cropRecordList = ref([]);
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getFarmWorkList();
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+const farmWorkData = ref([]);
|
|
|
+const typeObj = {
|
|
|
+ 1: '物候进程',
|
|
|
+ 2: '农事',
|
|
|
+ 3: '异常',
|
|
|
+}
|
|
|
+
|
|
|
+const getRecordTypeText = (recordType) => {
|
|
|
+ return typeObj[recordType];
|
|
|
+}
|
|
|
+const getFarmWorkList = () => {
|
|
|
+ // VE_API.user.getFarmWorkList(paramsPage.value).then(({ data }) => {
|
|
|
+ // if (data && data.length > 0) {
|
|
|
+ // farmWorkData.value = data[0] || {};
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ farmWorkData.value = [
|
|
|
+ {
|
|
|
+ time: "8/8",
|
|
|
+ action: "进入",
|
|
|
+ content: "花芽分化期",
|
|
|
+ recordType: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: "8/1",
|
|
|
+ action: "做了",
|
|
|
+ content: "杀虫",
|
|
|
+ text: "农事",
|
|
|
+ recordType: 2,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: "7/30",
|
|
|
+ action: "出现",
|
|
|
+ content: "蒂蛀虫",
|
|
|
+ recordType: 3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ time: "7/25",
|
|
|
+ action: "预计进入",
|
|
|
+ content: "果实膨大期",
|
|
|
+ isFuture: true,
|
|
|
+ recordType: 1,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+};
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.crop-record-page {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 100vh;
|
|
|
+ background: #F5F7FB;
|
|
|
+
|
|
|
+
|
|
|
+ .farm-work-timeline {
|
|
|
+ padding: 12px;
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ .farm-work-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ position: relative;
|
|
|
+ &:not(:last-child) {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .timeline-left {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ margin-right: 12px;
|
|
|
+ position: relative;
|
|
|
+ .timeline-dot {
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+ border-radius: 50%;
|
|
|
+ border: 1px solid #2199f8;
|
|
|
+ flex-shrink: 0;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+ .timeline-line {
|
|
|
+ width: 1px;
|
|
|
+ height: 48px;
|
|
|
+ background: #e5e6eb;
|
|
|
+ position: absolute;
|
|
|
+ top: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .timeline-right {
|
|
|
+ flex: 1;
|
|
|
+ .farm-work-card {
|
|
|
+ border: 1px solid #8bccff;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #f8fcff;
|
|
|
+ padding: 12px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #1d2129;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 22px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ &.card-1 {
|
|
|
+ border: 1px solid #8BCCFF;
|
|
|
+ .type-box {
|
|
|
+ background: #2199F8;
|
|
|
+ }
|
|
|
+ .farm-work-content {
|
|
|
+ color: #2199F8;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.card-2 {
|
|
|
+ border: 1px solid #FFBB83;
|
|
|
+ .type-box {
|
|
|
+ background: #FF953D;
|
|
|
+ }
|
|
|
+ .farm-work-content {
|
|
|
+ color: #FF953D;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.card-3 {
|
|
|
+ border: 1px solid #FF9C9C;
|
|
|
+ .type-box {
|
|
|
+ background: #FD7676;
|
|
|
+ }
|
|
|
+ .farm-work-content {
|
|
|
+ color: #FD7676;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.is-future {
|
|
|
+ // opacity: 0.5;
|
|
|
+ background: rgba(246, 250, 255, 0.5);
|
|
|
+ .type-box {
|
|
|
+ background: rgba(33, 153, 248, 0.5);
|
|
|
+ }
|
|
|
+ .farm-work-content {
|
|
|
+ color: rgba(29, 33, 41, 0.5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .type-box {
|
|
|
+ margin-right: 12px;
|
|
|
+ padding: 0 5px;
|
|
|
+ height: 20px;
|
|
|
+ line-height: 20px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 0 4px 0 4px;
|
|
|
+ }
|
|
|
+ .farm-work-date {
|
|
|
+ padding-right: 4px;
|
|
|
+ }
|
|
|
+ .farm-work-desc {
|
|
|
+ .farm-work-action {
|
|
|
+ padding-right: 4px;
|
|
|
+ }
|
|
|
+ .farm-work-content {
|
|
|
+ padding-right: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &.is-estimated {
|
|
|
+ .timeline-right {
|
|
|
+ .farm-work-card {
|
|
|
+ background: rgba(246, 250, 255, 0.5);
|
|
|
+ border: 1px solid rgba(190, 218, 255, 0.5);
|
|
|
+ .farm-work-date,
|
|
|
+ .farm-work-desc {
|
|
|
+ color: rgba(29, 33, 41, 0.5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|