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