2020-12-08 18:01:22 -04:00
|
|
|
import axios from 'axios';
|
2021-12-14 16:18:55 -04:00
|
|
|
import { RCBase64 } from '../utils/utils.js'
|
|
|
|
|
var base64 = RCBase64();
|
|
|
|
|
var credentials = JSON.parse(base64.decode(window.config.SYS_CREDENTIALS));
|
2020-12-02 19:46:17 +00:00
|
|
|
export let menu = {
|
|
|
|
|
get() {
|
2020-12-16 19:00:37 -04:00
|
|
|
return axios.get(
|
2021-03-24 14:56:11 +00:00
|
|
|
window.config.SYS_SERVER_API +
|
2020-12-16 19:00:37 -04:00
|
|
|
'/api/1.0/' +
|
|
|
|
|
window.config.SYS_WORKSPACE +
|
|
|
|
|
'/home/menu', {
|
2020-12-08 18:01:22 -04:00
|
|
|
headers: {
|
2021-12-14 16:18:55 -04:00
|
|
|
'Authorization': 'Bearer ' + credentials.accessToken,
|
2021-05-31 18:19:50 +00:00
|
|
|
"Accept-Language": window.config.SYS_LANG
|
2020-12-08 18:01:22 -04:00
|
|
|
}
|
2020-12-02 19:46:17 +00:00
|
|
|
});
|
2020-12-08 18:01:22 -04:00
|
|
|
|
2020-12-02 19:46:17 +00:00
|
|
|
},
|
2020-12-16 19:00:37 -04:00
|
|
|
getCounters() {
|
|
|
|
|
return axios.get(
|
2021-03-24 14:56:11 +00:00
|
|
|
window.config.SYS_SERVER_API +
|
2020-12-16 19:00:37 -04:00
|
|
|
'/api/1.0/' +
|
|
|
|
|
window.config.SYS_WORKSPACE +
|
|
|
|
|
'/home/tasks/counter', {
|
|
|
|
|
headers: {
|
2021-12-14 16:18:55 -04:00
|
|
|
'Authorization': 'Bearer ' + credentials.accessToken,
|
2021-05-31 18:19:50 +00:00
|
|
|
"Accept-Language": window.config.SYS_LANG
|
2020-12-16 19:00:37 -04:00
|
|
|
}
|
|
|
|
|
});
|
2021-07-22 16:12:03 -04:00
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* Get the counter of a specific task
|
|
|
|
|
* @param {string} task
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
getTooltip(task) {
|
|
|
|
|
return axios.get(
|
|
|
|
|
window.config.SYS_SERVER_API +
|
|
|
|
|
'/api/1.0/' +
|
|
|
|
|
window.config.SYS_WORKSPACE +
|
|
|
|
|
'/home/'+ task +'/counter', {
|
|
|
|
|
headers: {
|
2021-12-14 16:18:55 -04:00
|
|
|
'Authorization': 'Bearer ' + credentials.accessToken,
|
2021-07-22 16:12:03 -04:00
|
|
|
"Accept-Language": window.config.SYS_LANG
|
2021-09-20 15:54:16 -04:00
|
|
|
}
|
2021-07-22 16:12:03 -04:00
|
|
|
});
|
2021-08-26 20:29:51 -04:00
|
|
|
},
|
2021-09-20 15:54:16 -04:00
|
|
|
/**
|
|
|
|
|
* Get the counter of a specific custom case list
|
|
|
|
|
* @param {Object} data
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
getTooltipCaseList(data) {
|
|
|
|
|
return axios.get(
|
|
|
|
|
window.config.SYS_SERVER_API +
|
|
|
|
|
'/api/1.0/' +
|
|
|
|
|
window.config.SYS_WORKSPACE +
|
|
|
|
|
'/home/' + data.page + '/counter/caseList/' + data.id, {
|
|
|
|
|
headers: {
|
2021-12-14 16:18:55 -04:00
|
|
|
'Authorization': 'Bearer ' + credentials.accessToken,
|
2021-09-20 15:54:16 -04:00
|
|
|
"Accept-Language": window.config.SYS_LANG
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
},
|
2021-08-26 20:29:51 -04:00
|
|
|
/**
|
|
|
|
|
* Get the highlight
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
getHighlight() {
|
|
|
|
|
return axios.get(
|
|
|
|
|
window.config.SYS_SERVER_API +
|
|
|
|
|
'/api/1.0/' +
|
|
|
|
|
window.config.SYS_WORKSPACE +
|
|
|
|
|
'/home/tasks/highlight', {
|
|
|
|
|
headers: {
|
2021-12-14 16:18:55 -04:00
|
|
|
'Authorization': 'Bearer ' + credentials.accessToken,
|
2021-08-26 20:29:51 -04:00
|
|
|
"Accept-Language": window.config.SYS_LANG
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-12-16 19:00:37 -04:00
|
|
|
}
|
2020-12-02 19:46:17 +00:00
|
|
|
};
|