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
0a141e52
Commit
0a141e52
authored
Nov 27, 2024
by
曹泽华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数仓开发 策略指标
parent
1262279f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
31 deletions
+116
-31
index.vue
src/views/realTimeSync/strategicIndicators/index.vue
+78
-29
strategic.data.ts
src/views/realTimeSync/strategicIndicators/strategic.data.ts
+36
-0
strategicData.ts
src/views/realTimeSync/strategicIndicators/strategicData.ts
+2
-2
No files found.
src/views/realTimeSync/strategicIndicators/index.vue
View file @
0a141e52
...
@@ -13,7 +13,9 @@
...
@@ -13,7 +13,9 @@
style=
"width: 150px; margin-left: 10px"
style=
"width: 150px; margin-left: 10px"
:options=
"typeOptions"
:options=
"typeOptions"
/>
/>
<a-button
type=
"link"
><PlusOutlined
style=
"color: #9396a4"
/></a-button>
<a-button
type=
"link"
@
click=
"handleAdd"
><PlusOutlined
style=
"color: #9396a4"
/></a-button>
</div>
</div>
</
template
>
</
template
>
<
template
#
strategicName=
"{ text, record }"
>
<
template
#
strategicName=
"{ text, record }"
>
...
@@ -32,13 +34,23 @@
...
@@ -32,13 +34,23 @@
<!-- ><PlusOutlined style="color: #9396a4"-->
<!-- ><PlusOutlined style="color: #9396a4"-->
<!-- /></a-button>-->
<!-- /></a-button>-->
<div
class=
"w-3/4"
>
<div
class=
"w-3/4"
>
<div
v-if=
"title
Nam
e !== null"
style=
"display: flex; justify-content: space-between"
>
<div
v-if=
"title
Typ
e !== null"
style=
"display: flex; justify-content: space-between"
>
<div
style=
"font-size: 16px; font-weight: 650; margin: 0 0 20px 20px"
>
{{
<div
style=
"font-size: 16px; font-weight: 650; margin: 0 0 20px 20px"
>
{{
titleName
titleName
}}
</div>
}}
</div>
<div><a-button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</a-button></div>
<div>
<a-button
type=
"primary"
@
click=
"handleDelete"
>
删除
</a-button>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</a-button>
</div>
</div>
</div>
<BasicForm
v-show=
"titleName === '一致性检查默认策略'"
@
register=
"registerCheck"
>
<div
v-if=
"isAdd"
>
<div
style=
"text-align: right"
>
<a-button
type=
"primary"
@
click=
"handleSubmit"
>
保存
</a-button>
</div>
<BasicForm
@
register=
"registerAdd"
/>
</div>
<BasicForm
v-show=
"titleType === '一致性检查策略“'"
@
register=
"registerCheck"
>
<
template
#
strategicType=
"{ field, model }"
>
<
template
#
strategicType=
"{ field, model }"
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
...
@@ -56,13 +68,13 @@
...
@@ -56,13 +68,13 @@
</
template
>
</
template
>
</BasicForm>
</BasicForm>
<BasicForm
<BasicForm
v-show=
"title
Name !== null && titleName !== '一致性检查默认
策略'"
v-show=
"title
Type !== null && titleType !== '一致性检查
策略'"
@
register=
"registerForm"
@
register=
"registerForm"
>
>
<
template
#
strategicType=
"{ field, model }"
>
<
template
#
strategicType=
"{ field, model }"
>
<div
<div
v-if=
"title
Name === 'DB-DB源端DDL处理默认
策略'"
v-if=
"title
Type === 'DB-DB源端DDL处理
策略'"
v-show=
"title
Name === 'DB-DB源端DDL处理默认
策略'"
v-show=
"title
Type === 'DB-DB源端DDL处理
策略'"
>
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
...
@@ -73,8 +85,8 @@
...
@@ -73,8 +85,8 @@
/>
/>
</div>
</div>
<div
<div
v-if=
"title
Name === 'DB-Kafka源端DDL处理默认
策略'"
v-if=
"title
Type === 'DB-Kafka源端DDL处理
策略'"
v-show=
"title
Name === 'DB-Kafka源端DDL处理默认
策略'"
v-show=
"title
Type === 'DB-Kafka源端DDL处理
策略'"
>
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
...
@@ -84,10 +96,7 @@
...
@@ -84,10 +96,7 @@
message=
"含义:源端表对象进行DDL,任务应对策略配置。"
message=
"含义:源端表对象进行DDL,任务应对策略配置。"
/>
/>
</div>
</div>
<div
<div
v-if=
"titleType === '系统异常策略'"
v-show=
"titleType === '系统异常策略'"
>
v-if=
"titleName === '系统异常默认策略'"
v-show=
"titleName === '系统异常默认策略'"
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
style=
"margin-top: 20px"
style=
"margin-top: 20px"
...
@@ -97,10 +106,7 @@
...
@@ -97,10 +106,7 @@
/>
/>
<SystemStrategic
/>
<SystemStrategic
/>
</div>
</div>
<div
<div
v-if=
"titleType === '数据异常策略'"
v-show=
"titleType === '数据异常策略'"
>
v-if=
"titleName === '目标端数据异常默认策略'"
v-show=
"titleName === '目标端数据异常默认策略'"
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
style=
"margin-top: 20px"
style=
"margin-top: 20px"
...
@@ -116,10 +122,7 @@
...
@@ -116,10 +122,7 @@
/>
/>
<ErrorStrategic
/>
<ErrorStrategic
/>
</div>
</div>
<div
<div
v-if=
"titleType === '数据积压策略'"
v-show=
"titleType === '数据积压策略'"
>
v-if=
"titleName === '数据积压默认策略'"
v-show=
"titleName === '数据积压默认策略'"
>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Select
v-model:value=
"model[field]"
:options=
"typeOptions"
/>
<Alert
<Alert
style=
"margin-top: 20px"
style=
"margin-top: 20px"
...
@@ -170,6 +173,7 @@
...
@@ -170,6 +173,7 @@
errorFormSchema
,
errorFormSchema
,
backlogFormSchema
,
backlogFormSchema
,
checkFormSchema
,
checkFormSchema
,
addFormSchema
,
}
from
'./strategic.data'
;
}
from
'./strategic.data'
;
import
{
useForm
}
from
'@/components/Form'
;
import
{
useForm
}
from
'@/components/Form'
;
import
SystemStrategic
from
'@/views/realTimeSync/strategicIndicators/systemStrategic.vue'
;
import
SystemStrategic
from
'@/views/realTimeSync/strategicIndicators/systemStrategic.vue'
;
...
@@ -179,6 +183,7 @@
...
@@ -179,6 +183,7 @@
const
searchInfo
=
reactive
<
Recordable
>
({});
const
searchInfo
=
reactive
<
Recordable
>
({});
const
tabsKey
=
ref
(
'1'
);
const
tabsKey
=
ref
(
'1'
);
const
isAdd
=
ref
(
false
);
const
typeOptions
=
[
const
typeOptions
=
[
{
{
...
@@ -214,6 +219,24 @@
...
@@ -214,6 +219,24 @@
span
:
24
,
span
:
24
,
},
},
});
});
const
[
registerAdd
,
{
setFieldsValue
:
addsetFieldsValue
,
updateSchema
:
addupdateSchema
,
resetSchema
:
addresetSchema
,
resetFields
:
addresetFields
,
validate
:
addvalidate
,
},
]
=
useForm
({
labelWidth
:
150
,
schemas
:
addFormSchema
,
showActionButtonGroup
:
false
,
actionColOptions
:
{
span
:
24
,
},
});
const
[
registerCheck
,
{
setFieldsValue
:
checkSetFieldsValue
,
updateSchema
:
checkUpdateSchema
}]
=
const
[
registerCheck
,
{
setFieldsValue
:
checkSetFieldsValue
,
updateSchema
:
checkUpdateSchema
}]
=
useForm
({
useForm
({
labelWidth
:
150
,
labelWidth
:
150
,
...
@@ -236,6 +259,7 @@
...
@@ -236,6 +259,7 @@
getRowSelection
,
getRowSelection
,
setSelectedRows
,
setSelectedRows
,
clearSelectedRowKeys
,
clearSelectedRowKeys
,
setSelectedRowKeys
,
},
},
]
=
useTable
({
]
=
useTable
({
title
:
''
,
title
:
''
,
...
@@ -262,12 +286,17 @@
...
@@ -262,12 +286,17 @@
autoSubmitOnEnter
:
true
,
autoSubmitOnEnter
:
true
,
showActionButtonGroup
:
false
,
showActionButtonGroup
:
false
,
},
},
rowSelection
:
{
type
:
'radio'
,
onChange
:
handleSelect
,
},
clickToRowSelect
:
true
,
useSearchForm
:
false
,
useSearchForm
:
false
,
striped
:
false
,
striped
:
false
,
showTableSetting
:
false
,
showTableSetting
:
false
,
bordered
:
false
,
bordered
:
false
,
pagination
:
false
,
pagination
:
false
,
rowSelection
:
{
onSelect
:
handleSelect
},
//
rowSelection: { onSelect: handleSelect },
handleSearchInfoFn
(
info
)
{
handleSearchInfoFn
(
info
)
{
return
info
;
return
info
;
},
},
...
@@ -279,9 +308,14 @@
...
@@ -279,9 +308,14 @@
}
as
BasicTableProps
);
}
as
BasicTableProps
);
function
handleRow
(
record
)
{
function
handleRow
(
record
)
{
titleName
.
value
=
record
.
strategicName
;
handleab
();
const
index
=
TreeSystem
.
findIndex
((
item
)
=>
item
.
strategicId
===
record
.
strategicId
);
if
(
index
!==
-
1
)
{
titleName
.
value
=
TreeSystem
[
index
].
strategicName
;
titleType
.
value
=
TreeSystem
[
index
].
strategicType
;
}
console
.
log
(
'record'
,
record
);
console
.
log
(
'record'
,
record
);
setSelectedRows
([{
strategicId
:
record
.
strategicId
}]);
// setSelectedRows({ strategicId: record.strategicId });、
if
(
record
.
strategicId
===
101
)
{
if
(
record
.
strategicId
===
101
)
{
console
.
log
(
'被调用1'
);
console
.
log
(
'被调用1'
);
resetSchema
([...
backlogFormSchema
]);
resetSchema
([...
backlogFormSchema
]);
...
@@ -304,22 +338,37 @@
...
@@ -304,22 +338,37 @@
}
}
}
}
const
titleName
=
ref
(
null
);
const
titleName
=
ref
(
null
);
const
titleType
=
ref
(
null
);
function
handleSelect
(
record
)
{
function
handleSelect
(
record
)
{
console
.
log
(
'record'
,
record
);
console
.
log
(
'record'
,
record
);
titleName
.
value
=
record
.
strategicName
;
// nextTick(() => {
nextTick
(()
=>
{
// setSelectedRows({ strategicId: record.strategicId });
setSelectedRows
([{
strategicId
:
record
.
strategicId
}]
);
// }
);
});
handleRow
({
strategicId
:
record
[
0
]
});
console
.
log
(
'getRowSelection'
,
getRowSelection
());
console
.
log
(
'getRowSelection'
,
getRowSelection
());
}
}
onMounted
(()
=>
{});
onMounted
(()
=>
{});
function
handleAdd
()
{}
function
handleAdd
()
{
titleType
.
value
=
null
;
isAdd
.
value
=
true
;
}
function
handleab
()
{
isAdd
.
value
=
false
;
}
function
handleSubmit
()
{}
function
handleSubmit
()
{}
function
handleDelete
()
{}
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.hover1 {
.hover1 {
cursor: pointer;
cursor: pointer;
}
}
.select-class {
background-color: #e0f1ff;
}
::v-deep .ant-table-cell {
padding: 0;
}
</
style
>
</
style
>
src/views/realTimeSync/strategicIndicators/strategic.data.ts
View file @
0a141e52
...
@@ -573,3 +573,39 @@ export const clearFormSchema: FormSchema[] = [
...
@@ -573,3 +573,39 @@ export const clearFormSchema: FormSchema[] = [
colProps
:
{
lg
:
24
,
md
:
24
},
colProps
:
{
lg
:
24
,
md
:
24
},
},
},
];
];
export
const
addFormSchema
:
FormSchema
[]
=
[
{
field
:
'strategicName'
,
label
:
'策略名称'
,
component
:
'Input'
,
colProps
:
{
lg
:
13
,
md
:
13
},
required
:
true
,
},
{
field
:
'description'
,
label
:
'描述'
,
component
:
'InputTextArea'
,
componentProps
:
{
rows
:
4
,
},
colProps
:
{
lg
:
13
,
md
:
13
},
},
{
field
:
'strategicType'
,
label
:
'策略类型'
,
component
:
'Select'
,
componentProps
:
{
placeholder
:
'策略类型'
,
options
:
[
{
label
:
'DB-DB源端DDL处理策略'
,
value
:
'DB-DB源端DDL处理策略'
},
{
label
:
'DB-Kafka源端DDL处理策略'
,
value
:
'DB-Kafka源端DDL处理策略'
},
{
label
:
'系统异常处理策略'
,
value
:
'系统异常处理策略'
},
{
label
:
'异常数据处理策略'
,
value
:
'异常数据处理策略'
},
{
label
:
'数据积压策略'
,
value
:
'数据积压策略'
},
{
label
:
'—致性检查策略'
,
value
:
'致性检查策略'
},
],
},
colProps
:
{
lg
:
13
,
md
:
13
},
},
];
src/views/realTimeSync/strategicIndicators/strategicData.ts
View file @
0a141e52
...
@@ -12,7 +12,7 @@ export const TreeSystem: any[] = [
...
@@ -12,7 +12,7 @@ export const TreeSystem: any[] = [
{
{
strategicId
:
103
,
strategicId
:
103
,
strategicName
:
'DB-DB源端DDL处理默认策略'
,
strategicName
:
'DB-DB源端DDL处理默认策略'
,
strategicType
:
'DB-DB源
媛
DDL处理策略'
,
strategicType
:
'DB-DB源
端
DDL处理策略'
,
},
},
{
{
strategicId
:
104
,
strategicId
:
104
,
...
@@ -22,7 +22,7 @@ export const TreeSystem: any[] = [
...
@@ -22,7 +22,7 @@ export const TreeSystem: any[] = [
{
{
strategicId
:
105
,
strategicId
:
105
,
strategicName
:
'一致性检查默认策略'
,
strategicName
:
'一致性检查默认策略'
,
strategicType
:
'致性检查策略'
,
strategicType
:
'
一
致性检查策略'
,
},
},
{
{
strategicId
:
106
,
strategicId
:
106
,
...
...
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