Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gojs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴斌
vue-gojs
Commits
08f77e51
Commit
08f77e51
authored
Dec 19, 2023
by
吴斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UI overlap issue and enable rule execution
parent
875f2e49
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
11 deletions
+9
-11
App.vue
src/App.vue
+2
-2
ModelData.ts
src/kit/ModelData.ts
+0
-0
NodeTemplateKit.ts
src/kit/NodeTemplateKit.ts
+0
-5
Rule.ts
src/kit/rule/Rule.ts
+4
-3
main.ts
src/main.ts
+3
-1
No files found.
src/App.vue
View file @
08f77e51
...
...
@@ -132,7 +132,7 @@
<!-- 添加图形模板弹窗-->
<!-- 添加端口弹窗-->
<el-dialog
v-model=
"showAddPortDialog"
title=
"添加端口"
class=
"w-[500px] h-[500px]"
>
<el-form
v-model=
"addPortForm"
>
<el-form
v-model=
"addPortForm"
>
<el-form-item
label=
"端口名称"
>
<el-input
v-model=
"addPortForm.name"
></el-input>
</el-form-item>
...
...
@@ -562,7 +562,6 @@ function listenDiagram(){
myDiagram
.
addModelChangedListener
(
function
(
e
:
any
){
if
(
e
.
isTransactionFinished
)
{
deviceMap
.
value
=
getDiagramMapData
(
myDiagram
)
runAllEnableRule
(
deviceMap
.
value
)
}
})
}
...
...
@@ -776,6 +775,7 @@ function changeDeviceData(){
}
)
myDiagram
.
commitTransaction
(
'changeDeviceData'
)
runAllEnableRule
(
deviceMap
.
value
)
}
function
changeDataRealTime
(){
...
...
src/kit/ModelData.ts
View file @
08f77e51
This diff is collapsed.
Click to expand it.
src/kit/NodeTemplateKit.ts
View file @
08f77e51
...
...
@@ -40,11 +40,6 @@ export function makeShapeNode (stretch: typeof go.GraphObject.Fill = go.GraphObj
)
}
//
// export function makeGONode(){
// return GO(go.Shape, )
// }
/*
* 不同类型返回不同的节点模板
*/
...
...
src/kit/rule/Rule.ts
View file @
08f77e51
...
...
@@ -120,7 +120,10 @@ export function runRule(rule: any, deviceMap: Record<string, any>) {
export
function
runAllEnableRule
(
deviceMap
:
Record
<
string
,
any
>
)
{
rules
.
forEach
((
item
:
any
)
=>
{
if
(
item
[
'enable'
].
toString
()
===
'true'
)
{
runRule
(
item
,
deviceMap
)
// 为了避免触发Notification的时间一样,会导致UI重叠,所以使用setTimeout添加延迟。
setTimeout
(()
=>
{
runRule
(
item
,
deviceMap
)
},
1
)
}
})
}
...
...
@@ -205,10 +208,8 @@ export function runLua(rule: any, inputData: any) {
${
rule
[
'func'
]}
end
`
let
luaFunction
=
fengari
.
load
(
codeString
)
return
luaFunction
().
call
(
inputData
)
}
catch
(
e
)
{
alert
(
e
)
}
...
...
src/main.ts
View file @
08f77e51
...
...
@@ -4,6 +4,7 @@ import gojs from 'gojs'
import
ElementUI
from
'element-plus'
;
import
*
as
ElementPlusIconsVue
from
'@element-plus/icons-vue'
import
"element-plus/theme-chalk/index.css"
import
'./style/element-plus/custom.css'
import
'virtual:uno.css'
import
'./assets/iconfont/iconfont.css'
...
...
@@ -15,4 +16,4 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app
.
component
(
key
,
component
)
}
app
.
mount
(
'#app'
)
app
.
mount
(
'#app'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment