From 4251dc5d6167db0befecfacf2402511314eda6ec Mon Sep 17 00:00:00 2001 From: xiaqing Date: Wed, 28 Jun 2023 22:50:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=9A=E5=91=98=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=201.=E5=90=88=E5=B9=B6=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=8F=AAmember=20module=203.=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BC=9A=E5=91=98=E4=B8=AD/=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E3=80=81=E4=BC=9A=E5=91=98=E7=AD=BE=E5=88=B0?= =?UTF-8?q?/xxx=E5=B1=82=E7=BA=A7=E7=9B=AE=E5=BD=95=204.=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E7=9A=84=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/point/config/index.ts | 30 +-- src/utils/dict.ts | 4 +- src/views/member/point/config/index.vue | 88 ++++++++ .../{ => member}/point/record/RecordForm.vue | 4 +- src/views/{ => member}/point/record/index.vue | 79 +------ .../signin/config}/SignInConfigForm.vue | 0 .../signin/config}/index.vue | 0 .../signin/record}/SignInRecordForm.vue | 0 .../signin/record}/index.vue | 0 src/views/point/config/ConfigForm.vue | 122 ----------- src/views/point/config/index.vue | 202 ------------------ 11 files changed, 101 insertions(+), 428 deletions(-) create mode 100644 src/views/member/point/config/index.vue rename src/views/{ => member}/point/record/RecordForm.vue (97%) rename src/views/{ => member}/point/record/index.vue (70%) rename src/views/{point/signInConfig => member/signin/config}/SignInConfigForm.vue (100%) rename src/views/{point/signInConfig => member/signin/config}/index.vue (100%) rename src/views/{point/signInRecord => member/signin/record}/SignInRecordForm.vue (100%) rename src/views/{point/signInRecord => member/signin/record}/index.vue (100%) delete mode 100644 src/views/point/config/ConfigForm.vue delete mode 100644 src/views/point/config/index.vue diff --git a/src/api/point/config/index.ts b/src/api/point/config/index.ts index 1bf7b094..00adc3f1 100644 --- a/src/api/point/config/index.ts +++ b/src/api/point/config/index.ts @@ -8,32 +8,12 @@ export interface ConfigVO { tradeGivePoint: number } -// 查询积分设置列表 -export const getConfigPage = async (params) => { - return await request.get({ url: `/point/config/page`, params }) -} - // 查询积分设置详情 -export const getConfig = async (id: number) => { - return await request.get({ url: `/point/config/get?id=` + id }) +export const getConfig = async () => { + return await request.get({ url: `/point/config/get` }) } -// 新增积分设置 -export const createConfig = async (data: ConfigVO) => { - return await request.post({ url: `/point/config/create`, data }) -} - -// 修改积分设置 -export const updateConfig = async (data: ConfigVO) => { - return await request.put({ url: `/point/config/update`, data }) -} - -// 删除积分设置 -export const deleteConfig = async (id: number) => { - return await request.delete({ url: `/point/config/delete?id=` + id }) -} - -// 导出积分设置 Excel -export const exportConfig = async (params) => { - return await request.download({ url: `/point/config/export-excel`, params }) +// 新增修改积分设置 +export const saveConfig = async (data: ConfigVO) => { + return await request.put({ url: `/point/config/save`, data }) } diff --git a/src/utils/dict.ts b/src/utils/dict.ts index fda02848..92caf1c6 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -147,8 +147,8 @@ export enum DICT_TYPE { // ========== MALL - 会员模块 ========== // 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值; - POINT_BIZ_TYPE = 'point_biz_type', - POINT_STATUS = 'point_status', + MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', + MEMBER_POINT_STATUS = 'member_point_status', // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 diff --git a/src/views/member/point/config/index.vue b/src/views/member/point/config/index.vue new file mode 100644 index 00000000..c5f947ce --- /dev/null +++ b/src/views/member/point/config/index.vue @@ -0,0 +1,88 @@ + + diff --git a/src/views/point/record/RecordForm.vue b/src/views/member/point/record/RecordForm.vue similarity index 97% rename from src/views/point/record/RecordForm.vue rename to src/views/member/point/record/RecordForm.vue index bf162b96..7a69a733 100644 --- a/src/views/point/record/RecordForm.vue +++ b/src/views/member/point/record/RecordForm.vue @@ -13,7 +13,7 @@ 搜索 重置 - - 新增 - - - 导出 - @@ -94,7 +82,7 @@ @@ -135,26 +123,6 @@ prop="createDate" :formatter="dateFormatter" /> - - - import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' -import download from '@/utils/download' import * as RecordApi from '@/api/point/record' import RecordForm from './RecordForm.vue' defineOptions({ name: 'PointRecord' }) -const message = useMessage() // 消息弹窗 -const { t } = useI18n() // 国际化 - const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 @@ -195,7 +159,6 @@ const queryParams = reactive({ createDate: [] }) const queryFormRef = ref() // 搜索的表单 -const exportLoading = ref(false) // 导出的加载中 /** 查询列表 */ const getList = async () => { @@ -221,40 +184,6 @@ const resetQuery = () => { handleQuery() } -/** 添加/修改操作 */ -const formRef = ref() -const openForm = (type: string, id?: number) => { - formRef.value.open(type, id) -} - -/** 删除按钮操作 */ -const handleDelete = async (id: number) => { - try { - // 删除的二次确认 - await message.delConfirm() - // 发起删除 - await RecordApi.deleteRecord(id) - message.success(t('common.delSuccess')) - // 刷新列表 - await getList() - } catch {} -} - -/** 导出按钮操作 */ -const handleExport = async () => { - try { - // 导出的二次确认 - await message.exportConfirm() - // 发起导出 - exportLoading.value = true - const data = await RecordApi.exportRecord(queryParams) - download.excel(data, '用户积分记录.xls') - } catch { - } finally { - exportLoading.value = false - } -} - /** 初始化 **/ onMounted(() => { getList() diff --git a/src/views/point/signInConfig/SignInConfigForm.vue b/src/views/member/signin/config/SignInConfigForm.vue similarity index 100% rename from src/views/point/signInConfig/SignInConfigForm.vue rename to src/views/member/signin/config/SignInConfigForm.vue diff --git a/src/views/point/signInConfig/index.vue b/src/views/member/signin/config/index.vue similarity index 100% rename from src/views/point/signInConfig/index.vue rename to src/views/member/signin/config/index.vue diff --git a/src/views/point/signInRecord/SignInRecordForm.vue b/src/views/member/signin/record/SignInRecordForm.vue similarity index 100% rename from src/views/point/signInRecord/SignInRecordForm.vue rename to src/views/member/signin/record/SignInRecordForm.vue diff --git a/src/views/point/signInRecord/index.vue b/src/views/member/signin/record/index.vue similarity index 100% rename from src/views/point/signInRecord/index.vue rename to src/views/member/signin/record/index.vue diff --git a/src/views/point/config/ConfigForm.vue b/src/views/point/config/ConfigForm.vue deleted file mode 100644 index 088bd0af..00000000 --- a/src/views/point/config/ConfigForm.vue +++ /dev/null @@ -1,122 +0,0 @@ - - diff --git a/src/views/point/config/index.vue b/src/views/point/config/index.vue deleted file mode 100644 index ec3d587f..00000000 --- a/src/views/point/config/index.vue +++ /dev/null @@ -1,202 +0,0 @@ - - - From b1ce2672e418cc9a970992787d5ba405c92d5070 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 21:46:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?review=20=E7=A7=92=E6=9D=80=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/product/spu/components/index.ts | 5 ++++- src/views/mall/product/spu/index.vue | 2 ++ src/views/mall/promotion/components/SpuSelect.vue | 1 - src/views/mall/promotion/components/index.ts | 1 + src/views/mall/promotion/seckill/activity/index.vue | 3 +++ .../mall/promotion/seckill/activity/seckillActivity.data.ts | 2 +- 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/mall/product/spu/components/index.ts b/src/views/mall/product/spu/components/index.ts index 59c031e8..ca61ff6b 100644 --- a/src/views/mall/product/spu/components/index.ts +++ b/src/views/mall/product/spu/components/index.ts @@ -7,6 +7,7 @@ import SkuList from './SkuList.vue' import { Spu } from '@/api/mall/product/spu' +// TODO @puhui999:Properties 改成 Property 更合适? interface Properties { id: number name: string @@ -30,8 +31,10 @@ interface RuleConfig { } /** - * 商品通用函数 + * 获得商品的规格列表 + * * @param spu + * @return Property 规格列表 */ const getPropertyList = (spu: Spu): Properties[] => { // 直接拿返回的 skus 属性逆向生成出 propertyList diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index 7dfd484b..75bd02e0 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -437,6 +437,7 @@ const categoryList = ref() // 分类树 const categoryString = (categoryId) => { return treeToString(categoryList.value, categoryId) } + /** * 校验所选是否为二级及以下节点 */ @@ -446,6 +447,7 @@ const nodeClick = () => { message.warning('必须选择二级及以下节点!!') } } + /** 初始化 **/ onMounted(async () => { await getTabsCount() diff --git a/src/views/mall/promotion/components/SpuSelect.vue b/src/views/mall/promotion/components/SpuSelect.vue index 0d535dfd..94c60c9c 100644 --- a/src/views/mall/promotion/components/SpuSelect.vue +++ b/src/views/mall/promotion/components/SpuSelect.vue @@ -256,7 +256,6 @@ const imagePreview = (imgUrl: string) => { const categoryList = ref() // 分类树 -// TODO @puhui999:商品搜索的时候,可以通过一级搜二级;所以这个校验可以去掉哈;也就是说,只允许挂在二级,但是一级可搜索到 /** 初始化 **/ onMounted(async () => { await getList() diff --git a/src/views/mall/promotion/components/index.ts b/src/views/mall/promotion/components/index.ts index f3f09950..a4b4e75b 100644 --- a/src/views/mall/promotion/components/index.ts +++ b/src/views/mall/promotion/components/index.ts @@ -7,6 +7,7 @@ type SpuProperty = { spuDetail: T propertyList: Properties[] } + /** * 提供商品活动商品选择通用组件 */ diff --git a/src/views/mall/promotion/seckill/activity/index.vue b/src/views/mall/promotion/seckill/activity/index.vue index d7d69dfb..f06b855f 100644 --- a/src/views/mall/promotion/seckill/activity/index.vue +++ b/src/views/mall/promotion/seckill/activity/index.vue @@ -89,6 +89,8 @@ const openForm = (type: string, id?: number) => { const handleDelete = (id: number) => { tableMethods.delList(id, false) } + +// TODO @puhui:是不是直接叫 configList 就好啦 const seckillConfigAllSimple = ref([]) // 时段配置精简列表 const convertSeckillConfigNames = computed( () => (row) => @@ -96,6 +98,7 @@ const convertSeckillConfigNames = computed( ?.filter((item) => row.configIds.includes(item.id)) ?.map((config) => config.name) ) + const expandChange = (row, expandedRows) => { // TODO puhui:等 CRUD 完事后弄 console.log(row, expandedRows) diff --git a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts index fcf48985..c858374c 100644 --- a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts +++ b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts @@ -219,7 +219,7 @@ const crudSchemas = reactive([ }, { label: '状态', - field: 'status', // TODO @puhui999:状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了 + field: 'status', dictType: DICT_TYPE.COMMON_STATUS, dictClass: 'number', isForm: false, From 4571f893ed93d3a012635a22137ecaff0ae34949 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 23:18:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?review=20=E7=A7=AF=E5=88=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 5 ++- src/views/member/point/config/index.vue | 9 +++-- src/views/member/point/record/RecordForm.vue | 1 + src/views/member/point/record/index.vue | 36 +++++++++++--------- src/views/member/signin/config/index.vue | 15 ++++---- src/views/member/signin/record/index.vue | 21 ++---------- 6 files changed, 38 insertions(+), 49 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 92caf1c6..67a92ba6 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -146,9 +146,8 @@ export enum DICT_TYPE { MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 // ========== MALL - 会员模块 ========== - // 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值; - MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', - MEMBER_POINT_STATUS = 'member_point_status', + MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型 + MEMBER_POINT_STATUS = 'member_point_status', // 积分的状态 // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 diff --git a/src/views/member/point/config/index.vue b/src/views/member/point/config/index.vue index c5f947ce..0fd1484f 100644 --- a/src/views/member/point/config/index.vue +++ b/src/views/member/point/config/index.vue @@ -10,9 +10,11 @@ + + - + @@ -58,6 +60,7 @@ const formData = ref({ const formRules = reactive({}) const formRef = ref() // 表单 Ref +/** 修改积分配置 */ const onSubmit = async () => { // 校验表单 if (!formRef) return @@ -75,6 +78,7 @@ const onSubmit = async () => { } } +/** 获得积分配置 */ const getConfig = async () => { try { const data = await ConfigApi.getConfig() @@ -82,6 +86,7 @@ const getConfig = async () => { } finally { } } + onMounted(() => { getConfig() }) diff --git a/src/views/member/point/record/RecordForm.vue b/src/views/member/point/record/RecordForm.vue index 7a69a733..a75eb9a5 100644 --- a/src/views/member/point/record/RecordForm.vue +++ b/src/views/member/point/record/RecordForm.vue @@ -157,6 +157,7 @@ const submitForm = async () => { } } +// TODO @xiaqing:不需要更新操作哇? /** 重置表单 */ const resetForm = () => { formData.value = { diff --git a/src/views/member/point/record/index.vue b/src/views/member/point/record/index.vue index 082c64cb..517410f7 100644 --- a/src/views/member/point/record/index.vue +++ b/src/views/member/point/record/index.vue @@ -57,7 +57,7 @@ /> - + - - - - - + + + + + + + - - + + + + - - + + 导出 @@ -44,15 +46,10 @@ - + - - + +