<!--
 * @Author: YKH
 * @Date: 2022-03-11 16:13:39
 * @LastEditTime: 2022-03-15 14:53:42
 * @Description: 
 * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\cool\modules\shuyou\components\adv-search-dataActive.vue
-->
<template>
	<div class="demo-adv-search-dataActive">
		<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"),
					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: "分类依据",
				prop: "agentOrDirector",
				value: 0,
				component: {
					name: "el-radio-group",
					options: [
						{
							label: "总数据",
							value: 0
						},
						{
							label: "按游戏端口",
							value: 1
						},
						{
							label: "按负责人",
							value: 2
						}
					]
				}
			}
		]);

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

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

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