<template>
  <List :params="params">
    <template v-slot:header>
      <el-form-item label="场景名称：" style="width: 250px">
        <el-input v-model="params.keyword" placeholder="请输入"></el-input>
      </el-form-item>
      <!-- <el-form-item label="类型：" style="width: 250px">
        <el-select
          v-model="params.pagging.state.query.sceneType"
          placeholder="Select"
          size="large"
          style="width: 240px"
        >
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
      </el-form-item> -->
    </template>
    <template v-slot:content>
      <component :is="component" :numList="numList" :pagging="params.pagging" ref="contentRef" />
    </template>
  </List>
</template>

<script setup lang="ts">
import comSelect from "@/components/company-select/index.vue";
import List from "./list.vue";
import SceneContent from "./sceneContent.vue";
import ModelContent from "./modelContent.vue";
import { useScenePaggingParams } from "./pagging";
import { QuiskExpose } from "@/helper/mount";
import { computed, ref } from "vue";
defineProps<{ numList: Array<string> }>();
const options = [
  {
    value: '1',
    label: 'Mesh 场景',
  },
  {
    value: '2',
    label: '点云场景',
  },
]

const params = useScenePaggingParams();
console.log('params.isSwmx', params.isSwmx, 'ModelContent');
const component = computed(() => (params.isSwmx ? ModelContent : SceneContent));
const  contentRef = ref(null);
const submit = async () => {
    // replaceCaseScenes(props.caseId, caseScenes.value)
    await contentRef.value?.submit()
    // console.log("submit", caseScenes.value);
  }
defineExpose<QuiskExpose>({
  submit
});
</script>
