1.移除管理员管理页面的分页
This commit is contained in:
@@ -9,19 +9,23 @@
|
||||
/>
|
||||
<el-alert class="ba-table-alert" v-if="baTable.table.remark" :title="baTable.table.remark" type="info" show-icon />
|
||||
|
||||
<!-- 表格顶部菜单 -->
|
||||
<TableHeader
|
||||
:buttons="['refresh', 'add', 'edit', 'delete', 'unfold', 'comSearch', 'quickSearch', 'columnDisplay']"
|
||||
:buttons="['refresh', 'add', 'edit', 'delete', 'unfold', 'quickSearch', 'columnDisplay']"
|
||||
:quick-search-placeholder="t('Quick search placeholder', { fields: t('auth.admin.username') + '/' + t('auth.admin.nickname') })"
|
||||
/>
|
||||
|
||||
<!-- 表格 -->
|
||||
<Table ref="tableRef" :pagination="false" />
|
||||
|
||||
<!-- 表单 -->
|
||||
<PopupForm />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, provide, useTemplateRef } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import baTableClass from '/@/utils/baTable'
|
||||
import PopupForm from './popupForm.vue'
|
||||
import Table from '/@/components/table/index.vue'
|
||||
@@ -29,7 +33,6 @@ import TableHeader from '/@/components/table/header/index.vue'
|
||||
import { defaultOptButtons } from '/@/components/table'
|
||||
import { baTableApi } from '/@/api/common'
|
||||
import { useAdminInfo } from '/@/stores/adminInfo'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
defineOptions({
|
||||
name: 'auth/admin',
|
||||
@@ -50,49 +53,30 @@ const baTable = new baTableClass(
|
||||
expandAll: true,
|
||||
dblClickNotEditColumn: [undefined, 'status'],
|
||||
column: [
|
||||
{ type: 'selection', align: 'center', operator: false },
|
||||
{ label: t('Id'), prop: 'id', align: 'center', show: false, operator: '=', operatorPlaceholder: t('Id'), width: 70 },
|
||||
{ type: 'selection', align: 'center' },
|
||||
{
|
||||
label: t('auth.admin.username'),
|
||||
prop: 'username',
|
||||
align: 'left',
|
||||
minWidth: 160,
|
||||
operator: 'LIKE',
|
||||
operatorPlaceholder: t('Fuzzy query'),
|
||||
minWidth: '180',
|
||||
},
|
||||
{ label: t('auth.admin.nickname'), prop: 'nickname', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
|
||||
{
|
||||
label: t('auth.admin.channel'),
|
||||
prop: 'channel_id',
|
||||
show: false,
|
||||
operator: 'eq',
|
||||
comSearchRender: 'remoteSelect',
|
||||
comSearchInputAttr: {
|
||||
remoteUrl: '/admin/channel/index',
|
||||
field: 'name',
|
||||
pk: 'id',
|
||||
},
|
||||
label: t('auth.admin.nickname'),
|
||||
prop: 'nickname',
|
||||
align: 'center',
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
label: t('auth.admin.channel'),
|
||||
prop: 'channel_name',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: false,
|
||||
},
|
||||
{
|
||||
label: t('auth.admin.parent_admin'),
|
||||
prop: 'parent_admin_username',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
operator: false,
|
||||
minWidth: '140',
|
||||
},
|
||||
{
|
||||
label: t('auth.admin.commission_share_rate'),
|
||||
prop: 'commission_share_rate',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
operator: false,
|
||||
width: '120',
|
||||
formatter: (_row, _col, val) => {
|
||||
if (val === null || val === undefined || val === '') return '-'
|
||||
return `${val}%`
|
||||
@@ -102,31 +86,26 @@ const baTable = new baTableClass(
|
||||
label: t('auth.admin.group'),
|
||||
prop: 'group_name_arr',
|
||||
align: 'center',
|
||||
minWidth: 140,
|
||||
operator: false,
|
||||
minWidth: '140',
|
||||
render: 'tags',
|
||||
},
|
||||
{ label: t('auth.admin.invite_code'), prop: 'invite_code', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query') },
|
||||
{ label: t('auth.admin.avatar'), prop: 'avatar', align: 'center', render: 'image', operator: false, show: false },
|
||||
{ label: t('auth.admin.email'), prop: 'email', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query'), show: false },
|
||||
{ label: t('auth.admin.mobile'), prop: 'mobile', align: 'center', operator: 'LIKE', operatorPlaceholder: t('Fuzzy query'), show: false },
|
||||
{ label: t('auth.admin.invite_code'), prop: 'invite_code', align: 'center', width: '120', show: false },
|
||||
{ label: t('auth.admin.avatar'), prop: 'avatar', align: 'center', render: 'image', show: false },
|
||||
{ label: t('auth.admin.email'), prop: 'email', align: 'center', show: false },
|
||||
{ label: t('auth.admin.mobile'), prop: 'mobile', align: 'center', show: false },
|
||||
{
|
||||
label: t('auth.admin.Last login'),
|
||||
prop: 'last_login_time',
|
||||
align: 'center',
|
||||
render: 'datetime',
|
||||
sortable: 'custom',
|
||||
operator: 'RANGE',
|
||||
width: 160,
|
||||
width: '160',
|
||||
show: false,
|
||||
},
|
||||
{ label: t('Create time'), prop: 'create_time', align: 'center', render: 'datetime', sortable: 'custom', operator: 'RANGE', width: 160 },
|
||||
{ label: t('Create time'), prop: 'create_time', align: 'center', width: '160', render: 'datetime' },
|
||||
{
|
||||
label: t('State'),
|
||||
prop: 'status',
|
||||
align: 'center',
|
||||
operator: 'eq',
|
||||
sortable: false,
|
||||
render: 'switch',
|
||||
replaceValue: { disable: t('Disable'), enable: t('Enable') },
|
||||
customRenderAttr: {
|
||||
@@ -139,14 +118,12 @@ const baTable = new baTableClass(
|
||||
{
|
||||
label: t('Operate'),
|
||||
align: 'center',
|
||||
width: 100,
|
||||
width: '100',
|
||||
render: 'buttons',
|
||||
buttons: optButtons,
|
||||
operator: false,
|
||||
fixed: 'right',
|
||||
},
|
||||
],
|
||||
dblClickNotEditColumn: [undefined, 'status'],
|
||||
},
|
||||
{
|
||||
defaultItems: {
|
||||
@@ -157,6 +134,12 @@ const baTable = new baTableClass(
|
||||
}
|
||||
)
|
||||
|
||||
baTable.before.getData = () => {
|
||||
if (baTable.table.filter?.quickSearch) {
|
||||
baTable.table.expandAll = true
|
||||
}
|
||||
}
|
||||
|
||||
baTable.before.onSubmit = ({ operate, items }) => {
|
||||
if (operate === 'edit' && items.id == adminInfo.id) {
|
||||
delete items.group_arr
|
||||
|
||||
Reference in New Issue
Block a user