liuyang 5 лет назад
Родитель
Сommit
7edc81a273
1 измененных файлов с 20 добавлено и 2 удалено
  1. 20 2
      frontend_web/src/views/course/detail/index.vue

+ 20 - 2
frontend_web/src/views/course/detail/index.vue

@@ -44,7 +44,7 @@
           <el-button type="primary"
                      size="mini"
                      icon="el-icon-back"
-                     @click="back"> 返回
+                     @click="back"> 关闭
           </el-button>
         </el-form-item>
       </el-form>
@@ -146,6 +146,7 @@ import 'ag-grid-community/dist/styles/ag-grid.css'
 import 'ag-grid-community/dist/styles/ag-theme-balham.css'
 import FileSaver from 'file-saver'
 import XLSX from 'xlsx'
+import { mapActions, mapState } from 'vuex'
 
 export default {
   name: 'courseDetail',
@@ -188,6 +189,12 @@ export default {
       deleteIds: []
     }
   },
+  computed: {
+    ...mapState('d2admin/page', [
+      'opened',
+      'current' // 用户获取当前页面的地址,用于关闭
+    ])
+  },
   beforeMount () {
     this.gridOptions = {
       rowHeight: 32, // 设置行高为32px
@@ -421,8 +428,19 @@ export default {
       }
       this.doRefresh()
     },
+    // 关闭页面
+    ...mapActions('d2admin/page', [
+      'close'
+    ]),
+    // 关闭页面
+    ...mapActions('d2admin/page', [
+      'close_return'
+    ]),
     back () { // 返回上一页
-      this.$router.push({ path: '/course' })
+      this.close_return({
+        tagName: this.$route.fullPath,
+        returnTagName: '/course'
+      })
     },
     // 列表排序功能
     orderby (column) {