Browse Source

教材信息查看

dsy 2 tuần trước cách đây
mục cha
commit
00888194eb

+ 1 - 1
.env

@@ -11,4 +11,4 @@ VUE_APP_BookWebSI = '/GCLSBookWebSI/ServiceInterface'
 VUE_APP_EepServer = '/EEPServer/SI'
 
 #version
-VUE_APP_VERSION = '2025.12.13'
+VUE_APP_VERSION = '2025.12.24'

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "eep_page",
-  "version": "2025.12.13",
+  "version": "2025.12.24",
   "private": true,
   "main": "main.js",
   "description": "智慧梧桐数字教材编辑器",

+ 9 - 0
src/api/book.js

@@ -366,3 +366,12 @@ export function SaveBookKnowledgeGraph(data) {
 export function SearchBookContentText(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_content_manager-SearchBookContentText`, data);
 }
+
+/**
+ * @description 得到教材信息
+ * @param {object} data
+ * @param {string} data.id 教材ID
+ */
+export function GetBookInfo(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_manager-GetBookInfo`, data);
+}

+ 2 - 0
src/router/modules/index.js

@@ -11,12 +11,14 @@ import {
 } from './basic';
 import ProjectRouters from './project';
 import CoursewareRouters from './courseware';
+import OtherRouters from './other';
 
 export const routes = [
   loginPage,
   homePage,
   ...ProjectRouters,
   ...CoursewareRouters,
+  ...OtherRouters,
   ImageChangePage,
   NotFoundPage,
   RegisterPage,

+ 20 - 0
src/router/modules/other.js

@@ -0,0 +1,20 @@
+import DEFAULT from '@/layouts/default';
+
+export const BookInfoPage = {
+  path: '/book_info/:id',
+  component: DEFAULT,
+  // 使用命名路由并保留 params,避免在 children 中重复声明 :id,保留 query 参数
+  redirect: (to) => ({ name: 'BookInfo', params: { id: to.params.id }, query: to.query }),
+  children: [
+    {
+      path: 'index', // 子路由使用相对路径,不再重复声明 :id
+      name: 'BookInfo',
+      component: () => import(/* webpackChunkName: "views-home" */ '@/views/book_info/index.vue'),
+      // 将 route params 作为 props 传入组件,组件可声明 props: ['id']
+      // query 也可以通过 props 传入
+      props: (route) => ({ id: route.params.id, query: route.query }),
+    },
+  ],
+};
+
+export default [BookInfoPage];

+ 3 - 4
src/views/book/courseware/preview/components/video/VideoPreview.vue

@@ -183,11 +183,10 @@ export default {
               w = entry.contentRect.width;
               h = entry.contentRect.height - 30;
             }
-            // eslint-disable-next-line no-negated-condition
-            if (this.elementWidth !== w) {
-              this.elementWidth = w;
-            } else {
+            if (this.elementWidth === w) {
               this.elementHeight = h;
+            } else {
+              this.elementWidth = w;
             }
           });
         }

+ 183 - 0
src/views/book_info/index.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="book-info">
+    <template v-if="['/project_manage/book'].includes(backPath)">
+      <MenuPage :cur-key="backPath" />
+    </template>
+    <template v-if="['/project_manage/org/book'].includes(backPath)">
+      <ProjectMenu :cur-key="backPath.replace('/project_manage/', '')" />
+    </template>
+
+    <div class="book-info__header">
+      <div class="menu-container">
+        <span class="name">{{ book_info.name }}</span>
+      </div>
+      <div class="book">
+        <div class="operator">
+          <span class="link" @click="$router.push({ path: backPath })">返回项目列表</span>
+        </div>
+      </div>
+    </div>
+
+    <main class="book-info-main">
+      <div class="name info-item" :style="{ gridArea: 'name' }">
+        <span class="label">名称</span>
+        <span class="field">{{ book_info.name }}</span>
+      </div>
+      <div class="version info-item" :style="{ gridArea: 'version' }">
+        <span class="label">版本</span>
+        <span class="field">{{ book_info.version }}</span>
+      </div>
+      <div class="cover info-item" :style="{ gridArea: 'cover' }">
+        <span class="label">封面</span>
+        <span class="field">
+          <img :src="book_info.cover_image_file_url" alt="封面" :style="{ maxHeight: '220px' }" />
+        </span>
+      </div>
+      <div class="name_english info-item" :style="{ gridArea: 'english-name' }">
+        <span class="label">英文名称</span>
+        <span class="field">{{ book_info.name_english }}</span>
+      </div>
+      <div class="series_name info-item" :style="{ gridArea: 'series_name' }">
+        <span class="label">所属从书</span>
+        <span class="field">{{ book_info.series_name }}</span>
+      </div>
+      <div class="isbn info-item" :style="{ gridArea: 'isbn' }">
+        <span class="label">国际标准图书<br />编号(ISBN)</span>
+        <span class="field">{{ book_info.isbn }}</span>
+      </div>
+      <div class="author info-item" :style="{ gridArea: 'author' }">
+        <span class="label">作者</span>
+        <span class="field">{{ book_info.author }}</span>
+      </div>
+      <div class="price info-item" :style="{ gridArea: 'price' }">
+        <span class="label">价格</span>
+        <span class="field">{{ book_info.price }}</span>
+      </div>
+      <div class="content_count info-item" :style="{ gridArea: 'content_count' }">
+        <span class="label">课数容量</span>
+        <span class="field">{{ book_info.content_count }}</span>
+      </div>
+      <div class="shangjia_time info-item" :style="{ gridArea: 'shangjia_time' }">
+        <span class="label">上架时间</span>
+        <span class="field">{{ book_info.shangjia_time }}</span>
+      </div>
+    </main>
+  </div>
+</template>
+
+<script>
+import MenuPage from '@/views/personal_workbench/common/menu.vue';
+import ProjectMenu from '@/views/project_manage/common/ProjectMenu.vue';
+
+import { GetBookInfo } from '@/api/book';
+
+export default {
+  name: 'BookInfoPage',
+  components: {
+    MenuPage,
+    ProjectMenu,
+  },
+  props: {
+    id: {
+      type: String,
+      default: '',
+    },
+    query: {
+      type: Object,
+      default: () => ({}),
+    },
+  },
+  data() {
+    return {
+      book_info: {},
+    };
+  },
+  computed: {
+    backPath() {
+      return this.$route.query.backPath || '/project_manage/book';
+    },
+  },
+  created() {
+    GetBookInfo({ id: this.id }).then(({ book_info }) => {
+      this.book_info = book_info;
+    });
+  },
+  methods: {},
+};
+</script>
+
+<style lang="scss" scoped>
+@use '@/styles/mixin.scss' as *;
+
+.book-info {
+  @include page-content(true);
+
+  &__header {
+    .name {
+      width: 240px;
+      font-size: 16px;
+      font-weight: bold;
+    }
+
+    .book {
+      display: flex;
+      flex: 1;
+      align-items: center;
+      justify-content: flex-end;
+    }
+  }
+
+  main.book-info-main {
+    display: grid;
+    grid-template: repeat(3, 41px) 70px repeat(3, 41px) / repeat(2, 1fr);
+    grid-template-areas: 'name version' 'cover english-name' 'cover series_name' 'cover isbn' 'cover author' 'cover price' 'content_count shangjia_time';
+    grid-auto-rows: 41px;
+    row-gap: 0;
+    max-width: 1148px;
+    margin: 0 auto;
+
+    .info-item {
+      display: flex;
+      align-items: center;
+
+      .label {
+        width: 130px;
+        text-align: right;
+        background-color: #f2f3f5;
+      }
+
+      .field {
+        display: inline-flex;
+        flex: 1;
+        column-gap: 8px;
+      }
+
+      .label,
+      .field {
+        height: 100%;
+        padding: 4px 12px;
+        line-height: 32px;
+        border-bottom: 1px solid #e5e6eb;
+      }
+
+      &.cover {
+        .label {
+          height: 100%;
+        }
+
+        .field {
+          display: flex;
+          align-items: center;
+          justify-content: center;
+        }
+      }
+
+      &.ibsn {
+        .label {
+          line-height: 16px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 3 - 7
src/views/personal_workbench/project/ProjectInfoManage.vue

@@ -1,12 +1,10 @@
 <template>
   <div class="project-info">
-    <template
-      v-if="['/personal_workbench/project', '/project_manage/book', '/project_manage/project'].includes(backPath)"
-    >
+    <template v-if="['/personal_workbench/project', '/project_manage/project'].includes(backPath)">
       <MenuPage :cur-key="backPath" />
     </template>
-    <template v-if="['org/book', 'org/final', 'org/project'].includes(backPath)">
-      <ProjectMenu :cur-key="backPath" />
+    <template v-if="['/project_manage/org/final', '/project_manage/org/project'].includes(backPath)">
+      <ProjectMenu :cur-key="backPath.replace('/project_manage/', '')" />
     </template>
 
     <div class="project-info__header">
@@ -196,8 +194,6 @@ export default {
     ProjectMenu,
   },
   data() {
-    console.log(this.$route.query);
-
     return {
       id: this.$route.params.id,
       isManage: this.$route.query.isManage === 'true', // 是否为管理模式

+ 1 - 1
src/views/project_manage/book/index.vue

@@ -30,7 +30,7 @@
               class="link"
               @click="
                 $router.push({
-                  path: `/personal_workbench/project_info/${row.id}`,
+                  path: `/book_info/${row.id}`,
                   query: { isManage: false, backPath: '/project_manage/book' },
                 })
               "

+ 1 - 1
src/views/project_manage/org/book/index.vue

@@ -31,7 +31,7 @@
               class="link"
               @click="
                 $router.push({
-                  path: `/personal_workbench/project_info/${row.id}`,
+                  path: `/book_info/${row.id}`,
                   query: { isManage: false, backPath: '/project_manage/org/book' },
                 })
               "