赵殿龙 hace 1 año
padre
commit
bba8d74905
Se han modificado 1 ficheros con 8 adiciones y 2 borrados
  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 || '操作成功')