优化游戏渠道信息展示-只显示下级

This commit is contained in:
2026-04-02 11:36:01 +08:00
parent 81dc7de560
commit 9c03b92e4c
2 changed files with 31 additions and 8 deletions

View File

@@ -61,6 +61,7 @@
:placeholder="t('Please input field', { field: t('game.channel.remark') })"
/>
<FormItem
v-if="isSuperAdmin"
:label="t('game.channel.admin_id')"
type="remoteSelect"
v-model="baTable.form.items!.admin_id"
@@ -84,28 +85,34 @@
<script setup lang="ts">
import type { FormItemRule } from 'element-plus'
import { inject, reactive, useTemplateRef } from 'vue'
import { computed, inject, useTemplateRef } from 'vue'
import { useI18n } from 'vue-i18n'
import FormItem from '/@/components/formItem/index.vue'
import { useConfig } from '/@/stores/config'
import { useAdminInfo } from '/@/stores/adminInfo'
import type baTableClass from '/@/utils/baTable'
import { buildValidatorData } from '/@/utils/validate'
const config = useConfig()
const formRef = useTemplateRef('formRef')
const baTable = inject('baTable') as baTableClass
const adminInfo = useAdminInfo()
const { t } = useI18n()
const rules: Partial<Record<string, FormItemRule[]>> = reactive({
const isSuperAdmin = computed(() => adminInfo.super === true)
const rules = computed<Partial<Record<string, FormItemRule[]>>>(() => ({
code: [buildValidatorData({ name: 'required', title: t('game.channel.code') })],
name: [buildValidatorData({ name: 'required', title: t('game.channel.name') })],
user_count: [buildValidatorData({ name: 'integer', title: t('game.channel.user_count') })],
profit_amount: [buildValidatorData({ name: 'float', title: t('game.channel.profit_amount') })],
admin_id: [buildValidatorData({ name: 'required', title: t('game.channel.admin_id') })],
admin_id: isSuperAdmin.value
? [buildValidatorData({ name: 'required', title: t('game.channel.admin_id') })]
: [],
create_time: [buildValidatorData({ name: 'date', title: t('game.channel.create_time') })],
update_time: [buildValidatorData({ name: 'date', title: t('game.channel.update_time') })],
})
}))
</script>
<style scoped lang="scss"></style>