diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue
index 051dc54..afc7fe7 100644
--- a/src/layouts/BasicLayout.vue
+++ b/src/layouts/BasicLayout.vue
@@ -106,6 +106,9 @@
日志查询
+
+ 系统配置
+
@@ -325,6 +328,11 @@ export default defineComponent({
key: 'system-logs',
title: '日志查询',
path: '/system/logs'
+ },
+ {
+ key: 'system-config',
+ title: '系统配置',
+ path: '/system/config'
}
]
},
diff --git a/src/router/index.js b/src/router/index.js
index 5e4e279..fed9c09 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -94,6 +94,11 @@ const routes = [
path: 'logs',
component: () => import('@/views/system/LogList.vue'),
meta: { title: '日志查询' }
+ },
+ {
+ path: 'config',
+ component: () => import('@/views/system/ConfigList.vue'),
+ meta: { title: '系统配置' }
}
]
},
diff --git a/src/views/coupon/ActivityList.vue b/src/views/coupon/ActivityList.vue
index 1268a12..58581e8 100644
--- a/src/views/coupon/ActivityList.vue
+++ b/src/views/coupon/ActivityList.vue
@@ -144,6 +144,19 @@
+
+
+
+
{
+ return text || '不限'
+ }
+ },
{
title: '已领取次数',
dataIndex: 'receive_count',
@@ -352,6 +375,7 @@ export default defineComponent({
end_time: null,
daily_start_time: null,
daily_end_time: null,
+ total_limit: undefined,
daily_limit: 1,
coupon_config: {},
is_active: true
@@ -400,6 +424,7 @@ export default defineComponent({
end_time: null,
daily_start_time: null,
daily_end_time: null,
+ total_limit: undefined,
daily_limit: 1,
coupon_config: {},
is_active: true
@@ -417,6 +442,14 @@ export default defineComponent({
// 获取优惠券模板列表
await fetchCouponTemplates()
+ // 过滤掉数量为0的优惠券配置
+ const couponConfig = {}
+ Object.entries(record.coupon_config || {}).forEach(([key, value]) => {
+ if (value && value > 0) {
+ couponConfig[key] = value
+ }
+ })
+
// 设置表单数据
formState.value = {
name: record.name,
@@ -425,8 +458,9 @@ export default defineComponent({
end_time: dayjs(record.end_time),
daily_start_time: dayjs(record.daily_start_time, 'HH:mm:ss'),
daily_end_time: dayjs(record.daily_end_time, 'HH:mm:ss'),
+ total_limit: record.total_limit,
daily_limit: record.daily_limit,
- coupon_config: record.coupon_config || {},
+ coupon_config: couponConfig,
is_active: record.is_active
}
@@ -442,8 +476,17 @@ export default defineComponent({
formRef.value.validate().then(async () => {
try {
submitting.value = true
+ // 处理优惠券配置,过滤掉未设置数量的优惠券
+ const couponConfig = {}
+ Object.entries(formState.value.coupon_config).forEach(([key, value]) => {
+ if (value && value > 0) {
+ couponConfig[key] = value
+ }
+ })
+
const params = {
...formState.value,
+ coupon_config: couponConfig,
start_time: dayjs(formState.value.start_time).format('YYYY-MM-DD HH:mm:ss'),
end_time: dayjs(formState.value.end_time).format('YYYY-MM-DD HH:mm:ss'),
daily_start_time: dayjs(formState.value.daily_start_time).format('HH:mm:ss'),
diff --git a/src/views/system/ConfigList.vue b/src/views/system/ConfigList.vue
new file mode 100644
index 0000000..157e35f
--- /dev/null
+++ b/src/views/system/ConfigList.vue
@@ -0,0 +1,373 @@
+
+
+
+
+
+
+
+
+ {{ formatValue(record) }}
+
+
+ {{ formatDateTime(record.create_time) }}
+
+
+ {{ formatDateTime(record.update_time) }}
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file