<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: 140px">
        <el-select
          v-model="params.isShare"
          placeholder="多元融合"
          style="width: 240px"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
        <!-- <el-input v-model="params.keyword" placeholder="请输入"></el-input> -->
      </el-form-item>
    </template>
    <template v-slot:content>
      <component
        :is="component"
        :fusionIds="fusionIds"
        :noEditList="noEditList"
        :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<{ fusionIds: Array<string>, noEditList: Array<string> }>();
const options = [
  {
    value: 0,
    label: "多元融合",
  },
  {
    value: 1,
    label: "共享多元融合",
  },
];

const params = useScenePaggingParams();
console.log("params.isSwmx", params, "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>
