SelectionMixin.js: fix whitespace to eslint settings
This commit is contained in:
@ -1,72 +1,72 @@
|
|||||||
const SelectionMixin = { // eslint-disable-line no-unused-vars
|
const SelectionMixin = { // eslint-disable-line no-unused-vars
|
||||||
computed: {
|
computed: {
|
||||||
selectedSectionID: {
|
selectedSectionID: {
|
||||||
get () {
|
get() {
|
||||||
return this.$store.getters.SELECTED_SECTION_ID
|
return this.$store.getters.SELECTED_SECTION_ID
|
||||||
},
|
},
|
||||||
set (value) {
|
set(value) {
|
||||||
this.$store.dispatch('SET_SELECTED_SECTION_ID', value)
|
this.$store.dispatch('SET_SELECTED_SECTION_ID', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedFamilyID: {
|
selectedFamilyID: {
|
||||||
get () {
|
get() {
|
||||||
return this.$store.getters.SELECTED_FAMILY_ID
|
return this.$store.getters.SELECTED_FAMILY_ID
|
||||||
},
|
},
|
||||||
set (value) {
|
set(value) {
|
||||||
this.$store.dispatch('SET_SELECTED_FAMILY_ID', value)
|
this.$store.dispatch('SET_SELECTED_FAMILY_ID', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedModelID: {
|
selectedModelID: {
|
||||||
get () {
|
get() {
|
||||||
return this.$store.getters.SELECTED_MODEL_ID
|
return this.$store.getters.SELECTED_MODEL_ID
|
||||||
},
|
},
|
||||||
set (value) {
|
set(value) {
|
||||||
this.$store.dispatch('SET_SELECTED_MODEL_ID', value)
|
this.$store.dispatch('SET_SELECTED_MODEL_ID', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedMaterial: {
|
selectedMaterial: {
|
||||||
get () {
|
get() {
|
||||||
return this.$store.getters.SELECTED_MATERIAL_ID
|
return this.$store.getters.SELECTED_MATERIAL_ID
|
||||||
},
|
},
|
||||||
set (value) {
|
set(value) {
|
||||||
this.$store.dispatch('SET_SELECTED_MATERIAL_ID', value)
|
this.$store.dispatch('SET_SELECTED_MATERIAL_ID', value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectSection: function (id) {
|
selectSection: function(id) {
|
||||||
this.selectedSectionID = id
|
this.selectedSectionID = id
|
||||||
// this.selectedFamilyID = null
|
// this.selectedFamilyID = null
|
||||||
// this.selectedModelID = null
|
// this.selectedModelID = null
|
||||||
// this.selectedMaterial = null
|
// this.selectedMaterial = null
|
||||||
},
|
},
|
||||||
selectFamily: function (id) {
|
selectFamily: function(id) {
|
||||||
this.selectedFamilyID = id
|
this.selectedFamilyID = id
|
||||||
// this.selectedModelID = null
|
// this.selectedModelID = null
|
||||||
// this.selectedMaterial = null
|
// this.selectedMaterial = null
|
||||||
},
|
},
|
||||||
selectModel: function (id) {
|
selectModel: function(id) {
|
||||||
this.selectedModelID = id
|
this.selectedModelID = id
|
||||||
// this.selectedFamilyID = null
|
// this.selectedFamilyID = null
|
||||||
// this.selectedMaterial = null
|
// this.selectedMaterial = null
|
||||||
},
|
},
|
||||||
selectMaterial: function (id) {
|
selectMaterial: function(id) {
|
||||||
this.selectedMaterial = id
|
this.selectedMaterial = id
|
||||||
},
|
},
|
||||||
selectedFamilies: function () {
|
selectedFamilies: function() {
|
||||||
let section = this.$store.getters.CAT_SECTION(this.selectedSectionID)
|
let section = this.$store.getters.CAT_SECTION(this.selectedSectionID)
|
||||||
let ids = this.sectionIDs(section)
|
let ids = this.sectionIDs(section)
|
||||||
let materials = this.findMaterials(ids)
|
let materials = this.findMaterials(ids)
|
||||||
return this.makeFamilies(materials)
|
return this.makeFamilies(materials)
|
||||||
},
|
},
|
||||||
selectedFamily: function () {
|
selectedFamily: function() {
|
||||||
let families = this.selectedFamilies()
|
let families = this.selectedFamilies()
|
||||||
return families.find(s => s.id === this.selectedFamilyID)
|
return families.find(s => s.id === this.selectedFamilyID)
|
||||||
},
|
},
|
||||||
sectionIDs: function (section) {
|
sectionIDs: function(section) {
|
||||||
let ids = []
|
let ids = []
|
||||||
|
|
||||||
if (section !== undefined) {
|
if (section) {
|
||||||
for (let page of section.pages) {
|
for (let page of section.pages) {
|
||||||
for (let block of page) {
|
for (let block of page) {
|
||||||
ids.push(...block.ids)
|
ids.push(...block.ids)
|
||||||
@ -76,10 +76,10 @@ const SelectionMixin = { // eslint-disable-line no-unused-vars
|
|||||||
|
|
||||||
return ids
|
return ids
|
||||||
},
|
},
|
||||||
findMaterials: function (ids) {
|
findMaterials: function(ids) {
|
||||||
return ids.map(id => this.$store.getters.MATERIAL(id))
|
return ids.map(id => this.$store.getters.MATERIAL(id))
|
||||||
},
|
},
|
||||||
makeFamilies: function (materials) {
|
makeFamilies: function(materials) {
|
||||||
let families = []
|
let families = []
|
||||||
|
|
||||||
for (let mat of materials) {
|
for (let mat of materials) {
|
||||||
@ -102,7 +102,7 @@ const SelectionMixin = { // eslint-disable-line no-unused-vars
|
|||||||
|
|
||||||
return families
|
return families
|
||||||
},
|
},
|
||||||
uniquify: function (arr) {
|
uniquify: function(arr) {
|
||||||
return [...new Set(arr)]
|
return [...new Set(arr)]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user