basic functionality pot implemented
This commit is contained in:
246
plugins/vuex.js
246
plugins/vuex.js
@ -3,17 +3,18 @@ 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,
|
||||
filteredByClient: '',
|
||||
|
||||
onAssetlist: true,
|
||||
onCustomerAssetlist: false,
|
||||
onAsset: false,
|
||||
onSolutionlistAsset: false,
|
||||
chosenAssetId: -1,
|
||||
filteredAssetbyClient: '',
|
||||
newAsset: false,
|
||||
newAssetName: '',
|
||||
newCustomerID: '',
|
||||
newCustomer: '',
|
||||
@ -36,20 +37,47 @@ 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,
|
||||
|
||||
};
|
||||
},
|
||||
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.filteredByClient = ''
|
||||
},
|
||||
|
||||
// functions to change the asset pages
|
||||
changeToAssetlist(state) {
|
||||
state.onAssetlist = true
|
||||
state.onCustomerAssetlist = false
|
||||
@ -74,68 +102,45 @@ const store = createStore({
|
||||
state.onAsset = false
|
||||
state.onSolutionlistAsset = true
|
||||
},
|
||||
setChosenAsset(state, id) {
|
||||
state.chosenAssetId = id
|
||||
|
||||
// functions to change the production order pages
|
||||
changeToTemplatelist(state) {
|
||||
state.onTemplatelist = true
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
resetAssetStore(state) {
|
||||
state.assetEditable = false
|
||||
state.assetFiltered = false
|
||||
state.assetSearchable = false
|
||||
state.deleteAsset = false
|
||||
state.chosenAssetId = -1
|
||||
state.filteredAssetbyClient = ''
|
||||
state.newAsset = false
|
||||
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 = ''
|
||||
changeToCustomerTemplatelist(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = true
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
doDeleteAsset(state) {
|
||||
state.deleteAsset = true
|
||||
changeToTemplate(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = true
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
undoDeleteAsset(state) {
|
||||
state.deleteAsset = false
|
||||
changeToInstancelist(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = true
|
||||
state.onInstance = false
|
||||
},
|
||||
updateAssetFilterbyClient(state, client) {
|
||||
state.filteredAssetbyClient = client
|
||||
},
|
||||
toggleAssetSearchable(state) {
|
||||
if (state.assetSearchable == false) {
|
||||
state.assetSearchable = true
|
||||
state.assetFiltered = false
|
||||
} else {
|
||||
state.assetSearchable = false
|
||||
}
|
||||
state.filteredAssetbyClient = ''
|
||||
},
|
||||
addNewAsset(state) {
|
||||
state.newAsset = true
|
||||
state.assetEditable = false
|
||||
state.assetFiltered = false
|
||||
state.assetSearchable = false
|
||||
state.onAssetlist = false
|
||||
state.onCustomerAssetlist = false
|
||||
state.onAsset = true
|
||||
state.onSolutionlistAsset = false
|
||||
changeToInstance(state) {
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = false
|
||||
state.onInstancelist = false
|
||||
state.onInstance = true
|
||||
},
|
||||
|
||||
// functions to update the asset
|
||||
updateAssetComponent(state, asset) {
|
||||
state.newAssetName = asset.assetName
|
||||
state.newCustomerID = asset.customerId
|
||||
@ -161,7 +166,106 @@ 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
|
||||
},
|
||||
|
||||
// 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 reset the pages
|
||||
resetStore(state) {
|
||||
state.editable = false
|
||||
state.filtered = false
|
||||
state.searchable = false
|
||||
state.deleteBool = false
|
||||
state.chosenAssetId = -1
|
||||
state.filteredByClient = ''
|
||||
state.new = false
|
||||
|
||||
// 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 = false
|
||||
state.newDescriptionPOT = ''
|
||||
state.newNotesPOT = ''
|
||||
state.newLastViewPOT = ''
|
||||
},
|
||||
|
||||
// functions to (undo) delete an asset
|
||||
doDelete(state) {
|
||||
state.deleteBool = true
|
||||
},
|
||||
undoDelete(state) {
|
||||
state.deleteBool = false
|
||||
},
|
||||
|
||||
// function to update the asset filter
|
||||
updateFilterbyClient(state, client) {
|
||||
state.filteredByClient = 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 variables
|
||||
state.onTemplatelist = false
|
||||
state.onCustomerTemplatelist = false
|
||||
state.onTemplate = true
|
||||
state.onInstancelist = false
|
||||
state.onInstance = false
|
||||
},
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user