Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/common/component/BindI18n.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ export default {

<style lang="less" scoped>
.languageContent {
width: 254px;
border-radius: 5px;
text-align: center;
z-index: 99;
margin-top: 5px;
margin-bottom: 16px;

.tiny-svg {
margin-right: 10px;
Expand All @@ -184,7 +183,6 @@ export default {
}
}
.tiny-button {
margin-top: 10px;
max-width: initial;
padding: 0 12px;
background-color: var(--ti-lowcode-tabs-border-color);
Expand All @@ -196,18 +194,24 @@ export default {
}
}
.addNewLanguage {
padding: 0px 5px 5px;
.tiny-input {
display: flex;
margin-bottom: 10px;
padding: 0 8px;
align-items: center;
label {
width: 80px;
text-wrap: nowrap;
text-align: left;
width: 50px;
}
display: flex;
}
.tiny-input__inner {
flex: 1;
}
.add-btns {
text-align: right;
padding: 0 8px;
}
}
}
Expand Down
31 changes: 22 additions & 9 deletions packages/common/component/BlockDescription.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<meta-description class="description" type="warning">
<meta-description class="description">
<template #content>
<div @click="openBlockSetting" class="setting-block"><span class="add-icon">+</span>设置区块暴露属性</div>
<div @click="openBlockSetting" class="setting-block">
<svg-icon name="block-add-prop"></svg-icon>
<span>设置区块暴露属性</span>
</div>
</template>
</meta-description>
</template>
Expand Down Expand Up @@ -33,17 +36,27 @@ export default {

<style lang="less" scoped>
.description {
border-color: var(--ti-lowcode-description-color);
font-size: 12px;

&.wrapper {
height: 28px;
padding: 0 12px;
border-left: 0;
box-shadow: none;
border-radius: 4px;
display: flex;
align-items: center;
}

.setting-block {
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
}
.add-icon {
padding: 0 3px;
margin: 0 5px;
color: var(--ti-lowcode-toolbar-icon-color);
border-radius: 50%;
background-color: var(--ti-lowcode-description-color);

.svg-icon {
font-size: 16px;
}
}
</style>
89 changes: 60 additions & 29 deletions packages/common/component/BlockLinkField.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<template>
<tiny-popover class="block-link-field" popper-class="option-popper block-new-attr-popover">
<template #reference>
<span class="link-icon">+</span>
<div>
<span class="icon-wrap bind-prop">
<svg-icon name="block-bind-prop"></svg-icon>
</span>
<span class="icon-wrap add-prop">
<svg-icon name="block-add-prop"></svg-icon>
</span>
</div>
</template>
<ul class="context-menu">
<li v-if="isLinked" class="menu-item" @click="unLink(data)">取消关联</li>
<li v-else class="menu-item" @click="addProperty(data)">+ 新建属性</li>
<li class="menu-item" @click="openBlockSetting">管理属性</li>
<li v-for="item in properties" :key="item.property" class="menu-item">
{{ item.property }}
<li v-else class="menu-item" @click="addProperty(data)">
<svg-icon name="plus-circle"></svg-icon>
<span>创建并链接新属性</span>
</li>
<li class="menu-item" @click="openBlockSetting">
<svg-icon name="setting"></svg-icon>
<span>打开属性面板</span>
</li>
<li v-for="item in properties" :key="item.property" class="menu-item property">
<span>{{ item.property }}</span>
<span v-if="item.property !== data?.linked?.blockProperty" class="link-item" @click="editProperty(item)">
关联
</span>
Expand Down Expand Up @@ -51,14 +64,12 @@ export default {
state.newPropertyName = ''

confirm({
title: '新建区块属性',
title: '属性名称',
status: 'custom',
message: {
render() {
return (
<div>
<div>此新字段将自动链接到此属性</div>
<br />
<TinyInput placeholder="请输入字段名称" v-model={state.newPropertyName}></TinyInput>
</div>
)
Expand Down Expand Up @@ -141,49 +152,69 @@ export default {
}
</script>
<style lang="less" scoped>
.link-icon {
width: 16px;
height: 16px;
margin: 0 5px;
border-radius: 50%;
line-height: 16px;
text-align: center;
color: var(--ti-lowcode-block-link-field-link-icon-color);
background-color: var(--ti-lowcode-block-link-field-link-icon-bg-color);
cursor: pointer;
&:hover {
transform: scale(1.2);
.icon-wrap {
position: absolute;
top: 0;
left: 0;
z-index: 100;
transform: translate(-50%, -50%);

.svg-icon {
font-size: 14px;
}

&:hover .svg-icon {
transform: scale(1.25);
}

&.bind-prop {
z-index: 30;
&:hover {
z-index: 10;
}
}

&.add-prop {
z-index: 20;
&:hover {
z-index: 40;
}
}
}

.context-menu {
width: 200px;
padding: 3px 0;
padding: 8px 0;
border-radius: 3px;
display: flex;
flex-direction: column;
.menu-item {
line-height: 18px;
color: var(--ti-lowcode-attr-popover-menu-item-color);
display: flex;
justify-content: space-between;
padding: 6px 15px;
align-items: center;
gap: 4px;
padding: 4px 12px;
cursor: pointer;
&:hover {
background: var(--ti-lowcode-attr-popover-menu-item-hover-bg-color);
}

&.property {
justify-content: space-between;
}
.link-item {
cursor: pointer;
background-color: var(--ti-lowcode-attr-popover-menu-item-link-item-bg-color);
color: var(--ti-lowcode-attr-popover-menu-item-link-item-color);
padding: 2px 6px;
border-radius: 2px;
color: var(--te-common-text-emphasize);
}
}

.svg-icon {
font-size: 16px;
}
}
</style>
<style lang="less">
.tiny-popover.tiny-popper.block-new-attr-popover {
.tiny-popover.tiny-popper.tiny-popper.block-new-attr-popover[x-placement] {
// 这里不知为啥要添加 max-height,后续确认无用可删除
max-height: 65vh;
padding: 0;
Expand Down
2 changes: 2 additions & 0 deletions packages/common/component/ConfigItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ export default {
justify-content: space-between;
align-items: center;
overflow: hidden;
position: relative;
overflow: visible;
&:has(.verify-failed) {
align-items: flex-start;
}
Expand Down
15 changes: 15 additions & 0 deletions packages/design-core/assets/block-add-prop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions packages/design-core/assets/block-bind-prop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/settings/props/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ export default {

<style lang="less" scoped>
.block-description {
margin: 10px;
margin: 12px;
}
</style>