Compare commits
2 Commits
0d206f61de
...
528efc81f9
| Author | SHA1 | Date | |
|---|---|---|---|
| 528efc81f9 | |||
| d3334b11cf |
@@ -596,4 +596,16 @@ export default {
|
||||
regularTicket:'regular ticket',
|
||||
|
||||
},
|
||||
Assigned:{
|
||||
yes:'yes',
|
||||
no: 'no'
|
||||
},
|
||||
sortState:{
|
||||
asc: 'asc',
|
||||
desc: 'desc'
|
||||
},
|
||||
operational:{
|
||||
contact: 'contact',
|
||||
noContact: 'noContact',
|
||||
},
|
||||
}
|
||||
|
||||
@@ -592,7 +592,18 @@ export default {
|
||||
hostsInvitationType:{
|
||||
eliteTicket:'金票',
|
||||
regularTicket:'普票',
|
||||
|
||||
},
|
||||
Assigned:{
|
||||
yes:'是',
|
||||
no: '否'
|
||||
},
|
||||
sortState:{
|
||||
asc: '升序',
|
||||
desc: '降序'
|
||||
},
|
||||
operational:{
|
||||
contact: '转化',
|
||||
noContact: '未转化',
|
||||
},
|
||||
'OAuth 2.0': 'OAuth 2.0' // 避免菜单名是 OAuth 2.0 时,一直 warn 报错
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ export enum DICT_TYPE {
|
||||
INT_TRUE_FLASE = 'int_true_false',// 桥梁类型HOST_LEVEL
|
||||
HOST_LEVEL = 'host_level', // 桥梁类型country_group
|
||||
COUNTRY_GROUP = 'country_group', // 桥梁类型
|
||||
OPERATION_STATE = 'operational_state', // 桥梁类型operational_state
|
||||
OPERATION_STATE = 'operational_state', // 是否转化
|
||||
BIGBIOTHER_NEGOTIATION = 'bigBiother_negotiation', // 是否洽谈
|
||||
SORT_STATE = 'sort_state',// 升序降序
|
||||
SORT_TYPE = 'sort_type',// 排序类型
|
||||
|
||||
@@ -154,7 +154,9 @@
|
||||
<el-table-column label="该数据所属的账号id" align="center" prop="ownerId" />
|
||||
<el-table-column :label="t('newHosts.isAssigned')" align="center" prop="isAssigned">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INT_TRUE_FLASE" :value="scope.row.isAssigned" />
|
||||
<el-tag size="small" :type="scope.row.isAssigned == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.INT_TRUE_FLASE, scope.row.isAssigned) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
|
||||
@@ -204,7 +206,25 @@ import { BigBrotherApi, BigBrotherVO } from '@/api/server/bigbrother'
|
||||
import { getAllocation, getSimpleUserList } from '@/api/system/user'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import BigBrotherForm from './BigBrotherForm.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()
|
||||
/** 大哥数据 列表 */
|
||||
defineOptions({ name: 'BigBrother' })
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="操作状态" prop="operationStatus">
|
||||
<el-select v-model="formData.operationStatus" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.OPERATION_STATE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.OPERATION_STATE)" :key="dict.value"
|
||||
:label="$t(dict.label)" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<el-select v-model="queryParams.operationStatus" :placeholder="$t('employee.placeOperationStatus')"
|
||||
clearable class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.OPERATION_STATE)" :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('newHosts.sortName')" prop="sortName">
|
||||
@@ -197,7 +197,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="scope.row.operationStatus" />
|
||||
<el-tag size="small" :type="scope.row.operationStatus == 1 ? 'primary' : 'warning'">
|
||||
{{ dictLabelI18n(DICT_TYPE.OPERATION_STATE, scope.row.operationStatus) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
@@ -226,7 +228,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="scope.row.operationStatus" />
|
||||
<el-tag size="small" :type="scope.row.operationStatus == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.OPERATION_STATE, scope.row.operationStatus) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.remark')" align="center" prop="remake" />
|
||||
@@ -264,15 +268,17 @@
|
||||
:value="item.flag" />
|
||||
</div>
|
||||
<div class="card-row"><b>{{ $t('employee.operationStatus') }}:</b>
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="item.operationStatus" />
|
||||
<el-tag size="small" :type="item.operationStatus == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.OPERATION_STATE, item.operationStatus) || '-' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="card-row"><b>{{ $t('employee.createTime') }}:</b>{{ formatTimestamp(item.createTime) }}</div>
|
||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ formatTimestamp(item.updateTime) }}</div>
|
||||
<div class="card-row action-row">
|
||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||
}}</el-button>
|
||||
}}</el-button>
|
||||
<el-button link type="danger" @click="handleDelete(item.id)">{{ $t('employee.delete')
|
||||
}}</el-button>
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<el-select v-model="queryParams.operationStatus" :placeholder="$t('employee.placeOperationStatus')"
|
||||
clearable class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.OPERATION_STATE)" :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('newHosts.sortName')" prop="sortName">
|
||||
@@ -184,7 +184,9 @@
|
||||
|
||||
<el-table-column :label="$t('employee.operationStatus')" align="center" prop="operationStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="scope.row.operationStatus" />
|
||||
<el-tag size="small" :type="scope.row.operationStatus == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.OPERATION_STATE, scope.row.operationStatus) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('employee.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
@@ -221,13 +223,15 @@
|
||||
</div>
|
||||
|
||||
<div class="card-row"><b>{{ $t('employee.operationStatus') }}:</b>
|
||||
<dict-tag :type="DICT_TYPE.OPERATION_STATE" :value="item.operationStatus" />
|
||||
<el-tag size="small" :type="item.operationStatus == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.OPERATION_STATE, item.operationStatus) || '-' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="card-row"><b>{{ $t('employee.createTime') }}:</b>{{ formatTimestamp(item.createTime) }}</div>
|
||||
<div class="card-row"><b>{{ $t('employee.updateTime') }}:</b>{{ formatTimestamp(item.updateTime) }}</div>
|
||||
<div class="card-row action-row">
|
||||
<el-button link type="primary" @click="openForm('update', item.id, index)">{{ $t('employee.edit')
|
||||
}}</el-button>
|
||||
}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -96,8 +96,8 @@
|
||||
<el-form-item :label="t('newHosts.isAssigned')" prop="isAssigned">
|
||||
<el-select v-model="queryParams.isAssigned" :placeholder="t('newHosts.placeIsAssigned')" clearable
|
||||
class="!w-240px">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.INT_TRUE_FLASE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.INT_TRUE_FLASE)" :key="dict.value"
|
||||
:label="t(dict.label)" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('newHosts.createTime')" prop="createTime">
|
||||
@@ -179,7 +179,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('newHosts.hostsLevel')" sortable align="center" prop="hostsLevel" />
|
||||
|
||||
<el-table-column :label="t('newHosts.invitationType')" align="center" prop="invitationType" width="200">
|
||||
<el-table-column :label="t('newHosts.invitationType')" align="center" prop="invitationType">
|
||||
<template #default="scope">
|
||||
<el-tag size="small" :type="scope.row.invitationType == 1 ? 'primary' : 'warning'">
|
||||
{{ dictLabelI18n(DICT_TYPE.HOSTS_INVITATION_TYPE, scope.row.invitationType) || '-' }}
|
||||
@@ -203,9 +203,12 @@
|
||||
<el-table-column :label="t('newHosts.hostsKind')" align="center" prop="hostsKind" />
|
||||
<el-table-column :label="t('newHosts.isAssigned')" align="center" prop="isAssigned">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INT_TRUE_FLASE" :value="scope.row.isAssigned" />
|
||||
<el-tag size="small" :type="scope.row.isAssigned == 1 ? 'success' : 'info'">
|
||||
{{ dictLabelI18n(DICT_TYPE.INT_TRUE_FLASE, scope.row.isAssigned) || '-' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="t('newHosts.createTime')" align="center" prop="createTime" :formatter="dateFormatter"
|
||||
width="180px" />
|
||||
<!-- <el-table-column label="员工 Id" align="center" prop="userId" /> -->
|
||||
|
||||
Reference in New Issue
Block a user