Cut/Paste project and todos

This commit is contained in:
Paolo Arena
2019-04-29 01:01:31 +02:00
parent 2ba3cd6b3f
commit d6d527e1a8
14 changed files with 218 additions and 71 deletions

View File

@@ -171,7 +171,7 @@ export default class ProjList extends Vue {
mymenu = tools.menuPopupConfigProject[UserStore.state.lang]
if (mymenu.length > 0)
mymenu[0].disable = !(Projects.state.action.type === tools.MenuAction.CUT)
mymenu[0].disable = !(GlobalStore.state.lastaction.type === tools.MenuAction.CUT)
return mymenu
}
@@ -191,6 +191,14 @@ export default class ProjList extends Vue {
}
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursplanned * 100)
}
get getCalcHoursLeft() {
if (this.itemselproj.hoursleft <= 0) {
return 0
}
return Math.round(this.itemselproj.hoursworked / this.itemselproj.hoursleft * 100)
}
get calcprogressWeekly() {
@@ -207,7 +215,8 @@ export default class ProjList extends Vue {
try {
let orerimaste = this.itemselproj.hoursplanned - this.itemselproj.hoursworked
// let orerimaste = this.itemselproj.hoursplanned - this.itemselproj.hoursworked
let orerimaste = this.itemselproj.hoursleft
if (orerimaste < 0) {
orerimaste = 0
}
@@ -227,7 +236,7 @@ export default class ProjList extends Vue {
console.log(' days', days, 'weeks', weeks, 'orerimaste', orerimaste, 'dateestimated', this.itemselproj.endwork_estimate)
return this.itemselproj.endwork_estimate
}catch (e) {
} catch (e) {
this.itemselproj.endwork_estimate = tools.getDateNull()
}
@@ -379,11 +388,15 @@ export default class ProjList extends Vue {
} else if (action === tools.MenuAction.PASTE) {
const myaction: IAction = {
table: GlobalStore.state.lastaction.table,
type: tools.MenuAction.PASTE,
_id: this.itemselproj._id
}
return await Projects.actions.ActionCutPaste(myaction)
if (myaction.table === tools.projects)
return await Projects.actions.ActionCutPaste(myaction)
else if (myaction.table === tools.todos)
return await Todos.actions.ActionCutPaste(myaction)
}
}

View File

@@ -272,6 +272,7 @@
v-model="itemtodosel.descr"
:label="$t('proj.longdescr')"
outlined
:readonly="readonly_PanelPrivacy"
debounce="1000"
autogrow>
@@ -283,6 +284,7 @@
<q-icon class="flex-item flex-icon" name="done_outline"/>
<div class="flex-item itemstatus">
<q-select rounded outlined v-model="itemtodosel.statustodo" :options="selectStatus"
:readonly="readonly_PanelPrivacy"
:label="$t('todo.status')" emit-value map-options
@input="modifyfieldtodo('statustodo')">
</q-select>
@@ -290,6 +292,7 @@
<q-icon class="flex-item flex-icon" name="outlined_flag"/>
<div class="flex-item itemstatus">
<q-select rounded outlined v-model="itemtodosel.phase" :options="selectPhase"
:readonly="readonly_PanelPrivacy"
:label="$t('todo.phase')" emit-value map-options>
</q-select>
</div>
@@ -299,6 +302,7 @@
<div class="flex-item itemdescr">
<q-input
ref="input5"
:readonly="readonly_PanelPrivacy"
v-model="itemtodosel.hoursworked"
type="number"
rounded outlined
@@ -312,6 +316,7 @@
<div class="flex-item itemdata content-center">
<q-input
ref="input6"
:readonly="readonly_PanelPrivacy"
type="number"
v-model="itemtodosel.hoursplanned"
rounded outlined
@@ -321,6 +326,7 @@
</q-input>
<CProgress :descr="$t('proj.progresstask')"
:readonly="readonly_PanelPrivacy"
:progressval="itemtodosel.progress"
:slider="true" @input="itemtodosel.progress = arguments[0]"></CProgress>
</div>
@@ -329,6 +335,7 @@
<q-icon class="flex-item flex-icon" name="developer_mode"/>
<div class="flex-item itemdata">
<CDate :mydate="itemtodosel.start_date"
:readonly="readonly_PanelPrivacy"
@input="itemtodosel.start_date = new Date(arguments[0])"
:label="$t('todo.start_date')">
@@ -337,7 +344,7 @@
<div style="margin: 10px;"></div>
<q-icon class="flex-item flex-icon" name="event"/>
<div class="flex-item itemdata">
<CDate :readonly="itemtodosel.statustodo !== tools.Status.COMPLETED"
<CDate :readonly="((itemtodosel.statustodo !== tools.Status.COMPLETED) || readonly_PanelPrivacy)"
:mydate="itemtodosel.completed_at"
@input="itemtodosel.completed_at = new Date(arguments[0])"
:label="$t('todo.completed_at')">