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

两次点击

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