From 51c7c0ac7e50121d79d01be2f7b2346b450b2333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com> Date: Mon, 12 Dec 2022 11:42:56 +0800 Subject: [PATCH] 12/12 --- src/api/modular/main/CommondbCodeCountry.js | 2 +- .../main/CommondbCodeCountry/addForm.vue | 4 ++ .../main/CommondbCodeCountry/editForm.vue | 42 +++++++++++++------ src/views/main/CommondbCodeCountry/index.vue | 39 ++++++++--------- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/api/modular/main/CommondbCodeCountry.js b/src/api/modular/main/CommondbCodeCountry.js index 3e8e9f0..89f62ec 100644 --- a/src/api/modular/main/CommondbCodeCountry.js +++ b/src/api/modular/main/CommondbCodeCountry.js @@ -7,7 +7,7 @@ import { axios } from '@/utils/request' */ export function CommondbCodeCountryList(parameter) { return axios({ - url: '/commondb/code-country-list', + url: '/api/commondb/code-country-list', method: 'post', params: parameter }) diff --git a/src/views/main/CommondbCodeCountry/addForm.vue b/src/views/main/CommondbCodeCountry/addForm.vue index 0206cfe..a86103d 100644 --- a/src/views/main/CommondbCodeCountry/addForm.vue +++ b/src/views/main/CommondbCodeCountry/addForm.vue @@ -98,6 +98,10 @@ export default { }, mounted() {}, methods: { + // 初始化方法 + add(record) { + this.visible = true + }, /** * 提交表单 */ diff --git a/src/views/main/CommondbCodeCountry/editForm.vue b/src/views/main/CommondbCodeCountry/editForm.vue index a2b5bd4..6de0745 100644 --- a/src/views/main/CommondbCodeCountry/editForm.vue +++ b/src/views/main/CommondbCodeCountry/editForm.vue @@ -51,18 +51,19 @@ - - + + + + + + - - - - - @@ -77,15 +78,15 @@ export default { TypeData: [], labelCol: { xs: { span: 24 }, - sm: { span: 7 } + sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 15 } + sm: { span: 16 } }, labelCol2: { xs: { span: 24 }, - sm: { span: 4 } + sm: { span: 3 } }, wrapperCol2: { xs: { span: 24 }, @@ -93,12 +94,29 @@ export default { }, visible: false, confirmLoading: false, - form: this.$form.createForm(this), - data: {} + form: this.$form.createForm(this) } }, mounted() {}, methods: { + // 初始化方法 + edit(record) { + this.data = record + console.log(record) + this.visible = true + setTimeout(() => { + this.form.setFieldsValue({ + code: record.code, + enName: record.enName, + cnName: record.cnName, + capital: record.capital, + continent: record.continent, + description: record.description, + remark: record.remark + }) + console.log(this.form.getFieldsValue()) + }, 100) + }, handleSubmit() { const { form: { validateFields } diff --git a/src/views/main/CommondbCodeCountry/index.vue b/src/views/main/CommondbCodeCountry/index.vue index 7217604..bb35e71 100644 --- a/src/views/main/CommondbCodeCountry/index.vue +++ b/src/views/main/CommondbCodeCountry/index.vue @@ -10,7 +10,7 @@ - + + + + + @@ -45,7 +50,7 @@ - + @@ -68,7 +74,6 @@