diff --git a/cateditor/src/components/CatalogContents.vue b/cateditor/src/components/CatalogContents.vue index 9c498f9..eb9a4ef 100644 --- a/cateditor/src/components/CatalogContents.vue +++ b/cateditor/src/components/CatalogContents.vue @@ -38,7 +38,7 @@ - + info @@ -131,6 +131,7 @@ + @@ -144,18 +145,21 @@ import { paginateModels } from '@/pagination' import DragListHeading from './DragListHeading' import AddProductDialog from './AddProductDialog' import AddSectionDialog from './AddSectionDialog' +import SectionInfoDialog from './SectionInfoDialog' export default { components: { DragListHeading, AddProductDialog, AddSectionDialog, + SectionInfoDialog, //RawDisplayer, }, data: () => ({ showAddProductDialog: false, - showAddSectionDialog: true, + showAddSectionDialog: false, + showSectionInfoDialog: false, }), computed: { ...mapState([ @@ -184,11 +188,6 @@ export default { }, methods: { - selectSection(id) { - console.log('select section', id) - this.$store.dispatch('selectSection', id) - }, - selectModel(id) { console.log('select model', id) this.$store.dispatch('selectModel', id) @@ -245,7 +244,13 @@ export default { this.setModelMaterials({ model: this.selectedModel, materials: mats }) }, + popSectionInfo(id) { + this.selectSection(id) + this.showSectionInfoDialog = true + }, + ...mapActions([ + 'selectSection', 'reorderSection', 'setSectionPages', 'setModelMaterials', diff --git a/cateditor/src/components/SectionInfoDialog.vue b/cateditor/src/components/SectionInfoDialog.vue index 72d7c08..38d3211 100644 --- a/cateditor/src/components/SectionInfoDialog.vue +++ b/cateditor/src/components/SectionInfoDialog.vue @@ -2,17 +2,16 @@
- - Section Info - - close - + + + clear + + - - - + {{sectionModelCount}} {{sectionModelCount | pluralize('model') }}
+ {{sectionMaterialCount}} {{sectionMaterialCount | pluralize('material') }}
@@ -26,41 +25,80 @@ diff --git a/cateditor/src/pages/editor/store/index.js b/cateditor/src/pages/editor/store/index.js index f6cd53a..ea5af4d 100644 --- a/cateditor/src/pages/editor/store/index.js +++ b/cateditor/src/pages/editor/store/index.js @@ -11,7 +11,6 @@ export const store = new Vuex.Store({ catalog: null, materials: {}, selectedSectionID: null, - //selectedFamilyID: null, selectedModelID: null, selectedMaterial: null, loadingCatalog: false, @@ -190,6 +189,10 @@ export const store = new Vuex.Store({ state.catalog.sections.push(section) }, + setSectionName(state, { section, name }) { + section.name = name + }, + reorderSection(state, { from, to }) { if (from === to) return state.catalog.sections = arrayMove(state.catalog.sections, from, to) @@ -293,6 +296,10 @@ export const store = new Vuex.Store({ commit('addSection', section) }, + setSectionName({ commit }, payload) { + commit('setSectionName', payload) + }, + reorderSection({ commit }, payload) { commit('reorderSection', payload) },