Compare commits
No commits in common. "9340bfd9e36543cd097e1945f9263b3373ddc1a1" and "04cd3b953cc77573caf1f08d6667577e79581fa6" have entirely different histories.
9340bfd9e3
...
04cd3b953c
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
|
||||
<el-popover placement="bottom-start" :visible="isVisible" :width="props.width" ref="popoverRef"
|
||||
<el-popover placement="bottom-start" :visible="isVisible" width="40%" ref="popoverRef"
|
||||
:trigger-keys="[]">
|
||||
<template #reference>
|
||||
<el-input
|
||||
|
|
@ -58,7 +58,7 @@ const props = defineProps({
|
|||
},
|
||||
width: {
|
||||
type: Number,
|
||||
default: 600
|
||||
default: 1000
|
||||
},
|
||||
showConfig: {
|
||||
type: Array as () => showConfig[],
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
<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>
|
||||
<el-input v-model="keyword" style="width: 100%" @input="changeInput" :disabled="disabled" @click="changeInput"
|
||||
<el-input v-model="keyword" :style="{width:props.width+'px',height: 100+'%'}" @input="changeInput" :disabled="disabled" @click="changeInput"
|
||||
placeholder="诊断选择" ref="inputRef" @focus="focus" @blur="handleBlur"></el-input>
|
||||
</template>
|
||||
<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">
|
||||
<el-table-column v-for="item in showConfig" :prop="item.prop" :label="item.label"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
|
|
@ -55,6 +53,7 @@ const props = defineProps({
|
|||
const inputRef = ref();
|
||||
|
||||
|
||||
|
||||
const searchList = ref([]);
|
||||
const changeInput = (inputStr: string) => {
|
||||
unref(popoverRef).popperRef?.delayHide?.()
|
||||
|
|
@ -81,7 +80,7 @@ const changeInput = (inputStr: string) => {
|
|||
searchList.value = res;
|
||||
})
|
||||
}
|
||||
const emit = defineEmits(['selectedCallBack', 'focus'])
|
||||
const emit = defineEmits(['selectedCallBack','focus'])
|
||||
const clickRow = (row: any) => {
|
||||
selectList.value.push(row)
|
||||
nameList.value.push(row.name)
|
||||
|
|
@ -96,9 +95,9 @@ const beforeShow = () => {
|
|||
// }
|
||||
}
|
||||
const afterShow = () => {
|
||||
if (nameList.value.length === 0) {
|
||||
if (nameList.value.length === 0){
|
||||
keyword.value = ""
|
||||
} else {
|
||||
}else {
|
||||
keyword.value = nameList.value.join(",") + ","
|
||||
}
|
||||
|
||||
|
|
@ -116,17 +115,17 @@ const init = (list: any, nList: any) => {
|
|||
keyword.value = nameList.value.join(",") + ","
|
||||
}
|
||||
const isVisible = ref(false);
|
||||
const focus = () => {
|
||||
isVisible.value = true
|
||||
emit("focus", false)
|
||||
const focus = ()=>{
|
||||
isVisible.value=true
|
||||
emit("focus",false)
|
||||
}
|
||||
const handleBlur = () => {
|
||||
isVisible.value = false
|
||||
const handleBlur =()=> {
|
||||
isVisible.value=false
|
||||
}
|
||||
defineExpose({init})
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-table--small .el-table__cell) {
|
||||
:deep(.el-table--small .el-table__cell){
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue