|
@@ -25,7 +25,11 @@
|
|
|
<!-- 中间拖拽区域 start-->
|
|
|
<div class="drag-wrap">
|
|
|
<!-- 顶部工具 -->
|
|
|
- <TopToolBar @showJSON="showJSON" @saveJSON="saveJSON"></TopToolBar>
|
|
|
+ <TopToolBar
|
|
|
+ @showJSON="showJSON"
|
|
|
+ @saveJSON="saveJSON"
|
|
|
+ @showJSONData="showJSONData"
|
|
|
+ ></TopToolBar>
|
|
|
<CenterArea
|
|
|
:data="layoutData"
|
|
|
:selectItem="selectItem"
|
|
@@ -38,6 +42,8 @@
|
|
|
<!-- 右侧面板区域 start -->
|
|
|
<RightPanel class="right-panel" :selectItem="selectItem"></RightPanel>
|
|
|
<!-- 右侧面板区域 end -->
|
|
|
+ <!-- JSON数据预览 -->
|
|
|
+ <JSONViewer ref="JSONViewerRef"></JSONViewer>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -51,10 +57,18 @@ import collapseItem from "./collapseItem.vue"; //左侧tab
|
|
|
import RightPanel from "./RightPanel.vue"; //右侧tab
|
|
|
import TopToolBar from "./TopToolBar.vue"; //右侧tab
|
|
|
import { updateFormGroup } from "@/api/system/formGroup";
|
|
|
+import JSONViewer from "./JSONViewer.vue";
|
|
|
export default {
|
|
|
name: "DragPosition",
|
|
|
props: ["formGroupData"],
|
|
|
- components: { LetfPanel, CenterArea, collapseItem, RightPanel, TopToolBar },
|
|
|
+ components: {
|
|
|
+ LetfPanel,
|
|
|
+ CenterArea,
|
|
|
+ collapseItem,
|
|
|
+ RightPanel,
|
|
|
+ TopToolBar,
|
|
|
+ JSONViewer,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
startType: "",
|
|
@@ -157,6 +171,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // JSON展示回调
|
|
|
+ showJSONData() {
|
|
|
+ this.$refs.JSONViewerRef.setJSONData(JSON.stringify(this.layoutData));
|
|
|
+ this.$refs.JSONViewerRef.showHandler();
|
|
|
+ },
|
|
|
// 保存布局数据
|
|
|
async saveJSON() {
|
|
|
let payLoad = {
|