国际化国家+金票普票国际化
This commit is contained in:
@@ -87,8 +87,9 @@
|
||||
<el-select v-model="queryParams.invitationType" :placeholder="$t('employee.placeInvitationType')" clearable
|
||||
class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HOSTS_INVITATION_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
:label="$t(dict.label)" :value="dict.value" />
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('employee.operationStatus')" prop="operationStatus">
|
||||
<el-select v-model="queryParams.operationStatus" :placeholder="$t('employee.placeOperationStatus')"
|
||||
@@ -166,11 +167,14 @@
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.hostsLevel')" align="center" prop="hostsLevel" />
|
||||
<el-table-column :label="$t('employee.invitationType')" align="center" prop="invitationType">
|
||||
<el-table-column :label="t('newHosts.invitationType')" align="center" prop="invitationType" width="200">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HOSTS_INVITATION_TYPE" :value="scope.row.invitationType" />
|
||||
<el-tag size="small" :type="scope.row.invitationType == 1 ? 'warning' : 'primary'">
|
||||
{{ dictLabelI18n(DICT_TYPE.HOSTS_INVITATION_TYPE, scope.row.invitationType) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="uid" align="center" prop="uid" />
|
||||
|
||||
<el-table-column :label="$t('employee.hostsCoins')" align="center" prop="hostsCoins" />
|
||||
@@ -179,7 +183,11 @@
|
||||
<el-table-column :label="$t('employee.fans')" align="center" prop="fans" />
|
||||
<el-table-column :label="$t('employee.fllowernum')" align="center" prop="fllowernum" />
|
||||
<el-table-column :label="$t('employee.yesterdayCoins')" align="center" prop="yesterdayCoins" />
|
||||
<el-table-column :label="$t('employee.hostsCountry')" align="center" prop="country" />
|
||||
<el-table-column :label="$t('employee.hostsCountry')" align="center" prop="country">
|
||||
<template #default="scope">
|
||||
{{ t('newHosts.min') == '最小值' ? scope.row.country : scope.row.countryEng }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.hostsKind')" align="center" prop="hostsKind" />
|
||||
<el-table-column :label="$t('employee.remark')" align="center" prop="remake" />
|
||||
<el-table-column :label="$t('employee.flag')" align="center" prop="flag">
|
||||
@@ -292,6 +300,29 @@ import { getAllocation, getCountry } from '@/api/system/user'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { func } from 'vue-types'
|
||||
import MobilePagination from '@/components/MobilePagination.vue'
|
||||
import { useDictStore } from '@/store/modules/dict' // 如果你项目里有字典 store
|
||||
const dictStore = useDictStore?.() // 有就用;没有的话把 dictStore 相关行删掉
|
||||
|
||||
// 统一用字符串比较,自动识别并翻译 i18n key
|
||||
function dictLabelI18n(type: string, val: any) {
|
||||
const v = val == null ? '' : String(val)
|
||||
|
||||
// 优先从 store 取;若没有,就从你现有的工具取(getIntDictOptions / getStrDictOptions)
|
||||
const opts =
|
||||
(dictStore?.getDictOptions?.(type) as any[]) ||
|
||||
getIntDictOptions(type) ||
|
||||
getStrDictOptions(type) ||
|
||||
[]
|
||||
|
||||
const hit = opts.find(o => String(o.value) === v)
|
||||
const label = hit?.label ?? ''
|
||||
// 形如 a.b 或包含点号的,大概率是 i18n key,则用 t() 翻
|
||||
return label && label.includes('.') ? t(label) : label
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user