Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacker233 committed Apr 13, 2023
2 parents 8de11e2 + 18ed176 commit 9955078
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ pnpm build
<sub style="font-size:14px"><b>张雨凡</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 75.0; height: 75.0">
<a href=https://github.com/Ocean-H1>
<img src=https://avatars.githubusercontent.com/u/74898523?v=4 width="50;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=OceanH/>
<br />
<sub style="font-size:14px"><b>OceanH</b></sub>
</a>
</td>
<td align="center" style="word-wrap: break-word; width: 75.0; height: 75.0">
<a href=https://github.com/daluozha>
<img src=https://avatars.githubusercontent.com/u/35727398?v=4 width="50;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=- luozha -/>
Expand Down
15 changes: 8 additions & 7 deletions src/template/custom/ModelBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<div
v-if="item.show"
:ref="(el) => setRefItem(el, item.keyId)"
class="material-model-box"
:class="[
'material-model-box',
{ 'is-have-border': item.keyId === appStore.useSelectMaterialStore.cptKeyId }
]"
@click="selectModel"
@mouseover="handleMouseover"
@mouseleave="handleMouseleave"
Expand Down Expand Up @@ -52,15 +55,10 @@
const { cptKeyId } = storeToRefs(appStore.useSelectMaterialStore);
watch(
() => cptKeyId.value,
(newVal, oldVal) => {
// 判断是否选中复选框
if (oldVal && modelObj[oldVal]) {
modelObj[oldVal].el.style.borderColor = 'transparent';
}
(newVal) => {
// 如果选中了模块
if (newVal && modelObj[newVal]) {
modelObj[newVal].el.scrollIntoView({ behavior: 'smooth', block: 'center' }); // 该模块显示在可视区域内
modelObj[newVal].el.style.borderColor = '#7ec97e';
}
},
{
Expand Down Expand Up @@ -189,4 +187,7 @@
}
}
}
.is-have-border {
border-color: #7ec97e;
}
</style>
17 changes: 15 additions & 2 deletions src/views/custom/components/ModelBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
</el-tooltip>
<el-tooltip class="box-item" effect="dark" content="删除当前模块">
<div class="delete" @click.stop="useDeleteModel(item)">
<div class="delete" @click.stop="delModel">
<svg-icon
icon-name="icon-shanchu"
class-name="icon icon-shanchu"
Expand Down Expand Up @@ -114,7 +114,7 @@
}
};
// 传统布局删除
// 传统布局添加
const classicalAdd = () => {
let index: number = resumeJsonNewStore.value.COMPONENTS.findIndex(
(item) => item.keyId === props.item.keyId
Expand All @@ -123,6 +123,19 @@
insert.keyId = getUuid();
resumeJsonNewStore.value.COMPONENTS.splice(index, 0, insert);
};
// 删除当前模块
const delModel = () => {
if (resumeJsonNewStore.value.LAYOUT === 'classical') {
classicalDelete();
} else {
emit('leftRightDelete', props.item);
}
};
// 传统布局删除模块
const classicalDelete = () => {
useDeleteModel(props.item);
};
</script>
<style lang="scss" scoped>
.material-model-box {
Expand Down

1 comment on commit 9955078

@vercel
Copy link

@vercel vercel bot commented on 9955078 Apr 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

resume-design – ./

resume-design-kappa.vercel.app

Please sign in to comment.