update: 搜索组件替换
This commit is contained in:
parent
318a5cecaf
commit
0103cba6f7
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="notification-record-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="notification-subscription-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<j-pro-table
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="apply-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="data-source-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
|
@ -26,13 +26,16 @@
|
|||
<a-checkbox-group v-model:value="bulkList" :options="options" />
|
||||
</div>
|
||||
|
||||
<Search :columns="props.queryColumns" @search="query.search" />
|
||||
|
||||
<pro-search
|
||||
:columns="props.queryColumns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<j-pro-table
|
||||
ref="tableRef"
|
||||
:request="table.requestFun"
|
||||
:gridColumn="2"
|
||||
:params="query.params.value"
|
||||
:params="queryParams"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: table._selectedRowKeys.value,
|
||||
onChange: selectRow,
|
||||
|
@ -189,58 +192,8 @@ const options = computed(() =>
|
|||
const columns = props.queryColumns.filter(
|
||||
(item) => item.dataIndex !== 'action',
|
||||
);
|
||||
const query = {
|
||||
columns: [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'state',
|
||||
key: 'state',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'select',
|
||||
options: [
|
||||
{
|
||||
label: '在线',
|
||||
value: 'online',
|
||||
},
|
||||
{
|
||||
label: '离线',
|
||||
value: 'offline',
|
||||
},
|
||||
{
|
||||
label: '禁用',
|
||||
value: 'notActive',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
params: ref({}),
|
||||
search: (params: any) => {
|
||||
query.params.value = params;
|
||||
},
|
||||
};
|
||||
|
||||
const queryParams = ref({});
|
||||
const table: any = {
|
||||
_selectedRowKeys: ref<string[]>([]), // 选中项的id
|
||||
backRowKeys: [] as string[], // 旧选中项的id
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<div class="product-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
@search="(params:any) => (queryParams = params)"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<j-pro-table
|
||||
ref="tableRef"
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div class="product-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<j-pro-table
|
||||
|
|
|
@ -9,13 +9,17 @@
|
|||
@ok="confirm"
|
||||
@cancel="emits('update:visible', false)"
|
||||
>
|
||||
<Search :columns="query.columns" @search="query.search" />
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<div class="table">
|
||||
<j-pro-table
|
||||
ref="tableRef"
|
||||
:columns="table.columns"
|
||||
:columns="columns"
|
||||
:request="table.requestFun"
|
||||
:params="query.params"
|
||||
:params="queryParams"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: table._selectedRowKeys,
|
||||
onChange: table.onSelectChange,
|
||||
|
@ -57,47 +61,28 @@ const confirm = () => {
|
|||
}
|
||||
};
|
||||
|
||||
const query = {
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
const columns = [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
ellipsis: true,
|
||||
fixed: 'left',
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
],
|
||||
params: ref({}),
|
||||
search: (params: any) => {
|
||||
query.params.value = params;
|
||||
},
|
||||
};
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
];
|
||||
const queryParams = ref({});
|
||||
const table = reactive({
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
},
|
||||
],
|
||||
_selectedRowKeys: [] as string[],
|
||||
|
||||
requestFun: async (oParams: any) => {
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
<j-advanced-search :columns="columns" @search="(p:any)=>params = p" />
|
||||
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
<j-pro-table
|
||||
ref="tableRef"
|
||||
:columns="columns"
|
||||
:request="table.requestFun"
|
||||
:params="params"
|
||||
:params="queryParams"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: table._selectedRowKeys,
|
||||
onChange: table.onSelectChange,
|
||||
|
@ -137,7 +140,7 @@ const columns = [
|
|||
},
|
||||
];
|
||||
// 搜索参数
|
||||
const params = ref({});
|
||||
const queryParams = ref({});
|
||||
|
||||
// 表格
|
||||
const tableRef = ref<Record<string, any>>({}); // 表格实例
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="menu-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
@ -202,7 +203,7 @@ const table = reactive({
|
|||
},
|
||||
addChildren: (row: any) => {
|
||||
const sortIndex = row?.children?.length || 0;
|
||||
|
||||
|
||||
router.push(
|
||||
`/system/Menu/detail/:id?pid=${row.id}&basePath=${
|
||||
row.url || ''
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="permission-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
@search="(params:any) => (queryParams = params)"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
<j-pro-table
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="relationship-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div class="role-user-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
|
@ -6,10 +6,15 @@
|
|||
@ok="confirm"
|
||||
@cancel="emits('update:visible', false)"
|
||||
>
|
||||
<j-advanced-search
|
||||
<!-- <j-advanced-search
|
||||
:columns="columns"
|
||||
type="simple"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/> -->
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="simple"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
<j-pro-table
|
||||
|
@ -35,7 +40,7 @@ import { message } from 'ant-design-vue';
|
|||
const emits = defineEmits(['refresh', 'update:visible']);
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
roleId: string
|
||||
roleId: string;
|
||||
}>();
|
||||
|
||||
const columns = [
|
||||
|
@ -85,15 +90,13 @@ const confirm = () => {
|
|||
if (selectedRowKeys.value.length < 1) {
|
||||
message.error('请至少选择一项');
|
||||
} else {
|
||||
bindUser_api(props.roleId, selectedRowKeys.value).then(
|
||||
(resp) => {
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功');
|
||||
emits('refresh');
|
||||
emits('update:visible', false);
|
||||
}
|
||||
},
|
||||
);
|
||||
bindUser_api(props.roleId, selectedRowKeys.value).then((resp) => {
|
||||
if (resp.status === 200) {
|
||||
message.success('操作成功');
|
||||
emits('refresh');
|
||||
emits('update:visible', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="role-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
@search="(params:any)=>queryParams = params"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
<j-pro-table
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<div class="user-container">
|
||||
<j-advanced-search
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="category"
|
||||
@search="(params:any)=>queryParams = {...params}"
|
||||
/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue