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.

826 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
  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. image: require('/assets/img/thems/Frame33.png')
  381. }, {
  382. image: require('/assets/img/thems/Frame33.png')
  383. }, {
  384. image: require('/assets/img/thems/Frame33.png')
  385. }]
  386. },
  387. getStatusList() {
  388. this.$axios
  389. .get(
  390. `/trending/api/Exhibition/Statuses?Lang=${this.$i18n.localeProperties["langQuery"]}`
  391. )
  392. .then((result) => {
  393. if (result.data.DATA.rel) {
  394. this.statuses = result.data.DATA.rel;
  395. this.statuses = this.statuses.map((item => {
  396. this.statusMap.set(item.Key, item.Value);
  397. return {
  398. title: item.Value,
  399. key: item.Key,
  400. };
  401. }));
  402. }
  403. })
  404. .catch((err) => {
  405. console.log(err);
  406. });
  407. },
  408. getCategoryList() {
  409. this.$axios
  410. .get(
  411. `/trending/api/Exhibition/Categories?Lang=${this.$i18n.localeProperties["langQuery"]}`
  412. )
  413. .then((result) => {
  414. if (result.data.DATA.rel) {
  415. this.categories = result.data.DATA.rel;
  416. this.categories = this.categories.map((item) => {
  417. this.mainCategoryMap.set(item.CategoryID, item);
  418. item.SubCategoryList = item.SubCategoryList.map(
  419. (children) => {
  420. this.subCategoryMap.set(children.CategoryID, children);
  421. return {
  422. title: children.CategoryName,
  423. key: children.CategoryID,
  424. };
  425. }
  426. );
  427. return {
  428. title: item.CategoryName,
  429. key: item.CategoryID,
  430. children: item.SubCategoryList,
  431. };
  432. });
  433. }
  434. })
  435. .catch((err) => {
  436. console.log(err);
  437. });
  438. },
  439. getLocationList() {
  440. this.$axios
  441. .get(
  442. `/trending/api/Exhibition/Locations?Lang=${this.$i18n.localeProperties["langQuery"]}`
  443. )
  444. .then((result) => {
  445. if (result.data.DATA.rel) {
  446. var vm = this;
  447. vm.locations = result.data.DATA.rel;
  448. vm.locations = vm.locations.map((region) => {
  449. this.regionMap.set(region.RegionID, region);
  450. region.CountryList = region.CountryList.map((country) => {
  451. this.countryMap.set(country.CountryID, country);
  452. country.CityList = country.CityList.map((city) => {
  453. this.cityMap.set(city.CityID, city);
  454. return {
  455. title: city.CityName,
  456. key: city.CityID,
  457. };
  458. });
  459. return {
  460. title: country.CountryName,
  461. key: country.CountryID,
  462. children: country.CityList,
  463. };
  464. });
  465. return {
  466. title: region.RegionName,
  467. key: region.RegionID,
  468. children: region.CountryList,
  469. };
  470. });
  471. return result.data.DATA.rel;
  472. }
  473. })
  474. .catch((err) => {
  475. console.log(err);
  476. });
  477. },
  478. getExhibitionCard() {
  479. let vm = this;
  480. if (this.$route.query.category) {
  481. vm.categoryQueryFilter = vm.$route.query.category;
  482. this.selectedMainCategory.push(vm.$route.query.category);
  483. }
  484. if (this.$route.query.subcategory) {
  485. vm.categoryQueryFilter = vm.$route.query.category;
  486. this.selectedSubCategory.push(vm.$route.query.subcategory);
  487. }
  488. if (this.$route.query.country) {
  489. vm.locationQueryFilter = vm.$route.query.country;
  490. this.selectedCountry.push(vm.$route.query.country);
  491. }
  492. this.$axios
  493. .get(
  494. `/trending/api/Exhibition/Cards?Lang=${this.$i18n.localeProperties["langQuery"]}` +
  495. `&RegionIDs=${JSON.stringify(this.selectedRegion)}` +
  496. `&CountryIDs=${JSON.stringify(this.selectedCountry)}` +
  497. `&CityIDs=${JSON.stringify(this.selectedCity)}` +
  498. `&MainCategoryIDs=${JSON.stringify(this.selectedMainCategory)}` +
  499. `&SubCategoryIDs=${JSON.stringify(this.selectedSubCategory)}` +
  500. `&Status=${JSON.stringify(this.selectedStatus)}` +
  501. `&Date=${JSON.stringify(this.selectedDates)}` +
  502. `&Sort=${this.sortBy}`
  503. )
  504. .then((result) => {
  505. if (result.data.DATA.rel) {
  506. this.exhibitionList = result.data.DATA.rel;
  507. this.setFavorite();
  508. }
  509. })
  510. .catch((err) => {
  511. console.log(err);
  512. this.exhibitionList = [];
  513. });
  514. },
  515. getFavorite() {
  516. this.favoriteSet.clear();
  517. if (this.$auth.loggedIn) {
  518. this.$axios
  519. .get(
  520. `/trending/api/Favorite/Favorites?Type=Exhibition`
  521. )
  522. .then((result) => {
  523. if (result.data.DATA.rel) {
  524. let favoriteList = [];
  525. favoriteList = result.data.DATA.rel;
  526. favoriteList.forEach(item => {
  527. this.favoriteSet.add(item.ParentID);
  528. })
  529. }
  530. })
  531. .catch((err) => {
  532. console.log(err);
  533. });
  534. }
  535. },
  536. setFavorite() {
  537. if (this.exhibitionList.length > 0 && this.$auth.loggedIn) {
  538. for (let i = 0; i < this.exhibitionList.length; i++) {
  539. if (this.favoriteSet.has(this.exhibitionList[i].ExhibitionID)) {
  540. this.exhibitionList[i].IsFavorite = "Y";
  541. }
  542. }
  543. }
  544. },
  545. updateSortBy(data) {
  546. this.sortBy = data;
  547. this.getExhibitionCard();
  548. },
  549. updatePage(value) {
  550. this.page = value;
  551. },
  552. updateCategoryFilter(value) {
  553. this.selectedMainCategory = [];
  554. this.selectedSubCategory = [];
  555. value.forEach(key => {
  556. if (this.mainCategoryMap.has(key)) {
  557. this.selectedMainCategory.push(key);
  558. }
  559. if (this.subCategoryMap.has(key)) {
  560. this.selectedSubCategory.push(key);
  561. }
  562. });
  563. this.getExhibitionCard();
  564. },
  565. updateLocationFilter(value) {
  566. this.selectedRegion = [];
  567. this.selectedCountry = [];
  568. this.selectedCity = [];
  569. value.forEach(key => {
  570. if (this.regionMap.has(key)) {
  571. this.selectedRegion.push(key);
  572. }
  573. if (this.countryMap.has(key)) {
  574. this.selectedCountry.push(key);
  575. }
  576. if (this.cityMap.has(key)) {
  577. this.selectedCity.push(key);
  578. }
  579. });
  580. this.getExhibitionCard();
  581. },
  582. updateStatusFilter(value) {
  583. this.selectedStatus = [];
  584. value.forEach(key => {
  585. if (this.statusMap.has(key)) {
  586. this.selectedStatus.push(key);
  587. }
  588. });
  589. this.getExhibitionCard();
  590. },
  591. updateDateFilter(value) {
  592. this.selectedDates = value;
  593. this.getExhibitionCard();
  594. },
  595. async getQuery() {
  596. let vm = this;
  597. this.categoryQueryFilter = "";
  598. this.locationQueryFilter = "";
  599. // if (this.$route.query.hasOwnProperty("country") && this.countryNameList.length>0) {
  600. // this.locationQueryFilter =
  601. // this.countryNameList[Number(this.$route.query.country)];
  602. // }
  603. // if (this.$route.query.hasOwnProperty("city") && this.cityNameList.length>0) {
  604. // this.locationQueryFilter =
  605. // this.cityNameList[Number(this.$route.query.city)];
  606. // }
  607. // if (this.$route.query.hasOwnProperty("region")) {
  608. // this.locationQueryFilter =
  609. // this.regionNameList[Number(this.$route.query.region)];
  610. // }
  611. // if (this.$route.query.hasOwnProperty("category") && this.categoryNameList.length>0) {
  612. // this.categoryQueryFilter =
  613. // this.categoryNameList[Number(this.$route.query.category)];
  614. // }
  615. // if (this.$route.query.hasOwnProperty("subcategory")) {
  616. // this.categoryQueryFilter =
  617. // this.unsortSubcategoryList[Number(this.$route.query.subcategory)];
  618. // }
  619. if (vm.$route.query.hasOwnProperty("category")) {
  620. vm.categoryQueryFilter = vm.$route.query.category;
  621. }
  622. if (vm.$route.query.hasOwnProperty("country")) {
  623. vm.locationQueryFilter = vm.$route.query.country;
  624. }
  625. },
  626. sortServiceList(data) {
  627. switch (this.sortBy) {
  628. case "ShowEasy Recommended":
  629. return data;
  630. case "Exhibitor Numbers":
  631. function Exhibitors(a, b) {
  632. if (
  633. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") <
  634. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  635. )
  636. return 1;
  637. if (
  638. Number(a.exhibitors ? a.exhibitors.replace(/[^0-9]/gi, "") : "") >
  639. Number(b.exhibitors ? b.exhibitors.replace(/[^0-9]/gi, "") : "")
  640. )
  641. return -1;
  642. return 0;
  643. }
  644. return data.sort(Exhibitors);
  645. case "Visitor Numbers":
  646. function Visitor(a, b) {
  647. if (
  648. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") <
  649. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  650. )
  651. return 1;
  652. if (
  653. Number(a.visitors ? a.visitors.replace(/[^0-9]/gi, "") : "") >
  654. Number(b.visitors ? b.visitors.replace(/[^0-9]/gi, "") : "")
  655. )
  656. return -1;
  657. return 0;
  658. }
  659. return data.sort(Visitor);
  660. case "Show Dates":
  661. function Date(a, b) {
  662. if (a.startdate.replace(/-/g, "") < b.startdate.replace(/-/g, ""))
  663. return 1;
  664. if (a.startdate.replace(/-/g, "") > b.startdate.replace(/-/g, ""))
  665. return -1;
  666. return 0;
  667. }
  668. return data.sort(Date);
  669. default:
  670. return data;
  671. }
  672. },
  673. sliceRenderList(data) {
  674. return data.slice(
  675. (this.page - 1) * this.perPage,
  676. this.page * this.perPage
  677. );
  678. },
  679. },
  680. };
  681. </script>
  682. <style scoped lang="scss">
  683. .sort-by-text {
  684. max-width: 142px;
  685. >h3 {
  686. border-right: 1px solid #e5e5e5;
  687. }
  688. }
  689. .sort-by-text-sm {
  690. max-width: 112px;
  691. >h3 {
  692. border-right: 1px solid #e5e5e5;
  693. }
  694. }
  695. </style>
  696. <style lang="scss">
  697. .filter-zindex {
  698. z-index: 499 !important;
  699. }
  700. .exhibition-pagination {
  701. .v-pagination {
  702. justify-content: flex-end;
  703. }
  704. .v-pagination__navigation,
  705. .v-pagination__item {
  706. box-shadow: none;
  707. margin: 0;
  708. min-width: 28px;
  709. &.v-pagination__item--active {
  710. color: $primary-orange !important;
  711. }
  712. }
  713. }
  714. .v-breadcrumbs {
  715. padding: 0px;
  716. }
  717. .v-application ul {
  718. padding-left: 0px;
  719. }
  720. </style>