|
|
|
@ -1,13 +1,15 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-popover placement="bottom-start" :visible="isVisible" :width="props.width" ref="popoverRef" @before-enter="beforeShow" @hide ="afterShow">
|
|
|
|
<el-popover placement="bottom-start" :visible="isVisible" :width="props.width" ref="popoverRef"
|
|
|
|
|
|
|
|
@before-enter="beforeShow" @hide="afterShow">
|
|
|
|
<template #reference>
|
|
|
|
<template #reference>
|
|
|
|
<el-input v-model="keyword" :style="{width:props.width+'px',height: 100+'%'}" @input="changeInput" :disabled="disabled" @click="changeInput"
|
|
|
|
<el-input v-model="keyword" style="width: 100%" @input="changeInput" :disabled="disabled" @click="changeInput"
|
|
|
|
placeholder="诊断选择" ref="inputRef" @focus="focus" @blur="handleBlur"></el-input>
|
|
|
|
placeholder="诊断选择" ref="inputRef" @focus="focus" @blur="handleBlur"></el-input>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
|
<el-table :data="searchList" style="width: 100%" @row-click="clickRow" :show-header="props.showHeader" size="small"
|
|
|
|
<el-table :data="searchList" style="width: 100%" @row-click="clickRow" :show-header="props.showHeader"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
max-height="250px">
|
|
|
|
max-height="250px">
|
|
|
|
<el-table-column v-for="item in showConfig" :prop="item.prop" :label="item.label"
|
|
|
|
<el-table-column v-for="item in showConfig" :prop="item.prop" :label="item.label"
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
@ -53,7 +55,6 @@ const props = defineProps({
|
|
|
|
const inputRef = ref();
|
|
|
|
const inputRef = ref();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const searchList = ref([]);
|
|
|
|
const searchList = ref([]);
|
|
|
|
const changeInput = (inputStr: string) => {
|
|
|
|
const changeInput = (inputStr: string) => {
|
|
|
|
unref(popoverRef).popperRef?.delayHide?.()
|
|
|
|
unref(popoverRef).popperRef?.delayHide?.()
|
|
|
|
@ -80,7 +81,7 @@ const changeInput = (inputStr: string) => {
|
|
|
|
searchList.value = res;
|
|
|
|
searchList.value = res;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const emit = defineEmits(['selectedCallBack','focus'])
|
|
|
|
const emit = defineEmits(['selectedCallBack', 'focus'])
|
|
|
|
const clickRow = (row: any) => {
|
|
|
|
const clickRow = (row: any) => {
|
|
|
|
selectList.value.push(row)
|
|
|
|
selectList.value.push(row)
|
|
|
|
nameList.value.push(row.name)
|
|
|
|
nameList.value.push(row.name)
|
|
|
|
@ -95,9 +96,9 @@ const beforeShow = () => {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const afterShow = () => {
|
|
|
|
const afterShow = () => {
|
|
|
|
if (nameList.value.length === 0){
|
|
|
|
if (nameList.value.length === 0) {
|
|
|
|
keyword.value = ""
|
|
|
|
keyword.value = ""
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
keyword.value = nameList.value.join(",") + ","
|
|
|
|
keyword.value = nameList.value.join(",") + ","
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -115,17 +116,17 @@ const init = (list: any, nList: any) => {
|
|
|
|
keyword.value = nameList.value.join(",") + ","
|
|
|
|
keyword.value = nameList.value.join(",") + ","
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const isVisible = ref(false);
|
|
|
|
const isVisible = ref(false);
|
|
|
|
const focus = ()=>{
|
|
|
|
const focus = () => {
|
|
|
|
isVisible.value=true
|
|
|
|
isVisible.value = true
|
|
|
|
emit("focus",false)
|
|
|
|
emit("focus", false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const handleBlur =()=> {
|
|
|
|
const handleBlur = () => {
|
|
|
|
isVisible.value=false
|
|
|
|
isVisible.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defineExpose({init})
|
|
|
|
defineExpose({init})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
<style scoped lang="scss">
|
|
|
|
:deep(.el-table--small .el-table__cell){
|
|
|
|
:deep(.el-table--small .el-table__cell) {
|
|
|
|
padding: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|