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
b200153c
Commit
b200153c
authored
Nov 06, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目保存模版成功!
parent
3727f106
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
173 additions
and
28 deletions
+173
-28
api.js
pages/project/plan/api.js
+7
-3
importTemplate.vue
pages/project/plan/importTemplate.vue
+134
-0
index.vue
pages/project/plan/index.vue
+7
-0
saveTemplate.vue
pages/project/plan/saveTemplate.vue
+1
-5
index.vue
pages/project/resources/templates/index.vue
+24
-20
No files found.
pages/project/plan/api.js
View file @
b200153c
...
...
@@ -26,13 +26,17 @@ export default {
}
});
},
///projecttemplate/list
templates
(
params
){
return
Api
.
post
(
`
${
material
}
/projecttemplate/list`
,
params
)
},
saveTemplate
(
params
){
return
Api
.
post
(
'projecttemplate/create'
,
params
)
return
Api
.
post
(
`
${
material
}
/projectplan/createtemplate`
,
params
)
},
useTemplate
(
params
){
return
Api
.
post
(
'projecttemplate/usetemplate'
,
params
)
return
Api
.
post
(
`
${
material
}
/projectplan/usetemplate`
,
params
)
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projectplan/
batchdele
te`
,
params
);
return
Api
.
post
(
`
${
material
}
/projectplan/
usetempla
te`
,
params
);
}
}
pages/project/plan/importTemplate.vue
0 → 100644
View file @
b200153c
<
template
>
<div>
<EditGrid
:columns=
"columns"
ref=
"grid"
:items=
"list"
>
</EditGrid>
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"list"
,
head
:
{
title
:
""
,
author
:
"henq"
,
description
:
"project_template 10/29/2020 5:40:26 PM"
,
},
data
()
{
return
{
curId
:
0
,
list
:[],
columns
:
[
{
key
:
"id"
,
title
:
this
.
$t
(
"id"
),
hide
:
true
,
align
:
"left"
,
high
:
true
,
},
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
align
:
"left"
,
easy
:
true
,
high
:
true
,
},
{
key
:
"note"
,
title
:
this
.
l
(
"note"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"project.task.Type"
,
},
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
type
:
"user"
,
},
{
title
:
"操作"
,
key
:
"action"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"remove"
,
msg
:
"确定要导入模版吗?"
},
on
:
{
click
:
()
=>
this
.
useTemplate
(
params
.
row
.
id
)
},
},
"导入"
),
// h(
// "op",
// {
// attrs: { oprate: "delete" },
// on: { click: () => this.remove(params.row.id) },
// },
// "删除"
// ),
]);
},
},
],
};
},
mounted
()
{
this
.
load
();
},
props
:
{
v
:
Object
,
eid
:
String
,
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
ok
()
{
this
.
$refs
.
grid
.
load
();
this
.
modal
=
false
;
this
.
curId
=
""
;
},
load
()
{
Api
.
templates
({
}).
then
(
r
=>
{
this
.
list
=
r
.
result
;
})
},
useTemplate
(
id
)
{
Api
.
useTemplate
({
id
:
id
,
projectId
:
this
.
eid
}).
then
(
r
=>
{
if
(
r
.
success
){
this
.
$Message
.
success
(
"导入成功"
);
this
.
$emit
(
"on-load"
)
}
})
},
l
(
key
)
{
let
vkey
=
"project_template"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
};
</
script
>
<
style
lang=
"less"
>
</
style
>
\ No newline at end of file
pages/project/plan/index.vue
View file @
b200153c
...
...
@@ -397,6 +397,13 @@ export default {
that
.
title
=
"保存模版"
;
that
.
detail
=
()
=>
import
(
"./saveTemplate"
);
that
.
modal
=
true
;
},
useTemplate
(
name
){
that
.
curId
=
that
.
eid
;
that
.
row
=
that
.
data
;
that
.
title
=
"导入模版"
;
that
.
detail
=
()
=>
import
(
"./importTemplate"
);
that
.
modal
=
true
;
}
}
m
[
name
]
&&
m
[
name
](
name
);
...
...
pages/project/plan/saveTemplate.vue
View file @
b200153c
...
...
@@ -47,19 +47,15 @@ export default {
eid
:
String
,
},
mounted
()
{
if
(
this
.
eid
)
{
this
.
load
(
this
.
eid
);
}
},
methods
:
{
handleSubmit
()
{
this
.
$refs
.
form
.
validate
((
v
)
=>
{
if
(
v
)
{
Api
.
cre
ate
(
this
.
entity
)
Api
.
saveTempl
ate
(
this
.
entity
)
.
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
...
...
pages/project/resources/templates/index.vue
View file @
b200153c
...
...
@@ -107,8 +107,8 @@ export default {
high
:
true
,
},
{
key
:
"
attachment
"
,
title
:
this
.
l
(
"
attachment
"
),
key
:
"
note
"
,
title
:
this
.
l
(
"
note
"
),
align
:
"left"
,
high
:
true
,
},
...
...
@@ -117,9 +117,29 @@ export default {
title
:
this
.
l
(
"type"
),
align
:
"left"
,
high
:
true
,
code
:
"project.task.level"
// code: "mes.project_template.Type",
code
:
"project.task.level"
,
// code: "mes.project_template.Type",
},
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creationTime"
),
align
:
"left"
,
high
:
true
,
},
{
key
:
"creatorUserId"
,
title
:
this
.
l
(
"creatorUserId"
),
align
:
"left"
,
high
:
true
,
type
:
"user"
,
},
// {
// key: "attachment",
// title: this.l("attachment"),
// align: "left",
// high: true,
// },
{
title
:
"操作"
,
key
:
"action"
,
...
...
@@ -210,22 +230,6 @@ export default {
this
.
modal
=
false
;
},
l
(
key
)
{
/*
project_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
title:'标题',
note:'请注意',
template:'模板',
attachment:'附件',
type:'模版类型',
}
*/
let
vkey
=
"project_template"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
...
...
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