mh-two-thousand-and-two
2024-04-12 abdded451d7afb1922417ee4c937c531babc6bdb
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<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="advancedSeaTrue" 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
            },
            from: {
                type: Object,
                default () {
                    return {
                        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: '已删除'
                                    }
                                ]
                            }
                        ]
                    }
                }
            }
        },
        components: {
            MyForm
        },
        name: "advancedSearch",
        data() {
            return {
                // 高级搜索显示
                isAdvancedSearch: false,
                // 高级搜索
                
 
            };
        },
        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>
    .advancedSeaTrue,
    .zhushuju {
        padding: 0 1.24rem !important;
    }
 
    .advancedSeaTrue1 {
        padding: .08rem .19rem !important;
        font-size: .14rem !important;
    }
 
    /* Form组件里面的样式 */
    ::v-deep .el-row {
        display: flex;
        flex-wrap: wrap;
        margin-top: .1rem !important;
    }
 
    ::v-deep .el-form-item {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-bottom: .18rem !important;
    }
 
    ::v-deep .el-form-item__label {
        font-size: .14rem !important;
        height: .3rem !important;
        display: flex !important;
        align-items: center !important;
    }
 
    ::v-deep .el-input__inner {
        font-size: .14rem !important;
        height: .3rem !important;
    }
 
    ::v-deep .Formbtn {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
 
        .el-button {
            width: .7rem !important;
            height: .3rem !important;
            font-size: .12rem;
 
        }
    }
 
    .search_bar {
        width: 5rem;
        height: .36rem;
    }
</style>