修改自定义逻辑处理

v1.0.0
于肖磊 2024-10-15 15:00:42 +08:00
parent e15414419d
commit a5b5be39e9
2 changed files with 21 additions and 4 deletions

View File

@ -1,10 +1,16 @@
<template>
<div class="img-outer re oh flex-row w h" :style="com_style">
<icon :name="form.icon_class" :color="form.icon_color" :size="form.icon_size + ''"></icon>
<template v-if="!isEmpty(form.icon_class)">
<icon :name="form.icon_class" :color="form.icon_color" :size="form.icon_size + ''"></icon>
</template>
<template v-else>
<image-empty v-model="form.icon_class"></image-empty>
</template>
</div>
</template>
<script setup lang="ts">
import { radius_computer, padding_computer, gradient_handle } from '@/utils';
import { isEmpty } from 'lodash';
const props = defineProps({
value: {
type: Object,
@ -54,4 +60,14 @@ const set_count = () => {
};
</script>
<style lang="scss" scoped>
:deep(.el-image) {
height: 100%;
width: 100%;
.el-image__inner {
object-fit: cover;
}
.image-slot img {
width: 2rem;
}
}
</style>

View File

@ -22,7 +22,7 @@
<card-container class="h selected">
<div class="flex-col gap-10 drawer-container">
<div class="flex-row align-c jc-sb">已选组件
<div class="flex-row align-c gap-10">
<div class="flex-row align-c gap-20">
<span class="clear-selection" @click="show_computer_line">{{ !is_show_component_line ? '' : '' }}线</span>
<span class="clear-selection" @click="cancel"></span>
</div>
@ -59,7 +59,7 @@
<!-- 视图渲染 -->
<div class="main">
<div class="model-content">
<right-side-operation v-if="typeof select_index === 'number' && !isNaN(select_index)" v-model:index="select_index" v-model:dataLength="diy_data.length" @del="del" @copy="copy" @previous_layer="previous_layer" @underlying_layer="underlying_layer" @top_up="top_up" @bottom_up="bottom_up"></right-side-operation>
<right-side-operation v-if="typeof select_index === 'number' && !isNaN(select_index) && diy_data.length > 0" v-model:index="select_index" v-model:dataLength="diy_data.length" @del="del" @copy="copy" @previous_layer="previous_layer" @underlying_layer="underlying_layer" @top_up="top_up" @bottom_up="bottom_up"></right-side-operation>
<!-- 拖拽区 -->
<div class="model-drag">
<div class="model-wall">
@ -278,6 +278,7 @@ const del = (index: null | number) => {
} else {
diy_data.value.splice(index, 1);
}
select_index.value = diy_data.value.length > 0 ? select_index.value : null;
});
}
};
@ -458,7 +459,7 @@ const drop = (event: any) => {
};
diy_data.value.unshift(newItem);
set_show_tabs(diy_data.value.length - 1);
set_show_tabs(0);
}
};
function adjustPosition(x: number, y: number, width:number, height:number, maxWidth:number, maxHeight:number) {