Cut/Paste project and todos
This commit is contained in:
@@ -20,6 +20,7 @@ export default class CProgress extends Vue {
|
||||
@Prop({ required: true }) public progressval: number
|
||||
@Prop() public descr: string
|
||||
@Prop({ default: false }) public slider: boolean
|
||||
@Prop({ default: false }) public readonly: boolean
|
||||
|
||||
@Watch('progressval')
|
||||
public valchanged(value) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<div class="flex-item progress-item shadow-1">
|
||||
<q-slider v-if="slider" label
|
||||
class="cpr-slider-item"
|
||||
:readonly="readonly"
|
||||
:value="progressval"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@@ -12,6 +13,7 @@
|
||||
<q-linear-progress
|
||||
v-else
|
||||
stripe
|
||||
:readonly="readonly"
|
||||
rounded
|
||||
:value="progressval / 100"
|
||||
class="cpr-progrbar-item"
|
||||
|
||||
@@ -10,6 +10,7 @@ import { SubMenusProj } from '../SubMenusProj'
|
||||
import { CDate } from '../../CDate'
|
||||
|
||||
import { date } from 'quasar'
|
||||
import { GlobalStore } from '@store'
|
||||
|
||||
@Component({
|
||||
components: { SubMenusProj, CDate },
|
||||
@@ -488,6 +489,7 @@ export default class SingleProject extends Vue {
|
||||
this.activeEdit()
|
||||
} else if (action === tools.MenuAction.CUT) {
|
||||
const myaction = {
|
||||
table: tools.projects,
|
||||
type: tools.MenuAction.CUT,
|
||||
_id: this.itemproject._id
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import { Component, Prop, Watch } from 'vue-property-decorator'
|
||||
|
||||
import { UserStore } from '@modules'
|
||||
import { Projects, UserStore } from '@modules'
|
||||
import { tools } from '../../../store/Modules/tools'
|
||||
|
||||
import { ITodo } from '../../../model/index'
|
||||
@@ -460,6 +460,14 @@ export default class SingleTodo extends Vue {
|
||||
return await this.setCompleted()
|
||||
} else if (action === tools.MenuAction.PROGRESS_BAR) {
|
||||
return await this.updatedata('progress')
|
||||
} else if (action === tools.MenuAction.CUT) {
|
||||
const myaction = {
|
||||
table: tools.todos,
|
||||
type: tools.MenuAction.CUT,
|
||||
_id: this.itemtodo._id,
|
||||
cat: this.itemtodo.category
|
||||
}
|
||||
return await Projects.actions.ActionCutPaste(myaction)
|
||||
} else if (action === 0) {
|
||||
this.deselectAndExitEdit()
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { costanti } from "@src/store/Modules/costanti"
|
||||
import { UserStore } from "@store"
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { IAction } from '@src/model/Projects'
|
||||
|
||||
export interface IPost {
|
||||
title: string
|
||||
@@ -58,6 +59,7 @@ export interface IGlobalState {
|
||||
menulinks: {}
|
||||
listatodo: IMenuList[]
|
||||
arrConfig: IConfig[]
|
||||
lastaction: IAction
|
||||
}
|
||||
|
||||
export interface IMenuList {
|
||||
|
||||
@@ -3,8 +3,10 @@ import { UserStore } from '@store'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
export interface IAction {
|
||||
table: string
|
||||
type: number
|
||||
_id: any
|
||||
cat?: string
|
||||
}
|
||||
|
||||
export interface IProject {
|
||||
@@ -31,6 +33,7 @@ export interface IProject {
|
||||
live_url?: string
|
||||
test_url?: string
|
||||
hoursplanned?: number
|
||||
hoursleft?: number
|
||||
hoursworked?: number
|
||||
progressCalc?: number
|
||||
begin_development?: Date
|
||||
@@ -48,7 +51,6 @@ export interface IProjectsState {
|
||||
projects: IProject[]
|
||||
insidePending: boolean
|
||||
visuLastCompleted: number
|
||||
action: IAction
|
||||
}
|
||||
|
||||
export const Privacy = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { IAction } from '@src/model/Projects'
|
||||
|
||||
export interface ITodo {
|
||||
_id?: any,
|
||||
userId?: string
|
||||
|
||||
@@ -506,6 +506,7 @@ const messages = {
|
||||
insertbottom: 'Añadir nuevo Proyecto',
|
||||
longdescr: 'Descripción',
|
||||
hoursplanned: 'Horas Estimadas',
|
||||
hoursleft: 'Horas Restantes',
|
||||
hoursadded: 'Horas Adicional',
|
||||
hoursworked: 'Horas Trabajadas',
|
||||
begin_development: 'Comienzo desarrollo',
|
||||
@@ -763,6 +764,7 @@ const messages = {
|
||||
insertbottom: 'Insert New Project',
|
||||
longdescr: 'Description',
|
||||
hoursplanned: 'Estimated Hours',
|
||||
hoursleft: 'Left Hours',
|
||||
hoursadded: 'Additional Hours',
|
||||
hoursworked: 'Worked Hours',
|
||||
begin_development: 'Start Dev',
|
||||
|
||||
@@ -51,7 +51,12 @@ const state: IGlobalState = {
|
||||
downloading_server: 0,
|
||||
downloading_indexeddb: 0
|
||||
},
|
||||
arrConfig: []
|
||||
arrConfig: [],
|
||||
lastaction: {
|
||||
table: '',
|
||||
type: 0,
|
||||
_id: 0
|
||||
}
|
||||
}
|
||||
|
||||
async function getConfig(id) {
|
||||
|
||||
@@ -18,19 +18,15 @@ const stateglob: IProjectsState = {
|
||||
showtype: costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED,
|
||||
projects: [],
|
||||
insidePending: false,
|
||||
visuLastCompleted: 10,
|
||||
action: {
|
||||
type: 0,
|
||||
_id: ''
|
||||
}
|
||||
visuLastCompleted: 10
|
||||
}
|
||||
|
||||
const listFieldsToChange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursworked', 'id_parent', 'statusproj',
|
||||
const listFieldsToChange: string [] = ['descr', 'longdescr', 'hoursplanned', 'hoursleft', 'hoursworked', 'id_parent', 'statusproj',
|
||||
'category', 'expiring_at', 'priority', 'id_prev', 'pos', 'enableExpiring', 'progressCalc', 'live_url', 'test_url',
|
||||
'begin_development', 'begin_test', 'actualphase', 'totalphases', 'hoursweeky_plannedtowork', 'endwork_estimate',
|
||||
'privacyread', 'privacywrite', 'id_main_project', 'typeproj', 'favourite']
|
||||
|
||||
const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursworked', 'progressCalc', 'endwork_estimate']
|
||||
const listFieldsUpdateCalculation: string [] = ['hoursplanned', 'hoursleft', 'hoursworked', 'progressCalc', 'endwork_estimate']
|
||||
|
||||
const b = storeBuilder.module<IProjectsState>('Projects', stateglob)
|
||||
const stateGetter = b.state()
|
||||
@@ -92,13 +88,14 @@ namespace Getters {
|
||||
actualphase: 1,
|
||||
hoursworked: 0,
|
||||
hoursplanned: 0,
|
||||
hoursleft: 0,
|
||||
progressCalc: 0,
|
||||
privacyread: 'onlyme',
|
||||
privacywrite: 'onlyme',
|
||||
begin_development: tools.getDateNull(),
|
||||
begin_test: tools.getDateNull(),
|
||||
hoursweeky_plannedtowork: 0,
|
||||
endwork_estimate: tools.getDateNull(),
|
||||
endwork_estimate: tools.getDateNull()
|
||||
}
|
||||
|
||||
return obj
|
||||
@@ -247,9 +244,6 @@ namespace Mutations {
|
||||
async function movemyitem(state: IProjectsState, { myitemorig, myitemdest } ) {
|
||||
const indorig = tools.getIndexById(state.projects, myitemorig._id)
|
||||
|
||||
// console.log('myitemorig', myitemorig, 'indorig', indorig)
|
||||
// console.log('myitemdest', myitemdest)
|
||||
|
||||
state.projects.splice(indorig, 1)
|
||||
state.projects.push(myitemdest)
|
||||
|
||||
@@ -399,13 +393,13 @@ namespace Actions {
|
||||
|
||||
async function ActionCutPaste(context, action: IAction) {
|
||||
|
||||
if (action.type === tools.MenuAction.CUT)
|
||||
stateglob.action = action
|
||||
else if (action.type === tools.MenuAction.PASTE) {
|
||||
if (stateglob.action.type === tools.MenuAction.CUT) {
|
||||
if (action.type === tools.MenuAction.CUT) {
|
||||
GlobalStore.state.lastaction = action
|
||||
} else if (action.type === tools.MenuAction.PASTE) {
|
||||
if (GlobalStore.state.lastaction.type === tools.MenuAction.CUT) {
|
||||
|
||||
// Change id_parent
|
||||
const orig_obj = Getters.getters.getRecordById(stateglob.action._id)
|
||||
const orig_obj = Getters.getters.getRecordById(GlobalStore.state.lastaction._id)
|
||||
const dest = Getters.getters.getRecordById(action._id)
|
||||
|
||||
// console.log('dest', dest)
|
||||
@@ -418,13 +412,12 @@ namespace Actions {
|
||||
dest_obj.modified = true
|
||||
dest_obj.id_prev = null
|
||||
|
||||
await Mutations.mutations.movemyitem({ myitemorig: orig_obj, myitemdest: dest_obj })
|
||||
}
|
||||
GlobalStore.state.lastaction.type = 0
|
||||
|
||||
stateglob.action.type = 0
|
||||
return await Mutations.mutations.movemyitem({ myitemorig: orig_obj, myitemdest: dest_obj })
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { serv_constants } from '@src/store/Modules/serv_constants'
|
||||
import { GetterTree } from 'vuex'
|
||||
import objectId from '@src/js/objectId'
|
||||
import { costanti } from '@src/store/Modules/costanti'
|
||||
import { IAction } from '@src/model'
|
||||
|
||||
const nametable = 'todos'
|
||||
|
||||
@@ -46,7 +47,7 @@ function gettodosByCategory(category: string): [] {
|
||||
|
||||
function initcat() {
|
||||
|
||||
let rec = Getters.getters.getRecordEmpty()
|
||||
const rec = Getters.getters.getRecordEmpty()
|
||||
rec.userId = UserStore.state.userId
|
||||
|
||||
return rec
|
||||
@@ -54,7 +55,7 @@ function initcat() {
|
||||
}
|
||||
|
||||
namespace Getters {
|
||||
const getRecordEmpty = b.read((state: ITodosState) => (): ITodo => {
|
||||
const getRecordEmpty = b.read((stateparamf: ITodosState) => (): ITodo => {
|
||||
|
||||
const tomorrow = tools.getDateNow()
|
||||
tomorrow.setDate(tomorrow.getDate() + 1)
|
||||
@@ -81,32 +82,32 @@ namespace Getters {
|
||||
assigned_to_userId: '',
|
||||
hoursplanned: 0,
|
||||
hoursworked: 0,
|
||||
start_date: tools.getDateNull(),
|
||||
start_date: tools.getDateNull()
|
||||
}
|
||||
// return this.copy(objtodo)
|
||||
return objtodo
|
||||
}, 'getRecordEmpty')
|
||||
const items_dacompletare = b.read((state: ITodosState) => (cat: string): ITodo[] => {
|
||||
const items_dacompletare = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => {
|
||||
const indcat = getindexbycategory(cat)
|
||||
// console.log('items_dacompletare', 'indcat', indcat, state.todos[indcat])
|
||||
if (state.todos[indcat]) {
|
||||
return state.todos[indcat].filter((todo) => todo.statustodo !== tools.Status.COMPLETED)
|
||||
// console.log('items_dacompletare', 'indcat', indcat, stateparam.todos[indcat])
|
||||
if (stateparam.todos[indcat]) {
|
||||
return stateparam.todos[indcat].filter((todo) => todo.statustodo !== tools.Status.COMPLETED)
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}, 'items_dacompletare')
|
||||
|
||||
const todos_completati = b.read((state: ITodosState) => (cat: string): ITodo[] => {
|
||||
const todos_completati = b.read((stateparam: ITodosState) => (cat: string): ITodo[] => {
|
||||
const indcat = getindexbycategory(cat)
|
||||
if (state.todos[indcat]) {
|
||||
if (state.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed
|
||||
return state.todos[indcat].filter((todo) => todo.statustodo === tools.Status.COMPLETED).slice(0, state.visuLastCompleted)
|
||||
if (stateparam.todos[indcat]) {
|
||||
if (stateparam.showtype === costanti.ShowTypeTask.SHOW_LAST_N_COMPLETED) { // Show only the first N completed
|
||||
return stateparam.todos[indcat].filter((todo) => todo.statustodo === tools.Status.COMPLETED).slice(0, stateparam.visuLastCompleted)
|
||||
}
|
||||
else if (state.showtype === costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE) {
|
||||
else if (stateparam.showtype === costanti.ShowTypeTask.SHOW_ONLY_TOCOMPLETE) {
|
||||
return []
|
||||
}
|
||||
else if (state.showtype === costanti.ShowTypeTask.SHOW_ALL) {
|
||||
return state.todos[indcat].filter((todo) => todo.statustodo === tools.Status.COMPLETED)
|
||||
else if (stateparam.showtype === costanti.ShowTypeTask.SHOW_ALL) {
|
||||
return stateparam.todos[indcat].filter((todo) => todo.statustodo === tools.Status.COMPLETED)
|
||||
}
|
||||
else {
|
||||
return []
|
||||
@@ -116,22 +117,22 @@ namespace Getters {
|
||||
}
|
||||
}, 'todos_completati')
|
||||
|
||||
const doneTodosCount = b.read((state: ITodosState) => (cat: string): number => {
|
||||
const doneTodosCount = b.read((stateparam: ITodosState) => (cat: string): number => {
|
||||
return getters.todos_completati(cat).length
|
||||
}, 'doneTodosCount')
|
||||
const TodosCount = b.read((state: ITodosState) => (cat: string): number => {
|
||||
const TodosCount = b.read((stateparam: ITodosState) => (cat: string): number => {
|
||||
const indcat = getindexbycategory(cat)
|
||||
if (state.todos[indcat]) {
|
||||
return state.todos[indcat].length
|
||||
if (stateparam.todos[indcat]) {
|
||||
return stateparam.todos[indcat].length
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}, 'TodosCount')
|
||||
|
||||
const getRecordById = b.read((state: ITodosState) => (id: string, cat: string): ITodo => {
|
||||
const getRecordById = b.read((stateparam: ITodosState) => (id: string, cat: string): ITodo => {
|
||||
const indcat = getindexbycategory(cat)
|
||||
if (state.todos) {
|
||||
return state.todos[indcat].find((item) => item._id === id)
|
||||
if (stateparam.todos) {
|
||||
return stateparam.todos[indcat].find((item) => item._id === id)
|
||||
}
|
||||
return null
|
||||
}, 'getRecordById')
|
||||
@@ -160,49 +161,73 @@ namespace Getters {
|
||||
|
||||
namespace Mutations {
|
||||
|
||||
function findIndTodoById(state: ITodosState, data: IParamTodo) {
|
||||
const indcat = state.categories.indexOf(data.categorySel)
|
||||
function findIndTodoById(stateparam: ITodosState, data: IParamTodo) {
|
||||
const indcat = stateparam.categories.indexOf(data.categorySel)
|
||||
if (indcat >= 0) {
|
||||
return tools.getIndexById(state.todos[indcat], data.id)
|
||||
return tools.getIndexById(stateparam.todos[indcat], data.id)
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
function createNewItem(state: ITodosState, { objtodo, atfirst, categorySel }) {
|
||||
let indcat = state.categories.indexOf(categorySel)
|
||||
if (indcat == -1) {
|
||||
state.categories.push(categorySel)
|
||||
indcat = state.categories.indexOf(categorySel)
|
||||
function createNewItem(stateparam: ITodosState, { objtodo, atfirst, categorySel }) {
|
||||
let indcat = stateparam.categories.indexOf(categorySel)
|
||||
if (indcat === -1) {
|
||||
stateparam.categories.push(categorySel)
|
||||
indcat = stateparam.categories.indexOf(categorySel)
|
||||
}
|
||||
console.log('createNewItem', objtodo, 'cat=', categorySel, 'state.todos[indcat]', state.todos[indcat])
|
||||
if (state.todos[indcat] === undefined) {
|
||||
state.todos[indcat] = []
|
||||
state.todos[indcat].push(objtodo)
|
||||
console.log('push state.todos[indcat]', state.todos)
|
||||
console.log('createNewItem', objtodo, 'cat=', categorySel, 'stateparam.todos[indcat]', stateparam.todos[indcat])
|
||||
if (stateparam.todos[indcat] === undefined) {
|
||||
stateparam.todos[indcat] = []
|
||||
stateparam.todos[indcat].push(objtodo)
|
||||
console.log('push stateparam.todos[indcat]', stateparam.todos)
|
||||
return
|
||||
}
|
||||
if (atfirst) {
|
||||
state.todos[indcat].unshift(objtodo)
|
||||
stateparam.todos[indcat].unshift(objtodo)
|
||||
}
|
||||
else {
|
||||
state.todos[indcat].push(objtodo)
|
||||
stateparam.todos[indcat].push(objtodo)
|
||||
}
|
||||
|
||||
console.log('state.todos[indcat]', state.todos[indcat])
|
||||
console.log('stateparam.todos[indcat]', stateparam.todos[indcat])
|
||||
|
||||
}
|
||||
|
||||
function deletemyitem(state: ITodosState, myitem: ITodo) {
|
||||
function deletemyitem(stateparam: ITodosState, myitem: ITodo) {
|
||||
// Find record
|
||||
const indcat = state.categories.indexOf(myitem.category)
|
||||
const ind = findIndTodoById(state, { id: myitem._id, categorySel: myitem.category })
|
||||
const indcat = stateparam.categories.indexOf(myitem.category)
|
||||
const ind = findIndTodoById(stateparam, { id: myitem._id, categorySel: myitem.category })
|
||||
|
||||
ApiTables.removeitemfromarray(state.todos[indcat], ind)
|
||||
ApiTables.removeitemfromarray(stateparam.todos[indcat], ind)
|
||||
}
|
||||
|
||||
async function movemyitem(stateparam: ITodosState, { myitemorig, myitemdest } ) {
|
||||
|
||||
const indcat = stateparam.categories.indexOf(myitemorig.category)
|
||||
const indorig = tools.getIndexById(stateparam.todos[indcat], myitemorig._id)
|
||||
let indcatdest = stateparam.categories.indexOf(myitemdest.category)
|
||||
|
||||
console.log('stateparam.categories', stateparam.categories)
|
||||
console.log('myitemdest', myitemdest)
|
||||
console.log('indcat', indcat, 'indcatdest', indcatdest, 'indorig', indorig)
|
||||
|
||||
if (indcatdest === -1) {
|
||||
stateparam.categories.push(myitemdest.category)
|
||||
const newindcat = stateparam.categories.indexOf(myitemdest.category)
|
||||
stateparam.todos[newindcat] = []
|
||||
indcatdest = newindcat
|
||||
}
|
||||
|
||||
stateparam.todos[indcat].splice(indorig, 1)
|
||||
stateparam.todos[indcatdest].push(myitemdest)
|
||||
|
||||
await Actions.actions.modify({ myitem: myitemdest, field: 'category' })
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
deletemyitem: b.commit(deletemyitem),
|
||||
createNewItem: b.commit(createNewItem)
|
||||
createNewItem: b.commit(createNewItem),
|
||||
movemyitem: b.commit(movemyitem)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -373,12 +398,42 @@ namespace Actions {
|
||||
|
||||
}
|
||||
|
||||
async function ActionCutPaste(context, action: IAction) {
|
||||
console.log('ActionCutPaste', action)
|
||||
|
||||
if (action.type === tools.MenuAction.CUT) {
|
||||
GlobalStore.state.lastaction = action
|
||||
} else if (action.type === tools.MenuAction.PASTE) {
|
||||
if (GlobalStore.state.lastaction.type === tools.MenuAction.CUT) {
|
||||
|
||||
// Change id_parent
|
||||
const orig_obj = Getters.getters.getRecordById(GlobalStore.state.lastaction._id, GlobalStore.state.lastaction.cat)
|
||||
// const dest = Getters.getters.getRecordById(action._id, action.cat)
|
||||
|
||||
console.log('action', action, 'orig_obj', orig_obj)
|
||||
|
||||
const dest_obj = tools.jsonCopy(orig_obj)
|
||||
|
||||
if (!!dest_obj) {
|
||||
dest_obj.category = action._id
|
||||
dest_obj.modified = true
|
||||
dest_obj.id_prev = null
|
||||
|
||||
GlobalStore.state.lastaction.type = 0
|
||||
|
||||
return await Mutations.mutations.movemyitem({ myitemorig: orig_obj, myitemdest: dest_obj })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
dbLoad: b.dispatch(dbLoad),
|
||||
swapElems: b.dispatch(swapElems),
|
||||
deleteItemtodo: b.dispatch(deleteItemtodo),
|
||||
dbInsert: b.dispatch(dbInsert),
|
||||
modify: b.dispatch(modify)
|
||||
modify: b.dispatch(modify),
|
||||
ActionCutPaste: b.dispatch(ActionCutPaste)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ export interface INotify {
|
||||
}
|
||||
|
||||
export const tools = {
|
||||
projects: 'projects',
|
||||
todos: 'todos',
|
||||
EMPTY: 0,
|
||||
CALLING: 10,
|
||||
OK: 20,
|
||||
@@ -365,8 +367,16 @@ export const tools = {
|
||||
menuPopupTodo:
|
||||
{
|
||||
it: [
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Taglia',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: '',
|
||||
value: 120, // PROGRESS_BAR
|
||||
icon: 'rowing',
|
||||
@@ -374,6 +384,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
disable: false,
|
||||
label: 'Imposta Priorità',
|
||||
value: 130, // PRIORITY
|
||||
icon: 'rowing',
|
||||
@@ -381,6 +392,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
disable: false,
|
||||
label: 'Completato',
|
||||
value: 110, // COMPLETED
|
||||
icon: 'check_circle',
|
||||
@@ -388,6 +400,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Imposta Scadenza',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -395,6 +408,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Elimina',
|
||||
value: 100, // DELETE
|
||||
icon: 'delete',
|
||||
@@ -403,8 +417,16 @@ export const tools = {
|
||||
],
|
||||
es:
|
||||
[
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Cortar',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: '',
|
||||
value: 120, // PROGRESS_BAR
|
||||
icon: 'rowing',
|
||||
@@ -412,6 +434,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
disable: false,
|
||||
label: 'Establecer Prioridad',
|
||||
value: 130, // PRIORITY
|
||||
icon: 'rowing',
|
||||
@@ -419,6 +442,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
disable: false,
|
||||
label: 'Completado',
|
||||
value: 110, // COMPLETED
|
||||
icon: 'check_circle',
|
||||
@@ -426,6 +450,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Establecer expiración',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -433,6 +458,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Borrar',
|
||||
value: 100, // DELETE
|
||||
icon: 'delete',
|
||||
@@ -441,8 +467,16 @@ export const tools = {
|
||||
],
|
||||
enUs:
|
||||
[
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Cut',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: '',
|
||||
value: 120, // PROGRESS_BAR
|
||||
icon: 'check_circle',
|
||||
@@ -450,6 +484,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
disable: false,
|
||||
label: 'Set Priority',
|
||||
value: 130, // PRIORITY
|
||||
icon: 'high_priority',
|
||||
@@ -457,6 +492,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
disable: false,
|
||||
label: 'Completed',
|
||||
value: 110, // COMPLETED
|
||||
icon: 'check_circle',
|
||||
@@ -464,6 +500,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Set Expiring',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -471,6 +508,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Delete',
|
||||
value: 100, // DELETE
|
||||
icon: 'trash',
|
||||
@@ -484,18 +522,21 @@ export const tools = {
|
||||
it: [
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Taglia',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Modifica',
|
||||
value: 160, // EDIT
|
||||
icon: 'create'
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Imposta Scadenza',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -503,6 +544,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Elimina',
|
||||
value: 100, // DELETE
|
||||
icon: 'delete',
|
||||
@@ -513,18 +555,21 @@ export const tools = {
|
||||
[
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Cortar',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Editar',
|
||||
value: 160, // EDIT
|
||||
icon: 'create'
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Establecer expiración',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -532,6 +577,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Borrar',
|
||||
value: 100, // DELETE
|
||||
icon: 'delete',
|
||||
@@ -542,18 +588,21 @@ export const tools = {
|
||||
[
|
||||
{
|
||||
id: 5,
|
||||
disable: false,
|
||||
label: 'Cut',
|
||||
value: 71, // CUT
|
||||
icon: 'undo'
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Edit',
|
||||
value: 160, // EDIT
|
||||
icon: 'create'
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
disable: false,
|
||||
label: 'Set Expiring',
|
||||
value: 101, // TOGGLE_EXPIRING
|
||||
icon: 'date_range',
|
||||
@@ -561,6 +610,7 @@ export const tools = {
|
||||
},
|
||||
{
|
||||
id: 50,
|
||||
disable: false,
|
||||
label: 'Delete',
|
||||
value: 100, // DELETE
|
||||
icon: 'trash',
|
||||
@@ -574,6 +624,7 @@ export const tools = {
|
||||
it: [
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Mostra Task',
|
||||
value: 150, // SHOW_TASK
|
||||
icon: 'rowing'
|
||||
@@ -583,6 +634,7 @@ export const tools = {
|
||||
[
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Mostrar Tareas',
|
||||
value: 150,
|
||||
icon: 'rowing'
|
||||
@@ -592,6 +644,7 @@ export const tools = {
|
||||
[
|
||||
{
|
||||
id: 10,
|
||||
disable: false,
|
||||
label: 'Show Task',
|
||||
value: 150,
|
||||
icon: 'rowing'
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
if (myaction.table === tools.projects)
|
||||
return await Projects.actions.ActionCutPaste(myaction)
|
||||
else if (myaction.table === tools.todos)
|
||||
return await Todos.actions.ActionCutPaste(myaction)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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')">
|
||||
|
||||
Reference in New Issue
Block a user