Skip to content

Commit

Permalink
Merge pull request #77 from ZhQuella/main-feat/workflow
Browse files Browse the repository at this point in the history
feat(feat): "优化页面设计器"
  • Loading branch information
ZhQuella authored Jun 6, 2024
2 parents 11af8d1 + be2de66 commit 81ae1ea
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 8 deletions.
17 changes: 11 additions & 6 deletions packages/grow_designer/src/packages/GDesigner/GDesigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
@dragstart="onGenerateKey"/>
</div>
</div>
<div class="flex-1 bg-BG_COLOR2">
<div class="flex-1 bg-BG_COLOR2 relative">
<el-scrollbar class="h-full draggable-content">
<DraggableView :draggableConfig="draggableConfig"
@add="onDraggableViewAdd"
Expand All @@ -99,12 +99,15 @@
@delete="onDeleteItem"
@copy="onCopyItem"/>
</el-scrollbar>
<div class="text-gray-400 absolute top-[50%] left-[50%] translate-y-[-50%] translate-x-[-50%] leading-full pointer-events-none text-center text-[24px]"
v-if="!draggableConfig.structures.length">请从左侧组件库中拖入对应组件</div>
</div>
<div class="grow-0 shrink-0 w-[300px] bg-BG_COLOR3 border-l-[1px] border-BORDER_COLOR2 border-solid">
<ElScrollbar class="h-full">
配置区域
{{ activeUUID }}
</ElScrollbar>
<div class="grow-0 shrink-0 w-[300px] bg-BG_COLOR3 border-l-[1px] border-BORDER_COLOR2 border-solid"
@click.stop>
<EleOptions :activeUUID="activeUUID"
:config="draggableConfig"
v-if="activeUUID"/>
<PageOptions v-if="!activeUUID"/>
</div>
</div>

Expand All @@ -114,6 +117,8 @@
<script setup lang="ts">
import { FlowLogsVpc, Close, DataBase, TreeView } from "@vicons/carbon";
import DraggableView from "./components/draggableView/index.vue";
import EleOptions from "./components/eleOptions/index.vue";
import PageOptions from "./components/pageOptions/index.vue";
import { useOption } from "./use/useOption";
import { useEvents } from "./use/useEvents";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div class="h-full flex flex-col">
<h5 class="text-[14px] p-[10px] bg-BG_COLOR2">组件配置</h5>
<div class="px-[5px] shrink-0 grow-0">
<ElTabs v-model="tabModel" stretch>
<ElTabPane label="属性" name="props"/>
<ElTabPane label="样式" name="styles"/>
<ElTabPane label="事件" name="events"/>
<ElTabPane label="高级" name="renderArgument"/>
</ElTabs>
</div>
<ElScrollbar class="h-full flex-1">
<p class="p-[10px] text-center">用爱发电中...😊</p>
{{ config[tabModel][activeUUID] }}
</ElScrollbar>
</div>
</template>

<script setup lang="ts">
defineOptions({ name: "eleOptions" });
import { toRefs, ref } from "vue";
const props = defineProps({
activeUUID: {
type: String,
required: true
},
config: {
type: Object,
required: true
}
});
const { activeUUID, config } = toRefs(props);
const tabModel = ref("props");
// console.log( activeUUID, config);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="h-full flex flex-col">
<h5 class="text-[14px] p-[10px] bg-BG_COLOR2">页面配置</h5>
<div class="px-[5px] shrink-0 grow-0">
<ElTabs v-model="tabModel" stretch>
<ElTabPane label="属性" name="props"/>
<ElTabPane label="高级" name="renderArgument"/>
</ElTabs>
</div>
<ElScrollbar class="h-full flex-1">
<p class="p-[10px] text-center">用爱发电中...😊</p>
</ElScrollbar>
</div>
</template>

<script setup lang="ts">
defineOptions({ name: "pageOptions" });
import { ref } from "vue";
const tabModel = ref("props");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const useEvents = ({
Reflect.deleteProperty(draggableConfig.renderArgument, item);
}
draggableConfig.structures = deleteByUUID(draggableConfig.structures, event.uuid);
activeUUID.value = "";
};

const copyObjectConfig = (oldUUID) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/grow_up_admin/mock/menu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const menuList = [
{
label: "折叠列表",
name: "OverflowList",
icon: "PanelExpansion",
icon: "FolderDetailsReference",
path: "OverflowList",
component: "Feat/OverflowList/index.vue"
}
Expand Down Expand Up @@ -257,7 +257,7 @@ const menuDataList: any[] = [
menuType: "1",
label: "折叠列表",
name: "OverflowList",
icon: "PanelExpansion",
icon: "FolderDetailsReference",
path: "OverflowList",
component: "Feat/OverflowList/index.vue",
hidden: true,
Expand Down

0 comments on commit 81ae1ea

Please sign in to comment.