198 changed files with 1008 additions and 1012 deletions
@ -0,0 +1,51 @@ |
|||
import type { InternalMouseEvent, GraphPluginConstructor } from '@maxgraph/core'; |
|||
import { |
|||
Graph, |
|||
Geometry, |
|||
Point, |
|||
CellState, |
|||
ConnectionHandler, |
|||
CellEditorHandler, |
|||
SelectionCellsHandler, |
|||
SelectionHandler, |
|||
RubberBandHandler, |
|||
ConnectionConstraint, |
|||
} from '@maxgraph/core'; |
|||
|
|||
class PlatformGeometryClass extends Geometry { |
|||
constraints = [ |
|||
new ConnectionConstraint(new Point(0.25, 0), true), |
|||
new ConnectionConstraint(new Point(0.5, 0), true), |
|||
new ConnectionConstraint(new Point(0.75, 0), true), |
|||
new ConnectionConstraint(new Point(0, 0.25), true), |
|||
new ConnectionConstraint(new Point(0, 0.5), true), |
|||
new ConnectionConstraint(new Point(0, 0.75), true), |
|||
new ConnectionConstraint(new Point(1, 0.25), true), |
|||
new ConnectionConstraint(new Point(1, 0.5), true), |
|||
new ConnectionConstraint(new Point(1, 0.75), true), |
|||
new ConnectionConstraint(new Point(0.25, 1), true), |
|||
new ConnectionConstraint(new Point(0.5, 1), true), |
|||
new ConnectionConstraint(new Point(0.75, 1), true), |
|||
]; |
|||
} |
|||
|
|||
class PlatformConnectionHandler extends ConnectionHandler { |
|||
createEdgeState(_me: InternalMouseEvent) { |
|||
const edge = this.graph.createEdge(null, null!, null, null, null); |
|||
return new CellState(this.graph.view, edge, this.graph.getCellStyle(edge)); |
|||
} |
|||
} |
|||
|
|||
const plugins: GraphPluginConstructor[] = [CellEditorHandler, SelectionCellsHandler, PlatformConnectionHandler, SelectionHandler, RubberBandHandler]; |
|||
|
|||
class PlatformGraph extends Graph { |
|||
constructor(container: HTMLElement) { |
|||
super(container, undefined, plugins); |
|||
new RubberBandHandler(this); |
|||
} |
|||
getAllConnectionConstraints = (terminal: CellState | null, _source: boolean) => { |
|||
return (terminal?.cell?.geometry as PlatformGeometryClass)?.constraints ?? null; |
|||
}; |
|||
} |
|||
|
|||
export { PlatformGraph }; |
@ -0,0 +1,129 @@ |
|||
<template> |
|||
<w-dialog |
|||
ref="dialogRef" |
|||
width="500px" |
|||
:title="$t('changeRole')" |
|||
:can-maximize="false" |
|||
:buttons="[ |
|||
{ |
|||
label: $t('submit'), |
|||
noCaps: true, |
|||
click: () => { |
|||
axios.post(Environment.apiContextPath('api/security/changDefaultRole'), formRef.getData()).then((response) => { |
|||
const token = response.data; |
|||
if (token) { |
|||
AuthenticationManager.setLocalAccessToken(token); |
|||
|
|||
// 获取应用初始化参数 |
|||
const parameter = ApplicationInitializer.getInitializeParameter(); |
|||
|
|||
// 登录成功后,重新获取用户会话 |
|||
SessionManager.updateLastRequestDatetime(); |
|||
SessionManager.loadUserSession().then((userSession) => { |
|||
if (userSession) { |
|||
// 设置用户信息 |
|||
SessionManager.setUser(userSession.user); |
|||
|
|||
// 构建菜单 |
|||
MenuManager.setLocalMenus(parameter.localMenus); |
|||
SessionManager.setMenus(MenuManager.buildMenus(userSession.menus)); |
|||
|
|||
// 设置本地组件 |
|||
ComponentManager.setLocalComponents(parameter.localComponents); |
|||
|
|||
// 构建路由 |
|||
SessionManager.setRoutes(userSession.routes); |
|||
RouterManager.removeAllRoutes(); |
|||
RouterManager.setLocalRoutes(parameter.localRoutes); |
|||
RouterManager.buildRoutes(toRaw(userSession.routes)); |
|||
|
|||
// 关闭窗口 |
|||
close(); |
|||
|
|||
if (RouterManager.getRouteByName(router.currentRoute.value.name)) { |
|||
router.push({ |
|||
name: router.currentRoute.value.name, |
|||
params: router.currentRoute.value.params, |
|||
query: router.currentRoute.value.query, |
|||
}); |
|||
} else { |
|||
router.push({ |
|||
name: '/', |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
]" |
|||
> |
|||
<w-form |
|||
ref="formRef" |
|||
:cols-num="1" |
|||
class="p-2" |
|||
:fields="[ |
|||
{ |
|||
name: 'roleId', |
|||
label: $t('role'), |
|||
type: 'select', |
|||
required: true, |
|||
options: avaiableRoleOptionsRef, |
|||
defaultValue: currentRoleRef, |
|||
}, |
|||
]" |
|||
></w-form> |
|||
</w-dialog> |
|||
</template> |
|||
<script setup lang="ts"> |
|||
import { ref, toRaw } from 'vue'; |
|||
import { useRouter } from 'vue-router'; |
|||
import type { UserSessionType } from '@/platform'; |
|||
import { |
|||
axios, |
|||
Environment, |
|||
SessionManager, |
|||
AuthenticationManager, |
|||
MenuManager, |
|||
ComponentManager, |
|||
RouterManager, |
|||
ApplicationInitializer, |
|||
TagViewManager, |
|||
} from '@/platform'; |
|||
|
|||
const emit = defineEmits(['change']); |
|||
|
|||
const router = useRouter(); |
|||
|
|||
const dialogRef = ref(); |
|||
const formRef = ref(); |
|||
const avaiableRoleOptionsRef = ref([]); |
|||
const currentRoleRef = ref(); |
|||
|
|||
const open = () => { |
|||
const session: UserSessionType = SessionManager.getSession() as UserSessionType; |
|||
axios.get(Environment.apiContextPath('api/system/role/queryRolesByUser?userId=' + session.user.userId)).then((response) => { |
|||
const roles = response.data?.content; |
|||
if (roles && roles.length > 0) { |
|||
const options = []; |
|||
for (const role of roles) { |
|||
options.push({ label: role.name, value: role.id }); |
|||
} |
|||
avaiableRoleOptionsRef.value = options; |
|||
} |
|||
}); |
|||
currentRoleRef.value = session.user.defaultRoleId; |
|||
|
|||
dialogRef.value.show(); |
|||
}; |
|||
|
|||
const close = () => { |
|||
dialogRef.value.hide(); |
|||
}; |
|||
|
|||
defineExpose({ |
|||
open, |
|||
close, |
|||
}); |
|||
</script> |
@ -0,0 +1,4 @@ |
|||
package io.sc.platform.orm.entity; |
|||
|
|||
public interface DesensitizedEntity { |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue