重构小程序端管理模块

This commit is contained in:
2024-07-21 19:58:08 +08:00
parent 48ea6d0301
commit 23a25e1285
55 changed files with 3177 additions and 333 deletions

View File

@@ -0,0 +1,73 @@
<!-- 搜索表单 -->
<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>
<SelectDict
dict-code="mpGroup"
:placeholder="`选择分组`"
v-model:value="where.groupName"
@done="chooseGroupId"
/>
<a-button @click="reset">重置</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import useSearch from '@/utils/use-search';
import { MpMenu, MpMenuParam } from '@/api/cms/mp-menu/model';
import { DictData } from '@/api/system/dict-data/model';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: MpMenuParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 表单数据
const { where } = useSearch<MpMenu>({
parentId: undefined,
groupName: ''
});
const handleSearch = () => {
emit('search', where);
};
/* 重置 */
const reset = () => {
where.parentId = undefined;
handleSearch();
};
// 新增
const add = () => {
emit('add');
};
const chooseGroupId = (item: DictData) => {
where.parentId = item.dictDataId;
where.groupName = item.dictDataName;
handleSearch();
};
watch(
() => props.selection,
() => {}
);
</script>