|
|
@@ -5,6 +5,7 @@ import emitter from '@/utils/bus'
|
|
|
|
|
|
interface ListItem {
|
|
|
name: string
|
|
|
+ sname: string
|
|
|
number: number
|
|
|
icon: string
|
|
|
checked: boolean
|
|
|
@@ -22,11 +23,14 @@ watch(
|
|
|
TransportList.value = current
|
|
|
TransportList.value.forEach((item: any) => {
|
|
|
if (item.checked) {
|
|
|
- checkedCount.push(item.name)
|
|
|
+ checkedCount.push(item.sname)
|
|
|
const map = new Map()
|
|
|
checkedCount.forEach((item) => map.set(item, true))
|
|
|
checkedCount = [...map.keys()]
|
|
|
}
|
|
|
+ if (checkedCount.length == TransportList.value.length) {
|
|
|
+ checkAll.value = true
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
)
|
|
|
@@ -62,7 +66,7 @@ const handleCheckAllChange = (val: any) => {
|
|
|
TransportList.value.forEach((item: any) => {
|
|
|
if (val) {
|
|
|
item.checked = true
|
|
|
- checkedCount.push(item.name)
|
|
|
+ checkedCount.push(item.sname)
|
|
|
} else {
|
|
|
item.checked = false
|
|
|
checkedCount = []
|
|
|
@@ -98,21 +102,21 @@ const changedata = ref()
|
|
|
//点击搜索
|
|
|
const TransportData = {
|
|
|
title: 'Transport Mode',
|
|
|
- data: ''
|
|
|
+ data: ['']
|
|
|
}
|
|
|
const TransportSearch = (visible: any) => {
|
|
|
TransportList.value.forEach((item: any) => {
|
|
|
if (item.checked) {
|
|
|
- checkedCount.push(item.name)
|
|
|
+ checkedCount.push(item.sname)
|
|
|
const map = new Map()
|
|
|
checkedCount.forEach((item) => map.set(item, true))
|
|
|
checkedCount = [...map.keys()]
|
|
|
}
|
|
|
})
|
|
|
if (checkedCount.length == TransportList.value.length) {
|
|
|
- changedata.value = 'All'
|
|
|
+ changedata.value = ['All']
|
|
|
} else {
|
|
|
- changedata.value = checkedCount.join(', ')
|
|
|
+ changedata.value = checkedCount
|
|
|
}
|
|
|
TransportData.data = changedata.value
|
|
|
emit('TransportSearch', TransportData)
|
|
|
@@ -133,15 +137,22 @@ const defaultTransport = () => {
|
|
|
) {
|
|
|
if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
|
|
|
checkAll.value = true
|
|
|
- TransportData.data = 'All'
|
|
|
+ TransportData.data = ['All']
|
|
|
} else {
|
|
|
searchTableQeuryTracking.value =
|
|
|
JSON.parse(sessionStorage.getItem('searchTableQeuryTracking') as string) || {}
|
|
|
- if (searchTableQeuryTracking.value.transport_mode == 'All') {
|
|
|
- checkAll.value = true
|
|
|
- TransportData.data = 'All'
|
|
|
+ if (searchTableQeuryTracking.value.transport_mode.length !== 0) {
|
|
|
+ TransportData.data = searchTableQeuryTracking.value.transport_mode
|
|
|
+ searchTableQeuryTracking.value.transport_mode.forEach((item: any) => {
|
|
|
+ if (item == 'All') {
|
|
|
+ checkAll.value = true
|
|
|
+ } else {
|
|
|
+ checkAll.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- TransportData.data = ''
|
|
|
+ TransportData.data = []
|
|
|
+ checkAll.value = false
|
|
|
}
|
|
|
}
|
|
|
emit('defaultTransport', TransportData, searchTableQeuryTracking.value)
|
|
|
@@ -154,24 +165,33 @@ const defaultTransport = () => {
|
|
|
title: 'Transport Mode',
|
|
|
data: data.transport_mode
|
|
|
}
|
|
|
- if (data.transport_mode == 'All') {
|
|
|
- checkAll.value = true
|
|
|
- }
|
|
|
+ data.transport_mode.forEach((item: any) => {
|
|
|
+ if (item == 'All') {
|
|
|
+ checkAll.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
emit('defaultTransport', obj, searchTableQeuryTracking.value)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
if (sessionStorage.getItem('searchTableQeury') == null) {
|
|
|
checkAll.value = true
|
|
|
- TransportData.data = 'All'
|
|
|
+ TransportData.data = ['All']
|
|
|
} else {
|
|
|
searchTableQeury.value =
|
|
|
JSON.parse(sessionStorage.getItem('searchTableQeury') as string) || {}
|
|
|
- if (searchTableQeury.value.transport_mode == 'All') {
|
|
|
- checkAll.value = true
|
|
|
- TransportData.data = 'All'
|
|
|
+ if (searchTableQeury.value.transport_mode.length !== 0) {
|
|
|
+ TransportData.data = searchTableQeury.value.transport_mode
|
|
|
+ searchTableQeury.value.transport_mode.forEach((item: any) => {
|
|
|
+ if (item == 'All') {
|
|
|
+ checkAll.value = true
|
|
|
+ } else {
|
|
|
+ checkAll.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
} else {
|
|
|
- TransportData.data = ''
|
|
|
+ TransportData.data = []
|
|
|
+ checkAll.value = false
|
|
|
}
|
|
|
}
|
|
|
emit('defaultTransport', TransportData, searchTableQeury.value)
|
|
|
@@ -212,7 +232,7 @@ const defaultTransport = () => {
|
|
|
:value="item.name"
|
|
|
v-model="item.checked"
|
|
|
class="checkbox"
|
|
|
- @change="handleCheckedTransportChange(item.name, item.checked, index)"
|
|
|
+ @change="handleCheckedTransportChange(item.sname, item.checked)"
|
|
|
>
|
|
|
<div class="checkbox_title">
|
|
|
<span class="iconfont_icon">
|