up.
This commit is contained in:
parent
0a5c6edb3f
commit
d7285e8f5f
@ -8,6 +8,7 @@ use app\model\SysDictionary;
|
||||
use app\controller\admin\{auth,
|
||||
GlobalController,
|
||||
xm\ChannelController,
|
||||
xm\InstitutionController,
|
||||
xm\MemberController,
|
||||
system\CacheController,
|
||||
system\CacheDataController,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ele-page>
|
||||
<!-- 搜索表单 -->
|
||||
<member-search @search="reload" />
|
||||
<institution-search @search="reload" />
|
||||
<ele-card :body-style="{ paddingTop: '8px' }">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
@ -27,7 +27,7 @@
|
||||
</ele-pro-table>
|
||||
</ele-card>
|
||||
<!-- 编辑弹窗 -->
|
||||
<member-edit v-model="showEdit" :data="current" @done="reload" />
|
||||
<institution-edit v-model="showEdit" :data="current" @done="reload" />
|
||||
</ele-page>
|
||||
</template>
|
||||
|
||||
@ -40,11 +40,14 @@
|
||||
DatasourceFunction,
|
||||
Columns
|
||||
} from 'ele-admin-plus/es/ele-pro-table/types';
|
||||
import MemberSearch from './components/member-search.vue';
|
||||
import MemberEdit from './components/member-edit.vue';
|
||||
import InstitutionSearch from './components/institution-search.vue';
|
||||
import InstitutionEdit from './components/institution-edit.vue';
|
||||
import { removeRoles } from '@/api/system/role';
|
||||
import type { Channel, ChannelParam } from '@/api/xm/channel/model';
|
||||
import { pageChannels } from '@/api/xm/channel';
|
||||
import type {
|
||||
Institution,
|
||||
InstitutionParam
|
||||
} from '@/api/xm/institution/model';
|
||||
import { pageInstitutions } from '@/api/xm/institution';
|
||||
|
||||
defineOptions({ name: 'SystemRole' });
|
||||
|
||||
@ -67,7 +70,7 @@
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'channelId',
|
||||
prop: 'InstitutionId',
|
||||
label: '渠道ID',
|
||||
width: 80
|
||||
},
|
||||
@ -100,33 +103,33 @@
|
||||
]);
|
||||
|
||||
/** 表格选中数据 */
|
||||
const selections = ref<Channel[]>([]);
|
||||
const selections = ref<Institution[]>([]);
|
||||
|
||||
/** 当前编辑数据 */
|
||||
const current = ref<Channel | null>(null);
|
||||
const current = ref<Institution | null>(null);
|
||||
|
||||
/** 是否显示编辑弹窗 */
|
||||
const showEdit = ref(false);
|
||||
|
||||
/** 表格数据源 */
|
||||
const datasource: DatasourceFunction = ({ pages, where, orders }) => {
|
||||
return pageChannels({ ...where, ...orders, ...pages });
|
||||
return pageInstitutions({ ...where, ...orders, ...pages });
|
||||
};
|
||||
|
||||
/** 搜索 */
|
||||
const reload = (where?: ChannelParam) => {
|
||||
const reload = (where?: InstitutionParam) => {
|
||||
selections.value = [];
|
||||
tableRef.value?.reload?.({ page: 1, where });
|
||||
};
|
||||
|
||||
/** 打开编辑弹窗 */
|
||||
const openEdit = (row?: Channel) => {
|
||||
const openEdit = (row?: Institution) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/** 删除单个 */
|
||||
const remove = (row?: Channel) => {
|
||||
const remove = (row?: Institution) => {
|
||||
const rows = row == null ? selections.value : [row];
|
||||
if (!rows.length) {
|
||||
EleMessage.error({ message: '请至少选择一条数据', plain: true });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user