<script setup lang="ts">
import { ref } from "vue";
import { useVModel } from "@vueuse/core";
import RemoteSelect from "/@/components/RemoteSelect";
import { httpCompanylist } from "/@/api/netOrderEnter/netOrderEntry";

const props = defineProps<{
  modelValue?: string;
  disabled?: boolean;
}>();

const value = useVModel(props, "modelValue");

const RemoteSelectRef = ref<InstanceType<typeof RemoteSelect> | null>(null);

defineExpose({
  initalData: data => (RemoteSelectRef.value as any).initalData(data)
});
</script>

<template>
  <RemoteSelect
    ref="RemoteSelectRef"
    :disabled="disabled"
    v-model="value"
    style="width: 100%"
    :api="httpCompanylist"
    requset-prop="name"
    response-label-prop="company_name"
    response-val-prop="companyNo"
  />
</template>
