Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

验收会问题修复 #7124

Merged
merged 1 commit into from
Oct 12, 2023
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
Binary file modified frontend/desktop/src/assets/fonts/bksops-icon.eot
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/desktop/src/assets/fonts/bksops-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/desktop/src/assets/fonts/bksops-icon.ttf
Binary file not shown.
Binary file modified frontend/desktop/src/assets/fonts/bksops-icon.woff
Binary file not shown.
27 changes: 21 additions & 6 deletions frontend/desktop/src/components/common/RenderForm/FormGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<i
:class="['common-icon-variable-hook hook-icon', { actived: hook, disabled: !option.formEdit || !render }]"
v-bk-tooltips="{
content: hook ? $t('恢复为非变量节点内维护') : $t('转换为变量集中维护'),
content: hook ? $t('取消使用变量,节点内维护') : $t('转换为变量,集中维护'),
placement: 'bottom',
zIndex: 3000
}"
Expand Down Expand Up @@ -425,7 +425,15 @@
background: #ffeeec;
}
&.rf-has-hook .rf-tag-form {
margin-right: 45px;
margin-right: 40px;
}
&.show-render {
> .rf-tag-form {
margin-right: 58px;
}
.hook-icon {
padding-right: 3px !important;
}
}
.rf-group-name {
display: block
Expand All @@ -446,15 +454,17 @@
display: flex;
align-items: center;
justify-content: center;
padding: 0 8px;
height: 32px;
background: #f0f1f5;
border-radius: 2px;
cursor: pointer;
z-index: 1;
.hook-icon {
font-size: 16px;
.hook-icon,
.render-skip-icon {
height: 32px;
line-height: 32px;
font-size: 12px;
color: #979ba5;
cursor: pointer;
&.disabled {
color: #c4c6cc;
cursor: not-allowed;
Expand All @@ -464,8 +474,13 @@
}
}
.hook-icon {
line-height: 33px;
padding: 0 8px;
font-size: 16px;
}
.render-skip-icon {
padding: 0 8px 0 3px;
}
.icon-angle-up-fill {
font-size: 12px;
color: #c4c6cc;
Expand Down
18 changes: 12 additions & 6 deletions frontend/desktop/src/components/common/RenderForm/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,15 @@
}
&.rf-has-hook {
& > .rf-tag-form {
margin-right: 45px;
margin-right: 40px;
}
}
&.show-render {
> .rf-tag-form {
margin-right: 64px;
margin-right: 58px;
}
.hook-icon {
padding-right: 3px !important;
}
}
&.rf-col-layout {
Expand Down Expand Up @@ -548,16 +551,17 @@
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
height: 32px;
background: #f0f1f5;
border-radius: 2px;
z-index: 1;
cursor: pointer;
.hook-icon,
.render-skip-icon {
font-size: 14px;
height: 32px;
line-height: 32px;
font-size: 12px;
color: #979ba5;
cursor: pointer;
&.disabled {
color: #c4c6cc;
cursor: not-allowed;
Expand All @@ -567,10 +571,12 @@
}
}
.hook-icon {
line-height: 31px;
padding: 0 8px;
font-size: 16px;
}
.render-skip-icon {
margin-left: 7px;
padding: 0 8px 0 3px;
}
.icon-angle-up-fill {
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@
}
})
})
} else if (this.decorationsMap[lineNumber]) {
this.decorationsMap[lineNumber].forEach(decorations => {
monacoInstance.deltaDecorations(
[...decorations],
[]
)
} else {
Object.keys(this.decorationsMap).forEach(key => {
this.decorationsMap[key].forEach(decorations => {
monacoInstance.deltaDecorations(
[...decorations],
[]
)
})
})
this.decorationsMap = {}
}
Expand Down
62 changes: 40 additions & 22 deletions frontend/desktop/src/components/common/RenderForm/tags/TagInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
<li
class="rf-select-item"
v-for="item in varList"
v-bk-overflow-tips
:key="item"
:class="{ 'is-hover': hoverKey === item }"
@click.stop="onSelectVal(item)">
{{ item }}
:key="item.key"
:class="{ 'is-hover': hoverKey === item.key }"
@click.stop="onSelectVal(item.key)">
<span class="key">{{ item.key }}</span>
<span class="name" v-bk-overflow-tips>{{ item.name }}</span>
</li>
</ul>
</div>
Expand Down Expand Up @@ -122,14 +122,14 @@
}),
constantArr: {
get () {
let Keylist = []
let KeyList = []
if (this.constants) {
Keylist = [...Object.keys(this.constants)]
KeyList = [...Object.values(this.constants)]
}
if (this.internalVariable) {
Keylist = [...Keylist, ...Object.keys(this.internalVariable)]
KeyList = [...KeyList, ...Object.values(this.internalVariable)]
}
return Keylist
return KeyList
},
set (val) {
this.varList = val
Expand Down Expand Up @@ -330,7 +330,7 @@
matchResult = [matchText]
}
if (matchResult && matchResult[0]) {
this.varList = this.constantArr.filter(item => item.indexOf(matchText) > -1)
this.varList = this.constantArr.filter(item => item.key.indexOf(matchText) > -1)
// 计算变量下拉列表的left
this.isListOpen = false
if (this.varList.length) {
Expand All @@ -352,11 +352,10 @@
this.$el.appendChild(newDom)
const focusValueWidth = newDom.offsetWidth || 0
this.$el.removeChild(newDom)
let right = inputWidth - 238 - previousDomLeft - previousDomWidth - focusValueWidth
right = right > 0 ? right : 0
this.varListPositionRight = right
this.$nextTick(() => {
const { height: varListHeight } = document.querySelector('.rf-select-list').getBoundingClientRect()
const { width: varListWidth, height: varListHeight } = document.querySelector('.rf-select-list').getBoundingClientRect()
let right = inputWidth - varListWidth - previousDomLeft - previousDomWidth - focusValueWidth
right = right > 0 ? right : 0
const top = window.innerHeight < inputTop + 30 + varListHeight + 50 ? -95 : 30
this.varListPosition = `right: ${right}px; top: ${top}px`
})
Expand All @@ -382,9 +381,14 @@
// 获取行内纯文本
const divInputDom = this.$el.querySelector('.div-input')
let inputValue = divInputDom.textContent
inputValue.replace(' ', ' ')
if (divInputDom.childNodes.length) {
inputValue = Array.from(divInputDom.childNodes).map(item => {
return item.type === 'button' ? item.value : item.textContent
return item.type === 'button'
? item.value
: item.textContent.trim() === ''
? ' '
: item.textContent.replace(/&nbsp;/g, ' ')
}).join('')
}
this.input.value = inputValue
Expand All @@ -410,7 +414,7 @@
let isExistVar = false
if ($0) {
isExistVar = this.constantArr.some(item => {
const varText = item.slice(2, -1)
const varText = item.key.slice(2, -1)
if ($0.indexOf(varText) > -1) {
const regexp = new RegExp(`^(.*\\W|\\W)?${varText}(\\W|\\W.*)?$`)
return regexp.test($0)
Expand Down Expand Up @@ -451,12 +455,12 @@
if (len) {
event.preventDefault()
event.stopPropagation()
let curIndex = this.varList.findIndex(item => item === this.hoverKey)
let curIndex = this.varList.findIndex(item => item.key === this.hoverKey)
curIndex = event.code === 'ArrowDown' ? curIndex + 1 : curIndex - 1
curIndex = curIndex > len - 1 ? 0 : (curIndex < 0 ? len - 1 : curIndex)
const option = this.varList[curIndex]
if (option) {
this.hoverKey = option
this.hoverKey = option.key
const selectDom = this.$el.querySelector('.rf-select-content')
const hoverItemDom = selectDom.querySelector('.is-hover')
if (hoverItemDom) {
Expand Down Expand Up @@ -487,12 +491,17 @@
position: absolute;
top: 30px;
right: 0;
width: 238px;
max-width: 600px;
background: #ffffff;
border: 1px solid #dcdee5;
border-radius: 2px;
box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
box-shadow: 0 3px 9px 0 rgba(0,0,0,.1);
overflow-y: hidden;
z-index: 100;
.name {
color: #c4c6cc;
margin-left: 16px;
}
}
.rf-select-content {
max-height: 100px;
Expand All @@ -501,12 +510,21 @@
@include scrollbar;
}
.rf-select-item {
display: flex;
align-items: center;
padding: 0 10px;
line-height: 32px;
font-size: 12px;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
> span {
flex-shrink: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.name {
max-width: 250px;
}
&.is-hover,
&:hover {
background: #f5f7fa;
Expand Down
Loading
Loading