优化小程序菜单管理功能

This commit is contained in:
gxwebsoft
2024-06-01 02:45:33 +08:00
parent 4bae8599e1
commit e3fb9ba283
36 changed files with 2161 additions and 430 deletions
@@ -1,19 +1,21 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-input-search
allow-clear
placeholder="请输入关键词"
v-model:value="where.keywords"
@pressEnter="search"
@search="search"
/>
<a-button @click="reset">重置</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { UserParam } from '@/api/system/user/model';
const props = withDefaults(
defineProps<{
@@ -24,7 +26,7 @@
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'search', where?: UserParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
@@ -35,6 +37,25 @@
emit('add');
};
// 表单数据
const { where, resetFields } = useSearch<UserParam>({
userId: undefined,
username: undefined,
phone: undefined,
realName: undefined,
keywords: undefined
});
const search = () => {
emit('search', where);
};
/* 重置 */
const reset = () => {
resetFields();
search();
};
watch(
() => props.selection,
() => {}
+17 -25
View File
@@ -7,7 +7,6 @@
row-key="integralId"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
@@ -101,47 +100,40 @@
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: '',
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
},
{
title: '用户id',
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
align: 'center',
width: 90
},
{
title: '微信昵称',
dataIndex: 'username',
key: 'username',
align: 'center',
align: 'center'
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
dataIndex: 'mobile',
key: 'mobile',
align: 'center'
},
{
title: '获得积分',
dataIndex: 'integral',
key: 'integral',
align: 'center',
align: 'center'
},
{
title: '日期',
dataIndex: 'dateTime',
key: 'dateTime',
align: 'center',
align: 'center'
},
{
title: '天',
dataIndex: 'day',
key: 'day',
align: 'center',
align: 'center'
},
{
title: '签到时间',
@@ -151,15 +143,15 @@
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */