cateditor: fix setting model name
This commit is contained in:
@ -52,8 +52,9 @@ export default {
|
|||||||
return model ? model.name : '(none)'
|
return model ? model.name : '(none)'
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
|
var section = this.selectedSection()
|
||||||
var model = this.selectedModel()
|
var model = this.selectedModel()
|
||||||
this.setModelName({ model: model, name: value })
|
this.setModelName({ section: section, model: model, name: value })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
|
'selectedSection',
|
||||||
'selectedModel',
|
'selectedModel',
|
||||||
]),
|
]),
|
||||||
...mapActions([
|
...mapActions([
|
||||||
|
|||||||
@ -158,8 +158,15 @@ export const store = new Vuex.Store({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setModelName(state, { model, name }) {
|
setModelName(state, { section, model, name }) {
|
||||||
model.name = name
|
let catSection = state.catalog.sections.find(s => s.id === section.id)
|
||||||
|
for (let catPage of catSection.pages) {
|
||||||
|
for (let catModel of catPage) {
|
||||||
|
if (catModel.model === model.model) {
|
||||||
|
catModel.name = name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
addMaterialsToLibrary(state, materials) {
|
addMaterialsToLibrary(state, materials) {
|
||||||
|
|||||||
Reference in New Issue
Block a user