<template>
    <el-form label-width="84px" inline>
      <slot name="header" />
      <el-form-item class="searh-btns" style="grid-area: 1 / 4 / 2 / 4">
        <!-- <el-button type="primary" @click="params.pagging.refresh">查询</el-button> -->
        <el-button type="primary" plain @click="params.pagging.queryReset"
          >重置</el-button
        >
        <!-- :disabled="!!file" -->
        <!-- <el-upload
        class="upload-demo"
        :multiple="false"
        :limit="1"
        :before-upload="upload"
        :show-file-list="false"
        :http-request="() => {}"
        :accept="accept"
      > -->
        <!-- <el-button style="margin-left: 12px" type="primary" @click="handleAdd">上传文件</el-button> -->
      <!-- </el-upload> -->
      </el-form-item>
    </el-form>

  <div class="body-layer">
    <slot name="content" />
    <com-pagination
      @size-change="params.pagging.changPageSize"
      @current-change="params.pagging.changPageCurrent"
      :current-page="params.pagging.state.pag.currentPage"
      :page-size="params.pagging.state.pag.size"
      :total="params.pagging.state.pag.total"
    />
  </div>
</template>

<script setup lang="ts">
import comHead from "@/components/head/index.vue";
import comPagination from "@/components/pagination/index.vue";
import { SceneType } from "@/store/scene";
import { useFirePagging } from "./pagging";
import { SceneTypeDesc } from "@/constant/scene";
import { useScenePaggingParams } from "./pagging";
import { useUpload } from "@/hook/upload";
import { addLibraryFile } from "./quisk";

// const { pagging } = useScenePaggingParams();
const props = defineProps<{ params: ReturnType<typeof useScenePaggingParams> }>();

const { size, fileList, upload, removeFile, previewFile, file, accept } =
  useUpload({
    maxSize: 2000 * 1024 * 1024,
    formats: [".jpg", ".png", ".jpeg", ".mp4", ".wav", ".mp3"],
  });
const headOptions = [
  { value: SceneType.SWKK, name: SceneTypeDesc[SceneType.SWKK] },
  { value: SceneType.SWKJ, name: SceneTypeDesc[SceneType.SWKJ] },
  { value: SceneType.SWSS, name: SceneTypeDesc[SceneType.SWSS] },
  { value: SceneType.SWSSMX, name: SceneTypeDesc[SceneType.SWSSMX] },
  { value: SceneType.SWYDSS, name: SceneTypeDesc[SceneType.SWYDSS] },
  { value: SceneType.SWYDMX, name: SceneTypeDesc[SceneType.SWYDMX] },
  { value: SceneType.SWMX, name: SceneTypeDesc[SceneType.SWMX] },
];
const handleAdd = async () => {
  await addLibraryFile();
  props.params.pagging.refresh();
};
</script>
