File tree Expand file tree Collapse file tree 3 files changed +3
-14
lines changed
src/views/mall/promotion/bargain/activity Expand file tree Collapse file tree 3 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,6 @@ const getSpuDetails = async (
129
129
if (typeof products !== ' undefined' ) {
130
130
const product = products .find ((item ) => item .skuId === sku .id )
131
131
if (product ) {
132
- // 分转元
133
132
product .bargainFirstPrice = formatToFraction (product .bargainFirstPrice )
134
133
product .bargainPrice = formatToFraction (product .bargainPrice )
135
134
}
File renamed without changes.
Original file line number Diff line number Diff line change 65
65
import { allSchemas } from ' ./bargainActivity.data'
66
66
import * as BargainActivityApi from ' @/api/mall/promotion/bargain/bargainActivity'
67
67
import BargainActivityForm from ' ./BargainActivityForm.vue'
68
- import { cloneDeep } from ' lodash-es'
69
68
import { createImageViewer } from ' @/components/ImageViewer'
69
+ import { sortTableColumns } from ' @/hooks/web/useCrudSchemas'
70
70
71
71
defineOptions ({ name: ' PromotionBargainActivity' })
72
72
@@ -98,20 +98,10 @@ const handleDelete = (id: number) => {
98
98
tableMethods .delList (id , false )
99
99
}
100
100
101
- // TODO @puhui999:要不还是使用原生的 element plus 做。感觉 crud schema 复杂界面,做起来麻烦
102
101
/** 初始化 **/
103
102
onMounted (() => {
104
- /**
105
- TODO
106
- 后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
107
- 封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
108
- */
109
- // 处理一下表格列让商品往前
110
- const index = allSchemas .tableColumns .findIndex ((item ) => item .field === ' spuId' )
111
- const column = cloneDeep (allSchemas .tableColumns [index ])
112
- allSchemas .tableColumns .splice (index , 1 )
113
- // 添加到开头
114
- allSchemas .tableColumns .unshift (column )
103
+ // 获得活动列表
104
+ sortTableColumns (allSchemas .tableColumns , ' spuId' )
115
105
getList ()
116
106
})
117
107
</script >
You can’t perform that action at this time.
0 commit comments