Browse Source

Merge pull request 'fix issue #487' (#522) from fix-455 into V20211018

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/522
pull/524/head
A00老虎 3 years ago
parent
commit
5d6eb39672
1 changed files with 34 additions and 25 deletions
  1. +34
    -25
      web_src/js/components/EditTopics.vue

+ 34
- 25
web_src/js/components/EditTopics.vue View File

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




Loading…
Cancel
Save