mh-two-thousand-and-two
2024-04-03 29a02350b873fa6339a7535fa929697fec9a8f84
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<template>
    <view  style="height: 100% ;">
        <view class="flex flex-center" style="margin: 20rpx 0;">
            <luanqing-search class="search_bar" @onSearch="onSearch" :buttonText="buttonText" :isSearchTrue="isSearchTrue" :placehold="placehold"></luanqing-search>
            <view class="advancedSea" v-if="isAvancedTrue" @click="isAvancedClick" style="color:#244A7B ;font-size: .12rem;margin-left: .31rem;cursor: pointer;">高级搜索 ﹀</view>
        </view>
        <!-- 高级搜索 -->
        <view class="" v-if="isAdvancedSearch" style="padding: 0 1.24rem; margin-bottom: .18rem;">
            <view style="background-color: #fff;padding: .29rem;" class="">
                <h3>高级搜索</h3>
                <MyForm @submit="onSubmit" :from="from" />
            </view>
        </view>
    </view>
</template>
 
<script>
    import MyForm from '@/components/form/form.vue'
    export default {
        props:{
            isAvancedTrue:{
                type:Boolean,
                default(){
                    return true
                }
            },isSearchTrue:{
                type:Boolean,
                default(){
                    return true
                }
            },buttonText:{
                type:String,
                default(){
                    return '搜索'
                }
            },
            placehold:{
                type:String
            }
        },
        components: {
            MyForm
        },
        name: "advancedSearch",
        data() {
            return {
                // 高级搜索显示
                isAdvancedSearch: false,
                // 高级搜索
                from: {
                    from: [{
                            type: 'input',
                            label: '姓名',
                            name: 'name',
                            value: ''
                        },
                        {
                            type: 'select',
                            label: '性别',
                            value: '',
                            name: 'sex',
                            options: [{
                                    label: '男',
                                    value: '男'
                                },
                                {
                                    label: '女',
                                    value: '女'
                                }
                            ]
                        },
                        {
                            type: 'input',
                            label: '联系',
                            name: 'phone',
                            value: ''
                        },
                        {
                            type: 'input',
                            label: '证件',
                            name: 'idNumber',
                            value: ''
                        },
                        {
                            type: 'select',
                            label: '状态',
                            name: 'state',
                            value: '',
                            options: [{
                                    label: '未申请',
                                    value: '未申请'
                                },
                                {
                                    label: '已申请',
                                    value: '已申请'
                                },
                                {
                                    label: '已删除',
                                    value: '已删除'
                                }
                            ]
                        }
                    ]
                },
 
            };
        },
        methods: {
            isAvancedClick() {
                this.isAdvancedSearch = !this.isAdvancedSearch
                //     this.$nextTick(() => {
 
                //         var box1Height = document.querySelector('.fbox').offsetHeight;
                //         // let box2Height= document.querySelector('.fbox1').style.height = box1Height + 'px';
                //         let box2Height = document.querySelector('.fbox1').offsetHeight
                //         console.log(box1Height, box2Height);
                //         if (box1Height <= box2Height) {
                //             document.querySelector('.fbox1').style.height = box1Height + 'px';
                //         }
                //     })
            },
            onSearch(val) {
                this.$emit('onSearch',val)
                console.log(val);
            },
            onSubmit(val) {
                console.log(val);
            },
        }
    }
</script>
 
<style>
.search_bar{
    width: 5rem;
    height: .36rem;
}
</style>