提交 cba93f07 编写于 作者: huangwensu's avatar huangwensu

两次点击

上级 fd66b0fb
......@@ -42,7 +42,7 @@
<el-input
:class="{'red-b': item.nameCheck && item.actionName}"
v-model="item.actionName"
@blur="stepNameRepeat(item.actionName, index)"
@input="nameChange(item, index)"
maxlength="30"
placeholder="请输入步骤名称"
style="width:70%"></el-input>
......@@ -170,16 +170,16 @@ export default {
}
},
// 步骤名称不重复
stepNameRepeat(val, index) {
this.flag = false;
nameChange(item, index) {
this.$set(this.searchParam.actionModelList[index], 'nameCheck', false);
if(!val) return;
if(!item.actionName) return;
for(let i = 0; i < this.searchParam.actionModelList.length; i++) {
if(i == index) continue;
if(val == this.searchParam.actionModelList[i].actionName) {
this.searchParam.actionModelList[index].actionName = '';
this.$set(this.searchParam.actionModelList[index], 'nameCheck', true);
this.flag = true;
if(item.actionName == this.searchParam.actionModelList[i].actionName) {
setTimeout(() => {
this.searchParam.actionModelList[index].actionName = '';
this.$set(this.searchParam.actionModelList[index], 'nameCheck', true);
},500)
}
}
},
......@@ -233,16 +233,11 @@ export default {
}
let req = this.searchParam;
for(let i = 0; i < req.actionModelList.length; i++) {
if(req.actionModelList[i].nameCheck) {
req.actionModelList[i].nameCheck = false;
return;
}
if(!req.actionModelList[i].actionName) {
req.actionModelList[i].actionName = req.actionModelList[i].eventName;
req.actionModelList[i].nameCheck = false;
}
}
this.getData(
"post", `/session/funnel/save`, req,
res => {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册