File tree Expand file tree Collapse file tree 4 files changed +43
-24
lines changed
api/mall/promotion/combination
views/mall/promotion/combination Expand file tree Collapse file tree 4 files changed +43
-24
lines changed Original file line number Diff line number Diff line change 1
1
import request from '@/config/axios'
2
2
import { Sku , Spu } from '@/api/mall/product/spu'
3
3
4
- // TODO @puhui 999: combinationActivity.ts
5
-
6
4
export interface CombinationActivityVO {
7
5
id ?: number
8
6
name ?: string
Original file line number Diff line number Diff line change 6
6
:is-col =" true"
7
7
:rules =" rules"
8
8
:schema =" allSchemas.formSchema"
9
+ class =" mt-10px"
9
10
>
10
11
<template #spuId >
11
12
<el-button @click =" spuSelectRef.open()" >选择商品</el-button >
37
38
<SpuSelect ref =" spuSelectRef" :isSelectSku =" true" @confirm =" selectSpu" />
38
39
</template >
39
40
<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 '
42
43
import { allSchemas , rules } from ' ./combinationActivity.data'
43
44
import { SpuAndSkuList , SpuProperty , SpuSelect } from ' @/views/mall/promotion/components'
44
45
import { getPropertyList , RuleConfig } from ' @/views/mall/product/spu/components'
Original file line number Diff line number Diff line change 1
1
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
2
- import { dateFormatter , getNowDateTime } from '@/utils/formatTime'
2
+ import { dateFormatter2 } from '@/utils/formatTime'
3
3
4
4
// 表单校验
5
5
export const rules = reactive ( {
@@ -26,29 +26,49 @@ const crudSchemas = reactive<CrudSchema[]>([
26
26
}
27
27
} ,
28
28
{
29
- label : '活动时间' ,
30
- field : 'activityTime' ,
31
- formatter : dateFormatter ,
29
+ label : '活动开始时间' ,
30
+ field : 'startTime' ,
31
+ formatter : dateFormatter2 ,
32
+ isSearch : true ,
32
33
search : {
33
- show : true ,
34
34
component : 'DatePicker' ,
35
35
componentProps : {
36
- valueFormat : 'x' ,
37
- type : 'datetimerange' ,
38
- rangeSeparator : '至'
36
+ valueFormat : 'YYYY-MM-DD' ,
37
+ type : 'daterange'
39
38
}
40
39
} ,
41
40
form : {
42
41
component : 'DatePicker' ,
43
42
componentProps : {
44
- valueFormat : 'x' ,
45
- type : 'datetimerange' ,
46
- rangeSeparator : '至'
47
- } ,
48
- value : [ getNowDateTime ( ) . valueOf ( ) , getNowDateTime ( ) . valueOf ( ) ] ,
49
- colProps : {
50
- 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'
51
61
}
62
+ } ,
63
+ form : {
64
+ component : 'DatePicker' ,
65
+ componentProps : {
66
+ type : 'date' ,
67
+ valueFormat : 'x'
68
+ }
69
+ } ,
70
+ table : {
71
+ width : 120
52
72
}
53
73
} ,
54
74
{
Original file line number Diff line number Diff line change 63
63
</template >
64
64
<script lang="ts" setup>
65
65
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 '
67
67
import CombinationActivityForm from ' ./CombinationActivityForm.vue'
68
68
import { cloneDeep } from ' lodash-es'
69
69
import { createImageViewer } from ' @/components/ImageViewer'
@@ -102,10 +102,10 @@ const handleDelete = (id: number) => {
102
102
/** 初始化 **/
103
103
onMounted (() => {
104
104
/**
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
+ */
109
109
// 处理一下表格列让商品往前
110
110
const index = allSchemas .tableColumns .findIndex ((item ) => item .field === ' spuId' )
111
111
const column = cloneDeep (allSchemas .tableColumns [index ])
You can’t perform that action at this time.
0 commit comments