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