1.抽奖测试记录页面/dice/play_record_test/index增加彩金池配置筛选条件
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
"platformTotalProfit": "Platform Total Profit"
|
||||
},
|
||||
"search": {
|
||||
"lotteryPoolConfig": "Lottery Pool Config",
|
||||
"placeholderLotteryPool": "Select pool (search by name)",
|
||||
"rewardConfigRecordId": "Weight Test Record ID",
|
||||
"drawType": "Draw Type",
|
||||
"direction": "Direction",
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
"platformTotalProfit": "平台总盈利"
|
||||
},
|
||||
"search": {
|
||||
"lotteryPoolConfig": "彩金池配置",
|
||||
"placeholderLotteryPool": "请选择彩金池(可搜索 name)",
|
||||
"rewardConfigRecordId": "测试记录ID",
|
||||
"drawType": "抽奖类型",
|
||||
"direction": "方向",
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
|
||||
// 搜索表单(与 play_record 对齐:方向、赢取平台币范围、是否中大奖、中奖档位、点数和)
|
||||
const searchForm = ref<Record<string, unknown>>({
|
||||
lottery_config_id: undefined,
|
||||
reward_config_record_id: undefined,
|
||||
lottery_type: undefined,
|
||||
direction: undefined,
|
||||
|
||||
@@ -8,6 +8,29 @@
|
||||
@search="handleSearch"
|
||||
@expand="handleExpand"
|
||||
>
|
||||
<el-col v-bind="setSpan(6)">
|
||||
<el-form-item :label="$t('page.search.lotteryPoolConfig')" prop="lottery_config_id">
|
||||
<el-select
|
||||
v-model="formData.lottery_config_id"
|
||||
:placeholder="$t('page.search.placeholderLotteryPool')"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:loading="lotteryPoolLoading"
|
||||
:remote-method="filterLotteryPoolOptions"
|
||||
style="width: 100%"
|
||||
@visible-change="onLotteryPoolDropdownVisible"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in lotteryPoolOptions"
|
||||
:key="item.id"
|
||||
:label="lotteryPoolOptionLabel(item)"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="setSpan(6)">
|
||||
<el-form-item :label="$t('page.search.rewardConfigRecordId')" prop="reward_config_record_id">
|
||||
<el-input-number
|
||||
@@ -120,6 +143,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import lotteryPoolApi from '../../../api/lottery_pool_config/index'
|
||||
import {
|
||||
getChannelDeptRequestParams,
|
||||
useInjectedChannelDept
|
||||
} from '@/composables/useChannelDeptScope'
|
||||
|
||||
interface Props {
|
||||
modelValue: Record<string, any>
|
||||
}
|
||||
@@ -131,6 +160,70 @@
|
||||
const props = defineProps<Props>()
|
||||
const emit = defineEmits<Emits>()
|
||||
const isExpanded = ref<boolean>(false)
|
||||
const channelScope = useInjectedChannelDept()
|
||||
|
||||
const lotteryPoolAllOptions = ref<Array<{ id: number; name: string }>>([])
|
||||
const lotteryPoolOptions = ref<Array<{ id: number; name: string }>>([])
|
||||
const lotteryPoolLoading = ref(false)
|
||||
|
||||
function resolveDeptParams(): Record<string, unknown> {
|
||||
const extra = getChannelDeptRequestParams()
|
||||
if (extra.dept_id !== undefined) {
|
||||
return extra
|
||||
}
|
||||
if (channelScope) {
|
||||
return { dept_id: channelScope.selectedDeptId.value }
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
function lotteryPoolOptionLabel(item: { id: number; name: string }): string {
|
||||
const name = (item.name || '').trim()
|
||||
return name ? `${name} (#${item.id})` : `#${item.id}`
|
||||
}
|
||||
|
||||
async function loadLotteryPoolOptions() {
|
||||
lotteryPoolLoading.value = true
|
||||
try {
|
||||
const list = await lotteryPoolApi.getOptions(resolveDeptParams())
|
||||
lotteryPoolAllOptions.value = list
|
||||
lotteryPoolOptions.value = list
|
||||
} catch {
|
||||
lotteryPoolAllOptions.value = []
|
||||
lotteryPoolOptions.value = []
|
||||
} finally {
|
||||
lotteryPoolLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function filterLotteryPoolOptions(query: string) {
|
||||
const q = (query || '').trim().toLowerCase()
|
||||
if (!q) {
|
||||
lotteryPoolOptions.value = [...lotteryPoolAllOptions.value]
|
||||
return
|
||||
}
|
||||
lotteryPoolOptions.value = lotteryPoolAllOptions.value.filter((item) => {
|
||||
const name = (item.name || '').toLowerCase()
|
||||
return name.includes(q) || String(item.id).includes(q)
|
||||
})
|
||||
}
|
||||
|
||||
function onLotteryPoolDropdownVisible(visible: boolean) {
|
||||
if (visible && lotteryPoolAllOptions.value.length === 0) {
|
||||
void loadLotteryPoolOptions()
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadLotteryPoolOptions()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => channelScope?.selectedDeptId.value,
|
||||
() => {
|
||||
void loadLotteryPoolOptions()
|
||||
}
|
||||
)
|
||||
|
||||
const searchBarRef = ref()
|
||||
const formData = computed({
|
||||
|
||||
Reference in New Issue
Block a user