[色子游戏]奖池配置-优化样式
This commit is contained in:
@@ -8,7 +8,11 @@
|
||||
<ArtTableHeader v-model:columns="columnChecks" :loading="loading" @refresh="refreshData">
|
||||
<template #left>
|
||||
<ElSpace wrap>
|
||||
<ElButton v-permission="'dice:lottery_config:index:save'" @click="showDialog('add')" v-ripple>
|
||||
<ElButton
|
||||
v-permission="'dice:lottery_config:index:save'"
|
||||
@click="showDialog('add')"
|
||||
v-ripple
|
||||
>
|
||||
<template #icon>
|
||||
<ArtSvgIcon icon="ri:add-fill" />
|
||||
</template>
|
||||
@@ -77,11 +81,10 @@
|
||||
import TableSearch from './modules/table-search.vue'
|
||||
import EditDialog from './modules/edit-dialog.vue'
|
||||
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
type: undefined
|
||||
})
|
||||
|
||||
// 搜索处理
|
||||
@@ -90,6 +93,16 @@
|
||||
getData()
|
||||
}
|
||||
|
||||
// 奖池类型展示:0=正常 1=强制杀猪 2=T1高倍率
|
||||
const typeFormatter = (row: Record<string, unknown>) =>
|
||||
row.type === 0 ? '正常' : row.type === 1 ? '强制杀猪' : row.type === 2 ? 'T1高倍率' : '-'
|
||||
|
||||
// 权重列带 %
|
||||
const weightFormatter = (prop: string) => (row: Record<string, unknown>) => {
|
||||
const v = row[prop]
|
||||
return v != null && v !== '' ? `${v}%` : '-'
|
||||
}
|
||||
|
||||
// 表格配置
|
||||
const {
|
||||
columns,
|
||||
@@ -110,13 +123,13 @@
|
||||
columnsFactory: () => [
|
||||
{ type: 'selection' },
|
||||
{ prop: 'name', label: '名称' },
|
||||
{ prop: 'type', label: '奖池类型' },
|
||||
{ prop: 'type', label: '奖池类型', width: 100, formatter: typeFormatter },
|
||||
{ prop: 'safety_line', label: '安全线' },
|
||||
{ prop: 't1_wight', label: 'T1池权重' },
|
||||
{ prop: 't2_wight', label: 'T2池权重' },
|
||||
{ prop: 't3_wight', label: 'T3池权重' },
|
||||
{ prop: 't4_wight', label: 'T4池权重' },
|
||||
{ prop: 't5_wight', label: 'T5池权重' },
|
||||
{ prop: 't1_wight', label: 'T1池权重', width: 100, formatter: weightFormatter('t1_wight') },
|
||||
{ prop: 't2_wight', label: 'T2池权重', width: 100, formatter: weightFormatter('t2_wight') },
|
||||
{ prop: 't3_wight', label: 'T3池权重', width: 100, formatter: weightFormatter('t3_wight') },
|
||||
{ prop: 't4_wight', label: 'T4池权重', width: 100, formatter: weightFormatter('t4_wight') },
|
||||
{ prop: 't5_wight', label: 'T5池权重', width: 100, formatter: weightFormatter('t5_wight') },
|
||||
{ prop: 'operation', label: '操作', width: 100, fixed: 'right', useSlot: true }
|
||||
]
|
||||
}
|
||||
@@ -133,5 +146,4 @@
|
||||
handleSelectionChange,
|
||||
selectedRows
|
||||
} = useSaiAdmin()
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user