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/SearchBar.vue | 78 +++++++++++++++++++--------------------
1 files changed, 38 insertions(+), 40 deletions(-)
diff --git a/src/components/SearchBar.vue b/src/components/SearchBar.vue
index 19f48c3..ab18188 100644
--- a/src/components/SearchBar.vue
+++ b/src/components/SearchBar.vue
@@ -1,24 +1,16 @@
<template>
<el-row class="layout">
- <el-col :span="$slots.summary ? 10 : 24">
+ <el-col :span="$slots.summary ? 14 : 24">
<el-form :inline="true" :model="formSearch">
<el-form-item label="鎬讳换鍔�">
<!-- <el-input v-model="formSearch.topTaskId" placeholder="鎬讳换鍔�" /> -->
- <el-select
- v-model="formSearch.topTaskId"
- placeholder="鎬讳换鍔�"
- style="width: 260px"
- >
- <el-option
- v-for="s in topTasks"
- :key="s.value"
- :label="s.label"
- :value="s.value"
- />
+ <el-select v-model="formSearch.topTaskId" placeholder="鎬讳换鍔�" style="width: 260px">
+ <el-option v-for="s in topTasks" :key="s.value" :label="s.label" :value="s.value" />
</el-select>
</el-form-item>
<FYOptionScene
:allOption="false"
+ :init-value="false"
:type="2"
v-model:value="formSearch.scenetype"
></FYOptionScene>
@@ -27,7 +19,7 @@
</el-form-item>
</el-form>
</el-col>
- <el-col :span="$slots.summary ? 14 : 0">
+ <el-col :span="$slots.summary ? 10 : 0">
<el-row justify="end">
<slot name="summary"></slot>
</el-row>
@@ -36,19 +28,20 @@
</template>
<script>
-import taskApi from '@/api/fysp/taskApi';
+import taskApi from '@/api/fysp/taskApi'
+import dayjs from 'dayjs'
export default {
emits: ['onSubmit'],
props: {
btnShow: {
type: Boolean,
- default: true
+ default: true,
},
init: {
type: Boolean,
- default: true
- }
+ default: true,
+ },
},
data() {
@@ -56,48 +49,53 @@
topTasks: [],
formSearch: {
topTaskId: '',
- scenetype: ''
- }
- };
+ scenetype: {
+ label: '椁愰ギ',
+ value: '5',
+ },
+ },
+ }
},
methods: {
//鑾峰彇鏌ヨ鏉′欢
getOptions() {
taskApi.getTopTask().then((res) => {
- const list = res.map((r) => {
- return {
- value: r.tguid,
- label: r.name,
- data: r
- };
- });
- this.topTasks = list;
- this.formSearch.topTaskId = list[0].value;
+ const list = res
+ .filter((e) => {
+ return e.districtname == '寰愭眹鍖�' && dayjs(e.starttime).isBefore(dayjs('2025-12-31'))
+ })
+ .map((r) => {
+ return {
+ value: r.tguid,
+ label: r.name,
+ data: r,
+ }
+ })
+ this.topTasks = list
+ this.formSearch.topTaskId = list[0].value
if (this.init) {
- this.onSubmit();
+ this.onSubmit()
}
- });
+ })
},
//鏌ヨ瀛愪换鍔$粺璁′俊鎭�
onSubmit() {
- const task = this.topTasks.find(
- (t) => t.data.tguid == this.formSearch.topTaskId
- );
+ const task = this.topTasks.find((t) => t.data.tguid == this.formSearch.topTaskId)
const param = {
topTask: task ? task.data : {},
sceneTypeId: this.formSearch.scenetype.value,
sceneTypeName: this.formSearch.scenetype.label,
- };
+ }
// console.log(param);
- this.$emit('onSubmit', param);
- }
+ this.$emit('onSubmit', param)
+ },
},
mounted() {
- this.getOptions();
+ this.getOptions()
},
- expose: ['onSubmit']
-};
+ expose: ['onSubmit'],
+}
</script>
<style scoped>
--
Gitblit v1.9.3