fix:微信小程序 search-form.vue 无法点击的问题,因为没 @click 事件

fix:search-form.vue 的 popup 距离高度不对的问题
feat:移除 search-form.vue 的 title,简化交互
This commit is contained in:
YunaiV
2025-12-20 01:13:31 +08:00
parent 1e126355bf
commit 104468501e
16 changed files with 118 additions and 311 deletions

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索部门
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
部门名称
@@ -61,6 +49,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
import { getNavbarHeight } from '@/utils'
import { DICT_TYPE } from '@/utils/constants'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索菜单
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
菜单名称
@@ -54,6 +42,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getIntDictOptions } from '@/hooks/useDict'
import { getNavbarHeight } from '@/utils'
import { DICT_TYPE } from '@/utils/constants'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索通知公告
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
公告标题
@@ -61,6 +49,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
import { getNavbarHeight } from '@/utils'
import { DICT_TYPE } from '@/utils/constants'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索操作日志
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
操作人
@@ -77,12 +65,7 @@
</view>
</view>
</view>
<wd-datetime-picker-view
v-if="visibleCreateTime[0]"
v-model="tempCreateTime[0]"
type="date"
:columns-height="200"
/>
<wd-datetime-picker-view v-if="visibleCreateTime[0]" v-model="tempCreateTime[0]" type="date" />
<view v-if="visibleCreateTime[0]" class="yd-search-form-date-range-actions">
<wd-button size="small" plain @click="handleCreateTime0Cancel">
取消
@@ -91,12 +74,7 @@
确定
</wd-button>
</view>
<wd-datetime-picker-view
v-if="visibleCreateTime[1]"
v-model="tempCreateTime[1]"
type="date"
:columns-height="200"
/>
<wd-datetime-picker-view v-if="visibleCreateTime[1]" v-model="tempCreateTime[1]" type="date" />
<view v-if="visibleCreateTime[1]" class="yd-search-form-date-range-actions">
<wd-button size="small" plain @click="handleCreateTime1Cancel">
取消
@@ -131,6 +109,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import UserPicker from '@/pages-system/user/form/components/user-picker.vue'
import { getNavbarHeight } from '@/utils'
import { formatDate, formatDateRange } from '@/utils/date'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索岗位
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
岗位名称
@@ -71,6 +59,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
import { getNavbarHeight } from '@/utils'
import { DICT_TYPE } from '@/utils/constants'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索角色
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
角色名称
@@ -71,6 +59,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getDictLabel, getIntDictOptions } from '@/hooks/useDict'
import { getNavbarHeight } from '@/utils'
import { DICT_TYPE } from '@/utils/constants'
const emit = defineEmits<{

View File

@@ -1,24 +1,12 @@
<template>
<!-- 搜索框入口 -->
<wd-search
:placeholder="placeholder"
:hide-cancel="true"
disabled
@click="visible = true"
/>
<view @click="visible = true">
<wd-search :placeholder="placeholder" hide-cancel disabled />
</view>
<!-- 搜索弹窗 -->
<wd-popup
v-model="visible"
position="top"
custom-style="border-radius: var(--yd-search-form-popup-radius);"
safe-area-inset-top
@close="visible = false"
>
<view class="yd-search-form-container">
<view class="yd-search-form-title">
搜索用户
</view>
<wd-popup v-model="visible" position="top" @close="visible = false">
<view class="yd-search-form-container" :style="{ paddingTop: `${getNavbarHeight()}px` }">
<view class="yd-search-form-item">
<view class="yd-search-form-label">
用户名称
@@ -53,6 +41,7 @@
<script lang="ts" setup>
import { computed, reactive, ref } from 'vue'
import { getNavbarHeight } from '@/utils'
const emit = defineEmits<{
search: [data: Record<string, any>]