From 01c25b6d4ee7539c267f65a16f4ca71d8d29aa1c Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期二, 21 五月 2024 17:13:21 +0800 Subject: [PATCH] '' --- admin/src/components/base/BaseOpera.vue | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/admin/src/components/base/BaseOpera.vue b/admin/src/components/base/BaseOpera.vue index 70681bd..ad852f7 100644 --- a/admin/src/components/base/BaseOpera.vue +++ b/admin/src/components/base/BaseOpera.vue @@ -14,6 +14,16 @@ } } }, + // watch: { + // visible() { + // console.log(this.visible); + // } + // }, + watch: { + $route (to, from) { + this.close() + } + }, methods: { // 閰嶇疆 config (extParams = {}) { @@ -23,7 +33,11 @@ if (extParams.api == null) { throw new Error('Missing config option \'api\'.') } - this.api = require('@/api' + extParams.api) + if(extParams.api.indexOf('@/',0) === 0){ + this.api = require(extParams.api) + }else { + this.api = require('@/api' + extParams.api) + } extParams['field.id'] && (this.configData['field.id'] = extParams['field.id']) }, /** @@ -49,6 +63,9 @@ } }) }, + close () { + this.visible = false + }, // 纭鏂板缓/淇敼 confirm () { if (this.form.id == null || this.form.id === '') { @@ -60,9 +77,12 @@ // 纭鏂板缓 __confirmCreate () { this.$refs.form.validate((valid) => { + // debugger if (!valid) { return } + // console.log(this.form); + // debugger // 璋冪敤鏂板缓鎺ュ彛 this.isWorking = true this.api.create(this.form) -- Gitblit v1.9.3