|
@@ -68,14 +68,20 @@
|
|
|
<!-- 中间 -->
|
|
|
<div class="panel_center">
|
|
|
<div class="card_home">
|
|
|
- <draggable class="Bzu" :list="extraImgs1" itemKey="id" filter=".unmover"
|
|
|
- :group="{ name: 'itxst', pull: false, put: true }">
|
|
|
- <template #item="{ element }">
|
|
|
- <div class="item_module_center move">
|
|
|
- <VueDrag class="draggable" :dargData="element"></VueDrag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </draggable>
|
|
|
+ <img class="head_image_url" :src="imageUrl" />
|
|
|
+ <div class="Bzu">
|
|
|
+ <DraggableContainer :prevent-deactivation="false">
|
|
|
+ <draggable class="Bzu" v-model="extraImgs1" itemKey="id" :force-fallback="false" :sort="false"
|
|
|
+ :handle="'forbid'" :fallbackOnBody="false" :group="{ name: 'undraggable', pull: false, put: true }"
|
|
|
+ @start="onStart" @end="onEnd">
|
|
|
+ <template #item="{ element }">
|
|
|
+ <div class="item_module_center move">
|
|
|
+ <VueDrag :dargData="element" :id="element.id"></VueDrag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </draggable>
|
|
|
+ </DraggableContainer>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 右侧 -->
|
|
@@ -93,7 +99,7 @@
|
|
|
<!-- 右侧对齐方式 -->
|
|
|
<div class="card_alignment">
|
|
|
<div class="bg_ment">
|
|
|
- <div class="icon_item_align" v-for="(item, index) in btnAlignment" :key="index">
|
|
|
+ <div class="icon_item_align" v-for="( item, index ) in btnAlignment " :key="index">
|
|
|
<el-tooltip class="box-item" :content="item.label" placement="left" effect="light">
|
|
|
<span class="iconfont icon_alignment" :class="item.value"></span>
|
|
|
</el-tooltip>
|
|
@@ -112,6 +118,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { DraggableContainer } from 'vue3-draggable-resizable'
|
|
|
import Draggable from "vuedraggable";
|
|
|
import moduleLibrary from "../components/moduleLibrary.vue";
|
|
|
import getName from './widgets/getWidget';
|
|
@@ -119,11 +126,13 @@ import getName from './widgets/getWidget';
|
|
|
import VueDrag from '../components/drag/resizable.vue'
|
|
|
import { attributeValue, layout } from '../module/index';
|
|
|
import { ref } from "vue";
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
|
const tabPosition = ref<string>('style');
|
|
|
const activeName = ref<string>('bank');
|
|
|
// 默认选择组件库
|
|
|
const current = ref<string>('1');
|
|
|
+const imageUrl = new URL('@/assets/images/head.png', import.meta.url).href;
|
|
|
const btnOptions = [
|
|
|
{ label: "撤销", value: 'icon-chexiao' },
|
|
|
{ label: "重做", value: 'icon-zhongzuo' },
|
|
@@ -154,12 +163,12 @@ const state = ref({
|
|
|
|
|
|
//拖拽开始的事件
|
|
|
const onStart = () => {
|
|
|
- // console.log("开始拖拽");
|
|
|
+ console.log("开始拖拽");
|
|
|
};
|
|
|
|
|
|
//拖拽结束的事件
|
|
|
-const onEnd = () => {
|
|
|
- // console.log("结束拖拽");
|
|
|
+const onEnd = (value) => {
|
|
|
+ console.log(value, "结束拖拽");
|
|
|
};
|
|
|
|
|
|
const onMove = () => {
|
|
@@ -168,7 +177,6 @@ const onMove = () => {
|
|
|
//不允许停靠
|
|
|
return true;
|
|
|
};
|
|
|
-
|
|
|
const getWidget = (name: string) => {
|
|
|
//组件名映射
|
|
|
return getName[name]
|
|
@@ -185,8 +193,11 @@ const handleReceivedData = (num: any) => {
|
|
|
function handleClick(): void {
|
|
|
console.log(24);
|
|
|
}
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
// 发布
|
|
|
function announce() {
|
|
|
+ router.push('/TestDrag')
|
|
|
console.log(extraImgs1.value, 999);
|
|
|
}
|
|
|
|
|
@@ -375,14 +386,21 @@ function announce() {
|
|
|
}
|
|
|
|
|
|
.card_home {
|
|
|
- width: 380px;
|
|
|
+ width: 375px;
|
|
|
margin: 30px auto 8px;
|
|
|
- height: 600px;
|
|
|
+ height: 667px;
|
|
|
background-color: #fafafa;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
+.head_image_url {
|
|
|
+ width: 100%;
|
|
|
+ height: 20px;
|
|
|
+ -webkit-user-drag: none;
|
|
|
+ user-select: none;
|
|
|
+}
|
|
|
+
|
|
|
.item_module_left {
|
|
|
cursor: grab;
|
|
|
display: flex;
|
|
@@ -499,22 +517,6 @@ img {
|
|
|
|
|
|
.Bzu {
|
|
|
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;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
</style>
|