|
@@ -1,8 +1,8 @@
|
|
|
import {
|
|
import {
|
|
|
- postform,get
|
|
|
|
|
|
|
+ postform, get
|
|
|
} from '../utils/request'
|
|
} from '../utils/request'
|
|
|
|
|
|
|
|
-const dmsPath = systemConfig.dmsDataProxy
|
|
|
|
|
|
|
+const dmsPath = systemConfig.dmsDataProxy
|
|
|
|
|
|
|
|
const oauthPath = systemConfig.oauthServiceUrl
|
|
const oauthPath = systemConfig.oauthServiceUrl
|
|
|
|
|
|
|
@@ -222,6 +222,7 @@ export function totalCount(start, end) {
|
|
|
|
|
|
|
|
return resolveDmsMultiTableResult(postform(multiSearch, data));
|
|
return resolveDmsMultiTableResult(postform(multiSearch, data));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
export function totalCountGroupByTime(start, end) {
|
|
export function totalCountGroupByTime(start, end) {
|
|
|
let data = {
|
|
let data = {
|
|
|
"columnId": preCountDmsId,
|
|
"columnId": preCountDmsId,
|
|
@@ -238,7 +239,7 @@ export function totalCountGroupByTime(start, end) {
|
|
|
}, {
|
|
}, {
|
|
|
"table": "precount",
|
|
"table": "precount",
|
|
|
"column": "c_date",
|
|
"column": "c_date",
|
|
|
- "alias":"time"
|
|
|
|
|
|
|
+ "alias": "time"
|
|
|
}
|
|
}
|
|
|
]),
|
|
]),
|
|
|
"groupBy": JSON.stringify([
|
|
"groupBy": JSON.stringify([
|
|
@@ -254,9 +255,28 @@ export function totalCountGroupByTime(start, end) {
|
|
|
|
|
|
|
|
return resolveDmsMultiTableResult(postform(multiSearch, data));
|
|
return resolveDmsMultiTableResult(postform(multiSearch, data));
|
|
|
}
|
|
}
|
|
|
-export function countUserData(){
|
|
|
|
|
- return resolveoauthResult(get(oauthCountUser))
|
|
|
|
|
|
|
+
|
|
|
|
|
+export function countUserData() {
|
|
|
|
|
+ return resolveoauthResult(get(oauthCountUser))
|
|
|
|
|
+}
|
|
|
|
|
+export function countUserDataByTime(time1, time2, time3) {
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ "time": JSON.stringify([
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "last",
|
|
|
|
|
+ start: formatDateToDb(time1),
|
|
|
|
|
+ end: formatDateToDb(time2)
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "this",
|
|
|
|
|
+ start: formatDateToDb(time2),
|
|
|
|
|
+ end: formatDateToDb(time3)
|
|
|
|
|
+ },
|
|
|
|
|
+ ])
|
|
|
|
|
+ }
|
|
|
|
|
+ return resolveoauthResult(postform(oauthCountUser, data))
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function timeCheckers(start, end) {
|
|
function timeCheckers(start, end) {
|
|
|
let output = []
|
|
let output = []
|
|
|
if (start != null) {
|
|
if (start != null) {
|
|
@@ -299,7 +319,7 @@ async function resolveDmsMultiTableResult(result) {
|
|
|
} else if (result.code == 202) {
|
|
} else if (result.code == 202) {
|
|
|
return [];
|
|
return [];
|
|
|
} else {
|
|
} else {
|
|
|
- return null;
|
|
|
|
|
|
|
+ throw new Error(result.message)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
async function resolveoauthResult(result) {
|
|
async function resolveoauthResult(result) {
|
|
@@ -307,6 +327,16 @@ async function resolveoauthResult(result) {
|
|
|
if (result.code == 200) {
|
|
if (result.code == 200) {
|
|
|
return result.content
|
|
return result.content
|
|
|
} else {
|
|
} else {
|
|
|
- return null;
|
|
|
|
|
|
|
+ throw new Error(result.message)
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+function formatDateToDb(date) {
|
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
+ const hours = String(date.getHours()).padStart(2, '0');
|
|
|
|
|
+ const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
|
|
|
+ const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
|
|
|
+
|
|
|
|
|
+ return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
}
|
|
}
|