refator: 将脑图整体布局保存在浏览器端

This commit is contained in:
chenjianxing 2021-04-29 16:55:08 +08:00 committed by jianxing
parent e6a9556e47
commit afe37b3f86
5 changed files with 23 additions and 1 deletions

View File

@ -50,7 +50,7 @@
"vue-float-action-button": "^0.6.6",
"vue-i18n": "^8.15.3",
"vue-jsonpath-picker": "^1.1.5",
"vue-minder-editor-plus": "^1.0.23",
"vue-minder-editor-plus": "^1.0.24",
"vue-papa-parse": "^2.0.0",
"vue-pdf": "^4.2.0",
"vue-router": "^3.1.3",

View File

@ -11,7 +11,9 @@
:tag-edit-check="tagEditCheck"
:priority-disable-check="priorityDisableCheck"
:distinct-tags="distinctTags"
:default-mold="minderModel"
@afterMount="$emit('afterMount')"
@moldChange="handleMoldChange"
@save="save"
/>
</div>
@ -25,6 +27,7 @@ export default {
name: "MsModuleMinder",
components: {MsFullScreenButton},
props: {
minderKey: String,
treeNodes: {
type: Array,
default() {
@ -98,7 +101,23 @@ export default {
})
}
},
computed: {
minderModel() {
if (this.minderKey) {
let model = localStorage.getItem(this.minderKey + 'minderModel');
if (model) {
return Number.parseInt(model);
}
}
return 3;
}
},
methods: {
handleMoldChange(index) {
if (this.minderKey) {
localStorage.setItem(this.minderKey + 'minderModel', index);
}
},
save(data) {
this.$emit('save', data)
},

View File

@ -4,6 +4,7 @@
:tree-nodes="treeNodes"
:data-map="dataMap"
:tags="tags"
minder-key="testCase"
:select-node="selectNode"
:distinct-tags="tags"
:tag-edit-check="tagEditCheck()"

View File

@ -5,6 +5,7 @@
:data-map="dataMap"
:tags="tags"
:tag-enable="true"
minder-key="testPlan"
:select-node="selectNode"
:distinct-tags="[...tags, this.$t('test_track.plan.plan_status_prepare')]"
@afterMount="handleAfterMount"

View File

@ -5,6 +5,7 @@
:data-map="dataMap"
:tags="tags"
:tag-enable="true"
minder-key="testReview"
:select-node="selectNode"
:distinct-tags="[...tags, $t('test_track.plan.plan_status_prepare')]"
@afterMount="handleAfterMount"