Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

questionnairesの実装 #29

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions components/questionnaire-list/questionnaire-list.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<script lang="ts" setup>
import { FilterMatchMode } from 'primevue/api';
import { ref } from 'vue';

const props = defineProps<{
customers: {
title: string;
response_due_date_time: string;
modified_at: string;
questionnaire_id: string;
}[];
}>();
const filters = ref({
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
});
const loading = ref(false);
</script>

<template>
<div class="card">
<DataTable
v-model:filters="filters"
:value="customers"
paginator
:rows="20"
data-key="id"
:loading="loading"
:global-filter-fields="[
'title'
]"
>
<template #header>
<div class="flex justify-content-end">
<span class="p-input-icon-left">
<i class="pi pi-search" />
<InputText
v-model="filters['global'].value"
placeholder="アンケート名で検索"
/>
</span>
</div>
</template>
<Column field="title" header="アンケート名">
<template #body="{ data }">
{{ data.title }}
</template>
</Column>

<Column field="response_due_date_time" header="回答期限">
<template #body="{ data }">
{{ data.response_due_date_time }}
</template>
</Column>
<Column field="modified_at" header="最終更新日時">
<template #body="{ data }">
{{ data.modified_at }}
</template>
</Column>
<Column field="questionnaire_id" header="リンク">
<template #body="{ data }">
{{ data.questionnaire_id }}
</template>
</Column>
</DataTable>
</div>
</template>

<style></style>
15 changes: 13 additions & 2 deletions pages/questionnaires/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
<script lang="ts" setup></script>
<script lang="ts" setup>
const customer = ref([
{
title:"ああああああああああああああ",
response_due_date_time:"2021/10/10",
modified_at:"2021/10/10",
questionnaire_id:"1",
},
]);
</script>

<template>
<div/>
<div>
<questionnaire-list :customers="customer" />
</div>
</template>

<style></style>
Loading