guoshilong
2023-10-27 2311b03aee9db1bebacdd2ced13c071efda6a011
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
<template>
    <!--搜索页-->
    <view class="container">
        <view class="search">
            <u-search shape="square" focus placeholder="搜索水库" :actionStyle="{color:'#ffffff'}" actionText="取消"
                @custom="cancelSearch" @search="search" v-model="searchKey">
            </u-search>
 
        </view>
        <view>
            <u-cell-group>
                <u-cell @click="goRealtimeMonitor('')" icon="search" title="全部水库"></u-cell>
            </u-cell-group>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                searchKey: ""
            }
        },
        created() {
 
        },
        mounted() {
 
        },
        onLoad(option) {
 
        },
        onShow() {
 
        },
        methods: {
            /**
             * 点击右侧控件时的事件
             * @param {Object} value 输入框的值
             */
            cancelSearch(value) {
                this.$u.func.globalNavigator("", "navBack")
            },
 
            /**
             * 按下enter或搜索键时的方法
             * @param {Object} value 搜索关键字
             */
            search(searchKey) {
                this.goRealtimeMonitor(searchKey)
            },
 
            /**
             * 前往实时监测页面
             */
            goRealtimeMonitor(searchKey) {
                if (searchKey) {
                    let url = "/subPackage/realtimeMonitor/realtimeMonitor/index?searchKey=" + searchKey
                    this.$u.func.globalNavigator(url, "redTo")
                } else {
                    let url = "/subPackage/realtimeMonitor/realtimeMonitor/index?searchKey=" + searchKey
                    this.$u.func.globalNavigator(url, "redTo")
                }
 
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .container {
        min-height: 100vh;
        overflow: hidden;
    }
 
    .search {
        height: 200rpx;
        display: flex;
        background-color: #5887f9;
        padding: 30rpx;
        align-items: flex-end;
    }
</style>