赵殿龙 1 an în urmă
părinte
comite
bba8d74905
1 a modificat fișierele cu 8 adăugiri și 2 ștergeri
  1. 8 2
      src/views/dict/qc/components/CreateDialog.vue

+ 8 - 2
src/views/dict/qc/components/CreateDialog.vue

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