优化页面

This commit is contained in:
pengxiaolong
2025-06-09 23:02:05 +08:00
parent c5042d08c3
commit 8c70c2c850
605 changed files with 661 additions and 945 deletions

View File

@@ -1 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),t={name:"wht-select",props:{options:{type:Array,default:()=>[]},value:{type:[String,Number],default:""},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},height:{type:Number,default:40},fontSize:{type:Number,default:14},borderColor:{type:String,default:"#dcdfe6"},borderRadius:{type:Number,default:4},backgroundColor:{type:String,default:"#ffffff"},textColor:{type:String,default:"#606266"},placeholderColor:{type:String,default:"#c0c4cc"},activeColor:{type:String,default:"#409eff"},filterable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"请输入搜索内容"}},data:()=>({currentValue:"",isOpen:!1,searchQuery:""}),computed:{currentLabel(){const e=this.options.find((e=>e.value===this.currentValue));return e?e.label:""},filteredOptions(){return this.filterable&&this.searchQuery?this.options.filter((e=>e.label.toLowerCase().includes(this.searchQuery.toLowerCase()))):this.options}},watch:{value:{handler(e){this.currentValue=e},immediate:!0}},methods:{togglePicker(){this.disabled||(this.isOpen=!this.isOpen,this.isOpen||(this.searchQuery=""))},selectOption(e,t){e.disabled||(this.currentValue=e.value,this.searchQuery="",this.$emit("input",e.value),this.$emit("change",e),this.isOpen=!1)},clearValue(e){this.currentValue="",this.searchQuery="",this.$emit("input",""),this.$emit("change",null),this.$emit("clear")},onSearch(){this.$emit("search",this.searchQuery)},handleFocus(){this.disabled||(this.isOpen=!0)}}};const r=e._export_sfc(t,[["render",function(t,r,l,a,o,i){return e.e({a:l.filterable},l.filterable?{b:o.currentValue?i.currentLabel:l.placeholder,c:l.fontSize+"px",d:o.currentValue?l.textColor:l.placeholderColor,e:e.o$1((()=>{})),f:e.o$1([e=>o.searchQuery=e.detail.value,(...e)=>i.onSearch&&i.onSearch(...e)]),g:e.o$1(((...e)=>i.handleFocus&&i.handleFocus(...e))),h:o.searchQuery}:{i:e.t(i.currentLabel||l.placeholder),j:l.fontSize+"px",k:o.currentValue?l.textColor:l.placeholderColor},{l:l.clearable&&o.currentValue&&!l.disabled},l.clearable&&o.currentValue&&!l.disabled?{m:e.o$1(((...e)=>i.clearValue&&i.clearValue(...e)))}:{n:l.placeholderColor},{o:o.isOpen?1:"",p:o.currentValue?"":1,q:l.height+"px",r:l.backgroundColor,s:l.borderColor,t:l.borderRadius+"px",v:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),w:o.isOpen},o.isOpen?e.e({x:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),y:i.filteredOptions.length>0},i.filteredOptions.length>0?{z:e.f(i.filteredOptions,((t,r,a)=>({a:e.t(t.label),b:t.value,c:t.disabled?1:"",d:o.currentValue===t.value?1:"",e:t.disabled?l.placeholderColor:l.textColor,f:o.currentValue===t.value?l.activeColor+"20":l.backgroundColor,g:e.o$1((e=>i.selectOption(t,r)),t.value)}))),A:l.fontSize+"px"}:{B:l.fontSize+"px",C:l.placeholderColor},{D:l.backgroundColor,E:l.borderRadius+"px"}):{},{F:l.disabled?1:""})}],["__scopeId","data-v-27db697e"]]);wx.createComponent(r);
"use strict";const e=require("../../../../common/vendor.js"),t={name:"wht-select",props:{options:{type:Array,default:()=>[]},value:{type:[String,Number],default:""},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},height:{type:Number,default:40},fontSize:{type:Number,default:14},borderColor:{type:String,default:"#dcdfe6"},borderRadius:{type:Number,default:4},backgroundColor:{type:String,default:"#ffffff"},textColor:{type:String,default:"#606266"},placeholderColor:{type:String,default:"#c0c4cc"},activeColor:{type:String,default:"#409eff"},filterable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"请输入搜索内容"}},data:()=>({currentValue:"",isOpen:!1,searchQuery:""}),computed:{currentLabel(){const e=this.options.find((e=>e.value===this.currentValue));return e?e.label:""},filteredOptions(){return this.filterable&&this.searchQuery?this.options.filter((e=>e.label.toLowerCase().includes(this.searchQuery.toLowerCase()))):this.options}},watch:{value:{handler(e){this.currentValue=e},immediate:!0}},methods:{togglePicker(){this.disabled||(this.isOpen=!this.isOpen,this.isOpen||(this.searchQuery=""))},selectOption(e,t){e.disabled||(this.currentValue=e.value,this.searchQuery="",this.$emit("input",e.value),this.$emit("change",e),this.isOpen=!1)},clearValue(e){this.currentValue="",this.searchQuery="",this.$emit("input",""),this.$emit("change",null),this.$emit("clear")},onSearch(){this.$emit("search",this.searchQuery)},handleFocus(){this.disabled||(this.isOpen=!0)}}};const r=e._export_sfc(t,[["render",function(t,r,l,a,o,i){return e.e({a:l.filterable},l.filterable?{b:o.currentValue?i.currentLabel:l.placeholder,c:l.fontSize+"px",d:o.currentValue?l.textColor:l.placeholderColor,e:e.o$1((()=>{})),f:e.o$1([e=>o.searchQuery=e.detail.value,(...e)=>i.onSearch&&i.onSearch(...e)]),g:e.o$1(((...e)=>i.handleFocus&&i.handleFocus(...e))),h:o.searchQuery}:{i:e.t(i.currentLabel||l.placeholder),j:l.fontSize+"px",k:o.currentValue?l.textColor:l.placeholderColor},{l:l.clearable&&o.currentValue&&!l.disabled},l.clearable&&o.currentValue&&!l.disabled?{m:e.o$1(((...e)=>i.clearValue&&i.clearValue(...e)))}:{n:l.placeholderColor},{o:o.isOpen?1:"",p:o.currentValue?"":1,q:l.height+"px",r:l.backgroundColor,s:l.borderColor,t:l.borderRadius+"px",v:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),w:o.isOpen},o.isOpen?e.e({x:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),y:i.filteredOptions.length>0},i.filteredOptions.length>0?{z:e.f(i.filteredOptions,((t,r,a)=>({a:e.t(t.label),b:t.value,c:t.disabled?1:"",d:o.currentValue===t.value?1:"",e:t.disabled?l.placeholderColor:l.textColor,f:o.currentValue===t.value?l.activeColor+"20":l.backgroundColor,g:e.o$1((e=>i.selectOption(t,r)),t.value)}))),A:l.fontSize+"px"}:{B:l.fontSize+"px",C:l.placeholderColor},{D:l.backgroundColor,E:l.borderRadius+"px"}):{},{F:l.disabled?1:""})}],["__scopeId","data-v-d04a81ad"]]);wx.createComponent(r);

View File

@@ -1 +1 @@
<view class="{{['wht-select-wrapper', 'data-v-27db697e', F && 'is-disabled']}}"><view class="{{['wht-select-inner', 'data-v-27db697e', o && 'is-active', p && 'is-placeholder']}}" style="{{'height:' + q + ';' + ('background-color:' + r) + ';' + ('border-color:' + s) + ';' + ('border-radius:' + t)}}" bindtap="{{v}}"><view class="wht-select-value data-v-27db697e"><input wx:if="{{a}}" class="wht-select-input data-v-27db697e" placeholder="{{b}}" style="{{'font-size:' + c + ';' + ('color:' + d)}}" catchtap="{{e}}" bindinput="{{f}}" bindfocus="{{g}}" value="{{h}}"/><text wx:else class="data-v-27db697e" style="{{'font-size:' + j + ';' + ('color:' + k)}}">{{i}}</text></view><view class="wht-select-suffix data-v-27db697e"><view wx:if="{{l}}" class="wht-select-clear data-v-27db697e" catchtap="{{m}}">×</view><view wx:else class="wht-select-arrow data-v-27db697e" style="{{'border-top-color:' + n}}"></view></view></view><view wx:if="{{w}}" class="select-dropdown data-v-27db697e"><view class="select-dropdown-mask data-v-27db697e" catchtap="{{x}}"></view><view class="select-dropdown-content data-v-27db697e" style="{{'background-color:' + D + ';' + ('border-radius:' + E)}}"><block wx:if="{{y}}"><view wx:for="{{z}}" wx:for-item="item" wx:key="b" class="{{['data-v-27db697e', item.c && 'disabled', item.d && 'active']}}" style="{{'font-size:' + A + ';' + ('color:' + item.e) + ';' + ('background-color:' + item.f)}}" catchtap="{{item.g}}">{{item.a}}</view></block><view wx:else class="select-dropdown-empty data-v-27db697e" style="{{'font-size:' + B + ';' + ('color:' + C)}}"> 暂无数据 </view></view></view></view>
<view class="{{['wht-select-wrapper', 'data-v-d04a81ad', F && 'is-disabled']}}"><view class="{{['wht-select-inner', 'data-v-d04a81ad', o && 'is-active', p && 'is-placeholder']}}" style="{{'height:' + q + ';' + ('background-color:' + r) + ';' + ('border-color:' + s) + ';' + ('border-radius:' + t)}}" bindtap="{{v}}"><view class="wht-select-value data-v-d04a81ad"><input wx:if="{{a}}" class="wht-select-input data-v-d04a81ad" placeholder="{{b}}" style="{{'font-size:' + c + ';' + ('color:' + d)}}" catchtap="{{e}}" bindinput="{{f}}" bindfocus="{{g}}" value="{{h}}"/><text wx:else class="data-v-d04a81ad" style="{{'font-size:' + j + ';' + ('color:' + k)}}">{{i}}</text></view><view class="wht-select-suffix data-v-d04a81ad"><view wx:if="{{l}}" class="wht-select-clear data-v-d04a81ad" catchtap="{{m}}">×</view><view wx:else class="wht-select-arrow data-v-d04a81ad" style="{{'border-top-color:' + n}}"></view></view></view><view wx:if="{{w}}" class="select-dropdown data-v-d04a81ad"><view class="select-dropdown-mask data-v-d04a81ad" catchtap="{{x}}"></view><view class="select-dropdown-content data-v-d04a81ad" style="{{'background-color:' + D + ';' + ('border-radius:' + E)}}"><block wx:if="{{y}}"><view wx:for="{{z}}" wx:for-item="item" wx:key="b" class="{{['data-v-d04a81ad', item.c && 'disabled', item.d && 'active']}}" style="{{'font-size:' + A + ';' + ('color:' + item.e) + ';' + ('background-color:' + item.f)}}" catchtap="{{item.g}}">{{item.a}}</view></block><view wx:else class="select-dropdown-empty data-v-d04a81ad" style="{{'font-size:' + B + ';' + ('color:' + C)}}"> 暂无数据 </view></view></view></view>

View File

@@ -1 +1 @@
.wht-select-wrapper.data-v-27db697e{width:100%;position:relative}.wht-select-wrapper .wht-select-inner.data-v-27db697e{position:relative;width:100%;border-width:1px;border-style:solid;transition:all .2s;cursor:pointer}.wht-select-wrapper .wht-select-inner.is-active .wht-select-arrow.data-v-27db697e{transform:rotate(180deg)}.wht-select-wrapper .wht-select-value.data-v-27db697e{position:absolute;left:12px;right:30px;top:50%;transform:translateY(-50%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:100%;display:flex;align-items:center}.wht-select-wrapper .wht-select-suffix.data-v-27db697e{position:absolute;right:8px;top:50%;transform:translateY(-50%);display:flex;align-items:center}.wht-select-wrapper .wht-select-clear.data-v-27db697e{width:16px;height:16px;line-height:16px;text-align:center;border-radius:50%;background-color:#c0c4cc;color:#fff;font-size:12px;cursor:pointer;transition:all .2s}.wht-select-wrapper .wht-select-clear.data-v-27db697e:hover{background-color:#909399}.wht-select-wrapper .wht-select-arrow.data-v-27db697e{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;transition:transform .2s}.wht-select-wrapper .select-dropdown.data-v-27db697e{position:absolute;top:100%;left:0;width:100%;margin-top:4px;z-index:999}.wht-select-wrapper .select-dropdown-mask.data-v-27db697e{position:fixed;top:0;left:0;right:0;bottom:0;z-index:998}.wht-select-wrapper .select-dropdown-content.data-v-27db697e{position:relative;max-height:240px;border:1px solid #e4e7ed;box-shadow:0 2px 12px rgba(0,0,0,.1);z-index:999;overflow-y:auto}.wht-select-wrapper .select-dropdown-content.data-v-27db697e::-webkit-scrollbar{width:6px}.wht-select-wrapper .select-dropdown-content.data-v-27db697e::-webkit-scrollbar-thumb{background-color:#e4e7ed;border-radius:3px}.wht-select-wrapper .select-dropdown-content>view.data-v-27db697e{padding:0 12px;height:36px;line-height:36px;cursor:pointer}.wht-select-wrapper .select-dropdown-content>view.disabled.data-v-27db697e{cursor:not-allowed}.wht-select-wrapper .select-dropdown-content .select-dropdown-search.data-v-27db697e{padding:8px;border-bottom:1px solid #e4e7ed}.wht-select-wrapper .select-dropdown-content .select-dropdown-search input.data-v-27db697e{width:100%;height:32px;padding:0 8px;border:1px solid #dcdfe6;border-radius:4px;font-size:14px}.wht-select-wrapper .select-dropdown-content .select-dropdown-search input.data-v-27db697e:focus{border-color:#409eff;outline:none}.wht-select-wrapper .select-dropdown-content .select-dropdown-empty.data-v-27db697e{padding:12px;text-align:center}.wht-select-wrapper .wht-select-input.data-v-27db697e{width:100%;height:100%;background:transparent;border:none;outline:none;padding:0;margin:0;line-height:normal}.wht-select-wrapper .wht-select-input.data-v-27db697e::-webkit-input-placeholder{color:inherit;line-height:normal}.wht-select-wrapper .wht-select-input.data-v-27db697e::placeholder{color:inherit;line-height:normal}
.wht-select-wrapper.data-v-d04a81ad{width:100%;position:relative}.wht-select-wrapper .wht-select-inner.data-v-d04a81ad{position:relative;width:100%;border-width:1px;border-style:solid;transition:all .2s;cursor:pointer}.wht-select-wrapper .wht-select-inner.is-active .wht-select-arrow.data-v-d04a81ad{transform:rotate(180deg)}.wht-select-wrapper .wht-select-value.data-v-d04a81ad{position:absolute;left:12px;right:30px;top:50%;transform:translateY(-50%);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:100%;display:flex;align-items:center}.wht-select-wrapper .wht-select-suffix.data-v-d04a81ad{position:absolute;right:8px;top:50%;transform:translateY(-50%);display:flex;align-items:center}.wht-select-wrapper .wht-select-clear.data-v-d04a81ad{width:16px;height:16px;line-height:16px;text-align:center;border-radius:50%;background-color:#c0c4cc;color:#fff;font-size:12px;cursor:pointer;transition:all .2s}.wht-select-wrapper .wht-select-clear.data-v-d04a81ad:hover{background-color:#909399}.wht-select-wrapper .wht-select-arrow.data-v-d04a81ad{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;transition:transform .2s}.wht-select-wrapper .select-dropdown.data-v-d04a81ad{position:absolute;top:100%;left:0;width:100%;margin-top:4px;z-index:999}.wht-select-wrapper .select-dropdown-mask.data-v-d04a81ad{position:fixed;top:0;left:0;right:0;bottom:0;z-index:998}.wht-select-wrapper .select-dropdown-content.data-v-d04a81ad{position:relative;max-height:240px;border:1px solid #e4e7ed;box-shadow:0 2px 12px rgba(0,0,0,.1);z-index:999;overflow-y:auto}.wht-select-wrapper .select-dropdown-content.data-v-d04a81ad::-webkit-scrollbar{width:6px}.wht-select-wrapper .select-dropdown-content.data-v-d04a81ad::-webkit-scrollbar-thumb{background-color:#e4e7ed;border-radius:3px}.wht-select-wrapper .select-dropdown-content>view.data-v-d04a81ad{padding:0 12px;height:36px;line-height:36px;cursor:pointer}.wht-select-wrapper .select-dropdown-content>view.disabled.data-v-d04a81ad{cursor:not-allowed}.wht-select-wrapper .select-dropdown-content .select-dropdown-search.data-v-d04a81ad{padding:8px;border-bottom:1px solid #e4e7ed}.wht-select-wrapper .select-dropdown-content .select-dropdown-search input.data-v-d04a81ad{width:100%;height:32px;padding:0 8px;border:1px solid #dcdfe6;border-radius:4px;font-size:14px}.wht-select-wrapper .select-dropdown-content .select-dropdown-search input.data-v-d04a81ad:focus{border-color:#409eff;outline:none}.wht-select-wrapper .select-dropdown-content .select-dropdown-empty.data-v-d04a81ad{padding:12px;text-align:center}.wht-select-wrapper .wht-select-input.data-v-d04a81ad{width:100%;height:100%;background:transparent;border:none;outline:none;padding:0;margin:0;line-height:normal}.wht-select-wrapper .wht-select-input.data-v-d04a81ad::-webkit-input-placeholder{color:inherit;line-height:normal}.wht-select-wrapper .wht-select-input.data-v-d04a81ad::placeholder{color:inherit;line-height:normal}