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.

864 lines
23 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
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. // get URL link prarm
  89. // created
  90. let isPageLoading = true;
  91. let langQuery = "?lang=" + i18n.localeProperties["langQuery"];
  92. let keyword = route.query.q;
  93. let data;
  94. // ({ data } = await $axios.get("/exhibitions/filters" + langQuery));
  95. let statuses;
  96. if (data) {
  97. statuses = data.filters.statuses.map((item) => {
  98. return {
  99. key: item.Key,
  100. title: item.Value,
  101. };
  102. });
  103. }
  104. // ({ data } = await $axios.get(
  105. // `/t/exhibitions/locations${langQuery}&sort=true`
  106. // ));
  107. let locations;
  108. if (data) {
  109. locations = data.sort_results.map((item) => {
  110. item.country_list = item.country_list.map((country) => {
  111. country.city_list = country.city_list.map((city) => {
  112. return {
  113. title: city.city_name,
  114. key: city.city_name,
  115. };
  116. });
  117. return {
  118. title: country.country_name,
  119. key: country.country_name,
  120. children: country.city_list,
  121. };
  122. });
  123. return {
  124. title: item.region_name,
  125. key: item.region_name,
  126. children: item.country_list,
  127. };
  128. });
  129. }
  130. // ({ data } = await $axios.get(
  131. // `/t/exhibitions/categories${langQuery}&sort=true`
  132. // ));
  133. let categories;
  134. if (data) {
  135. categories = data.sort_results.map((item) => {
  136. item.subcategories_list = item.subcategories_list.map((children) => {
  137. return {
  138. title: children.subcategory_name,
  139. key: children.subcategory_name,
  140. };
  141. });
  142. return {
  143. title: item.category_name,
  144. key: item.category_name,
  145. children: item.subcategories_list,
  146. };
  147. });
  148. }
  149. if (keyword) {
  150. langQuery = langQuery + "&q=" + keyword;
  151. }
  152. try {
  153. data = {
  154. exhibitions: [],
  155. ads: [],
  156. };
  157. // ({ data } = await $axios
  158. // .get("/exhibitions" + langQuery)
  159. // .then()
  160. // .catch((err) => {
  161. // console.log(err);
  162. // }));
  163. } catch (e) {
  164. data = {
  165. exhibitions: [],
  166. ads: [],
  167. };
  168. console.log(e);
  169. }
  170. // console.log(data.exhibitions);
  171. // let exhibitionList = data.exhibitions; // exhibitionApi2CardType();
  172. let userSavedList = [];
  173. if ($auth.loggedIn) {
  174. // await $axios
  175. // .get(
  176. // `/member/users/${$auth.$storage.getUniversal("jwt").user_id}?jwt=${
  177. // $auth.$storage.getUniversal("jwt").token
  178. // }`
  179. // )
  180. // .then((res) => {
  181. // userSavedList = res.data.UserExhibition; //.map(item=>item.exhibition_id)
  182. // })
  183. // .catch((err) => {
  184. // console.log(err);
  185. // });
  186. }
  187. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  188. // for (let i = 0; i < exhibitionList.length; i++) {
  189. // if (userSavedList.includes(exhibitionList[i].id)) {
  190. // exhibitionList[i].saved = true;
  191. // } else {
  192. // exhibitionList[i].saved = false;
  193. // }
  194. // }
  195. let ads = data.ads;
  196. return {
  197. statuses: statuses,
  198. // categories: categories,
  199. // locations: locations,
  200. // rating: rating,
  201. isPageLoading: isPageLoading,
  202. // exhibitionList: exhibitionList,
  203. ads: ads,
  204. langQuery: langQuery,
  205. };
  206. },
  207. data: () => ({
  208. page: 1,
  209. perPage: 10,
  210. adList: [],
  211. exhibitionList: [],
  212. categoryChecked: [],
  213. locationChecked: [],
  214. ratingChecked: [],
  215. locations: [],
  216. selectedDates: [],
  217. selectedStatus: [],
  218. statusMap: new Map(),
  219. regionMap: new Map(),
  220. countryMap: new Map(),
  221. cityMap: new Map(),
  222. mainCategoryMap: new Map(),
  223. subCategoryMap: new Map(),
  224. selectedMainCategory: [],
  225. selectedSubCategory: [],
  226. selectedRegion: [],
  227. selectedCountry: [],
  228. selectedCity: [],
  229. favoriteSet: new Set(),
  230. categories: [],
  231. categoryQueryFilter: "",
  232. locationQueryFilter: "",
  233. width: undefined,
  234. sortType: [
  235. { name: "exhibition.Recommended", value: "Recommended" },
  236. { name: "exhibition.ShowDate", value: "ShowDate" },
  237. { name: "exhibition.ExhibitorCount", value: "ExhibitorCount" },
  238. { name: "exhibition.VisitorCount", value: "VisitorCount" },
  239. ],
  240. sortBy: "ShowDate",
  241. query: ""
  242. }),
  243. async created() {
  244. console.log("created");
  245. // to Fred
  246. // addjust async/sync orders
  247. this.isPageLoading = true;
  248. // this.getAdList();
  249. await this.getStatusList();
  250. await this.getLocationList();
  251. await this.getCategoryList();
  252. await this.getFavorite();
  253. await this.getQuery();
  254. // await this.getExhibitionCard();
  255. // this.getQuery();
  256. // await this.getUnsortLocationList();
  257. // await this.getUnsortCategoryList();
  258. // await this.getQuery();
  259. // if (this.$route.query.hasOwnProperty("q")) {
  260. // this.sortType.splice(0, 0, {
  261. // name: "ShowEasy Recommended",
  262. // value: "ShowEasy Recommended",
  263. // });
  264. // this.sortBy = "ShowEasy Recommended";
  265. // }
  266. // let userSavedList = [];
  267. // if (this.$auth.loggedIn) {
  268. // // await this.$axios
  269. // // .get(
  270. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  271. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  272. // // )
  273. // // .then((res) => {
  274. // // userSavedList = res.data.UserExhibition;
  275. // // })
  276. // // .catch((err) => {
  277. // // console.log(err);
  278. // // });
  279. // // this.$store.dispatch("updatePicture");
  280. // // this.$nextTick(() => {
  281. // // this.$forceUpdate();
  282. // // });
  283. // }
  284. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  285. // for (let i = 0; i < this.exhibitionList.length; i++) {
  286. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  287. // this.exhibitionList[i].saved = true;
  288. // } else {
  289. // this.exhibitionList[i].saved = false;
  290. // }
  291. // }
  292. if (process.client) {
  293. this.width = window.innerWidth;
  294. }
  295. this.$nextTick(() => {
  296. this.isPageLoading = false;
  297. });
  298. },
  299. async mounted() {
  300. console.log("mounted");
  301. // let userSavedList = [];
  302. // if (this.$auth.loggedIn) {
  303. // // await this.$axios
  304. // // .get(
  305. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  306. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  307. // // )
  308. // // .then((res) => {
  309. // // userSavedList = res.data.UserExhibition;
  310. // // })
  311. // // .catch((err) => {
  312. // // console.log(err);
  313. // // });
  314. // // this.$store.dispatch("updatePicture");
  315. // // this.$nextTick(() => {
  316. // // this.$forceUpdate();
  317. // // });
  318. // }
  319. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  320. // for (let i = 0; i < this.exhibitionList.length; i++) {
  321. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  322. // this.exhibitionList[i].saved = true;
  323. // } else {
  324. // this.exhibitionList[i].saved = false;
  325. // }
  326. // }
  327. this.$nextTick(() => {
  328. window.addEventListener("resize", this.onResize);
  329. });
  330. },
  331. beforeDestroy() {
  332. window.removeEventListener("resize", this.onResize);
  333. this.fetchUser();
  334. },
  335. computed: {
  336. result() {
  337. // return this.exhibitionsFilter.length;
  338. return this.exhibitionList.length;
  339. },
  340. pageLength() {
  341. return Math.ceil(this.result / this.perPage);
  342. },
  343. // renderList() {
  344. // return this.sliceRenderList(this.exhibitionsFilter);
  345. // },
  346. },
  347. watch: {
  348. page() {
  349. // window.scrollTo(0, 0);
  350. },
  351. $route() {
  352. console.log("route");
  353. this.getQuery();
  354. },
  355. },
  356. methods: {
  357. onResize() {
  358. if (process.client) {
  359. this.width = window.innerWidth;
  360. }
  361. },
  362. async fetchUser() {
  363. let userSavedList = [];
  364. if (this.$auth.loggedIn) {
  365. // await this.$axios
  366. // .get(
  367. // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  368. // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  369. // )
  370. // .then((res) => {
  371. // userSavedList = res.data.UserExhibition;
  372. // })
  373. // .catch((err) => {
  374. // console.log(err);
  375. // });
  376. }
  377. userSavedList = userSavedList.map((item) => item.exhibition_id);
  378. for (let i = 0; i < this.exhibitionList.length; i++) {
  379. if (userSavedList.includes(this.exhibitionList[i].id)) {
  380. this.exhibitionList[i].saved = true;
  381. } else {
  382. this.exhibitionList[i].saved = false;
  383. }
  384. }
  385. },
  386. getAdList() {
  387. this.ads = [
  388. {
  389. id: 'banner_1',
  390. image: require('/assets/img/banner/banner_1.png'),
  391. url: '/service?taiwan=taiwan'
  392. },
  393. {
  394. id: 'banner_2',
  395. image: require('/assets/img/banner/banner_2.png'),
  396. url: 'javascript:void(0);'
  397. },
  398. {
  399. id: 'banner_3',
  400. image: require('/assets/img/banner/banner_3.png'),
  401. url: 'javascript:void(0);'
  402. },
  403. {
  404. id: 'banner_4',
  405. image: require('/assets/img/banner/banner_4.png'),
  406. url: 'javascript:void(0);'
  407. },
  408. {
  409. id: 'banner_5',
  410. image: require('/assets/img/banner/banner_5.png'),
  411. url: 'javascript:void(0);'
  412. }
  413. ]
  414. },
  415. async getStatusList() {
  416. await this.$axios
  417. .get(
  418. `/trending/api/Exhibition/Statuses?Lang=${this.$i18n.localeProperties["langQuery"]}`
  419. )
  420. .then((result) => {
  421. if (result.data.DATA.rel) {
  422. this.statuses = result.data.DATA.rel;
  423. this.statuses = this.statuses.map((item => {
  424. this.statusMap.set(item.Key, item.Value);
  425. return {
  426. title: item.Value,
  427. key: item.Key,
  428. };
  429. }));
  430. }
  431. })
  432. .catch((err) => {
  433. console.log(err);
  434. });
  435. },
  436. async getCategoryList() {
  437. await this.$axios
  438. .get(
  439. `/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`
  440. )
  441. .then((result) => {
  442. if (result.data.DATA.rel) {
  443. this.categories = result.data.DATA.rel;
  444. this.categories = this.categories.map((item) => {
  445. this.mainCategoryMap.set(item.CategoryID, item);
  446. item.SubCategoryList = item.SubCategoryList.map(
  447. (children) => {
  448. this.subCategoryMap.set(children.CategoryID, children);
  449. return {
  450. title: children.CategoryName,
  451. key: children.CategoryID,
  452. };
  453. }
  454. );
  455. return {
  456. title: item.CategoryName,
  457. key: item.CategoryID,
  458. children: item.SubCategoryList,
  459. };
  460. });
  461. }
  462. })
  463. .catch((err) => {
  464. console.log(err);
  465. });
  466. },
  467. async getLocationList() {
  468. await this.$axios
  469. .get(
  470. `/trending/api/Exhibition/Locations?Lang=${this.$i18n.localeProperties["langQuery"]}`
  471. )
  472. .then((result) => {
  473. if (result.data.DATA.rel) {
  474. var vm = this;
  475. vm.locations = result.data.DATA.rel;
  476. vm.locations = vm.locations.map((region) => {
  477. this.regionMap.set(region.RegionID, region);
  478. region.CountryList = region.CountryList.map((country) => {
  479. this.countryMap.set(country.CountryID, country);
  480. country.CityList = country.CityList.map((city) => {
  481. this.cityMap.set(city.CityID, city);
  482. return {
  483. title: city.CityName,
  484. key: city.CityID,
  485. };
  486. });
  487. return {
  488. title: country.CountryName,
  489. key: country.CountryID,
  490. children: country.CityList,
  491. };
  492. });
  493. return {
  494. title: region.RegionName,
  495. key: region.RegionID,
  496. children: region.CountryList,
  497. };
  498. });
  499. return result.data.DATA.rel;
  500. }
  501. })
  502. .catch((err) => {
  503. console.log(err);
  504. });
  505. },
  506. async getExhibitionCard() {
  507. // to Fred
  508. // should add q=? to api
  509. this.query = this.query + "工具機";
  510. console.log("getExhibitionCard"+": "+this.query)
  511. await this.$axios
  512. .get(
  513. `/trending/api/Exhibition/Cards?Lang=${this.$i18n.localeProperties["langQuery"]}` +
  514. `&RegionIDs=${JSON.stringify(this.selectedRegion)}` +
  515. `&CountryIDs=${JSON.stringify(this.selectedCountry)}` +
  516. `&CityIDs=${JSON.stringify(this.selectedCity)}` +
  517. `&MainCategoryIDs=${JSON.stringify(this.selectedMainCategory)}` +
  518. `&SubCategoryIDs=${JSON.stringify(this.selectedSubCategory)}` +
  519. `&Status=${JSON.stringify(this.selectedStatus)}` +
  520. `&Date=${JSON.stringify(this.selectedDates)}` +
  521. `&Sort=${this.sortBy}` +
  522. `&Query=${this.query}`
  523. )
  524. .then((result) => {
  525. console.log(result);
  526. if (result.data.DATA.rel) {
  527. this.exhibitionList = result.data.DATA.rel;
  528. this.setFavorite();
  529. }
  530. })
  531. .catch((err) => {
  532. console.log(err);
  533. this.exhibitionList = [];
  534. });
  535. },
  536. async getFavorite() {
  537. this.favoriteSet.clear();
  538. if (this.$auth.loggedIn) {
  539. await this.$axios
  540. .get(
  541. `/trending/api/Favorite/Favorites?Type=Exhibition`
  542. )
  543. .then((result) => {
  544. if (result.data.DATA.rel) {
  545. let favoriteList = [];
  546. favoriteList = result.data.DATA.rel;
  547. favoriteList.forEach(item => {
  548. this.favoriteSet.add(item.ParentID);
  549. })
  550. }
  551. })
  552. .catch((err) => {
  553. console.log(err);
  554. });
  555. }
  556. },
  557. setFavorite() {
  558. if (this.exhibitionList.length > 0 && this.$auth.loggedIn) {
  559. for (let i = 0; i < this.exhibitionList.length; i++) {
  560. if (this.favoriteSet.has(this.exhibitionList[i].ExhibitionID)) {
  561. this.exhibitionList[i].IsFavorite = "Y";
  562. }
  563. }
  564. }
  565. },
  566. updateSortBy(data) {
  567. this.sortBy = data;
  568. this.getExhibitionCard();
  569. },
  570. updatePage(value) {
  571. this.page = value;
  572. },
  573. updateCategoryFilter(value) {
  574. this.selectedMainCategory = [];
  575. this.selectedSubCategory = [];
  576. value.forEach(key => {
  577. if (this.mainCategoryMap.has(key)) {
  578. this.selectedMainCategory.push(key);
  579. }
  580. if (this.subCategoryMap.has(key)) {
  581. this.selectedSubCategory.push(key);
  582. }
  583. });
  584. this.getExhibitionCard();
  585. },
  586. updateLocationFilter(value) {
  587. this.selectedRegion = [];
  588. this.selectedCountry = [];
  589. this.selectedCity = [];
  590. value.forEach(key => {
  591. if (this.regionMap.has(key)) {
  592. this.selectedRegion.push(key);
  593. }
  594. if (this.countryMap.has(key)) {
  595. this.selectedCountry.push(key);
  596. }
  597. if (this.cityMap.has(key)) {
  598. this.selectedCity.push(key);
  599. }
  600. });
  601. this.getExhibitionCard();
  602. },
  603. updateStatusFilter(value) {
  604. this.selectedStatus = [];
  605. value.forEach(key => {
  606. if (this.statusMap.has(key)) {
  607. this.selectedStatus.push(key);
  608. }
  609. });
  610. this.getExhibitionCard();
  611. },
  612. updateDateFilter(value) {
  613. this.selectedDates = value;
  614. this.getExhibitionCard();
  615. },
  616. async getQuery() {
  617. let vm = this;
  618. this.selectedMainCategory = [];
  619. this.selectedSubCategory = [];
  620. this.selectedCountry = [];
  621. this.selectedCity = [];
  622. this.query = "";
  623. // vm.categoryQueryFilter = {};
  624. console.log(this.$route.query);
  625. if (this.$route.query.category) {
  626. vm.categoryQueryFilter = vm.$route.query.category;
  627. this.selectedMainCategory.push(vm.$route.query.category);
  628. }
  629. if (this.$route.query.subcategory) {
  630. vm.categoryQueryFilter = vm.$route.query.subcategory;
  631. this.selectedSubCategory.push(vm.$route.query.subcategory);
  632. }
  633. if (this.$route.query.country) {
  634. vm.locationQueryFilter = vm.$route.query.country;
  635. this.selectedCountry.push(vm.$route.query.country);
  636. }
  637. if (this.$route.query.city) {
  638. vm.locationQueryFilter = vm.$route.query.city;
  639. this.selectedCity.push(vm.$route.query.city);
  640. }
  641. if (this.$route.query.q) {
  642. this.query = vm.$route.query.q;
  643. }
  644. this.getExhibitionCard();
  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>