|
@@ -71,12 +71,11 @@
|
|
|
<img class="head_image_url" :src="imageUrl" />
|
|
|
<div class="Bzu">
|
|
|
<DraggableContainer>
|
|
|
- <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 }">
|
|
|
+ <draggable class="Bzuil" v-model="extraImgs1" itemKey="id" :force-fallback="false" :sort="false"
|
|
|
+ :handle="'.forbid'" :fallbackOnBody="false" :group="{ name: 'undraggable', pull: false, put: true }">
|
|
|
+ <template #item="{ element, index }">
|
|
|
<div class="item_module_center move">
|
|
|
- <VueDrag :dargData="element" :id="element.id"></VueDrag>
|
|
|
+ <VueDrag :index="index" :dargData="element" :id="element.id"></VueDrag>
|
|
|
</div>
|
|
|
</template>
|
|
|
</draggable>
|
|
@@ -99,13 +98,14 @@
|
|
|
<!-- 右侧对齐方式 -->
|
|
|
<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" :class="activate ? 'active_icon' : 'icon_item_gray'"
|
|
|
+ v-for="( item, index ) in btnAlignment " :key="index" @click="alignment(item)">
|
|
|
<el-tooltip class="box-item" :content="item.label" placement="left" effect="light">
|
|
|
<span class="iconfont icon_alignment" :class="item.value"></span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
<div class="line_divider"></div>
|
|
|
- <div class="icon_item_align">
|
|
|
+ <div class="icon_item_align" :class="activate ? 'active_icon' : 'icon_item_gray'">
|
|
|
<el-tooltip class="box-item" content="锁定" placement="left" effect="light">
|
|
|
<span class="iconfont icon_alignment icon-suoding"></span>
|
|
|
</el-tooltip>
|
|
@@ -132,6 +132,7 @@ const tabPosition = ref<string>('style');
|
|
|
const activeName = ref<string>('bank');
|
|
|
// 默认选择组件库
|
|
|
const current = ref<string>('1');
|
|
|
+const deagRef = ref(null)
|
|
|
const imageUrl = new URL('@/assets/images/head.png', import.meta.url).href;
|
|
|
const btnOptions = [
|
|
|
{ label: "撤销", value: 'icon-chexiao' },
|
|
@@ -139,19 +140,20 @@ const btnOptions = [
|
|
|
{ label: "清除", value: 'icon-qingchu' },
|
|
|
];
|
|
|
const btnAlignment = [
|
|
|
- { label: "左对齐", value: 'icon-zuoduiqi' },
|
|
|
- { label: "水平居中", value: 'icon-hengxiangjuzhong' },
|
|
|
- { label: "右对齐", value: 'icon-youduiqi' },
|
|
|
- { label: "顶对齐", value: 'icon-shangduiqi' },
|
|
|
- { label: "垂直居中", value: 'icon-zongxiangjuzhong' },
|
|
|
- { label: "底对齐", value: 'icon-xiaduiqi' },
|
|
|
+ { type: 'left', label: "左对齐", value: 'icon-zuoduiqi' },
|
|
|
+ { type: 'centerHorizontally', label: "水平居中", value: 'icon-hengxiangjuzhong' },
|
|
|
+ { type: 'right', label: "右对齐", value: 'icon-youduiqi' },
|
|
|
+ { type: 'top', label: "顶对齐", value: 'icon-shangduiqi' },
|
|
|
+ { type: 'verticalCenter', label: "垂直居中", value: 'icon-zongxiangjuzhong' },
|
|
|
+ { type: 'bottom', label: "底对齐", value: 'icon-xiaduiqi' },
|
|
|
];
|
|
|
function getAssetsImages(name) {
|
|
|
return new URL(`/src/assets/${name}`, import.meta.url).href;
|
|
|
}
|
|
|
|
|
|
const extraImgs = ref(attributeValue);
|
|
|
-const extraImgs1:any = ref([]);
|
|
|
+const extraImgs1: any = ref([]);
|
|
|
+const activate: any = ref(true);
|
|
|
const state = ref({
|
|
|
message: "拖拽",
|
|
|
groupA: {
|
|
@@ -202,10 +204,26 @@ function announce() {
|
|
|
}
|
|
|
|
|
|
function preview() {
|
|
|
- console.log(extraImgs1.value[0],887);
|
|
|
+ // console.log(extraImgs1.value[0], 887);
|
|
|
extraImgs1.value[0].active = true
|
|
|
extraImgs1.value = extraImgs1.value
|
|
|
}
|
|
|
+
|
|
|
+function alignment(params: any) {
|
|
|
+ if (params.type == 'left') {
|
|
|
+ extraImgs1.value[0].css.left = 0
|
|
|
+ } else if (params.type == 'centerHorizontally') {
|
|
|
+ extraImgs1.value[0].css.left = 0
|
|
|
+ } else if (params.type == 'right') {
|
|
|
+ extraImgs1.value[0].css.left = 75
|
|
|
+ } else if (params.type == 'top') {
|
|
|
+ extraImgs1.value[0].css.top = 0
|
|
|
+ } else if (params.type == 'verticalCenter') {
|
|
|
+
|
|
|
+ } else if (params.type == 'bottom') {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -392,9 +410,10 @@ function preview() {
|
|
|
|
|
|
.card_home {
|
|
|
width: 375px;
|
|
|
- margin: 30px auto 8px;
|
|
|
+ margin: 30px auto 0px;
|
|
|
height: 667px;
|
|
|
- background-color: #fafafa;
|
|
|
+ background-color: red;
|
|
|
+ // background-color: #fafafa;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
}
|
|
@@ -469,10 +488,19 @@ function preview() {
|
|
|
padding: 0px 12px;
|
|
|
}
|
|
|
|
|
|
-.icon_item_align:hover .icon_alignment {
|
|
|
+.active_icon:hover .icon_alignment {
|
|
|
color: #409EFF;
|
|
|
}
|
|
|
|
|
|
+.icon_item_gray {
|
|
|
+ opacity: 0.3;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ user-select: none;
|
|
|
+ cursor: no-drop;
|
|
|
+}
|
|
|
+
|
|
|
.line_divider {
|
|
|
display: block;
|
|
|
width: 24px;
|
|
@@ -522,6 +550,15 @@ img {
|
|
|
|
|
|
.Bzu {
|
|
|
height: 100%;
|
|
|
- overflow: hidden;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ // overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.Bzuil {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
</style>
|