| @@ -61,18 +61,23 @@ export default { | |||
| if(!this.showInitTopic[item]){ | |||
| this.arrayTopics.push(array.topic_name) | |||
| if(this.arrayTopics.includes(array.topic_name)){ | |||
| return | |||
| } | |||
| else{ | |||
| this.arrayTopics.push(array.topic_name) | |||
| let topics = this.arrayTopics | |||
| let strTopics = topics.join(',') | |||
| let data = this.qs.stringify({ | |||
| _csrf:csrf, | |||
| topics:strTopics | |||
| }) | |||
| this.Post(data,topics) | |||
| this.$set(this.showInitTopic,item,true) | |||
| $('#repo-topics1').children('span').remove() | |||
| } | |||
| let topics = this.arrayTopics | |||
| let strTopics = topics.join(',') | |||
| let data = this.qs.stringify({ | |||
| _csrf:csrf, | |||
| topics:strTopics | |||
| }) | |||
| this.Post(data,topics) | |||
| this.$set(this.showInitTopic,item,true) | |||
| $('#repo-topics1').children('span').remove() | |||
| @@ -93,7 +98,6 @@ export default { | |||
| this.Post(data,topics) | |||
| this.$set(this.showInitTopic,item,false) | |||
| if(this.arrayTopics.length===0){ | |||
| console.log("set empty") | |||
| $('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>') | |||
| }else{ | |||
| $('#repo-topics1').children('span').remove() | |||
| @@ -199,7 +203,6 @@ export default { | |||
| postTopic(){ | |||
| const patter = /^[\u4e00-\u9fa5a-zA-Z0-9][\u4e00-\u9fa5a-zA-Z0-9-]{0,34}$/ | |||
| let regexp = patter.test(this.input) | |||
| console.log("regexp",regexp) | |||
| if(!regexp){ | |||
| this.$notify({ | |||
| @@ -210,19 +213,25 @@ export default { | |||
| return | |||
| }else{ | |||
| let topic = this.input | |||
| this.arrayTopics.push(topic) | |||
| if(this.arrayTopics.includes(topic)){ | |||
| return | |||
| } | |||
| else{ | |||
| this.arrayTopics.push(topic) | |||
| let topics = this.arrayTopics | |||
| let strTopics = topics.join(',') | |||
| let data = this.qs.stringify({ | |||
| _csrf:csrf, | |||
| topics:strTopics | |||
| }) | |||
| this.Post(data,topics) | |||
| $('#repo-topics1').children('span').remove() | |||
| this.showInputValue = false | |||
| this.showAddTopic = true | |||
| this.showAddFlage = true | |||
| } | |||
| let topics = this.arrayTopics | |||
| let strTopics = topics.join(',') | |||
| let data = this.qs.stringify({ | |||
| _csrf:csrf, | |||
| topics:strTopics | |||
| }) | |||
| this.Post(data,topics) | |||
| $('#repo-topics1').children('span').remove() | |||
| this.showInputValue = false | |||
| this.showAddTopic = true | |||
| this.showAddFlage = true | |||
| } | |||