|
|
@ -14,7 +14,7 @@ |
|
|
<div v-if="disabled!==true" class="my-select" name="select" :value="myVal"> |
|
|
<div v-if="disabled!==true" class="my-select" name="select" :value="myVal"> |
|
|
<el-select v-model="myVal" @change="onSelectChange" :clearable="clearable" filterable> |
|
|
<el-select v-model="myVal" @change="onSelectChange" :clearable="clearable" filterable> |
|
|
|
|
|
|
|
|
<el-option value="" disabled v-if="users && users.length>10"> |
|
|
|
|
|
|
|
|
<el-option :value="myVal" disabled v-if="users && users.length>10"> |
|
|
<el-row><el-button :type="deptUserVisible?'':'primary'" @click.stop="deptUserVisible=false">常用用户</el-button> <el-button :type="deptUserVisible?'primary':''" @click.stop="deptUserVisible=true">部门用户</el-button><el-button v-if="projectId" :type="projectVisible?'primary':''" @click.stop="projectVisible=true">项目组</el-button> </el-row> |
|
|
<el-row><el-button :type="deptUserVisible?'':'primary'" @click.stop="deptUserVisible=false">常用用户</el-button> <el-button :type="deptUserVisible?'primary':''" @click.stop="deptUserVisible=true">部门用户</el-button><el-button v-if="projectId" :type="projectVisible?'primary':''" @click.stop="projectVisible=true">项目组</el-button> </el-row> |
|
|
</el-option> |
|
|
</el-option> |
|
|
<el-option class="avatar-container" v-for="(item,index) in users" :key="index" :value="item" :label="item.username"> |
|
|
<el-option class="avatar-container" v-for="(item,index) in users" :key="index" :value="item" :label="item.username"> |
|
|
@ -26,7 +26,7 @@ |
|
|
<i v-else> </i> |
|
|
<i v-else> </i> |
|
|
</div> |
|
|
</div> |
|
|
</el-option> |
|
|
</el-option> |
|
|
<el-option value="" > |
|
|
|
|
|
|
|
|
<el-option :value="myVal" disabled> |
|
|
<el-row><el-button :type="deptUserVisible?'':'primary'" @click.stop="deptUserVisible=false">常用用户</el-button> <el-button :type="deptUserVisible?'primary':''" @click.stop="deptUserVisible=true">部门用户</el-button><el-button v-if="projectId||productId" :type="projectVisible?'primary':''" @click.stop="projectVisible=true">项目组</el-button> </el-row> |
|
|
<el-row><el-button :type="deptUserVisible?'':'primary'" @click.stop="deptUserVisible=false">常用用户</el-button> <el-button :type="deptUserVisible?'primary':''" @click.stop="deptUserVisible=true">部门用户</el-button><el-button v-if="projectId||productId" :type="projectVisible?'primary':''" @click.stop="projectVisible=true">项目组</el-button> </el-row> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
@ -70,9 +70,6 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
myVal(){ |
|
|
myVal(){ |
|
|
if(this.value instanceof String){ |
|
|
|
|
|
this.$emit('input',this.myVal) |
|
|
|
|
|
}else if(this.value instanceof Object){ |
|
|
|
|
|
if(!this.myVal||!this.myVal.userid){ |
|
|
if(!this.myVal||!this.myVal.userid){ |
|
|
if(this.value[this.useridKey]){ |
|
|
if(this.value[this.useridKey]){ |
|
|
this.value[this.useridKey]="" |
|
|
this.value[this.useridKey]="" |
|
|
@ -83,14 +80,12 @@ |
|
|
}else{ |
|
|
}else{ |
|
|
if(this.value[this.useridKey]!=this.myVal.userid){ |
|
|
if(this.value[this.useridKey]!=this.myVal.userid){ |
|
|
this.value[this.useridKey]=this.myVal.userid |
|
|
this.value[this.useridKey]=this.myVal.userid |
|
|
this.value[this.usernameKey]=this.myVal.userid |
|
|
|
|
|
|
|
|
this.value[this.usernameKey]=this.myVal.username |
|
|
this.$emit('input',this.value) |
|
|
this.$emit('input',this.value) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
projectId:{ |
|
|
projectId:{ |
|
|
@ -133,9 +128,6 @@ |
|
|
if(!myVal){ |
|
|
if(!myVal){ |
|
|
return "" |
|
|
return "" |
|
|
}else{ |
|
|
}else{ |
|
|
if(this.value instanceof String){ |
|
|
|
|
|
return myVal |
|
|
|
|
|
}else if(this.value instanceof Object){ |
|
|
|
|
|
if(!myVal||!myVal.userid){ |
|
|
if(!myVal||!myVal.userid){ |
|
|
return "" |
|
|
return "" |
|
|
} |
|
|
} |
|
|
@ -147,30 +139,11 @@ |
|
|
return "" |
|
|
return "" |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
getMyAvaterInfo(item){ |
|
|
getMyAvaterInfo(item){ |
|
|
return this.showMyValue(item) |
|
|
return this.showMyValue(item) |
|
|
}, |
|
|
}, |
|
|
getMyColor(item){ |
|
|
getMyColor(item){ |
|
|
if(this.value instanceof String){ |
|
|
|
|
|
if(item){ |
|
|
|
|
|
|
|
|
|
|
|
if(this.getColor){ |
|
|
|
|
|
return this.getColor(item) |
|
|
|
|
|
} |
|
|
|
|
|
return util.getColor(item) |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
if(this.getColor){ |
|
|
|
|
|
return this.getColor("0") |
|
|
|
|
|
}else{ |
|
|
|
|
|
return util.getColor(0) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(this.value instanceof Object){ |
|
|
|
|
|
|
|
|
|
|
|
if(item&&item.userid){ |
|
|
if(item&&item.userid){ |
|
|
|
|
|
|
|
|
@ -187,8 +160,6 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getMyIcon(item){ |
|
|
getMyIcon(item){ |
|
|
if(item){ |
|
|
if(item){ |
|
|
@ -206,13 +177,10 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
initData(){ |
|
|
initData(){ |
|
|
if(this.value instanceof String){ |
|
|
|
|
|
this.myVal=this.value |
|
|
|
|
|
}else if(this.value instanceof Object){ |
|
|
|
|
|
this.myVal={} |
|
|
|
|
|
this.myVal.userid=this.value[this.useridKey] |
|
|
|
|
|
this.myVal.username=this.value[this.usernameKey] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var myVal={} |
|
|
|
|
|
myVal.userid=this.value[this.useridKey] |
|
|
|
|
|
myVal.username=this.value[this.usernameKey] |
|
|
|
|
|
this.myVal=myVal |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
onSelectChange(item){ |
|
|
onSelectChange(item){ |
|
|
|