|
@@ -111,14 +111,20 @@ export default {
|
|
submitForm(formName) {
|
|
submitForm(formName) {
|
|
this.$refs[formName].validate(async(valid) => {
|
|
this.$refs[formName].validate(async(valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ const { id, name, keywords } = this.ruleForm
|
|
|
|
+ const params = {
|
|
|
|
+ name,
|
|
|
|
+ keywords: JSON.stringify(keywords)
|
|
|
|
+ }
|
|
if (this.ruleForm.id) {
|
|
if (this.ruleForm.id) {
|
|
- edit_word_map(this.ruleForm).then((res) => {
|
|
|
|
|
|
+ params.id = id
|
|
|
|
+ edit_word_map(params).then((res) => {
|
|
this.data.bSwitch = false
|
|
this.data.bSwitch = false
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
this.$message.success(res.m || '操作成功')
|
|
this.$message.success(res.m || '操作成功')
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- add_word_map(this.ruleForm).then((res) => {
|
|
|
|
|
|
+ add_word_map(params).then((res) => {
|
|
this.data.bSwitch = false
|
|
this.data.bSwitch = false
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
this.$message.success(res.m || '操作成功')
|
|
this.$message.success(res.m || '操作成功')
|