1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
| <template>
| <el-row class="layout">
| <el-col :span="$slots.summary ? 10 : 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>
| </el-form-item>
| <FYOptionScene
| :allOption="false"
| :type="2"
| v-model:value="formSearch.scenetype"
| ></FYOptionScene>
| <el-form-item v-show="btnShow">
| <el-button type="primary" @click="onSubmit">查询</el-button>
| </el-form-item>
| </el-form>
| </el-col>
| <el-col :span="$slots.summary ? 14 : 0">
| <el-row justify="end">
| <slot name="summary"></slot>
| </el-row>
| </el-col>
| </el-row>
| </template>
|
| <script>
| import taskApi from '@/api/fysp/taskApi';
|
| export default {
| emits: ['onSubmit'],
| props: {
| btnShow: {
| type: Boolean,
| default: true
| },
| init: {
| type: Boolean,
| default: true
| }
| },
|
| data() {
| return {
| topTasks: [],
| formSearch: {
| topTaskId: '',
| scenetype: ''
| }
| };
| },
| 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;
| if (this.init) {
| this.onSubmit();
| }
| });
| },
| //查询子任务统计信息
| onSubmit() {
| 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);
| }
| },
| mounted() {
| this.getOptions();
| },
| expose: ['onSubmit']
| };
| </script>
|
| <style scoped>
| /* .layout {
| background-color: aqua;
| } */
| </style>
|
|