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
22 changes: 18 additions & 4 deletions packages/dag/src/components/form/field-processor/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { debounce } from 'lodash'
import i18n from '@tap/i18n'
import { defineComponent, ref, reactive, nextTick, watch } from '@vue/composition-api'
import { defineComponent, ref, reactive, nextTick, watch, computed } from '@vue/composition-api'
import { metadataInstancesApi, taskApi } from '@tap/api'
import { FormItem } from '@tap/form'
import { useForm } from '@tap/form'
Expand Down Expand Up @@ -98,6 +98,19 @@ export const FieldRenameProcessor = defineComponent({
tableList.value = config.target
}
}

const filterFieldList = computed(() => {
const search = config.searchField.trim().toLowerCase()
if (search) {
return tableList.value.filter(v => {
let str = (v.sourceFieldName + '' + v.targetFieldName).toLowerCase()
return str.includes(search)
})
} else {
return tableList.value
}
})

let fieldsMapping = props.value || []
const restOp = {
prefix: '',
Expand Down Expand Up @@ -405,6 +418,7 @@ export const FieldRenameProcessor = defineComponent({
return {
list,
tableList,
filterFieldList,
config,
loadData,
doVisible,
Expand Down Expand Up @@ -432,7 +446,7 @@ export const FieldRenameProcessor = defineComponent({
<ElInput
size="mini"
placeholder={i18n.t('packages_form_field_mapping_list_qingshurubiaoming')}
suffix-icon="el-icon-search"
prefix-icon="el-icon-search"
clearable
v-model={this.config.searchTable}
onInput={this.doSearchTables}
Expand Down Expand Up @@ -515,7 +529,7 @@ export const FieldRenameProcessor = defineComponent({
<ElInput
size="mini"
placeholder={i18n.t('packages_form_field_mapping_list_qingshuruziduan')}
suffix-icon="el-icon-search"
prefix-icon="el-icon-search"
clearable
v-model={this.config.searchField}
onInput={this.doSearchField}
Expand All @@ -542,7 +556,7 @@ export const FieldRenameProcessor = defineComponent({
border
height="100%"
ref={'table'}
data={this.tableList}
data={this.filterFieldList}
v-loading={this.config.loadingTable}
row-class-name={this.tableRowClassName}
onSelection-change={this.doSelectionField}
Expand Down
16 changes: 2 additions & 14 deletions packages/dag/src/nodes/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,6 @@ export class Table extends NodeType {
title: i18n.t('packages_dag_nodes_table_gengxintiaojianzi'),
type: 'array',
'x-index': 1,
// required: true,
default: null,
description: `{{ !$isDaas ? "${i18n.t(
'packages_dag_nodes_table_isDaa_ruguoyuanweimongodb'
)}" : ""}}`,
Expand All @@ -1065,21 +1063,11 @@ export class Table extends NodeType {
'x-reactions': [
`{{useAsyncDataSourceByConfig({service: loadNodeFieldOptions, withoutField: true}, $values.$inputs[0])}}`,
{
dependencies: ['$inputs'],
// 源节点连线时,字段值为null并且模型获取到后执行
// when: '{{$deps[0].length && !$self.value && $self.dataSource && $self.dataSource.length}}',
effects: ['onFieldMount'],
fulfill: {
run: `$self.validate()`
run: '$self.visible && $self.validate(); console.log("updateConditionFields", $self)'
}
}
/*{
dependencies: ['$inputs'],
// 断开源节点的连线,如果更新条件为空[],设置值为null(为了下次连线触发设置默认值)
when: '{{!$deps[0].length && $self.value && $self.value.length === 0}}',
fulfill: {
run: `$self.value=null`
}
}*/
],
'x-validator': {
validator: `{{async (value, rule, ctx) => {
Expand Down