Browse Source

fix the issue #164

tags/v1.21.10.1^2
zhoupzh 4 years ago
parent
commit
4b4e8603ec
1 changed files with 16 additions and 13 deletions
  1. +16
    -13
      web_src/js/components/EditTopics.vue

+ 16
- 13
web_src/js/components/EditTopics.vue View File

@@ -3,22 +3,22 @@
<div class="input-search">
<el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input">
<el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input" @keyup.enter.native="postTopic">

</el-input>
<div class="scrolling-menu">
<div v-if="showSearchTopic" class="item-text" v-for="(arr,i) in array" @click="addTopics(i,arr)">
<div class="icon-wrapper">
<i style="line-height: 1.5;" v-if="showInitTopic[i]" class="el-icon-check" ></i>
<i style="vertical-align: middle;color: #303643;" v-if="showInitTopic[i]" class="el-icon-check" ></i>
</div>
<div class="text">{{arr.topic_name}} </div>
</div>
<div v-if="showInputValue" class="addition item-text" @click="postTopic">
<div v-if="showInputValue" class="addition item-text" @click="postTopic">
点击或回车添加<b class="user-add-label-text">{{input}}</b>标签
</div>
<div v-if="showAddTopic" class="item-text" @click="addPostTopic">
<div class="icon-wrapper">
<i style="line-height: 1.5;" v-if="showAddFlage" class="el-icon-check" ></i>
<i style="vertical-align: middle;color: #303643;" v-if="showAddFlage" class="el-icon-check" ></i>
</div>
<div class="text">{{input}}</div>
</div>
@@ -100,7 +100,7 @@ export default {
},
changeValue(){
console.log("changevalue")
if (this.input === ''){
this.array = this.arrayTopics
let data = []
@@ -128,6 +128,7 @@ export default {
this.showSearchTopic = false
}else{
this.showInitTopic = []
let timestamp=new Date().getTime()
this.params.q = this.input
@@ -136,11 +137,10 @@ export default {
params:this.params
}).then((res)=>{
this.array = res.data.topics
})
this.array.forEach((element,index) => {

this.array.forEach((element,index) => {
if (this.arrayTopics.indexOf(element.topic_name)>-1){
this.showInitTopic.push(true)

}else{
@@ -150,6 +150,10 @@ export default {
});
})
this.showInputValue = true
this.showSearchTopic = true
@@ -241,8 +245,7 @@ export default {
editDiv.css('display', ''); // show Semantic UI Grid
this.input = ''
console.log("this.",this)
console.log("-----------------asdasd",$("#topics_input"),$("#topics_input").val())
stopPropagation(e);
});
@@ -273,7 +276,7 @@ computed:{
watch: {

input(newValue){
console.log("---newvalue--",newValue)
if (newValue === ''){
this.array = this.arrayTopics
let data = []
@@ -311,7 +314,7 @@ mounted() {
this.changeValue()
} ,
created(){
console.log("this.created");
this.initTopics();
this.input=''


Loading…
Cancel
Save