Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigDataSystem
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
bigDataSystem
Commits
b1470738
Commit
b1470738
authored
Dec 11, 2024
by
chenjiahao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数仓开发-数据加载-数据出湖&入湖修改
parent
e99aaa06
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
241 additions
and
135 deletions
+241
-135
dataEntry.data.ts
...taIntegration/dataLoading/dataEntryLake/dataEntry.data.ts
+0
-102
dataTransformationRuleModal.vue
...dataLoading/dataEntryLake/dataTransformationRuleModal.vue
+213
-3
databaseOfflineLoading.vue
...tion/dataLoading/dataEntryLake/databaseOfflineLoading.vue
+10
-29
offlineLoading.data.ts
...egration/dataLoading/dataEntryLake/offlineLoading.data.ts
+18
-1
No files found.
src/views/dataIntegration/dataLoading/dataEntryLake/dataEntry.data.ts
View file @
b1470738
...
...
@@ -316,108 +316,6 @@ export const FieldTypeMappingRuleFormSchema: FormSchema[] = [
},
];
export
const
DataTransformationRuleFormSchema
:
FormSchema
[]
=
[
{
field
:
'ruleName'
,
label
:
'规则名称'
,
component
:
'Input'
,
required
:
true
,
},
{
field
:
'selectiveDataTable'
,
label
:
'选择数据表'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'table_1'
,
value
:
'table_1'
},
{
label
:
'table_2'
,
value
:
'table_2'
},
{
label
:
'table_3'
,
value
:
'table_3'
},
{
label
:
'table_4'
,
value
:
'table_4'
},
],
},
required
:
true
,
},
{
field
:
'conversionResultWriting'
,
label
:
'转换结果写入'
,
component
:
'RadioGroup'
,
defaultValue
:
'覆盖已有字段'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
onChange
:
()
=>
{
const
flag
=
formModel
.
conversionResultWriting
===
'覆盖已有字段'
;
formActionType
.
updateSchema
([{
field
:
'selectExistingField'
,
ifShow
:
flag
}]);
formActionType
.
updateSchema
([{
field
:
'newFieldName'
,
ifShow
:
!
flag
}]);
formActionType
.
updateSchema
([{
field
:
'newFieldType'
,
ifShow
:
!
flag
}]);
},
options
:
[
{
label
:
'覆盖已有字段'
,
value
:
'覆盖已有字段'
},
{
label
:
'写入新增字段'
,
value
:
'写入新增字段'
},
],
}),
},
{
field
:
'selectExistingField'
,
label
:
'选择已有字段'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'total_amount'
,
value
:
'total_amount'
},
{
label
:
'payment_id'
,
value
:
'payment_id'
},
{
label
:
'position'
,
value
:
'position'
},
{
label
:
'employee_id'
,
value
:
'employee_id'
},
],
},
required
:
true
,
ifShow
:
true
,
},
{
field
:
'newFieldName'
,
label
:
'新增字段名称'
,
component
:
'Input'
,
required
:
true
,
ifShow
:
false
,
},
{
field
:
'newFieldType'
,
label
:
'新增字段类型'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'int'
,
value
:
'int'
},
{
label
:
'bigint'
,
value
:
'bigint'
},
{
label
:
'decimal'
,
value
:
'decimal'
},
{
label
:
'varchar'
,
value
:
'varchar'
},
{
label
:
'string'
,
value
:
'string'
},
{
label
:
'timestamp'
,
value
:
'timestamp'
},
],
},
required
:
true
,
ifShow
:
false
,
},
{
field
:
'conversionRule'
,
label
:
'转换规则'
,
component
:
'RadioGroup'
,
defaultValue
:
'配置规则'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
onChange
:
()
=>
{
const
flag
=
formModel
.
conversionRule
===
'自定义'
;
formActionType
.
updateSchema
([{
field
:
'customRule'
,
ifShow
:
flag
}]);
},
options
:
[
{
label
:
'配置规则'
,
value
:
'配置规则'
},
{
label
:
'自定义'
,
value
:
'自定义'
},
],
}),
},
{
field
:
'customRule'
,
label
:
'自定义规则'
,
component
:
'InputTextArea'
,
ifShow
:
false
,
},
];
export
const
FieldNameMappingRuleFormSchema
:
FormSchema
[]
=
[
{
field
:
'ruleName'
,
...
...
src/views/dataIntegration/dataLoading/dataEntryLake/dataTransformationRuleModal.vue
View file @
b1470738
...
...
@@ -6,16 +6,205 @@
@
ok=
"handleSubmit"
minHeight=
"50"
>
<BasicForm
@
register=
"registerForm"
/>
<BasicForm
@
register=
"registerForm"
>
<template
#
functionExpressionTableSlot
>
<div
style=
"width: 100%; margin-bottom: 20px"
>
<a-button
style=
"width: 100%"
type=
"primary"
>
参数解析
</a-button>
</div>
<div>
<BasicTable
@
register=
"registerDataTransformationRuleTable"
/>
</div>
</
template
>
</BasicForm>
</BasicModal>
</template>
<
script
lang=
"ts"
setup
>
import
{
onMounted
}
from
'vue'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'@/components/Modal'
;
import
{
BasicTable
,
FormSchema
,
useTable
}
from
'@/components/Table'
;
import
{
BasicForm
,
useForm
}
from
'@/components/Form'
;
import
{
DataTransformationRuleFormSchema
}
from
'./dataEntry
.data'
;
import
{
dataTransformationRuleColumns
}
from
'@/views/dataIntegration/dataLoading/dataEntryLake/offlineLoading
.data'
;
let
dataTransformationRuleTableData
=
ref
([]);
let
functionExpressionValue
=
ref
(
''
);
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
DataTransformationRuleFormSchema
:
FormSchema
[]
=
[
{
field
:
'ruleName'
,
label
:
'规则名称'
,
component
:
'Input'
,
required
:
true
,
},
{
field
:
'selectiveDataTable'
,
label
:
'选择数据表'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'table_1'
,
value
:
'table_1'
},
{
label
:
'table_2'
,
value
:
'table_2'
},
{
label
:
'table_3'
,
value
:
'table_3'
},
{
label
:
'table_4'
,
value
:
'table_4'
},
],
},
required
:
true
,
},
{
field
:
'conversionResultWriting'
,
label
:
'转换结果写入'
,
component
:
'RadioGroup'
,
defaultValue
:
'覆盖已有字段'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
onChange
:
()
=>
{
const
flag
=
formModel
.
conversionResultWriting
===
'覆盖已有字段'
;
formActionType
.
updateSchema
([{
field
:
'selectExistingField'
,
ifShow
:
flag
}]);
formActionType
.
updateSchema
([{
field
:
'newFieldName'
,
ifShow
:
!
flag
}]);
formActionType
.
updateSchema
([{
field
:
'newFieldType'
,
ifShow
:
!
flag
}]);
},
options
:
[
{
label
:
'覆盖已有字段'
,
value
:
'覆盖已有字段'
},
{
label
:
'写入新增字段'
,
value
:
'写入新增字段'
},
],
}),
},
{
field
:
'selectExistingField'
,
label
:
'选择已有字段'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'total_amount'
,
value
:
'total_amount'
},
{
label
:
'payment_id'
,
value
:
'payment_id'
},
{
label
:
'position'
,
value
:
'position'
},
{
label
:
'employee_id'
,
value
:
'employee_id'
},
],
},
required
:
true
,
ifShow
:
true
,
},
{
field
:
'newFieldName'
,
label
:
'新增字段名称'
,
component
:
'Input'
,
required
:
true
,
ifShow
:
false
,
},
{
field
:
'newFieldType'
,
label
:
'新增字段类型'
,
component
:
'Select'
,
componentProps
:
{
options
:
[
{
label
:
'int'
,
value
:
'int'
},
{
label
:
'bigint'
,
value
:
'bigint'
},
{
label
:
'decimal'
,
value
:
'decimal'
},
{
label
:
'varchar'
,
value
:
'varchar'
},
{
label
:
'string'
,
value
:
'string'
},
{
label
:
'timestamp'
,
value
:
'timestamp'
},
],
},
required
:
true
,
ifShow
:
false
,
},
{
field
:
'conversionRule'
,
label
:
'转换规则'
,
component
:
'RadioGroup'
,
defaultValue
:
'配置规则'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
onChange
:
()
=>
{
const
flag
=
formModel
.
conversionRule
===
'自定义'
;
formActionType
.
updateSchema
([{
field
:
'customRule'
,
ifShow
:
flag
}]);
formActionType
.
updateSchema
([{
field
:
'functionExpression'
,
ifShow
:
!
flag
}]);
formActionType
.
updateSchema
([{
field
:
'functionExpressionTableSlot'
,
ifShow
:
!
flag
}]);
},
options
:
[
{
label
:
'配置规则'
,
value
:
'配置规则'
},
{
label
:
'自定义'
,
value
:
'自定义'
},
],
}),
},
{
field
:
'customRule'
,
label
:
'自定义规则'
,
component
:
'InputTextArea'
,
ifShow
:
false
,
},
{
field
:
'functionExpression'
,
label
:
'函数表达式'
,
component
:
'Select'
,
componentProps
:
({
formModel
,
formActionType
})
=>
({
onChange
:
()
=>
{
functionExpressionValue
.
value
=
formModel
.
functionExpression
;
const
regex
=
/
\$\{(\w
+
)\}
/g
;
const
matches
=
[...
functionExpressionValue
.
value
.
matchAll
(
regex
)];
dataTransformationRuleTableData
.
value
=
matches
.
map
((
match
)
=>
({
parameterName
:
match
[
1
],
}));
reload
();
// console.log(dataTransformationRuleTableData.value);
},
options
:
[
{
label
:
'变更字段名'
,
value
:
'ALTER TABLE ${table_name} CHANGE ${old_column_name} ${new_column_name} ${column_type};'
,
},
{
label
:
'变更字段数据类型'
,
value
:
'ALTER TABLE ${table_name} MODIFY ${column_name} ${new_column_type};'
,
},
{
label
:
'添加新字段'
,
value
:
'ALTER TABLE ${table_name} ADD COLUMN ${new_column_name} ${column_type} ${default_value};'
,
},
{
label
:
'删除字段'
,
value
:
'ALTER TABLE ${table_name} DROP COLUMN ${column_name};'
,
},
{
label
:
'重命名表'
,
value
:
'RENAME TABLE ${old_table_name} TO ${new_table_name};'
,
},
{
label
:
'创建索引'
,
value
:
'CREATE INDEX ${index_name} ON ${table_name} (${column_name});'
,
},
{
label
:
'删除索引'
,
value
:
'DROP INDEX ${index_name} ON ${table_name};'
,
},
{
label
:
'添加主键'
,
value
:
'ALTER TABLE ${table_name} ADD PRIMARY KEY (${column_name});'
,
},
{
label
:
'移除主键'
,
value
:
'ALTER TABLE ${table_name} DROP PRIMARY KEY;'
,
},
{
label
:
'添加外键约束'
,
value
:
'ALTER TABLE ${table_name} ADD CONSTRAINT ${constraint_name} FOREIGN KEY (${column_name}) REFERENCES ${referenced_table_name}(${referenced_column_name});'
,
},
{
label
:
'移除外键约束'
,
value
:
'ALTER TABLE ${table_name} DROP FOREIGN KEY ${constraint_name};'
,
},
],
}),
required
:
true
,
},
{
field
:
'functionExpressionTableSlot'
,
label
:
''
,
slot
:
'functionExpressionTableSlot'
,
},
];
const
[
registerForm
,
{
validate
}]
=
useForm
({
labelWidth
:
100
,
baseColProps
:
{
span
:
24
},
...
...
@@ -28,6 +217,27 @@
//初始化弹框
const
[
registerModal
,
{
closeModal
,
setModalProps
}]
=
useModalInner
(
async
()
=>
{});
const
[
registerDataTransformationRuleTable
,
{
reload
}]
=
useTable
({
api
:
async
()
=>
{
const
response
=
{
pageNu
:
'1'
,
pageSize
:
'5'
,
pages
:
'1'
,
total
:
dataTransformationRuleTableData
.
value
.
length
,
code
:
''
,
message
:
''
,
data
:
dataTransformationRuleTableData
.
value
,
};
return
{
...
response
};
},
scroll
:
{
y
:
300
},
rowKey
:
'businessId'
,
columns
:
dataTransformationRuleColumns
,
showTableSetting
:
false
,
showIndexColumn
:
false
,
bordered
:
false
,
});
async
function
handleSubmit
()
{
try
{
setModalProps
({
confirmLoading
:
true
});
...
...
src/views/dataIntegration/dataLoading/dataEntryLake/databaseOfflineLoading.vue
View file @
b1470738
...
...
@@ -104,7 +104,7 @@
:accept=
"['.xlsx, .xls']"
>
<template
#
uploadBtnName
>
{{
1231231
}}
<span>
导入文件
</span>
</
template
>
</BasicUpload>
</div>
...
...
@@ -2234,34 +2234,15 @@
}
function
updateDestinationConfiguration
()
{
updateDestinationConfigurationSchema
({
field
:
'CodePreview'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'configurationForm'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'switchToTheConfigurationItem'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'customQuerySQL'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'editSQL'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'SQLPreview'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
({
field
:
'span'
,
ifShow
:
!
[
0
,
1
].
includes
(
configurationModeFlag
.
value
),
});
updateDestinationConfigurationSchema
([
{
field
:
'CodePreview'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'configurationForm'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'switchToTheConfigurationItem'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'customQuerySQL'
,
ifShow
:
[
0
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'editSQL'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'SQLPreview'
,
ifShow
:
[
1
].
includes
(
configurationModeFlag
.
value
)
},
{
field
:
'span'
,
ifShow
:
!
[
0
,
1
].
includes
(
configurationModeFlag
.
value
)
},
]);
}
function
configurationTableOnClick
(
record
)
{
...
...
src/views/dataIntegration/dataLoading/dataEntryLake/offlineLoading.data.ts
View file @
b1470738
...
...
@@ -93,7 +93,7 @@ export const partitionKeyColumns: BasicColumn[] = [
{
label
:
'CHAR'
,
value
:
'CHAR'
},
{
label
:
'BOOLEAN'
,
value
:
'BOOLEAN'
},
],
}
}
,
},
];
...
...
@@ -289,6 +289,23 @@ export const compareSearchFormSchema: FormSchema[] = [
},
];
export
const
dataTransformationRuleColumns
:
BasicColumn
[]
=
[
{
title
:
'参数名'
,
dataIndex
:
'parameterName'
,
},
{
title
:
'实际值'
,
dataIndex
:
'parameterValue'
,
editable
:
true
,
edit
:
true
,
editComponent
:
'Input'
,
editComponentProps
:
{
placeholder
:
'请输入'
,
}
},
];
export
const
tableListSearchFormSchema
:
FormSchema
[]
=
[
{
field
:
'name'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment