|
@@ -50,12 +50,14 @@ function configureStyles(graph: InstanceType<typeof myMxGraph>) {
|
|
}
|
|
}
|
|
|
|
|
|
function setupGraphListeners(graph: InstanceType<typeof myMxGraph>) {
|
|
function setupGraphListeners(graph: InstanceType<typeof myMxGraph>) {
|
|
- graph.getSelectionModel().addListener(myMxConstants.EVENT_CHANGE, (sender: unknown, evt: any) => {
|
|
|
|
- const cells = evt.getProperty('added')
|
|
|
|
- console.log('Selected cells:', cells)
|
|
|
|
- })
|
|
|
|
|
|
+ graph
|
|
|
|
+ .getSelectionModel()
|
|
|
|
+ .addListener(myMxConstants.EVENT_CHANGE, (_sender: unknown, evt: any) => {
|
|
|
|
+ const cells = evt.getProperty('added')
|
|
|
|
+ console.log('Selected cells:', cells)
|
|
|
|
+ })
|
|
|
|
|
|
- graph.addListener(myMxConstants.EVENT_DOUBLE_CLICK, (sender: unknown, evt: any) => {
|
|
|
|
|
|
+ graph.addListener(myMxConstants.EVENT_DOUBLE_CLICK, (_sender: unknown, evt: any) => {
|
|
const cell = evt.getProperty('cell')
|
|
const cell = evt.getProperty('cell')
|
|
if (cell) {
|
|
if (cell) {
|
|
const newValue = prompt('输入新值:', graph.convertValueToString(cell) || '')
|
|
const newValue = prompt('输入新值:', graph.convertValueToString(cell) || '')
|
|
@@ -69,7 +71,7 @@ function setupGraphListeners(graph: InstanceType<typeof myMxGraph>) {
|
|
function setupContextMenu(graph: InstanceType<typeof myMxGraph>) {
|
|
function setupContextMenu(graph: InstanceType<typeof myMxGraph>) {
|
|
myMxEvent.disableContextMenu(graph.container)
|
|
myMxEvent.disableContextMenu(graph.container)
|
|
|
|
|
|
- graph.addListener(myMxConstants.EVENT_CONTEXT_MENU, (sender: unknown, evt: any) => {
|
|
|
|
|
|
+ graph.addListener(myMxConstants.EVENT_CONTEXT_MENU, (_sender: unknown, evt: any) => {
|
|
const cell = evt.getProperty('cell')
|
|
const cell = evt.getProperty('cell')
|
|
evt.preventDefault()
|
|
evt.preventDefault()
|
|
|
|
|