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.

872 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
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. perPageItems: 10,
  210. currentPage: 1,
  211. total: 0,
  212. adList: [],
  213. exhibitionList: [],
  214. categoryChecked: [],
  215. locationChecked: [],
  216. ratingChecked: [],
  217. locations: [],
  218. selectedDates: [],
  219. selectedStatus: [],
  220. statusMap: new Map(),
  221. regionMap: new Map(),
  222. countryMap: new Map(),
  223. cityMap: new Map(),
  224. mainCategoryMap: new Map(),
  225. subCategoryMap: new Map(),
  226. selectedMainCategory: [],
  227. selectedSubCategory: [],
  228. selectedRegion: [],
  229. selectedCountry: [],
  230. selectedCity: [],
  231. favoriteSet: new Set(),
  232. categories: [],
  233. categoryQueryFilter: "",
  234. locationQueryFilter: "",
  235. width: undefined,
  236. sortType: [
  237. { name: "exhibition.Recommended", value: "Recommended" },
  238. { name: "exhibition.ShowDate", value: "ShowDate" },
  239. { name: "exhibition.ExhibitorCount", value: "ExhibitorCount" },
  240. { name: "exhibition.VisitorCount", value: "VisitorCount" },
  241. ],
  242. sortBy: "ShowDate",
  243. query: ""
  244. }),
  245. async created() {
  246. console.log("created");
  247. // to Fred
  248. // addjust async/sync orders
  249. this.isPageLoading = true;
  250. // this.getAdList();
  251. await this.getStatusList();
  252. await this.getLocationList();
  253. await this.getCategoryList();
  254. await this.getFavorite();
  255. await this.getQuery();
  256. // await this.getExhibitionCard();
  257. // this.getQuery();
  258. // await this.getUnsortLocationList();
  259. // await this.getUnsortCategoryList();
  260. // await this.getQuery();
  261. // if (this.$route.query.hasOwnProperty("q")) {
  262. // this.sortType.splice(0, 0, {
  263. // name: "ShowEasy Recommended",
  264. // value: "ShowEasy Recommended",
  265. // });
  266. // this.sortBy = "ShowEasy Recommended";
  267. // }
  268. // let userSavedList = [];
  269. // if (this.$auth.loggedIn) {
  270. // // await this.$axios
  271. // // .get(
  272. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  273. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  274. // // )
  275. // // .then((res) => {
  276. // // userSavedList = res.data.UserExhibition;
  277. // // })
  278. // // .catch((err) => {
  279. // // console.log(err);
  280. // // });
  281. // // this.$store.dispatch("updatePicture");
  282. // // this.$nextTick(() => {
  283. // // this.$forceUpdate();
  284. // // });
  285. // }
  286. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  287. // for (let i = 0; i < this.exhibitionList.length; i++) {
  288. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  289. // this.exhibitionList[i].saved = true;
  290. // } else {
  291. // this.exhibitionList[i].saved = false;
  292. // }
  293. // }
  294. if (process.client) {
  295. this.width = window.innerWidth;
  296. }
  297. this.$nextTick(() => {
  298. this.isPageLoading = false;
  299. });
  300. },
  301. async mounted() {
  302. console.log("mounted");
  303. // let userSavedList = [];
  304. // if (this.$auth.loggedIn) {
  305. // // await this.$axios
  306. // // .get(
  307. // // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  308. // // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  309. // // )
  310. // // .then((res) => {
  311. // // userSavedList = res.data.UserExhibition;
  312. // // })
  313. // // .catch((err) => {
  314. // // console.log(err);
  315. // // });
  316. // // this.$store.dispatch("updatePicture");
  317. // // this.$nextTick(() => {
  318. // // this.$forceUpdate();
  319. // // });
  320. // }
  321. // userSavedList = userSavedList.map((item) => item.exhibition_id);
  322. // for (let i = 0; i < this.exhibitionList.length; i++) {
  323. // if (userSavedList.includes(this.exhibitionList[i].id)) {
  324. // this.exhibitionList[i].saved = true;
  325. // } else {
  326. // this.exhibitionList[i].saved = false;
  327. // }
  328. // }
  329. this.$nextTick(() => {
  330. window.addEventListener("resize", this.onResize);
  331. });
  332. },
  333. beforeDestroy() {
  334. window.removeEventListener("resize", this.onResize);
  335. this.fetchUser();
  336. },
  337. computed: {
  338. // result() {
  339. // // return this.exhibitionsFilter.length;
  340. // return this.exhibitionList.length;
  341. // },
  342. // pageLength() {
  343. // return Math.ceil(this.totalPages / this.perPage);
  344. // },
  345. // renderList() {
  346. // return this.sliceRenderList(this.exhibitionsFilter);
  347. // },
  348. result() {
  349. return this.total;
  350. },
  351. pageLength() {
  352. return Math.ceil(this.result / this.perPageItems);
  353. },
  354. },
  355. watch: {
  356. page() {
  357. // window.scrollTo(0, 0);
  358. },
  359. $route() {
  360. // console.log("route");
  361. this.getQuery();
  362. },
  363. },
  364. methods: {
  365. onResize() {
  366. if (process.client) {
  367. this.width = window.innerWidth;
  368. }
  369. },
  370. async fetchUser() {
  371. let userSavedList = [];
  372. if (this.$auth.loggedIn) {
  373. // await this.$axios
  374. // .get(
  375. // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  376. // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  377. // )
  378. // .then((res) => {
  379. // userSavedList = res.data.UserExhibition;
  380. // })
  381. // .catch((err) => {
  382. // console.log(err);
  383. // });
  384. }
  385. userSavedList = userSavedList.map((item) => item.exhibition_id);
  386. for (let i = 0; i < this.exhibitionList.length; i++) {
  387. if (userSavedList.includes(this.exhibitionList[i].id)) {
  388. this.exhibitionList[i].saved = true;
  389. } else {
  390. this.exhibitionList[i].saved = false;
  391. }
  392. }
  393. },
  394. getAdList() {
  395. this.ads = [
  396. {
  397. id: 'banner_1',
  398. image: require('/assets/img/banner/banner_1.png'),
  399. url: '/service?taiwan=taiwan'
  400. },
  401. {
  402. id: 'banner_2',
  403. image: require('/assets/img/banner/banner_2.png'),
  404. url: 'javascript:void(0);'
  405. },
  406. {
  407. id: 'banner_3',
  408. image: require('/assets/img/banner/banner_3.png'),
  409. url: 'javascript:void(0);'
  410. },
  411. {
  412. id: 'banner_4',
  413. image: require('/assets/img/banner/banner_4.png'),
  414. url: 'javascript:void(0);'
  415. },
  416. {
  417. id: 'banner_5',
  418. image: require('/assets/img/banner/banner_5.png'),
  419. url: 'javascript:void(0);'
  420. }
  421. ]
  422. },
  423. async getStatusList() {
  424. await this.$axios
  425. .get(
  426. `/trending/api/Exhibition/Statuses?Lang=${this.$i18n.localeProperties["langQuery"]}`
  427. )
  428. .then((result) => {
  429. if (result.data.DATA.rel) {
  430. this.statuses = result.data.DATA.rel;
  431. this.statuses = this.statuses.map((item => {
  432. this.statusMap.set(item.Key, item.Value);
  433. return {
  434. title: item.Value,
  435. key: item.Key,
  436. };
  437. }));
  438. }
  439. })
  440. .catch((err) => {
  441. console.log(err);
  442. });
  443. },
  444. async getCategoryList() {
  445. await this.$axios
  446. .get(
  447. `/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`
  448. )
  449. .then((result) => {
  450. if (result.data.DATA.rel) {
  451. this.categories = result.data.DATA.rel;
  452. this.categories = this.categories.map((item) => {
  453. this.mainCategoryMap.set(item.CategoryID, item);
  454. item.SubCategoryList = item.SubCategoryList.map(
  455. (children) => {
  456. this.subCategoryMap.set(children.CategoryID, children);
  457. return {
  458. title: children.CategoryName,
  459. key: children.CategoryID,
  460. };
  461. }
  462. );
  463. return {
  464. title: item.CategoryName,
  465. key: item.CategoryID,
  466. children: item.SubCategoryList,
  467. };
  468. });
  469. }
  470. })
  471. .catch((err) => {
  472. console.log(err);
  473. });
  474. },
  475. async getLocationList() {
  476. await this.$axios
  477. .get(
  478. `/trending/api/Exhibition/Locations?Lang=${this.$i18n.localeProperties["langQuery"]}`
  479. )
  480. .then((result) => {
  481. if (result.data.DATA.rel) {
  482. var vm = this;
  483. vm.locations = result.data.DATA.rel;
  484. vm.locations = vm.locations.map((region) => {
  485. this.regionMap.set(region.RegionID, region);
  486. region.CountryList = region.CountryList.map((country) => {
  487. this.countryMap.set(country.CountryID, country);
  488. country.CityList = country.CityList.map((city) => {
  489. this.cityMap.set(city.CityID, city);
  490. return {
  491. title: city.CityName,
  492. key: city.CityID,
  493. };
  494. });
  495. return {
  496. title: country.CountryName,
  497. key: country.CountryID,
  498. children: country.CityList,
  499. };
  500. });
  501. return {
  502. title: region.RegionName,
  503. key: region.RegionID,
  504. children: region.CountryList,
  505. };
  506. });
  507. return result.data.DATA.rel;
  508. }
  509. })
  510. .catch((err) => {
  511. console.log(err);
  512. });
  513. },
  514. async getExhibitionCard() {
  515. await this.$axios
  516. .get(
  517. `/trending/api/Exhibition/Cards?Lang=${this.$i18n.localeProperties["langQuery"]}` +
  518. `&PageIndex=${this.currentPage}` +
  519. `&PageSize=${this.perPageItems}` +
  520. `&RegionIDs=${JSON.stringify(this.selectedRegion)}` +
  521. `&CountryIDs=${JSON.stringify(this.selectedCountry)}` +
  522. `&CityIDs=${JSON.stringify(this.selectedCity)}` +
  523. `&MainCategoryIDs=${JSON.stringify(this.selectedMainCategory)}` +
  524. `&SubCategoryIDs=${JSON.stringify(this.selectedSubCategory)}` +
  525. `&Status=${JSON.stringify(this.selectedStatus)}` +
  526. `&Date=${JSON.stringify(this.selectedDates)}` +
  527. `&Sort=${this.sortBy}` +
  528. `&Query=${this.query}`
  529. )
  530. .then((result) => {
  531. console.table(result);
  532. if(result && result.data && result.data.DATA && result.data.DATA.rel){
  533. let data = result.data.DATA.rel
  534. if(data.DataList.length>0){
  535. this.total = data.Total;
  536. this.exhibitionList = data.DataList;
  537. this.setFavorite();
  538. }
  539. }
  540. })
  541. .catch((err) => {
  542. console.log(err);
  543. this.exhibitionList = [];
  544. });
  545. },
  546. async getFavorite() {
  547. this.favoriteSet.clear();
  548. if (this.$auth.loggedIn) {
  549. await this.$axios
  550. .get(
  551. `/trending/api/Favorite/Favorites?Type=Exhibition`
  552. )
  553. .then((result) => {
  554. if (result.data.DATA.rel) {
  555. let favoriteList = [];
  556. favoriteList = result.data.DATA.rel;
  557. favoriteList.forEach(item => {
  558. this.favoriteSet.add(item.ParentID);
  559. })
  560. }
  561. })
  562. .catch((err) => {
  563. console.log(err);
  564. });
  565. }
  566. },
  567. setFavorite() {
  568. if (this.exhibitionList.length > 0 && this.$auth.loggedIn) {
  569. for (let i = 0; i < this.exhibitionList.length; i++) {
  570. if (this.favoriteSet.has(this.exhibitionList[i].ExhibitionID)) {
  571. this.exhibitionList[i].IsFavorite = "Y";
  572. }
  573. }
  574. }
  575. },
  576. updateSortBy(data) {
  577. this.query = "";
  578. this.sortBy = data;
  579. this.getExhibitionCard();
  580. },
  581. updatePage(value) {
  582. this.currentPage = value;
  583. this.getExhibitionCard();
  584. },
  585. updateCategoryFilter(value) {
  586. this.query = "";
  587. this.selectedMainCategory = [];
  588. this.selectedSubCategory = [];
  589. value.forEach(key => {
  590. if (this.mainCategoryMap.has(key)) {
  591. this.selectedMainCategory.push(key);
  592. }
  593. if (this.subCategoryMap.has(key)) {
  594. this.selectedSubCategory.push(key);
  595. }
  596. });
  597. this.getExhibitionCard();
  598. },
  599. updateLocationFilter(value) {
  600. this.query = "";
  601. this.selectedRegion = [];
  602. this.selectedCountry = [];
  603. this.selectedCity = [];
  604. value.forEach(key => {
  605. if (this.regionMap.has(key)) {
  606. this.selectedRegion.push(key);
  607. }
  608. if (this.countryMap.has(key)) {
  609. this.selectedCountry.push(key);
  610. }
  611. if (this.cityMap.has(key)) {
  612. this.selectedCity.push(key);
  613. }
  614. });
  615. this.getExhibitionCard();
  616. },
  617. updateStatusFilter(value) {
  618. this.query = "";
  619. this.selectedStatus = [];
  620. value.forEach(key => {
  621. if (this.statusMap.has(key)) {
  622. this.selectedStatus.push(key);
  623. }
  624. });
  625. this.getExhibitionCard();
  626. },
  627. updateDateFilter(value) {
  628. this.query = "";
  629. this.selectedDates = value;
  630. this.getExhibitionCard();
  631. },
  632. async getQuery() {
  633. let vm = this;
  634. this.selectedMainCategory = [];
  635. this.selectedSubCategory = [];
  636. this.selectedCountry = [];
  637. this.selectedCity = [];
  638. this.query = "";
  639. if (this.$route.query.category) {
  640. vm.categoryQueryFilter = vm.$route.query.category;
  641. this.selectedMainCategory.push(vm.$route.query.category);
  642. }
  643. if (this.$route.query.subcategory) {
  644. vm.categoryQueryFilter = vm.$route.query.subcategory;
  645. this.selectedSubCategory.push(vm.$route.query.subcategory);
  646. }
  647. if (this.$route.query.country) {
  648. vm.locationQueryFilter = vm.$route.query.country;
  649. this.selectedCountry.push(vm.$route.query.country);
  650. }
  651. if (this.$route.query.city) {
  652. vm.locationQueryFilter = vm.$route.query.city;
  653. this.selectedCity.push(vm.$route.query.city);
  654. }
  655. if (this.$route.query.q) {
  656. this.query = vm.$route.query.q;
  657. }
  658. this.getExhibitionCard();
  659. },
  660. sortServiceList(data) {
  661. switch (this.sortBy) {
  662. case "ShowEasy Recommended":
  663. return data;
  664. case "Exhibitor Numbers":
  665. function Exhibitors(a, b) {
  666. if (
  667. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") <
  668. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  669. )
  670. return 1;
  671. if (
  672. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") >
  673. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  674. )
  675. return -1;
  676. return 0;
  677. }
  678. return data.sort(Exhibitors);
  679. case "Visitor Numbers":
  680. function Visitor(a, b) {
  681. if (
  682. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") <
  683. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  684. )
  685. return 1;
  686. if (
  687. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") >
  688. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  689. )
  690. return -1;
  691. return 0;
  692. }
  693. return data.sort(Visitor);
  694. case "Show Dates":
  695. function Date(a, b) {
  696. if (a.startdate.replace(/-/g, "") < b.startdate.replace(/-/g, ""))
  697. return 1;
  698. if (a.startdate.replace(/-/g, "") > b.startdate.replace(/-/g, ""))
  699. return -1;
  700. return 0;
  701. }
  702. return data.sort(Date);
  703. default:
  704. return data;
  705. }
  706. },
  707. sliceRenderList(data) {
  708. return data.slice(
  709. (this.page - 1) * this.perPage,
  710. this.page * this.perPage
  711. );
  712. },
  713. },
  714. };
  715. </script>
  716. <style scoped lang="scss">
  717. .sort-by-text {
  718. max-width: 142px;
  719. >h3 {
  720. border-right: 1px solid #e5e5e5;
  721. }
  722. }
  723. .sort-by-text-sm {
  724. max-width: 112px;
  725. >h3 {
  726. border-right: 1px solid #e5e5e5;
  727. }
  728. }
  729. </style>
  730. <style lang="scss">
  731. .filter-zindex {
  732. z-index: 499 !important;
  733. }
  734. .exhibition-pagination {
  735. .v-pagination {
  736. justify-content: flex-end;
  737. }
  738. .v-pagination__navigation,
  739. .v-pagination__item {
  740. box-shadow: none;
  741. margin: 0;
  742. min-width: 28px;
  743. &.v-pagination__item--active {
  744. color: $primary-orange !important;
  745. }
  746. }
  747. }
  748. .v-breadcrumbs {
  749. padding: 0px;
  750. }
  751. .v-application ul {
  752. padding-left: 0px;
  753. }
  754. </style>