-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ $t(`取消`) }}
@@ -49,6 +68,7 @@ export default {
components: {},
data() {
return {
+ tabId: `basic`,
rules: {},
visible: false,
mode: `add`,
@@ -64,6 +84,9 @@ export default {
created() {},
emits: [`success`, `closed`, `mounted`],
methods: {
+ async paneClosed() {
+ this.visible = false
+ },
//显示
async open(data) {
this.visible = true
@@ -102,18 +125,26 @@ export default {
//表单提交方法
async submit() {
- const valid = await this.$refs.dialogForm.validate().catch(() => {})
- if (!valid) {
- return false
- }
this.loading = true
- const method = this.mode === `add` ? this.$API[this.entityName].create : this.$API[this.entityName].edit
- try {
- const res = await method.post(this.form)
- this.$emit(`success`, res.data, this.mode)
- this.visible = false
- this.$message.success(this.$t(`操作成功`))
- } catch {}
+ if (this.tabId === `basic`) {
+ const valid = await this.$refs.dialogForm.validate().catch(() => {})
+ if (!valid) {
+ this.loading = false
+ return false
+ }
+ const method = this.mode === `add` ? this.$API[this.entityName].create : this.$API[this.entityName].edit
+ try {
+ const res = await method.post(this.form)
+ this.$emit(`success`, res.data, this.mode)
+ this.visible = false
+ this.$message.success(this.$t(`操作成功`))
+ } catch {}
+ } else {
+ if (await this.tabs.submit(this.$refs, this.tabId)) {
+ this.visible = false
+ }
+ }
+
this.loading = false
},
},
@@ -125,8 +156,13 @@ export default {
summary: { type: String },
columns: { type: Array },
dialogFullScreen: { type: Boolean },
+ tabs: { type: Array },
},
}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/frontend/admin/src/components/na-table-page/index.vue b/src/frontend/admin/src/components/na-table-page/index.vue
index 87f6595b..f4605774 100644
--- a/src/frontend/admin/src/components/na-table-page/index.vue
+++ b/src/frontend/admin/src/components/na-table-page/index.vue
@@ -1,4 +1,4 @@
-
+