diff --git a/src/views/recruitment/component/addRecruit.vue b/src/views/recruitment/component/addRecruit.vue index e52993f..17d15c3 100644 --- a/src/views/recruitment/component/addRecruit.vue +++ b/src/views/recruitment/component/addRecruit.vue @@ -221,7 +221,7 @@ export default { > ); case 3: - let options = item.remark.split(",") + let options = Array.from(new Set(item.remark.split(","))) return ( { - return ( - - ); + if(row.type === 3){ + return ( +
+ { + row.remark ? Array.from(new Set(row.remark.split(','))).map((item) => { + return ( + { + if(row.remark.length === 0){ + return + } + if(row.remark.indexOf(item) === 0){ + row.remark = row.remark.slice(item.length + 1) + }else{ + let temp = String(row.remark) + row.remark = temp.slice(0, row.remark.indexOf(item) - 1) + temp.slice(row.remark.indexOf(item) + item.length) + } + } + }}>{item} + ) + }) : '' + } + { + this.inputVisible ? ( + { + e.preventDefault() + if(!this.inputValue){ + return + } + if (e.keyCode === 13) { + row.remark += row.remark ? `,${this.inputValue}` : this.inputValue + this.inputVisible = false + this.inputValue = "" + } + } + } + on={{ + ['blur']:e => { + if(!this.inputValue){ + return + } + row.remark += row.remark ? `,${this.inputValue}` : this.inputValue + this.inputVisible = false + this.inputValue = "" + } + }} + > + ) : ( + { + this.inputVisible = true; + this.$nextTick(_ => { + this.$refs.saveTagInput.$refs.input.focus(); + }); + } + }}>新增 + ) + } +
+ ) + }else{ + return ( + + ); + } + }, }, { @@ -356,3 +432,8 @@ export default { +