Merge branch 'main' of https://git.tueit.de/jo.kuehner/TueIT_App into main
This commit is contained in:
295
plugins/vuex.js
295
plugins/vuex.js
@ -3,10 +3,15 @@ import { createStore } from "vuex";
|
||||
const store = createStore({
|
||||
state() {
|
||||
return {
|
||||
assetEditable: false,
|
||||
assetFiltered: false,
|
||||
assetSearchable: false,
|
||||
deleteAsset: false,
|
||||
editable: false,
|
||||
filtered: false,
|
||||
searchable: false,
|
||||
deleteBool: false,
|
||||
new: false,
|
||||
customerChanged: false,
|
||||
changedCustomerId: -1,
|
||||
filteredByCustomer: '',
|
||||
|
||||
onAssetlist: true,
|
||||
onCustomerAssetlist: false,
|
||||
onAsset: false,
|
||||
@ -36,20 +41,77 @@ const store = createStore({
|
||||
newSoftware: '',
|
||||
newVersion: '',
|
||||
newLicense: '',
|
||||
|
||||
onTemplatelist: true,
|
||||
onCustomerTemplatelist: false,
|
||||
onTemplate: false,
|
||||
onInstancelist: false,
|
||||
onInstance: false,
|
||||
|
||||
newNamePOT: '',
|
||||
newCustomerIDPOT: '',
|
||||
newCustomerPOT: '',
|
||||
newLastViewPOT: '',
|
||||
newUserPOT: '',
|
||||
newDescriptionPOT: '',
|
||||
newNotesPOT: '',
|
||||
chosenPOTId: -1,
|
||||
|
||||
newNameMVT: '',
|
||||
newCustomerIDMVT: '',
|
||||
newCustomerMVT: '',
|
||||
newLastViewMVT: '',
|
||||
newUserMVT: '',
|
||||
newTypeMVT: '',
|
||||
newNotesMVT: '',
|
||||
chosenMVTId: -1,
|
||||
|
||||
onSolutionlist: true,
|
||||
onCustomerSolutionlist: false,
|
||||
onSolution: false,
|
||||
chosenSolutionId: -1,
|
||||
newSolutionNameSol: '',
|
||||
newCustomerIDSol: '',
|
||||
newCustomerSol: '',
|
||||
newAssetNameSol: '',
|
||||
newTypeSol: '',
|
||||
newLastViewSol: '',
|
||||
newUserSol: '',
|
||||
newDescriptionSol: '',
|
||||
newNotesSol: '',
|
||||
};
|
||||
},
|
||||
mutations: {
|
||||
toggleEditableAsset(state) {
|
||||
state.assetEditable = !state.assetEditable
|
||||
// functions to toggle with the actionbar
|
||||
toggleEditable(state) {
|
||||
state.editable = !state.editable
|
||||
},
|
||||
toggleFilteredAsset(state) {
|
||||
if (state.assetFiltered == false) {
|
||||
state.assetFiltered = true
|
||||
state.assetSearchable = false
|
||||
toggleFiltered(state) {
|
||||
if (state.filtered == false) {
|
||||
state.filtered = true
|
||||
state.searchable = false
|
||||
} else {
|
||||
state.assetFiltered = false
|
||||
state.filtered = false
|
||||
}
|
||||
},
|
||||
toggleSearchable(state) {
|
||||
if (state.searchable == false) {
|
||||
state.searchable = true
|
||||
state.filtered = false
|
||||
} else {
|
||||
state.searchable = false
|
||||
}
|
||||
state.filteredByCustomer = ''
|
||||
},
|
||||
toggleCustomerChanged(state) {
|
||||
state.customerChanged = !state.customerChanged
|
||||
},
|
||||
toggleCustomerId(state, id) {
|
||||
state.changedCustomerId = id
|
||||
},
|
||||
|
||||
|
||||
// functions to change the asset pages
|
||||
changeToAssetlist(state) {
|
||||
state.onAssetlist = true
|
||||
state.onCustomerAssetlist = false
|
||||
@ -107,6 +169,35 @@ const store = createStore({
|
||||
state.newSoftware = ''
|
||||
state.newVersion = ''
|
||||
state.newLicense = ''
|
||||
|
||||
// functions to change the production order and maintenance visit pages
|
||||
changeToTemplatelist(state) {
|
||||
state.onTemplatelist = true
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
changeToCustomerTemplatelist(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = true
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
changeToTemplate(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = true
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
changeToInstancelist(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = true
|
||||
state.onInstance = false
|
||||
},
|
||||
doDeleteAsset(state) {
|
||||
state.deleteAsset = true
|
||||
@ -136,6 +227,25 @@ const store = createStore({
|
||||
state.onAsset = true
|
||||
state.onSolutionlistAsset = false
|
||||
},
|
||||
|
||||
// functions to change the solution pages
|
||||
changeToSolutionlist(state) {
|
||||
state.onSolutionlist = true
|
||||
state.onCustomerSolutionlist = false
|
||||
state.onSolution = false
|
||||
},
|
||||
changeToCustomerSolutionlist(state) {
|
||||
state.onSolutionlist = false
|
||||
state.onCustomerSolutionlist = true
|
||||
state.onSolution = false
|
||||
},
|
||||
changeToSolution(state) {
|
||||
state.onSolutionlist = false
|
||||
state.onCustomerSolutionlist = false
|
||||
state.onSolution = true
|
||||
},
|
||||
|
||||
// functions to update the asset
|
||||
updateAssetComponent(state, asset) {
|
||||
state.newAssetName = asset.assetName
|
||||
state.newCustomerID = asset.customerId
|
||||
@ -161,7 +271,168 @@ const store = createStore({
|
||||
state.newSoftware = asset.software
|
||||
state.newVersion = asset.version
|
||||
state.newLicense = asset.license
|
||||
}
|
||||
},
|
||||
|
||||
// functions to update the production order template
|
||||
updateProductionOrderTemplateComponent(state, pot) {
|
||||
state.newNamePOT = pot.name
|
||||
state.newCustomerIDPOT = pot.customerId
|
||||
state.newCustomerPOT = pot.customer
|
||||
state.newUserPOT = pot.user
|
||||
state.newDescriptionPOT = pot.description
|
||||
state.newNotesPOT = pot.notes
|
||||
},
|
||||
|
||||
// functions to update the maintenance visit template
|
||||
updateMaintenanceVisitTemplateComponent(state, mvt) {
|
||||
state.newNameMVT = mvt.name
|
||||
state.newCustomerIDMVT = mvt.customerId
|
||||
state.newCustomerMVT = mvt.customer
|
||||
state.newUserMVT = mvt.user
|
||||
state.newTypeMVT = mvt.type
|
||||
state.newNotesMVT = mvt.notes
|
||||
},
|
||||
|
||||
// functions to update the solution
|
||||
updateSolutionComponent(state, sol) {
|
||||
state.newSolutionNameSol = sol.solutionName
|
||||
state.newCustomerIDSol = sol.customerId
|
||||
state.newCustomerSol = sol.customer
|
||||
state.newAssetNameSol = sol.assetName
|
||||
state.newLastViewSol = sol.lastView
|
||||
state.newTypeSol = sol.type
|
||||
state.newDescriptionSol = sol.description
|
||||
state.newNotesSol = sol.notes
|
||||
state.newUserSol = sol.user
|
||||
},
|
||||
|
||||
// function to set the chosen asset
|
||||
setChosenAsset(state, id) {
|
||||
state.chosenAssetId = id
|
||||
},
|
||||
|
||||
// function to set the chosen production order template
|
||||
setChosenPOT(state, id) {
|
||||
state.chosenPOTId = id
|
||||
},
|
||||
|
||||
// function to set the chosen maintenance visit template
|
||||
setChosenMVT(state, id) {
|
||||
state.chosenMVTId = id
|
||||
},
|
||||
|
||||
// function to set the chosen solution
|
||||
setChosenSolution(state, id) {
|
||||
state.chosenSolutionId = id
|
||||
},
|
||||
|
||||
// function to reset the pages
|
||||
resetStore(state) {
|
||||
state.editable = false
|
||||
state.filtered = false
|
||||
state.searchable = false
|
||||
state.deleteBool = false
|
||||
state.chosenAssetId = -1
|
||||
state.filteredByCustomer = ''
|
||||
state.new = false
|
||||
state.customerChanged = false
|
||||
state.changedCustomerId = -1
|
||||
|
||||
// reset the asset page variables
|
||||
state.newAssetName = ''
|
||||
state.newCustomerID = ''
|
||||
state.newCustomer = ''
|
||||
state.newLocation = ''
|
||||
state.newRemoteLocation = ''
|
||||
state.newType = ''
|
||||
state.newDescription = ''
|
||||
state.newNotes = ''
|
||||
state.newState = ''
|
||||
state.newLastView = ''
|
||||
state.newUser = ''
|
||||
state.hardwareBool = false
|
||||
state.newModel = ''
|
||||
state.newSerialnumber = ''
|
||||
state.newCPU = ''
|
||||
state.newRAM = ''
|
||||
state.newStorageConfiguration = ''
|
||||
state.newMiscellaneous = ''
|
||||
state.softwareBool = false
|
||||
state.newSoftware = ''
|
||||
state.newVersion = ''
|
||||
state.newLicense = ''
|
||||
|
||||
// reset the production order template page variables
|
||||
state.newNamePOT = ''
|
||||
state.newCustomerIDPOT = ''
|
||||
state.newCustomerPOT = ''
|
||||
state.newUserPOT = ''
|
||||
state.newDescriptionPOT = ''
|
||||
state.newNotesPOT = ''
|
||||
state.newLastViewPOT = ''
|
||||
state.chosenPOTId = -1
|
||||
|
||||
// reset the maintenance visit template page variables
|
||||
state.newNameMVT = ''
|
||||
state.newCustomerIDMVT = ''
|
||||
state.newCustomerMVT = ''
|
||||
state.newUserMVT = ''
|
||||
state.newTypeMVT = ''
|
||||
state.newNotesMVT = ''
|
||||
state.newLastViewMVT = ''
|
||||
state.chosenMVTId = -1
|
||||
|
||||
// reset the solution page variables
|
||||
state.newSolutionNameSol = ''
|
||||
state.newCustomerIDSol = ''
|
||||
state.newCustomerSol = ''
|
||||
state.newAssetNameSol = ''
|
||||
state.newLastViewSol = ''
|
||||
state.newTypeSol = ''
|
||||
state.newDescriptionSol = ''
|
||||
state.newNotesSol = ''
|
||||
state.newUserSol = ''
|
||||
state.chosenSolutionId = -1
|
||||
},
|
||||
|
||||
// functions to (undo) delete an asset
|
||||
doDelete(state) {
|
||||
state.deleteBool = true
|
||||
},
|
||||
undoDelete(state) {
|
||||
state.deleteBool = false
|
||||
},
|
||||
|
||||
// function to update the asset filter
|
||||
updateFilterbyCustomer(state, client) {
|
||||
state.filteredByCustomer = client
|
||||
},
|
||||
|
||||
// function to get to the add page
|
||||
add(state) {
|
||||
state.new = true
|
||||
state.editable = false
|
||||
state.filtered = false
|
||||
state.searchable = false
|
||||
|
||||
// set the asset variables
|
||||
state.onAssetlist = false
|
||||
state.onCustomerAssetlist = false
|
||||
state.onAsset = true
|
||||
state.onSolutionlistAsset = false
|
||||
|
||||
// set the production order and maintenance visit variables
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = true
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
|
||||
// set the solution variables
|
||||
state.onSolutionlist = false
|
||||
state.onCustomerSolutionlist = false
|
||||
state.onSolution = true
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user