<template>
	<div class="demo-adv-search-reason">
		<cl-adv-btn>高级搜索</cl-adv-btn>
		<cl-adv-search :items="items" :op-list="opList" />
	</div>
</template>

<script lang="ts">
import { AdvSearchItem } from "cl-admin-crud-vue3/types";
import { defineComponent, ref } from "vue";
// import dayjs from "dayjs";

export default defineComponent({
	setup() {
		const items = ref<AdvSearchItem[]>([
			{
				prop: "new_date",
				label: "目标日期",
				span: 18,
				// value: dayjs(new Date()).format("YYYY-MM-DD"),
				component: {
					name: "el-date-picker",
					props: {
						type: "daterange",
						rangeSeparator: "至",
						startPlaceholder: "开始日期",
        				endPlaceholder: "结束日期",
						format: "YYYY-MM-DD",
						valueFormat: "YYYY-MM-DD"
					}
				},
				rules: {
					required: true,
					message: "日期不能为空"
				}
			},
			{
				label: "任务ID",
				prop: "task_id",
				span: 13,
				component: {
					name: "el-input",
					attrs: {
						placeholder: "请填写任务ID"
					}
				}
			},
			{
				label: "任务名称",
				prop: "task_name",
				span: 18,
				component: {
					name: "el-input",
					attrs: {
						placeholder: "请填写任务名称"
					}
				}
			},
			{
				prop: "directorName",
				label: "负责人",
				span: 13,
				component: {
					name: "shuyouGameDirectorNameselect",
					props: {
						placeholder: "请选择负责人"
					}
				}
			}
		]);

		const opList = ref<string[]>(["search", "reset", "close"]);

		return {
			items,
			opList
		};
	}
});
</script>

<style lang="scss" scoped></style>
