【修改】修改关键词可以重复
This commit is contained in:
@@ -190,7 +190,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="关键词:">
|
<el-form-item label="关键词:">
|
||||||
<vue-tags-input placeholder="请输入关键词" v-model="reportF.tags" :tags="tags"
|
<vue-tags-input placeholder="请输入关键词" v-model="reportF.tags" :tags="tags"
|
||||||
@tags-changed=" newTags =>{
|
:avoid-adding-duplicates="false" @tags-changed="newTags =>{
|
||||||
|
|
||||||
if(newTags[newTags.length - 1].text.length <= 20){
|
if(newTags[newTags.length - 1].text.length <= 20){
|
||||||
if(tags.length < 10){
|
if(tags.length < 10){
|
||||||
tags = newTags
|
tags = newTags
|
||||||
@@ -199,6 +200,9 @@
|
|||||||
tags = newTags.slice(0,-1)
|
tags = newTags.slice(0,-1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// else if(reportF.tags.indexOf(newTags)){
|
||||||
|
// this.$message({type:'error',message:'关键词数量不能超过10个'})
|
||||||
|
// }
|
||||||
else{
|
else{
|
||||||
this.$message({type:'error',message:'单个关键词不能超过20个字'})
|
this.$message({type:'error',message:'单个关键词不能超过20个字'})
|
||||||
tags = newTags.slice(0,-1)
|
tags = newTags.slice(0,-1)
|
||||||
@@ -436,6 +440,20 @@ export default {
|
|||||||
/* 权限全选 */
|
/* 权限全选 */
|
||||||
checked: false,
|
checked: false,
|
||||||
mulSelecteds: [], // 已选中选项
|
mulSelecteds: [], // 已选中选项
|
||||||
|
validation: [{
|
||||||
|
classes: 'min-length',
|
||||||
|
rule: tag => tag.text.length < 8,
|
||||||
|
}, {
|
||||||
|
classes: 'no-numbers',
|
||||||
|
rule: /^([^0-9]*)$/,
|
||||||
|
}, {
|
||||||
|
classes: 'avoid-item',
|
||||||
|
rule: /^(?!Cannot).*$/,
|
||||||
|
disableAdd: true,
|
||||||
|
}, {
|
||||||
|
classes: 'no-braces',
|
||||||
|
rule: ({ text }) => text.indexOf('{') !== -1 || text.indexOf('}') !== -1
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//监听标签搜索框
|
//监听标签搜索框
|
||||||
|
|||||||
Reference in New Issue
Block a user