|
@@ -9,12 +9,21 @@ export const A2_APIgetList = (data: any): any => {
|
|
|
return async (dispatch: AppDispatch) => {
|
|
|
const res = await http.post('cms/exhibition/pageList', data)
|
|
|
if (res.code === 0) {
|
|
|
+ const arr: any = []
|
|
|
+
|
|
|
+ res.data.records.forEach((v: any) => {
|
|
|
+ let activityTime = ''
|
|
|
+
|
|
|
+ if (v.type !== 'long') {
|
|
|
+ if (v.dateStart) activityTime += v.dateStart
|
|
|
+ if (v.dateEnd) activityTime += ` 至 ${v.dateEnd}`
|
|
|
+ }
|
|
|
+ v.activityTime = activityTime
|
|
|
+ arr.push(v)
|
|
|
+ })
|
|
|
+
|
|
|
const obj = {
|
|
|
- list: res.data.records.map((v: any) => ({
|
|
|
- ...v,
|
|
|
- activityTime:
|
|
|
- v.type === 'long' ? '' : v.dateStart + ' 至 ' + (v.dateEnd ? v.dateEnd : '长期有效')
|
|
|
- })),
|
|
|
+ list: arr,
|
|
|
total: res.data.total
|
|
|
}
|
|
|
dispatch({ type: 'A2/getList', payload: obj })
|