|
|
@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
|
|
|
title="编辑配置"
|
|
|
|
|
|
|
|
:width="1100"
|
|
|
|
|
|
|
|
:visible="visible"
|
|
|
|
|
|
|
|
:confirmLoading="confirmLoading"
|
|
|
|
|
|
|
|
@ok="handleSubmit"
|
|
|
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<a-spin :spinning="confirmLoading">
|
|
|
|
|
|
|
|
<a-form :form="form">
|
|
|
|
|
|
|
|
<a-row>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="代码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入中文名"
|
|
|
|
|
|
|
|
v-decorator="['code', { rules: [{ required: true, message: '请输入代码!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入英文名"
|
|
|
|
|
|
|
|
v-decorator="['enName', { rules: [{ required: true, message: '请输入英文名!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="中文名" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入中文名"
|
|
|
|
|
|
|
|
v-decorator="['cnName', { rules: [{ required: true, message: '请输入中文名!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="首都" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入首都"
|
|
|
|
|
|
|
|
v-decorator="['capital', { rules: [{ required: true, message: '请输入首都!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="大洲" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入大洲"
|
|
|
|
|
|
|
|
v-decorator="['continent', { rules: [{ required: true, message: '请输入大洲!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input
|
|
|
|
|
|
|
|
placeholder="请输入描述"
|
|
|
|
|
|
|
|
v-decorator="['description', { rules: [{ required: true, message: '请输入描述!' }] }]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
|
|
|
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
|
|
|
|
|
|
|
|
<a-input placeholder="请输入备注" v-decorator="['remark']" />
|
|
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
</a-col>
|
|
|
|
|
|
|
|
</a-row>
|
|
|
|
|
|
|
|
</a-form>
|
|
|
|
|
|
|
|
</a-spin>
|
|
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import { CommondbSavecodecountry } from '@/api/modular/main/CommondbCodeCountry'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
TypeData: [],
|
|
|
|
|
|
|
|
labelCol: {
|
|
|
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
|
|
|
sm: { span: 7 }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
wrapperCol: {
|
|
|
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
|
|
|
sm: { span: 15 }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
labelCol2: {
|
|
|
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
|
|
|
sm: { span: 4 }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
wrapperCol2: {
|
|
|
|
|
|
|
|
xs: { span: 24 },
|
|
|
|
|
|
|
|
sm: { span: 20 }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
visible: false,
|
|
|
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
|
|
|
form: this.$form.createForm(this),
|
|
|
|
|
|
|
|
data: {}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
|
|
|
form: { validateFields }
|
|
|
|
|
|
|
|
} = this
|
|
|
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
|
|
|
validateFields((errors, values) => {
|
|
|
|
|
|
|
|
console.log(errors, values)
|
|
|
|
|
|
|
|
if (!errors) {
|
|
|
|
|
|
|
|
for (const key in values) {
|
|
|
|
|
|
|
|
console.log(key, 1)
|
|
|
|
|
|
|
|
if (typeof values[key] === 'object' && !(values[key] === null)) {
|
|
|
|
|
|
|
|
values[key] = JSON.stringify(values[key])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(this.form, values.gid)
|
|
|
|
|
|
|
|
values.gid = this.data.gid
|
|
|
|
|
|
|
|
console.log(values)
|
|
|
|
|
|
|
|
CommondbSavecodecountry(values)
|
|
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
this.$message.success('编辑成功')
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
|
|
|
this.$emit('ok', values)
|
|
|
|
|
|
|
|
this.handleCancel()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(`编辑失败,${res.message}`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.finally(res => {
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleCancel() {
|
|
|
|
|
|
|
|
this.form.resetFields()
|
|
|
|
|
|
|
|
this.visible = false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|