|
|
@@ -17,10 +17,10 @@ export enum StatisticType {
|
|
|
export interface finalReportMessage {
|
|
|
type: number;
|
|
|
statisticType: StatisticType;
|
|
|
- dayOfWeek: ''
|
|
|
+ dayOfWeek: number
|
|
|
monthList: [string];
|
|
|
dayOfMonthList: [string];
|
|
|
- pushTimeList: [];
|
|
|
+ pushTimeList: [string];
|
|
|
pushChannel: [];
|
|
|
userGroupList: [];
|
|
|
designatedUserList: [];
|
|
|
@@ -32,15 +32,15 @@ export interface finalReportMessage {
|
|
|
export interface reportMessage {
|
|
|
type: number;
|
|
|
statisticType: StatisticType;
|
|
|
- dayOfWeek: ''
|
|
|
+ dayOfWeek: number
|
|
|
monthList: [string];
|
|
|
- monthAndDayList?: [string],
|
|
|
+ monthAndDayList?: [string, string] | any,
|
|
|
dayOfMonthList: [string];
|
|
|
- pushTimeList: [];
|
|
|
+ pushTimeList: [string];
|
|
|
pushChannel: [];
|
|
|
- userGroupList: [];
|
|
|
- designatedUserList: [];
|
|
|
- customUserList: [];
|
|
|
+ userGroupList: any[];
|
|
|
+ designatedUserList: any;
|
|
|
+ customUserList: any;
|
|
|
recipientType: number|undefined;
|
|
|
customPushConfigList: computeCustom[]|any;
|
|
|
}
|
|
|
@@ -108,8 +108,8 @@ export const toReportMessage = (form: reportMessage, receivedData: finalReportMe
|
|
|
form.dayOfMonthList = receivedData.dayOfMonthList
|
|
|
form.pushTimeList = receivedData.pushTimeList
|
|
|
form.pushChannel = receivedData.pushChannel
|
|
|
- form.userGroupList = receivedData.userGroupList
|
|
|
- form.designatedUserList = receivedData.designatedUserList
|
|
|
+ form.userGroupList = receivedData.userGroupList?.map((user:any) => user.id)
|
|
|
+ form.designatedUserList.value = receivedData.designatedUserList
|
|
|
form.customUserList.value = receivedData.customUserList
|
|
|
form.recipientType = receivedData.recipientType
|
|
|
form.customPushConfigList = []
|
|
|
@@ -119,19 +119,20 @@ export const toReportMessage = (form: reportMessage, receivedData: finalReportMe
|
|
|
return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- if(receivedData.customPushConfigList[0].customUserList.length > 0){
|
|
|
- for (let index in form.customPushConfigList) {
|
|
|
- let userInfo = receivedData.customPushConfigList[index].customUserList.map((user:UserList) => {
|
|
|
- return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
- })
|
|
|
- form.customPushConfigList[index]['customUserList'].push(userInfo)
|
|
|
- }
|
|
|
+ if(form.designatedUserList.value.length > 0){
|
|
|
+ form.designatedUserList.value = form.designatedUserList.value.map((user) => {
|
|
|
+ return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
+ })
|
|
|
}
|
|
|
if(receivedData.statisticType === 2){
|
|
|
+
|
|
|
+ // form.dayOfMonthList[0] = receivedData.dayOfMonthList[0].toString()
|
|
|
form.dayOfMonthList.push(receivedData.dayOfMonthList[0].toString())
|
|
|
+ // form.dayOfMonthList.splice(0, form.dayOfMonthList.length);
|
|
|
+ // form.dayOfMonthList.push(receivedData.dayOfMonthList[0])
|
|
|
}
|
|
|
if(receivedData.statisticType === 4){
|
|
|
+ form.monthAndDayList.length = 0
|
|
|
form.monthAndDayList?.push(receivedData.monthList[0].toString())
|
|
|
form.monthAndDayList?.push(receivedData.dayOfMonthList[0].toString())
|
|
|
}
|
|
|
@@ -157,30 +158,9 @@ export const toReportMessage = (form: reportMessage, receivedData: finalReportMe
|
|
|
tempconfig['customUserList'] = config.customUserList.map((user:UserList) => {
|
|
|
return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
})
|
|
|
+ tempconfig['userGroupList'] = config.userGroupList?.map((user:any) => user.id)
|
|
|
customPushConfigList.push(tempconfig)
|
|
|
tempconfig = {}
|
|
|
-
|
|
|
- // if(receivedData.customPushConfigList[0].customUserList.length > 0){
|
|
|
- // for (let index in form.customPushConfigList) {
|
|
|
- // // console.log("form.customPushConfigList[index][customConfig']", form.customPushConfigList[index]["customUserList"]);
|
|
|
- // // for (let userIndex in form.customPushConfigList[index]["customUserList"]){
|
|
|
- // // console.log("userindex", userIndex);
|
|
|
- // // // console.log("form.customPushConfigList[index][customConfig']", form.customPushConfigList[index]["customUserList"][0]);
|
|
|
-
|
|
|
- // // console.log("aaa",form.customPushConfigList[index]["customUserList"].map((user:UserList) => {
|
|
|
- // // return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
- // // }))
|
|
|
- // // }
|
|
|
- // // console.log("form.customPushConfigList[index].customUserList", form.customPushConfigList[index].customUserList);
|
|
|
- // // console.log("form.customPushConfigList[index].customUserList",form.customPushConfigList[index].customUserList.map((user:UserList) => {
|
|
|
- // // return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
- // // }));
|
|
|
- // let userInfo = receivedData.customPushConfigList[index].customUserList.map((user:UserList) => {
|
|
|
- // return {"id": `u${user.userId}`, "name": user.userNickname, "userId": user.userId}
|
|
|
- // })
|
|
|
- // form.customPushConfigList[index]['customUserList'].push(userInfo)
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
for (let index in customPushConfigList){
|
|
|
const finalPushTime = computed(() => customPushConfigList[index]['pushDay'] + ' ' + customPushConfigList[index]['pushTime'])
|
|
|
@@ -208,9 +188,6 @@ export const reportMessageToFinal = (form) => { // 临时表单转为只存在
|
|
|
tempCustom['pushTime'] = config[key]
|
|
|
}
|
|
|
else if(key === 'customUserList'){
|
|
|
- console.log("key", key);
|
|
|
- console.log("config[key]", config[key]);
|
|
|
-
|
|
|
tempCustom['customUserList'] = config[key].map((user) => user.userId)
|
|
|
}
|
|
|
else{
|
|
|
@@ -222,7 +199,7 @@ export const reportMessageToFinal = (form) => { // 临时表单转为只存在
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return {
|
|
|
"type": form.type,
|
|
|
"statisticType": form.statisticType,
|
|
|
@@ -231,10 +208,10 @@ export const reportMessageToFinal = (form) => { // 临时表单转为只存在
|
|
|
"dayOfMonthList": form.dayOfMonthList,
|
|
|
"pushTimeList": form.pushTimeList,
|
|
|
"pushChannel": form.pushChannel,
|
|
|
- "userGroupList": form.userGroupList,
|
|
|
+ "userGroupList": form.userGroupList?.map((userOrId) => userOrId.id? userOrId.id :userOrId), // 用户对象和id可能会同时存在列表中
|
|
|
"recipientType": form.recipientType,
|
|
|
"customPushConfigList": customPushConfigList,
|
|
|
- "designatedUserList": form.designatedUserList,
|
|
|
+ "designatedUserList": form.designatedUserList.value?.map((user) => user.userId), // 只取出id
|
|
|
"customUserList": form.customUserList.value?.map((user) => user.userId)
|
|
|
}
|
|
|
};
|