|
@@ -30,7 +30,9 @@
|
|
|
<div class="left-date">{{ formatDate(fw.createTime) }}</div>
|
|
<div class="left-date">{{ formatDate(fw.createTime) }}</div>
|
|
|
<div class="text">
|
|
<div class="text">
|
|
|
<span class="van-ellipsis">{{ fw.title }}</span>
|
|
<span class="van-ellipsis">{{ fw.title }}</span>
|
|
|
- <el-icon><ArrowRight /></el-icon>
|
|
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <ArrowRight />
|
|
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="farm-info" v-if="fw.work_status === 0">
|
|
<div class="farm-info" v-if="fw.work_status === 0">
|
|
@@ -42,7 +44,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="title-text van-ellipsis">{{ fw.title }}</div>
|
|
<div class="title-text van-ellipsis">{{ fw.title }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="status-right" :style="statusColorObj[fw.work_status]" v-if="fw.work_status !== 3 && fw.work_status !== 5">{{ workStatusObj[fw.work_status] }}</div>
|
|
|
|
|
|
|
+ <div class="status-right" :style="statusColorObj[fw.work_status]"
|
|
|
|
|
+ v-if="fw.work_status !== 3 && fw.work_status !== 5">{{
|
|
|
|
|
+ workStatusObj[fw.work_status] }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -76,16 +80,6 @@ const props = defineProps({
|
|
|
type: [String, Number],
|
|
type: [String, Number],
|
|
|
default: null,
|
|
default: null,
|
|
|
},
|
|
},
|
|
|
- // 区域ID
|
|
|
|
|
- regionId: {
|
|
|
|
|
- type: [Number, String],
|
|
|
|
|
- default: null,
|
|
|
|
|
- },
|
|
|
|
|
- // 类型ID
|
|
|
|
|
- typeId: {
|
|
|
|
|
- type: [Number, String],
|
|
|
|
|
- default: null,
|
|
|
|
|
- },
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const emits = defineEmits(["row-click", "card-click"]);
|
|
const emits = defineEmits(["row-click", "card-click"]);
|
|
@@ -93,7 +87,7 @@ const emits = defineEmits(["row-click", "card-click"]);
|
|
|
const phenologyList = ref([]);
|
|
const phenologyList = ref([]);
|
|
|
const timelineContainerRef = ref(null);
|
|
const timelineContainerRef = ref(null);
|
|
|
const getTimelineScrollKey = () =>
|
|
const getTimelineScrollKey = () =>
|
|
|
- `timelineScrollTop:${props.farmId ?? "none"}:${props.regionId ?? "none"}:${route.path}`;
|
|
|
|
|
|
|
+ `timelineScrollTop:${props.farmId ?? "none"}:${route.path}`;
|
|
|
|
|
|
|
|
const saveTimelineScrollTop = () => {
|
|
const saveTimelineScrollTop = () => {
|
|
|
if (!timelineContainerRef.value) return;
|
|
if (!timelineContainerRef.value) return;
|
|
@@ -131,8 +125,7 @@ const isRequesting = ref(false);
|
|
|
// 记录上一次请求作用域,避免相同参数重复请求
|
|
// 记录上一次请求作用域,避免相同参数重复请求
|
|
|
const lastRequestedFarmId = ref(null);
|
|
const lastRequestedFarmId = ref(null);
|
|
|
|
|
|
|
|
-const farmWorkPlanScopeKey = () =>
|
|
|
|
|
- JSON.stringify([props.farmId ?? null, props.regionId ?? null]);
|
|
|
|
|
|
|
+const farmWorkPlanScopeKey = () => JSON.stringify([props.farmId ?? null]);
|
|
|
|
|
|
|
|
const resetTimelineData = () => {
|
|
const resetTimelineData = () => {
|
|
|
phenologyList.value = [];
|
|
phenologyList.value = [];
|
|
@@ -272,11 +265,11 @@ const normalizeFarmWorksPhenologyList = (data) => {
|
|
|
const startDate =
|
|
const startDate =
|
|
|
!Number.isNaN(minMs) && minMs > 0
|
|
!Number.isNaN(minMs) && minMs > 0
|
|
|
? (() => {
|
|
? (() => {
|
|
|
- const d = new Date(minMs);
|
|
|
|
|
- const m = `${d.getMonth() + 1}`.padStart(2, "0");
|
|
|
|
|
- const day = `${d.getDate()}`.padStart(2, "0");
|
|
|
|
|
- return `${d.getFullYear()}-${m}-${day}`;
|
|
|
|
|
- })()
|
|
|
|
|
|
|
+ const d = new Date(minMs);
|
|
|
|
|
+ const m = `${d.getMonth() + 1}`.padStart(2, "0");
|
|
|
|
|
+ const day = `${d.getDate()}`.padStart(2, "0");
|
|
|
|
|
+ return `${d.getFullYear()}-${m}-${day}`;
|
|
|
|
|
+ })()
|
|
|
: null;
|
|
: null;
|
|
|
return {
|
|
return {
|
|
|
id: stage.id ?? works[0]?.phenology_code ?? `phenology-${idx}`,
|
|
id: stage.id ?? works[0]?.phenology_code ?? `phenology-${idx}`,
|
|
@@ -321,11 +314,8 @@ const getFarmWorkPlan = () => {
|
|
|
|
|
|
|
|
const params = {
|
|
const params = {
|
|
|
farm_id: 195,
|
|
farm_id: 195,
|
|
|
- crop_variety:1
|
|
|
|
|
|
|
+ crop_variety: 1,
|
|
|
};
|
|
};
|
|
|
- if (props.typeId != null && props.typeId !== "") {
|
|
|
|
|
- params.crop_variety = props.typeId;
|
|
|
|
|
- }
|
|
|
|
|
VE_API.monitor.getPhenologyList(params)
|
|
VE_API.monitor.getPhenologyList(params)
|
|
|
.then(({ data, code }) => {
|
|
.then(({ data, code }) => {
|
|
|
const ok = code === 200 || code === 0;
|
|
const ok = code === 200 || code === 0;
|
|
@@ -353,12 +343,10 @@ const updateFarmWorkPlan = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
watch(
|
|
watch(
|
|
|
- () => [props.farmId, props.regionId],
|
|
|
|
|
|
|
+ () => props.farmId,
|
|
|
(val, oldVal) => {
|
|
(val, oldVal) => {
|
|
|
if (!props.farmId) return;
|
|
if (!props.farmId) return;
|
|
|
- const changed =
|
|
|
|
|
- !oldVal ||
|
|
|
|
|
- val.some((item, index) => item !== oldVal[index]);
|
|
|
|
|
|
|
+ const changed = oldVal == null || val !== oldVal;
|
|
|
if (changed) {
|
|
if (changed) {
|
|
|
lastRequestedFarmId.value = null;
|
|
lastRequestedFarmId.value = null;
|
|
|
}
|
|
}
|
|
@@ -383,7 +371,6 @@ const handleStatusDetail = (fw) => {
|
|
|
farmWorkLibId: '832268348690534411',
|
|
farmWorkLibId: '832268348690534411',
|
|
|
recordId: "832268363366404096",
|
|
recordId: "832268363366404096",
|
|
|
reproductiveId: 149,
|
|
reproductiveId: 149,
|
|
|
- typeId: props.typeId
|
|
|
|
|
}),
|
|
}),
|
|
|
}),
|
|
}),
|
|
|
},
|
|
},
|
|
@@ -444,8 +431,9 @@ onBeforeRouteLeave(() => {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
-@mixin arrange-card-status($color, $content-color: null,$border-color: null, $content-bg: null, $text-color: null) {
|
|
|
|
|
|
|
+@mixin arrange-card-status($color, $content-color: null, $border-color: null, $content-bg: null, $text-color: null) {
|
|
|
border-color: $color;
|
|
border-color: $color;
|
|
|
|
|
+
|
|
|
@if $content-bg !=null {
|
|
@if $content-bg !=null {
|
|
|
background: $content-bg;
|
|
background: $content-bg;
|
|
|
}
|
|
}
|
|
@@ -516,7 +504,7 @@ onBeforeRouteLeave(() => {
|
|
|
z-index: 10;
|
|
z-index: 10;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
|
|
|
|
+ align-items: baseline;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
writing-mode: vertical-rl;
|
|
writing-mode: vertical-rl;
|
|
|
text-orientation: upright;
|
|
text-orientation: upright;
|
|
@@ -556,6 +544,10 @@ onBeforeRouteLeave(() => {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
writing-mode: vertical-rl;
|
|
writing-mode: vertical-rl;
|
|
|
text-orientation: upright;
|
|
text-orientation: upright;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
|
|
|
|
|
|
|
|
&.phenology-red {
|
|
&.phenology-red {
|
|
@@ -589,6 +581,7 @@ onBeforeRouteLeave(() => {
|
|
|
padding: 8px 15px 8px 10px;
|
|
padding: 8px 15px 8px 10px;
|
|
|
writing-mode: horizontal-tb;
|
|
writing-mode: horizontal-tb;
|
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
|
|
|
+
|
|
|
.card-content {
|
|
.card-content {
|
|
|
color: #242424;
|
|
color: #242424;
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -635,6 +628,7 @@ onBeforeRouteLeave(() => {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
border: 0.5px solid rgba(0, 0, 0, 0.4);
|
|
border: 0.5px solid rgba(0, 0, 0, 0.4);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.farm-info {
|
|
.farm-info {
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
color: #626262;
|
|
color: #626262;
|
|
@@ -646,7 +640,7 @@ onBeforeRouteLeave(() => {
|
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
|
text-align: left;
|
|
text-align: left;
|
|
|
margin-top: 6px;
|
|
margin-top: 6px;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
.info-right {
|
|
.info-right {
|
|
|
background: #FF953D;
|
|
background: #FF953D;
|
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
@@ -683,11 +677,11 @@ onBeforeRouteLeave(() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-normal {
|
|
.arrange-card.status-normal {
|
|
|
- @include arrange-card-status(#2199F8, null, #2199F8, null,#000);
|
|
|
|
|
|
|
+ @include arrange-card-status(#2199F8, null, #2199F8, null, #000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-green-info {
|
|
.arrange-card.status-green-info {
|
|
|
- @include arrange-card-status(#4ABF32, #ECFFE8, rgba(74, 191, 50, 0.5),rgba(28, 169, 0, 0.1),rgba(0, 0, 0, 0.4));
|
|
|
|
|
|
|
+ @include arrange-card-status(#4ABF32, #ECFFE8, rgba(74, 191, 50, 0.5), rgba(28, 169, 0, 0.1), rgba(0, 0, 0, 0.4));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-orange {
|
|
.arrange-card.status-orange {
|