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.

863 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
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.total;
  340. },
  341. pageLength() {
  342. return Math.ceil(this.result / this.perPageItems);
  343. },
  344. },
  345. watch: {
  346. page() {
  347. // window.scrollTo(0, 0);
  348. },
  349. $route() {
  350. this.getQuery();
  351. },
  352. },
  353. methods: {
  354. onResize() {
  355. if (process.client) {
  356. this.width = window.innerWidth;
  357. }
  358. },
  359. async fetchUser() {
  360. let userSavedList = [];
  361. if (this.$auth.loggedIn) {
  362. // await this.$axios
  363. // .get(
  364. // `/member/users/${this.$auth.$storage.getUniversal("jwt").user_id
  365. // }?jwt=${this.$auth.$storage.getUniversal("jwt").token}`
  366. // )
  367. // .then((res) => {
  368. // userSavedList = res.data.UserExhibition;
  369. // })
  370. // .catch((err) => {
  371. // console.log(err);
  372. // });
  373. }
  374. userSavedList = userSavedList.map((item) => item.exhibition_id);
  375. for (let i = 0; i < this.exhibitionList.length; i++) {
  376. if (userSavedList.includes(this.exhibitionList[i].id)) {
  377. this.exhibitionList[i].saved = true;
  378. } else {
  379. this.exhibitionList[i].saved = false;
  380. }
  381. }
  382. },
  383. getAdList() {
  384. this.ads = [
  385. {
  386. id: 'banner_1',
  387. image: require('/assets/img/banner/banner_1.png'),
  388. url: '/service?taiwan=taiwan'
  389. },
  390. {
  391. id: 'banner_2',
  392. image: require('/assets/img/banner/banner_2.png'),
  393. url: 'javascript:void(0);'
  394. },
  395. {
  396. id: 'banner_3',
  397. image: require('/assets/img/banner/banner_3.png'),
  398. url: 'javascript:void(0);'
  399. },
  400. {
  401. id: 'banner_4',
  402. image: require('/assets/img/banner/banner_4.png'),
  403. url: 'javascript:void(0);'
  404. },
  405. {
  406. id: 'banner_5',
  407. image: require('/assets/img/banner/banner_5.png'),
  408. url: 'javascript:void(0);'
  409. }
  410. ]
  411. },
  412. async getStatusList() {
  413. await this.$axios
  414. .get(
  415. `/trending/api/Exhibition/Statuses?Lang=${this.$i18n.localeProperties["langQuery"]}`
  416. )
  417. .then((result) => {
  418. if(result && result.data && result.data.DATA && result.data.DATA.rel){
  419. this.statuses = result.data.DATA.rel;
  420. this.statuses = this.statuses.map((item => {
  421. this.statusMap.set(item.Key, item.Value);
  422. return {
  423. title: item.Value,
  424. key: item.Key,
  425. };
  426. }));
  427. }
  428. })
  429. .catch((err) => {
  430. console.log(err);
  431. });
  432. },
  433. async getCategoryList() {
  434. await this.$axios
  435. .get(
  436. `/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`
  437. )
  438. .then((result) => {
  439. if(result && result.data && result.data.DATA && result.data.DATA.rel){
  440. this.categories = result.data.DATA.rel;
  441. this.categories = this.categories.map((item) => {
  442. this.mainCategoryMap.set(item.CategoryID, item);
  443. item.SubCategoryList = item.SubCategoryList.map(
  444. (children) => {
  445. this.subCategoryMap.set(children.CategoryID, children);
  446. return {
  447. title: children.CategoryName,
  448. key: children.CategoryID,
  449. };
  450. }
  451. );
  452. return {
  453. title: item.CategoryName,
  454. key: item.CategoryID,
  455. children: item.SubCategoryList,
  456. };
  457. });
  458. }
  459. })
  460. .catch((err) => {
  461. console.log(err);
  462. });
  463. },
  464. async getLocationList() {
  465. await this.$axios
  466. .get(
  467. `/trending/api/Exhibition/Locations?Lang=${this.$i18n.localeProperties["langQuery"]}`
  468. )
  469. .then((result) => {
  470. if(result && result.data && result.data.DATA && result.data.DATA.rel){
  471. var vm = this;
  472. vm.locations = result.data.DATA.rel;
  473. vm.locations = vm.locations.map((region) => {
  474. this.regionMap.set(region.RegionID, region);
  475. region.CountryList = region.CountryList.map((country) => {
  476. this.countryMap.set(country.CountryID, country);
  477. country.CityList = country.CityList.map((city) => {
  478. this.cityMap.set(city.CityID, city);
  479. return {
  480. title: city.CityName,
  481. key: city.CityID,
  482. };
  483. });
  484. return {
  485. title: country.CountryName,
  486. key: country.CountryID,
  487. children: country.CityList,
  488. };
  489. });
  490. return {
  491. title: region.RegionName,
  492. key: region.RegionID,
  493. children: region.CountryList,
  494. };
  495. });
  496. return result.data.DATA.rel;
  497. }
  498. })
  499. .catch((err) => {
  500. console.log(err);
  501. });
  502. },
  503. async getExhibitionCard() {
  504. // this.query = this.query + "工具機";
  505. // console.log("getExhibitionCard"+": "+this.query)
  506. await this.$axios
  507. .get(
  508. `/trending/api/Exhibition/Cards?Lang=${this.$i18n.localeProperties["langQuery"]}` +
  509. `&PageIndex=${this.currentPage}` +
  510. `&PageSize=${this.perPageItems}` +
  511. `&RegionIDs=${JSON.stringify(this.selectedRegion)}` +
  512. `&CountryIDs=${JSON.stringify(this.selectedCountry)}` +
  513. `&CityIDs=${JSON.stringify(this.selectedCity)}` +
  514. `&MainCategoryIDs=${JSON.stringify(this.selectedMainCategory)}` +
  515. `&SubCategoryIDs=${JSON.stringify(this.selectedSubCategory)}` +
  516. `&Status=${JSON.stringify(this.selectedStatus)}` +
  517. `&Date=${JSON.stringify(this.selectedDates)}` +
  518. `&Sort=${this.sortBy}` +
  519. `&Query=${this.query}`
  520. )
  521. .then((result) => {
  522. if(result && result.data && result.data.DATA && result.data.DATA.rel){
  523. let data = result.data.DATA.rel
  524. if(data.DataList.length>0){
  525. this.total = data.Total;
  526. this.exhibitionList = data.DataList;
  527. this.setFavorite();
  528. }
  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 && result.data && result.data.DATA && 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.query = "";
  568. this.sortBy = data;
  569. this.getExhibitionCard();
  570. },
  571. updatePage(value) {
  572. this.currentPage = value;
  573. this.getExhibitionCard();
  574. },
  575. updateCategoryFilter(value) {
  576. this.query = "";
  577. this.selectedMainCategory = [];
  578. this.selectedSubCategory = [];
  579. value.forEach(key => {
  580. if (this.mainCategoryMap.has(key)) {
  581. this.selectedMainCategory.push(key);
  582. }
  583. if (this.subCategoryMap.has(key)) {
  584. this.selectedSubCategory.push(key);
  585. }
  586. });
  587. this.getExhibitionCard();
  588. },
  589. updateLocationFilter(value) {
  590. this.query = "";
  591. this.selectedRegion = [];
  592. this.selectedCountry = [];
  593. this.selectedCity = [];
  594. value.forEach(key => {
  595. if (this.regionMap.has(key)) {
  596. this.selectedRegion.push(key);
  597. }
  598. if (this.countryMap.has(key)) {
  599. this.selectedCountry.push(key);
  600. }
  601. if (this.cityMap.has(key)) {
  602. this.selectedCity.push(key);
  603. }
  604. });
  605. this.getExhibitionCard();
  606. },
  607. updateStatusFilter(value) {
  608. this.query = "";
  609. this.selectedStatus = [];
  610. value.forEach(key => {
  611. if (this.statusMap.has(key)) {
  612. this.selectedStatus.push(key);
  613. }
  614. });
  615. this.getExhibitionCard();
  616. },
  617. updateDateFilter(value) {
  618. this.query = "";
  619. this.selectedDates = value;
  620. this.getExhibitionCard();
  621. },
  622. async getQuery() {
  623. let vm = this;
  624. this.selectedMainCategory = [];
  625. this.selectedSubCategory = [];
  626. this.selectedCountry = [];
  627. this.selectedCity = [];
  628. this.query = "";
  629. if (this.$route.query.category) {
  630. vm.categoryQueryFilter = vm.$route.query.category;
  631. this.selectedMainCategory.push(vm.$route.query.category);
  632. }
  633. if (this.$route.query.subcategory) {
  634. vm.categoryQueryFilter = vm.$route.query.subcategory;
  635. this.selectedSubCategory.push(vm.$route.query.subcategory);
  636. }
  637. if (this.$route.query.country) {
  638. vm.locationQueryFilter = vm.$route.query.country;
  639. this.selectedCountry.push(vm.$route.query.country);
  640. }
  641. if (this.$route.query.city) {
  642. vm.locationQueryFilter = vm.$route.query.city;
  643. this.selectedCity.push(vm.$route.query.city);
  644. }
  645. if (this.$route.query.q) {
  646. this.query = vm.$route.query.q;
  647. }
  648. this.getExhibitionCard();
  649. },
  650. sortServiceList(data) {
  651. switch (this.sortBy) {
  652. case "ShowEasy Recommended":
  653. return data;
  654. case "Exhibitor Numbers":
  655. function Exhibitors(a, b) {
  656. if (
  657. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") <
  658. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  659. )
  660. return 1;
  661. if (
  662. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") >
  663. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  664. )
  665. return -1;
  666. return 0;
  667. }
  668. return data.sort(Exhibitors);
  669. case "Visitor Numbers":
  670. function Visitor(a, b) {
  671. if (
  672. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") <
  673. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  674. )
  675. return 1;
  676. if (
  677. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") >
  678. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  679. )
  680. return -1;
  681. return 0;
  682. }
  683. return data.sort(Visitor);
  684. case "Show Dates":
  685. function Date(a, b) {
  686. if (a.startdate.replace(/-/g, "") < b.startdate.replace(/-/g, ""))
  687. return 1;
  688. if (a.startdate.replace(/-/g, "") > b.startdate.replace(/-/g, ""))
  689. return -1;
  690. return 0;
  691. }
  692. return data.sort(Date);
  693. default:
  694. return data;
  695. }
  696. },
  697. sliceRenderList(data) {
  698. return data.slice(
  699. (this.page - 1) * this.perPage,
  700. this.page * this.perPage
  701. );
  702. },
  703. },
  704. };
  705. </script>
  706. <style scoped lang="scss">
  707. .sort-by-text {
  708. max-width: 142px;
  709. >h3 {
  710. border-right: 1px solid #e5e5e5;
  711. }
  712. }
  713. .sort-by-text-sm {
  714. max-width: 112px;
  715. >h3 {
  716. border-right: 1px solid #e5e5e5;
  717. }
  718. }
  719. </style>
  720. <style lang="scss">
  721. .filter-zindex {
  722. z-index: 499 !important;
  723. }
  724. .exhibition-pagination {
  725. .v-pagination {
  726. justify-content: flex-end;
  727. }
  728. .v-pagination__navigation,
  729. .v-pagination__item {
  730. box-shadow: none;
  731. margin: 0;
  732. min-width: 28px;
  733. &.v-pagination__item--active {
  734. color: $primary-orange !important;
  735. }
  736. }
  737. }
  738. .v-breadcrumbs {
  739. padding: 0px;
  740. }
  741. .v-application ul {
  742. padding-left: 0px;
  743. }
  744. </style>