|
@@ -35,7 +35,7 @@
|
|
|
<!-- 拖拽图标 -->
|
|
|
<i ref="drag-group" class="drag-icon iconfont icon-editor_folder_off folder_collapsed"></i>
|
|
|
<i v-if="data.type == 'group' && expandedNodes.includes(data.id)" class="iconfont icon-editor_folder_on folder_expanded"></i>
|
|
|
- <span v-if="reNameId != data.id"> {{ data.name }}</span>
|
|
|
+ <span v-if="reNameId != data.id"> {{ fixTitle(data.name) }}</span>
|
|
|
<input
|
|
|
ref="reNameInput"
|
|
|
v-model.trim="data.name"
|
|
@@ -193,7 +193,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // console.error("保存后", this.$refs.sceneTree.store.nodesMap);
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -261,12 +260,24 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
ossImagePreviewUrlSuffix,
|
|
|
-
|
|
|
+ fixTitle(name) {
|
|
|
+ if (name == "默认二级分组") {
|
|
|
+ name = this.$i18n.t("navigation.default_group_two");
|
|
|
+ } else if (name == "一级分组") {
|
|
|
+ name = this.$i18n.t("navigation.group_one");
|
|
|
+ } else if (name == "二级分组") {
|
|
|
+ name = this.$i18n.t("navigation.group_two");
|
|
|
+ } else {
|
|
|
+ // eslint-disable-next-line no-self-assign
|
|
|
+ name = name;
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+ },
|
|
|
handleNodeExpand(data, node, instance) {
|
|
|
console.log("节点展开", data);
|
|
|
// 当节点展开时,将其id添加到数组中
|
|
|
this.expandedNodes.push(data.id);
|
|
|
- console.error(this.expandedNodes);
|
|
|
+
|
|
|
|
|
|
this.nodesMap = {};
|
|
|
for (let key in this.$refs.sceneTree.store.nodesMap) {
|
|
@@ -280,7 +291,6 @@ export default {
|
|
|
if (index !== -1) {
|
|
|
this.expandedNodes.splice(index, 1);
|
|
|
}
|
|
|
- console.error(this.expandedNodes);
|
|
|
this.nodesMap = {};
|
|
|
for (let key in this.$refs.sceneTree.store.nodesMap) {
|
|
|
this.nodesMap[key] = this.$refs.sceneTree.store.nodesMap[key];
|
|
@@ -301,7 +311,7 @@ export default {
|
|
|
if (!this.timer) {
|
|
|
if (dropNode.data.type == "group" && dropNode.data.children.length && !dropNode.expanded) {
|
|
|
this.timer = setTimeout(() => {
|
|
|
- console.error("可以展开");
|
|
|
+ // console.error("可以展开");
|
|
|
dropNode.expanded = true;
|
|
|
this.clearTimer();
|
|
|
}, 1000);
|
|
@@ -406,7 +416,6 @@ export default {
|
|
|
this.isShowSelectionWindow = true;
|
|
|
},
|
|
|
onSubmitFromMaterialSelector(selected) {
|
|
|
- console.error(this.insertTag);
|
|
|
let changeListLength = this.insertTag.children.length || 0;
|
|
|
let newScenes = [];
|
|
|
let roundId = new Date().getTime();
|
|
@@ -449,8 +458,6 @@ export default {
|
|
|
}
|
|
|
changeListLength++;
|
|
|
}
|
|
|
- console.error(newScenes);
|
|
|
- console.error(this.sceneList);
|
|
|
|
|
|
let allSuccess = true;
|
|
|
newScenes.forEach((item, i) => {
|
|
@@ -504,7 +511,6 @@ export default {
|
|
|
// });
|
|
|
},
|
|
|
onInputNewNameComplete(data) {
|
|
|
- console.error(data.name);
|
|
|
if (this.inputData.name.trim() == "") {
|
|
|
// data.name = this.backUpName;
|
|
|
// data.name = data.name;
|
|
@@ -542,7 +548,6 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- console.error(node, data);
|
|
|
|
|
|
if (this.info.navigationTrees.length == 1 && node.level == 1) {
|
|
|
this.$alert({
|
|
@@ -583,7 +588,7 @@ export default {
|
|
|
|
|
|
//如果删除当前选择的分组
|
|
|
if (data.id == this.currentRootId || data.id == this.currentSecondId) {
|
|
|
- console.error("如果删除当前选择的分组");
|
|
|
+ // console.error("如果删除当前选择的分组");
|
|
|
this.$store.commit("navigation/setData", { currentRootId: null, currentSecondId: null });
|
|
|
|
|
|
let firstScene = null;
|
|
@@ -594,7 +599,7 @@ export default {
|
|
|
firstScene = this.sceneList[0];
|
|
|
}
|
|
|
if (!this.currentRootId && !this.currentSecondId) {
|
|
|
- console.error("初始化");
|
|
|
+ // console.error("初始化");
|
|
|
// this.$store.commit("scene/setCurrentScene", firstScene);
|
|
|
let activeScene = null;
|
|
|
this.info.navigationTrees.forEach((item, index) => {
|
|
@@ -644,7 +649,6 @@ export default {
|
|
|
level: data ? 1 : 0,
|
|
|
children: [],
|
|
|
};
|
|
|
- console.error(group);
|
|
|
if (data) {
|
|
|
// if (data.children.length && data.children[0].type != "group") {
|
|
|
// //新增子目录的时候,如果目录里面没有子目录,新增一个默认目录包含旧数据
|
|
@@ -683,7 +687,6 @@ export default {
|
|
|
case "add":
|
|
|
if (panoList.length && groupList.length) {
|
|
|
//新增目录到二级目录。且二级目录只有场景的时候
|
|
|
- console.error("add");
|
|
|
let list = [];
|
|
|
let defaultDir = {
|
|
|
id: "add_" + (this.getRoundId() + 1),
|
|
@@ -716,7 +719,7 @@ export default {
|
|
|
|
|
|
break;
|
|
|
case "del":
|
|
|
- if (groupList.length == 1 && !panoList.length && groupList[0].children.length) {
|
|
|
+ if (groupList.length == 1 && !panoList.length && groupList[0].children.length && groupList[0].name == "默认二级分组") {
|
|
|
//当只有一个二级目录,二级目录有场景
|
|
|
item.children = groupList[0].children;
|
|
|
}
|
|
@@ -730,7 +733,6 @@ export default {
|
|
|
case "drag":
|
|
|
if (panoList.length && groupList.length) {
|
|
|
//新增目录到二级目录。且二级目录只有场景的时候
|
|
|
- console.error("drag");
|
|
|
let list = [];
|
|
|
let defaultDir = {
|
|
|
id: "add_" + (this.getRoundId() + 1),
|
|
@@ -743,7 +745,6 @@ export default {
|
|
|
list.push(defaultDir);
|
|
|
list = list.concat(groupList);
|
|
|
item.children = list;
|
|
|
- console.error(item.children);
|
|
|
}
|
|
|
|
|
|
// if (groupList.length == 1 && !groupList[0].children.length) {
|