Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
周远喜
mes-ui
Commits
a68d5a4b
Commit
a68d5a4b
authored
Oct 28, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务
parent
a014758f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
806 additions
and
682 deletions
+806
-682
projectTaskTree.vue
components/page/projectTaskTree.vue
+229
-175
state.vue
components/page/state.vue
+50
-34
index.vue
pages/project/task/index.vue
+527
-473
No files found.
components/page/projectTaskTree.vue
View file @
a68d5a4b
<
template
>
<div
class=
"flex fd tree-menu"
>
<h3>
任务结构
<div
class=
"fr mr10 mt10"
>
<ButtonGroup
class=
"fr"
size=
"small"
>
<Button
:icon=
"expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@
click=
"toggle"
title=
"展开/合并"
></Button>
<Button
icon=
"md-refresh"
title=
"刷新"
@
click=
"loadTree"
></Button>
<Button
icon=
"md-rewind"
title=
"收起"
@
click=
"hide"
></Button>
</ButtonGroup>
</div>
</h3>
<div
class=
"flex fd tree-menu"
>
<!-- 任务结构 -->
<div
class=
"p-list"
>
<h3>
<Dropdown
@
on-click=
"clickItem"
>
<a
href=
"javascript:void(0)"
>
{{
downName
}}
<Icon
type=
"ios-arrow-down"
></Icon>
</a>
<DropdownMenu
slot=
"list"
>
<DropdownItem
v-for=
"item in projectList"
:key=
"item.id"
:name=
"item.id"
>
{{
item
.
title
}}
</DropdownItem
>
</DropdownMenu>
</Dropdown>
</h3>
<div
class=
"mr10 mt10 icon-d"
>
<ButtonGroup
class=
"fr"
size=
"small"
>
<Button
:icon=
"expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
@
click=
"toggle"
title=
"展开/合并"
></Button>
<Button
icon=
"md-refresh"
title=
"刷新"
@
click=
"loadTree"
></Button>
<Button
icon=
"md-rewind"
title=
"收起"
@
click=
"hide"
></Button>
</ButtonGroup>
</div>
</div>
<div
class=
"search"
>
<Input
search
placeholder=
"请输入关键字"
v-model=
"keys"
clearable
/>
<Input
search
placeholder=
"请输入关键字"
v-model=
"keys"
clearable
/>
</div>
<div
class=
"fg"
>
<div
class=
"tree"
>
<Tree
:data=
"data"
:render=
"renderContent"
ref=
"tree"
@
on-select-change=
"change"
></Tree>
</div>
<div
class=
"tree"
>
<Tree
:data=
"data"
:render=
"renderContent"
ref=
"tree"
@
on-select-change=
"change"
></Tree>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
""
,
data
()
{
return
{
keys
:
""
,
expand
:
true
,
list
:
[]
};
name
:
""
,
data
()
{
return
{
keys
:
""
,
expand
:
true
,
list
:
[],
downName
:
""
,
projectList
:
[],
};
},
props
:
{
curId
:
{
type
:
String
,
default
:
""
,
},
},
created
()
{
this
.
listSlecet
();
// this.loadTree();
},
methods
:
{
clickItem
(
val
)
{
console
.
log
(
val
);
this
.
projectList
.
forEach
((
e
)
=>
{
if
(
val
==
e
.
id
)
{
this
.
downName
=
e
.
title
;
}
});
this
.
loadTree
(
val
);
},
props
:
{
curId
:
{
type
:
String
,
default
:
''
,
},
listSlecet
()
{
let
data
=
{
conditions
:
[],
sortBy
:
"id"
,
isDesc
:
false
,
};
this
.
$api
.
post
(
`
${
material
}
/projectmain/list`
,
data
).
then
((
r
)
=>
{
if
(
r
.
result
)
{
this
.
projectList
=
r
.
result
;
this
.
downName
=
this
.
projectList
[
0
].
title
;
// this.curId = this.projectList[0].id;
this
.
loadTree
(
this
.
projectList
[
0
].
id
);
}
});
},
created
()
{
this
.
loadTree
();
loadTree
(
v
)
{
let
params
=
{
conditions
:
[
{
fieldName
:
"projectId"
,
fieldValue
:
v
,
conditionalType
:
"Equal"
,
},
],
};
this
.
$api
.
post
(
`
${
material
}
/projectplan/list`
,
params
).
then
((
r
)
=>
{
var
data
=
this
.
$u
.
toTree
(
r
.
result
,
null
,
(
u
)
=>
{
u
.
value
=
u
.
id
;
u
.
expand
=
true
;
u
.
selected
=
false
;
u
.
checked
=
false
;
},
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
});
},
methods
:
{
loadTree
()
{
let
params
=
{
conditions
:
[{
fieldName
:
"projectId"
,
fieldValue
:
this
.
curId
,
conditionalType
:
"Equal"
}]
}
this
.
$api
.
post
(
`
${
material
}
/projectplan/list`
,
params
).
then
(
r
=>
{
var
data
=
this
.
$u
.
toTree
(
r
.
result
,
null
,
u
=>
{
u
.
value
=
u
.
id
;
u
.
expand
=
true
;
u
.
selected
=
false
;
u
.
checked
=
false
;
},
"upId"
);
this
.
list
=
this
.
$u
.
clone
(
data
);
});
},
toggle
()
{
this
.
expand
=
!
this
.
expand
;
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
// let type = "md-folder";
// if (data.isProduct != 0) {
// type = "ios-image";
// }
return
h
(
"div"
,
[
h
(
"state"
,
{
props
:
{
code
:
"mes.project_plan.Type"
,
type
:
"icon"
,
value
:
data
.
type
+
""
}
}),
h
(
"span"
,
{
style
:
{
// color: data.isProduct == 0 ? "#000" : "rgba(38, 128, 235, 1)"
}
},
data
.
title
),
h
(
"state"
,
{
props
:
{
code
:
"mes.project_plan.Status"
,
type
:
"tag"
,
value
:
data
.
status
}
}),
]);
},
change
(
v
,
b
)
{
// console.log(b);
let
ids
=
[];
let
productIds
=
[];
// if (b.bomId !== 0) {
// ids.push(b.bomId);
// }
var
curentId
=
''
curentId
=
b
.
id
productIds
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
toggle
()
{
this
.
expand
=
!
this
.
expand
;
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
var
items
=
this
.
$store
.
getters
.
dictionaryByKey
(
"mes.project_plan.Status"
);
var
item
=
items
.
filter
((
u
)
=>
{
return
u
.
code
==
data
.
status
;
})[
0
];
console
.
warn
(
"jjjjjj"
,
items
,
item
);
var
color
=
item
.
color
||
"black"
;
return
h
(
"div"
,
[
h
(
"state"
,
{
props
:
{
code
:
"mes.project_plan.Type"
,
type
:
"icon"
,
value
:
data
.
type
+
""
,
size
:
16
,
},
}),
h
(
"Badge"
,
{
props
:
{
color
:
color
,
text
:
data
.
title
,
},
}),
]);
},
change
(
v
,
b
)
{
// console.log(b);
let
ids
=
[];
let
productIds
=
[];
// if (b.bomId !== 0) {
// ids.push(b.bomId);
// }
var
curentId
=
""
;
curentId
=
b
.
id
;
productIds
.
push
(
b
.
value
);
if
(
b
.
children
)
{
addId
(
b
.
children
);
function
addId
(
data
)
{
data
.
map
(
u
=>
{
// if (u.bomId !== 0) {
// ids.push(u.bomId);
// }
productIds
.
push
(
u
.
value
);
if
(
u
.
children
)
{
addId
(
u
.
children
);
}
});
}
function
addId
(
data
)
{
data
.
map
((
u
)
=>
{
// if (u.bomId !== 0) {
// ids.push(u.bomId);
// }
productIds
.
push
(
u
.
value
);
if
(
u
.
children
)
{
addId
(
u
.
children
);
}
this
.
$emit
(
"on-select"
,
curentId
,
b
,
productIds
);
},
hide
()
{
this
.
$emit
(
"on-hide"
);
});
}
}
this
.
$emit
(
"on-select"
,
curentId
,
b
,
productIds
);
},
hide
()
{
this
.
$emit
(
"on-hide"
);
},
computed
:
{
data
()
{
let
items
=
this
.
$u
.
clone
(
this
.
list
);
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
},
computed
:
{
data
()
{
let
items
=
this
.
$u
.
clone
(
this
.
list
);
let
expand
=
this
.
expand
;
let
result
=
[];
search
(
this
.
keys
,
items
);
function
search
(
keys
,
data
)
{
data
.
map
(
u
=>
{
if
(
keys
.
length
<
2
)
{
u
.
expand
=
expand
;
result
.
push
(
u
);
}
else
{
u
.
expand
=
expand
;
if
(
u
.
title
.
indexOf
(
keys
)
>
-
1
)
{
result
.
push
(
u
);
}
else
if
(
u
.
children
)
{
search
(
keys
,
u
.
children
);
}
}
});
function
search
(
keys
,
data
)
{
data
.
map
((
u
)
=>
{
if
(
keys
.
length
<
2
)
{
u
.
expand
=
expand
;
result
.
push
(
u
);
}
else
{
u
.
expand
=
expand
;
if
(
u
.
title
.
indexOf
(
keys
)
>
-
1
)
{
result
.
push
(
u
);
}
else
if
(
u
.
children
)
{
search
(
keys
,
u
.
children
);
}
return
result
;
}
}
});
}
return
result
;
},
watch
:
{
curId
(
v
)
{
if
(
v
)
{
this
.
loadTree
();
}
},
},
watch
:
{
curId
(
v
)
{
if
(
v
)
{
this
.
loadTree
(
v
);
}
},
},
};
</
script
>
<
style
lang=
"less"
>
@import "../../assets/css/custom.less";
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: @left-tree-header-color;
background: @left-tree-header-bg-color;
opacity: 1;
padding-left: 10px;
}
// @import "../../assets/css/custom.less";
.search {
height: 50px;
padding: 5px 10px;
}
// .tree-menu {
// h3 {
// height: 50px;
// font-size: 14px;
// font-family: Microsoft YaHei;
// font-weight: bold;
// line-height: 50px;
// color: @left-tree-header-color;
// background: @left-tree-header-bg-color;
// opacity: 1;
// padding-left: 10px;
// }
.p-list {
position: relative;
}
.icon-d {
position: absolute;
top: 0;
right: 0;
}
// .search {
// height: 50px;
// padding: 5px 10px;
// }
.fg {
flex: none;
// height:0;
overflow: auto;
padding-left: 10px;
}
//
.fg {
//
flex: none;
//
// height:0;
//
overflow: auto;
//
padding-left: 10px;
//
}
.tree {
height: calc(100vh - 215px);
overflow: auto;
}
}
//
.tree {
//
height: calc(100vh - 215px);
//
overflow: auto;
//
}
//
}
</
style
>
components/page/state.vue
View file @
a68d5a4b
<
template
>
<div
class=
"ib"
@
click=
"showLife"
>
<div
class=
"ib"
v-if=
"!isMore"
>
<span
v-if=
"type=='text'"
:style=
"style"
>
{{
name
}}
</span>
<Tag
v-if=
"type=='tag'"
:color=
"tagcolor"
>
{{
name
}}
</Tag>
<Badge
v-if=
"type=='dot'"
:color=
"tagcolor"
:text=
"name"
/>
<Icon
v-if=
"type=='icon'"
:type=
"item.icon"
:color=
"tagcolor"
:title=
"name"
size=
"24"
/>
<span
v-if=
"type == 'text'"
:style=
"style"
>
{{
name
}}
</span>
<Tag
v-if=
"type == 'tag'"
:color=
"tagcolor"
>
{{
name
}}
</Tag>
<Badge
v-if=
"type == 'dot'"
:color=
"tagcolor"
:text=
"name"
/>
<Icon
v-if=
"type == 'icon'"
:type=
"item.icon"
:color=
"tagcolor"
:title=
"name"
:size=
"size"
/>
</div>
<div
class=
"ib"
v-else
v-for=
"(li,i) in items"
:key=
"i"
>
<span
v-if=
"type
=='text'"
:style=
"li.style"
>
{{
li
.
name
}}
</span>
<Tag
v-if=
"type
=='tag'"
:color=
"li.tagcolor"
>
{{
li
.
name
}}
</Tag>
<Badge
v-if=
"type
==
'dot'"
:color=
"li.tagcolor"
:text=
"li.name"
/>
<div
class=
"ib"
v-else
v-for=
"(li,
i) in items"
:key=
"i"
>
<span
v-if=
"type
== 'text'"
:style=
"li.style"
>
{{
li
.
name
}}
</span>
<Tag
v-if=
"type
== 'tag'"
:color=
"li.tagcolor"
>
{{
li
.
name
}}
</Tag>
<Badge
v-if=
"type
==
'dot'"
:color=
"li.tagcolor"
:text=
"li.name"
/>
</div>
<Modal
v-model=
"modal"
title=
"生命周期"
width=
"800"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:code=
"code"
:value=
"value"
:mode=
"mode"
/>
<Modal
v-model=
"modal"
title=
"生命周期"
width=
"800"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:code=
"code"
:value=
"value"
:mode=
"mode"
/>
</Modal>
</div>
</
template
>
...
...
@@ -21,48 +33,52 @@ export default {
name
:
"state"
,
data
()
{
return
{
mode
:
'0'
,
mode
:
"0"
,
name
:
""
,
isMore
:
false
,
modal
:
false
,
modal
:
false
,
item
:
{},
items
:
[],
data
:
[],
detail
:
null
,
detail
:
null
,
};
},
props
:
{
default
:
{
type
:
String
,
default
:
""
default
:
""
,
},
type
:
{
type
:
String
,
default
:
"text"
,
validator
:
function
(
value
)
{
validator
:
function
(
value
)
{
return
[
"text"
,
"tag"
,
"dot"
,
"icon"
].
indexOf
(
value
)
!=
-
1
;
}
}
,
},
code
:
{
type
:
String
,
required
:
true
required
:
true
,
},
value
:
{
type
:
[
String
,
Number
],
required
:
false
required
:
false
,
},
color
:
{
type
:
Boolean
,
default
:
true
default
:
true
,
},
size
:
{
type
:
Number
,
default
:
24
,
},
icon
:
{
type
:
Boolean
,
default
:
false
default
:
false
,
},
img
:
{
type
:
Boolean
,
default
:
false
}
default
:
false
,
}
,
},
created
()
{
this
.
data
=
this
.
$store
.
getters
.
dictionaryByKey
(
this
.
code
)
||
[];
...
...
@@ -71,7 +87,7 @@ export default {
setName
(
v
)
{
if
((
v
+
""
).
indexOf
(
","
)
==
-
1
)
{
var
item
;
this
.
data
.
map
(
u
=>
{
this
.
data
.
map
(
(
u
)
=>
{
if
(
u
.
code
==
v
)
{
item
=
u
;
}
...
...
@@ -81,7 +97,7 @@ export default {
this
.
item
=
item
;
}
else
{
if
(
this
.
value
==
"undefined"
)
{
this
.
name
=
' '
this
.
name
=
" "
;
}
else
{
this
.
name
=
this
.
value
;
}
...
...
@@ -90,7 +106,7 @@ export default {
this
.
isMore
=
true
;
var
items
=
[];
var
ul
=
(
v
+
""
).
split
(
","
);
this
.
data
.
map
(
u
=>
{
this
.
data
.
map
(
(
u
)
=>
{
if
(
ul
.
indexOf
(
u
.
code
)
>
-
1
)
{
u
.
tagcolor
=
u
.
color
|
"default"
;
u
.
style
=
{
color
:
u
.
color
|
"inherit"
};
...
...
@@ -99,11 +115,11 @@ export default {
});
this
.
items
=
items
;
}
}
,
showLife
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./life"
);
}
}
,
showLife
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./life"
);
}
,
},
computed
:
{
tagcolor
()
{
...
...
@@ -125,9 +141,9 @@ export default {
color
:
this
.
item
&&
this
.
item
.
color
!=
""
&&
this
.
item
.
color
!=
null
?
this
.
item
.
color
:
"inherit"
:
"inherit"
,
};
}
}
,
},
watch
:
{
value
(
v
)
{
...
...
@@ -139,7 +155,7 @@ export default {
this
.
setName
(
this
.
value
);
this
.
$forceUpdate
();
}
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/project/task/index.vue
View file @
a68d5a4b
<
template
>
<Layout
class=
"full"
>
<Layout
class=
"full"
>
<Sider
hide-trigger
v-if=
"showMenu"
class=
"menu_side"
width=
"300"
>
<ProjectTaskTree
:curId=
"projectId"
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
<ProjectTaskTree
:curId=
"projectId"
@
on-hide=
"onHide"
@
on-select=
"productSearch"
/>
</Sider>
<div
v-if=
"!showMenu"
class=
"show_menu"
>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
<a
class=
"menu_play fr"
@
click=
"showMenuFn"
title=
"展开"
>
<Icon
type=
"ios-arrow-forward"
size=
"24"
/>
</a>
</div>
<Content
class=
"content"
:class=
"!showMenu?'con_bord':''"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:lazy=
"true"
:set=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
inline
>
<FormItem>
<div
class=
"taskMenu"
>
<Menu
mode=
"horizontal"
active-name=
"2"
@
on-select=
"onSelect"
>
<MenuItem
name=
"1"
>
所有
</MenuItem>
<MenuItem
name=
"2"
>
未关闭
</MenuItem>
<MenuItem
name=
"3"
>
指派给我
</MenuItem>
<MenuItem
name=
"4"
>
由我参与
</MenuItem>
<MenuItem
name=
"5"
>
已延期
</MenuItem>
<!--
<Content
class=
"content"
:class=
"!showMenu ? 'con_bord' : ''"
>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:lazy=
"true"
:set=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
inline
>
<FormItem>
<div
class=
"taskMenu"
>
<Menu
mode=
"horizontal"
active-name=
"2"
@
on-select=
"onSelect"
>
<MenuItem
name=
"1"
>
所有
</MenuItem>
<MenuItem
name=
"2"
>
未关闭
</MenuItem>
<MenuItem
name=
"3"
>
指派给我
</MenuItem>
<MenuItem
name=
"4"
>
由我参与
</MenuItem>
<MenuItem
name=
"5"
>
已延期
</MenuItem>
<!--
<Submenu
name=
"6"
>
<template
slot=
"title"
>
更多
...
...
@@ -42,504 +43,557 @@
</MenuGroup>
</Submenu>
-->
</Menu>
</div>
<div
class=
"taskTab"
v-if=
"false"
>
<Tabs
value=
"statu2"
>
<TabPane
label=
"所有"
name=
"statu1"
/>
<TabPane
label=
"未关闭"
name=
"statu2"
/>
<TabPane
label=
"指派给我"
name=
"statu3"
/>
<TabPane
label=
"由我参与"
name=
"statu4"
/>
<TabPane
label=
"已延期"
name=
"statu5"
/>
</Tabs>
</div>
</FormItem>
<FormItem
prop=
"keys"
><Input
placeholder=
"请输入项目标题/计划名称/任务标题"
v-model=
"easySearch.keys.value"
v-width=
"240"
/>
</FormItem>
<FormItem><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem>
<!--
</Menu>
</div>
<div
class=
"taskTab"
v-if=
"false"
>
<Tabs
value=
"statu2"
>
<TabPane
label=
"所有"
name=
"statu1"
/>
<TabPane
label=
"未关闭"
name=
"statu2"
/>
<TabPane
label=
"指派给我"
name=
"statu3"
/>
<TabPane
label=
"由我参与"
name=
"statu4"
/>
<TabPane
label=
"已延期"
name=
"statu5"
/>
</Tabs>
</div>
</FormItem>
<FormItem
prop=
"keys"
><Input
placeholder=
"请输入项目标题/计划名称/任务标题"
v-model=
"easySearch.keys.value"
v-width=
"240"
/>
</FormItem>
<FormItem
><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem
>
<!--
<FormItem>
<Button @click="highSearch" type="text">
<Icon type="md-search" />高级
</Button>
</FormItem>
-->
</Form>
</template>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
>
开始
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
>
暂停
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
>
继续
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
:fullscreen=
"fullScreen"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
:pid=
"planId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</Form>
</template>
<
template
slot=
"buttons"
>
<Button
type=
"primary"
@
click=
"add"
>
新增
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
>
开始
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
>
暂停
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
>
继续
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1200"
:fullscreen=
"fullScreen"
footer-hide
>
<component
:is=
"detail"
:eid=
"curId"
:pid=
"planId"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</Content>
</Layout>
</Layout>
</template>
<
script
>
import
Api
from
'./api'
import
Search
from
'./search'
import
Api
from
"./api"
;
import
Search
from
"./search"
;
export
default
{
name
:
'list'
,
components
:
{
Search
,
},
head
:
{
title
:
""
,
author
:
"henq"
,
description
:
"project_task 10/20/2020 9:27:58 AM"
,
},
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"title"
,
value
:
null
},
projectId
:
{
op
:
"Equal"
,
value
:
''
},
planId
:
{
op
:
"In"
,
value
:
[]
}
},
theme1
:
'light'
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
''
,
fullScreen
:
false
,
projectId
:
''
,
columns
:
[
// {
// key: "selection",
// type: "selection",
// width: 50,
// align: "center"
// },
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
'a'
,
{
attrs
:
{
oprate
:
'detail'
},
on
:
{
click
:
()
=>
this
.
viewRecord
(
params
.
row
.
id
)
}
},
params
.
row
.
title
)
}
},
{
key
:
"level"
,
title
:
this
.
l
(
"level"
),
align
:
"center"
,
high
:
true
,
code
:
'project.task.level'
},
{
key
:
"projectTitle"
,
title
:
this
.
l
(
"projectTitle"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"planTitle"
,
title
:
this
.
l
(
"planTitle"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
'project.task.status'
},
{
key
:
"userId"
,
title
:
this
.
l
(
"userId"
),
align
:
"left"
,
high
:
true
,
type
:
'user'
},
{
key
:
"startDate"
,
title
:
this
.
l
(
"startDate"
),
align
:
"center"
,
high
:
true
,
},
{
key
:
"endDate"
,
title
:
this
.
l
(
"endDate"
),
align
:
"center"
,
high
:
true
,
},
{
key
:
"workHour"
,
title
:
this
.
l
(
"workHour"
),
align
:
"center"
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
'a'
,
{
attrs
:
{
oprate
:
'detail'
},
on
:
{
click
:
()
=>
this
.
viewWork
(
params
.
row
.
id
)
}
},
params
.
row
.
workHour
)
}
},
{
key
:
"note"
,
title
:
this
.
l
(
"note"
),
align
:
"left"
,
high
:
true
,
hide
:
true
},
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
'user'
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
200
,
align
:
'center'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'div'
,
{
class
:
"action"
},
[
h
(
'op'
,
{
attrs
:
{
icon
:
"md-arrow-dropright-circle"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
params
.
row
.
status
==
0
?
"开始"
:
params
.
row
.
status
==
2
?
"继续"
:
''
,
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
1
)
}
}),
// h('op', {
// attrs: {
// icon: "ios-pause",
// type: "icon",
// title: "暂停",
// //disable: params.row.status == 1 ? false : true
// },
// on: {
// click: () => this.updatepart(params.row.id, 2)
// }
// }),
h
(
'op'
,
{
attrs
:
{
icon
:
"ios-alarm"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
"完成"
,
//disable: (params.row.status != 0 && params.row.status != 3) ? false : true
},
on
:
{
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
3
)
}
}),
h
(
'op'
,
{
attrs
:
{
icon
:
"md-add"
,
type
:
"icon"
,
oprate
:
"add"
,
title
:
"新增记录"
,
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true
},
on
:
{
click
:
()
=>
this
.
addRecord
(
params
.
row
.
id
)
}
}),
h
(
'op'
,
{
attrs
:
{
icon
:
"md-create"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
"修改"
,
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
}
}),
h
(
'op'
,
{
attrs
:
{
icon
:
"md-trash"
,
type
:
"icon"
,
title
:
"删除"
,
oprate
:
'delete'
,
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
})
])
}
},
],
data1
:
[{
id
:
1
,
title
:
'测试title'
}],
data
:
[],
planId
:
''
,
//当前计划Id
planIdsCur
:
[]
}
},
props
:
{
eid
:
String
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
},
created
()
{
if
(
this
.
eid
!=
''
)
{
this
.
projectId
=
this
.
eid
this
.
easySearch
.
projectId
.
value
=
this
.
eid
}
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
if
(
this
.
eid
!=
""
)
{
this
.
easySearch
.
projectId
.
value
=
this
.
eid
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
},
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
()
this
.
modal
=
false
this
.
curId
=
0
;
name
:
"list"
,
components
:
{
Search
,
},
head
:
{
title
:
""
,
author
:
"henq"
,
description
:
"project_task 10/20/2020 9:27:58 AM"
,
},
data
()
{
return
{
action
:
Api
.
index
,
showMenu
:
true
,
easySearch
:
{
keys
:
{
op
:
"title"
,
value
:
null
,
},
search
()
{
this
.
easySearch
.
planId
.
value
=
this
.
planIdsCur
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
)
projectId
:
{
op
:
"Equal"
,
value
:
""
,
},
add
()
{
this
.
curId
=
this
.
projectId
;
this
.
title
=
"新增"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'./add'
)
this
.
modal
=
true
;
planId
:
{
op
:
"In"
,
value
:
[],
},
highSearch
()
{
this
.
curId
=
0
;
this
.
title
=
"高级搜索"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'./search'
)
this
.
modal
=
true
;
},
theme1
:
"light"
,
modal
:
false
,
title
:
"新增"
,
detail
:
null
,
curId
:
""
,
fullScreen
:
false
,
projectId
:
""
,
columns
:
[
// {
// key: "selection",
// type: "selection",
// width: 50,
// align: "center"
// },
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'./add'
)
this
.
modal
=
true
;
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"a"
,
{
attrs
:
{
oprate
:
"detail"
,
},
on
:
{
click
:
()
=>
this
.
viewRecord
(
params
.
row
.
id
),
},
},
params
.
row
.
title
);
},
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'./detail'
)
this
.
modal
=
true
;
{
key
:
"level"
,
title
:
this
.
l
(
"level"
),
align
:
"center"
,
high
:
true
,
code
:
"project.task.level"
,
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'./edit'
)
this
.
modal
=
true
;
{
key
:
"projectTitle"
,
title
:
this
.
l
(
"projectTitle"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
'删除成功'
)
}
})
{
key
:
"planTitle"
,
title
:
this
.
l
(
"planTitle"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
hide
:
true
,
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
{
key
:
"status"
,
title
:
this
.
l
(
"status"
),
align
:
"center"
,
high
:
true
,
code
:
"project.task.status"
,
},
{
key
:
"userId"
,
title
:
this
.
l
(
"userId"
),
align
:
"left"
,
high
:
true
,
type
:
"user"
,
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
{
key
:
"startDate"
,
title
:
this
.
l
(
"startDate"
),
align
:
"center"
,
high
:
true
,
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
{
key
:
"endDate"
,
title
:
this
.
l
(
"endDate"
),
align
:
"center"
,
high
:
true
,
},
productSearch
(
id
,
item
,
planIds
)
{
this
.
planId
=
item
.
selected
?
id
:
''
;
this
.
planIdsCur
=
item
.
selected
?
planIds
:
[]
let
where
=
{
planId
:
{
op
:
"In"
,
value
:
item
.
selected
?
planIds
:
[]
{
key
:
"workHour"
,
title
:
this
.
l
(
"workHour"
),
align
:
"center"
,
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"a"
,
{
attrs
:
{
oprate
:
"detail"
,
},
projectId
:
{
op
:
"Equal"
,
value
:
this
.
eid
on
:
{
click
:
()
=>
this
.
viewWork
(
params
.
row
.
id
),
},
};
this
.
$refs
.
grid
.
reload
(
where
);
},
params
.
row
.
workHour
);
},
},
updatepart
(
valId
,
valStatus
)
{
let
params
=
{
id
:
valId
,
status
:
valStatus
}
Api
.
updatepart
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
'操作成功'
)
}
else
{
this
.
$Message
.
error
(
'操作失败'
)
}
}).
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
'操作失败'
)
console
.
warn
(
err
)
})
{
key
:
"note"
,
title
:
this
.
l
(
"note"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
onSelect
(
val
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
)
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
},
viewRecord
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看记录"
;
this
.
fullScreen
=
true
;
this
.
detail
=
()
=>
import
(
'./detail'
)
this
.
modal
=
true
;
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
hide
:
true
,
type
:
"user"
,
},
viewWork
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看工时"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'../record'
)
this
.
modal
=
true
;
{
title
:
"操作"
,
key
:
"action"
,
width
:
200
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
,
},
[
h
(
"op"
,
{
attrs
:
{
icon
:
"md-arrow-dropright-circle"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
params
.
row
.
status
==
0
?
"开始"
:
params
.
row
.
status
==
2
?
"继续"
:
""
,
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
1
),
},
}),
// h('op', {
// attrs: {
// icon: "ios-pause",
// type: "icon",
// title: "暂停",
// //disable: params.row.status == 1 ? false : true
// },
// on: {
// click: () => this.updatepart(params.row.id, 2)
// }
// }),
h
(
"op"
,
{
attrs
:
{
icon
:
"ios-alarm"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
"完成"
,
//disable: (params.row.status != 0 && params.row.status != 3) ? false : true
},
on
:
{
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
3
),
},
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"md-add"
,
type
:
"icon"
,
oprate
:
"add"
,
title
:
"新增记录"
,
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true
},
on
:
{
click
:
()
=>
this
.
addRecord
(
params
.
row
.
id
),
},
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"md-create"
,
type
:
"icon"
,
oprate
:
"edit"
,
title
:
"修改"
,
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
),
},
}),
h
(
"op"
,
{
attrs
:
{
icon
:
"md-trash"
,
type
:
"icon"
,
title
:
"删除"
,
oprate
:
"delete"
,
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
),
},
}),
]
);
},
},
addRecord
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"新增记录"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
'../record/add'
)
this
.
modal
=
true
;
],
data1
:
[
{
id
:
1
,
title
:
"测试title"
,
},
l
(
key
)
{
let
vkey
=
"project_task"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
}
],
data
:
[],
planId
:
""
,
//当前计划Id
planIdsCur
:
[],
};
},
props
:
{
eid
:
String
,
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
created
()
{
if
(
this
.
eid
!=
""
)
{
this
.
projectId
=
this
.
eid
;
this
.
easySearch
.
projectId
.
value
=
this
.
eid
;
}
this
.
treeHeight
=
window
.
innerHeight
-
150
;
},
mounted
()
{
if
(
this
.
eid
!=
""
)
{
this
.
easySearch
.
projectId
.
value
=
this
.
eid
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
},
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
easySearch
.
planId
.
value
=
this
.
planIdsCur
;
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
add
()
{
this
.
curId
=
this
.
projectId
;
this
.
title
=
"新增"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
highSearch
()
{
this
.
curId
=
0
;
this
.
title
=
"高级搜索"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"./search"
);
this
.
modal
=
true
;
},
copy
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"克隆"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"./add"
);
this
.
modal
=
true
;
},
view
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"详情"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
edit
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"编辑"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"./edit"
);
this
.
modal
=
true
;
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
""
)
{
this
.
eid
=
v
}
remove
(
id
)
{
Api
.
delete
(
id
).
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"删除成功"
);
}
}
}
});
},
cancel
()
{
this
.
curId
=
0
;
this
.
modal
=
false
;
},
onHide
()
{
// this.$Message.info("收起左侧树")
this
.
showMenu
=
false
;
},
showMenuFn
()
{
//this.$Message.info("展开左侧树")
this
.
showMenu
=
true
;
},
productSearch
(
id
,
item
,
planIds
)
{
this
.
planId
=
item
.
selected
?
id
:
""
;
this
.
planIdsCur
=
item
.
selected
?
planIds
:
[];
let
where
=
{
planId
:
{
op
:
"In"
,
value
:
item
.
selected
?
planIds
:
[],
},
projectId
:
{
op
:
"Equal"
,
value
:
this
.
eid
,
},
};
this
.
$refs
.
grid
.
reload
(
where
);
},
updatepart
(
valId
,
valStatus
)
{
let
params
=
{
id
:
valId
,
status
:
valStatus
,
};
Api
.
updatepart
(
params
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
$Message
.
success
(
"操作成功"
);
}
else
{
this
.
$Message
.
error
(
"操作失败"
);
}
})
.
catch
((
err
)
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"操作失败"
);
console
.
warn
(
err
);
});
},
onSelect
(
val
)
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
viewRecord
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看记录"
;
this
.
fullScreen
=
true
;
this
.
detail
=
()
=>
import
(
"./detail"
);
this
.
modal
=
true
;
},
viewWork
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"查看工时"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"../record"
);
this
.
modal
=
true
;
},
addRecord
(
id
)
{
this
.
curId
=
id
;
this
.
title
=
"新增记录"
;
this
.
fullScreen
=
false
;
this
.
detail
=
()
=>
import
(
"../record/add"
);
this
.
modal
=
true
;
},
l
(
key
)
{
let
vkey
=
"project_task"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
""
)
{
this
.
eid
=
v
;
}
},
},
};
</
script
>
<
style
lang=
"less"
>
@import "../../../assets/css/custom.less";
.full {
margin-top: 0;
margin-top: 0;
.content {
margin-top: 10px;
.content {
margin-top: 10px;
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-add:before {
content: "\f341";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
.ivu-icon-ios-remove:before {
content: "\f33d";
}
}
.ivu-layout-sider {
background: @layout-content-bg-color;
margin-right: 10px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
// height: 89vh;
overflow: auto;
}
.ivu-layout-content {
margin-left: 5px;
background: @right-bg;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
overflow: auto;
padding: 10px;
// height: 89vh;
}
}
.taskTab .ivu-tabs-bar {
border-bottom: 1px solid #fff;
margin-bottom: 2px;
border-bottom: 1px solid #fff;
margin-bottom: 2px;
}
.taskMenu {
font-size: 12px;
font-size: 12px;
.ivu-menu-horizontal {
height: 30px;
line-height: 30px;
}
.ivu-menu-horizontal {
height: 30px;
line-height: 30px;
}
.ivu-menu-light {
&:after {
height: 0px !important;
}
.ivu-menu-light {
&:after {
height: 0px !important;
}
}
}
.actionCur {
a {
span {
padding: 4px;
}
a {
span {
padding: 4px;
}
i {
padding: 4px;
border-radius: 3px;
font-weight: bold;
font-size: 18px;
}
i {
padding: 4px;
border-radius: 3px;
font-weight: bold;
font-size: 18px;
}
}
}
</
style
>
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