|
@@ -29,7 +29,7 @@
|
|
</el-icon></div>
|
|
</el-icon></div>
|
|
<span>存为草稿</span>
|
|
<span>存为草稿</span>
|
|
</div>
|
|
</div>
|
|
- <div class="card_right_btn">
|
|
|
|
|
|
+ <div class="card_right_btn" @click="announce">
|
|
<div class="card_btn_item"><el-icon :size="18">
|
|
<div class="card_btn_item"><el-icon :size="18">
|
|
<Promotion />
|
|
<Promotion />
|
|
</el-icon></div>
|
|
</el-icon></div>
|
|
@@ -72,10 +72,7 @@
|
|
:group="{ name: 'itxst', pull: false, put: true }">
|
|
:group="{ name: 'itxst', pull: false, put: true }">
|
|
<template #item="{ element }">
|
|
<template #item="{ element }">
|
|
<div class="item_module_center move">
|
|
<div class="item_module_center move">
|
|
- <vue-drag-resize :isActive="true" :w="200" :h="200" :draggable="false" :aspectRatio="false"
|
|
|
|
- sticks="['tl']" :preventActiveBehavior="true" v-on:resizing="resize" v-on:dragging="resize">
|
|
|
|
- <component class="draggable" :is="getWidget(element.type)" :config="element"></component>
|
|
|
|
- </vue-drag-resize>
|
|
|
|
|
|
+ <VueDrag class="draggable" :dargData="element"></VueDrag>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</draggable>
|
|
</draggable>
|
|
@@ -116,9 +113,10 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import Draggable from "vuedraggable";
|
|
import Draggable from "vuedraggable";
|
|
-import VueDragResize from 'vue-drag-resize/src';
|
|
|
|
import moduleLibrary from "../components/moduleLibrary.vue";
|
|
import moduleLibrary from "../components/moduleLibrary.vue";
|
|
import getName from './widgets/getWidget';
|
|
import getName from './widgets/getWidget';
|
|
|
|
+// import VueDrag from '../components/drag/index.vue'
|
|
|
|
+import VueDrag from '../components/drag/resizable.vue'
|
|
import { attributeValue, layout } from '../module/index';
|
|
import { attributeValue, layout } from '../module/index';
|
|
import { ref } from "vue";
|
|
import { ref } from "vue";
|
|
|
|
|
|
@@ -156,23 +154,23 @@ const state = ref({
|
|
|
|
|
|
//拖拽开始的事件
|
|
//拖拽开始的事件
|
|
const onStart = () => {
|
|
const onStart = () => {
|
|
- console.log("开始拖拽");
|
|
|
|
|
|
+ // console.log("开始拖拽");
|
|
};
|
|
};
|
|
|
|
|
|
//拖拽结束的事件
|
|
//拖拽结束的事件
|
|
const onEnd = () => {
|
|
const onEnd = () => {
|
|
- console.log("结束拖拽");
|
|
|
|
|
|
+ // console.log("结束拖拽");
|
|
};
|
|
};
|
|
|
|
|
|
-const onMove = (event: MouseEvent) => {
|
|
|
|
- console.log(event, 266)
|
|
|
|
|
|
+const onMove = () => {
|
|
|
|
+ // event: MouseEvent
|
|
|
|
+ // console.log(event, 266)
|
|
//不允许停靠
|
|
//不允许停靠
|
|
- // if (event.relatedContext.element.disabledPark == true) return false;
|
|
|
|
return true;
|
|
return true;
|
|
};
|
|
};
|
|
|
|
|
|
const getWidget = (name: string) => {
|
|
const getWidget = (name: string) => {
|
|
- //写的时候,组件的起名一定要与dragList中的element名字一模一样,不然会映射不上
|
|
|
|
|
|
+ //组件名映射
|
|
return getName[name]
|
|
return getName[name]
|
|
}
|
|
}
|
|
// 组件库选择
|
|
// 组件库选择
|
|
@@ -181,21 +179,17 @@ const handleReceivedData = (num: any) => {
|
|
extraImgs.value = attributeValue
|
|
extraImgs.value = attributeValue
|
|
} else if (num == 2) {
|
|
} else if (num == 2) {
|
|
extraImgs.value = layout
|
|
extraImgs.value = layout
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 切换tabs
|
|
// 切换tabs
|
|
function handleClick(): void {
|
|
function handleClick(): void {
|
|
console.log(24);
|
|
console.log(24);
|
|
}
|
|
}
|
|
-// 组件移动
|
|
|
|
-function resize(newRect) {
|
|
|
|
- console.log(newRect, extraImgs1, 222)
|
|
|
|
- // extraImgs1.width = newRect.width;
|
|
|
|
- // extraImgs1.height = newRect.height;
|
|
|
|
- // extraImgs1.top = newRect.top;
|
|
|
|
- // extraImgs1.left = newRect.left;
|
|
|
|
|
|
+// 发布
|
|
|
|
+function announce() {
|
|
|
|
+ console.log(extraImgs1.value, 999);
|
|
}
|
|
}
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -506,4 +500,21 @@ img {
|
|
.Bzu {
|
|
.Bzu {
|
|
height: 100%;
|
|
height: 100%;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.vdr.active:before {
|
|
|
|
+ outline: 1px solid #0f73e6;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.vdr .vdr-stick-mr {
|
|
|
|
+ border-radius: 3px;
|
|
|
|
+ cursor: ew-resize;
|
|
|
|
+ height: 12px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.vdr .vdr-stick {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ background-origin: content-box;
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
+ border: 1px solid #0f73e6;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|