|
|
@@ -0,0 +1,86 @@
|
|
|
+<template>
|
|
|
+ <div class="agri-record-index" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
|
|
|
+ <div class="record-content">
|
|
|
+ <div>天气</div>
|
|
|
+ <div class="record-list">
|
|
|
+ <div class="line-title">农事记录</div>
|
|
|
+ <div class="task-content" v-loading="loading">
|
|
|
+ <div class="task-item" v-for="(item, index) in taskList" :key="item.id || item.workRecordId">
|
|
|
+ <task-item
|
|
|
+ :key="1 + '-' + index"
|
|
|
+ :itemIndex="1"
|
|
|
+ :status="1"
|
|
|
+ :item-data="item"
|
|
|
+ >
|
|
|
+ </task-item>
|
|
|
+ </div>
|
|
|
+ <div class="empty-data" v-if="noData">暂无数据</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, onMounted, computed, onActivated } from "vue";
|
|
|
+import { useStore } from "vuex";
|
|
|
+import taskItem from "@/components/taskItem.vue";
|
|
|
+
|
|
|
+const store = useStore();
|
|
|
+const tabBarHeight = computed(() => store.state.home.tabBarHeight);
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+});
|
|
|
+
|
|
|
+onActivated(() => {
|
|
|
+ getRecordList();
|
|
|
+});
|
|
|
+
|
|
|
+const taskList = ref([]);
|
|
|
+const loading = ref(false);
|
|
|
+const noData = ref(false);
|
|
|
+const getRecordList = () => {
|
|
|
+ const params = {
|
|
|
+ role: 2,
|
|
|
+ flowStatus: 5,
|
|
|
+ includePrescription: true,
|
|
|
+ }
|
|
|
+ VE_API.z_farm_work_record
|
|
|
+ .getSimpleList(params)
|
|
|
+ .then(({ data }) => {
|
|
|
+ loading.value = false;
|
|
|
+ taskList.value = data;
|
|
|
+ if(data.length === 0) {
|
|
|
+ noData.value = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+};
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.agri-record-index {
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px 12px;
|
|
|
+ background: linear-gradient(180deg, #F9F9F9 0%, #F0F8FF 31.47%, #F9F9F9 46.81%, #F9F9F9 69.38%, #F9F9F9 100%);
|
|
|
+ .line-title {
|
|
|
+ padding: 10px 0;
|
|
|
+ position: relative;
|
|
|
+ padding-left: 14px;
|
|
|
+ font-size: 16px;
|
|
|
+ &::before {
|
|
|
+ content: '';
|
|
|
+ position: absolute;
|
|
|
+ left: 5px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ width: 4px;
|
|
|
+ height: 15px;
|
|
|
+ background: #2199f8;
|
|
|
+ border-radius: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|