Commit 4f7a7c67 authored by derong.zhang's avatar derong.zhang

阻止重复添加

parent 2693c4ee
......@@ -172,11 +172,11 @@
<Option v-for="(item, index) in tageList" :value="item" :key="index">{{ item }}</Option>
</Select>
</FormItem>
<FormItem prop="alladdcontent" label="首部:">
<Input v-model="header" type="text" placeholder="请输入速率" style="width: 70%" />
<FormItem prop="alladdcontent" label="header:">
<Input v-model="header" type="text" placeholder="请输入首部" style="width: 70%" />
</FormItem>
<FormItem prop="alladdcontent" label="主体:">
<Input v-model="body" type="text" placeholder="请输入速率" style="width: 70%" />
<FormItem prop="alladdcontent" label="body:">
<Input v-model="body" type="text" placeholder="请输入主体" style="width: 70%" />
</FormItem>
</Form>
<div class="alladdbtn">
......@@ -808,7 +808,8 @@ export default {
}
}
],
rollbacklist: []
rollbacklist: [],
keyArr: [],
}
},
methods: {
......@@ -841,6 +842,7 @@ export default {
this.testdiv = false
this.key = key
this.logData = []
this.singlebaraddition = ''
this.getkeytext(key)
this.getconfigurlist(key, this.server)
this.isShowList = true
......@@ -944,6 +946,16 @@ export default {
this.$Message.error('请先输入要添加的内容')
return
}
let keys = this.logData.some(item => {
return item.sort === this.singlebaraddition
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
return
}
this.logData.push({sort: this.singlebaraddition})
this.logparamsarr.push(this.singlebaraddition)
this.singlebaraddition = ''
......@@ -952,6 +964,7 @@ export default {
this.origenselectserver = this.server
},
alladd () {
this.formInline.alladdcontent = ''
this.alladdModal = true
},
alladdconfire () {
......@@ -964,6 +977,23 @@ export default {
str = str.replace(/\"/g, '') // eslint-disable-line no-useless-escape
str = str.replace(/\'/g, '') // eslint-disable-line no-useless-escape
let arr = str.split(',')
arr.map(item => {
let keys = this.logData.some(data => {
return item === data.sort
})
this.keyArr.push(keys)
})
let keys = this.keyArr.some(item => {
return item === true
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
this.keyArr = []
return
}
this.logparamsarr = arr
arr.map(item => {
this.logData.push({sort: item})
......@@ -1597,6 +1627,16 @@ export default {
this.addSpecifiedModal = true;
},
confireIpset() {
let keys = this.ipsetData.some(item => {
return item.name === this.ipsetName
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
return
}
if (this.updataIpsetSta) {
this.ipsetData[this.updateconfigindex].ip_list = this.ipsetContent
} else {
......@@ -1616,6 +1656,16 @@ export default {
this.origenselectserver = this.server
},
confireUrlSet() {
let keys = this.urlIpSetData.some(item => {
return item.ip_set_name === this.urlIpsetName
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
return
}
if (this.updataUrlSta) {
this.urlIpSetData[this.updateconfigindex].path = this.urlIpsetPath
this.urlIpSetData[this.updateconfigindex].ip_set_name = this.urlIpsetName
......@@ -1635,6 +1685,16 @@ export default {
this.origenselectserver = this.server
},
confireLimit() {
let keys = this.urlIpSetData.some(item => {
return item.path === this.limitPath
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
return
}
if (this.updataLimitSta) {
this.limitData[this.updateconfigindex].path = this.limitPath
this.limitData[this.updateconfigindex].duration = this.limitTime
......@@ -1656,6 +1716,16 @@ export default {
this.origenselectserver = this.server
},
confireSpecified() {
let keys = this.specifiedData.some(item => {
return item.err_type === this.err_type && item.err_tag === this.err_tag
})
if (keys) {
this.$Notice.error({
title: '提示',
desc: '不能添加重复的内容',
});
return
}
if (this.updataSpecifiedSta) {
this.specifiedData[this.updateconfigindex].body = this.body
this.specifiedData[this.updateconfigindex].header = this.header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment