chenlei 11 月之前
父節點
當前提交
589c0a0c02

+ 2 - 1
.env.development

@@ -1 +1,2 @@
-VITE_BASE_URL=https://sit-shoubov2.4dage.com
+VITE_BASE_URL=https://sit-shoubov2.4dage.com
+VITE_MEDIA_BASE_URL=http://192.168.20.245:8008

+ 8 - 1
src/api/publications.ts

@@ -7,7 +7,7 @@ import {
 export interface PublishListParams extends PaginationParams {
 export interface PublishListParams extends PaginationParams {
   type?: "Magazines" | "Exhibition";
   type?: "Magazines" | "Exhibition";
   searchKey?: string;
   searchKey?: string;
-  year?: number;
+  year?: string;
 }
 }
 
 
 /**
 /**
@@ -40,3 +40,10 @@ export const getPublishListApi = async (params: PublishListParams) => {
 export const getPublishDetailApi = async (id: string | number) => {
 export const getPublishDetailApi = async (id: string | number) => {
   return requestByGet<PublicationDetail>(`/api/show/publish/detail/${id}`);
   return requestByGet<PublicationDetail>(`/api/show/publish/detail/${id}`);
 };
 };
+
+/**
+ * 获取有数据的年份列表
+ */
+export const getMagazineYearListApi = () => {
+  return requestByGet<string[]>("/api/show/publish/getYear");
+};

+ 3 - 0
src/assets/css/base.css

@@ -242,3 +242,6 @@ a:hover {
 .media-wrap {
 .media-wrap {
   text-align: center;
   text-align: center;
 }
 }
+.media-wrap > * {
+  max-width: 100%;
+}

+ 3 - 1
src/components/Accessibility/index.vue

@@ -743,7 +743,9 @@ export default {
             if (that.audioPlayer && !that.audioPlayer.ended) {
             if (that.audioPlayer && !that.audioPlayer.ended) {
               that.audioPlayer.pause();
               that.audioPlayer.pause();
             }
             }
-            that.audioPlayer = new Audio(location.origin + res.msg);
+            that.audioPlayer = new Audio(
+              (import.meta.env.VITE_MEDIA_BASE_URL || location.origin) + res.msg
+            );
             that.audioPlayer.muted = that.ariaSettings.isMuted;
             that.audioPlayer.muted = that.ariaSettings.isMuted;
             that.audioPlayer.playbackRate =
             that.audioPlayer.playbackRate =
               speechRateFactors[that.ariaSettings.speechRateLevel];
               speechRateFactors[that.ariaSettings.speechRateLevel];

+ 37 - 36
src/components/PageTitle/index.vue

@@ -1,36 +1,37 @@
-<template>
-  <div class="page-title">
-    <img src="./pLeft.jpg" />
-    <span tabindex="1" :aria-description="title">{{ title }}</span>
-  </div>
-</template>
-
-<script lang="ts" setup>
-defineProps<{
-  title?: string;
-}>();
-</script>
-
-<style lang="scss" scoped>
-.page-title {
-  position: relative;
-  display: flex;
-  margin-bottom: 20px;
-  height: 65px;
-  align-items: center;
-  font-size: 24px;
-  font-weight: bold;
-  text-indent: 5px;
-  border-bottom: 1px solid var(--black-text-color);
-
-  &::after {
-    content: "";
-    position: absolute;
-    bottom: -1px;
-    left: 0;
-    width: 80px;
-    height: 2px;
-    background: var(--van-primary-color);
-  }
-}
-</style>
+<template>
+  <div class="page-title">
+    <img src="./pLeft.jpg" />
+    <span tabindex="1" :aria-description="title">{{ title }}</span>
+  </div>
+</template>
+
+<script lang="ts" setup>
+defineProps<{
+  title?: string;
+}>();
+</script>
+
+<style lang="scss" scoped>
+.page-title {
+  position: relative;
+  display: flex;
+  margin-bottom: 20px;
+  min-height: 65px;
+  line-height: 40px;
+  align-items: center;
+  font-size: 24px;
+  font-weight: bold;
+  text-indent: 5px;
+  border-bottom: 1px solid var(--black-text-color);
+
+  &::after {
+    content: "";
+    position: absolute;
+    bottom: -1px;
+    left: 0;
+    width: 80px;
+    height: 2px;
+    background: var(--van-primary-color);
+  }
+}
+</style>

+ 14 - 16
src/views/Collections/index.vue

@@ -162,27 +162,25 @@ onBeforeUnmount(() => {
   window.removeEventListener("scroll", handleScroll);
   window.removeEventListener("scroll", handleScroll);
 });
 });
 
 
-watch(sourceList, (v) => {
+watch(sourceList, async (v) => {
   if (!v.length) return;
   if (!v.length) return;
 
 
   rendering.value = true;
   rendering.value = true;
 
 
-  const promises = v.map(async (i) => {
-    const url = baseUrl + i.thumb;
-    const ratio = await getImgRatio(url);
-
-    list.value.push({
-      ...i,
-      imgHeight: 303 * ratio,
-      src: url,
-    });
-
-    return i;
-  });
-
-  Promise.allSettled(promises).then(() => {
+  try {
+    for (const i of v) {
+      const url = baseUrl + i.thumb;
+      const ratio = await getImgRatio(url);
+
+      list.value.push({
+        ...i,
+        imgHeight: 303 * ratio,
+        src: url,
+      });
+    }
+  } finally {
     rendering.value = false;
     rendering.value = false;
-  });
+  }
 });
 });
 
 
 watch(
 watch(

+ 15 - 7
src/views/Events/detail.vue

@@ -91,7 +91,7 @@ import {
 import Breadcrumb from "@/components/Breadcrumb/index.vue";
 import Breadcrumb from "@/components/Breadcrumb/index.vue";
 import { getFormatDate } from "@/utils/date";
 import { getFormatDate } from "@/utils/date";
 import { getBaseURL } from "@dage/service";
 import { getBaseURL } from "@dage/service";
-import { onMounted, ref } from "vue";
+import { ref, watch } from "vue";
 import { useRoute } from "vue-router";
 import { useRoute } from "vue-router";
 
 
 interface PrivateEventDetail extends EventDetail {
 interface PrivateEventDetail extends EventDetail {
@@ -106,11 +106,6 @@ const tabIndex = ref(0);
 const detail = ref<PrivateEventDetail | null>(null);
 const detail = ref<PrivateEventDetail | null>(null);
 const recommendList = ref<EventListItem[]>([]);
 const recommendList = ref<EventListItem[]>([]);
 
 
-onMounted(() => {
-  getDetail();
-  getRecommendList();
-});
-
 const getDetail = async () => {
 const getDetail = async () => {
   try {
   try {
     loading.value = true;
     loading.value = true;
@@ -119,11 +114,13 @@ const getDetail = async () => {
 
 
     detail.value = {
     detail.value = {
       ...data,
       ...data,
-      titleArr: JSON.parse(data.rtfTitle),
+      titleArr: JSON.parse(data.rtfTitle).filter((i: string) => Boolean(i)),
       txtArr: data.rtf ? JSON.parse(data.rtf).txtArr : [],
       txtArr: data.rtf ? JSON.parse(data.rtf).txtArr : [],
     };
     };
 
 
     if (routeId.length > 1) tabIndex.value = Number(routeId[1]);
     if (routeId.length > 1) tabIndex.value = Number(routeId[1]);
+
+    toTop();
   } finally {
   } finally {
     loading.value = false;
     loading.value = false;
   }
   }
@@ -141,6 +138,17 @@ const getRecommendList = async () => {
 const toTop = () => {
 const toTop = () => {
   window.scrollTo({ top: 0, behavior: "smooth" });
   window.scrollTo({ top: 0, behavior: "smooth" });
 };
 };
+
+watch(
+  route,
+  () => {
+    getDetail();
+    getRecommendList();
+  },
+  {
+    immediate: true,
+  }
+);
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 15 - 1
src/views/Events/index.scss

@@ -53,17 +53,31 @@
       }
       }
     }
     }
     &__container {
     &__container {
-      padding: 15px 0;
+      margin: 15px 0;
       font-family: Georgia;
       font-family: Georgia;
       font-size: 16px;
       font-size: 16px;
       color: hsla(0, 0%, 100%, 0.7);
       color: hsla(0, 0%, 100%, 0.7);
       line-height: 20px;
       line-height: 20px;
+      max-height: 300px;
+      overflow-y: auto;
 
 
       p {
       p {
         margin: 0 auto;
         margin: 0 auto;
         width: 350px;
         width: 350px;
         text-align: left;
         text-align: left;
       }
       }
+      &::-webkit-scrollbar {
+        width: 6px;
+        height: 1px;
+      }
+      &::-webkit-scrollbar-thumb {
+        border-radius: 10px;
+        background: hsla(0, 0%, 100%, 0.7);
+      }
+      &::-webkit-scrollbar-track {
+        border-radius: 10px;
+        background: transparent;
+      }
     }
     }
     i {
     i {
       font-family: Georgia;
       font-family: Georgia;

+ 2 - 2
src/views/Events/index.vue

@@ -33,7 +33,7 @@
             >
             >
               <div class="events-page-item__main">
               <div class="events-page-item__main">
                 <div class="events-page-item__hd">
                 <div class="events-page-item__hd">
-                  <h2>{{ item.name }}</h2>
+                  <h2 class="limit-line line-2">{{ item.name }}</h2>
                   <!-- <p>International Symposium</p> -->
                   <!-- <p>International Symposium</p> -->
                 </div>
                 </div>
 
 
@@ -89,7 +89,7 @@ const {
 const list = computed(() =>
 const list = computed(() =>
   _list.value.map((i) => ({
   _list.value.map((i) => ({
     ...i,
     ...i,
-    _rtfTitle: JSON.parse(i.rtfTitle),
+    _rtfTitle: JSON.parse(i.rtfTitle).filter((i: string) => Boolean(i)),
     date: getFormatDate(i.dateStart, i.dateEnd),
     date: getFormatDate(i.dateStart, i.dateEnd),
   }))
   }))
 );
 );

+ 3 - 2
src/views/Exhibitions/Detail/components/Objects.vue

@@ -19,14 +19,14 @@
         />
         />
 
 
         <div class="exh-detail-object-item__mask">
         <div class="exh-detail-object-item__mask">
-          <p>{{ item.fileName }}</p>
+          <p class="limit-line line-4">{{ item.fileName }}</p>
           <div>
           <div>
             <SvgIcon
             <SvgIcon
               name="download"
               name="download"
               color="var(--white-text-color)"
               color="var(--white-text-color)"
               style="width: 26px; height: 26px"
               style="width: 26px; height: 26px"
             />
             />
-            <a :href="item.filePath" download tabindex="0"> Download </a>
+            <a :href="baseUrl + item.filePath" download> Download </a>
           </div>
           </div>
           <div @click="handlePreview(item.filePath)">
           <div @click="handlePreview(item.filePath)">
             <SvgIcon
             <SvgIcon
@@ -145,6 +145,7 @@ defineExpose({
         color: white;
         color: white;
         font-size: 18px;
         font-size: 18px;
         line-height: 24px;
         line-height: 24px;
+        word-break: break-all;
       }
       }
     }
     }
   }
   }

+ 5 - 10
src/views/Exhibitions/Detail/components/Overview.vue

@@ -4,27 +4,22 @@
     class="exh-detail-overview"
     class="exh-detail-overview"
     :style="{ height: hasMore ? `${height}px` : 'auto' }"
     :style="{ height: hasMore ? `${height}px` : 'auto' }"
   >
   >
-    <div
-      class="exh-detail-overview-hd"
-      data-aria-viewport-area
-      tabindex="0"
-      aria-description="You've reached the section of exhibition title, please use the tab key to navigate through the content."
-    >
-      <p class="title">{{ detail?.name }}</p>
+    <div class="exh-detail-overview-hd">
+      <p class="title" tabindex="0">{{ detail?.name }}</p>
       <div>
       <div>
         <div v-if="detail?.dateStart">
         <div v-if="detail?.dateStart">
           <img :src="DateIcon" style="width: 18px; height: 20px" />
           <img :src="DateIcon" style="width: 18px; height: 20px" />
-          <p style="padding: 0 15px">{{ date }}</p>
+          <p tabindex="0" style="padding: 0 15px">{{ date }}</p>
         </div>
         </div>
         <div v-if="detail?.typeRemark">
         <div v-if="detail?.typeRemark">
           <img :src="ClockIcon" style="width: 20px; height: 20px" />
           <img :src="ClockIcon" style="width: 20px; height: 20px" />
-          <p style="padding: 0 15px">
+          <p tabindex="0" style="padding: 0 15px">
             {{ detail.typeRemark }}
             {{ detail.typeRemark }}
           </p>
           </p>
         </div>
         </div>
         <div>
         <div>
           <img :src="AddressIcon" style="width: 14px; height: 20px" />
           <img :src="AddressIcon" style="width: 14px; height: 20px" />
-          <p style="padding-left: 15px">{{ detail?.address }}</p>
+          <p tabindex="0" style="padding-left: 15px">{{ detail?.address }}</p>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>

+ 21 - 30
src/views/Publications/Detail/index.scss

@@ -9,40 +9,31 @@
     }
     }
   }
   }
   &__hd {
   &__hd {
-    position: relative;
     margin-bottom: 23px;
     margin-bottom: 23px;
     color: white;
     color: white;
-    height: 329px;
+    min-height: 329px;
+    background: url("../images/infoBan.jpg") 0 0 #7f694a;
 
 
-    > div {
-      position: absolute;
-      left: 0;
-      top: 0;
-      width: 100%;
-      height: inherit;
-      background: url("../images/infoBan.jpg") 0 0 no-repeat #7f694a;
+    .container {
+      display: flex;
+      padding-top: 15px;
+      gap: 30px;
+      width: 1125px;
+      font-size: 42px;
+      line-height: 60px;
+      font-weight: 700;
+      color: white;
 
 
-      .container {
-        display: flex;
-        padding-top: 15px;
-        gap: 30px;
-        width: 1125px;
-        font-size: 42px;
-        line-height: 60px;
-        font-weight: 700;
-        color: white;
-
-        p {
-          padding-top: 70px;
-          flex: 1;
-        }
-        img {
-          flex-shrink: 0;
-          width: 275px;
-          height: 314px;
-          object-fit: contain;
-          object-position: center bottom;
-        }
+      p {
+        padding: 70px 0 30px;
+        flex: 1;
+      }
+      img {
+        flex-shrink: 0;
+        width: 275px;
+        height: 314px;
+        object-fit: contain;
+        object-position: center bottom;
       }
       }
     }
     }
   }
   }

+ 3 - 5
src/views/Publications/Detail/index.vue

@@ -1,12 +1,10 @@
 <template>
 <template>
   <div v-loading="loading" class="publications-detail">
   <div v-loading="loading" class="publications-detail">
     <div class="publications-detail__hd">
     <div class="publications-detail__hd">
-      <div>
-        <div class="container">
-          <p>{{ detail?.name }}</p>
+      <div class="container">
+        <p>{{ detail?.name }}</p>
 
 
-          <img v-if="detail" :src="baseUrl + detail.thumb" />
-        </div>
+        <img v-if="detail" :src="baseUrl + detail.thumb" />
       </div>
       </div>
     </div>
     </div>
 
 

+ 15 - 11
src/views/Publications/Magazines/index.vue

@@ -91,20 +91,17 @@
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { computed, onMounted, ref } from "vue";
 import { computed, onMounted, ref } from "vue";
 import { MAGAZINES_INFO } from "../constants";
 import { MAGAZINES_INFO } from "../constants";
-import { getPublishListApi, type PubicationItem } from "@/api";
+import {
+  getMagazineYearListApi,
+  getPublishListApi,
+  type PubicationItem,
+} from "@/api";
 import { getBaseURL } from "@dage/service";
 import { getBaseURL } from "@dage/service";
 import { debounce } from "lodash-unified";
 import { debounce } from "lodash-unified";
 
 
 const PAGE_SIZE = 8;
 const PAGE_SIZE = 8;
 
 
-const MIN_YEAR = 2017;
-const date = new Date();
-const year = date.getFullYear();
-const years = Array.from(
-  { length: year - MIN_YEAR + 1 },
-  (_, index) => year - index
-);
-
+const years = ref<string[]>([]);
 const curInfoIndex = ref(0);
 const curInfoIndex = ref(0);
 const curDateIndex = ref(0);
 const curDateIndex = ref(0);
 const baseUrl = getBaseURL();
 const baseUrl = getBaseURL();
@@ -116,7 +113,7 @@ const loading = ref(false);
 const list = ref<PubicationItem[]>([]);
 const list = ref<PubicationItem[]>([]);
 
 
 onMounted(() => {
 onMounted(() => {
-  getList();
+  getMagazineYearList();
 });
 });
 
 
 const debounceSearch = debounce(() => {
 const debounceSearch = debounce(() => {
@@ -124,13 +121,20 @@ const debounceSearch = debounce(() => {
   getList();
   getList();
 }, 500);
 }, 500);
 
 
+const getMagazineYearList = async () => {
+  const data = await getMagazineYearListApi();
+  years.value = data;
+
+  getList();
+};
+
 const getList = async () => {
 const getList = async () => {
   try {
   try {
     loading.value = true;
     loading.value = true;
     const data = await getPublishListApi({
     const data = await getPublishListApi({
       pageSize: PAGE_SIZE,
       pageSize: PAGE_SIZE,
       pageNum: pageNum.value,
       pageNum: pageNum.value,
-      year: years[curDateIndex.value],
+      year: years.value[curDateIndex.value],
       type: "Magazines",
       type: "Magazines",
     });
     });
     total.value = data.total;
     total.value = data.total;

+ 4 - 0
vite.config.ts

@@ -16,6 +16,10 @@ export default defineConfig({
   base: "./",
   base: "./",
   server: {
   server: {
     proxy: {
     proxy: {
+      "/api/tts": {
+        target: "http://192.168.20.245:8008",
+        changeOrigin: true,
+      },
       "/api": {
       "/api": {
         target: "https://sit-shoubov2.4dage.com",
         target: "https://sit-shoubov2.4dage.com",
         changeOrigin: true,
         changeOrigin: true,

文件差異過大導致無法顯示
+ 59 - 0
vite.config.ts.timestamp-1724915820305-02eed02af0d6.mjs