|
@@ -2,6 +2,7 @@
|
|
|
<el-select v-model="modelObj" :clearable="props.clearable"
|
|
|
:remote="props.remote" :remote-method="xcMethod"
|
|
|
:style="{width: props.width + 'px'}"
|
|
|
+ ref="xcselect"
|
|
|
filterable @change="changeStaff" @clear="clear">
|
|
|
<el-option v-for="(item,index) in props.data" :key="item.index"
|
|
|
:label="item.name"
|
|
@@ -56,6 +57,7 @@ let modelObj = $ref({
|
|
|
value: '',
|
|
|
label: '',
|
|
|
})
|
|
|
+let xcselect = $ref()
|
|
|
let optionList = $ref([])
|
|
|
const colorList = {
|
|
|
'primary': '#409eff',
|
|
@@ -111,7 +113,6 @@ watch(() => props.data, () => {
|
|
|
})
|
|
|
|
|
|
const updateData = () => {
|
|
|
-
|
|
|
let code = props.modelValue[props.name[0]]
|
|
|
if (stringNotBlank(code)) {
|
|
|
let codeList = props.data.find((i) => i.code === code)
|
|
@@ -132,6 +133,11 @@ const method = (value) => {
|
|
|
emit('method', value)
|
|
|
}
|
|
|
|
|
|
+const focus = () => {
|
|
|
+ xcselect.focus()
|
|
|
+}
|
|
|
+defineExpose({focus})
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
// 判断组件是否使用了 slot
|
|
|
if (!!useSlots().default) {
|