Skip to content

Commit

Permalink
optimization: 执行方案删除失败后逻辑调整&&节点详情tab切换不支持滚动
Browse files Browse the repository at this point in the history
  • Loading branch information
ywywZhou authored and luofann committed Aug 31, 2023
1 parent 016aaba commit 7945ae9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
isCommon: this.isCommonProcess,
id: scheme.id
})
if (!resp.result) return
if (resp.result === false) return
const index = this.schemeList.findIndex(item => item.id === scheme.id)
this.schemeList.splice(index, 1)
// 删除方案后,画布按编辑前选中的方案来勾选节点
Expand Down
7 changes: 0 additions & 7 deletions frontend/desktop/src/pages/task/TaskExecute/ExecuteInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -996,12 +996,6 @@
if (['record', 'log'].includes(name)) {
this.onSelectExecuteRecord(this.theExecuteRecord)
}
const { top } = document.querySelector('.execute-info').getBoundingClientRect()
const scrollBoxDom = document.querySelector('.scroll-box')
const height = window.innerHeight - top
if (height < 700) {
scrollBoxDom.scrollTo({ top: height, behavior: 'smooth' })
}
},
onSelectNode (node) {
this.loading = true
Expand Down Expand Up @@ -1663,7 +1657,6 @@
}
.execute-info {
height: 100%;
min-height: 700px;
display: flex;
flex-direction: column;
padding-bottom: 0;
Expand Down
3 changes: 2 additions & 1 deletion frontend/desktop/src/pages/task/TaskList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@
if (this.deletaLoading) return
this.deletaLoading = true
try {
await this.deleteTask(taskId)
const resp = await this.deleteTask(taskId)
if (resp.result === false) return
// 最后一页最后一条删除后,往前翻一页
if (
this.pagination.current > 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<pre class="variable-type-desc" v-if="variableDesc">{{ variableDesc }}</pre>
</div>
<!-- 验证规则 -->
<div v-show="['input', 'textarea'].includes(theEditingData.custom_type) && !isInternalVal" class="form-item clearfix">
<div v-show="theEditingData.custom_type === 'input' && !isInternalVal" class="form-item clearfix">
<label class="form-label">{{ $t('正则校验') }}</label>
<div class="form-content">
<bk-input
Expand Down Expand Up @@ -277,7 +277,7 @@
varTypeListLoading: false,
varTypeList: [], // 变量类型,input、textarea、datetime 等
varTypeData: {},
inputRegexp: '', // input,textarea类型正则
inputRegexp: '', // input类型正则
atomConfigLoading: false,
atomTypeKey: '',
stringLength: STRING_LENGTH,
Expand Down Expand Up @@ -564,7 +564,7 @@
if (is_meta && source_type === 'component_inputs' && config.meta_transform) {
config = config.meta_transform(meta)
}
if (['input', 'textarea'].includes(custom_type)) {
if (custom_type === 'input') {
config.attrs.validation.push({
type: 'regex',
args: this.getInputDefaultValueValidation(),
Expand Down Expand Up @@ -628,13 +628,13 @@
// 隐藏状态下,默认值为必填项
// 输入框显示类型为隐藏时,按照正则规则校验,去掉必填项校验
if (show_type === 'show' || (show_type === 'hide' && ['input', 'textarea'].includes(custom_type))) {
if (show_type === 'show' || (show_type === 'hide' && custom_type === 'input')) {
return validateSet.slice(1)
} else {
return validateSet
}
},
// input/textarea 表单默认校验规则
// input 表单默认校验规则
getInputDefaultValueValidation () {
let validation = this.theEditingData.validation
if (this.theEditingData.show_type === 'show') {
Expand All @@ -649,8 +649,8 @@
? { set_module_ip_selector: tools.deepClone(this.renderData['ip_selector']) }
: tools.deepClone(this.renderData)
Object.assign(this.varTypeData, valData)
// 将input textarea类型正则存起来
if (['input', 'textarea'].includes(oldValue)) {
// 将input类型正则存起来
if (oldValue === 'input') {
this.inputRegexp = this.theEditingData.validation
}
let data
Expand All @@ -667,8 +667,8 @@
} else {
this.renderData = {}
}
// input textarea类型需要正则校验
if (['input', 'textarea'].includes(val)) {
// input类型需要正则校验
if (val === 'input') {
this.theEditingData.validation = this.inputRegexp || '^.+$'
} else {
this.theEditingData.validation = ''
Expand Down Expand Up @@ -709,7 +709,7 @@
const validateSet = this.getValidateSet()
this.$set(this.renderOption, 'validateSet', validateSet)
if (['input', 'textarea'].includes(this.theEditingData.custom_type)) {
if (this.theEditingData.custom_type === 'input') {
const config = tools.deepClone(this.renderConfig[0])
const regValidate = config.attrs.validation.find(item => item.type === 'regex')
regValidate.args = this.getInputDefaultValueValidation()
Expand Down

0 comments on commit 7945ae9

Please sign in to comment.