Переглянути джерело

feat: 完成Booking筛选项中 more filters部分的重构

Jack Zhou 2 місяців тому
батько
коміт
ae51c41b16

+ 29 - 41
src/components/AutoSelect/src/AutoSelect.vue

@@ -1,27 +1,26 @@
 <script setup lang="ts">
-import { ref, watch } from 'vue'
+import { useFiltersStore } from '@/stores/modules/filtersList'
+import { cloneDeep } from 'lodash'
+
+const filtersStore = useFiltersStore()
 
 const props = defineProps({
-  ASPlaceholder: {
+  placeholder: {
     type: String
   },
-  ASValue: {
+  data: {
     type: Array
   },
-  ASisDisabled: {
-    type: Boolean
-  },
-  ASType: {
-    type: String
-  },
-  ASSearchFiled: {
+
+  type: {
     type: String
   },
-  ASSearchMode: {
+  title: {
     type: String
   },
-  ASSearchObj: {
-    type: Object
+  isDisabled: {
+    type: Boolean,
+    default: false
   }
 })
 
@@ -31,46 +30,35 @@ interface ListItem {
   checked: boolean
 }
 
-const list = ref<ListItem[]>([])
 const options = ref<ListItem[]>([])
-const value = ref(props.ASValue)
-const type = ref(props.ASType)
-const search_field = ref(props.ASSearchFiled)
-const search_mode = ref(props.ASSearchMode)
-const MoreFiltersObj = ref(props.ASSearchObj)
+const pageData = ref(cloneDeep(props.data))
 const loading = ref(false)
 watch(
-  () => props.ASValue,
-  (current) => {
-    value.value = current
-  }
-)
-watch(
-  () => props.ASSearchObj,
+  () => props.data,
   (current) => {
-    MoreFiltersObj.value = current
+    pageData.value = cloneDeep(current)
   }
 )
+
 const remoteMethod = (query: string) => {
   if (query) {
     loading.value = true
+
+    const queryData = filtersStore.getQueryData
     setTimeout(() => {
       $api
         .getMoreFiltersData({
           term: query,
-          type: type.value,
-          search_field: search_field.value,
-          search_mode: search_mode.value,
-          ...MoreFiltersObj.value
+          type: props.type,
+          search_field: props.title,
+          search_mode: 'booking',
+          ...queryData
         })
         .then((res: any) => {
           loading.value = false
           if (res.code == 200) {
-            list.value = res.data.map((item: any) => {
-              return { value: item, label: item, checked: value.value?.includes(item) }
-            })
-            options.value = list.value.filter((item) => {
-              return item.label.toLowerCase().includes(query.toLowerCase())
+            options.value = res.data.map((item: any) => {
+              return { value: item, label: item, checked: pageData.value?.includes(item) }
             })
           }
         })
@@ -82,7 +70,7 @@ const remoteMethod = (query: string) => {
 const emit = defineEmits(['changeAutoSelect', 'changeFocus'])
 // 选中改变
 const changeAutoSelect = () => {
-  emit('changeAutoSelect', value)
+  emit('changeAutoSelect', pageData.value, props.title)
 }
 // 清除警告样式
 const removeClass = () => {
@@ -98,17 +86,17 @@ const removeClass = () => {
 <template>
   <div>
     <el-select
-      v-model="value"
+      v-model="pageData"
       multiple
       filterable
       remote
       @change="changeAutoSelect"
       reserve-keyword
-      :placeholder="props.ASPlaceholder"
+      :placeholder="props.placeholder"
       collapse-tags
       @focus="removeClass"
       @blur="emit('changeFocus', false)"
-      :disabled="props.ASisDisabled"
+      :disabled="props.isDisabled"
       collapse-tags-tooltip
       :max-collapse-tags="3"
       :remote-method="remoteMethod"
@@ -142,4 +130,4 @@ const removeClass = () => {
     color: var(--badge__content--warning);
   }
 }
-</style>
+</style>

+ 4 - 5
src/components/DateRange/src/DateRange.new.vue

@@ -2,9 +2,9 @@
 import { ref, watch, onMounted, onBeforeMount } from 'vue'
 import IconDropDown from '@/components/IconDropDown'
 import VCalendarDate from './components/VCalendarDate.vue'
-import { useFiltersList } from '@/stores/modules/filtersList'
+import { useFiltersStore } from '@/stores/modules/filtersList'
 
-const filtersStore = useFiltersList()
+const filtersStore = useFiltersStore()
 const filtersList = computed(() => filtersStore.filtersList)
 
 const popoverVisible = ref(false)
@@ -77,15 +77,14 @@ const DateRangeSearch = () => {
     })
   allOtherType.value.forEach((item) => {
     const curIndex = otherDateType.value.findIndex((type) => type.title === item.title)
-    if (curIndex !== -1 && hasValidDate(otherDateType[curIndex].value)) {
+    if (curIndex !== -1 && hasValidDate(otherDateType.value[curIndex]?.value)) {
       filtersStore.pushFilter({
         title: item.title,
         keyType: 'dateRange',
-        value: otherDateType[curIndex].value,
+        value: otherDateType.value[curIndex].value,
         key: item.key
       })
     } else {
-      console.log('deltet', item.title)
       filtersStore.deleteFilterByTitle(item.title)
     }
   })

Різницю між файлами не показано, бо вона завелика
+ 76 - 865
src/components/MoreFilters/src/MoreFilters.new.vue


+ 209 - 0
src/components/MoreFilters/src/components/PartiesView.vue

@@ -0,0 +1,209 @@
+<script setup lang="ts">
+import { useFiltersStore } from '@/stores/modules/filtersList'
+import { cloneDeep } from 'lodash'
+
+const filtersStore = useFiltersStore()
+const filtersList = filtersStore.filtersList
+
+const pageData = ref([
+  {
+    title: 'Shipper Name',
+    key: 'shipper',
+    type: 'contanct',
+    value: [],
+    placeholder: 'Please input shipper name'
+  },
+  {
+    title: 'Consignee Name',
+    key: 'consignee',
+    type: 'contanct',
+    value: [],
+    placeholder: 'Please input consignee name'
+  }
+])
+const changeAutoSelect = (data: any, title: string) => {
+  const index = pageData.value.findIndex((item: any) => item.title === title)
+  pageData.value[index].value = data
+}
+
+const partyTypeOptions = ref([
+  {
+    title: 'Origin Agent',
+    key: 'origin',
+    type: 'apex'
+  },
+  {
+    title: 'Destination Agent',
+    key: 'agent',
+    type: 'apex'
+  },
+  {
+    title: 'Sales',
+    key: 'sales_rep',
+    type: 'sales'
+  }
+])
+
+const moreList = ref([])
+
+const initData = () => {
+  moreList.value = []
+  pageData.value.forEach((item) => {
+    item.value = []
+  })
+  filtersList.forEach((item) => {
+    pageData.value.forEach((pageItem) => {
+      if (item.title === pageItem.title) {
+        pageItem.value = item.value as string[]
+      }
+    })
+    partyTypeOptions.value.forEach((typeItem) => {
+      if (item.title === typeItem.title) {
+        moreList.value.push({
+          title: item.title,
+          value: item.value
+        })
+      }
+    })
+  })
+}
+
+const generate3UniqueIds = () => {
+  return Math.floor(Math.random() * 900000) + 100000
+}
+const addType = () => {
+  moreList.value.push({
+    title: '',
+    id: generate3UniqueIds(),
+    value: []
+  })
+}
+
+const changeData = (data: any) => {
+  const index = moreList.value.findIndex((item) => item.title === data.title)
+  moreList.value[index].value = cloneDeep(data)
+}
+const deleteType = (title: string) => {
+  const index = moreList.value.findIndex((item) => item.title === title)
+  moreList.value.splice(index, 1)
+}
+
+const getQueryData = () => {
+  pageData.value.forEach((item: any) => {
+    if (item.value.length) {
+      filtersStore.pushFilter({
+        title: item.title,
+        key: item.key,
+        value: item.value,
+        keyType: 'array'
+      })
+    } else {
+      filtersStore.deleteFilterByTitle(item.title)
+    }
+  })
+  moreList.value.forEach((item) => {
+    partyTypeOptions.value.forEach((ite) => {
+      if (item.title === ite.title) {
+        item.key = ite.key
+      }
+    })
+  })
+
+  partyTypeOptions.value.forEach((item) => {
+    const index = moreList.value.findIndex((ite) => ite.title === item.title && ite.value.length)
+    if (index !== -1) {
+      const ite = moreList.value[index]
+      filtersStore.pushFilter({
+        title: ite.title,
+        key: ite.key,
+        value: ite.value,
+        keyType: 'array'
+      })
+    } else {
+      filtersStore.deleteFilterByTitle(item.title)
+    }
+  })
+}
+const getBadgeData = () => {
+  let count = 0
+  pageData.value.forEach((item) => {
+    if (item.value.length) {
+      count++
+    }
+  })
+  moreList.value.forEach((item) => {
+    if (item.value.length) {
+      count++
+    }
+  })
+  return count
+}
+
+defineExpose({
+  getQueryData,
+  initData,
+  getBadgeData
+})
+</script>
+
+<template>
+  <div>
+    <div class="ETD" v-for="item in pageData" :key="item.title">
+      <div class="ETD_title">{{ item.title }}</div>
+      <AutoSelect
+        :type="item.type"
+        :title="item.title"
+        :data="item.value"
+        :placeholder="item.placeholder"
+        @changeAutoSelect="changeAutoSelect"
+      >
+      </AutoSelect>
+    </div>
+
+    <SelectAutoSelect
+      :typeOptions="partyTypeOptions"
+      :pageData="moreList"
+      @deleteType="deleteType"
+      @changeData="changeData"
+      placeholder="Please input party name"
+    >
+    </SelectAutoSelect>
+    <div class="MoreType" @click="addType" v-if="partyTypeOptions.length != moreList.length">
+      <el-button class="el-button--noborder moretype">+ More Party Type</el-button>
+    </div>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+.ETD {
+  margin: 8px 16px;
+}
+
+.ETA {
+  margin: 16px 16px;
+}
+
+.ETD_title {
+  font-size: var(--font-size-2);
+  color: var(--color-neutral-2);
+}
+
+.MoreType {
+  color: var(--color-accent-2);
+  padding: 0 0 16px 16px;
+  cursor: pointer;
+}
+
+.AddType {
+  background-color: var(--addparties-background-color);
+  margin: 0 16px 8px 16px;
+  padding: 8px;
+  border-radius: var(--border-radius-6);
+}
+
+.moretype {
+  background-color: transparent;
+  padding: 0 4px;
+  height: 24px;
+}
+</style>

+ 345 - 0
src/components/MoreFilters/src/components/PlacesView.vue

@@ -0,0 +1,345 @@
+<script setup lang="ts">
+import { useFiltersStore } from '@/stores/modules/filtersList'
+import { cloneDeep } from 'lodash'
+
+const filtersStore = useFiltersStore()
+const filtersList = filtersStore.filtersList
+
+const pageData = ref([
+  {
+    title: 'Origin',
+    key: 'shipper_city',
+    value: [],
+    placeholder: 'Please input shipper name'
+  },
+  {
+    title: 'Destination',
+    key: 'consignee_city',
+    value: [],
+    placeholder: 'Please input consignee name'
+  }
+])
+const moreList = ref([])
+const placeTypeOptions = ref([
+  {
+    title: 'Place of delivery',
+    key: 'place_of_delivery/place_of_delivery_exp',
+    needKey: 'city'
+  },
+  {
+    title: ' Place of Receipt',
+    key: 'place_of_receipt/place_of_receipt_exp',
+    needKey: 'city'
+  },
+  {
+    title: 'Port of Loading',
+    key: 'fport_of_loading_uncode/fport_of_loading_exp',
+    type: 'uncode'
+  }
+])
+const initData = () => {
+  moreList.value = []
+  pageData.value.forEach((item) => {
+    item.value = []
+  })
+  filtersList.forEach((item) => {
+    pageData.value.forEach((ite) => {
+      if (item.title === ite.title) {
+        ite.value = item.value as string[]
+      }
+    })
+    placeTypeOptions.value.forEach((typeItem) => {
+      if (item.title === typeItem.title) {
+        moreList.value.push({
+          title: item.title,
+          value: item.value
+        })
+      }
+    })
+  })
+}
+
+const changePageData = (data: any, title: string) => {
+  const index = pageData.value.findIndex((item: any) => item.title === title)
+  if (index !== -1) {
+    pageData.value[index].value = cloneDeep(data)
+  }
+}
+
+const generate3UniqueIds = () => {
+  return Math.floor(Math.random() * 900000) + 100000
+}
+const addType = () => {
+  moreList.value.push({
+    title: '',
+    needKey: '',
+    id: generate3UniqueIds(),
+    value: []
+  })
+}
+
+const changeType = (data: any) => {
+  const needKey = placeTypeOptions.value.find((item) => item.title === data.title)?.needKey
+  moreList.value.forEach((item) => {
+    if (item.id === data.id) {
+      item.value = data.value
+      item.title = data.title
+      item.needKey = needKey
+    }
+  })
+}
+const deleteType = (id) => {
+  moreList.value = moreList.value.filter((item) => item.id !== id)
+}
+const changeData = (data: any, title: string) => {
+  const index = moreList.value.findIndex((item: any) => item.title === title)
+  if (index !== -1) {
+    moreList.value[index].value = cloneDeep(data)
+  }
+}
+
+const getQueryData = () => {
+  pageData.value.forEach((item: any) => {
+    if (item.value.length) {
+      filtersStore.pushFilter({
+        title: item.title,
+        key: item.key,
+        value: item.value,
+        keyType: 'array'
+      })
+    } else {
+      filtersStore.deleteFilterByTitle(item.title)
+    }
+  })
+  moreList.value.forEach((item) => {
+    placeTypeOptions.value.forEach((ite) => {
+      if (item.title === ite.title) {
+        item.key = ite.key
+      }
+    })
+  })
+
+  placeTypeOptions.value.forEach((item) => {
+    const index = moreList.value.findIndex((ite) => ite.title === item.title && ite.value.length)
+    if (index !== -1) {
+      const ite = moreList.value[index]
+      filtersStore.pushFilter({
+        title: ite.title,
+        key: ite.key,
+        value: ite.value,
+        keyType: 'array'
+      })
+    } else {
+      filtersStore.deleteFilterByTitle(item.title)
+    }
+  })
+}
+
+const getBadgeData = () => {
+  let count = 0
+  pageData.value.forEach((item) => {
+    if (item.value.length) {
+      count++
+    }
+  })
+  moreList.value.forEach((item) => {
+    if (item.value.length) {
+      count++
+    }
+  })
+  return count
+}
+
+defineExpose({
+  initData,
+  getQueryData,
+  getBadgeData
+})
+</script>
+
+<template>
+  <div class="ETD" v-for="item in pageData">
+    <div class="ETD_title">{{ item.title }}</div>
+    <SelectTable :title="item.title" :data="item.value" @input="changePageData" />
+  </div>
+  <SelectTableSelect
+    :data="moreList"
+    :dateTypeoptions="placeTypeOptions"
+    @changeData="changeData"
+    @changeType="changeType"
+    @deleteType="deleteType"
+    placeholder="Please input places name"
+  >
+  </SelectTableSelect>
+  <!-- More Place Type -->
+  <div class="MoreType" @click="addType()" v-if="moreList.length !== placeTypeOptions.length">
+    <el-button class="el-button--noborder moretype">+ More Place Type</el-button>
+  </div>
+</template>
+
+<style lang="scss" scoped>
+img.more-filters-guide-class {
+  right: -20px;
+  top: -1px;
+  width: 361px;
+  z-index: 1500;
+}
+
+.icon_more {
+  margin-left: 8px;
+  margin-right: 0;
+}
+
+.icon_delete {
+  fill: var(--color-danger);
+  cursor: pointer;
+}
+
+.More_Filters {
+  display: flex;
+  align-items: center;
+  height: 32px;
+  font-size: var(--font-size-3);
+  margin-left: 8px;
+  width: 116px;
+}
+
+.More_Filters:hover {
+  .Filters_title {
+    color: var(--color-theme);
+  }
+}
+
+.select_icon {
+  margin-right: 8px;
+}
+
+.Filters_title {
+  margin: 0 8px;
+  margin-left: 7px;
+}
+
+:deep(.el-drawer__header) {
+  background-color: var(--color-table-header-bg);
+  display: flex;
+  align-items: center;
+  height: 64px;
+  padding: 0;
+  padding-left: 17.12px;
+  margin-bottom: 0;
+  color: var(--color-neutral-1);
+}
+
+:deep(.el-drawer__title) {
+  font-size: var(--font-size-6);
+  font-weight: bold;
+}
+
+:deep(.el-drawer__close-btn) {
+  font-size: var(--font-size-4);
+  color: var(--icon-color-black);
+  margin-right: 24px;
+  padding: 0;
+}
+
+:deep(.el-drawer__body) {
+  padding: 0;
+  position: relative;
+}
+
+.collapse-title {
+  flex: 1 0 90%;
+  order: 1;
+  text-align: left;
+}
+
+:deep(.el-collapse-item__header) {
+  border-bottom: none;
+  height: 48px;
+  color: var(--icon-color-blac);
+  font-size: var(--font-size-4);
+  font-weight: bold;
+  padding-left: 16px;
+}
+
+:deep(.el-collapse-item__wrap) {
+  border-bottom: none;
+  background-color: var(--more-filters-background-color);
+}
+
+.ETD {
+  margin: 8px 16px;
+}
+
+.ETA {
+  margin: 16px 16px;
+}
+
+.ETD_title {
+  font-size: var(--font-size-2);
+  color: var(--color-neutral-2);
+}
+
+.Date_Title {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.MoreType {
+  color: var(--color-accent-2);
+  padding: 0 0 16px 16px;
+  cursor: pointer;
+}
+
+.AddType {
+  background-color: var(--addparties-background-color);
+  margin: 0 16px 8px 16px;
+  padding: 8px;
+  border-radius: var(--border-radius-6);
+}
+
+.more_bottom {
+  display: flex;
+  align-items: center;
+  bottom: 0;
+  height: 64px;
+  border-top: 1px solid var(--color-border-top);
+  width: 400px;
+  padding: 16px;
+}
+
+.reset {
+  width: 180px;
+  display: flex;
+  align-items: center;
+  height: 40px;
+  justify-content: center;
+  border: 1px solid var(--color-accent-13);
+  border-radius: var(--border-radius-6);
+}
+
+.AlertInput :deep(.el-select__wrapper) {
+  box-shadow: 0 0 0 0.5px var(--color-danger);
+}
+
+:deep(.el-drawer__body) {
+  padding: 0 !important;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+  overflow-x: hidden;
+}
+
+:deep(.el-overlay) {
+  background-color: transparent;
+}
+:deep(.el-drawer__close-btn) {
+  margin-right: 0;
+}
+.moretype {
+  background-color: transparent;
+  padding: 0 4px;
+  height: 24px;
+}
+</style>

+ 0 - 114
src/components/SelectTable/src/SelectTable copy.vue

@@ -1,114 +0,0 @@
-<script setup lang="ts" name="SelTable">
-
-const emit = defineEmits(['check', 'input'])
-
-const props = defineProps({
-  value: {
-    type: Array,
-    default: () => []
-  },
-  addTagOnKeys: {
-    type: Array,
-    default: () => []
-  },
-  readOnly: {
-    type: Boolean,
-    default: false
-  },
-})
-
-const tagInputRef: any = ref(null)
-const newTag = ref('')
-const innerTags = ref([...props.value])
-
-watch(
-  () => props.value,
-  () => {
-    innerTags.value = [...props.value]
-  }
-)
-
-function focusTagInput() {
-  if (props.readOnly || !tagInputRef.value) {
-    return
-  } else {
-    tagInputRef.value.focus()
-  }
-}
-
-function inputTag(ev: any) {
-  newTag.value = ev.target.value
-}
-function remove(index: number) {
-  innerTags.value.splice(index, 1)
-  tagChange()
-}
-function addNew(e: any) {
-  if (e && (!props.addTagOnKeys.includes(e.keyCode)) && (e.type !== 'blur')) {
-    return
-  }
-  if (e) {
-    e.stopPropagation()
-    e.preventDefault()
-  }
-  let addSuccess = false
-  if (newTag.value.includes(',')) {
-    newTag.value.split(',').forEach(item => {
-      if (addTag(item.trim())) {
-        addSuccess = true
-      }
-    })
-  } else {
-    if (addTag(newTag.value.trim())) {
-      addSuccess = true
-    }
-  }
-  if (addSuccess) {
-    tagChange()
-    newTag.value = ''
-  }
-}
-function addTag(tag: any) {
-  tag = tag.trim()
-  if (tag && !innerTags.value.includes(tag)) {
-    innerTags.value.push(tag)
-    return true
-  }
-  return false
-}
-
-function removeLastTag() {
-  if (newTag.value) {
-    return
-  }
-  innerTags.value.pop()
-  tagChange()
-}
-function tagChange() {
-  emit('input', innerTags.value)
-}
-
-
-</script>
-<template>
-  <div class="el-input el-input--suffix el-tooltip__trigger" @click="focusTagInput">
-    <div class="el-input__wrapper">
-      <el-space>
-        <template v-for="(tag, idx) in innerTags" :key="tag">
-          <el-tag v-bind="$attrs" type="info" size="small" round :closable="!readOnly" :disable-transitions="false"
-            @close="remove(idx)">
-            {{ tag }}
-          </el-tag>
-        </template>
-        <input v-if="!readOnly" ref="tagInputRef" class="el-input__inner" @input="inputTag" :value="newTag"
-          @keydown.delete.stop="removeLastTag" @keydown="addNew" @blur="addNew" />
-      </el-space>
-    </div>
-  </div>
-</template>
-
-<style scoped lang="scss">
-.el-input__wrapper {
-  justify-content: flex-start;
-}
-</style>

+ 64 - 47
src/components/SelectTable/src/SelectTable.vue

@@ -1,8 +1,13 @@
 <script setup lang="ts" name="SelTable">
-import _ from 'lodash'
-import { reactive, ref, onMounted, watch } from 'vue'
 import { ElMessage } from 'element-plus'
 import { formatNumber } from '@/utils/tools'
+import { useFiltersStore } from '@/stores/modules/filtersList'
+import { cloneDeep } from 'lodash'
+import { useRoute } from 'vue-router'
+
+const filtersStore = useFiltersStore()
+const route = useRoute()
+const searchMode = route.path.includes('booking') ? 'booking' : 'tracking'
 
 const emit = defineEmits(['check', 'input'])
 const props = defineProps({
@@ -10,15 +15,12 @@ const props = defineProps({
     type: Number,
     default: 380
   },
-  searchInput: {
+
+  data: {
     type: Array,
     default: () => []
   },
-  disabled: {
-    type: Boolean,
-    default: false
-  },
-  keyVal: {
+  needKey: {
     type: String,
     default: 'city'
   },
@@ -26,16 +28,13 @@ const props = defineProps({
     type: Boolean,
     default: false
   },
-  ASSearchMode: {
+  title: {
     type: String,
     default: ''
   },
-  ASSearchFiled: {
-    type: String,
-    default: ''
-  },
-  ASSearchObj: {
-    type: Object
+  disabled: {
+    type: Boolean,
+    default: false
   }
 })
 
@@ -44,9 +43,9 @@ const innerTags: any = ref([])
 const tagInputRef: any = ref(null)
 
 watch(
-  () => props.searchInput,
+  () => props.data,
   (current) => {
-    innerTags.value = current
+    innerTags.value = cloneDeep(current)
   },
   {
     deep: true,
@@ -67,11 +66,10 @@ const state: any = reactive({
 // 点击行
 const handleRowClick = (row: any) => {
   state.poverShow = false
-  if (!innerTags.value.includes(row[props.keyVal])) {
-    innerTags.value.push(row[props.keyVal])
+  if (!innerTags.value.includes(row[props.needKey])) {
+    innerTags.value.push(row[props.needKey])
     state.activeRowIndex = row.id
-    emit('input', innerTags.value)
-    emit('check', innerTags.value)
+    emit('input', innerTags.value, props.title)
   } else {
     ElMessage({
       message: 'Cannot add duplicate cities.',
@@ -80,43 +78,52 @@ const handleRowClick = (row: any) => {
   }
   searchVal.value = null
 }
-const handleSearch = _.debounce((val?) => {
+const handleSearch = (val?) => {
   state.loading = true
-  searchVal.value = val?.target?.value
-  let filterList: any = []
+  let curTableData: any = []
+  state.tableData = []
+  let rc = '-1'
+  if (val === 'pageChange') {
+    rc = state.total
+  } else {
+    console.log('handleSearch', val)
+    searchVal.value = val ? val.target.value : ''
+    state.total = 0
+  }
+  const queryData = filtersStore.getQueryData
   setTimeout(() => {
     $api
       .getMoreFiltersTableData({
         term: searchVal.value ? searchVal.value : '',
         cp: state.currentPage,
         ps: state.pageSize,
-        rc: '-1',
-        search_field: props.ASSearchFiled,
-        search_mode: props.ASSearchMode,
-        ...props.ASSearchObj
+        rc,
+        search_field: props.title,
+        search_mode: searchMode,
+        ...queryData
       })
       .then((res: any) => {
         if (res.code == 200) {
-          filterList = res.data.searchData
-          state.loading = false
-          filterList = res.data.searchData.filter((p: any) => {
+          curTableData = res.data.searchData
+          curTableData = res.data.searchData.filter((p: any) => {
             return (
               p.country.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1 ||
               p.city.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1 ||
               p.uncode.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1
             )
           })
-          state.tableData = filterList
+          state.tableData = curTableData
           state.total = Number(res.data.rc)
           state.loading = false
         }
       })
   }, 800)
-}, 500)
+}
 // 分页 请求接口
 const handleCurrentChange = () => {
   state.loading = true
-  let filterList: any = []
+  let tableData: any = []
+  const queryData = filtersStore.getQueryData
   setTimeout(() => {
     $api
       .getMoreFiltersTableData({
@@ -124,22 +131,22 @@ const handleCurrentChange = () => {
         cp: state.currentPage,
         ps: state.pageSize,
         rc: state.total,
-        search_field: props.ASSearchFiled,
-        search_mode: props.ASSearchMode,
-        ...props.ASSearchObj
+        search_field: props.title,
+        search_mode: 'booking',
+        ...queryData
       })
       .then((res: any) => {
         if (res.code == 200) {
-          filterList = res.data.searchData
+          tableData = res.data.searchData
           state.loading = false
-          filterList = res.data.searchData.filter((p: any) => {
+          tableData = res.data.searchData.filter((p: any) => {
             return (
               p.country.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1 ||
               p.city.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1 ||
               p.uncode.toLowerCase().indexOf(searchVal.value.toLowerCase()) > -1
             )
           })
-          state.tableData = filterList
+          state.tableData = tableData
           state.total = Number(res.data.rc)
           state.loading = false
         }
@@ -149,13 +156,23 @@ const handleCurrentChange = () => {
 // 删除
 const remove = (idx: number) => {
   innerTags.value.splice(idx, 1)
-  emit('input', innerTags.value)
-  emit('check', innerTags.value)
+  emit('input', innerTags.value, props.title)
 }
 
 const onInput = () => {
   tagInputRef.value.focus()
 }
+
+// 在切换title时,可以用来清空搜索框
+const clearSearchInput = () => {
+  searchVal.value = ''
+  state.tableData = []
+  state.currentPage = 1
+  state.total = 0
+}
+defineExpose({
+  clearSearchInput
+})
 </script>
 <template>
   <div>
@@ -212,11 +229,11 @@ const onInput = () => {
                 </el-popover>
               </template>
               <input
-                :disabled="props.disabled"
                 :value="searchVal"
                 ref="tagInputRef"
                 :placeholder="innerTags.length ? '' : 'Please input country/city/uncode'"
                 class="el-input__inner"
+                :disabled="disabled"
                 type="text"
                 @input="handleSearch"
                 @click="handleSearch"
@@ -240,9 +257,9 @@ const onInput = () => {
         @row-click="handleRowClick"
         header-row-class-name="cus-header"
       >
-        <el-table-column property="country" label="Country" />
+        <el-table-column property="country" label="Country" width="75" />
         <el-table-column property="city" label="City" />
-        <el-table-column property="uncode" label="Uncode" />
+        <el-table-column property="uncode" label="Uncode" width="80" />
       </el-table>
       <div class="pagination">
         <span>Total {{ formatNumber(state.total) }}</span>
@@ -253,8 +270,8 @@ const onInput = () => {
           layout="prev, pager, next"
           :pager-count="5"
           :total="state.total"
-          @current-change="handleCurrentChange"
-          @size-change="handleCurrentChange"
+          @current-change="handleSearch('pageChange')"
+          @size-change="handleSearch('pageChange')"
         />
       </div>
     </el-popover>

+ 59 - 151
src/components/SelectTableSelect/src/SelectTableSelect.vue

@@ -2,172 +2,93 @@
 import { ref, watch } from 'vue'
 import IconDropDown from '@/components/IconDropDown'
 import SelectTable from '@/components/SelectTable'
+import { cloneDeep } from 'lodash'
 
-interface TypeItem {
-  placesType: ''
-  placesname: []
-}
-interface dateoptions {
-  value: string
-  label: string
-}
 interface Props {
-  AddDateType: TypeItem[]
-  ASPlaceholder: string
-  DateTypeoptions: dateoptions[]
-  selectedPartyTypeoptions: Array<string>
-  TablesearchTableQeury: Object
-  TablesearchMode: String
-}
-interface optionsItem {
-  value: string
-  label: string
+  data: any[]
+  placeholder: string
+  dateTypeoptions: any[]
 }
+
 const props = withDefaults(defineProps<Props>(), {})
-const AddType: any = ref([])
-const dataTypeoptions = ref<optionsItem[]>([])
-const typeSelectIndex = ref(-1)
-watch(
-  () => props.selectedPartyTypeoptions,
-  (newV) => {
-    let arr: any = []
-    if (newV.length == 0) {
-      arr = props.DateTypeoptions
-    } else {
-      props.DateTypeoptions.forEach((item: any) => {
-        let index = newV.findIndex((con: any) => {
-          return con == item.value
-        })
-        if (index < 0) {
-          arr.push(item)
-        }
-      })
-    }
-    dataTypeoptions.value = arr
-  },
-  {
-    immediate: true,
-    deep: true
-  }
-)
+
+const pageData = ref(props.data)
 
 watch(
-  () => props.AddDateType,
-  (val) => {
-    AddType.value = val
+  () => props.data,
+  (newVal) => {
+    pageData.value = cloneDeep(newVal)
   },
   {
-    immediate: true,
     deep: true
   }
 )
 
+const originnalTypeOptions = ref(props.dateTypeoptions)
+
+// 计算排除其他已选项后的可用选项
+const getAvailableOptions = (curTitle: string) => {
+  // 获取其他下拉已选的值(排除自己)
+  const otherTypeOptions = pageData.value
+    .filter((type) => {
+      return type.title !== curTitle
+    })
+    .map((type) => {
+      return type.title
+    })
+  return originnalTypeOptions.value.filter((type) => {
+    return !otherTypeOptions.includes(type.title)
+  })
+}
+
 // 删除当前more type
-const deleteType = (i: any) => {
-  emit('delSelect', i, AddType.value[i].placesType)
-  AddType.value.splice(i, 1)
+const deleteType = (id: number) => {
+  emit('deleteType', id)
 }
+const selectTableRef = ref()
 // 选中type改变
-const changeSelect = (val: any) => {
-  emit('changeAutoSelectAddType', typeSelectIndex.value, val)
-}
-// 选中name改变
-const emit = defineEmits(['changeAutoSelectAddType', 'delSelect', 'changeAutoSelect'])
-const errorBoolean = ref(false)
-let AutoSelectObj: any = {}
-let AutoSelectObj2: any = {}
-const changeAutoSelect = (val: any, value: any) => {
-  if (value.length) {
-    errorBoolean.value = true
-  } else {
-    errorBoolean.value = false
-  }
-  AutoSelectObj[val] = value.join()
-  AutoSelectObj2[val] = value
-  emit('changeAutoSelect', AutoSelectObj, AutoSelectObj2,errorBoolean.value)
-}
-const typeSelectFocus = (index: any, e: any) => {
-  typeSelectIndex.value = index
-}
-const typeSelectBlur = () => {
-  typeSelectIndex.value = -1
-  let arr: any = []
-  if (props.selectedPartyTypeoptions.length == 0) {
-    arr = props.DateTypeoptions
-  } else {
-    props.DateTypeoptions.forEach((item: any) => {
-      let index = props.selectedPartyTypeoptions.findIndex((con: any) => {
-        return con == item.value
-      })
-      if (index < 0) {
-        arr.push(item)
-      }
-    })
-  }
-  dataTypeoptions.value = arr
-}
-const typeSelectClick = (index: any, val: any) => {
-  if (AddType.value[index].placesType) {
-    let j = props.DateTypeoptions.findIndex((item: any) => {
-      return item.value == AddType.value[index].placesType
+const changeType = (item: any) => {
+  item.value = []
+  const id = item.id
+  emit('changeType', item)
+  // 在title变化时,清空搜索框
+  nextTick(() => {
+    const index = pageData.value.findIndex((type) => {
+      return type.id === id
     })
-    let i = dataTypeoptions.value.findIndex((item: any) => {
-      return item.value == AddType.value[index].placesType
-    })
-    if (i < 0) {
-      dataTypeoptions.value.push(props.DateTypeoptions[j])
-    }
-  } else {
-    let arr: any = []
-    if (props.selectedPartyTypeoptions.length == 0) {
-      arr = props.DateTypeoptions
-    } else {
-      props.DateTypeoptions.forEach((item: any) => {
-        let index = props.selectedPartyTypeoptions.findIndex((con: any) => {
-          return con == item.value
-        })
-        if (index < 0) {
-          arr.push(item)
-        }
-      })
-    }
-    dataTypeoptions.value = arr
-  }
+    selectTableRef.value[index].clearSearchInput()
+  })
 }
+// 选中name改变
+const emit = defineEmits(['changeType', 'deleteType', 'changeData'])
 
-const checkdestination = (row: any, index: any) => {
-  if (row) {
-    AddType.value[index].placesname = row
-    changeAutoSelect(AddType.value[index].placesType, AddType.value[index].placesname)
-  }
+const changePageData = (data: any, title: string) => {
+  emit('changeData', data, title)
 }
 </script>
 <template>
-  <div class="AddType" v-for="(item, index) in AddType" :key="index">
+  <div class="AddType" v-for="(item, index) in pageData" :key="item.id">
     <div>
       <div class="Date_Title">
         <div class="ETD_title">Places Type</div>
-        <span class="iconfont_icon" @click="deleteType(index)">
+        <span class="iconfont_icon" @click="deleteType(item.id)">
           <svg class="iconfont icon_delete" aria-hidden="true">
             <use xlink:href="#icon-icon_delete_b"></use>
           </svg>
         </span>
       </div>
       <el-select
-        v-model="AddType[index].placesType"
+        v-model="item.title"
         :suffix-icon="IconDropDown"
-        @blur="typeSelectBlur"
         class="testname"
-        @focus="typeSelectFocus(index, $event)"
-        @click="typeSelectClick(index, $event)"
-        @change="changeSelect(AddType[index].placesType)"
+        @change="changeType(item)"
         placeholder="Please Select Party Type"
       >
         <el-option
-          v-for="item in dataTypeoptions"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
+          v-for="type in getAvailableOptions(item.title)"
+          :key="type.title"
+          :label="type.title"
+          :value="type.title"
         >
         </el-option>
       </el-select>
@@ -175,28 +96,15 @@ const checkdestination = (row: any, index: any) => {
     <div style="margin-top: 16px">
       <div class="ETD_title">Places Details</div>
       <SelectTable
-        :ASSearchFiled="AddType[index].placesType"
-        :ASSearchObj="props.TablesearchTableQeury"
-        :ASSearchMode="props.TablesearchMode"
-        :key-val="
-          AddType[index].placesType &&
-          (AddType[index].placesType === 'Port of Loading' ||
-            AddType[index].placesType === 'Port of Discharge')
-            ? 'uncode'
-            : 'city'
-        "
-        :is-error="
-          AddType[index].placesType != '' && AddType[index].placesname.length == 0 ? true : false
-        "
-        :disabled="AddType[index].placesType ? false : true"
-        :searchInput="AddType[index].placesname"
-        @check="(row) => checkdestination(row, index)"
+        ref="selectTableRef"
+        :title="item.title"
+        :data="item.value"
+        :needKey="item.needKey"
+        :disabled="!item.title ? true : false"
+        @input="changePageData"
       />
 
-      <div
-        class="error"
-        v-if="AddType[index].placesType != '' && AddType[index].placesname.length == 0"
-      >
+      <div class="error" v-if="item.title != '' && item.value.length === 0">
         Please Input Places Details
       </div>
     </div>

+ 2 - 2
src/components/TransportMode/src/TransportMode.vue

@@ -2,9 +2,9 @@
 import { ref, onMounted, onBeforeMount, watch, computed } from 'vue'
 import type { DropdownInstance } from 'element-plus'
 import { cloneDeep } from 'lodash'
-import { useFiltersList } from '@/stores/modules/filtersList'
+import { useFiltersStore } from '@/stores/modules/filtersList'
 
-const filtersStore = useFiltersList()
+const filtersStore = useFiltersStore()
 
 interface ListItem {
   name: string

+ 95 - 189
src/components/selectAutoSelect/src/selectAutoSelect.vue

@@ -1,212 +1,120 @@
 <script setup lang="ts">
 import { ref, watch } from 'vue'
 import IconDropDown from '@/components/IconDropDown'
-interface TypeItem {
-  partyType: ''
-  partyname: []
-}
-interface ListItem {
-  value: string
-  label: string
-}
-interface dateoptions {
-  value: string
-  label: string
-}
+import { cloneDeep } from 'lodash'
+import { useFiltersStore } from '@/stores/modules/filtersList'
+import { useRoute } from 'vue-router'
+
+const route = useRoute()
+const searchMode = route.path.includes('booking') ? 'booking' : 'tracking'
+const filtersStore = useFiltersStore()
+
 interface Props {
-  AddDateType: TypeItem[]
-  ASPlaceholder: string
-  DateTypeoptions: dateoptions[]
-  selectedPartyTypeoptions: Array<string>
-  ASSearchMode: String
-  ASSearchObj: Object
-}
-interface optionsItem {
-  value: string
-  label: string
-  checked: boolean
+  placeholder: string
+  typeOptions: Array<any>
+  pageData: Array<any>
 }
 
-const list = ref<ListItem[]>([])
-const options = ref<ListItem[]>([])
 const loading = ref(false)
 const props = withDefaults(defineProps<Props>(), {})
-const AddType = ref(props.AddDateType)
+// 搜索得到的值列表
+const detailsData = ref([])
+const typeData = ref(cloneDeep(props.pageData))
 watch(
-  () => props.AddDateType,
-  (val) => {
-    AddType.value = val
+  () => props.pageData,
+  (newVal) => {
+    typeData.value = cloneDeep(newVal)
   },
   {
-    immediate: true,
     deep: true
   }
 )
-// const ErrorNumber = ref(0)
-const dataTypeoptions = ref<optionsItem[]>([])
-const typeSelectIndex = ref(-1)
-watch(
-  () => props.selectedPartyTypeoptions,
-  (newV) => {
-    let arr: any = []
-    if (newV.length == 0) {
-      arr = props.DateTypeoptions
-    } else {
-      props.DateTypeoptions.forEach((item: any) => {
-        let index = newV.findIndex((con: any) => {
-          return con == item.value
-        })
-        if (index < 0) {
-          arr.push(item)
-        }
-      })
-    }
-    dataTypeoptions.value = arr
-  },
-  {
-    immediate: true,
-    deep: true
-  }
-)
-const ErrorNumber = ref(false)
-const str = ref()
-const search_field = ref()
-const InputAutoSelect = (val: any) => {
-  search_field.value = val
-  if (val.includes('Agent')) {
-    str.value = 'apex'
-  } else {
-    str.value = 'sales'
-  }
-}
-const remoteMethod = (query: string) => {
-  if (query) {
-    loading.value = true
-    setTimeout(() => {
-      $api
-        .getMoreFiltersData({
-          term: query,
-          type: str.value,
-          search_field: search_field.value,
-          search_mode: props.ASSearchMode,
-          ...props.ASSearchObj
-        })
-        .then((res: any) => {
-          if (res.code == 200) {
-            loading.value = false
-            list.value = res.data.map((item: any) => {
-              return { value: item, label: item, checked: testAuto.value?.includes(item) }
-            })
-            options.value = list.value.filter((item) => {
-              return item.label.toLowerCase().includes(query.toLowerCase())
-            })
-          }
-        })
-    }, 200)
-  } else {
-    options.value = []
-  }
-}
-// 删除当前more type
-const deleteType = (i: any) => {
-  emit('delSelect', i, AddType.value[i].partyType)
-  AddType.value.splice(i, 1)
-}
-// 选中type改变
-const changeSelect = (val: any) => {
-  emit('changeAutoSelectAddType', typeSelectIndex.value, val)
+
+const originnalTypeOptions = ref(props.typeOptions)
+
+// 计算排除其他已选项后的可用选项
+const getAvailableOptions = (curTitle: string) => {
+  // 获取其他下拉已选的值(排除自己)
+  const otherTypeOptions = typeData.value
+    .filter((type) => {
+      return type.title !== curTitle
+    })
+    .map((type) => {
+      return type.title
+    })
+  return originnalTypeOptions.value.filter((type) => {
+    return !otherTypeOptions.includes(type.title)
+  })
 }
-// 选中name改变
-const emit = defineEmits(['changeAutoSelectAddType', 'delSelect', 'changeAutoSelect'])
-let AutoSelectObj: any = {}
-let AutoSelectObj2: any = {}
-const testAuto = ref()
-const changeAutoSelect = (val: any, value: any) => {
-  testAuto.value = value
-  AutoSelectObj[val] = value.join()
-  AutoSelectObj2[val] = value
-  if (value.length) {
-    ErrorNumber.value = true
-  } else {
-    ErrorNumber.value = false
-  }
-  emit('changeAutoSelect', AutoSelectObj, AutoSelectObj2, ErrorNumber.value)
+const emit = defineEmits(['deleteType', 'changeType'])
+
+const changeData = (item: any) => {
+  item.value = []
+  emit('changeType', item)
 }
-const typeSelectFocus = (index: any, e: any) => {
-  typeSelectIndex.value = index
+
+const deleteType = (title: string) => {
+  emit('deleteType', title)
 }
-const typeSelectBlur = () => {
-  typeSelectIndex.value = -1
-  let arr: any = []
-  if (props.selectedPartyTypeoptions.length == 0) {
-    arr = props.DateTypeoptions
-  } else {
-    props.DateTypeoptions.forEach((item: any) => {
-      let index = props.selectedPartyTypeoptions.findIndex((con: any) => {
-        return con == item.value
-      })
-      if (index < 0) {
-        arr.push(item)
-      }
-    })
+
+const visibleChange = (val: boolean) => {
+  if (!val) {
+    detailsData.value = []
   }
-  dataTypeoptions.value = arr
 }
-const typeSelectClick = (index: any, val: any) => {
-  if (AddType.value[index].partyType) {
-    let j = props.DateTypeoptions.findIndex((item: any) => {
-      return item.value == AddType.value[index].partyType
+const createQueryHandler = (title: string, curValue: string[]) => {
+  return (query: string) => {
+    const curType = originnalTypeOptions.value.find((type) => {
+      return type.title === title
     })
-    let i = dataTypeoptions.value.findIndex((item: any) => {
-      return item.value == AddType.value[index].partyType
-    })
-    if (i < 0) {
-      dataTypeoptions.value.push(props.DateTypeoptions[j])
-    }
-  } else {
-    let arr: any = []
-    if (props.selectedPartyTypeoptions.length == 0) {
-      arr = props.DateTypeoptions
-    } else {
-      props.DateTypeoptions.forEach((item: any) => {
-        let index = props.selectedPartyTypeoptions.findIndex((con: any) => {
-          return con == item.value
-        })
-        if (index < 0) {
-          arr.push(item)
-        }
-      })
+    if (query) {
+      loading.value = true
+      const queryData = filtersStore.getQueryData
+      setTimeout(() => {
+        $api
+          .getMoreFiltersData({
+            term: query,
+            type: curType.type,
+            search_field: title,
+            search_mode: searchMode,
+            ...queryData
+          })
+          .then((res: any) => {
+            if (res.code == 200) {
+              loading.value = false
+              detailsData.value = res.data.map((item: any) => {
+                return { value: item, label: item, checked: curValue?.includes(item) }
+              })
+            }
+          })
+      }, 200)
     }
-    dataTypeoptions.value = arr
   }
 }
 </script>
 <template>
-  <div class="AddType" v-for="(item, index) in AddType" :key="index">
+  <div class="addType" v-for="item in pageData" :key="item.id">
     <div>
       <div class="Date_Title">
         <div class="ETD_title">Party Type</div>
-        <span class="iconfont_icon" @click="deleteType(index)">
+        <span class="iconfont_icon" @click="deleteType(item.title)">
           <svg class="iconfont icon_delete" aria-hidden="true">
             <use xlink:href="#icon-icon_delete_b"></use>
           </svg>
         </span>
       </div>
       <el-select
-        v-model="AddType[index].partyType"
+        v-model="item.title"
         :suffix-icon="IconDropDown"
-        @blur="typeSelectBlur"
         class="testname"
-        @focus="typeSelectFocus(index, $event)"
-        @click="typeSelectClick(index, $event)"
-        @change="changeSelect(AddType[index].partyType)"
+        @change="changeData(item)"
         placeholder="Please Select Party Type"
       >
         <el-option
-          v-for="item in dataTypeoptions"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
+          v-for="type in getAvailableOptions(item.title)"
+          :key="type.title"
+          :label="type.title"
+          :value="type.title"
         >
         </el-option>
       </el-select>
@@ -214,39 +122,37 @@ const typeSelectClick = (index: any, val: any) => {
     <div style="margin-top: 16px">
       <div class="ETD_title">Party Details</div>
       <el-select
-        v-model="AddType[index].partyname"
+        v-model="item.value"
         multiple
         filterable
         remote
         :class="{
-          is_error: AddType[index].partyType != '' && AddType[index].partyname.length == 0
+          is_error: item.value != '' && item.title
         }"
         reserve-keyword
-        :placeholder="props.ASPlaceholder"
+        :placeholder="props.placeholder"
         collapse-tags
-        @input="InputAutoSelect(AddType[index].partyType)"
-        @change="changeAutoSelect(AddType[index].partyType, AddType[index].partyname)"
-        :disabled="AddType[index].partyType ? false : true"
+        :disabled="item.title ? false : true"
         collapse-tags-tooltip
         :max-collapse-tags="3"
-        :remote-method="remoteMethod"
+        :remote-method="createQueryHandler(item.title, item.value)"
         :loading="loading"
+        @visible-change="visibleChange"
       >
         <el-option
-          v-for="item in options"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
+          v-for="infoItem in detailsData"
+          :key="infoItem.label"
+          :label="infoItem.label"
+          :value="infoItem.label"
         >
-          <el-checkbox :checked="item.checked">
-            <span class="label" @click="item.checked = !item.checked">{{ item.value }}</span>
+          <el-checkbox :checked="infoItem.checked">
+            <span class="label" @click="infoItem.checked = !infoItem.checked">{{
+              infoItem.label
+            }}</span>
           </el-checkbox>
         </el-option>
       </el-select>
-      <div
-        class="error"
-        v-if="AddType[index].partyType != '' && AddType[index].partyname.length == 0"
-      >
+      <div class="error" v-if="item.value.length === 0 && item.title">
         Please Input Party Details
       </div>
     </div>
@@ -254,7 +160,7 @@ const typeSelectClick = (index: any, val: any) => {
 </template>
 
 <style lang="scss" scoped>
-.AddType {
+.addType {
   background-color: var(--addparties-background-color);
   margin: 0 16px 8px 16px;
   padding: 8px;
@@ -312,4 +218,4 @@ const typeSelectClick = (index: any, val: any) => {
   line-height: 14px;
   margin-top: 5px;
 }
-</style>
+</style>

+ 1 - 1
src/stores/modules/filtersList.ts

@@ -27,7 +27,7 @@ type FiltersType =
     value: string[]
   }
 
-export const useFiltersList = defineStore('filtersList', {
+export const useFiltersStore = defineStore('filtersStore', {
   state: (): StateType => ({ filtersList: [] }),
 
   getters: {

+ 2 - 11
src/views/Booking/src/BookingView.new.vue

@@ -9,11 +9,11 @@ import { ref, reactive } from 'vue'
 import { useCalculatingHeight } from '@/hooks/calculatingHeight'
 import { useUserStore } from '@/stores/modules/user'
 import dayjs from 'dayjs'
-import { useFiltersList } from '@/stores/modules/filtersList'
+import { useFiltersStore } from '@/stores/modules/filtersList'
 
 const userStore = useUserStore()
 const formatDate = userStore.dateFormat
-const filtersStore = useFiltersList()
+const filtersStore = useFiltersStore()
 const filtersList = computed(() => filtersStore.filtersList)
 
 const filterRef: Ref<HTMLElement | null> = ref(null)
@@ -112,15 +112,6 @@ const handleClose = (tagTitle: any) => {
   getBookingdata()
 }
 
-const setFilterData = (dateRangeData: any) => {
-  filterData.daterangeData = []
-  for (const key in dateRangeData) {
-    const startEnd = dateRangeData[key].data[0] + ' To ' + dateRangeData[key].data[1]
-    let str = `${key}:${startEnd}`
-    filterData.daterangeData.push(str)
-  }
-}
-
 //MoreFiltersSearch
 const MoreFiltersSearch = (val: any, value: any) => {
   filterData.morefiltersData = []

+ 0 - 11
src/views/DestinationDelivery/src/components/TableView/src/TableView.vue

@@ -310,17 +310,6 @@ const handleCreate = () => {
   router.push({ name: 'Create New Booking' })
 }
 
-const testData = [
-  {
-    key: 'A1703530062',
-    value: 'CD1Xeh4rG%2FPmYIiCHAw2%2B0Gw8BFZ8k%2F2pQDkYX3vuf6iZ3kcQXj%2BzQ'
-  },
-  {
-    key: 'A1703530062',
-    value: 'CD1Xeh4rG%2FPmYIiCHAw2%2B0Gw8BFZ8k%2F2pQDkYX3vuf6iZ3kcQXj%2BzQ'
-  }
-]
-
 const handleMultLinkClick = (item: any) => {
   router.push({
     path: '/tracking/detail',

Деякі файли не було показано, через те що забагато файлів було змінено