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 <template> 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 #set ($hasDict = 0) 10 #set ($hasDict = 0)
23 #foreach ($column in $columns) 11 #foreach ($column in $columns)
24 #if ($hasDict == 0 && $column.listOperation && $column.dictType && "" != $column.dictType) 12 #if ($hasDict == 0 && $column.listOperation && $column.dictType && "" != $column.dictType)
@@ -41,8 +29,8 @@ @@ -41,8 +29,8 @@
41 #set ($dictMethod = "getBoolDictOptions") 29 #set ($dictMethod = "getBoolDictOptions")
42 #end 30 #end
43 #if ($column.htmlType == "input") 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 ${comment} 34 ${comment}
47 </view> 35 </view>
48 <wd-input 36 <wd-input
@@ -53,49 +41,35 @@ @@ -53,49 +41,35 @@
53 </view> 41 </view>
54 #elseif ($column.htmlType == "datetime" && $listOperationCondition == "BETWEEN") 42 #elseif ($column.htmlType == "datetime" && $listOperationCondition == "BETWEEN")
55 #set ($AttrName = $javaField.substring(0,1).toUpperCase() + ${javaField.substring(1)}) 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 ${comment} 46 ${comment}
59 </view> 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 {{ formatDate(formData.${javaField}?.[0]) || '开始日期' }} 51 {{ formatDate(formData.${javaField}?.[0]) || '开始日期' }}
66 </view> 52 </view>
67 </view> 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 {{ formatDate(formData.${javaField}?.[1]) || '结束日期' }} 57 {{ formatDate(formData.${javaField}?.[1]) || '结束日期' }}
74 </view> 58 </view>
75 </view> 59 </view>
76 </view> 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 </wd-button> 65 </wd-button>
87 <wd-button size="small" type="primary" @click="handle${AttrName}0Confirm"> 66 <wd-button size="small" type="primary" @click="handle${AttrName}0Confirm">
88 确定 67 确定
89 </wd-button> 68 </wd-button>
90 </view> 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 </wd-button> 74 </wd-button>
101 <wd-button size="small" type="primary" @click="handle${AttrName}1Confirm"> 75 <wd-button size="small" type="primary" @click="handle${AttrName}1Confirm">
@@ -104,8 +78,8 @@ @@ -104,8 +78,8 @@
104 </view> 78 </view>
105 </view> 79 </view>
106 #elseif (($column.htmlType == "select" || $column.htmlType == "radio") && $dictType && "" != $dictType) 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 ${comment} 83 ${comment}
110 </view> 84 </view>
111 <wd-radio-group v-model="formData.${javaField}" shape="button"> 85 <wd-radio-group v-model="formData.${javaField}" shape="button">
@@ -122,8 +96,8 @@ @@ -122,8 +96,8 @@
122 </wd-radio-group> 96 </wd-radio-group>
123 </view> 97 </view>
124 #else 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 ${comment} 101 ${comment}
128 </view> 102 </view>
129 <wd-input 103 <wd-input
@@ -135,7 +109,7 @@ @@ -135,7 +109,7 @@
135 #end 109 #end
136 #end 110 #end
137 #end 111 #end
138 - <view class="w-full flex justify-center gap-24rpx"> 112 + <view class="yd-search-form-actions">
139 <wd-button class="flex-1" plain @click="handleReset"> 113 <wd-button class="flex-1" plain @click="handleReset">
140 重置 114 重置
141 </wd-button> 115 </wd-button>
@@ -174,6 +148,7 @@ @@ -174,6 +148,7 @@
174 #end 148 #end
175 #end 149 #end
176 import { computed, reactive, ref } from 'vue' 150 import { computed, reactive, ref } from 'vue'
  151 +import { getNavbarHeight } from '@/utils'
177 #if ($hasDateTimeBetween == 1) 152 #if ($hasDateTimeBetween == 1)
178 import { formatDate, formatDateRange } from '@/utils/date' 153 import { formatDate, formatDateRange } from '@/utils/date'
179 #end 154 #end
@@ -276,21 +251,11 @@ function handle${AttrName}0Confirm() { @@ -276,21 +251,11 @@ function handle${AttrName}0Confirm() {
276 visible${AttrName}.value[0] = false 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 /** ${column.columnComment}[1]确认 */ 254 /** ${column.columnComment}[1]确认 */
285 function handle${AttrName}1Confirm() { 255 function handle${AttrName}1Confirm() {
286 formData.${javaField} = [formData.${javaField}?.[0], temp${AttrName}.value[1]] 256 formData.${javaField} = [formData.${javaField}?.[0], temp${AttrName}.value[1]]
287 visible${AttrName}.value[1] = false 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 #end 259 #end
295 #end 260 #end
296 #end 261 #end
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/detail/index.vue.vm
1 <template> 1 <template>
2 - <view class="page-container"> 2 + <view class="yd-page-container">
3 <!-- 顶部导航栏 --> 3 <!-- 顶部导航栏 -->
4 <wd-navbar 4 <wd-navbar
5 title="${table.classComment}详情" 5 title="${table.classComment}详情"
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/form/index.vue.vm
1 <template> 1 <template>
2 - <view class="page-container"> 2 + <view class="yd-page-container">
3 <!-- 顶部导航栏 --> 3 <!-- 顶部导航栏 -->
4 <wd-navbar 4 <wd-navbar
5 :title="getTitle" 5 :title="getTitle"
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/index.vue.vm
1 <template> 1 <template>
2 - <view class="page-container"> 2 + <view class="yd-page-container">
3 <!-- 顶部导航栏 --> 3 <!-- 顶部导航栏 -->
4 <wd-navbar 4 <wd-navbar
5 title="${table.classComment}管理" 5 title="${table.classComment}管理"