<template>
  <com-head :options="headOptions" v-model="params.pagging.state.query.isObj">
    <el-form label-width="84px" inline>
      <slot name="header" />
      <el-form-item class="searh-btns" style="grid-area: 1 / 6 / 2 / 4">
        <el-button style="visibility: hidden;" type="primary" @click="params.pagging.refresh">查询</el-button>
        <el-button v-if="upload" type="primary" plain @click="addUploadSecen">上传</el-button>
        <el-button class="float-right" type="primary" plain @click="params.pagging.queryReset"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
  </com-head>

  <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 { SceneTypeDesc } from "@/constant/scene";
import { useScenePaggingParams } from "./pagging";
import { addModelScene } from "./quisk" 
const props = defineProps<{ params: ReturnType<typeof useScenePaggingParams>, upload: boolean }>();
const addUploadSecen = async () => {
  await addModelScene();
  props.params.pagging.refresh();
}
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] },
];
</script>
