Commit 08f77e51 by 吴斌

Fix UI overlap issue and enable rule execution

parent 875f2e49
......@@ -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(){
......
......@@ -40,11 +40,6 @@ export function makeShapeNode (stretch: typeof go.GraphObject.Fill = go.GraphObj
)
}
//
// export function makeGONode(){
// return GO(go.Shape, )
// }
/*
* 不同类型返回不同的节点模板
*/
......
......@@ -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)
}
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment