Browse Source

模板库调整细节

natasha 2 weeks ago
parent
commit
df18ca545e

+ 25 - 8
src/views/personal_workbench/edit_task/edit/index.vue

@@ -1,8 +1,11 @@
 <template>
-  <div class="edit-task">
-    <MenuPage only-key="/personal_workbench/edit_task" />
+  <div class="edit-task" :class="[type && type !== 'personal' ? 'edit-task_template' : '']">
+    <MenuPage
+      :only-key="type ? '/personal_workbench/template_list' : '/personal_workbench/edit_task'"
+      v-if="!type || type === 'personal'"
+    />
 
-    <div class="edit-task__header">
+    <div class="edit-task__header" :style="{ top: type && type !== 'personal' ? '0' : '' }">
       <div class="menu-container">
         <span class="name">{{ courseware_info.book_name }}</span>
       </div>
@@ -74,7 +77,7 @@ export default {
     return {
       id: this.$route.params.courseware_id,
       project_id: this.$route.query.project_id,
-      type: this.$route.query.type,
+      type: this.$route.query.template_type,
       courseware_info: {},
       courseware_list: [],
       isEdit: true, // 是否编辑状态
@@ -130,10 +133,18 @@ export default {
       this.$refs.create.showFullTextSettings();
     },
     goBackPreview() {
-      this.$router.push({
-        path: `/personal_workbench/edit_task/preview/${this.id}`,
-        query: { project_id: this.project_id },
-      });
+      console.log('tuichu');
+      if (this.$route.query.template_type) {
+        this.$router.push({
+          path: `/personal_workbench/template_list/preview/${this.id}`,
+          query: { template_type: this.$route.query.template_type },
+        });
+      } else {
+        this.$router.push({
+          path: `/personal_workbench/edit_task/preview/${this.id}`,
+          query: { project_id: this.project_id },
+        });
+      }
     },
     getLangList() {
       GetLanguageTypeList({ book_id: this.courseware_info.book_id, is_contain_zh: 'true' }).then(
@@ -259,5 +270,11 @@ export default {
     flex: 1;
     flex-direction: row !important;
   }
+
+  &_template {
+    main {
+      min-height: 100%;
+    }
+  }
 }
 </style>

+ 1 - 1
src/views/personal_workbench/template_list/index.vue

@@ -192,7 +192,7 @@ export default {
       if (!row.id) return;
       this.$router.push({
         path: `/personal_workbench/template_list/preview/${row.id}`,
-        query: { type: 'personal' },
+        query: { template_type: 'personal' },
       });
     },
     //共享/取消共享模板

+ 13 - 5
src/views/personal_workbench/template_list/preview/CommonPreview.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="common-preview">
-    <div class="common-preview__header">
+    <div class="common-preview__header" :class="[type && type !== 'personal' ? 'common-preview__header_org' : '']">
       <div class="menu-container">
         {{ courseware_info.book_name }}
       </div>
@@ -10,13 +10,13 @@
         <slot name="middle" :courseware="courseware_info"></slot>
 
         <div class="operator">
-          <span class="link" @click="editTask">开始编辑</span>
+          <span class="link" @click="editTask" v-if="type !== 'manager'">开始编辑</span>
 
           <span class="link" @click="goBackTemplateList">返回模板列表</span>
         </div>
       </div>
     </div>
-    <div class="audit-content">
+    <div class="audit-content" :class="[type && type !== 'personal' ? 'audit-content_org' : '']">
       <div ref="previewMain" class="main-container" :style="{ paddingLeft: '0', paddingRight: '0' }">
         <main :class="['preview-main', { 'no-audit': !isShowAudit }]">
           <div class="preview-left"></div>
@@ -107,7 +107,7 @@ export default {
       data: { row_list: [] },
       component_list: [],
       content_group_row_list: [],
-      type: this.$route.query.type,
+      type: this.$route.query.template_type,
       curSelectId: this.id,
       isTrue,
       sidebarShow: true,
@@ -181,7 +181,7 @@ export default {
     editTask() {
       this.$router.push({
         path: `/personal_workbench/edit_task/edit/${this.id}`,
-        query: { type: this.type },
+        query: { template_type: this.type },
       });
     },
     convertText(text) {
@@ -211,6 +211,10 @@ $total-width: $courseware-width + $courseware-left-margin + $courseware-right-ma
     border-top: $border;
     border-bottom: $border;
 
+    &_org {
+      top: 0;
+    }
+
     > .menu-container {
       display: flex;
       justify-content: space-between;
@@ -391,6 +395,10 @@ $total-width: $courseware-width + $courseware-left-margin + $courseware-right-ma
     min-width: 1810px;
     height: calc(100vh - 166px);
 
+    &_org {
+      height: calc(100vh - 126px);
+    }
+
     .left-menu {
       display: flex;
       flex-direction: column;

+ 2 - 1
src/views/personal_workbench/template_list/preview/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="task-preview">
-    <MenuPage only-key="/personal_workbench/template_list" />
+    <MenuPage only-key="/personal_workbench/template_list" v-if="type && type === 'personal'" />
 
     <CommonPreview :id="id" ref="preview"> </CommonPreview>
   </div>
@@ -19,6 +19,7 @@ export default {
   data() {
     return {
       id: this.$route.params.id,
+      type: this.$route.query.template_type,
     };
   },
   methods: {},

+ 1 - 1
src/views/personal_workbench/template_list_manager/index.vue

@@ -144,7 +144,7 @@ export default {
       if (!row.id) return;
       this.$router.push({
         path: `/personal_workbench/template_list/preview/${row.id}`,
-        query: { type: 'manager' },
+        query: { template_type: 'manager' },
       });
     },
     // 更改模板状态

+ 1 - 1
src/views/personal_workbench/template_list_org/index.vue

@@ -183,7 +183,7 @@ export default {
       if (!row.id) return;
       this.$router.push({
         path: `/personal_workbench/template_list/preview/${row.id}`,
-        query: { type: 'org' },
+        query: { template_type: 'org' },
       });
     },
     //更改模板状态