diff --git a/cateditor/src/components/CatalogContents.vue b/cateditor/src/components/CatalogContents.vue index 9a205dd..7e5e636 100644 --- a/cateditor/src/components/CatalogContents.vue +++ b/cateditor/src/components/CatalogContents.vue @@ -80,7 +80,7 @@ info - + delete @@ -134,6 +134,7 @@ + @@ -150,6 +151,7 @@ import AddSectionDialog from './AddSectionDialog' import SectionInfoDialog from './SectionInfoDialog' import SectionDeleteDialog from './SectionDeleteDialog' import ModelInfoDialog from './ModelInfoDialog' +import ModelDeleteDialog from './ModelDeleteDialog' export default { components: { @@ -159,6 +161,7 @@ export default { SectionInfoDialog, SectionDeleteDialog, ModelInfoDialog, + ModelDeleteDialog, //RawDisplayer, }, @@ -168,6 +171,7 @@ export default { showSectionInfoDialog: false, showSectionDeleteDialog: false, showModelInfoDialog: false, + showModelDeleteDialog: false, }), computed: { ...mapState([ @@ -262,6 +266,11 @@ export default { this.showModelInfoDialog = true }, + popModelDelete(id) { + this.selectModel(id) + this.showModelDeleteDialog = true + }, + ...mapActions([ 'selectSection', 'selectModel', diff --git a/cateditor/src/components/ModelDeleteDialog.vue b/cateditor/src/components/ModelDeleteDialog.vue new file mode 100644 index 0000000..7a44aaf --- /dev/null +++ b/cateditor/src/components/ModelDeleteDialog.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/cateditor/src/pages/editor/store/index.js b/cateditor/src/pages/editor/store/index.js index 054c047..900a4a8 100644 --- a/cateditor/src/pages/editor/store/index.js +++ b/cateditor/src/pages/editor/store/index.js @@ -326,6 +326,13 @@ export const store = new Vuex.Store({ commit('setModelName', payload) }, + deleteSectionModel({ commit, getters }, { section, model }) { + let models = getters.sectionModels(section) + models = models.filter(m => m.model !== model.model) + let pages = paginateModels(models) + commit('setSectionPages', { section: section, pages: pages }) + }, + setModelMaterials({ commit }, payload) { commit('setModelMaterials', payload) },