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
85ba568f
Commit
85ba568f
authored
Oct 09, 2023
by
吴斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改权重不成功的bug
parent
98e737d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
32 deletions
+12
-32
阀 - 副本.xml
src/assets/models/valve/阀 - 副本.xml
+1
-23
analyze-data.vue
src/components/info/analyze-data.vue
+10
-6
GOJSKit.ts
src/kit/GOJSKit.ts
+1
-3
No files found.
src/assets/models/valve/阀 - 副本.xml
deleted
100644 → 0
View file @
98e737d6
<?xml version="1.0" encoding="utf-8"?>
++ /dev/null
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
version=
"1.1"
id=
"图层_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"90px"
height=
"50px"
viewBox=
"0 0 90 50"
enable-background=
"new 0 0 90 50"
xml:space=
"preserve"
>
<linearGradient
id=
"SVGID_1_"
gradientUnits=
"userSpaceOnUse"
x1=
"45"
y1=
"1.044341e-005"
x2=
"45"
y2=
"50"
>
<stop
offset=
"0.0056"
style=
"stop-color:#717071"
/>
<stop
offset=
"0.1763"
style=
"stop-color:#9E9E9F"
/>
<stop
offset=
"0.3483"
style=
"stop-color:#C8C9CA"
/>
<stop
offset=
"0.5219"
style=
"stop-color:#FFFFFF"
/>
<stop
offset=
"0.6946"
style=
"stop-color:#DBDCDC"
/>
<stop
offset=
"0.7395"
style=
"stop-color:#D7D8D8"
/>
<stop
offset=
"0.7841"
style=
"stop-color:#CBCCCC"
/>
<stop
offset=
"0.8284"
style=
"stop-color:#B8B8B9"
/>
<stop
offset=
"0.836"
style=
"stop-color:#B4B4B5"
/>
<stop
offset=
"1"
style=
"stop-color:#6B6A6A"
/>
</linearGradient>
<path
fill=
"url(#SVGID_1_)"
stroke=
"#C8C9CA"
stroke-width=
"0.1877"
stroke-miterlimit=
"10"
d=
"M87.442,0.224L45.738,23.568
c-0.371,0.208-0.609,0.522-0.738,0.867c-0.129-0.345-0.366-0.659-0.738-0.867L2.558,0.224C1.421-0.412,0,0.383,0,1.656v46.688
c0,1.273,1.421,2.068,2.558,1.432l41.704-23.344c0.371-0.208,0.609-0.522,0.738-0.867c0.129,0.345,0.366,0.659,0.738,0.867
l41.704,23.344C88.579,50.412,90,49.617,90,48.344V1.656C90,0.383,88.579-0.412,87.442,0.224z"
/>
</svg>
src/components/info/analyze-data.vue
View file @
85ba568f
...
...
@@ -14,13 +14,14 @@
</el-form>
<div
class=
"flex justify-center"
>
<el-checkbox
@
change=
"highlightPath(key)"
v-model=
"value.highlight"
>
高亮
</el-checkbox>
<el-button
type=
"primary"
@
click=
"
computeData(pathNodesMap, analyzeResult)
"
class=
"ml-4"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"
analyzeCompute
"
class=
"ml-4"
>
确定
</el-button>
</div>
</el-collapse-item>
</el-collapse>
</el-scrollbar>
<div
class=
"w-full h-32 bg-red-200"
>
<div
class=
"mb-2 mt-0 text-xl font-medium leading-tight text-primary"
>
分析结果
</div>
<!--
<div>
{{
analyzeResult
}}
</div>
-->
<div
v-for=
"(value, key) in analyzeResult"
class=
"flex"
>
<div>
{{
nodeMap
[
key
].
data
.
name
}}
:
{{
value
}}
</div>
</div>
...
...
@@ -49,9 +50,10 @@ const props = defineProps({
})
let
pathNodesMap
=
ref
<
Record
<
string
,
any
>>
({})
let
analyzeResult
=
ref
<
any
>
(
{}
)
let
analyzeResult
=
ref
<
any
>
(
null
)
watch
(()
=>
props
.
paths
,
(
newValue
)
=>
{
pathNodesMap
.
value
=
{}
newValue
.
forEach
((
path
:
any
)
=>
{
let
pathNode
:
any
[]
=
[]
let
pathNodeName
:
string
[]
=
[]
...
...
@@ -63,9 +65,14 @@ watch(()=>props.paths, (newValue) => {
'nodeKeys'
:
path
,
'nodesName'
:
pathNodeName
,
"nodes"
:
pathNode
,
'highlight'
:
false
,
'weight'
:
1
/
props
.
paths
.
length
}
})
computeData
(
pathNodesMap
.
value
,
analyzeResult
)
analyzeCompute
(
)
});
function
analyzeCompute
(){
computeData
(
pathNodesMap
.
value
,
analyzeResult
)
}
function
highlightPath
(
pathIndex
:
string
){
let
path
:
number
[]
=
pathNodesMap
.
value
[
pathIndex
].
nodeKeys
cancelHighlightLink
(
props
.
myDiagram
)
...
...
@@ -75,6 +82,4 @@ function highlightPath(pathIndex:string){
}
}
}
</
script
>
\ No newline at end of file
src/kit/GOJSKit.ts
View file @
85ba568f
...
...
@@ -157,7 +157,6 @@ export function highlightLink(from:number, to:number, myDiagram:any){
model
.
set
(
item
,
"color"
,
"red"
)
}
})
console
.
log
(
linkDataArray
);
}
export
function
cancelHighlightLink
(
myDiagram
:
any
){
...
...
@@ -177,7 +176,6 @@ export function computeData(pathNodesMap:any, analyzeResult:any){
console
.
log
(
"compute"
,
pathNodesMap
);
for
(
let
key
in
pathNodesMap
){
let
path
=
pathNodesMap
[
key
]
console
.
log
(
path
.
nodeKeys
)
for
(
let
node
of
path
.
nodes
){
if
(
node
.
data
.
key
in
nodesDataMap
){
let
currentNodeIndex
=
path
.
nodes
.
indexOf
(
node
)
...
...
@@ -186,7 +184,6 @@ export function computeData(pathNodesMap:any, analyzeResult:any){
}
let
lastNode
=
path
.
nodes
[
currentNodeIndex
-
1
]
nodesDataMap
[
node
.
data
.
key
][
'predict'
]
+=
lastNode
.
data
.
press
*
path
.
weight
console
.
log
(
"predict"
,
nodesDataMap
[
node
.
data
.
key
][
'predict'
],
lastNode
.
data
.
press
,
path
.
weight
);
}
else
{
nodesDataMap
[
node
.
data
.
key
]
=
{
'predict'
:
0
,
'real'
:
node
.
data
.
press
}
...
...
@@ -213,5 +210,6 @@ export function computeData(pathNodesMap:any, analyzeResult:any){
analyzeResult
.
value
[
key
]
=
"压力正常"
}
}
console
.
log
(
analyzeResult
.
value
)
return
nodesDataMap
}
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