|
|
@@ -7,6 +7,9 @@ import DateRange from '@/components/DateRange'
|
|
|
import MoreFilters from '@/components/MoreFilters'
|
|
|
import { ref, reactive, onMounted } from 'vue'
|
|
|
import { useCalculatingHeight } from '@/hooks/calculatingHeight'
|
|
|
+import { useHeaderSearch } from '@/stores/modules/headerSearch'
|
|
|
+
|
|
|
+const headerSearch = useHeaderSearch()
|
|
|
|
|
|
const filterRef: Ref<HTMLElement | null> = ref(null)
|
|
|
|
|
|
@@ -235,6 +238,24 @@ const clearMoreFiltersTags = () => {
|
|
|
filterData.morefiltersData = []
|
|
|
}
|
|
|
|
|
|
+// 从 store 中获取数据并绑定到输入框
|
|
|
+const headerSearchdData = computed(() => headerSearch.searchValue)
|
|
|
+
|
|
|
+// 监听 sharedData 的变化并更新 inputValue
|
|
|
+headerSearchdData.value && (TrackingSearch.value = headerSearchdData.value)
|
|
|
+headerSearch.clearSearchData()
|
|
|
+// 当 sharedData 发生变化时,更新 inputValue
|
|
|
+watch(
|
|
|
+ () => headerSearchdData.value,
|
|
|
+ (newData) => {
|
|
|
+ if (newData) {
|
|
|
+ console.log(headerSearchdData.value)
|
|
|
+ TrackingSearch.value = headerSearchdData.value
|
|
|
+ headerSearch.clearSearchData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
const TrackingTable_ref = ref()
|
|
|
const TransportListItem = ref()
|
|
|
interface ListItem {
|
|
|
@@ -246,20 +267,27 @@ interface ListItem {
|
|
|
const TagsList = ref<ListItem[]>([])
|
|
|
const filterTag = ref(['All'])
|
|
|
const Gettrackingdata = () => {
|
|
|
- $api
|
|
|
- .getTrackingTableData({
|
|
|
- cp: TrackingTable_ref.value.pageInfo.pageNo,
|
|
|
- ps: TrackingTable_ref.value.pageInfo.pageSize,
|
|
|
- rc: -1,
|
|
|
- other_filed: '',
|
|
|
- ...searchTableQeury
|
|
|
- })
|
|
|
- .then((res: any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- TransportListItem.value = res.data.TransportList
|
|
|
- TagsList.value = res.data.tagsList
|
|
|
- }
|
|
|
- })
|
|
|
+ const trackingData = JSON.parse(localStorage.getItem('TrackingData'))
|
|
|
+ if (trackingData) {
|
|
|
+ TransportListItem.value = trackingData.TransportList
|
|
|
+ TagsList.value = trackingData.tagsList
|
|
|
+ TrackingSearch.value = trackingData.searchData
|
|
|
+ } else {
|
|
|
+ $api
|
|
|
+ .getTrackingTableData({
|
|
|
+ cp: TrackingTable_ref.value.pageInfo.pageNo,
|
|
|
+ ps: TrackingTable_ref.value.pageInfo.pageSize,
|
|
|
+ rc: -1,
|
|
|
+ other_filed: '',
|
|
|
+ ...searchTableQeury
|
|
|
+ })
|
|
|
+ .then((res: any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ TransportListItem.value = res.data.TransportList
|
|
|
+ TagsList.value = res.data.tagsList
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
if (
|