Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
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
TFMOM
TF-MOM-WEB
Commits
e13caab2
Commit
e13caab2
authored
Aug 09, 2023
by
arvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
装配单元路线修改保存功能
parent
ae2fec0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
10 deletions
+76
-10
unit.vue
...-mes/src/privateComponents/components/MBOMConfig/unit.vue
+76
-10
No files found.
applications/dee-mes/src/privateComponents/components/MBOMConfig/unit.vue
View file @
e13caab2
...
...
@@ -43,6 +43,10 @@ export default {
loading
:
false
,
dialogFlag
:
false
,
unitList
:
[],
modifyData
:
{
task
:
[],
links
:
[]
},
// eslint-disable-next-line no-undef
gantt
:
Gantt
.
getGanttInstance
(),
initGanttFlag
:
false
,
...
...
@@ -138,6 +142,40 @@ export default {
duration
:
this
.
toDuration
(
n
.
workHour
)
}
},
calcCriticalPath
(
link
)
{
},
modifyLink
(
link
,
operator
)
{
const
_link
=
{
sourceId
:
Number
(
link
.
source
),
targetId
:
Number
(
link
.
target
),
isCritical
:
link
.
isCritical
,
id
:
link
.
cid
,
operator
}
if
(
operator
===
'ADD'
)
{
// 判断是否为恢复旧数据
const
item
=
this
.
modifyData
.
links
.
find
(
l
=>
l
.
sourceId
===
_link
.
sourceId
&&
l
.
targetId
===
_link
.
targetId
)
if
(
item
)
{
item
.
operator
=
''
}
else
{
this
.
modifyData
.
links
.
push
(
_link
)
}
}
else
{
// 判断是为删除新数据
const
itemIdx
=
this
.
modifyData
.
links
.
findIndex
(
l
=>
!
l
.
id
&&
l
.
sourceId
===
_link
.
sourceId
&&
l
.
targetId
===
_link
.
targetId
)
if
(
itemIdx
>
-
1
)
{
const
item
=
this
.
modifyData
.
links
[
itemIdx
]
if
(
item
.
id
)
{
item
.
operator
=
'REMOVE'
}
else
{
this
.
modifyData
.
links
.
splice
(
itemIdx
,
1
)
}
}
else
{
this
.
modifyData
.
links
.
push
(
_link
)
}
}
},
getData
(
flag
)
{
if
(
!
flag
&&
this
.
loading
&&
(
this
.
currentId
===
this
.
node
.
id
))
{
return
...
...
@@ -146,6 +184,10 @@ export default {
this
.
gantt
.
clearAll
()
this
.
AOname
=
''
this
.
loading
=
true
this
.
modifyData
=
{
data
:
[],
links
:
[]
}
const
params
=
{
searchItems
:
{
'items'
:
[{
'fieldName'
:
'sourceId'
,
'operator'
:
'EQ'
,
'value'
:
this
.
currentId
}]
},
'sortItem'
:
[{
'fieldName'
:
'modifyTime'
,
'sortOrder'
:
'asc'
}],
...
...
@@ -434,9 +476,15 @@ export default {
text
+=
'<b>'
+
to
.
text
+
'</b>的 '
return
text
}
ganttAss
.
attachEvent
(
'onAfterLinkAdd'
,
function
(
id
,
item
)
{
that
.
modifyLink
(
item
,
'ADD'
)
console
.
log
(
'onAfterLinkAdd'
,
id
,
item
)
})
// 删除连接后触发
ganttAss
.
attachEvent
(
'onAfterLinkDelete'
,
function
(
id
,
item
)
{
console
.
log
(
'onAfterLinkDelete'
,
id
,
item
)
var
target
=
ganttAss
.
getTask
(
item
.
target
)
that
.
modifyLink
(
item
,
'REMOVE'
)
var
targetLength
=
target
.
$target
.
length
if
(
!
targetLength
)
{
var
data
=
{
...
...
@@ -453,15 +501,11 @@ export default {
// 当分支被打开时触发
ganttAss
.
attachEvent
(
'onTaskOpened'
,
function
(
id
)
{
that
.
openTree
.
push
(
Number
(
id
))
})
// 当分支关闭时触发
ganttAss
.
attachEvent
(
'onTaskClosed'
,
function
(
id
)
{
var
arr
=
that
.
openTree
arr
.
splice
(
arr
.
findIndex
((
item
)
=>
item
===
Number
(
id
)),
1
)
})
ganttAss
.
attachEvent
(
'onBeforeTaskDisplay'
,
function
(
id
,
task
)
{
if
(
task
.
priority
)
{
...
...
@@ -544,10 +588,6 @@ export default {
const
pTask
=
this
.
params
.
data
.
find
(
t
=>
t
.
id
===
task
.
parent
)
if
(
pTask
)
{
parentTasks
.
push
(
pTask
)
const
gTask
=
this
.
params
.
data
.
find
(
t
=>
t
.
id
===
pTask
.
parent
)
if
(
gTask
)
{
parentTasks
.
push
(
gTask
)
}
}
}
})
...
...
@@ -556,6 +596,32 @@ export default {
this
.
gantt
.
parse
({
data
:
[...
tasks
,
...
parentTasks
]
})
},
save
()
{
const
params
=
this
.
modifyData
.
links
.
filter
(
r
=>
r
.
operator
)
.
map
(
link
=>
{
if
(
link
.
operator
===
'ADD'
||
link
.
operator
===
'MODIFY'
)
{
return
{
prevNodeId
:
link
.
sourceId
,
prevNodeIdType
:
'ExtProcessPlan'
,
subTypeName
:
'ExtProcessExecutorRoute'
,
isCritical
:
link
.
isCritical
,
currNodeId
:
link
.
targetId
,
currNodeIdType
:
'ExtProcessPlan'
,
id
:
link
.
id
,
operator
:
link
.
operator
}
}
if
(
link
.
operator
===
'REMOVE'
)
{
return
{
id
:
link
.
id
,
operator
:
'REMOVE'
}
}
})
this
.
$api
.
recursion
(
'ExtProcessExecutorRoute'
,
params
,
true
).
then
(
res
=>
{
this
.
getData
()
})
}
}
}
...
...
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