成品下拉框修改完成
This commit is contained in:
@ -34,7 +34,6 @@
|
|||||||
filterable
|
filterable
|
||||||
@change="fetchData"
|
@change="fetchData"
|
||||||
style="width: 160px;"
|
style="width: 160px;"
|
||||||
popper-class="long-dropdown"
|
|
||||||
>
|
>
|
||||||
<el-option v-for="item in categoryOptions" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in categoryOptions" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -47,7 +46,6 @@
|
|||||||
filterable
|
filterable
|
||||||
@change="fetchData"
|
@change="fetchData"
|
||||||
style="width: 160px;"
|
style="width: 160px;"
|
||||||
popper-class="long-dropdown"
|
|
||||||
>
|
>
|
||||||
<el-option v-for="item in typeOptions" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in typeOptions" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -207,7 +205,7 @@
|
|||||||
@change="onMaterialSelected"
|
@change="onMaterialSelected"
|
||||||
default-first-option
|
default-first-option
|
||||||
v-loadmore="loadMoreMaterials"
|
v-loadmore="loadMoreMaterials"
|
||||||
popper-class="long-dropdown"
|
popper-class="product-dropdown"
|
||||||
>
|
>
|
||||||
<template #prefix><el-icon><Search /></el-icon></template>
|
<template #prefix><el-icon><Search /></el-icon></template>
|
||||||
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
|
<el-option v-for="item in materialOptions" :key="item.id" :label="item.name" :value="item.id">
|
||||||
@ -482,7 +480,8 @@ import { useUserStore } from '@/stores/user'
|
|||||||
const vLoadmore = {
|
const vLoadmore = {
|
||||||
mounted(el: any, binding: any) {
|
mounted(el: any, binding: any) {
|
||||||
const checkAndBind = () => {
|
const checkAndBind = () => {
|
||||||
const dropDownWrap = document.querySelector('.long-dropdown .el-select-dropdown__wrap')
|
// 这里的 .product-dropdown 是唯一标识,防止和采购/半成品页面冲突
|
||||||
|
const dropDownWrap = document.querySelector('.product-dropdown .el-select-dropdown__wrap')
|
||||||
if (dropDownWrap && !dropDownWrap.getAttribute('data-loadmore-bound')) {
|
if (dropDownWrap && !dropDownWrap.getAttribute('data-loadmore-bound')) {
|
||||||
dropDownWrap.setAttribute('data-loadmore-bound', 'true')
|
dropDownWrap.setAttribute('data-loadmore-bound', 'true')
|
||||||
dropDownWrap.addEventListener('scroll', function (this: any) {
|
dropDownWrap.addEventListener('scroll', function (this: any) {
|
||||||
@ -1085,7 +1084,7 @@ onMounted(() => {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.long-dropdown { width: 580px !important; }
|
.product-dropdown { width: 580px !important; }
|
||||||
.long-dropdown .el-select-dropdown__wrap { max-height: 320px !important; }
|
.product-dropdown .el-select-dropdown__wrap { max-height: 320px !important; }
|
||||||
.long-dropdown .el-input__suffix { z-index: 10; }
|
.product-dropdown .el-input__suffix { z-index: 10; }
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user