Skip to content

Commit 0139443

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents ef31ec7 + 2ed13a2 commit 0139443

File tree

6 files changed

+48
-40
lines changed

6 files changed

+48
-40
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"vite-plugin-purge-icons": "^0.9.2",
126126
"vite-plugin-svg-icons": "^2.0.1",
127127
"vite-plugin-top-level-await": "^1.3.1",
128+
"vue-eslint-parser": "^9.3.1",
128129
"vue-tsc": "^1.8.8"
129130
},
130131
"license": "MIT",

src/api/mall/promotion/combination/combinationactivity.ts renamed to src/api/mall/promotion/combination/combinationActivity.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import request from '@/config/axios'
22
import { Sku, Spu } from '@/api/mall/product/spu'
33

4-
// TODO @puhui999: combinationActivity.ts
5-
64
export interface CombinationActivityVO {
75
id?: number
86
name?: string

src/store/modules/permission.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineStore } from 'pinia'
22
import { store } from '../index'
33
import { cloneDeep } from 'lodash-es'
44
import remainingRouter from '@/router/modules/remaining'
5-
import { generateRoute, flatMultiLevelRoutes } from '@/utils/routerHelper'
5+
import { flatMultiLevelRoutes, generateRoute } from '@/utils/routerHelper'
66
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
77

88
const { wsCache } = useCache()
@@ -34,11 +34,11 @@ export const usePermissionStore = defineStore('permission', {
3434
async generateRoutes(): Promise<unknown> {
3535
return new Promise<void>(async (resolve) => {
3636
// 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取
37-
let res: AppCustomRouteRecordRaw[]
37+
let res: AppCustomRouteRecordRaw[] = []
3838
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
3939
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
4040
}
41-
const routerMap: AppRouteRecordRaw[] = generateRoute(res as AppCustomRouteRecordRaw[])
41+
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
4242
// 动态路由,404一定要放到最后面
4343
this.addRouters = routerMap.concat([
4444
{

src/views/mall/promotion/combination/activity/CombinationActivityForm.vue renamed to src/views/mall/promotion/combination/CombinationActivityForm.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:is-col="true"
77
:rules="rules"
88
:schema="allSchemas.formSchema"
9+
class="mt-10px"
910
>
1011
<template #spuId>
1112
<el-button @click="spuSelectRef.open()">选择商品</el-button>
@@ -37,8 +38,8 @@
3738
<SpuSelect ref="spuSelectRef" :isSelectSku="true" @confirm="selectSpu" />
3839
</template>
3940
<script lang="ts" setup>
40-
import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationactivity'
41-
import { CombinationProductVO } from '@/api/mall/promotion/combination/combinationactivity'
41+
import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationActivity'
42+
import { CombinationProductVO } from '@/api/mall/promotion/combination/combinationActivity'
4243
import { allSchemas, rules } from './combinationActivity.data'
4344
import { SpuAndSkuList, SpuProperty, SpuSelect } from '@/views/mall/promotion/components'
4445
import { getPropertyList, RuleConfig } from '@/views/mall/product/spu/components'

src/views/mall/promotion/combination/activity/combinationActivity.data.ts renamed to src/views/mall/promotion/combination/combinationActivity.data.ts

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
2-
import { dateFormatter, getNowDateTime } from '@/utils/formatTime'
2+
import { dateFormatter2 } from '@/utils/formatTime'
33

44
// 表单校验
55
export const rules = reactive({
@@ -9,11 +9,6 @@ export const rules = reactive({
99
startTime: [required],
1010
endTime: [required],
1111
userSize: [required],
12-
totalNum: [required],
13-
successNum: [required],
14-
orderUserCount: [required],
15-
virtualGroup: [required],
16-
status: [required],
1712
limitDuration: [required]
1813
})
1914

@@ -31,34 +26,54 @@ const crudSchemas = reactive<CrudSchema[]>([
3126
}
3227
},
3328
{
34-
label: '活动时间',
35-
field: 'activityTime',
36-
formatter: dateFormatter,
29+
label: '活动开始时间',
30+
field: 'startTime',
31+
formatter: dateFormatter2,
32+
isSearch: true,
3733
search: {
38-
show: true,
3934
component: 'DatePicker',
4035
componentProps: {
41-
valueFormat: 'x',
42-
type: 'datetimerange',
43-
rangeSeparator: '至'
36+
valueFormat: 'YYYY-MM-DD',
37+
type: 'daterange'
4438
}
4539
},
4640
form: {
4741
component: 'DatePicker',
4842
componentProps: {
49-
valueFormat: 'x',
50-
type: 'datetimerange',
51-
rangeSeparator: '至'
52-
},
53-
value: [getNowDateTime().valueOf(), getNowDateTime().valueOf()],
54-
colProps: {
55-
span: 24
43+
type: 'date',
44+
valueFormat: 'x'
45+
}
46+
},
47+
table: {
48+
width: 120
49+
}
50+
},
51+
{
52+
label: '活动结束时间',
53+
field: 'endTime',
54+
formatter: dateFormatter2,
55+
isSearch: true,
56+
search: {
57+
component: 'DatePicker',
58+
componentProps: {
59+
valueFormat: 'YYYY-MM-DD',
60+
type: 'daterange'
5661
}
62+
},
63+
form: {
64+
component: 'DatePicker',
65+
componentProps: {
66+
type: 'date',
67+
valueFormat: 'x'
68+
}
69+
},
70+
table: {
71+
width: 120
5772
}
5873
},
5974
{
6075
label: '参与人数',
61-
field: 'orderUserCount',
76+
field: 'userSize',
6277
isSearch: false,
6378
form: {
6479
component: 'InputNumber',
@@ -117,13 +132,6 @@ const crudSchemas = reactive<CrudSchema[]>([
117132
isSearch: false,
118133
isForm: false
119134
},
120-
{
121-
label: '虚拟成团',
122-
field: 'virtualGroup',
123-
isSearch: false,
124-
isTable: false,
125-
isForm: false
126-
},
127135
{
128136
label: '活动状态',
129137
field: 'status',

src/views/mall/promotion/combination/activity/index.vue renamed to src/views/mall/promotion/combination/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</template>
6464
<script lang="ts" setup>
6565
import { allSchemas } from './combinationActivity.data'
66-
import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationactivity'
66+
import * as CombinationActivityApi from '@/api/mall/promotion/combination/combinationActivity'
6767
import CombinationActivityForm from './CombinationActivityForm.vue'
6868
import { cloneDeep } from 'lodash-es'
6969
import { createImageViewer } from '@/components/ImageViewer'
@@ -102,10 +102,10 @@ const handleDelete = (id: number) => {
102102
/** 初始化 **/
103103
onMounted(() => {
104104
/**
105-
TODO
106-
后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
107-
封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
108-
*/
105+
TODO
106+
后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
107+
封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
108+
*/
109109
// 处理一下表格列让商品往前
110110
const index = allSchemas.tableColumns.findIndex((item) => item.field === 'spuId')
111111
const column = cloneDeep(allSchemas.tableColumns[index])

0 commit comments

Comments
 (0)