From 9fc1a55def8de378c567c53f80e64b215c46514d Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Mon, 10 Apr 2023 09:42:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.ts | 2 +- src/api/login.ts | 6 +- src/components/Layout/BasicLayoutPage.vue | 5 +- src/router/menu.ts | 8 + .../Save/action/ListItem/FilterCondition.vue | 1 + .../Save/action/ListItem/FilterGroup.vue | 7 +- .../Scene/Save/action/ListItem/Item.vue | 637 +++++++++--------- src/views/rule-engine/Scene/Save/util.ts | 14 +- 8 files changed, 351 insertions(+), 329 deletions(-) diff --git a/src/api/home.ts b/src/api/home.ts index a37c0f3d..c7d0805e 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -1,7 +1,7 @@ import server from '@/utils/request'; // 当前登录用户权限信息 -export const getMe_api = () => server.get(`/authorize/me`); +export const getMe_api = () => server.get<{ user: any, [key : string]: any }>(`/authorize/me`); // 设置登录用户选择的页面 export const setView_api = (data:object) => server.patch(`/user/settings/view/user`, data); // 当前登录用户选择的页面 diff --git a/src/api/login.ts b/src/api/login.ts index fd3eed95..b5511f80 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -10,7 +10,7 @@ export const config = () => server.get(`/authorize/captcha/config`) * 获取验证码图片 * @returns */ -export const code = () => server.get(`/authorize/captcha/image?width=130&height=30`) +export const code = () => server.get<{ base64: string, key: string }>(`/authorize/captcha/image?width=130&height=30`) /** * 登录 @@ -57,3 +57,7 @@ export const userDetail = () => server.get('/user/detail') * 退出登录 */ export const loginout_api = () => server.get('/user-token/reset') + +export const getOAuth2 = (params: any) => server.get('/oauth2/authorize', params) + +export const initApplication = (clientId: string | number) => server.get<{name: string}>(`/application/${clientId}/info`) diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 0121209e..48dbeaf1 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -110,8 +110,6 @@ const jump = (item: any) => { path = item.path } - console.log(item, history.state) - console.log(path) // jumpPage(slotProps.route.path) router.push(path) } @@ -119,8 +117,7 @@ const jump = (item: any) => { const breadcrumb = computed(() => { const paths = router.currentRoute.value.name as string - console.log(router.currentRoute) - console.log(route) + const metas = findRouteMeta(paths) return metas.map((item, index) => { return { diff --git a/src/router/menu.ts b/src/router/menu.ts index 48fe3918..59a832ae 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -4,6 +4,7 @@ export const AccountCenterBindPath = '/account/center/bind' export const InitLicense = '/init-license' export const NotificationSubscriptionCode = 'account/NotificationSubscription' export const NotificationRecordCode = 'account/NotificationRecord' +export const OauthPath = '/oauth' export const AccountMenu = { path: '/account', @@ -70,6 +71,13 @@ export default [ { path: InitLicense, component: () => import('@/views/system/License/index.vue') + }, + { + path: OauthPath, + meta: { + title: '授权页' + }, + component: () => import('@/views/oauth/index.vue') } ] \ No newline at end of file diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue index c0248b84..5469d1d2 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue @@ -348,6 +348,7 @@ const termAdd = () => { } const onDelete = () => { + const key = formModel.value.branches?.[props.branchName]?.then?.[props.thenName]?.actions?.[props.actionName].terms?.[props.termsName].terms?.[props.name].key formModel.value.branches?.[props.branchName]?.then?.[props.thenName]?.actions?.[props.actionName].terms?.[props.termsName].terms?.splice(props.name, 1) const _options = formModel.value.branches![props.branchName].then[props.thenName].actions[props.name].options const termsColumns = _options?.termsColumns || [] diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue index 3e7c95c7..c178ad34 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterGroup.vue @@ -107,8 +107,11 @@ const onKeys: string[] = EventSubscribeKeys({ action: props.actionName }) -const handleRequest = () => { - columnRequest() +const handleRequest = (e: any) => { + const hasDelete = 'isDelete' in e + if (!hasDelete) { + columnRequest() + } } EventEmitter.subscribe(onKeys, handleRequest) diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/Item.vue b/src/views/rule-engine/Scene/Save/action/ListItem/Item.vue index 8dd1f30b..c4884343 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/Item.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/Item.vue @@ -6,328 +6,328 @@ >
-
-
- -
-
- - -
-
- - - + + +
+ 点击配置执行动作 +
+
{{ name + 1 }}
+ +
+ +
+
@@ -461,11 +461,14 @@ const termsOptions = computed(() => { }); const onDelete = () => { + const key = _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].key + EventEmitter.emit(key!, { isDelete: true }) if (props.name !== 0 && !props.parallel) { // 清空上一个串行执行动作中的options.termsColumns和terms _data.value.branches![props.branchesName].then[props.thenName].actions[props.name - 1].options!.termsColumns = [] _data.value.branches![props.branchesName].then[props.thenName].actions[props.name - 1].options!.terms = [] _data.value.branches![props.branchesName].then[props.thenName].actions[props.name - 1].terms = [] } + emit('delete'); }; diff --git a/src/views/rule-engine/Scene/Save/util.ts b/src/views/rule-engine/Scene/Save/util.ts index 1e0bd228..c35fb190 100644 --- a/src/views/rule-engine/Scene/Save/util.ts +++ b/src/views/rule-engine/Scene/Save/util.ts @@ -68,6 +68,8 @@ export const EventEmitterKeys = (params: Params): string => { * @constructor */ export const EventSubscribeKeys = (params: Params): string[] => { + const sceneStore = useSceneStore() + let keys: string[] = [] if (params.action === 0) { @@ -75,10 +77,14 @@ export const EventSubscribeKeys = (params: Params): string[] => { } for (let i = 0; i <= params.action; i++) { - const _b = `branches_${params.branch}` // branchesName - const _t = `then_${params.branchGroup}` // thenName - const _a = `then_${i}` // actionName - keys.push(`${_b}_${_t}_${_a}`) + let key = sceneStore.data.branches?.[params.branch].then[params.branchGroup].actions[i]?.key + if (!key) { + const _b = `branches_${params.branch}` // branchesName + const _t = `then_${params.branchGroup}` // thenName + const _a = `then_${i}` // actionName + key = `${_b}_${_t}_${_a}` + } + keys.push(key) } return keys