diff --git a/src/api/member/group/index.ts b/src/api/member/group/index.ts new file mode 100644 index 00000000..df3054e2 --- /dev/null +++ b/src/api/member/group/index.ts @@ -0,0 +1,38 @@ +import request from '@/config/axios' + +export interface GroupVO { + id: number + name: string + remark: string + status: number +} + +// 查询用户分组列表 +export const getGroupPage = async (params: any) => { + return await request.get({ url: `/member/group/page`, params }) +} + +// 查询用户分组详情 +export const getGroup = async (id: number) => { + return await request.get({ url: `/member/group/get?id=` + id }) +} + +// 新增用户分组 +export const createGroup = async (data: GroupVO) => { + return await request.post({ url: `/member/group/create`, data }) +} + +// 查询用户分组 - 精简信息列表 +export const getSimpleGroupList = async () => { + return await request.get({ url: `/member/group/list-all-simple` }) +} + +// 修改用户分组 +export const updateGroup = async (data: GroupVO) => { + return await request.put({ url: `/member/group/update`, data }) +} + +// 删除用户分组 +export const deleteGroup = async (id: number) => { + return await request.delete({ url: `/member/group/delete?id=` + id }) +} diff --git a/src/api/member/level/index.ts b/src/api/member/level/index.ts new file mode 100644 index 00000000..a284fd2d --- /dev/null +++ b/src/api/member/level/index.ts @@ -0,0 +1,42 @@ +import request from '@/config/axios' + +export interface LevelVO { + id: number + name: string + experience: number + value: number + discount: number + icon: string + bgUrl: string + status: number +} + +// 查询会员等级列表 +export const getLevelPage = async (params) => { + return await request.get({ url: `/member/level/page`, params }) +} + +// 查询会员等级详情 +export const getLevel = async (id: number) => { + return await request.get({ url: `/member/level/get?id=` + id }) +} + +// 查询会员等级 - 精简信息列表 +export const getSimpleLevelList = async () => { + return await request.get({ url: `/member/level/list-all-simple` }) +} + +// 新增会员等级 +export const createLevel = async (data: LevelVO) => { + return await request.post({ url: `/member/level/create`, data }) +} + +// 修改会员等级 +export const updateLevel = async (data: LevelVO) => { + return await request.put({ url: `/member/level/update`, data }) +} + +// 删除会员等级 +export const deleteLevel = async (id: number) => { + return await request.delete({ url: `/member/level/delete?id=` + id }) +} diff --git a/src/api/member/tag/index.ts b/src/api/member/tag/index.ts index 04d0536c..7ff6e9bf 100644 --- a/src/api/member/tag/index.ts +++ b/src/api/member/tag/index.ts @@ -6,7 +6,7 @@ export interface TagVO { } // 查询会员标签列表 -export const getMemberTagPage = async (params) => { +export const getMemberTagPage = async (params: any) => { return await request.get({ url: `/member/tag/page`, params }) } @@ -15,6 +15,11 @@ export const getMemberTag = async (id: number) => { return await request.get({ url: `/member/tag/get?id=` + id }) } +// 查询会员标签 - 精简信息列表 +export const getSimpleTagList = async () => { + return await request.get({ url: `/member/tag/list-all-simple` }) +} + // 新增会员标签 export const createMemberTag = async (data: TagVO) => { return await request.post({ url: `/member/tag/create`, data }) diff --git a/src/views/member/group/GroupForm.vue b/src/views/member/group/GroupForm.vue new file mode 100644 index 00000000..9788dbef --- /dev/null +++ b/src/views/member/group/GroupForm.vue @@ -0,0 +1,112 @@ + + diff --git a/src/views/member/group/components/MemberGroupSelect.vue b/src/views/member/group/components/MemberGroupSelect.vue new file mode 100644 index 00000000..2b38fce1 --- /dev/null +++ b/src/views/member/group/components/MemberGroupSelect.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/member/group/index.vue b/src/views/member/group/index.vue new file mode 100644 index 00000000..552a72a6 --- /dev/null +++ b/src/views/member/group/index.vue @@ -0,0 +1,174 @@ + + + diff --git a/src/views/member/level/LevelForm.vue b/src/views/member/level/LevelForm.vue new file mode 100644 index 00000000..d02794be --- /dev/null +++ b/src/views/member/level/LevelForm.vue @@ -0,0 +1,175 @@ + + diff --git a/src/views/member/level/components/MemberLevelSelect.vue b/src/views/member/level/components/MemberLevelSelect.vue new file mode 100644 index 00000000..6a944600 --- /dev/null +++ b/src/views/member/level/components/MemberLevelSelect.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/member/level/index.vue b/src/views/member/level/index.vue new file mode 100644 index 00000000..be1c646c --- /dev/null +++ b/src/views/member/level/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/views/member/tag/components/MemberTagSelect.vue b/src/views/member/tag/components/MemberTagSelect.vue index ec4f4617..ebff61ea 100644 --- a/src/views/member/tag/components/MemberTagSelect.vue +++ b/src/views/member/tag/components/MemberTagSelect.vue @@ -52,8 +52,7 @@ const tagIds = computed({ const tags = ref([]) const getList = async () => { - const data = await TagApi.getMemberTagPage({}) - tags.value = data.list + tags.value = await TagApi.getSimpleTagList() } /** 添加用户标签表单弹框 */ diff --git a/src/views/member/user/UserForm.vue b/src/views/member/user/UserForm.vue index c10d3fea..0b7915a2 100644 --- a/src/views/member/user/UserForm.vue +++ b/src/views/member/user/UserForm.vue @@ -60,6 +60,25 @@ + + + + + + + + + + + + + + + @@ -76,6 +95,8 @@ import * as UserApi from '@/api/member/user' import * as AreaApi from '@/api/system/area' import { defaultProps } from '@/utils/tree' import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue' +import MemberLevelSelect from '@/views/member/level/components/MemberLevelSelect.vue' +import MemberGroupSelect from '@/views/member/group/components/MemberGroupSelect.vue' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -87,6 +108,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formData = ref({ id: undefined, mobile: undefined, + password: undefined, status: undefined, nickname: undefined, avatar: undefined, @@ -95,14 +117,19 @@ const formData = ref({ areaId: undefined, birthday: undefined, mark: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: undefined, + groupId: undefined }) const formRules = reactive({ mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], - status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] + status: [{ required: true, message: '状态不能为空', trigger: 'blur' }], + levelReason: [{ required: true, message: '修改原因不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref const areaList = ref([]) // 地区列表 +const originLevelId = ref() // 修改前的会员等级 /** 打开弹窗 */ const open = async (type: string, id?: number) => { @@ -115,6 +142,7 @@ const open = async (type: string, id?: number) => { formLoading.value = true try { formData.value = await UserApi.getUser(id) + originLevelId.value = formData.value.levelId } finally { formLoading.value = false } @@ -158,9 +186,6 @@ const resetForm = () => { mobile: undefined, password: undefined, status: undefined, - registerIp: undefined, - loginIp: undefined, - loginDate: undefined, nickname: undefined, avatar: undefined, name: undefined, @@ -168,8 +193,10 @@ const resetForm = () => { areaId: undefined, birthday: undefined, mark: undefined, - createTime: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: undefined, + groupId: undefined } formRef.value?.resetFields() } diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 0389de37..3a8e4259 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -51,6 +51,12 @@ + + + + + + 搜索 重置 @@ -69,9 +75,8 @@ - - - + + {