优化样式
This commit is contained in:
@@ -22,6 +22,7 @@ import { defaultOptButtons } from '/@/components/table'
|
||||
import TableHeader from '/@/components/table/header/index.vue'
|
||||
import Table from '/@/components/table/index.vue'
|
||||
import baTableClass from '/@/utils/baTable'
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
defineOptions({
|
||||
name: 'channel',
|
||||
@@ -29,7 +30,29 @@ defineOptions({
|
||||
|
||||
const { t } = useI18n()
|
||||
const tableRef = useTemplateRef('tableRef')
|
||||
const optButtons: OptButton[] = defaultOptButtons(['edit', 'delete'])
|
||||
let optButtons: OptButton[] = [
|
||||
{
|
||||
render: 'confirmButton',
|
||||
name: 'manualSettle',
|
||||
title: 'channel.manual_settle',
|
||||
text: '',
|
||||
type: 'warning',
|
||||
icon: 'el-icon-Clock',
|
||||
class: 'table-row-manual-settle',
|
||||
popconfirm: {
|
||||
confirmButtonText: t('channel.manual_settle'),
|
||||
cancelButtonText: t('Cancel'),
|
||||
confirmButtonType: 'warning',
|
||||
title: t('channel.manual_settle_confirm'),
|
||||
},
|
||||
disabledTip: false,
|
||||
click: async (row: TableRow) => {
|
||||
await createAxios({ url: '/admin/channel/manualSettle', method: 'post', data: { id: row.id } }, { showSuccessMessage: true })
|
||||
baTable.onTableHeaderAction('refresh', { event: 'manual-settle' })
|
||||
},
|
||||
},
|
||||
]
|
||||
optButtons = optButtons.concat(defaultOptButtons(['edit', 'delete']))
|
||||
const formatRatePercent = (_row: any, _column: any, cellValue: number | string | null) => {
|
||||
if (cellValue === null || cellValue === undefined || cellValue === '') return '-'
|
||||
const num = Number(cellValue)
|
||||
@@ -74,6 +97,10 @@ const baTable = new baTableClass(
|
||||
operator: 'eq',
|
||||
sortable: false,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
turnover: 'primary',
|
||||
affiliate: 'success',
|
||||
},
|
||||
replaceValue: {
|
||||
turnover: t('channel.agent_mode turnover'),
|
||||
affiliate: t('channel.agent_mode affiliate'),
|
||||
@@ -115,6 +142,80 @@ const baTable = new baTableClass(
|
||||
operator: 'RANGE',
|
||||
formatter: formatAmountInt,
|
||||
},
|
||||
{
|
||||
label: t('channel.affiliate_contract_no'),
|
||||
prop: 'affiliate_contract_no',
|
||||
align: 'center',
|
||||
minWidth: 140,
|
||||
sortable: false,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
showOverflowTooltip: true,
|
||||
},
|
||||
{
|
||||
label: t('channel.settle_cycle'),
|
||||
prop: 'settle_cycle',
|
||||
align: 'center',
|
||||
width: 110,
|
||||
operator: 'eq',
|
||||
sortable: false,
|
||||
render: 'tag',
|
||||
custom: { daily: 'info', weekly: 'primary', monthly: 'success' },
|
||||
replaceValue: {
|
||||
daily: t('channel.settle_cycle daily'),
|
||||
weekly: t('channel.settle_cycle weekly'),
|
||||
monthly: t('channel.settle_cycle monthly'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('channel.settle_weekday'),
|
||||
prop: 'settle_weekday',
|
||||
align: 'center',
|
||||
width: 110,
|
||||
operator: 'eq',
|
||||
sortable: false,
|
||||
render: 'tag',
|
||||
custom: { '1': 'info', '2': 'info', '3': 'info', '4': 'info', '5': 'info', '6': 'success', '7': 'success' },
|
||||
replaceValue: {
|
||||
'1': t('channel.weekday 1'),
|
||||
'2': t('channel.weekday 2'),
|
||||
'3': t('channel.weekday 3'),
|
||||
'4': t('channel.weekday 4'),
|
||||
'5': t('channel.weekday 5'),
|
||||
'6': t('channel.weekday 6'),
|
||||
'7': t('channel.weekday 7'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('channel.settle_time'),
|
||||
prop: 'settle_time',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
operator: 'LIKE',
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
label: t('channel.affiliate_effective_start_at'),
|
||||
prop: 'affiliate_effective_start_at',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
operator: 'RANGE',
|
||||
comSearchRender: 'datetime',
|
||||
sortable: 'custom',
|
||||
width: 160,
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
},
|
||||
{
|
||||
label: t('channel.affiliate_effective_end_at'),
|
||||
prop: 'affiliate_effective_end_at',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
operator: 'RANGE',
|
||||
comSearchRender: 'datetime',
|
||||
sortable: 'custom',
|
||||
width: 160,
|
||||
timeFormat: 'yyyy-mm-dd hh:MM:ss',
|
||||
},
|
||||
{
|
||||
label: t('channel.user_count'),
|
||||
prop: 'user_count',
|
||||
|
||||
Reference in New Issue
Block a user