Skip to content

Commit

Permalink
优化结构
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Oct 12, 2023
1 parent 89c3a7c commit 450eb2b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 67 deletions.
14 changes: 6 additions & 8 deletions GoEasyDesigner/frontend/src/app9.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,12 @@ function 拖拽开始(event, 组件名称) {
}
if (组件名称 == "选择夹") {
let id = 新属性.id
新属性.子组件[0].id = store.获取随机id()
新属性.子组件[0].标题 = "选项卡" + store.获取索引(id + "选项卡")
新属性.子组件[0].子组件[0].id = store.获取随机id()
新属性.子组件[0].子组件[0].父容器id = id
新属性.子组件[1].id = store.获取随机id()
新属性.子组件[1].标题 = "选项卡" + store.获取索引(id + "选项卡")
新属性.子组件[1].子组件[0].id = store.获取随机id()
新属性.子组件[1].子组件[0].父容器id = id
for (var i = 0; i < 2; i++) {
新属性.子组件[i].id = store.获取随机id()
新属性.子组件[i].名称 = "内容区域" + store.获取索引(id + "内容区域")
新属性.子组件[i].标题 = "选项卡" + store.获取索引(id + "选项卡")
新属性.子组件[i].父容器id = id
}
}
if (组件名称 == "开关") {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,36 @@ export default {
标签位置: "top",
子组件: [
{
标题: "选项卡",
子组件: [
{
组件名称: "布局容器",
名称: "内容区域1",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
父容器id: 0,
层级: 0,
子组件: []
},

]
组件名称: "布局容器",
名称: "内容区域1",
标题: "选项卡1",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
父容器id: 0,
层级: 0,
子组件: []
},
{
标题: "选项卡",
子组件: [
{
组件名称: "布局容器",
名称: "内容区域2",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
层级: 0,
子容器: true,
父容器id: 0,
子组件: []
},

]
组件名称: "布局容器",
名称: "内容区域1",
标题: "选项卡2",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
父容器id: 0,
层级: 0,
子组件: []
},
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:key="tabItemIndex"
:label="tabItem.标题"
>
<component is="渲染组件" v-for="(tabItem2, tabItemIndex2) in tabItem.子组件" :key="tabItemIndex2" :item="tabItem2"/>
<component is="渲染组件" v-for="(tabItem2, tabItemIndex2) in [tabItem]" :key="tabItemIndex2" :item="tabItem2"/>
</el-tab-pane>
</el-tabs>

Expand Down
32 changes: 13 additions & 19 deletions GoEasyDesigner/frontend/src/stores/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,26 +233,20 @@ export const useCounterStore = defineStore('counter', {

新增子组件(id) {
let 插入数据 = {
标题: "选项卡" + this.获取索引(id + "选项卡"),
id: this.获取随机id(),
子组件: [
{
id: this.获取随机id(),
名称: '选择夹',
组件名称: "布局容器",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
父容器id: id,
子组件: []
},

]
名称: "内容区域" + this.获取索引(id + "内容区域"),
标题: "选项卡" + this.获取索引(id + "选项卡"),
组件名称: "布局容器",
top: "0",
left: "0",
width: "100%",
height: "100%",
禁止放置: false,
禁止拖动: true,
可视: true,
禁止: false,
父容器id: id,
子组件: []
}
this.递归添加(this.list, 插入数据, id)
},
Expand Down

0 comments on commit 450eb2b

Please sign in to comment.