From c8596787799b05e68afb2c14ce466e9b1be2afa6 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 20 Jun 2024 17:06:14 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/router/modules/application.ts | 2 +- ui/src/views/application-workflow/index.vue | 26 +- .../views/application/ApplicationSetting.vue | 507 ++++++++++++++++++ 3 files changed, 527 insertions(+), 8 deletions(-) create mode 100644 ui/src/views/application/ApplicationSetting.vue diff --git a/ui/src/router/modules/application.ts b/ui/src/router/modules/application.ts index af215d81d..daefb7754 100644 --- a/ui/src/router/modules/application.ts +++ b/ui/src/router/modules/application.ts @@ -48,7 +48,7 @@ const applicationRouter = { parentPath: '/application/:id/:type', parentName: 'ApplicationDetail' }, - component: () => import('@/views/application/CreateAndSetting.vue') + component: () => import('@/views/application/ApplicationSetting.vue') }, { path: 'hit-test', diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index ebacca038..f20f9135d 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -4,6 +4,9 @@

{{ detail?.name }}

+ 保存时间:{{ datetimeFormat(saveTime) }}
@@ -13,7 +16,8 @@ 调试 - 保存 + 保存 + 发布
@@ -77,6 +81,7 @@ import { menuNodes } from '@/workflow/common/data' import { iconComponent } from '@/workflow/icons/utils' import applicationApi from '@/api/application' import { MsgSuccess, MsgConfirm } from '@/utils/message' +import { datetimeFormat } from '@/utils/time' import useStore from '@/stores' const { application } = useStore() const route = useRoute() @@ -94,6 +99,7 @@ const detail = ref(null) const showPopover = ref(false) const showDebug = ref(false) const enlarge = ref(false) +const saveTime = ref('') function publicHandle() { workflowRef.value?.validate().then(() => { @@ -132,15 +138,21 @@ function getDetail() { }) } +function saveApplication() { + const obj = { + work_flow: getGraphData() + } + application.asyncPutApplication(id, obj).then((res) => { + saveTime.value = new Date() + }) +} + /** * 定时保存 */ const initInterval = () => { interval = setInterval(() => { - const obj = { - work_flow: getGraphData() - } - application.asyncPutApplication(id, obj) + saveApplication() }, 60000) } @@ -181,9 +193,9 @@ onBeforeUnmount(() => { user-select: none; /* CSS3属性 */ position: absolute; top: 110px; - right: 23px; + right: 77px; z-index: 99; - width: 253px; + width: 263px; box-shadow: 0px 4px 8px 0px var(--app-text-color-light-1); background: #ffffff; padding-bottom: 8px; diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue new file mode 100644 index 000000000..67a4aac96 --- /dev/null +++ b/ui/src/views/application/ApplicationSetting.vue @@ -0,0 +1,507 @@ + + + From 1e7ba0656076b180466d2f0d1963f9ae3b35d160 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 20 Jun 2024 17:36:34 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E9=9A=90=E8=97=8F=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/layout/components/breadcrumb/index.vue | 6 ++++-- ui/src/layout/components/sidebar/SidebarItem.vue | 15 +++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ui/src/layout/components/breadcrumb/index.vue b/ui/src/layout/components/breadcrumb/index.vue index 1f529ee39..aaf6924b7 100644 --- a/ui/src/layout/components/breadcrumb/index.vue +++ b/ui/src/layout/components/breadcrumb/index.vue @@ -161,8 +161,10 @@ function changeMenu(id: string) { router.push({ name: lastMatched.name, params: { id: id } }) } else if (isApplication.value) { const type = list.value?.filter((v) => v.id === id)?.[0]?.type - if (lastMatched.name === 'AppSetting' && type === 'WORK_FLOW') { - router.push({ path: `/application/${id}/${type}/overview` }) + if (type === 'WORK_FLOW') { + if (lastMatched.name === 'AppSetting' || lastMatched.name === 'AppHitTest') { + router.push({ path: `/application/${id}/${type}/overview` }) + } } else { router.push({ name: lastMatched.name, diff --git a/ui/src/layout/components/sidebar/SidebarItem.vue b/ui/src/layout/components/sidebar/SidebarItem.vue index 4e2a7e1ab..443bcb2aa 100644 --- a/ui/src/layout/components/sidebar/SidebarItem.vue +++ b/ui/src/layout/components/sidebar/SidebarItem.vue @@ -1,5 +1,5 @@