|
@@ -54,7 +54,32 @@ export async function htQuery(id, ...dataContent) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function NewGeneralDataReception(func: any) {
|
|
|
+ return func;
|
|
|
+}
|
|
|
+
|
|
|
export function GeneralDataReception(params): Promise<CommonQueryResult> {
|
|
|
+ const { serviceId, dataContent } = params;
|
|
|
+ if (NEW_SERVICE_ID.includes(serviceId)) {
|
|
|
+ const newData = JSON.parse(dataContent);
|
|
|
+ const { event } = newData;
|
|
|
+ const eventType = event;
|
|
|
+ let key: any = null;
|
|
|
+ if (newData?.event) {
|
|
|
+ delete newData.event;
|
|
|
+ }
|
|
|
+ if (eventType == 2) {
|
|
|
+ for (const item in newData) {
|
|
|
+ if (item.includes("id") || item.includes("Id") || item.includes("ID")) {
|
|
|
+ key = item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return NewGeneralDataReception(
|
|
|
+ dataToChange(serviceId, newData, eventType, key)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return NewGeneralDataReception(dataToChange(serviceId, newData, eventType));
|
|
|
+ }
|
|
|
return request({
|
|
|
url: "/openApi/generalDataReception",
|
|
|
method: "post",
|
|
@@ -78,16 +103,43 @@ export async function dataToChange(
|
|
|
};
|
|
|
const { code, message } =
|
|
|
event == 1
|
|
|
- ? await newData(params)
|
|
|
+ ? await newData2(params)
|
|
|
: event == 2
|
|
|
- ? await modifyData(params)
|
|
|
- : await moveData(params);
|
|
|
+ ? await modifyData2(params)
|
|
|
+ : await moveData2(params);
|
|
|
return { code, message };
|
|
|
} catch (error) {
|
|
|
return { code: 1, message: error };
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//新增
|
|
|
+export function newData2(params) {
|
|
|
+ return request({
|
|
|
+ url: "/openApi/newdata",
|
|
|
+ method: "post",
|
|
|
+ data: params,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//修改
|
|
|
+export function modifyData2(params) {
|
|
|
+ return request({
|
|
|
+ url: "/openApi/modifydata",
|
|
|
+ method: "post",
|
|
|
+ data: params,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//删除movedata
|
|
|
+export function moveData2(params) {
|
|
|
+ return request({
|
|
|
+ url: "/openApi/movedata",
|
|
|
+ method: "post",
|
|
|
+ data: params,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
//新增
|
|
|
export function newData(params) {
|
|
|
return request({
|