Forráskód Böngészése

字典项修改关闭

liuyang 5 éve
szülő
commit
eb4ebc96a3

+ 3 - 7
frontend_web/src/views/course/detail/index.vue

@@ -43,8 +43,8 @@
           </el-button>
           <el-button type="primary"
                      size="mini"
-                     icon="el-icon-back"
-                     @click="back"> 关闭
+                     icon="el-icon-close"
+                     @click="close"> 关闭
           </el-button>
         </el-form-item>
       </el-form>
@@ -429,14 +429,10 @@ export default {
       this.doRefresh()
     },
     // 关闭页面
-    ...mapActions('d2admin/page', [
-      'close'
-    ]),
-    // 关闭页面
     ...mapActions('d2admin/page', [
       'close_return'
     ]),
-    back () { // 返回上一页
+    close () { // 关闭并返回上一页
       this.close_return({
         tagName: this.$route.fullPath,
         returnTagName: '/course'

+ 18 - 3
frontend_web/src/views/sysadmin/item_detail/index.vue

@@ -39,8 +39,8 @@
           </el-button>
           <el-button type="primary"
                      size="mini"
-                     icon="el-icon-back"
-                     @click="back"> 返回
+                     icon="el-icon-close"
+                     @click="close"> 关闭
           </el-button>
         </el-form-item>
       </el-form>
@@ -80,6 +80,7 @@ import editForm from './editForm'
 import { AgGridVue } from 'ag-grid-vue'
 import 'ag-grid-community/dist/styles/ag-grid.css'
 import 'ag-grid-community/dist/styles/ag-theme-balham.css'
+import { mapActions, mapState } from 'vuex'
 
 export default {
   name: 'item',
@@ -117,6 +118,12 @@ export default {
       deleteIds: []
     }
   },
+  computed: {
+    ...mapState('d2admin/page', [
+      'opened',
+      'current' // 用户获取当前页面的地址,用于关闭
+    ])
+  },
   beforeMount () {
     this.gridOptions = {
       rowHeight: 32, // 设置行高为32px
@@ -291,8 +298,16 @@ export default {
       }
       this.doRefresh()
     },
-    back () { // 返回上一页
+    // 关闭页面
+    ...mapActions('d2admin/page', [
+      'close_return'
+    ]),
+    close () { // 返回上一页
       this.$router.push({ path: '/sysadmin/item' })
+      this.close_return({
+        tagName: this.$route.fullPath,
+        returnTagName: '/sysadmin/item'
+      })
     }
   }
 }