|
@@ -1,6 +1,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<PagingTable url="/game" :where="where" ref="table">
|
|
<PagingTable url="/game" :where="where" ref="table">
|
|
|
<template #filter>
|
|
<template #filter>
|
|
|
|
|
+ <ElSelect v-model="where.roomId" clearable placeholder="筛选房间">
|
|
|
|
|
+ <ElOption v-for="item in rooms" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
+ </ElSelect>
|
|
|
<ElButton :icon="Plus" @click="onEdit()">添加</ElButton>
|
|
<ElButton :icon="Plus" @click="onEdit()">添加</ElButton>
|
|
|
</template>
|
|
</template>
|
|
|
<ElTableColumn prop="id" label="#" width="80" />
|
|
<ElTableColumn prop="id" label="#" width="80" />
|
|
@@ -106,7 +109,7 @@
|
|
|
</ElDialog>
|
|
</ElDialog>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref } from 'vue'
|
|
|
|
|
|
|
+import { onMounted, ref } from 'vue'
|
|
|
import PagingTable from '@/components/PagingTable.vue'
|
|
import PagingTable from '@/components/PagingTable.vue'
|
|
|
import { useEnumFormatter, useTimeFormatter } from '@/utils/formatter'
|
|
import { useEnumFormatter, useTimeFormatter } from '@/utils/formatter'
|
|
|
import { Plus } from '@vicons/tabler'
|
|
import { Plus } from '@vicons/tabler'
|
|
@@ -147,6 +150,14 @@ const rules = {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const rooms = ref([])
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ http.post('/room').then((res) => {
|
|
|
|
|
+ rooms.value = res.items
|
|
|
|
|
+ })
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const { showEditDialog, onEdit } = setupEditDialog(model)
|
|
const { showEditDialog, onEdit } = setupEditDialog(model)
|
|
|
async function submit() {
|
|
async function submit() {
|
|
|
await http.put(model.value.id ? `/game/${model.value.id}` : '/game', model.value)
|
|
await http.put(model.value.id ? `/game/${model.value.id}` : '/game', model.value)
|