This commit is contained in:
bb_pan 2025-12-18 17:33:28 +08:00
parent e402fd0d31
commit 9d52c12e04
4 changed files with 64 additions and 29 deletions

3
components.d.ts vendored
View File

@ -26,6 +26,9 @@ declare module 'vue' {
ElCountdown: typeof import('element-plus/es')['ElCountdown']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']

View File

@ -20,8 +20,8 @@
<div style="margin: 10px 0; padding-right: 15px; text-align: right">
<span style="text-align: right; color: #ff4800" v-if="isShowPrice">
<i style="font-size: 14px"></i>
<i style="margin: 0 6px; font-size: 18px; font-weight: bold">{{ price }}</i>
<i style="font-size: 14px">/ </i>
<i style="margin: 0 6px; font-size: 18px; font-weight: bold">{{ price == 0 ? '电话商议' : price }}</i>
<i v-if="price > 0" style="font-size: 14px">/ </i>
</span>
</div>
</div>

View File

@ -2,8 +2,8 @@ import { get, post } from '../../index'
// 登录接口 - 调试使用 - 产线环境需注释
export const loginApi = (data: any) => {
return false
// return post('/auth/login', data)
// return false
return post('/auth/login', data)
}
// 获取用户信息

View File

@ -60,6 +60,7 @@
</div>
</div>
<div class="btns">
<div class="label">综合排序</div>
<div
class="item"
@click="changeOption(v)"
@ -67,7 +68,19 @@
v-for="(v, i) in screenOptionList"
:key="i"
>
{{ v.name }}
<span>
<el-dropdown @command="(command) => changeDropdown(command, v)">
<span class="dropdown-trigger" :class="v.id == optionActive && 'active'">
{{ v.name }}
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="ASC">正序</el-dropdown-item>
<el-dropdown-item command="DESC">倒序</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</span>
<template v-if="v.sort">
<el-icon class="icon" v-show="v.sort == 'DESC'">
<CaretBottom />
@ -157,7 +170,7 @@ import {
import { getCompanyListApi, getGoodsClassListApi } from 'http/api/home'
import $bus from '@/utils/bus'
import NavMenu from '@/components/Navmenu/index.vue'
import { ElMessage } from 'element-plus'
import { ElMessage, ElDropdown, ElDropdownItem, ElDropdownMenu } from 'element-plus'
const router = useRouter()
const route: any = useRoute()
@ -166,6 +179,7 @@ const endPrice: any = ref(0)
const levelList = ref<any>([{ title: '一级分类' }, { title: '二级分类' }])
const levelList_2 = ref<any>([{ title: '一级分类' }, { title: '二级分类' }, { title: '三级分类' }])
let currentIndex = route.query.level || null
const dropdown = ref()
const onConfirmPrice = () => {
ElMessage.closeAll()
@ -286,7 +300,7 @@ const screenChooseList: any = reactive([
},
{
type: 'companyId',
name: '所属公司',
name: '所属公司',
isShow: true,
list: [
{
@ -321,19 +335,19 @@ const screenTags = computed(() => {
})
//
const screenOptionList: any = reactive([
{
name: '综合排序',
id: 0,
sort: '',
},
{
name: '共享剩余时间',
id: 1,
sort: 'DESC',
},
// {
// name: '',
// id: 0,
// sort: '',
// },
// {
// name: '',
// id: 1,
// sort: 'DESC',
// },
{
name: '上架时间',
id: 2,
id: 0,
sort: 'DESC', //desc or desc
},
])
@ -426,9 +440,9 @@ const getDeviceListData = async (params: any = null, keyWord: any = null) => {
toolType: '',
level: '',
maStatus: 2,
dayLeasePriceOrderBy:
optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
updateTimeOrderBy: optionActive.value == 2 ? screenOptionList[optionActive.value].sort : '',
// dayLeasePriceOrderBy:
// optionActive.value == 1 ? screenOptionList[optionActive.value].sort : '',
updateTimeOrderBy: optionActive.value == 0 ? screenOptionList[0].sort : '',
}
screenChooseList.forEach((e: any, index: number) => {
@ -549,13 +563,19 @@ const handleClose = (tag: any) => {
//
const changeOption = (val: any) => {
if (val.sort && optionActive.value == val.id) {
val.sort = val.sort == 'ASC' ? 'DESC' : 'ASC'
}
console.log(screenOptionList, 'screenOptionList')
optionActive.value = val.id
getDeviceListData()
console.log('🚀 ~ changeOption ~ val:', val)
// optionActive.value = val.id
// if (val.sort && optionActive.value == val.id && val.id == 0) {
// val.sort = val.sort == 'ASC' ? 'DESC' : 'ASC'
// getDeviceListData()
// }
}
const changeDropdown = (sort: any, val: any) => {
optionActive.value = 0
val.sort = val.sort == 'ASC' ? 'DESC' : 'ASC'
setTimeout(() => {
getDeviceListData()
}, 200)
}
// select
@ -750,11 +770,13 @@ const onHandleDetails = (row: any) => {
.line {
padding: 14px 0;
display: flex;
align-items: center;
align-items: flex-start;
// border-bottom: 1px solid #dddddd;
.label {
// width: 100px;
padding-top: 2px;
line-height: 25px;
box-sizing: border-box;
// padding: 0 15px;
@ -890,4 +912,14 @@ const onHandleDetails = (row: any) => {
background-color: #2fa18f !important;
border-color: #2fa18f !important;
}
.dropdown-trigger {
display: inline-flex;
align-items: center;
}
/* 去掉 hover / focus 边框 */
.dropdown-trigger:focus,
.dropdown-trigger:focus-visible {
outline: none;
}
</style>