From f841bed3dd8c648f04ed4362b046c1a553dff814 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Wed, 7 Dec 2022 17:07:30 +0800 Subject: [PATCH 001/124] feat(route): add user and roles --- apps/daas/src/router/routes.js | 94 +++++++++++++++---------------- apps/daas/src/views/Layout.vue | 6 +- apps/daas/src/views/user/List.vue | 17 ++---- 3 files changed, 56 insertions(+), 61 deletions(-) diff --git a/apps/daas/src/router/routes.js b/apps/daas/src/router/routes.js index baa6393606..e47a4497eb 100644 --- a/apps/daas/src/router/routes.js +++ b/apps/daas/src/router/routes.js @@ -661,54 +661,54 @@ export default [ } }, /* ---------- 用户管理 ----------*/ - // { - // path: '/user', - // name: 'users', - // component: () => import(/* webpackChunkName: "user" */ '@/views/user/List'), - // meta: { - // title: 'page_title_user', - // code: 'user_management_menu' - // } - // }, + { + path: '/user', + name: 'users', + component: () => import(/* webpackChunkName: "user" */ '@/views/user/List'), + meta: { + title: 'page_title_user', + code: 'user_management_menu' + } + }, /* ---------- 角色管理 ----------*/ - // { - // path: '/role', - // name: 'roles', - // component: Parent, - // redirect: 'role/', - // meta: { - // title: 'page_title_role' - // }, - // children: [ - // { - // path: '', - // name: 'roleList', - // component: () => import(/* webpackChunkName: "role-list" */ '@/views/role/Roles'), - // meta: { - // title: 'page_title_role', - // code: 'role_management_menu' - // } - // }, - // { - // path: 'create', - // name: 'role', - // component: RoleDetails, - // meta: { - // title: 'page_title_role', - // code: 'role_creation' - // } - // }, - // { - // path: ':id/edit', - // name: 'editRole', - // component: RoleDetails, - // meta: { - // title: 'page_title_role', - // code: 'role_edition' - // } - // } - // ] - // }, + { + path: '/role', + name: 'roles', + component: Parent, + redirect: 'role/', + meta: { + title: 'page_title_role' + }, + children: [ + { + path: '', + name: 'roleList', + component: () => import(/* webpackChunkName: "role-list" */ '@/views/role/Roles'), + meta: { + title: 'page_title_role', + code: 'role_management_menu' + } + }, + // { + // path: 'create', + // name: 'role', + // component: RoleDetails, + // meta: { + // title: 'page_title_role', + // code: 'role_creation' + // } + // }, + // { + // path: ':id/edit', + // name: 'editRole', + // component: RoleDetails, + // meta: { + // title: 'page_title_role', + // code: 'role_edition' + // } + // } + ] + }, /* ---------- 设置 ----------*/ { path: '/settingCenter', diff --git a/apps/daas/src/views/Layout.vue b/apps/daas/src/views/Layout.vue index 65ae6dca67..71c8a11b87 100644 --- a/apps/daas/src/views/Layout.vue +++ b/apps/daas/src/views/Layout.vue @@ -402,10 +402,10 @@ let menuSetting = [ icon: 'system_navbar', code: 'system_management', children: [ - { name: 'clusterManagement', code: 'Cluster_management_menu' } + { name: 'clusterManagement', code: 'Cluster_management_menu' }, // { name: 'externalStorage', code: '' } - // { name: 'users', code: 'user_management_menu', parent: 'migrate' }, - // { name: 'roleList', code: 'role_management_menu', parent: 'migrate' } + { name: 'users', code: 'user_management_menu', parent: 'migrate' }, + { name: 'roleList', code: 'role_management_menu', parent: 'migrate' } ] } ] diff --git a/apps/daas/src/views/user/List.vue b/apps/daas/src/views/user/List.vue index 024744b0be..01bba0bc27 100644 --- a/apps/daas/src/views/user/List.vue +++ b/apps/daas/src/views/user/List.vue @@ -84,7 +84,7 @@ size="mini" @click="openCreateDialog" > - {{ $t('user_creatUser') }} + {{ $t('button_create') }} @@ -636,9 +636,7 @@ export default { break } // delete params.status; - that - .$api('users') - [that.createForm.id ? 'patch' : 'post'](params) + usersApi[that.createForm.id ? 'patch' : 'post'](params) .then(data => { if (data) { // 过滤不存在角色 @@ -655,7 +653,7 @@ export default { // 删除以前角色id that.roleMappding.forEach(rolemapping => { - that.$api('roleMapping').delete(rolemapping.id) + roleMappingsApi.delete(rolemapping.id) }) let newRoleMappings = [] @@ -666,12 +664,9 @@ export default { roleId: roleuser }) }) - that - .$api('roleMapping') - .saveAll(newRoleMappings) - .then(() => { - that.$message.success(this.$t('message_save_ok')) - }) + roleMappingsApi.saveAll(newRoleMappings).then(() => { + that.$message.success(this.$t('message_save_ok')) + }) this.table.fetch() } }) From 30e9723bbe0d8dd265a5f9c1217e4778014ee727 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Mon, 12 Dec 2022 14:08:13 +0800 Subject: [PATCH 002/124] feat(daas/route): add RoleDetails --- apps/daas/src/router/routes.js | 38 ++++++++++++++++--------------- apps/daas/src/views/role/Role.vue | 8 +++---- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/daas/src/router/routes.js b/apps/daas/src/router/routes.js index e47a4497eb..a1e5452c51 100644 --- a/apps/daas/src/router/routes.js +++ b/apps/daas/src/router/routes.js @@ -60,6 +60,8 @@ const RelationTaskDetails = async () => { return RelationTaskDetails } +const RoleDetails = () => import(/* webpackChunkName: "role-details" */ '@/views/role/Role') + export default [ { path: '/login', @@ -689,24 +691,24 @@ export default [ code: 'role_management_menu' } }, - // { - // path: 'create', - // name: 'role', - // component: RoleDetails, - // meta: { - // title: 'page_title_role', - // code: 'role_creation' - // } - // }, - // { - // path: ':id/edit', - // name: 'editRole', - // component: RoleDetails, - // meta: { - // title: 'page_title_role', - // code: 'role_edition' - // } - // } + { + path: 'create', + name: 'role', + component: RoleDetails, + meta: { + title: 'page_title_role', + code: 'role_creation' + } + }, + { + path: ':id/edit', + name: 'editRole', + component: RoleDetails, + meta: { + title: 'page_title_role', + code: 'role_edition' + } + } ] }, /* ---------- 设置 ----------*/ diff --git a/apps/daas/src/views/role/Role.vue b/apps/daas/src/views/role/Role.vue index c25d5a2de8..a1414ecc11 100644 --- a/apps/daas/src/views/role/Role.vue +++ b/apps/daas/src/views/role/Role.vue @@ -196,7 +196,7 @@ + + diff --git a/packages/dag/src/components/LeftSidebar.vue b/packages/dag/src/components/LeftSidebar.vue index 621a2e6763..63b7f76c0a 100644 --- a/packages/dag/src/components/LeftSidebar.vue +++ b/packages/dag/src/components/LeftSidebar.vue @@ -110,6 +110,11 @@ {{ tbTotal }} + + + refresh + + search-outline @@ -269,6 +274,7 @@ import BaseNode from './BaseNode' import CreateTable from './CreateTable' import NodeIcon from './NodeIcon' import ConnectionType from './ConnectionType' +import StageButton from '@tap/component/src/StageButton' export default { name: 'LeftSidebar', @@ -282,7 +288,8 @@ export default { VIcon, ConnectionType, ConnectionTypeSelector, - ElScrollbar: Select.components.ElScrollbar + ElScrollbar: Select.components.ElScrollbar, + StageButton }, data() { From 8251d930a76ba3f5cdf1f92a6f183be2da116084 Mon Sep 17 00:00:00 2001 From: xufei Date: Sat, 14 Jan 2023 01:48:43 +0800 Subject: [PATCH 053/124] fix(@tap/dag): fix PaperScroller offset caused by reset operation and zoom center misalignment --- .../component/src/directives/mousedrag.js | 3 +- packages/dag/src/Editor.vue | 2 +- packages/dag/src/MigrationEditor.vue | 15 +++--- packages/dag/src/components/LeftSidebar.vue | 48 ++++++++++++++----- packages/dag/src/components/PaperScroller.vue | 17 ++----- .../src/components/migration/LeftSider.vue | 30 ++++++++++-- 6 files changed, 76 insertions(+), 39 deletions(-) diff --git a/packages/component/src/directives/mousedrag.js b/packages/component/src/directives/mousedrag.js index 684fbbcf7d..75ab83900a 100644 --- a/packages/component/src/directives/mousedrag.js +++ b/packages/component/src/directives/mousedrag.js @@ -51,7 +51,8 @@ export default { GlobalState.startEvent = event GlobalState.onMouseDownAt = Time.now() if (event.button === 0) { - onStart?.(item) + const ifCancel = onStart?.(item) + if (ifCancel === false) return false on(document.documentElement, eventsFor.move, handleMove, { capture: false, passive: false diff --git a/packages/dag/src/Editor.vue b/packages/dag/src/Editor.vue index ef2d15f886..8fd7ca08fa 100644 --- a/packages/dag/src/Editor.vue +++ b/packages/dag/src/Editor.vue @@ -30,7 +30,7 @@
- - - +
diff --git a/packages/dag/src/components/LeftSidebar.vue b/packages/dag/src/components/LeftSidebar.vue index 4898126b8f..5cea2dbd48 100644 --- a/packages/dag/src/components/LeftSidebar.vue +++ b/packages/dag/src/components/LeftSidebar.vue @@ -14,7 +14,14 @@ search-outline - add-outline + add-outline {{ activeConnection.name }} @@ -64,8 +71,8 @@ onStop }" :key="db.id" - class="db-item grabbable flex align-center px-1 user-select-none rounded-2" - :class="{ active: activeConnection.id === db.id }" + class="db-item flex align-center px-1 user-select-none rounded-2" + :class="{ grabbable: !stateIsReadonly, active: activeConnection.id === db.id }" @click="handleSelectDB(db)" >
@@ -114,7 +121,13 @@ >search-outline - add-outline + add-outline
@@ -165,7 +178,8 @@ onStop }" :key="tb.id" - class="tb-item grabbable flex align-center px-2 user-select-none rounded-2" + class="tb-item flex align-center px-2 user-select-none rounded-2" + :class="{ grabbable: !stateIsReadonly }" > @@ -204,7 +218,8 @@ onDrop, onStop }" - class="node-item grabbable flex align-center px-2 user-select-none rounded-2" + class="node-item flex align-center px-2 user-select-none rounded-2" + :class="{ grabbable: !stateIsReadonly }" > @@ -342,7 +357,7 @@ export default { }, computed: { - ...mapGetters('dataflow', ['processorNodeTypes', 'getCtor']), + ...mapGetters('dataflow', ['processorNodeTypes', 'getCtor', 'stateIsReadonly']), noMore() { return this.tbPage >= Math.ceil(this.tbTotal / 20) @@ -387,7 +402,7 @@ export default { methods: { // 创建连接 creat() { - this.connectionDialog = true + this.connectionDialog = !this.stateIsReadonly }, getDatabaseType() { databaseTypesApi.get().then(res => { @@ -616,6 +631,7 @@ export default { }, initStart(node) { + if (this.stateIsReadonly) return false const getResourceIns = this.$store.getters['dataflow/getResourceIns'] const ins = getResourceIns(node) Object.defineProperty(node, '__Ctor', { @@ -629,15 +645,16 @@ export default { onStart(item) { const node = this.getNodeProps(item, '') - this.initStart(node) + return this.initStart(node) }, onTBStart(item) { const node = this.getNodeProps(this.activeConnection, item.name) - this.initStart(node) + return this.initStart(node) }, onProcessorStart(item) { + if (this.stateIsReadonly) return false const node = item const getResourceIns = this.$store.getters['dataflow/getResourceIns'] if (!item.__Ctor) { @@ -721,7 +738,7 @@ export default { }, 100), handleAddTable() { - this.dialogData.visible = true + this.dialogData.visible = !this.stateIsReadonly }, handleSaveTable(name) { @@ -814,6 +831,15 @@ $hoverBg: #eef3ff; color: map-get($color, primary); background: $hoverBg; } + + &-disabled { + color: currentColor; + cursor: not-allowed; + &:hover { + color: currentColor; + background: rgba(242, 243, 245); + } + } } .badge { diff --git a/packages/dag/src/components/PaperScroller.vue b/packages/dag/src/components/PaperScroller.vue index 508c7e0a4c..7cb5930457 100644 --- a/packages/dag/src/components/PaperScroller.vue +++ b/packages/dag/src/components/PaperScroller.vue @@ -174,16 +174,6 @@ export default { } }, - watch: { - stateIsReadonly() { - // 编辑和查看切换时,视图尺寸变化,主要是侧边栏显示隐藏的切换 - const rect = this.$el.getBoundingClientRect() - this.visibleArea.width = rect.width - this.visibleArea.left = rect.left - this.visibleArea.x = rect.x - } - }, - created() { this.bindEvent() }, @@ -659,7 +649,7 @@ export default { wheelToScaleArtboard(scale, scalePoint) { scalePoint = scalePoint || this.getScaleAbsolutePoint() const scaleOrigin = this.getMouseToPageOriginal(scalePoint) - const area = this.visibleArea + const area = this.windowArea const offset = this.paperOffset const left = scalePoint.x - area.left // 光标与可视区左边的距离 const top = scalePoint.y - area.top // 光标与可视区上边的距离 @@ -683,6 +673,9 @@ export default { const options = { left, top } animate && (options.behavior = 'smooth') this.$el.scrollTo(options) + requestAnimationFrame(() => { + this.$el.scrollTo(options) + }) }) }, @@ -691,7 +684,7 @@ export default { * @returns {{x: *, y: *}} */ getScaleAbsolutePoint() { - const area = this.visibleArea + const area = this.windowArea return { x: Math.round(area.width / 2) + area.left, y: Math.round(area.height / 2) + area.top } }, diff --git a/packages/dag/src/components/migration/LeftSider.vue b/packages/dag/src/components/migration/LeftSider.vue index 01a1fb396f..d84629385a 100644 --- a/packages/dag/src/components/migration/LeftSider.vue +++ b/packages/dag/src/components/migration/LeftSider.vue @@ -14,7 +14,14 @@ search-outline - add-outline + add-outline @@ -62,7 +69,8 @@ onStop }" :key="db.id" - class="db-item grabbable flex align-center px-1 user-select-none rounded-2" + class="db-item flex align-center px-1 user-select-none rounded-2" + :class="{ grabbable: !stateIsReadonly }" >
@@ -122,7 +130,8 @@ onDrop, onStop }" - class="node-item grabbable flex align-center px-2 user-select-none rounded-2" + class="node-item flex align-center px-2 user-select-none rounded-2" + :class="{ grabbable: !stateIsReadonly }" > = Math.ceil(this.dbTotal / 20) @@ -289,7 +298,7 @@ export default { // 创建连接 creat() { - this.connectionDialog = true + this.connectionDialog = !this.stateIsReadonly }, async getDatabaseType() { await databaseTypesApi.get().then(res => { @@ -439,6 +448,7 @@ export default { }, onStart(item) { + if (this.stateIsReadonly) return false const node = this.getNodeProps(item) const getResourceIns = this.$store.getters['dataflow/getResourceIns'] const ins = getResourceIns(node) @@ -452,6 +462,7 @@ export default { }, onProcessorStart(item) { + if (this.stateIsReadonly) return false const node = item const getResourceIns = this.$store.getters['dataflow/getResourceIns'] if (!item.__Ctor) { @@ -613,6 +624,15 @@ $hoverBg: #eef3ff; color: map-get($color, primary); background: $hoverBg; } + + &-disabled { + color: currentColor; + cursor: not-allowed; + &:hover { + color: currentColor; + background: rgba(242, 243, 245); + } + } } .badge { From 3aae12e753dfd3fcc92d8aede05f508579acc5da Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Mon, 16 Jan 2023 11:01:22 +0800 Subject: [PATCH 054/124] refactor(StageButton): add $emit complete --- packages/component/src/StageButton.vue | 1 + packages/dag/src/components/LeftSidebar.vue | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/component/src/StageButton.vue b/packages/component/src/StageButton.vue index e2a4d365ad..8d25ba8a4d 100644 --- a/packages/component/src/StageButton.vue +++ b/packages/component/src/StageButton.vue @@ -48,6 +48,7 @@ export default { } else { this.progress = 100 + '%' setTimeout(() => { + this.$emit('complete') this.loading = false }, 1000) } diff --git a/packages/dag/src/components/LeftSidebar.vue b/packages/dag/src/components/LeftSidebar.vue index 63b7f76c0a..9807daee11 100644 --- a/packages/dag/src/components/LeftSidebar.vue +++ b/packages/dag/src/components/LeftSidebar.vue @@ -111,8 +111,8 @@ - - refresh + + refresh Date: Mon, 16 Jan 2023 11:36:04 +0800 Subject: [PATCH 055/124] fix(@tap/dag): fix js editor fullscreen error --- packages/dag/src/components/form/js-processor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dag/src/components/form/js-processor/index.js b/packages/dag/src/components/form/js-processor/index.js index 1eae446731..692b190195 100644 --- a/packages/dag/src/components/form/js-processor/index.js +++ b/packages/dag/src/components/form/js-processor/index.js @@ -167,7 +167,7 @@ export const JsProcessor = observer( clearTimeout(timer) version = Time.now() queryStart = Time.now() - if (!fullscreen.value) fullscreen.value = true + if (!fullscreen.value) toggleFullscreen() taskApi.testRunJs({ ...params, version, script: props.value }).then( () => { queryStart = Time.now() From 71b3f6a5ffd185cfe68b0025efe6872516c75ad1 Mon Sep 17 00:00:00 2001 From: xufei Date: Mon, 16 Jan 2023 11:56:50 +0800 Subject: [PATCH 056/124] style(@tap/dag): update js processor log line style --- packages/dag/src/components/form/js-processor/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dag/src/components/form/js-processor/index.js b/packages/dag/src/components/form/js-processor/index.js index 692b190195..2463eed6cc 100644 --- a/packages/dag/src/components/form/js-processor/index.js +++ b/packages/dag/src/components/form/js-processor/index.js @@ -452,7 +452,7 @@ export const JsProcessor = observer( ) } - return
{item.message}
+ return
{item.message}
}) : !logLoading.value && }
Date: Mon, 16 Jan 2023 15:04:15 +0800 Subject: [PATCH 057/124] feat(@dag): add StageButtonLaebl --- packages/component/src/StageButton.vue | 24 ++++++++++++----- packages/dag/src/components/form/index.js | 1 + .../form/stage-button-label/index.js | 27 +++++++++++++++++++ packages/dag/src/nodes/Table.js | 11 +++++--- 4 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 packages/dag/src/components/form/stage-button-label/index.js diff --git a/packages/component/src/StageButton.vue b/packages/component/src/StageButton.vue index 8d25ba8a4d..c809e99eb9 100644 --- a/packages/component/src/StageButton.vue +++ b/packages/component/src/StageButton.vue @@ -1,5 +1,5 @@ - - - @@ -34,13 +31,26 @@ export default { }, mounted() { - this.getProgress() + this.getProgress(true) }, methods: { - getProgress() { + loadSchema() { + connectionsApi + .updateById(this.connectionId, { + loadCount: 0, + loadFieldsStatus: 'loading' + }) + .then(() => { + this.getProgress() + }) + }, + + getProgress(check = false) { if (!this.connectionId) return - this.loading = true + if (!check) { + this.loading = true + } this.progress = '0' connectionsApi.getNoSchema(this.connectionId).then(res => { if (res.loadFieldsStatus !== 'finished') { diff --git a/packages/dag/src/components/form/index.js b/packages/dag/src/components/form/index.js index d64a911fcf..cb2b983f2c 100644 --- a/packages/dag/src/components/form/index.js +++ b/packages/dag/src/components/form/index.js @@ -19,3 +19,4 @@ export * from './pdk-properties' export * from './js-declare' export * from './load-schema-tree' export * from './field-inference' +export * from './stage-button-label' diff --git a/packages/dag/src/components/form/stage-button-label/index.js b/packages/dag/src/components/form/stage-button-label/index.js new file mode 100644 index 0000000000..d20a1058e1 --- /dev/null +++ b/packages/dag/src/components/form/stage-button-label/index.js @@ -0,0 +1,27 @@ +import { defineComponent } from '@vue/composition-api' +import { observer } from '@formily/reactive-vue' + +import StageButton from '@tap/component/src/StageButton' +import { FormItem } from '@tap/form' + +export const StageButtonLabel = observer( + defineComponent({ + props: ['value', 'disabled', 'connectionId', 'title'], + setup(props, { emit, root, attrs, refs, slots }) { + return () => { + const label = ( +
+ {props.title} + +
+ ) + + return ( + + {slots.default?.()} + + ) + } + } + }) +) diff --git a/packages/dag/src/nodes/Table.js b/packages/dag/src/nodes/Table.js index 978ab04b79..8cb0a92873 100644 --- a/packages/dag/src/nodes/Table.js +++ b/packages/dag/src/nodes/Table.js @@ -97,10 +97,12 @@ export class Table extends NodeType { tableNameWrap: { type: 'void', title: '表', - 'x-decorator': 'FormItem', + 'x-decorator': 'StageButtonLabel', 'x-decorator-props': { asterisk: true, - feedbackLayout: 'none' + feedbackLayout: 'none', + connectionId: '', + title: '表' }, 'x-component': 'FormFlex', 'x-component-props': { @@ -108,10 +110,13 @@ export class Table extends NodeType { align: 'start' }, 'x-reactions': { - dependencies: ['databaseType'], + dependencies: ['databaseType', '.connectionId'], fulfill: { state: { display: '{{ !["CSV","EXCEL","JSON","XML"].includes($deps[0]) ? "visible":"hidden"}}' + }, + schema: { + 'x-decorator-props.connectionId': `{{$deps[1]}}` } } }, From 2f53e365fef37da95917e65a0136d2d982662c4d Mon Sep 17 00:00:00 2001 From: xufei Date: Mon, 16 Jan 2023 15:44:21 +0800 Subject: [PATCH 058/124] refactor(@tap/dag): update Database node tableExpression --- packages/dag/src/nodes/Database.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/dag/src/nodes/Database.js b/packages/dag/src/nodes/Database.js index 8856e97833..4ab75b30a9 100644 --- a/packages/dag/src/nodes/Database.js +++ b/packages/dag/src/nodes/Database.js @@ -137,6 +137,9 @@ export class Database extends NodeType { type: 'string', default: 'custom', 'x-decorator': 'FormItem', + 'x-decorator-props': { + tooltip: '表达式匹配模式下,数据库新增的符合表达的表会被自动同步到目标' + }, 'x-component': 'Radio.Group', enum: [ { @@ -178,14 +181,12 @@ export class Database extends NodeType { tableExpression: { type: 'string', - default: '*', + default: '.*', + description: '使用正则表达式匹配 .*代表任意长度任意字符', 'x-decorator': 'FormItem', - 'x-decorator-props': { - extra: '表达式匹配模式下,数据库新增的符合表达的表会被自动同步到目标' - }, 'x-component': 'Input.TextArea', 'x-component-props': { - placeholder: '逗号分割的正则表达式列表,使用*代表任意长度任意字符' + rows: 1 }, 'x-reactions': { dependencies: ['migrateTableSelectType'], From 72116bc2d99512011011cf9a26a132d78c7ce5e8 Mon Sep 17 00:00:00 2001 From: xufei Date: Mon, 16 Jan 2023 17:12:35 +0800 Subject: [PATCH 059/124] feat(@tap/dag): JsProcessor Node show api docs --- .../src/components/form/js-processor/index.js | 37 ++++++++++--------- packages/dag/src/locale/lang/en.js | 3 +- packages/dag/src/locale/lang/zh-CN.js | 3 +- packages/dag/src/locale/lang/zh-TW.js | 3 +- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/packages/dag/src/components/form/js-processor/index.js b/packages/dag/src/components/form/js-processor/index.js index 2463eed6cc..abcd1079f3 100644 --- a/packages/dag/src/components/form/js-processor/index.js +++ b/packages/dag/src/components/form/js-processor/index.js @@ -1,4 +1,4 @@ -import { defineComponent, ref, reactive, onUnmounted } from '@vue/composition-api' +import { defineComponent, ref, reactive, onUnmounted, watch } from '@vue/composition-api' import { useForm } from '@tap/form' import { observer } from '@formily/reactive-vue' import { observe } from '@formily/reactive' @@ -197,7 +197,7 @@ export const JsProcessor = observer( showDoc.value = !showDoc.value } - let functionGroup = reactive([]) + let functionGroup = ref({}) const classDescMap = { DateUtil: '日期处理', idGen: 'ID生成器', @@ -208,15 +208,17 @@ export const JsProcessor = observer( filter: JSON.stringify({ limit: 1000, where: { - type: 'system' + type: 'system', + category: { + $in: ['enhanced', 'standard'] + } } }) }) const group = groupBy(data.items, 'className') const noClassFunction = group[''] delete group[''] - functionGroup = group - // console.log('loadFunction', groupBy(data.items, 'className')) // eslint-disable-line + functionGroup.value = group } loadFunction() @@ -246,9 +248,9 @@ export const JsProcessor = observer(
* {i18n.t('packages_form_js_processor_index_jiaoben')} - {/* - API文档 - */} + + {i18n.t('packages_dag_api_docs')} + fangda {i18n.t('packages_form_js_editor_fullscreen')} @@ -345,7 +347,8 @@ export const JsProcessor = observer( { @@ -355,19 +358,19 @@ export const JsProcessor = observer( }} >
- {Object.keys(functionGroup).map(className => { + {Object.keys(functionGroup.value).map(className => { return [

{className}

, classDescMap[className] &&

{classDescMap[className]}

,

方法

, - functionGroup[className].map(item => { + functionGroup.value[className].map(item => { return [

{item.methodName}

,
    -
  • 作用
  • -
  • 用法
  • +
  • 作用:{item.desc}
  • +
  • 用法:
, - + ] }) ] @@ -385,9 +388,9 @@ export const JsProcessor = observer(
{fullscreen && runTool}
- {/* - API文档 - */} + + {i18n.t('packages_dag_api_docs')} + suoxiao {i18n.t('packages_form_js_editor_exit_fullscreen')} diff --git a/packages/dag/src/locale/lang/en.js b/packages/dag/src/locale/lang/en.js index 2770fb7bba..2b35577b1e 100644 --- a/packages/dag/src/locale/lang/en.js +++ b/packages/dag/src/locale/lang/en.js @@ -544,5 +544,6 @@ export default { packages_dag_monitor_node_popover_cdcTimeTitle_processor: 'Process incremental time', packages_dag_monitor_node_popover_targetWriteTime_title: 'Avg time per write', packages_dag_monitor_topheader_renwuxintiaoshi: 'Task heartbeat time', - packages_dag_monitor_node_per_deal_need_time: 'Single processing time' + packages_dag_monitor_node_per_deal_need_time: 'Single processing time', + packages_dag_api_docs: 'Docs' } diff --git a/packages/dag/src/locale/lang/zh-CN.js b/packages/dag/src/locale/lang/zh-CN.js index e17ff6a983..d974338856 100644 --- a/packages/dag/src/locale/lang/zh-CN.js +++ b/packages/dag/src/locale/lang/zh-CN.js @@ -518,5 +518,6 @@ export default { packages_dag_monitor_node_popover_cdcTimeTitle_processor: '处理增量时间点', packages_dag_monitor_node_popover_targetWriteTime_title: '平均每条写入耗时', packages_dag_monitor_topheader_renwuxintiaoshi: '任务心跳时间', - packages_dag_monitor_node_per_deal_need_time: '单条处理耗时' + packages_dag_monitor_node_per_deal_need_time: '单条处理耗时', + packages_dag_api_docs: 'API文档' } diff --git a/packages/dag/src/locale/lang/zh-TW.js b/packages/dag/src/locale/lang/zh-TW.js index 2b4033279e..c2140fef42 100644 --- a/packages/dag/src/locale/lang/zh-TW.js +++ b/packages/dag/src/locale/lang/zh-TW.js @@ -515,5 +515,6 @@ export default { packages_dag_monitor_node_popover_cdcTimeTitle_processor: '處理增量時間點', packages_dag_monitor_node_popover_targetWriteTime_title: '平均每條寫入耗時', packages_dag_monitor_topheader_renwuxintiaoshi: '任務心跳時間', - packages_dag_monitor_node_per_deal_need_time: '單條處理耗時' + packages_dag_monitor_node_per_deal_need_time: '單條處理耗時', + packages_dag_api_docs: 'API文檔' } From 59b5b8cdbb91727992d58db201760d9d2fec6c7e Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Mon, 16 Jan 2023 18:09:04 +0800 Subject: [PATCH 060/124] feat(targetNode): add writeStrategy --- packages/dag/src/nodes/Database.js | 40 ++++++++ packages/dag/src/nodes/Table.js | 159 +++++++++++++++++++++++++---- 2 files changed, 177 insertions(+), 22 deletions(-) diff --git a/packages/dag/src/nodes/Database.js b/packages/dag/src/nodes/Database.js index 8856e97833..5c0edc37a9 100644 --- a/packages/dag/src/nodes/Database.js +++ b/packages/dag/src/nodes/Database.js @@ -352,6 +352,38 @@ export class Database extends NodeType { } } }, + writeStrategyObject: { + // title: '数据写入模式', + type: 'void', + 'x-component-props': { + layout: 'horizontal', + colon: false, + feedbackLayout: 'none' + }, + properties: { + writeStrategy: { + title: '数据写入模式', + type: 'string', + default: 'updateOrInsert', + 'x-decorator': 'FormItem', + 'x-component': 'Radio.Group', + 'x-component-props': { + tooltip: + '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + }, + enum: [ + { + label: '按事件类型处理', + value: 'updateOrInsert' + }, + { + label: '统计追加写入', + value: 'appendWrite' + } + ] + } + } + }, dmlPolicy: { title: '数据写入策略', type: 'object', @@ -423,6 +455,14 @@ export class Database extends NodeType { effect: 'light' } } + }, + 'x-reactions': { + dependencies: ['writeStrategy'], + fulfill: { + state: { + display: '{{$deps[0] === "appendWrite" ? "hidden":"visible"}}' + } + } } }, diff --git a/packages/dag/src/nodes/Table.js b/packages/dag/src/nodes/Table.js index 978ab04b79..e7ca93a9ce 100644 --- a/packages/dag/src/nodes/Table.js +++ b/packages/dag/src/nodes/Table.js @@ -628,35 +628,150 @@ export class Table extends NodeType { } } }, - writeStrategy: { - title: '数据写入模式', - type: 'string', - default: 'updateOrInsert', - enum: [ - { - label: '追加写入', - value: 'appendWrite' - }, - { - label: '更新已存在或者插入新数据', - value: 'updateOrInsert' + // writeStrategy: { + // title: '数据写入模式', + // type: 'string', + // default: 'updateOrInsert', + // enum: [ + // { + // label: '追加写入', + // value: 'appendWrite' + // }, + // { + // label: '更新已存在或者插入新数据', + // value: 'updateOrInsert' + // } + // ], + // 'x-decorator': 'FormItem', + // 'x-decorator-props': { + // wrapperWidth: 300 + // }, + // 'x-component': 'Select', + // 'x-reactions': [ + // { + // target: 'updateConditionFields', + // fulfill: { + // state: { + // display: '{{$self.value!=="appendWrite" ? "visible":"hidden"}}' + // } + // } + // } + // ] + // }, + writeStrategyObject: { + // title: '数据写入模式', + type: 'void', + 'x-component-props': { + layout: 'horizontal', + colon: false, + feedbackLayout: 'none', + tooltip: + '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + }, + properties: { + writeStrategy: { + title: '数据写入模式', + type: 'string', + default: 'updateOrInsert', + 'x-decorator': 'FormItem', + 'x-component': 'Radio.Group', + 'x-component-props': { + tooltip: + '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + }, + enum: [ + { + label: '按事件类型处理', + value: 'updateOrInsert' + }, + { + label: '统计追加写入', + value: 'appendWrite' + } + ] } - ], + } + }, + dmlPolicy: { + title: '数据写入策略', + type: 'object', 'x-decorator': 'FormItem', 'x-decorator-props': { - wrapperWidth: 300 + feedbackLayout: 'none' }, - 'x-component': 'Select', - 'x-reactions': [ - { - target: 'updateConditionFields', - fulfill: { - state: { - display: '{{$self.value!=="appendWrite" ? "visible":"hidden"}}' + 'x-component': 'FormLayout', + 'x-component-props': { + layout: 'horizontal', + colon: false, + feedbackLayout: 'none' + }, + properties: { + insertPolicy: { + type: 'string', + 'x-component': 'Select', + 'x-decorator': 'FormItem', + 'x-decorator-props': { + className: 'font-color-dark mb-2', + wrapperWidth: 300, + addonBefore: '插入事件' + }, + default: 'update_on_exists', + enum: [ + { + label: '目标存在时更新', + value: 'update_on_exists' + }, + { + label: '目标存在时丢弃', + value: 'ignore_on_exists' } + ] + }, + updatePolicy: { + type: 'string', + 'x-component': 'Select', + 'x-decorator': 'FormItem', + 'x-decorator-props': { + className: 'font-color-dark mb-2', + wrapperWidth: 300, + addonBefore: '更新事件' + }, + default: 'ignore_on_nonexists', + enum: [ + { + label: '不存在时丢弃', + value: 'ignore_on_nonexists' + }, + { + label: '不存在时插入', + value: 'insert_on_nonexists' + } + ] + }, + deletePolicy: { + type: 'void', + 'x-decorator': 'FormItem', + 'x-decorator-props': { + className: 'font-color-dark', + wrapperWidth: 300, + addonBefore: '删除事件' + }, + 'x-component': 'Tag', + 'x-content': '不存在时丢弃', + 'x-component-props': { + type: 'info', + effect: 'light' } } - ] + }, + 'x-reactions': { + dependencies: ['writeStrategy'], + fulfill: { + state: { + display: '{{$deps[0] === "appendWrite" ? "hidden":"visible"}}' + } + } + } }, updateConditionFields: { title: '更新条件字段', From 2241080f33694c600258530d8e430ffd5f011625 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Mon, 16 Jan 2023 18:14:26 +0800 Subject: [PATCH 061/124] feat(databaseForm): add tooltip in connectionSchemaUpdateHour --- packages/business/src/views/connections/DatabaseForm.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/business/src/views/connections/DatabaseForm.vue b/packages/business/src/views/connections/DatabaseForm.vue index 17e4a6f041..ddf104420d 100644 --- a/packages/business/src/views/connections/DatabaseForm.vue +++ b/packages/business/src/views/connections/DatabaseForm.vue @@ -762,6 +762,9 @@ export default { title: '模型加载频率', 'x-decorator': 'FormItem', 'x-component': 'Select', + 'x-decorator-props': { + tooltip: '数据源中模型数量大于1万时,会按本参数设置进行模型刷新' + }, default: '02:00', enum: [ 'false', From aae145f158c3730f4ef23b3748a5043f64d8d107 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Mon, 16 Jan 2023 18:34:46 +0800 Subject: [PATCH 062/124] feat(targetNode): add writeStrategy --- packages/dag/src/nodes/Database.js | 7 +++---- packages/dag/src/nodes/Table.js | 11 ++++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/packages/dag/src/nodes/Database.js b/packages/dag/src/nodes/Database.js index e18e078fe5..aa9b4af45a 100644 --- a/packages/dag/src/nodes/Database.js +++ b/packages/dag/src/nodes/Database.js @@ -366,11 +366,10 @@ export class Database extends NodeType { title: '数据写入模式', type: 'string', default: 'updateOrInsert', - 'x-decorator': 'FormItem', 'x-component': 'Radio.Group', - 'x-component-props': { - tooltip: - '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + 'x-decorator': 'FormItem', + 'x-decorator-props': { + tooltip: '统计追加写入: 只处理插入事件,丢弃更新和删除事件' }, enum: [ { diff --git a/packages/dag/src/nodes/Table.js b/packages/dag/src/nodes/Table.js index e7ca93a9ce..7addcdac6c 100644 --- a/packages/dag/src/nodes/Table.js +++ b/packages/dag/src/nodes/Table.js @@ -664,20 +664,17 @@ export class Table extends NodeType { 'x-component-props': { layout: 'horizontal', colon: false, - feedbackLayout: 'none', - tooltip: - '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + feedbackLayout: 'none' }, properties: { writeStrategy: { title: '数据写入模式', type: 'string', default: 'updateOrInsert', - 'x-decorator': 'FormItem', 'x-component': 'Radio.Group', - 'x-component-props': { - tooltip: - '选择该单选框后,隐藏【事件处理策略】配置区,当鼠标移入到提示符“!”时显示如下提示信息:只处理插入事件,丢弃更新和删除事件' + 'x-decorator': 'FormItem', + 'x-decorator-props': { + tooltip: '统计追加写入: 只处理插入事件,丢弃更新和删除事件' }, enum: [ { From df24095db96c53166bb053117756fbf4704456e3 Mon Sep 17 00:00:00 2001 From: xufei Date: Mon, 16 Jan 2023 19:13:51 +0800 Subject: [PATCH 063/124] style(@tap/dag): JS Node add beta icon --- apps/daas/src/assets/icons/colorSvg/beta.svg | 10 ++++++++++ apps/dfs/src/assets/icons/colorSvg/beta.svg | 10 ++++++++++ packages/dag/src/Editor.vue | 3 ++- packages/dag/src/MigrationEditor.vue | 3 ++- packages/dag/src/components/DFNode.vue | 1 + packages/dag/src/components/LeftSidebar.vue | 1 + packages/dag/src/components/form/js-processor/index.js | 10 ++++++---- packages/dag/src/components/migration/LeftSider.vue | 1 + packages/dag/src/nodes/JavaScript.js | 2 ++ packages/dag/src/nodes/JsProcessor.js | 2 ++ packages/dag/src/nodes/StandardJs.js | 1 + packages/dag/src/nodes/StandardMigrateJs.js | 1 + 12 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 apps/daas/src/assets/icons/colorSvg/beta.svg create mode 100644 apps/dfs/src/assets/icons/colorSvg/beta.svg diff --git a/apps/daas/src/assets/icons/colorSvg/beta.svg b/apps/daas/src/assets/icons/colorSvg/beta.svg new file mode 100644 index 0000000000..2c5da953d3 --- /dev/null +++ b/apps/daas/src/assets/icons/colorSvg/beta.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/apps/dfs/src/assets/icons/colorSvg/beta.svg b/apps/dfs/src/assets/icons/colorSvg/beta.svg new file mode 100644 index 0000000000..2c5da953d3 --- /dev/null +++ b/apps/dfs/src/assets/icons/colorSvg/beta.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/dag/src/Editor.vue b/packages/dag/src/Editor.vue index 5ce866ede3..3c609a2028 100644 --- a/packages/dag/src/Editor.vue +++ b/packages/dag/src/Editor.vue @@ -220,7 +220,8 @@ export default { }, { name: i18n.t('packages_dag_src_migrationeditor_jSchuli'), - type: 'js_processor' + type: 'js_processor', + beta: true }, { name: 'Row Filter', diff --git a/packages/dag/src/MigrationEditor.vue b/packages/dag/src/MigrationEditor.vue index cc2d5481ed..e951b6f11a 100644 --- a/packages/dag/src/MigrationEditor.vue +++ b/packages/dag/src/MigrationEditor.vue @@ -212,7 +212,8 @@ export default { }, { name: i18n.t('packages_dag_src_migrationeditor_jSchuli'), - type: 'migrate_js_processor' + type: 'migrate_js_processor', + beta: true } ]) this.addResourceIns(allResourceIns) diff --git a/packages/dag/src/components/DFNode.vue b/packages/dag/src/components/DFNode.vue index 9ded1ed130..da177f291d 100644 --- a/packages/dag/src/components/DFNode.vue +++ b/packages/dag/src/components/DFNode.vue @@ -9,6 +9,7 @@ placement="top" :open-delay="400" /> + beta
+ beta
diff --git a/packages/dag/src/components/form/js-processor/index.js b/packages/dag/src/components/form/js-processor/index.js index abcd1079f3..c4794c8371 100644 --- a/packages/dag/src/components/form/js-processor/index.js +++ b/packages/dag/src/components/form/js-processor/index.js @@ -15,7 +15,7 @@ import './style.scss' export const JsProcessor = observer( defineComponent({ - props: ['value', 'disabled'], + props: ['value', 'disabled', 'isStandard'], directives: { resize }, @@ -209,9 +209,11 @@ export const JsProcessor = observer( limit: 1000, where: { type: 'system', - category: { - $in: ['enhanced', 'standard'] - } + category: props.isStandard + ? 'standard' + : { + $in: ['enhanced', 'standard'] + } } }) }) diff --git a/packages/dag/src/components/migration/LeftSider.vue b/packages/dag/src/components/migration/LeftSider.vue index d84629385a..4a302a461d 100644 --- a/packages/dag/src/components/migration/LeftSider.vue +++ b/packages/dag/src/components/migration/LeftSider.vue @@ -141,6 +141,7 @@ placement="top" :open-delay="400" /> + beta
diff --git a/packages/dag/src/nodes/JavaScript.js b/packages/dag/src/nodes/JavaScript.js index 143c75fc4d..edb4667750 100644 --- a/packages/dag/src/nodes/JavaScript.js +++ b/packages/dag/src/nodes/JavaScript.js @@ -8,6 +8,8 @@ export class JavaScript extends NodeType { type = 'js_processor' + beta = true + maxInputs = 1 // 最大输入个数 group = 'processor' diff --git a/packages/dag/src/nodes/JsProcessor.js b/packages/dag/src/nodes/JsProcessor.js index bc69367c00..1a23a0b066 100644 --- a/packages/dag/src/nodes/JsProcessor.js +++ b/packages/dag/src/nodes/JsProcessor.js @@ -8,6 +8,8 @@ export class JavaScript extends NodeType { type = 'migrate_js_processor' + beta = true + maxInputs = 1 // 最大输入个数 maxOutputs = 1 // 最大输出个数 diff --git a/packages/dag/src/nodes/StandardJs.js b/packages/dag/src/nodes/StandardJs.js index 18f69a9600..2575f30146 100644 --- a/packages/dag/src/nodes/StandardJs.js +++ b/packages/dag/src/nodes/StandardJs.js @@ -33,6 +33,7 @@ export class StandardJs extends NodeType { default: 'function process(record){\n\n\t// Enter you code at here\n\treturn record;\n}', 'x-component': 'JsProcessor', 'x-component-props': { + isStandard: true, height: 500, options: { showPrintMargin: false, wrap: false }, includeBeforeAndAfter: true, diff --git a/packages/dag/src/nodes/StandardMigrateJs.js b/packages/dag/src/nodes/StandardMigrateJs.js index 1274597c2a..488ba372b5 100644 --- a/packages/dag/src/nodes/StandardMigrateJs.js +++ b/packages/dag/src/nodes/StandardMigrateJs.js @@ -33,6 +33,7 @@ export class StandardJs extends NodeType { default: 'function process(record){\n\n\t// Enter you code at here\n\treturn record;\n}', 'x-component': 'JsProcessor', 'x-component-props': { + isStandard: true, height: 500, options: { showPrintMargin: false, wrap: false }, includeBeforeAndAfter: true, From f41aa9493a1edf690dcabf27ac99ea0d8dbf9bc1 Mon Sep 17 00:00:00 2001 From: xufei Date: Mon, 16 Jan 2023 19:36:04 +0800 Subject: [PATCH 064/124] reformat(daas): Function list add category filter condition --- apps/daas/src/views/function/List.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/daas/src/views/function/List.vue b/apps/daas/src/views/function/List.vue index 1ed0bab418..631b0e8dca 100644 --- a/apps/daas/src/views/function/List.vue +++ b/apps/daas/src/views/function/List.vue @@ -105,7 +105,9 @@ export default { getData({ page }) { let { type } = this.searchParams let { current, size } = page - let where = {} + let where = { + category: null + } type && (where.type = type) let filter = { where, From d1ab0087c2259d8d84d928fd3a50f5e7dec863b7 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Tue, 17 Jan 2023 11:26:16 +0800 Subject: [PATCH 065/124] refactor(StageButton): watch connectionId to run init function --- packages/component/src/StageButton.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/component/src/StageButton.vue b/packages/component/src/StageButton.vue index c809e99eb9..7e9eb1f949 100644 --- a/packages/component/src/StageButton.vue +++ b/packages/component/src/StageButton.vue @@ -30,11 +30,22 @@ export default { } }, + watch: { + connectionId(v) { + v && this.init() + } + }, + mounted() { - this.getProgress(true) + this.init() }, methods: { + init() { + this.loading = false + this.getProgress(true) + }, + loadSchema() { connectionsApi .updateById(this.connectionId, { From af4fc667f99bca3870faac45db48582a15d2d821 Mon Sep 17 00:00:00 2001 From: xufei Date: Tue, 17 Jan 2023 12:05:58 +0800 Subject: [PATCH 066/124] refactor(@tap/dag): update Database Node tableExpression description --- packages/dag/src/nodes/Database.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/dag/src/nodes/Database.js b/packages/dag/src/nodes/Database.js index aa9b4af45a..07744acb84 100644 --- a/packages/dag/src/nodes/Database.js +++ b/packages/dag/src/nodes/Database.js @@ -137,9 +137,6 @@ export class Database extends NodeType { type: 'string', default: 'custom', 'x-decorator': 'FormItem', - 'x-decorator-props': { - tooltip: '表达式匹配模式下,数据库新增的符合表达的表会被自动同步到目标' - }, 'x-component': 'Radio.Group', enum: [ { @@ -147,7 +144,7 @@ export class Database extends NodeType { value: 'custom' }, { - label: '按表达式匹配', + label: '按正则表达式匹配', value: 'expression' } ] @@ -182,7 +179,7 @@ export class Database extends NodeType { tableExpression: { type: 'string', default: '.*', - description: '使用正则表达式匹配 .*代表任意长度任意字符', + description: '正则表达式匹配模式下,数据库新增的符合表达式的表会被自动同步到目标', 'x-decorator': 'FormItem', 'x-component': 'Input.TextArea', 'x-component-props': { From 8cd9edbf63a282045ecba3b5a5e6ccf925143517 Mon Sep 17 00:00:00 2001 From: xufei Date: Tue, 17 Jan 2023 12:10:26 +0800 Subject: [PATCH 067/124] refactor(@tap/dag): Remove useless code --- packages/dag/src/components/FormPanel.vue | 436 ---------------------- 1 file changed, 436 deletions(-) diff --git a/packages/dag/src/components/FormPanel.vue b/packages/dag/src/components/FormPanel.vue index 61447053fa..7cfa21155b 100644 --- a/packages/dag/src/components/FormPanel.vue +++ b/packages/dag/src/components/FormPanel.vue @@ -183,442 +183,6 @@ export default { this.$emit('setSchema') }, - getSettingSchema() { - return { - type: 'object', - properties: { - layout: { - type: 'void', - 'x-component': 'FormLayout', - 'x-component-props': { - colon: false, - layout: 'vertical', - feedbackLayout: 'terse', - wrapperWidth: 300 - }, - properties: { - flowEngineVersion: { - title: this.$t('packages_dag_dataFlow_flowEngineVersion'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Select', - default: 'Data_Flow_Engine_V1', - enum: [ - { - label: this.$t('packages_dag_dataFlow_flowEngineV1'), - value: 'Data_Flow_Engine_V1' - }, - { - label: this.$t('packages_dag_dataFlow_jetFlowEngineV2'), - value: 'Jet_Flow_Engine_V2' - } - ] - }, - sync_type: { - title: i18n.t('packages_dag_task_setting_sync_type'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Radio.Group', - // default: 'initial_sync+cdc', - enum: [ - { - label: i18n.t('packages_dag_components_formpanel_quanliangzengliang'), - value: 'initial_sync+cdc' - }, - { - label: i18n.t('packages_dag_task_setting_initial_sync'), - value: 'initial_sync' - }, - { - label: i18n.t('packages_dag_task_setting_cdc'), - value: 'cdc' - } - ], - 'x-reactions': { - target: '*(isSerialMode, cdcFetchSize)', - fulfill: { - state: { - visible: '{{$self.value !== "initial_sync"}}' - } - } - } - }, - cdcEngineFilter: { - title: i18n.t('packages_dag_task_setting_cdc_engine_filter'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - }, - stopOnError: { - title: i18n.t('packages_dag_task_setting_stop_on_error'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - // default: true - }, - needToCreateIndex: { - title: i18n.t('packages_dag_task_setting_automatic_index'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - // default: true - }, - isOpenAutoDDL: { - title: i18n.t('packages_dag_components_formpanel_zidongchuliD'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - }, - noPrimaryKey: { - title: i18n.t('packages_dag_components_formpanel_zhichiwuzhujian'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - }, - isSerialMode: { - title: i18n.t('packages_dag_components_formpanel_zengliangshujuchu'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Select', - enum: [ - { - label: i18n.t('packages_dag_components_formpanel_piliang'), - value: false - }, - { - label: i18n.t('packages_dag_components_formpanel_zhutiao'), - value: true - } - ] - }, - cdcFetchSize: { - title: i18n.t('packages_dag_components_formpanel_zengliangpicidu'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'InputNumber', - 'x-component-props': { - min: 1, - max: 1000 - } - // default: 1 - }, - distinctWriteType: { - title: i18n.t('packages_dag_task_setting_distinct_write_type'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Select', - enum: [ - { - label: this.$t('packages_dag_dataFlow_setting_intellect'), - value: 'intellect' - }, - { - label: this.$t('packages_dag_dataFlow_setting_compel'), - value: 'compel' - } - ] - // default: 'intellect' - }, - emailWaring: { - title: i18n.t('packages_dag_components_formpanel_fasongyoujian'), - type: 'object', - 'x-decorator': 'FormItem', - properties: { - paused: { - type: 'boolean', - 'x-component': 'Checkbox', - 'x-component-props': { - option: { - label: i18n.t('packages_dag_components_formpanel_dangrenwutingzhi') - } - } - }, - error: { - type: 'boolean', - 'x-component': 'Checkbox', - 'x-component-props': { - option: { - label: i18n.t('packages_dag_components_formpanel_dangrenwuchucuo') - } - } - }, - edited: { - type: 'boolean', - 'x-component': 'Checkbox', - 'x-component-props': { - option: { - label: i18n.t('packages_dag_components_formpanel_dangrenwubeibian') - } - } - }, - started: { - type: 'boolean', - 'x-component': 'Checkbox', - 'x-component-props': { - option: { - label: i18n.t('packages_dag_components_formpanel_dangrenwukaiqi') - } - } - } - } - }, - readShareLogMode: { - title: i18n.t('packages_dag_task_setting_share_cdc_mode'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Select', - enum: [ - { - label: i18n.t('packages_dag_components_formpanel_liushiduqu'), - value: 'STREAMING' - }, - { - label: i18n.t('packages_dag_components_formpanel_lunxunduqu'), - value: 'POLLING' - } - ] - // default: 'STREAMING' - }, - increment: { - title: i18n.t('packages_dag_task_setting_automatic_index'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch', - 'x-reactions': { - dependencies: ['sync_type'], - fulfill: { - state: { - display: '{{$deps[0] === "initial_sync"}}' - } - } - } - }, - isSchedule: { - title: i18n.t('packages_dag_task_setting_is_schedule'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch', - 'x-reactions': { - dependencies: ['sync_type'], - fulfill: { - state: { - display: '{{$deps[0] === "initial_sync" ? "visible" : "hidden"}}' - } - } - } - // default: false - }, - cronExpression: { - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-component-props': { - placeholder: i18n.t('packages_dag_task_setting_cron_expression') - }, - 'x-reactions': { - dependencies: ['sync_type', 'isSchedule'], - fulfill: { - state: { - display: '{{$deps[0] === "initial_sync" && $deps[1] ? "visible" : "hidden"}}' - } - } - } - }, - readCdcInterval: { - title: i18n.t('packages_dag_components_formpanel_zengliangtongbujian'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-component-props': { - append: 'ms' - } - }, - readBatchSize: { - title: i18n.t('packages_dag_components_formpanel_meiciduqushu'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-content': { - append: 'row' - } - // default: 100 - }, - processorConcurrency: { - title: i18n.t('packages_dag_task_setting_processorThreadNum'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'InputNumber', - 'x-component-props': { - min: 1, - max: 100 - } - // default: 1 - }, - cdcConcurrency: { - title: i18n.t('packages_dag_task_setting_cdc_concurrency'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch', - // default: false, - 'x-reactions': { - dependencies: ['sync_type'], - fulfill: { - state: { - display: '{{$deps[0] !== "initial_sync" ? "visible" : "hidden"}}' - } - } - } - }, - transformerConcurrency: { - title: i18n.t('packages_dag_task_setting_transformer_concurrency'), - type: 'string', - 'x-decorator': 'FormItem', - 'x-component': 'InputNumber', - 'x-component-props': { - min: 1, - max: 100 - }, - 'x-reactions': { - dependencies: ['sync_type', 'cdcConcurrency'], - fulfill: { - state: { - visible: '{{$deps[0] !== "cdc" || ($deps[0] === "cdc" && $deps[1])}}' - } - } - } - // default: 8 - }, - syncPoints: { - title: i18n.t('packages_dag_task_setting_sync_point'), - type: 'array', - 'x-decorator': 'FormItem', - 'x-component': 'ArrayItems', - 'x-reactions': { - dependencies: ['sync_type'], - fulfill: { - state: { - visible: '{{$deps[0] === "cdc"}}' - } - } - }, - items: [ - { - type: 'object', - properties: { - row: { - type: 'void', - 'x-component': 'Row', - 'x-component-props': { - type: 'flex', - gap: '10px' - }, - properties: { - type: { - type: 'string', - 'x-decorator': 'Col', - 'x-decorator-props': { - span: 8 - }, - 'x-component': 'Select', - 'x-component-props': { - placeholder: i18n.t('packages_dag_components_formpanel_qingxuanze') - }, - enum: [ - { - label: this.$t('packages_dag_dataFlow_SyncInfo_localTZType'), - value: 'localTZ' - }, - { - label: this.$t('packages_dag_dataFlow_SyncInfo_connTZType'), - value: 'connTZ' - }, - { - label: this.$t('packages_dag_dataFlow_SyncInfo_currentType'), - value: 'current' - } - ] - }, - date: { - type: 'string', - 'x-decorator': 'Col', - 'x-decorator-props': { - span: 14 - }, - 'x-component': 'DatePicker', - 'x-component-props': { - type: 'datetime', - format: 'yyyy-MM-dd HH:mm:ss' - } - } - } - } - } - } - ] - /*default: [ - { - connectionId: '', - type: 'current', // localTZ: 本地时区; connTZ:连接时区 - time: '', - date: '', - name: '', - timezone: '+08:00' // 当type为localTZ时有该字段 - } - ]*/ - }, - cdcShareFilterOnServer: { - title: i18n.t('packages_dag_components_formpanel_gongxiangwajueri'), - type: 'boolean', - 'x-decorator': 'FormItem', - 'x-component': 'Switch' - }, - maxTransactionLength: { - title: i18n.t('packages_dag_components_formpanel_shiwuzuidashi'), - type: 'number', - 'x-decorator': 'FormItem', - 'x-component': 'InputNumber' - }, - lagTime: { - title: i18n.t('packages_dag_components_formpanel_zengliangzhihoupan'), - type: 'void', - 'x-decorator': 'FormItem', - 'x-component': 'Space', - 'x-reactions': { - dependencies: ['sync_type'], - fulfill: { - state: { - visible: '{{$deps[0] !== "initial_sync"}}' - } - } - }, - properties: { - lagTimeFalg: { - type: 'boolean', - 'x-component': 'Switch' - }, - userSetLagTime: { - type: 'number', - 'x-component': 'InputNumber', - /*'x-component-props': { - append: '秒' - },*/ - 'x-reactions': { - dependencies: ['lagTimeFalg'], - fulfill: { - state: { - visible: '{{$deps[0] === true}}' - } - } - } - } - } - } - } - } - } - } - }, - updateNodePropsDebounce(form) { clearTimeout(this.updateTimer) this.updateTimer = setTimeout(() => { From 7e3344486652c1401a1ebe5191ad5b9285e8c5e7 Mon Sep 17 00:00:00 2001 From: xufei Date: Tue, 17 Jan 2023 12:13:04 +0800 Subject: [PATCH 068/124] fix(@tap/dag): Monitor page do not validate the form #132406 --- packages/dag/src/components/FormPanel.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dag/src/components/FormPanel.vue b/packages/dag/src/components/FormPanel.vue index 7cfa21155b..b2c9e37c31 100644 --- a/packages/dag/src/components/FormPanel.vue +++ b/packages/dag/src/components/FormPanel.vue @@ -94,7 +94,7 @@ export default { } // 校验上一个节点配置 - if (o) { + if (o && !this.stateIsReadonly) { const node = this.nodeById(o) try { if (node) { From 33a332d2519600c79dafcecf90da9a6961dd8cc1 Mon Sep 17 00:00:00 2001 From: kennen <317052920@qq.com> Date: Tue, 17 Jan 2023 15:15:11 +0800 Subject: [PATCH 069/124] refactor(RelationTask/Details): show info when detailData is not empty --- packages/business/src/views/task/relation/Details.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/business/src/views/task/relation/Details.vue b/packages/business/src/views/task/relation/Details.vue index eb748375e1..fbbe0f7fca 100644 --- a/packages/business/src/views/task/relation/Details.vue +++ b/packages/business/src/views/task/relation/Details.vue @@ -10,7 +10,11 @@ }}
-