Explorar o código

Merge remote-tracking branch 'origin/master'

liuyang %!s(int64=5) %!d(string=hai) anos
pai
achega
81dedb2f0c
Modificáronse 1 ficheiros con 20 adicións e 5 borrados
  1. 20 5
      frontend_web/src/views/duty/detail/index.vue

+ 20 - 5
frontend_web/src/views/duty/detail/index.vue

@@ -68,8 +68,9 @@
                    style="margin-left:10px"
                    @click="addDuytDetail()">保存</el-button>
         <el-button size="mini"
+                   type="warning"
                    style="margin-right:6px"
-                   @click="closeWindow()">关闭</el-button>
+                   @click="closePage()">关闭</el-button>
       </el-form>
     </template>
     <el-table :data="list"
@@ -172,6 +173,9 @@ const columnProperty = [
   'Saturday',
   'Sunday'
 ]
+import { mapState, mapActions } from 'vuex'
+import DutyApi from '@/api/duty'
+import itemDetailApi from '@/api/sysadmin/itemdetail'
 export default {
   name: 'dutyEdit',
   data () {
@@ -200,7 +204,13 @@ export default {
       list: []
     }
   },
-
+  computed: {
+    ...mapState('d2admin/page', [
+      'opened',
+      'current' // 用户获取当前页面的地址,用于关闭
+    ])
+  },
+ 
   mounted () {
     this.getLocal()
     this.getPeople()
@@ -439,9 +449,14 @@ export default {
         }
       }
     },
-    // 关闭当前页
-    closeWindow () {
-      window.location.href = './#/duty'
+    // 关闭页面
+    ...mapActions('d2admin/page', [
+      'close'
+    ]),
+    // 关闭
+    closePage () {
+      let tagName = this.current
+      this.close({ tagName })
     }
   }
 }