From f1735a4010ee1e873c4b07c1e0d222e4180fa27c Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 20 Aug 2023 15:54:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BC=9A=E5=91=98=E7=AD=89=E7=BA=A7=E5=A2=9E=E5=88=A0?= =?UTF-8?q?=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/level/index.ts | 37 ++++++ src/views/member/level/LevelForm.vue | 175 ++++++++++++++++++++++++++ src/views/member/level/index.vue | 182 +++++++++++++++++++++++++++ 3 files changed, 394 insertions(+) create mode 100644 src/api/member/level/index.ts create mode 100644 src/views/member/level/LevelForm.vue create mode 100644 src/views/member/level/index.vue diff --git a/src/api/member/level/index.ts b/src/api/member/level/index.ts new file mode 100644 index 00000000..8a069089 --- /dev/null +++ b/src/api/member/level/index.ts @@ -0,0 +1,37 @@ +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 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/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/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 @@ + + + From 7bef2409262a4075b51b5dbc14d275b5cc3f0a0e Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 21 Aug 2023 21:31:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=B0=83=E6=95=B4=E4=BC=9A=E5=91=98=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/level/index.ts | 5 ++ .../level/components/MemberLevelSelect.vue | 46 +++++++++++++++++++ src/views/member/user/UserForm.vue | 35 +++++++++++--- src/views/member/user/index.vue | 13 +++--- 4 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 src/views/member/level/components/MemberLevelSelect.vue diff --git a/src/api/member/level/index.ts b/src/api/member/level/index.ts index 8a069089..a284fd2d 100644 --- a/src/api/member/level/index.ts +++ b/src/api/member/level/index.ts @@ -21,6 +21,11 @@ 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 }) diff --git a/src/views/member/level/components/MemberLevelSelect.vue b/src/views/member/level/components/MemberLevelSelect.vue new file mode 100644 index 00000000..73e11f1b --- /dev/null +++ b/src/views/member/level/components/MemberLevelSelect.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/member/user/UserForm.vue b/src/views/member/user/UserForm.vue index c10d3fea..2a86c63e 100644 --- a/src/views/member/user/UserForm.vue +++ b/src/views/member/user/UserForm.vue @@ -60,6 +60,22 @@ + + + + + + + + + + + + @@ -76,6 +92,7 @@ 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' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -87,6 +104,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formData = ref({ id: undefined, mobile: undefined, + password: undefined, status: undefined, nickname: undefined, avatar: undefined, @@ -95,14 +113,18 @@ const formData = ref({ areaId: undefined, birthday: undefined, mark: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: 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 +137,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 +181,6 @@ const resetForm = () => { mobile: undefined, password: undefined, status: undefined, - registerIp: undefined, - loginIp: undefined, - loginDate: undefined, nickname: undefined, avatar: undefined, name: undefined, @@ -168,8 +188,9 @@ const resetForm = () => { areaId: undefined, birthday: undefined, mark: undefined, - createTime: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: undefined } formRef.value?.resetFields() } diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 0389de37..673fd63d 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -51,6 +51,9 @@ + + + 搜索 重置 @@ -69,8 +72,8 @@ + - { From 884bb055b054408a019c9c1ef7992e3d2c446390 Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 21 Aug 2023 21:44:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86=E4=BD=BF=E7=94=A8=E7=9A=84=20=E7=B2=BE=E7=AE=80?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/tag/index.ts | 7 ++++++- src/views/member/tag/components/MemberTagSelect.vue | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) 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/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() } /** 添加用户标签表单弹框 */ From 78917cd2be0d34dbbf4baab040f0cb83cec910ee Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 21 Aug 2023 23:59:49 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=94=A8=E6=88=B7=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/group/index.ts | 38 ++++ src/views/member/group/GroupForm.vue | 112 +++++++++++ .../group/components/MemberGroupSelect.vue | 46 +++++ src/views/member/group/index.vue | 174 ++++++++++++++++++ .../level/components/MemberLevelSelect.vue | 2 +- src/views/member/user/UserForm.vue | 10 +- src/views/member/user/index.vue | 10 +- 7 files changed, 386 insertions(+), 6 deletions(-) create mode 100644 src/api/member/group/index.ts create mode 100644 src/views/member/group/GroupForm.vue create mode 100644 src/views/member/group/components/MemberGroupSelect.vue create mode 100644 src/views/member/group/index.vue 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/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/components/MemberLevelSelect.vue b/src/views/member/level/components/MemberLevelSelect.vue index 73e11f1b..c816a295 100644 --- a/src/views/member/level/components/MemberLevelSelect.vue +++ b/src/views/member/level/components/MemberLevelSelect.vue @@ -18,7 +18,7 @@ defineOptions({ name: 'MemberLevelSelect' }) const props = defineProps({ /** 下拉框选中值 **/ modelValue: { - type: Array, + type: Number, default: undefined } }) diff --git a/src/views/member/user/UserForm.vue b/src/views/member/user/UserForm.vue index 2a86c63e..0b7915a2 100644 --- a/src/views/member/user/UserForm.vue +++ b/src/views/member/user/UserForm.vue @@ -76,6 +76,9 @@ + + + @@ -93,6 +96,7 @@ 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() // 消息弹窗 @@ -115,7 +119,8 @@ const formData = ref({ mark: undefined, tagIds: [], levelId: undefined, - levelReason: undefined + levelReason: undefined, + groupId: undefined }) const formRules = reactive({ mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], @@ -190,7 +195,8 @@ const resetForm = () => { mark: undefined, tagIds: [], levelId: undefined, - levelReason: 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 673fd63d..3a8e4259 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -54,6 +54,9 @@ + + + 搜索 重置 @@ -73,8 +76,7 @@ - - + Date: Tue, 22 Aug 2023 01:48:52 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E4=B8=8B=E6=8B=89=E6=A1=86=E6=98=BE=E7=A4=BA=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/level/components/MemberLevelSelect.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/views/member/level/components/MemberLevelSelect.vue b/src/views/member/level/components/MemberLevelSelect.vue index c816a295..6a944600 100644 --- a/src/views/member/level/components/MemberLevelSelect.vue +++ b/src/views/member/level/components/MemberLevelSelect.vue @@ -1,11 +1,11 @@