You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

846 lines
24 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div
  3. class="tw-px-[30px] tw-mb-[60px] md:tw-mb-[100px] xl:tw-px-[60px] xl:tw-max-w-screen-xl xl:tw-mx-auto xl:tw-grid xl:tw-grid-cols-[380px_auto] xl:tw-gap-[30px]">
  4. <section class="xl:tw-col-span-2 tw-mb-5 md:tw-mb-0">
  5. <centerMode :list="ads" v-if="ads.length"></centerMode>
  6. </section>
  7. <section class="xl:tw-col-span-2 tw-mb-[40px] xl:tw-mb-[10px]">
  8. <Breadcrumbs class="tw-py-[7px] md:tw-py-[10px] xl:tw-py-[13px] tw-mb-4 md:tw-mb-6 xl:tw-mb-0"></Breadcrumbs>
  9. <sort :results="result" :sortType="sortType" :sortBy="sortBy" @sort="updateSortBy($event)"
  10. @filter="$modal.show(`sidebar-filter-modal`)"></sort>
  11. </section>
  12. <section class="tw-grid tw-grid-cols-1 tw-gap-[30px] tw-auto-rows-min">
  13. <div class="tw-max-h-min" v-if="$vuetify.breakpoint.xl">
  14. <DateCard @update="updateDateFilter" :modalChecked="selectedDates" />
  15. </div>
  16. <div v-if="$vuetify.breakpoint.xl">
  17. <oneLevel :label="'exhibition.Show Status'" :list="statuses" @update="updateStatusFilter"></oneLevel>
  18. </div>
  19. <div v-if="$vuetify.breakpoint.xl">
  20. <multipleLevel :label="'Categories'" :placeholder="'Find Categories...'" :list="categories"
  21. :queryItem="categoryQueryFilter" @update="updateCategoryFilter"></multipleLevel>
  22. </div>
  23. <div v-if="$vuetify.breakpoint.xl">
  24. <multipleLevel :label="'Location'" :placeholder="'Find country/city ...'" :list="locations"
  25. :queryItem="locationQueryFilter" @update="updateLocationFilter"></multipleLevel>
  26. </div>
  27. <div v-if="$vuetify.breakpoint.xl">
  28. <!-- <rating></rating> -->
  29. </div>
  30. </section>
  31. <!-- <section class="">
  32. <ExhibitionListCard v-for="(item, index) in renderList" :key="index" :item="item"
  33. @toggle-favorite="onToggleFavorite"></ExhibitionListCard>
  34. <div class="tw-mt-[34px] tw-flex tw-justify-end">
  35. <pagination :pageLength="pageLength" @update="updatePage"></pagination>
  36. </div>
  37. </section> -->
  38. <section class="">
  39. <ExhibitionListCard v-for="(item, index) in exhibitionList" :key="index" :item="item"></ExhibitionListCard>
  40. <div class="tw-mt-[34px] tw-flex tw-justify-end">
  41. <pagination :pageLength="pageLength" @update="updatePage"></pagination>
  42. </div>
  43. </section>
  44. <div v-if="!$vuetify.breakpoint.xl">
  45. <ShowSidebarFilterModal :statusList="statuses" :locationList="locations" :categoryList="categories"
  46. :statusChecked="selectedStatus" :locationChecked="locationChecked" :categoryChecked="categoryChecked"
  47. :datesChecked="selectedDates" @updateCategoryFilter="updateCategoryFilter"
  48. @updateLocationFilter="updateLocationFilter" @updateStatusFilter="updateStatusFilter"
  49. @updateDateFilter="updateDateFilter"></ShowSidebarFilterModal>
  50. </div>
  51. <loading :isLoading="isPageLoading"></loading>
  52. </div>
  53. </template>
  54. <script>
  55. import Breadcrumbs from "~/components/Breadcrumbs.vue";
  56. import centerMode from "@/components/swiper/centerMode";
  57. import ExhibitionListCard from "~/components/exhibition/ExhibitionListCard.vue";
  58. import DateCard from "~/components/exhibition/DateCard.vue";
  59. import sort from "@/components/newComponent/sort/sort";
  60. import multipleLevel from "@/components/newComponent/filter/multipleLevel";
  61. import oneLevel from "@/components/newComponent/filter/oneLevel";
  62. import rating from "@/components/newComponent/filter/rating.vue";
  63. import pagination from "@/components/newComponent/pagination/pagination.vue";
  64. import ShowSidebarFilterModal from "@/components/exhibition/ShowSidebarFilterModal.vue";
  65. import { XIcon } from "vue-feather-icons";
  66. import loading from "@/components/newComponent/loading/loading.vue";
  67. export default {
  68. name: "ExhibitionView",
  69. auth: false,
  70. meta: {
  71. name: "Exhibition",
  72. },
  73. components: {
  74. centerMode,
  75. Breadcrumbs,
  76. DateCard,
  77. ExhibitionListCard,
  78. XIcon,
  79. sort,
  80. multipleLevel,
  81. oneLevel,
  82. rating,
  83. pagination,
  84. ShowSidebarFilterModal,
  85. loading,
  86. },
  87. async asyncData({ route, $auth, $axios, i18n }) {
  88. let isPageLoading = true;
  89. let langQuery = "?lang=" + i18n.localeProperties["langQuery"];
  90. let keyword = route.query.q;
  91. let data;
  92. // ({ data } = await $axios.get("/exhibitions/filters" + langQuery));
  93. let statuses;
  94. if (data) {
  95. statuses = data.filters.statuses.map((item) => {
  96. return {
  97. key: item.Key,
  98. title: item.Value,
  99. };
  100. });
  101. }
  102. // ({ data } = await $axios.get(
  103. // `/t/exhibitions/locations${langQuery}&sort=true`
  104. // ));
  105. let locations;
  106. if (data) {
  107. locations = data.sort_results.map((item) => {
  108. item.country_list = item.country_list.map((country) => {
  109. country.city_list = country.city_list.map((city) => {
  110. return {
  111. title: city.city_name,
  112. key: city.city_name,
  113. };
  114. });
  115. return {
  116. title: country.country_name,
  117. key: country.country_name,
  118. children: country.city_list,
  119. };
  120. });
  121. return {
  122. title: item.region_name,
  123. key: item.region_name,
  124. children: item.country_list,
  125. };
  126. });
  127. }
  128. // ({ data } = await $axios.get(
  129. // `/t/exhibitions/categories${langQuery}&sort=true`
  130. // ));
  131. let categories;
  132. if (data) {
  133. categories = data.sort_results.map((item) => {
  134. item.subcategories_list = item.subcategories_list.map((children) => {
  135. return {
  136. title: children.subcategory_name,
  137. key: children.subcategory_name,
  138. };
  139. });
  140. return {
  141. title: item.category_name,
  142. key: item.category_name,
  143. children: item.subcategories_list,
  144. };
  145. });
  146. }
  147. if (keyword) {
  148. langQuery = langQuery + "&q=" + keyword;
  149. }
  150. try {
  151. data = {
  152. exhibitions: [],
  153. ads: [],
  154. };
  155. // ({ data } = await $axios
  156. // .get("/exhibitions" + langQuery)
  157. // .then()
  158. // .catch((err) => {
  159. // console.log(err);
  160. // }));
  161. } catch (e) {
  162. data = {
  163. exhibitions: [],
  164. ads: [],
  165. };
  166. console.log(e);
  167. }
  168. // console.log(data.exhibitions);
  169. // let exhibitionList = data.exhibitions; // exhibitionApi2CardType();
  170. let userSavedList = [];
  171. if ($auth.loggedIn) {
  172. // await $axios
  173. // .get(
  174. // `/member/users/${$auth.$storage.getUniversal("jwt").user_id}?jwt=${
  175. // $auth.$storage.getUniversal("jwt").token
  176. // }`
  177. // )
  178. // .then((res) => {
  179. // userSavedList = res.data.UserExhibition; //.map(item=>item.exhibition_id)
  180. // })
  181. // .catch((err) => {
  182. // console.log(err);
  183. // });
  184. }
  185. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  186. // for (let i = 0; i < exhibitionList.length; i++) {
  187. // if (userSavedList.includes(exhibitionList[i].id)) {
  188. // exhibitionList[i].saved = true;
  189. // } else {
  190. // exhibitionList[i].saved = false;
  191. // }
  192. // }
  193. let ads = data.ads;
  194. return {
  195. statuses: statuses,
  196. // categories: categories,
  197. // locations: locations,
  198. // rating: rating,
  199. isPageLoading: isPageLoading,
  200. // exhibitionList: exhibitionList,
  201. ads: ads,
  202. langQuery: langQuery,
  203. };
  204. },
  205. data: () => ({
  206. page: 1,
  207. perPage: 10,
  208. adList: [],
  209. exhibitionList: [],
  210. categoryChecked: [],
  211. locationChecked: [],
  212. ratingChecked: [],
  213. locations: [],
  214. selectedDates: [],
  215. selectedStatus: [],
  216. statusMap: new Map(),
  217. regionMap: new Map(),
  218. countryMap: new Map(),
  219. cityMap: new Map(),
  220. mainCategoryMap: new Map(),
  221. subCategoryMap: new Map(),
  222. selectedMainCategory: [],
  223. selectedSubCategory: [],
  224. selectedRegion: [],
  225. selectedCountry: [],
  226. selectedCity: [],
  227. favoriteSet: new Set(),
  228. categories: [],
  229. categoryQueryFilter: "",
  230. locationQueryFilter: "",
  231. width: undefined,
  232. sortType: [
  233. { name: "Recommended", value: "exhibition.Recommended" },
  234. { name: "ShowDate", value: "exhibition.ShowDate" },
  235. { name: "ExhibitorCount", value: "exhibition.ExhibitorCount" },
  236. { name: "VisitorCount", value: "exhibition.VisitorCount" },
  237. ],
  238. sortBy: "ShowDate",
  239. }),
  240. async created() {
  241. this.isPageLoading = true;
  242. this.getAdList();
  243. this.getStatusList();
  244. this.getLocationList();
  245. this.getCategoryList();
  246. this.getFavorite();
  247. this.getExhibitionCard();
  248. // this.getQuery();
  249. // await this.getUnsortLocationList();
  250. // await this.getUnsortCategoryList();
  251. // await this.getQuery();
  252. // if (this.$route.query.hasOwnProperty("q")) {
  253. // this.sortType.splice(0, 0, {
  254. // name: "ShowEasy Recommended",
  255. // value: "ShowEasy Recommended",
  256. // });
  257. // this.sortBy = "ShowEasy Recommended";
  258. // }
  259. // let userSavedList = [];
  260. // if (this.$auth.loggedIn) {
  261. // // await this.$axios
  262. // // .get(
  263. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  264. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  265. // // )
  266. // // .then((res) => {
  267. // // userSavedList = res.data.UserExhibition;
  268. // // })
  269. // // .catch((err) => {
  270. // // console.log(err);
  271. // // });
  272. // // this.$store.dispatch("updatePicture");
  273. // // this.$nextTick(() => {
  274. // // this.$forceUpdate();
  275. // // });
  276. // }
  277. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  278. // for (let i = 0; i < this.exhibitionList.length; i++) {
  279. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  280. // this.exhibitionList[i].saved = true;
  281. // } else {
  282. // this.exhibitionList[i].saved = false;
  283. // }
  284. // }
  285. if (process.client) {
  286. this.width = window.innerWidth;
  287. }
  288. this.$nextTick(() => {
  289. this.isPageLoading = false;
  290. });
  291. },
  292. async mounted() {
  293. // let userSavedList = [];
  294. // if (this.$auth.loggedIn) {
  295. // // await this.$axios
  296. // // .get(
  297. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  298. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  299. // // )
  300. // // .then((res) => {
  301. // // userSavedList = res.data.UserExhibition;
  302. // // })
  303. // // .catch((err) => {
  304. // // console.log(err);
  305. // // });
  306. // // this.$store.dispatch("updatePicture");
  307. // // this.$nextTick(() => {
  308. // // this.$forceUpdate();
  309. // // });
  310. // }
  311. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  312. // for (let i = 0; i < this.exhibitionList.length; i++) {
  313. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  314. // this.exhibitionList[i].saved = true;
  315. // } else {
  316. // this.exhibitionList[i].saved = false;
  317. // }
  318. // }
  319. this.$nextTick(() => {
  320. window.addEventListener("resize", this.onResize);
  321. });
  322. },
  323. beforeDestroy() {
  324. window.removeEventListener("resize", this.onResize);
  325. this.fetchUser();
  326. },
  327. computed: {
  328. result() {
  329. // return this.exhibitionsFilter.length;
  330. return this.exhibitionList.length;
  331. },
  332. pageLength() {
  333. return Math.ceil(this.result / this.perPage);
  334. },
  335. // renderList() {
  336. // return this.sliceRenderList(this.exhibitionsFilter);
  337. // },
  338. },
  339. watch: {
  340. page() {
  341. // window.scrollTo(0, 0);
  342. },
  343. $route() {
  344. // console.table(this.$route);
  345. // this.getQuery();
  346. },
  347. },
  348. methods: {
  349. onResize() {
  350. if (process.client) {
  351. this.width = window.innerWidth;
  352. }
  353. },
  354. async fetchUser() {
  355. let userSavedList = [];
  356. if (this.$auth.loggedIn) {
  357. // await this.$axios
  358. // .get(
  359. // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  360. // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  361. // )
  362. // .then((res) => {
  363. // userSavedList = res.data.UserExhibition;
  364. // })
  365. // .catch((err) => {
  366. // console.log(err);
  367. // });
  368. }
  369. userSavedList = userSavedList.map((item) => item.exhibition_id);
  370. for (let i = 0; i < this.exhibitionList.length; i++) {
  371. if (userSavedList.includes(this.exhibitionList[i].id)) {
  372. this.exhibitionList[i].saved = true;
  373. } else {
  374. this.exhibitionList[i].saved = false;
  375. }
  376. }
  377. },
  378. getAdList() {
  379. this.ads = [
  380. {
  381. id: 'banner_1',
  382. image: require('/assets/img/banner/banner_1.png'),
  383. url: '/service?taiwan=taiwan'
  384. },
  385. {
  386. id: 'banner_2',
  387. image: require('/assets/img/banner/banner_2.png'),
  388. url: 'javascript:void(0);'
  389. },
  390. {
  391. id: 'banner_3',
  392. image: require('/assets/img/banner/banner_3.png'),
  393. url: 'javascript:void(0);'
  394. },
  395. {
  396. id: 'banner_4',
  397. image: require('/assets/img/banner/banner_4.png'),
  398. url: 'javascript:void(0);'
  399. },
  400. {
  401. id: 'banner_5',
  402. image: require('/assets/img/banner/banner_5.png'),
  403. url: 'javascript:void(0);'
  404. }
  405. ]
  406. },
  407. getStatusList() {
  408. this.$axios
  409. .get(
  410. `/trending/api/Exhibition/Statuses?Lang=${this.$i18n.localeProperties["langQuery"]}`
  411. )
  412. .then((result) => {
  413. if (result.data.DATA.rel) {
  414. this.statuses = result.data.DATA.rel;
  415. this.statuses = this.statuses.map((item => {
  416. this.statusMap.set(item.Key, item.Value);
  417. return {
  418. title: item.Value,
  419. key: item.Key,
  420. };
  421. }));
  422. }
  423. })
  424. .catch((err) => {
  425. console.log(err);
  426. });
  427. },
  428. getCategoryList() {
  429. this.$axios
  430. .get(
  431. `/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`
  432. )
  433. .then((result) => {
  434. if (result.data.DATA.rel) {
  435. this.categories = result.data.DATA.rel;
  436. this.categories = this.categories.map((item) => {
  437. this.mainCategoryMap.set(item.CategoryID, item);
  438. item.SubCategoryList = item.SubCategoryList.map(
  439. (children) => {
  440. this.subCategoryMap.set(children.CategoryID, children);
  441. return {
  442. title: children.CategoryName,
  443. key: children.CategoryID,
  444. };
  445. }
  446. );
  447. return {
  448. title: item.CategoryName,
  449. key: item.CategoryID,
  450. children: item.SubCategoryList,
  451. };
  452. });
  453. }
  454. })
  455. .catch((err) => {
  456. console.log(err);
  457. });
  458. },
  459. getLocationList() {
  460. this.$axios
  461. .get(
  462. `/trending/api/Exhibition/Locations?Lang=${this.$i18n.localeProperties["langQuery"]}`
  463. )
  464. .then((result) => {
  465. if (result.data.DATA.rel) {
  466. var vm = this;
  467. vm.locations = result.data.DATA.rel;
  468. vm.locations = vm.locations.map((region) => {
  469. this.regionMap.set(region.RegionID, region);
  470. region.CountryList = region.CountryList.map((country) => {
  471. this.countryMap.set(country.CountryID, country);
  472. country.CityList = country.CityList.map((city) => {
  473. this.cityMap.set(city.CityID, city);
  474. return {
  475. title: city.CityName,
  476. key: city.CityID,
  477. };
  478. });
  479. return {
  480. title: country.CountryName,
  481. key: country.CountryID,
  482. children: country.CityList,
  483. };
  484. });
  485. return {
  486. title: region.RegionName,
  487. key: region.RegionID,
  488. children: region.CountryList,
  489. };
  490. });
  491. return result.data.DATA.rel;
  492. }
  493. })
  494. .catch((err) => {
  495. console.log(err);
  496. });
  497. },
  498. getExhibitionCard() {
  499. let vm = this;
  500. if (this.$route.query.category) {
  501. vm.categoryQueryFilter = vm.$route.query.category;
  502. this.selectedMainCategory.push(vm.$route.query.category);
  503. }
  504. if (this.$route.query.subcategory) {
  505. vm.categoryQueryFilter = vm.$route.query.category;
  506. this.selectedSubCategory.push(vm.$route.query.subcategory);
  507. }
  508. if (this.$route.query.country) {
  509. vm.locationQueryFilter = vm.$route.query.country;
  510. this.selectedCountry.push(vm.$route.query.country);
  511. }
  512. this.$axios
  513. .get(
  514. `/trending/api/Exhibition/Cards?Lang=${this.$i18n.localeProperties["langQuery"]}` +
  515. `&RegionIDs=${JSON.stringify(this.selectedRegion)}` +
  516. `&CountryIDs=${JSON.stringify(this.selectedCountry)}` +
  517. `&CityIDs=${JSON.stringify(this.selectedCity)}` +
  518. `&MainCategoryIDs=${JSON.stringify(this.selectedMainCategory)}` +
  519. `&SubCategoryIDs=${JSON.stringify(this.selectedSubCategory)}` +
  520. `&Status=${JSON.stringify(this.selectedStatus)}` +
  521. `&Date=${JSON.stringify(this.selectedDates)}` +
  522. `&Sort=${this.sortBy}`
  523. )
  524. .then((result) => {
  525. if (result.data.DATA.rel) {
  526. this.exhibitionList = result.data.DATA.rel;
  527. this.setFavorite();
  528. }
  529. })
  530. .catch((err) => {
  531. console.log(err);
  532. this.exhibitionList = [];
  533. });
  534. },
  535. getFavorite() {
  536. this.favoriteSet.clear();
  537. if (this.$auth.loggedIn) {
  538. this.$axios
  539. .get(
  540. `/trending/api/Favorite/Favorites?Type=Exhibition`
  541. )
  542. .then((result) => {
  543. if (result.data.DATA.rel) {
  544. let favoriteList = [];
  545. favoriteList = result.data.DATA.rel;
  546. favoriteList.forEach(item => {
  547. this.favoriteSet.add(item.ParentID);
  548. })
  549. }
  550. })
  551. .catch((err) => {
  552. console.log(err);
  553. });
  554. }
  555. },
  556. setFavorite() {
  557. if (this.exhibitionList.length > 0 && this.$auth.loggedIn) {
  558. for (let i = 0; i < this.exhibitionList.length; i++) {
  559. if (this.favoriteSet.has(this.exhibitionList[i].ExhibitionID)) {
  560. this.exhibitionList[i].IsFavorite = "Y";
  561. }
  562. }
  563. }
  564. },
  565. updateSortBy(data) {
  566. this.sortBy = data;
  567. this.getExhibitionCard();
  568. },
  569. updatePage(value) {
  570. this.page = value;
  571. },
  572. updateCategoryFilter(value) {
  573. this.selectedMainCategory = [];
  574. this.selectedSubCategory = [];
  575. value.forEach(key => {
  576. if (this.mainCategoryMap.has(key)) {
  577. this.selectedMainCategory.push(key);
  578. }
  579. if (this.subCategoryMap.has(key)) {
  580. this.selectedSubCategory.push(key);
  581. }
  582. });
  583. this.getExhibitionCard();
  584. },
  585. updateLocationFilter(value) {
  586. this.selectedRegion = [];
  587. this.selectedCountry = [];
  588. this.selectedCity = [];
  589. value.forEach(key => {
  590. if (this.regionMap.has(key)) {
  591. this.selectedRegion.push(key);
  592. }
  593. if (this.countryMap.has(key)) {
  594. this.selectedCountry.push(key);
  595. }
  596. if (this.cityMap.has(key)) {
  597. this.selectedCity.push(key);
  598. }
  599. });
  600. this.getExhibitionCard();
  601. },
  602. updateStatusFilter(value) {
  603. this.selectedStatus = [];
  604. value.forEach(key => {
  605. if (this.statusMap.has(key)) {
  606. this.selectedStatus.push(key);
  607. }
  608. });
  609. this.getExhibitionCard();
  610. },
  611. updateDateFilter(value) {
  612. this.selectedDates = value;
  613. this.getExhibitionCard();
  614. },
  615. async getQuery() {
  616. let vm = this;
  617. this.categoryQueryFilter = "";
  618. this.locationQueryFilter = "";
  619. // if (this.$route.query.hasOwnProperty("country") && this.countryNameList.length>0) {
  620. // this.locationQueryFilter =
  621. // this.countryNameList[Number(this.$route.query.country)];
  622. // }
  623. // if (this.$route.query.hasOwnProperty("city") && this.cityNameList.length>0) {
  624. // this.locationQueryFilter =
  625. // this.cityNameList[Number(this.$route.query.city)];
  626. // }
  627. // if (this.$route.query.hasOwnProperty("region")) {
  628. // this.locationQueryFilter =
  629. // this.regionNameList[Number(this.$route.query.region)];
  630. // }
  631. // if (this.$route.query.hasOwnProperty("category") && this.categoryNameList.length>0) {
  632. // this.categoryQueryFilter =
  633. // this.categoryNameList[Number(this.$route.query.category)];
  634. // }
  635. // if (this.$route.query.hasOwnProperty("subcategory")) {
  636. // this.categoryQueryFilter =
  637. // this.unsortSubcategoryList[Number(this.$route.query.subcategory)];
  638. // }
  639. if (vm.$route.query.hasOwnProperty("category")) {
  640. vm.categoryQueryFilter = vm.$route.query.category;
  641. }
  642. if (vm.$route.query.hasOwnProperty("country")) {
  643. vm.locationQueryFilter = vm.$route.query.country;
  644. }
  645. },
  646. sortServiceList(data) {
  647. switch (this.sortBy) {
  648. case "ShowEasy Recommended":
  649. return data;
  650. case "Exhibitor Numbers":
  651. function Exhibitors(a, b) {
  652. if (
  653. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") <
  654. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  655. )
  656. return 1;
  657. if (
  658. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") >
  659. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  660. )
  661. return -1;
  662. return 0;
  663. }
  664. return data.sort(Exhibitors);
  665. case "Visitor Numbers":
  666. function Visitor(a, b) {
  667. if (
  668. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") <
  669. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  670. )
  671. return 1;
  672. if (
  673. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") >
  674. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  675. )
  676. return -1;
  677. return 0;
  678. }
  679. return data.sort(Visitor);
  680. case "Show Dates":
  681. function Date(a, b) {
  682. if (a.startdate.replace(/-/g, "") < b.startdate.replace(/-/g, ""))
  683. return 1;
  684. if (a.startdate.replace(/-/g, "") > b.startdate.replace(/-/g, ""))
  685. return -1;
  686. return 0;
  687. }
  688. return data.sort(Date);
  689. default:
  690. return data;
  691. }
  692. },
  693. sliceRenderList(data) {
  694. return data.slice(
  695. (this.page - 1) * this.perPage,
  696. this.page * this.perPage
  697. );
  698. },
  699. },
  700. };
  701. </script>
  702. <style scoped lang="scss">
  703. .sort-by-text {
  704. max-width: 142px;
  705. >h3 {
  706. border-right: 1px solid #e5e5e5;
  707. }
  708. }
  709. .sort-by-text-sm {
  710. max-width: 112px;
  711. >h3 {
  712. border-right: 1px solid #e5e5e5;
  713. }
  714. }
  715. </style>
  716. <style lang="scss">
  717. .filter-zindex {
  718. z-index: 499 !important;
  719. }
  720. .exhibition-pagination {
  721. .v-pagination {
  722. justify-content: flex-end;
  723. }
  724. .v-pagination__navigation,
  725. .v-pagination__item {
  726. box-shadow: none;
  727. margin: 0;
  728. min-width: 28px;
  729. &.v-pagination__item--active {
  730. color: $primary-orange !important;
  731. }
  732. }
  733. }
  734. .v-breadcrumbs {
  735. padding: 0px;
  736. }
  737. .v-application ul {
  738. padding-left: 0px;
  739. }
  740. </style>