|
|
@ -4,7 +4,7 @@ |
|
|
|
<Form :value="formData" class="form" ref="FormConfigRef" :formList="formList" column="1" labelWidth="120px" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<template #footer> |
|
|
|
<template #footer> this.checkRepeat(); |
|
|
|
<Button style="background-color: rgba(0, 179, 204, .3);" @click.native="modelVisible = false, submitting = false"> |
|
|
|
取消 |
|
|
|
</Button> |
|
|
@ -38,7 +38,8 @@ export default { |
|
|
|
}, |
|
|
|
props: { |
|
|
|
visible: Boolean, |
|
|
|
data: Object |
|
|
|
data: Object, |
|
|
|
dataAll: Array |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -70,11 +71,26 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
checkRepeat(word){ |
|
|
|
let temp = _.find(this.data, { word: word }); |
|
|
|
console.log(temp, 'ttttttttttt') |
|
|
|
if (temp) { |
|
|
|
this.$message.danger("该关键词已存在。") |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSubmit() { |
|
|
|
this.$refs.FormConfigRef.validate() |
|
|
|
.then((data) => { |
|
|
|
this.submitting = true; |
|
|
|
data.word = data.word.trim(); |
|
|
|
|
|
|
|
if(!this.checkRepeat(data.word)){ |
|
|
|
return ; |
|
|
|
} |
|
|
|
|
|
|
|
this.submitting = true; |
|
|
|
if (this.data) data.id = this.data.id; |
|
|
|
|
|
|
|
request({ |
|
|
|