<script setup lang="ts">
import type { SelectOption } from 'naive-ui';
import SearchForm from '@/components/advanced/search-form.vue';

defineOptions({
  name: 'JobSearch',
  inheritAttrs: false
});

const model = defineModel<Api.SystemManage.JobSearchParams>('model', { required: true });
withDefaults(defineProps<{ statusOptions: Api.SystemManage.DictInfo[]; jobGroupOptions?: Array<SelectOption> }>(), {
  typeOptions: () => [],
  jobGroupOptions: () => []
});
</script>

<template>
  <SearchForm v-model:model="model" v-bind="$attrs">
    <template #formItem>
      <NFormItemGi span="24 s:12 m:6" label="任务名称" class="pr-24px">
        <NInput v-model:value="model.jobName" placeholder="请输入任务名称" />
      </NFormItemGi>
      <NFormItemGi span="24 s:12 m:6" label="任务组名" class="pr-24px">
        <NSelect v-model:value="model.jobGroup" placeholder="请选择任务组名" :options="jobGroupOptions" clearable />
      </NFormItemGi>
      <NFormItemGi span="24 s:12 m:6" label="任务状态" class="pr-24px">
        <NSelect
          v-model:value="model.status"
          label-field="dictLabel"
          value-field="dictValue"
          placeholder="请选择任务状态"
          :options="statusOptions"
          clearable
        />
      </NFormItemGi>
    </template>
  </SearchForm>
</template>

<style scoped></style>
