mh-two-thousand-and-two
2024-03-29 d27fbd63d7840787d7f3ca5333b6e24dc3a860d4
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<template>
    <view>
        <!-- 顶部 -->
        <headNav />
        <!-- 搜索 -->
        <view class="flex flex-center" style="margin: 20rpx 0;">
            <luanqing-search class="search_bar" @onSearch="onSearch"></luanqing-search>
            <view class="" @click="isAvancedClick"
                style="color:#244A7B ;font-size: 20rpx;margin-left: 60rpx;cursor: pointer;">高级搜索 ﹀</view>
        </view>
        <!-- 热门搜索 -->
        <view class="flex flex-center" style="font-size: 20rpx;margin: 10rpx 0;">
            热门搜索:
            <ul class="flex" style="margin-right: 10rpx;">
                <!-- 
                 <li v-for="item in hot" :key="item.id" @tap="HotClick(item.id)" style="margin: 0 10rpx;"
                     :style="{color:item.bgColor==true?'#5879a4':'#000'}">
                     {{item.name}}
                 </li>-->
                <li v-for="item in hot" :key="item.id" style="margin: 0 10rpx;color: #5879a4;font-size: 20rpx;">
                    {{item.name}}
                </li>
            </ul>
        </view>
        <!-- 高级搜索 -->
        <view class="" v-if="isAdvancedSearch" style="padding: 0 230rpx; margin-bottom: 10rpx;">
            <view style="background-color: #fff;padding: 20rpx;" class="">
                <h3>高级搜索</h3>
                <MyForm @submit="onSubmit" :from="from" />
            </view>
        </view>
        <uni-row class="demo-uni-row flex flex-items-start" style="padding: 0 230rpx; ">
            <uni-col :span="5" class="fbox">
                <!-- 职业 -->
                <view class="demo-uni-col dark box"
                    style="margin-bottom: 40rpx;background-color: #fff; padding: 20rpx;border: 2rpx solid #e0e0e0;">
                    <h3>{{profession.title}}</h3>
                    <ul style="margin-top: 10rpx;" :class="{ 'a': activeBox === 'a'?'a':'' }">
                        <!-- background-color: #d6e3f4;border-radius: 60rpx; -->
                        <li class="flex"
                            :style="{'background':profession.index === index ?  '#d6e3f4' :'','borderRadius': profession.index === index ?  '60rpx' :''}"
                            v-for="(item,index) in profession.list" :key="index" style="padding:0 20rpx;">
                            <view class="">{{item.name}}</view>
                            <view class="">{{item.number}}</view>
                        </li>
                    </ul>
                    <view class="flex flex-center">
                        <view class="toggleButton" style="font-size: 25rpx;color: #C1D3EA;" @click="shrinkClick('a')">
                            {{ activeBox !== 'a' ? '更多  ﹀' : '收起  ︿' }}
                        </view>
                    </view>
                </view>
                <!-- 世代 -->
                <view class="demo-uni-col dark box"
                    style="background-color: #fff;padding: 20rpx;border: 2rpx solid #e0e0e0;" :style="{'marginBottom': isAdvancedSearch ===true ? '0': '40rpx'}">
                    <h3>{{dynasty.title}}</h3>
                    <ul style="margin-top: 10rpx;" :class="{ 'b': activeBox === 'b'?'b':'' }">
                        <!-- background-color: #d6e3f4;border-radius: 60rpx; -->
                        <li class="flex"
                            :style="{'background':dynasty.index === index ?  '#d6e3f4' :'','borderRadius': dynasty.index === index ?  '60rpx' :''}"
                            v-for="(item,index) in dynasty.list" :key="index" style="padding:0 20rpx;">
                            <view class="">{{item.name}}</view>
                            <view class="">{{item.number}}</view>
                        </li>
                    </ul>
                    <view class="flex flex-center">
                        <view class="toggleButton" style="font-size: 25rpx;color: #C1D3EA;" @click="shrinkClick('b')">
                            {{ activeBox !== 'b' ? '更多  ﹀' : '收起  ︿' }}
                        </view>
                    </view>
                </view>
                <!-- 来源 -->
                <view v-if="!isAdvancedSearch" class="demo-uni-col dark box"
                    style="height: 250rpx;background-color: #fff;padding: 20rpx;border: 2rpx solid #e0e0e0;">
                    <h3>{{source.title}}</h3>
                    <ul style="margin-top: 10rpx;" :class="{ 'b': activeBox === 'b'?'b':'' }">
                        <!-- background-color: #d6e3f4;border-radius: 60rpx; -->
                        <li class="flex" v-for="(item,index) in source.list" :key="index"
                            style="padding:0 20rpx;color: #244A7B;font-size: 24rpx;">
                            <view class="">{{ index+1 + '. '  +item.name}}</view>
                            <view class="">{{item.number}}</view>
                        </li>
                    </ul>
                    <!--     <view class="flex flex-center">
                        <view class="toggleButton" style="font-size: 25rpx;color: #C1D3EA;" @click="shrinkClick('b')">
                            {{ activeBox !== 'b' ? '更多  ﹀' : '收起  ︿' }}</view>
                    </view> -->
                </view>
            </uni-col>
            <uni-col :span="19" style="padding-left: 20rpx; ">
                <view class="demo-uni-col light fbox1"
                    style=" background-color: #fff;border: 1px solid   #e0e0e0;padding: 10rpx 20rpx;">
                    <view class="flex" style="margin:10rpx 0">
                        <view class="" style="color: #2C2C2C;">共1374条</view>
                        <el-button size="mini">下载</el-button>
                    </view>
                    <el-table :data="tableData" size="mini" style="width: 100%">
                        <el-table-column prop="serialNumber" label="序号" width="70"></el-table-column>
                        <el-table-column prop="name" label="姓名"></el-table-column>
                        <el-table-column prop="another" label="别名"></el-table-column>
                        <el-table-column prop="gender" label="性别"></el-table-column>
                        <el-table-column prop="epoch" label="时代"></el-table-column>
                        <el-table-column prop="year" label="生年" width="70"></el-table-column>
                        <el-table-column prop="death" label="卒年" width="70"></el-table-column>
                        <el-table-column prop="nativePlace" label="籍贯"></el-table-column>
                        <el-table-column prop="socialIdentity" label="社会身份"></el-table-column>
                        <el-table-column prop="officialPosition" label="官职"></el-table-column>
                    </el-table>
                </view>
            </uni-col>
        </uni-row>
        <Footer1 />
    </view>
</template>
 
<script>
    import Footer1 from '@/components/footer/footer'
    import MyForm from '@/components/form/form.vue'
    export default {
        components: {
            Footer1,
            MyForm
        },
        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: '已删除'
                                }
                            ]
                        }
                    ]
                },
                // 热门搜索
                hot: [{
                    id: 1,
                    name: '李时珍',
                    bgColor: false
                }, {
                    id: 2,
                    name: '李时珍2',
                    bgColor: false
                }, {
                    id: 3,
                    name: '李时珍3',
                    bgColor: false
                }, ],
                // 职业
                profession: {
                    title: '职业',
                    index: 0,
                    list: [{
                            name: '全部',
                            id: 1,
                            number: 829
                        },
                        {
                            name: '医家',
                            id: 2,
                            number: 90
                        }, {
                            name: '世医',
                            id: 3,
                            number: 81
                        }, {
                            name: '宫廷医',
                            id: 4,
                            number: 83
                        },
                    ]
                },
                // 展开和收缩的按钮需要
                activeBox: null,
                // 世代
                dynasty: {
                    title: '世代',
                    index: 0,
                    list: [{
                            name: '全部',
                            id: 1,
                            number: 829
                        },
                        {
                            name: '唐',
                            id: 2,
                            number: 90
                        }, {
                            name: '宋',
                            id: 3,
                            number: 81
                        }, {
                            name: '元',
                            id: 4,
                            number: 83
                        },
                    ]
                },
                // 来源
                source: {
                    title: '来源',
                    list: [{
                        name: '中国K小制应薛典',
                        id: 1
                    }, {
                        name: '中医医事大会',
                        id: 2
                    }, {
                        name: '中国医中制度研究',
                        id: 3
                    }, ]
                },
                tableData: [{
                    serialNumber: 1,
                    name: '王小虎',
                    another: '小虎',
                    gender: '男',
                    epoch: '唐代',
                    year: 1234,
                    death: 1332,
                    nativePlace: '河北',
                    socialIdentity: '世医',
                    officialPosition: '院判'
                }, {
                    serialNumber: 2,
                    name: '王w小虎',
                    another: 'w小虎',
                    gender: 'w男',
                    epoch: '唐w代',
                    year: 1234,
                    death: 1332,
                    nativePlace: '河北',
                    socialIdentity: '世医',
                    officialPosition: '院判'
                }, {
                    serialNumber: 1,
                    name: '王小虎',
                    another: '小虎',
                    gender: '男',
                    epoch: '唐代',
                    year: 1234,
                    death: 1332,
                    nativePlace: '河北',
                    socialIdentity: '世医',
                    officialPosition: '院判'
                }]
            }
        },
        mounted() {
            // 修改两次的高度保持一致
            var box1Height = document.querySelector('.fbox').offsetHeight;
            document.querySelector('.fbox1').style.height = box1Height + 'px';
        },
        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';
                    }
                })
            },
            onSubmit(val) {
                console.log(val);
            },
            onSearch(val) {
 
                console.log(val);
            },
            // 热门搜索
            HotClick(id) {
                this.hot.forEach(item => {
                    if (item.id === id) {
                        console.log(item.id === id);
                        item.bgColor = true
                    } else {
                        console.log(item.id === id);
                        item.bgColor = false
                    }
                })
 
            },
            // 展开收缩
            shrinkClick(box) {
                console.log(box);
                if (this.activeBox === box) {
                    this.activeBox = null;
                } else {
                    this.activeBox = box;
                }
            }
        }
    }
</script>
 
<style>
    * {
        box-sizing: border-box;
    }
 
    .a {
        height: 200px;
    }
 
    .b {
        height: 100px;
    }
 
    .box {
        transition: height 0.3s;
        /* 添加过渡效果 */
        overflow: hidden;
        /* 避免内容溢出 */
 
    }
 
    ::v-deep .el-table th,
    ::v-deep .el-table td {
        text-align: center;
    }
 
    ::v-deep .has-gutter tr>th {
        background-color: #DDE8F6 !important;
    }
</style>