forked from adempiere/adempiere-vue
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Calendar Task (PanJiaChen#1894)
* feat Calendar `Tasks`. * Feat: List Tasks (#52) * Feat: List Tasks * load events from server. * remove console.log --------- Co-authored-by: Edwin Betancourt <[email protected]> --------- Co-authored-by: Elsio Sanchez <[email protected]>
- Loading branch information
1 parent
351790e
commit 1400e8a
Showing
4 changed files
with
230 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Contributor(s): Edwin Betancourt [email protected] https://github.com/EdwinBetanc0urt | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
// Get Instance for connection | ||
import { request } from '@/utils/ADempiere/request' | ||
|
||
export function requestListTasks({ | ||
date | ||
}) { | ||
return request({ | ||
url: `/task-management/tasks`, | ||
method: 'get', | ||
params: { | ||
// date: '2023-01-24T00:00:00.000Z', | ||
is_with_projects: true, | ||
is_with_requests: true, | ||
is_with_resource_assignments: true | ||
// date | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/** | ||
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution | ||
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com | ||
* Contributor(s): Elsio Sanchez [email protected] https://github.com/elsiosanchez | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
// import lang from '@/lang' | ||
|
||
// API Request Methods | ||
import { requestListTasks } from '@/api/ADempiere/form/task-management.ts' | ||
import { isEmptyValue } from '@/utils/ADempiere' | ||
|
||
// Utils and Helper Methods | ||
// import { translateDate } from '@/utils/ADempiere/formatValue/dateFormat' | ||
import { showMessage } from '@/utils/ADempiere/notification.js' | ||
|
||
const calendarView = { | ||
listEvents: [] | ||
} | ||
|
||
export default { | ||
state: calendarView, | ||
|
||
mutations: { | ||
setListTaks(state, list) { | ||
state.listEvents = list | ||
} | ||
}, | ||
|
||
actions: { | ||
getListTasksFromServer({ commit }, { | ||
date = undefined | ||
}) { | ||
return new Promise(resolve => { | ||
requestListTasks({ | ||
date | ||
}) | ||
.then(response => { | ||
const { tasks } = response | ||
// const list = tasks.map(list => { | ||
// return { | ||
// title: list.name, | ||
// timeText: translateDate({ | ||
// value: list.start_date, | ||
// format: 'long' | ||
// }) | ||
// } | ||
// }) | ||
commit('setListTaks', tasks) | ||
resolve(tasks) | ||
}) | ||
.catch(error => { | ||
console.warn(`Add List Taks: ${error.message}. Code: ${error.code}.`) | ||
let message = error.message | ||
if (!isEmptyValue(error.response) && !isEmptyValue(error.response.data.message)) { | ||
message = error.response.data.message | ||
} | ||
|
||
showMessage({ | ||
type: 'error', | ||
message, | ||
showClose: true | ||
}) | ||
resolve({}) | ||
}) | ||
}) | ||
} | ||
}, | ||
getters: { | ||
getListTasksEvents(state) { | ||
return state.listEvents | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters