Commit 1af0bc1e7b3390642a3c645857f14b15b6497eb6

Authored by YunaiV
1 parent 3861fdf4

fix:【infra】代码生成器:微信小程序 search-form.vue 无法点击的问题,因为没 @click 事件

fix:【infra】代码生成器:search-form.vue 的 popup 距离高度不对的问题
feat:【infra】代码生成器:移除 search-form.vue 的 title,简化交互
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/components/search-form.vue.vm
1 1 <template>
2 2 <!-- 搜索框入口 -->
3   - <wd-search
4   - :placeholder="placeholder"
5   - :hide-cancel="true"
6   - disabled
7   - @click="visible = true"
8   - />
  3 + <view @click="visible = true">
  4 + <wd-search :placeholder="placeholder" hide-cancel disabled />
  5 + </view>
9 6  
10 7 <!-- 搜索弹窗 -->
11   - <wd-popup
12   - v-model="visible"
13   - position="top"
14   - custom-style="border-radius: 0 0 24rpx 24rpx;"
15   - safe-area-inset-top
16   - @close="visible = false"
17   - >
18   - <view class="p-32rpx">
19   - <view class="mb-24rpx text-32rpx text-[#333] font-semibold">
20   - 搜索${table.classComment}
21   - </view>
  8 + <wd-popup v-model="visible" position="top" @close="visible = false">
  9 + <view class="yd-search-form-container" :style="{ paddingTop: `#[[${]]#getNavbarHeight()#[[}]]#px` }">
22 10 #set ($hasDict = 0)
23 11 #foreach ($column in $columns)
24 12 #if ($hasDict == 0 && $column.listOperation && $column.dictType && "" != $column.dictType)
... ... @@ -41,8 +29,8 @@
41 29 #set ($dictMethod = "getBoolDictOptions")
42 30 #end
43 31 #if ($column.htmlType == "input")
44   - <view class="mb-24rpx">
45   - <view class="mb-12rpx text-28rpx text-[#666]">
  32 + <view class="yd-search-form-item">
  33 + <view class="yd-search-form-label">
46 34 ${comment}
47 35 </view>
48 36 <wd-input
... ... @@ -53,49 +41,35 @@
53 41 </view>
54 42 #elseif ($column.htmlType == "datetime" && $listOperationCondition == "BETWEEN")
55 43 #set ($AttrName = $javaField.substring(0,1).toUpperCase() + ${javaField.substring(1)})
56   - <view class="mb-32rpx">
57   - <view class="mb-12rpx text-28rpx text-[#666]">
  44 + <view class="yd-search-form-item">
  45 + <view class="yd-search-form-label">
58 46 ${comment}
59 47 </view>
60   - <view class="flex items-center gap-16rpx">
61   - <view class="flex-1" @click="visible${AttrName}[0] = true">
62   - <view
63   - class="h-72rpx flex items-center justify-center rounded-8rpx bg-[#f5f5f5] px-24rpx text-28rpx"
64   - >
  48 + <view class="yd-search-form-date-range-container">
  49 + <view @click="visible${AttrName}[0] = true">
  50 + <view class="yd-search-form-date-range-picker">
65 51 {{ formatDate(formData.${javaField}?.[0]) || '开始日期' }}
66 52 </view>
67 53 </view>
68   - <text class="text-28rpx text-[#999]">至</text>
69   - <view class="flex-1" @click="visible${AttrName}[1] = true">
70   - <view
71   - class="h-72rpx flex items-center justify-center rounded-8rpx bg-[#f5f5f5] px-24rpx text-28rpx"
72   - >
  54 + -
  55 + <view @click="visible${AttrName}[1] = true">
  56 + <view class="yd-search-form-date-range-picker">
73 57 {{ formatDate(formData.${javaField}?.[1]) || '结束日期' }}
74 58 </view>
75 59 </view>
76 60 </view>
77   - <wd-datetime-picker-view
78   - v-if="visible${AttrName}[0]"
79   - v-model="temp${AttrName}[0]"
80   - type="date"
81   - :columns-height="200"
82   - />
83   - <view v-if="visible${AttrName}[0]" class="mt-16rpx flex justify-end gap-16rpx">
84   - <wd-button size="small" plain @click="handle${AttrName}0Cancel">
  61 + <wd-datetime-picker-view v-if="visible${AttrName}[0]" v-model="temp${AttrName}[0]" type="date" />
  62 + <view v-if="visible${AttrName}[0]" class="yd-search-form-date-range-actions">
  63 + <wd-button size="small" plain @click="visible${AttrName}[0] = false">
85 64 取消
86 65 </wd-button>
87 66 <wd-button size="small" type="primary" @click="handle${AttrName}0Confirm">
88 67 确定
89 68 </wd-button>
90 69 </view>
91   - <wd-datetime-picker-view
92   - v-if="visible${AttrName}[1]"
93   - v-model="temp${AttrName}[1]"
94   - type="date"
95   - :columns-height="200"
96   - />
97   - <view v-if="visible${AttrName}[1]" class="mt-16rpx flex justify-end gap-16rpx">
98   - <wd-button size="small" plain @click="handle${AttrName}1Cancel">
  70 + <wd-datetime-picker-view v-if="visible${AttrName}[1]" v-model="temp${AttrName}[1]" type="date" />
  71 + <view v-if="visible${AttrName}[1]" class="yd-search-form-date-range-actions">
  72 + <wd-button size="small" plain @click="visible${AttrName}[1] = false">
99 73 取消
100 74 </wd-button>
101 75 <wd-button size="small" type="primary" @click="handle${AttrName}1Confirm">
... ... @@ -104,8 +78,8 @@
104 78 </view>
105 79 </view>
106 80 #elseif (($column.htmlType == "select" || $column.htmlType == "radio") && $dictType && "" != $dictType)
107   - <view class="mb-32rpx">
108   - <view class="mb-12rpx text-28rpx text-[#666]">
  81 + <view class="yd-search-form-item">
  82 + <view class="yd-search-form-label">
109 83 ${comment}
110 84 </view>
111 85 <wd-radio-group v-model="formData.${javaField}" shape="button">
... ... @@ -122,8 +96,8 @@
122 96 </wd-radio-group>
123 97 </view>
124 98 #else
125   - <view class="mb-24rpx">
126   - <view class="mb-12rpx text-28rpx text-[#666]">
  99 + <view class="yd-search-form-item">
  100 + <view class="yd-search-form-label">
127 101 ${comment}
128 102 </view>
129 103 <wd-input
... ... @@ -135,7 +109,7 @@
135 109 #end
136 110 #end
137 111 #end
138   - <view class="w-full flex justify-center gap-24rpx">
  112 + <view class="yd-search-form-actions">
139 113 <wd-button class="flex-1" plain @click="handleReset">
140 114 重置
141 115 </wd-button>
... ... @@ -174,6 +148,7 @@
174 148 #end
175 149 #end
176 150 import { computed, reactive, ref } from 'vue'
  151 +import { getNavbarHeight } from '@/utils'
177 152 #if ($hasDateTimeBetween == 1)
178 153 import { formatDate, formatDateRange } from '@/utils/date'
179 154 #end
... ... @@ -276,21 +251,11 @@ function handle${AttrName}0Confirm() {
276 251 visible${AttrName}.value[0] = false
277 252 }
278 253  
279   -/** ${column.columnComment}[0]取消 */
280   -function handle${AttrName}0Cancel() {
281   - visible${AttrName}.value[0] = false
282   -}
283   -
284 254 /** ${column.columnComment}[1]确认 */
285 255 function handle${AttrName}1Confirm() {
286 256 formData.${javaField} = [formData.${javaField}?.[0], temp${AttrName}.value[1]]
287 257 visible${AttrName}.value[1] = false
288 258 }
289   -
290   -/** ${column.columnComment}[1]取消 */
291   -function handle${AttrName}1Cancel() {
292   - visible${AttrName}.value[1] = false
293   -}
294 259 #end
295 260 #end
296 261 #end
... ...
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm
1 1 <template>
2   - <view class="page-container">
  2 + <view class="yd-page-container">
3 3 <!-- 顶部导航栏 -->
4 4 <wd-navbar
5 5 title="${table.classComment}详情"
... ...
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/form/index.vue.vm
1 1 <template>
2   - <view class="page-container">
  2 + <view class="yd-page-container">
3 3 <!-- 顶部导航栏 -->
4 4 <wd-navbar
5 5 :title="getTitle"
... ...
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/index.vue.vm
1 1 <template>
2   - <view class="page-container">
  2 + <view class="yd-page-container">
3 3 <!-- 顶部导航栏 -->
4 4 <wd-navbar
5 5 title="${table.classComment}管理"
... ...