修改已选组件逻辑

v1.0.0
于肖磊 2024-08-30 16:37:47 +08:00
parent c7b183d0fe
commit 3d19865c68
10 changed files with 355 additions and 273 deletions

View File

@ -1,9 +1,9 @@
@font-face {
font-family: "iconfont"; /* Project id 4607934 */
src: url('iconfont.woff2?t=1724925411942') format('woff2'),
url('iconfont.woff?t=1724925411942') format('woff'),
url('iconfont.ttf?t=1724925411942') format('truetype'),
url('iconfont.svg?t=1724925411942#iconfont') format('svg');
src: url('iconfont.woff2?t=1725006134098') format('woff2'),
url('iconfont.woff?t=1725006134098') format('woff'),
url('iconfont.ttf?t=1725006134098') format('truetype'),
url('iconfont.svg?t=1725006134098#iconfont') format('svg');
}
.iconfont {
@ -14,6 +14,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-close-b:before {
content: "\e745";
}
.icon-youhuiquanjiantou:before {
content: "\e796";
}
.icon-arrow-right-o:before {
content: "\e6aa";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,20 @@
"css_prefix_text": "icon-",
"description": "web端",
"glyphs": [
{
"icon_id": "40047116",
"name": "进销存关闭2",
"font_class": "close-b",
"unicode": "e745",
"unicode_decimal": 59205
},
{
"icon_id": "41674274",
"name": "优惠券箭头",
"font_class": "youhuiquanjiantou",
"unicode": "e796",
"unicode_decimal": 59286
},
{
"icon_id": "36882570",
"name": "右箭头-2",

View File

@ -14,6 +14,10 @@
/>
<missing-glyph />
<glyph glyph-name="close-b" unicode="&#59205;" d="M512-128C229.6832-128 0 101.6832 0 384S229.6832 896 512 896s512-229.6832 512-512-229.6832-512-512-512z m0 984.610133C251.392 856.610133 39.389867 644.608 39.389867 384S251.392-88.610133 512-88.610133 984.610133 123.392 984.610133 384 772.608 856.610133 512 856.610133zM330.990933 183.296a19.694933 19.694933 0 0 0-13.9264 33.621333L679.082667 578.901333a19.694933 19.694933 0 1 0 27.8528-27.8528L344.917333 189.098667a19.592533 19.592533 0 0 0-13.9264-5.802667zM693.009067 183.296a19.592533 19.592533 0 0 0-13.9264 5.768533L317.098667 551.082667a19.694933 19.694933 0 1 0 27.8528 27.8528L706.901333 216.917333a19.694933 19.694933 0 0 0-13.9264-33.621333z" horiz-adv-x="1024" />
<glyph glyph-name="youhuiquanjiantou" unicode="&#59286;" d="M512 896c282.24 0 512-229.76 512-512s-229.76-512-512-512-512 229.76-512 512 229.76 512 512 512zM447.36 594.56a25.472 25.472 0 0 1-36.48 0c-10.24-10.24-10.24-26.24 0-36.48l173.76-173.76L410.88 210.56c-10.24-10.24-10.24-26.24 0-36.48 5.12-5.12 11.52-7.68 17.92-7.68 6.4 0 12.8 2.56 18.56 7.68l192 192c10.24 10.24 10.24 26.24 0 36.48z" horiz-adv-x="1024" />
<glyph glyph-name="arrow-right-o" unicode="&#59050;" d="M512-66C263.915-66 62 135.96 62 384 62 632.085 263.915 834 512 834c248.04 0 450-201.915 450-450 0-248.04-201.96-450-450-450zM438.875 192.75a22.23 22.23 0 0 0-15.75 6.75c-9 9-9 23.04 0 32.085l168.75 168.75c9 9 23.04 9 32.085 0 9-9 9-23.085 0-32.085l-168.75-168.75a24.525 24.525 0 0 0-16.335-6.75zM607.625 361.5a22.23 22.23 0 0 0-15.75 6.75L423.125 537c-9 9-9 23.04 0 32.04 9 9 23.04 9 32.085 0l168.75-168.75c9-9 9-23.04 0-32.04a24.525 24.525 0 0 0-16.335-6.75z" horiz-adv-x="1024" />
<glyph glyph-name="ellipsis" unicode="&#58933;" d="M169.319538 289.773795a94.226205 94.226205 0 1 0 0 188.45241 94.226205 94.226205 0 0 0 0-188.45241z m342.680462 0a94.226205 94.226205 0 1 0 0 188.45241 94.226205 94.226205 0 0 0 0-188.45241z m342.680462 0a94.226205 94.226205 0 1 0 0 188.45241 94.226205 94.226205 0 0 0 0-188.45241z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -0,0 +1,279 @@
.siderbar {
width: 34rem;
padding: 2rem 3rem;
background-color: #fff;
overflow: auto;
.el-collapse {
border: 0;
:deep(.el-collapse-item__wrap) {
border: 0;
}
:deep(.el-collapse-item__header) {
border: 0;
}
}
.component {
.item {
width: calc(100% / 3);
padding: 0.5rem;
.img {
width: 3rem;
height: 3rem;
}
}
}
&-show {
display: flex;
padding: 0.5rem;
transition: box-shadow 0.5s ease;
}
&-show:hover {
cursor: pointer;
border-radius: 0.5rem;
box-shadow: 0 0 0.5rem 0 rgba(24, 144, 255, 0.3);
transform: scale(1.05);
transition: all 0.4s;
}
&-hidden {
display: none;
}
}
@media screen and (max-width: 1540px) {
.siderbar {
width: 32rem;
}
}
.main {
flex: 1;
position: relative;
height: 100%;
width: 100%;
.acticons {
position: absolute;
left: 50%;
margin-left: 26rem;
top: 0;
display: flex;
flex-direction: column;
gap: 2rem;
z-index: 1;
.el-button {
border-radius: 0.4rem;
}
.el-button + .el-button {
margin-left: 0;
}
}
.model {
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
height: 100%;
.model-content {
position: relative;
height: 84.6rem;
.model-bottom {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
z-index: 2;
.roll {
border-top: 0.1rem solid #f5f5f5;
height: 4rem;
width: 39rem;
background: #fff;
margin: 0 auto;
}
}
.model-drag {
overflow-y: auto;
padding-top: 0.2rem;
max-height: 84.4rem;
&::-webkit-scrollbar {
display: none;
}
}
//
.plug-in-table.float-window {
.plug-in-name {
display: none;
}
}
// 100%
.plug-in-border.float-window {
.plug-in-name {
display: block;
}
}
.plug-in-border {
position: relative;
// border: 0.2rem solid $cr-main;
z-index: 1;
box-sizing: border-box;
}
.plug-in-border::before {
content: '';
width: calc(100% + 0.4rem);
height: calc(100% + 0.4rem);
position: absolute;
top: -0.2rem;
left: -0.2rem;
border: 0.2rem solid $cr-main;
}
.plug-in-animation {
transition: all 0.3s ease-in-out;
&:hover {
box-shadow: 0 2px 8px rgba(50, 55, 58, 0.1);
}
}
.plug-in-table {
display: table;
width: 100%;
cursor: move;
transform: translateZ(0rem) !important;
}
.plug-in-name {
position: absolute;
top: 0;
background: #fff;
left: -10rem;
width: 8.6rem;
height: 3.2rem;
text-align: center;
line-height: 3.2rem;
font-size: 1.3rem;
color: #666;
border-radius: 0.3rem;
z-index: 99;
&::before {
content: '';
position: absolute;
width: 1rem;
height: 1rem;
background: #fff;
transform: rotate(45deg);
top: 50%;
right: -0.5rem;
margin-top: -0.5rem;
}
}
.plug-in-close::before {
position: absolute;
content: '\5DF2\9690\85CF';
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 99;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.plug-in-right {
background: $cr-main;
position: absolute;
right: -5rem;
display: flex;
flex-direction: column;
gap: 2rem;
padding: 2rem 1.2rem;
color: #fff;
border-radius: 0.4rem;
& > i {
cursor: pointer;
}
& > i.disabled {
color: #5db2ff;
cursor: not-allowed;
}
}
.main-show {
display: inherit;
}
.main-hidden {
display: none;
}
.main-border {
padding: 1rem;
border: 0.1rem dashed $cr-main;
background: #b9d8f5;
}
}
.plug-in-right {
background: $cr-main;
position: absolute;
right: -5rem;
display: flex;
flex-direction: column;
gap: 2rem;
padding: 2rem 1.2rem;
color: #fff;
border-radius: 0.4rem;
& > i {
cursor: pointer;
}
& > i.disabled {
color: #5db2ff;
cursor: not-allowed;
}
& .icon-arrow-top,
& .icon-arrow-bottom {
height: 0.9rem;
}
}
.main-show {
display: inherit;
}
.main-hidden {
display: none;
}
.main-border {
padding: 1rem;
border: 0.1rem dashed $cr-main;
background: #b9d8f5;
}
}
}
.seat {
background: transparent;
height: 0.2rem;
width: 39rem;
margin: 0 auto;
}
.drawer-container {
position: relative;
overflow: hidden;
width: 12.8rem;
margin-left: 0.1rem;
.drawer-content {
position: absolute;
top: 0;
width: 12.8rem;
height: 100%;
background: #fff;
transition: left 0.3s ease;
}
.drawer-drag-area {
height: calc(100% - 6rem);
overflow-y: auto;
}
.drawer-drag {
cursor: move;
}
.drawer-drag:hover{
background: #F2F8FF;
.iconfont.icon-close-b {
display: block !important;
}
}
.iconfont.icon-close-b {
right: 1rem;
top: 1.4rem;
color: #8A8A8A;
cursor: pointer;
}
}

View File

@ -15,6 +15,22 @@
</el-collapse-item>
</el-collapse>
</div>
<div class="drawer-container">
<div class="drawer-content" :style="{ left: diy_data.length > 0 ? '0' : '-100%' }">
<div class="size-14 cr-3 fw ptb-20 pl-12">已选组件</div>
<div class="drawer-drag-area">
<VueDraggable v-model="diy_data" :animation="500" target=".sort-target" :scroll="true" :on-sort="on_sort">
<TransitionGroup type="transition" tag="ul" name="fade" class="sort-target flex-col">
<li v-for="(item, index) in diy_data" :key="index" class="flex ptb-12 plr-10 gap-y-8 re align-c drawer-drag" :style="[item.show_tabs ? 'background: #F2F8FF;' : '']" @click="on_choose(index, item.show_tabs)">
<el-icon class="iconfont icon-drag size-16 cr-d" />
<span class="size-12 cr-6">{{ item.name }}</span>
<el-icon class="iconfont icon-close-b size-16 abs" :style="[ item.show_tabs ? '' : 'display:none']" @click.stop="del(index)" />
</li>
</TransitionGroup>
</VueDraggable>
</div>
</div>
</div>
<!-- 视图渲染 -->
<div class="main">
<div class="model">
@ -457,16 +473,21 @@ const copy = (index: number) => {
//
const del = (index: number) => {
app?.appContext.config.globalProperties.$common.message_box('删除后不可恢复,确定继续吗?', 'warning').then(() => {
diy_data.value.splice(index, 1);
if (diy_data.value.length > 0) {
let new_index: number = index;
// 0
if (index > 0) {
new_index = new_index - 1;
const show_tabs_index = diy_data.value.findIndex((item: any) => item.show_tabs);
if (show_tabs_index == index) {
diy_data.value.splice(index, 1);
if (diy_data.value.length > 0) {
let new_index: number = index;
// 0
if (index > 0) {
new_index = new_index - 1;
}
set_show_tabs(new_index);
} else {
page_settings();
}
set_show_tabs(new_index);
} else {
page_settings();
diy_data.value.splice(index, 1);
}
});
};
@ -564,267 +585,23 @@ const float_bottom_change = (val: { bottom: string; location: string }, id: stri
</script>
<style lang="scss" scoped>
.siderbar {
width: 34rem;
padding: 2rem 3rem;
background-color: #fff;
overflow: auto;
.el-collapse {
border: 0;
:deep(.el-collapse-item__wrap) {
border: 0;
}
:deep(.el-collapse-item__header) {
border: 0;
}
}
.component {
.item {
width: calc(100% / 3);
padding: 0.5rem;
.img {
width: 3rem;
height: 3rem;
}
}
}
&-show {
display: flex;
padding: 0.5rem;
transition: box-shadow 0.5s ease;
}
&-show:hover {
cursor: pointer;
border-radius: 0.5rem;
box-shadow: 0 0 0.5rem 0 rgba(24, 144, 255, 0.3);
transform: scale(1.05);
transition: all 0.4s;
}
&-hidden {
display: none;
}
}
@media screen and (max-width: 1540px) {
.siderbar {
width: 32rem;
}
}
.main {
flex: 1;
position: relative;
height: 100%;
width: 100%;
.acticons {
position: absolute;
left: 50%;
margin-left: 26rem;
top: 0;
display: flex;
flex-direction: column;
gap: 2rem;
z-index: 1;
.el-button {
border-radius: 0.4rem;
}
.el-button + .el-button {
margin-left: 0;
}
}
.model {
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
height: 100%;
.model-content {
position: relative;
height: 84.6rem;
.model-bottom {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
z-index: 2;
.roll {
border-top: 0.1rem solid #f5f5f5;
height: 4rem;
width: 39rem;
background: #fff;
margin: 0 auto;
}
}
.model-drag {
overflow-y: auto;
padding-top: 0.2rem;
max-height: 84.4rem;
&::-webkit-scrollbar {
display: none;
}
.model-wall {
width: 39rem;
background: #f5f5f5;
margin: 0 auto;
.drag-area {
min-height: v-bind(height);
}
.drag-area .float-window {
position: fixed;
max-width: 39rem;
margin: 0 auto;
z-index: 3;
}
.main-content {
max-width: 39rem;
overflow: hidden;
}
}
}
//
.plug-in-table.float-window {
.plug-in-name {
display: none;
}
}
// 100%
.plug-in-border.float-window {
.plug-in-name {
display: block;
}
}
.plug-in-border {
position: relative;
// border: 0.2rem solid $cr-main;
z-index: 1;
box-sizing: border-box;
}
.plug-in-border::before {
content: '';
width: calc(100% + 0.4rem);
height: calc(100% + 0.4rem);
position: absolute;
top: -0.2rem;
left: -0.2rem;
border: 0.2rem solid $cr-main;
}
.plug-in-animation {
transition: all 0.3s ease-in-out;
&:hover {
box-shadow: 0 2px 8px rgba(50, 55, 58, 0.1);
}
}
.plug-in-table {
display: table;
width: 100%;
cursor: move;
transform: translateZ(0rem) !important;
}
.plug-in-name {
position: absolute;
top: 0;
background: #fff;
left: -10rem;
width: 8.6rem;
height: 3.2rem;
text-align: center;
line-height: 3.2rem;
font-size: 1.3rem;
color: #666;
border-radius: 0.3rem;
z-index: 99;
&::before {
content: '';
position: absolute;
width: 1rem;
height: 1rem;
background: #fff;
transform: rotate(45deg);
top: 50%;
right: -0.5rem;
margin-top: -0.5rem;
}
}
.plug-in-close::before {
position: absolute;
content: '\5DF2\9690\85CF';
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 99;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
.plug-in-right {
background: $cr-main;
position: absolute;
right: -5rem;
display: flex;
flex-direction: column;
gap: 2rem;
padding: 2rem 1.2rem;
color: #fff;
border-radius: 0.4rem;
& > i {
cursor: pointer;
}
& > i.disabled {
color: #5db2ff;
cursor: not-allowed;
}
}
.main-show {
display: inherit;
}
.main-hidden {
display: none;
}
.main-border {
padding: 1rem;
border: 0.1rem dashed $cr-main;
background: #b9d8f5;
}
}
.plug-in-right {
background: $cr-main;
position: absolute;
right: -5rem;
display: flex;
flex-direction: column;
gap: 2rem;
padding: 2rem 1.2rem;
color: #fff;
border-radius: 0.4rem;
& > i {
cursor: pointer;
}
& > i.disabled {
color: #5db2ff;
cursor: not-allowed;
}
& .icon-arrow-top,
& .icon-arrow-bottom {
height: 0.9rem;
}
}
.main-show {
display: inherit;
}
.main-hidden {
display: none;
}
.main-border {
padding: 1rem;
border: 0.1rem dashed $cr-main;
background: #b9d8f5;
}
}
}
.seat {
background: transparent;
height: 0.2rem;
@import 'index.scss';
.model-wall {
width: 39rem;
background: #f5f5f5;
margin: 0 auto;
.drag-area {
min-height: v-bind(height);
}
.drag-area .float-window {
position: fixed;
max-width: 39rem;
margin: 0 auto;
z-index: 3;
}
.main-content {
max-width: 39rem;
overflow: hidden;
}
}
</style>