From ccc970e575ef3f3e5c67af8da210263f4ac549f9 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 10 四月 2026 16:44:55 +0800
Subject: [PATCH] 2026.4.10
---
src/components/search-option/FYOptionTopTask.vue | 80 +++++++++++++++++++---------------------
1 files changed, 38 insertions(+), 42 deletions(-)
diff --git a/src/components/search-option/FYOptionTopTask.vue b/src/components/search-option/FYOptionTopTask.vue
index 1005c96..a20967d 100644
--- a/src/components/search-option/FYOptionTopTask.vue
+++ b/src/components/search-option/FYOptionTopTask.vue
@@ -6,76 +6,68 @@
:placeholder="label"
style="width: 260px"
>
- <el-option
- v-for="s in filtedBeforeTask"
- :key="s.value"
- :label="s.label"
- :value="s.value"
- />
+ <el-option v-for="s in filtedBeforeTask" :key="s.value" :label="s.label" :value="s.value" />
</el-select>
</el-form-item>
</template>
<script>
-import taskApi from '@/api/fysp/taskApi';
+import taskApi from '@/api/fysp/taskApi'
+import dayjs from 'dayjs'
export default {
props: {
label: {
type: String,
- default: '鎬讳换鍔�'
+ default: '鎬讳换鍔�',
},
// 杩斿洖缁撴灉
value: Object,
// 鏄惁榛樿杩斿洖鍒濆閫夐」
initValue: {
type: Boolean,
- default: true
+ default: true,
},
// form琛ㄥ崟缁戝畾灞炴�у悕
prop: {
type: String,
- default: 'topTaskId'
+ default: 'topTaskId',
},
// 閫夐」绛涢�夋潯浠讹紝绛涢�夋煇浠诲姟涔嬪墠鐨勭浉鍚岃鏀垮尯鍒掑唴鐨勪换鍔�
beforeTask: {
type: Object,
default: () => {
- return {};
- }
- }
+ return {}
+ },
+ },
},
emits: ['update:value'],
data() {
return {
selected: {},
- topTasks: []
- };
+ topTasks: [],
+ }
},
computed: {
// 閫夋嫨妗嗕腑浣跨敤椤跺眰浠诲姟id浣滀负閫夐」鍊�
formatedValue() {
- return this.value?.tguid;
+ return this.value?.tguid
},
// 鏌愪换鍔′箣鍓嶇殑鐩稿悓琛屾斂鍖哄垝鍐呯殑浠诲姟
filtedBeforeTask() {
const filteredTasks = this.topTasks.filter((t) => {
return (
- (!this.beforeTask.provincecode ||
- this.beforeTask.provincecode == t.data.provincecode) &&
- (!this.beforeTask.citycode ||
- this.beforeTask.citycode == t.data.citycode) &&
- (!this.beforeTask.districtcode ||
- this.beforeTask.districtcode == t.data.districtcode) &&
- (!this.beforeTask.starttime ||
- t.data.starttime < this.beforeTask.starttime)
- );
- });
+ (!this.beforeTask.provincecode || this.beforeTask.provincecode == t.data.provincecode) &&
+ (!this.beforeTask.citycode || this.beforeTask.citycode == t.data.citycode) &&
+ (!this.beforeTask.districtcode || this.beforeTask.districtcode == t.data.districtcode) &&
+ (!this.beforeTask.starttime || t.data.starttime < this.beforeTask.starttime)
+ )
+ })
if (filteredTasks.length > 0) {
- this.handleChange(filteredTasks[0]?.value);
+ this.handleChange(filteredTasks[0]?.value)
}
- return filteredTasks;
- }
+ return filteredTasks
+ },
},
methods: {
//鑾峰彇鏌ヨ鏉′欢
@@ -85,25 +77,29 @@
return {
value: r.tguid,
label: r.name,
- data: r
- };
- });
- this.topTasks = list;
+ data: r,
+ }
+ })
+ this.topTasks = list.filter((e) => {
+ return (
+ e.data.districtname == '寰愭眹鍖�' && dayjs(e.data.starttime).isBefore(dayjs('2025-12-31'))
+ )
+ })
if (this.initValue) {
- this.handleChange(list[0].value);
+ this.handleChange(list[0].value)
}
- });
+ })
},
//鏌ヨ瀛愪换鍔$粺璁′俊鎭�
handleChange(value) {
- const task = this.topTasks.find((t) => t.data.tguid == value);
- const param = task ? task.data : {};
+ const task = this.topTasks.find((t) => t.data.tguid == value)
+ const param = task ? task.data : {}
- this.$emit('update:value', param);
- }
+ this.$emit('update:value', param)
+ },
},
mounted() {
- this.getOptions();
- }
-};
+ this.getOptions()
+ },
+}
</script>
--
Gitblit v1.9.3