2024-04-20 22:36:09 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { $t } from '@/locales';
|
2024-04-22 17:57:02 +08:00
|
|
|
import SelectGroup from '@/components/common/select-group.vue';
|
|
|
|
import SelectScene from '@/components/common/select-scene.vue';
|
2024-04-20 22:36:09 +08:00
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: 'SceneSearch'
|
|
|
|
});
|
|
|
|
|
|
|
|
interface Emits {
|
|
|
|
(e: 'reset'): void;
|
|
|
|
(e: 'search'): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
const emit = defineEmits<Emits>();
|
|
|
|
|
|
|
|
const model = defineModel<Api.RetryScene.SceneSearchParams>('model', { required: true });
|
|
|
|
|
2024-04-21 17:54:48 +08:00
|
|
|
/** 组列表 */
|
2024-04-22 17:57:02 +08:00
|
|
|
// const groupNameList = ref<string[]>([]);
|
2024-04-21 17:54:48 +08:00
|
|
|
/** 场景列表 */
|
2024-04-22 17:57:02 +08:00
|
|
|
// const sceneNameList = ref<string[]>([]);
|
2024-04-21 17:54:48 +08:00
|
|
|
|
2024-04-22 17:57:02 +08:00
|
|
|
// async function getGroupNameList() {
|
|
|
|
// const res = await fetchGetAllGroupNameList();
|
|
|
|
// groupNameList.value = res.data as string[];
|
|
|
|
// }
|
2024-04-21 17:54:48 +08:00
|
|
|
|
2024-04-20 22:36:09 +08:00
|
|
|
function reset() {
|
|
|
|
emit('reset');
|
|
|
|
}
|
|
|
|
|
|
|
|
function search() {
|
|
|
|
emit('search');
|
|
|
|
}
|
2024-04-21 17:54:48 +08:00
|
|
|
|
2024-04-22 17:57:02 +08:00
|
|
|
// async function handleGroupNameUpdate(groupName: string) {
|
|
|
|
// if (groupName) {
|
|
|
|
// const res = await fetchGetRetrySceneList({ groupName });
|
|
|
|
// sceneNameList.value = res.data!.map((scene: Api.RetryScene.Scene) => scene.sceneName);
|
|
|
|
// } else {
|
|
|
|
// model.value.sceneName = '';
|
|
|
|
// sceneNameList.value = [];
|
|
|
|
// }
|
|
|
|
// }
|
2024-04-21 17:54:48 +08:00
|
|
|
|
2024-04-22 17:57:02 +08:00
|
|
|
// onMounted(() => {
|
|
|
|
// getGroupNameList();
|
|
|
|
// });
|
2024-04-20 22:36:09 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<SearchForm :model="model" @search="search" @reset="reset">
|
2024-04-21 09:47:13 +08:00
|
|
|
<NFormItemGi span="24 s:12 m:6" :label="$t('page.retryScene.groupName')" path="userName" class="pr-24px">
|
2024-04-22 17:57:02 +08:00
|
|
|
<!-- <NSelect-->
|
|
|
|
<!-- v-model:value="model.groupName"-->
|
|
|
|
<!-- :placeholder="$t('page.retryScene.form.groupName')"-->
|
|
|
|
<!-- :options="translateOptions2(groupNameList)"-->
|
|
|
|
<!-- clearable-->
|
|
|
|
<!-- filterable-->
|
|
|
|
<!-- @update:value="handleGroupNameUpdate"-->
|
|
|
|
<!-- />-->
|
|
|
|
|
|
|
|
<SelectGroup v-model:value="model.groupName" />
|
2024-04-20 22:36:09 +08:00
|
|
|
</NFormItemGi>
|
2024-04-21 09:47:13 +08:00
|
|
|
<NFormItemGi span="24 s:12 m:6" :label="$t('page.retryScene.sceneName')" path="userName" class="pr-24px">
|
2024-04-22 17:57:02 +08:00
|
|
|
<!-- <NSelect-->
|
|
|
|
<!-- v-model:value="model.sceneName"-->
|
|
|
|
<!-- :placeholder="$t('page.retryScene.form.sceneName')"-->
|
|
|
|
<!-- :options="translateOptions2(sceneNameList)"-->
|
|
|
|
<!-- clearable-->
|
|
|
|
<!-- />-->
|
|
|
|
<SelectScene v-model:value="model.sceneName" :group-name="model.groupName as string" />
|
2024-04-20 22:36:09 +08:00
|
|
|
</NFormItemGi>
|
|
|
|
</SearchForm>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped></style>
|