|
@@ -3,7 +3,7 @@
|
|
|
<div class="plan-menu">
|
|
<div class="plan-menu">
|
|
|
<el-anchor :container="containerRef" direction="vertical" type="default" @click="handleClick">
|
|
<el-anchor :container="containerRef" direction="vertical" type="default" @click="handleClick">
|
|
|
<el-menu :default-active="defaultActive" class="el-menu-vertical-demo">
|
|
<el-menu :default-active="defaultActive" class="el-menu-vertical-demo">
|
|
|
- <el-sub-menu v-for="(menu, index) in menuData" :key="index" :index="String(menu.id)">
|
|
|
|
|
|
|
+ <el-sub-menu v-for="(menu, index) in menuData" :key="index" :index="String(menu.phenologyId)">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<img class="menu-icon" :src="require(`@/assets/img/gallery/icon-${index}.png`)" />
|
|
<img class="menu-icon" :src="require(`@/assets/img/gallery/icon-${index}.png`)" />
|
|
|
<span class="menu-text">{{ menu.phenologyName }}</span>
|
|
<span class="menu-text">{{ menu.phenologyName }}</span>
|
|
@@ -31,7 +31,7 @@
|
|
|
:key="index + '-' + subI"
|
|
:key="index + '-' + subI"
|
|
|
>
|
|
>
|
|
|
<div class="section-id" :id="section.phenologyName + sub.name"></div>
|
|
<div class="section-id" :id="section.phenologyName + sub.name"></div>
|
|
|
- <record-item :record-item-data="sub">
|
|
|
|
|
|
|
+ <record-item :record-item-data="sub" @click="handleEdit(sub)">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<div class="box-title">
|
|
<div class="box-title">
|
|
|
<div class="title-l">
|
|
<div class="title-l">
|
|
@@ -52,13 +52,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
|
|
+import { ref, onMounted, watch } from "vue";
|
|
|
import recordItem from "@/components/recordItem.vue";
|
|
import recordItem from "@/components/recordItem.vue";
|
|
|
|
|
+import { useRouter } from "vue-router";
|
|
|
|
|
+
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
farmId: {
|
|
farmId: {
|
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
|
- required: true,
|
|
|
|
|
|
|
+ default: null,
|
|
|
},
|
|
},
|
|
|
isEdit: {
|
|
isEdit: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -68,6 +71,10 @@ const props = defineProps({
|
|
|
type: String,
|
|
type: String,
|
|
|
default: "1-1",
|
|
default: "1-1",
|
|
|
},
|
|
},
|
|
|
|
|
+ schemeId : {
|
|
|
|
|
+ type: [Number, String],
|
|
|
|
|
+ default: null,
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const curRole = localStorage.getItem("SET_USER_CUR_ROLE")
|
|
const curRole = localStorage.getItem("SET_USER_CUR_ROLE")
|
|
@@ -90,10 +97,30 @@ const getFarmTypeText = (type) => {
|
|
|
return "";
|
|
return "";
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleEdit = (sub) => {
|
|
|
|
|
+ if(curRole == 2){
|
|
|
|
|
+ router.push(`/edit_plan?id=${sub.id}`);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getPlanWorkList();
|
|
|
|
|
|
|
+ if(props.farmId){
|
|
|
|
|
+ getPlanWorkList();
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+watch(() => props.schemeId, (newVal) => {
|
|
|
|
|
+ if(newVal){
|
|
|
|
|
+ getListBySchemeId();
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const getListBySchemeId = () => {
|
|
|
|
|
+ VE_API.home.listBySchemeId({ schemeId: props.schemeId }).then(({ data }) => {
|
|
|
|
|
+ menuData.value = data;
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleClick = (e) => {
|
|
const handleClick = (e) => {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
};
|
|
};
|
|
@@ -207,6 +234,7 @@ const handleClick = (e) => {
|
|
|
.box-title {
|
|
.box-title {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
padding-bottom: 8px;
|
|
padding-bottom: 8px;
|
|
|
border-bottom: 1px solid #f5f5f5;
|
|
border-bottom: 1px solid #f5f5f5;
|
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|