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
4e006a98
Commit
4e006a98
authored
Oct 27, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Plain Diff
ok
parents
17c1eedb
0a699746
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
290 additions
and
139 deletions
+290
-139
opration.vue
components/page/opration.vue
+109
-81
henq.js
libs/henq.js
+59
-3
index1.vue
pages/project/record/index1.vue
+44
-6
api.js
pages/project/task/api.js
+32
-25
index.vue
pages/project/task/index.vue
+46
-24
No files found.
components/page/opration.vue
View file @
4e006a98
<
template
>
<Tooltip
trigger=
"hover"
v-if=
"title"
:content=
"title
"
placement=
"top-end"
>
<Tooltip
trigger=
"hover"
v-if=
"!disable&&title"
:content=
"titles
"
placement=
"top-end"
>
<a
class=
"op"
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type == 'icon'"
:type=
"icon"
:color=
"color
"
/>
<span
v-else=
"type ==
'text'"
v-text=
"text"
></span>
</slot>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
:color=
"colors
"
/>
<span
v-else=
"type==
'text'"
v-text=
"text"
></span>
</slot>
</a>
</Tooltip>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
</Tooltip>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type == 'icon'"
:type=
"icon"
:color=
"color
"
/>
<span
v-else=
"type ==
'text'"
v-text=
"text"
></span>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
:color=
"colors
"
/>
<span
v-else=
"type==
'text'"
v-text=
"text"
></span>
</slot>
</a>
</a>
</
template
>
<
script
>
export
default
{
name
:
"op"
,
props
:
{
icon
:
{
type
:
String
,
},
oprate
:
{
type
:
String
,
},
type
:
{
type
:
String
,
default
:
"text"
,
name
:
"op"
,
props
:
{
icon
:
{
type
:
String
},
oprate
:
{
type
:
String
},
type
:
{
type
:
String
,
default
:
"text"
},
title
:
{
type
:
String
,
},
msg
:
{
type
:
String
,
default
:
"确认要删除吗?"
},
color
:
{
type
:
String
},
disable
:
{
type
:
Boolean
,
default
:
false
},
},
title
:
{
type
:
String
,
data
()
{
return
{
text
:
""
,
css
:
"detail"
,
colors
:
this
.
color
,
titles
:
this
.
title
};
},
msg
:
{
type
:
String
,
default
:
"确认要删除吗?"
,
created
()
{
var
oprates
=
{
detail
:
"查看"
,
edit
:
"编辑"
,
add
:
"添加"
,
delete
:
"删除"
,
remove
:
"删除"
};
if
(
oprates
[
this
.
oprate
])
{
this
.
text
=
oprates
[
this
.
oprate
];
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
oprate
)
{
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
type
==
"icon"
)
{
this
.
css
=
"icon"
;
}
},
color
:
{
type
:
String
,
mounted
()
{
if
(
this
.
disable
)
{
this
.
colors
=
"#ccc"
;
this
.
titles
=
''
}
},
disalbe
:
{
// 0 启用 1 禁用 2权限不足
type
:
Number
,
default
:
0
,
methods
:
{
handler
()
{
if
(
!
this
.
disable
)
{
if
(
this
.
oprate
==
"delete"
||
this
.
oprate
==
"remove"
)
{
this
.
$Modal
.
confirm
({
title
:
this
.
title
,
content
:
"<p>"
+
this
.
msg
+
"</p>"
,
onOk
:
()
=>
{
this
.
$emit
(
"click"
,
event
);
}
});
}
else
{
this
.
$emit
(
"click"
,
event
);
}
}
}
},
},
data
()
{
return
{
text
:
""
,
css
:
"detail"
,
};
},
created
()
{
var
oprates
=
{
detail
:
"查看"
,
edit
:
"编辑"
,
add
:
"添加"
,
delete
:
"删除"
,
remove
:
"删除"
,
};
watch
:
{
v
()
{},
disable
(
v
)
{
if
(
v
)
{
this
.
colors
=
"#ccc"
;
this
.
titles
=
''
;
}
else
{
this
.
colors
=
this
.
color
;
this
.
titles
=
this
.
title
;
if
(
oprates
[
this
.
oprate
])
{
this
.
text
=
oprates
[
this
.
oprate
];
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
oprate
)
{
this
.
css
=
this
.
oprate
;
}
else
if
(
this
.
type
==
"icon"
)
{
this
.
css
=
"icon"
;
}
if
(
this
.
disalbe
){
this
.
css
=
"disable"
}
},
methods
:
{
handler
()
{
if
(
this
.
disalbe
==
0
)
{
if
(
this
.
oprate
==
"delete"
||
this
.
oprate
==
"remove"
)
{
this
.
$Modal
.
confirm
({
title
:
this
.
title
,
content
:
"<p>"
+
this
.
msg
+
"</p>"
,
onOk
:
()
=>
{
this
.
$emit
(
"click"
,
event
);
},
});
}
else
{
this
.
$emit
(
"click"
,
event
);
}
}
else
if
(
this
.
disalbe
==
1
){
this
.
$Message
.
warning
(
"不能操作"
)
}
else
{
this
.
$Message
.
warning
(
"没有权限"
)
}
}
this
.
disable
=
v
},
color
(
v
)
{
if
(
v
&&
v
!=
''
)
{
this
.
colors
=
v
}
},
title
(
v
)
{
if
(
v
&&
v
!=
''
)
{
this
.
titles
=
v
}
},
},
},
};
</
script
>
<
style
lang=
"less"
>
a.op {
display: inline;
margin: 0 3px;
display: inline;
margin: 0 3px;
}
</
style
>
libs/henq.js
View file @
4e006a98
...
...
@@ -524,9 +524,7 @@ henq.makeRules = (list, apiUrl) => {
required
:
true
,
trigger
:
"blur"
}
}
else
if
(
el
.
ruleType
==
'datetime'
)
{
}
else
if
(
el
.
ruleType
==
'datetime'
)
{
objInfo
=
{
required
:
true
,
message
:
"请选择时间"
,
...
...
@@ -552,4 +550,62 @@ henq.makeRules = (list, apiUrl) => {
return
rules
}
//colums验证end
//获取当天、明天、昨天、本周、上周、本月、上月的日期 start
//获取今天的日期
henq
.
getToday
=
()
=>
{
let
myDate
=
new
Date
();
let
nowDate
=
myDate
.
getFullYear
()
+
"-"
+
(
myDate
.
getMonth
()
+
1
)
+
"-"
+
myDate
.
getDate
();
return
nowDate
}
//获取明天的日期
henq
.
getTomorrow
=
()
=>
{
let
myDate
=
new
Date
();
myDate
.
setTime
(
myDate
.
getTime
()
+
24
*
60
*
60
*
1000
);
let
tomorrowDate
=
myDate
.
getFullYear
()
+
"-"
+
(
myDate
.
getMonth
()
+
1
)
+
"-"
+
myDate
.
getDate
();
return
tomorrowDate
}
//获取昨天的日期
henq
.
getYestoday
=
()
=>
{
let
myDate
=
new
Date
();
myDate
.
setTime
(
myDate
.
getTime
()
-
24
*
60
*
60
*
1000
);
let
yestoayDate
=
myDate
.
getFullYear
()
+
"-"
+
(
myDate
.
getMonth
()
+
1
)
+
"-"
+
myDate
.
getDate
();
return
yestoayDate
}
//获取本周的日期
henq
.
getCurMonday
=
(
val
)
=>
{
let
nowTemp
=
new
Date
();
//当前时间
let
oneDayLong
=
24
*
60
*
60
*
1000
;
//一天的毫秒数
let
c_time
=
nowTemp
.
getTime
();
//当前时间的毫秒时间
let
c_day
=
nowTemp
.
getDay
()
||
7
;
//当前时间的星期几
let
m_time
=
c_time
-
(
c_day
-
val
)
*
oneDayLong
;
//当前周一的毫秒时间
let
monday
=
new
Date
(
m_time
);
//设置周一时间对象
let
m_year
=
monday
.
getFullYear
();
let
m_month
=
monday
.
getMonth
()
+
1
;
let
m_date
=
monday
.
getDate
();
return
m_year
+
'-'
+
m_month
+
'-'
+
m_date
}
henq
.
getCurMonth
=
(
val
)
=>
{
let
nowTemp
=
new
Date
();
//当前时间
let
m_year
=
nowTemp
.
getFullYear
();
let
m_month
=
nowTemp
.
getMonth
()
+
1
+
val
;
if
(
m_month
==
0
)
{
m_month
=
12
m_year
=
m_year
-
1
}
return
m_year
+
'-'
+
m_month
}
//获取当天、明天、昨天、本周、上周、本月、上月的日期 end
export
default
henq
;
pages/project/record/index1.vue
View file @
4e006a98
...
...
@@ -4,7 +4,7 @@
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem>
<div
class=
"taskMenu"
>
<Menu
mode=
"horizontal"
active-name=
"
2
"
>
<Menu
mode=
"horizontal"
active-name=
"
1"
@
on-select=
"onSelectTime
"
>
<MenuItem
name=
"1"
>
所有
</MenuItem>
...
...
@@ -40,23 +40,23 @@
</div>
</FormItem>
<FormItem
style=
"float:right"
>
<Button
type=
"primary"
@
click=
"add"
>
新增记录
</Button>
<Button
type=
"primary"
@
click=
"add"
v-if=
"false"
>
新增记录
</Button>
</FormItem>
</Form>
</div>
<div>
<div
class=
"group"
>
<Row>
<Col
span=
"
3
"
>
<Col
span=
"
4
"
>
<div
class=
"fr boxBoder"
>
<List>
<ListItem>
<ListItemMeta>
<
template
slot=
"title"
>
<h3>
今天
</h3>
<h3>
{{
listTitle
}}
</h3>
</
template
>
<
template
slot=
"description"
>
2020-10-20
{{
listTime
}}
</
template
>
</ListItemMeta>
<
template
slot=
"action"
>
...
...
@@ -71,7 +71,7 @@
<Col
span=
"2"
>
<Divider
class=
"dividerpram"
/>
</Col>
<Col
span=
"1
9
"
>
<Col
span=
"1
8
"
>
<div
class=
"boxBoder"
>
<Timeline
v-if=
"recordList&&recordList.length>0"
>
<TimelineItem
v-for=
"(item,index) in recordList"
:key=
"index"
v-if=
"recordList&&recordList.length>0"
>
...
...
@@ -283,6 +283,8 @@ export default {
name
:
""
,
field
:
""
,
},
listTitle
:
'所有'
,
listTime
:
'截止当前:'
+
this
.
$u
.
getToday
()
}
},
mounted
()
{
...
...
@@ -363,6 +365,42 @@ export default {
this
.
parms
.
eid
=
val
;
this
.
modalFiles
=
true
;
},
onSelectTime
(
name
)
{
let
title
=
'所有'
;
let
time
=
'截止当前:'
+
this
.
$u
.
getToday
();
switch
(
name
)
{
case
'2'
:
title
=
'今天'
;
time
=
this
.
$u
.
getToday
();
break
;
case
'3'
:
title
=
'昨天'
;
time
=
this
.
$u
.
getYestoday
();
break
;
case
'4'
:
title
=
'本周'
;
time
=
this
.
$u
.
getCurMonday
(
1
)
+
"--"
+
this
.
$u
.
getToday
();
break
;
case
'5'
:
title
=
'上周'
;
time
=
this
.
$u
.
getCurMonday
(
-
6
)
+
"--"
+
this
.
$u
.
getCurMonday
(
0
);
break
;
case
'6'
:
title
=
'本月'
;
time
=
this
.
$u
.
getCurMonth
(
0
);
break
;
case
'7'
:
title
=
'上月'
;
time
=
this
.
$u
.
getCurMonth
(
-
1
);
break
;
default
:
title
=
'所有'
;
time
=
'截止当前:'
+
this
.
$u
.
getToday
();
break
;
}
this
.
listTitle
=
title
;
this
.
listTime
=
time
;
},
l
(
key
)
{
let
vkey
=
"project_plan_record"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
...
...
pages/project/task/api.js
View file @
4e006a98
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
material
}
/projecttask/paged`
,
paged
(
params
){
return
Api
.
post
(
`
${
material
}
/projecttask/paged`
,
params
);
},
get
(
params
){
return
Api
.
get
(
`
${
material
}
/projecttask/get`
,
params
);
},
create
(
params
){
return
Api
.
post
(
`
${
material
}
/projecttask/create`
,
params
);
},
update
(
params
){
return
Api
.
post
(
`
${
material
}
/projecttask/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
material
}
/projecttask/delete`
,{
params
:{
id
:
id
}});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/batchdelete`
,
params
);
},
//改变状态
updatestatus
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/updatestatus`
,
params
);
}
}
\ No newline at end of file
index
:
`
${
material
}
/projecttask/paged`
,
paged
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/paged`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
material
}
/projecttask/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/create`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/update`
,
params
);
},
delete
(
id
)
{
return
Api
.
delete
(
`
${
material
}
/projecttask/delete`
,
{
params
:
{
id
:
id
}
});
},
deletes
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/batchdelete`
,
params
);
},
//改变状态
updatestatus
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/updatestatus`
,
params
);
},
//修改字段
updatepart
(
params
)
{
return
Api
.
post
(
`
${
material
}
/projecttask/updatepart`
,
params
);
}
}
\ No newline at end of file
pages/project/task/index.vue
View file @
4e006a98
...
...
@@ -227,50 +227,54 @@ export default {
align
:
'center'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'div'
,
{
class
:
"action"
class
:
"action
actionCur
"
},
[
h
(
'op'
,
{
attrs
:
{
icon
:
"ios-play"
,
type
:
"icon"
,
title
:
params
.
row
.
status
==
0
?
"开始"
:
params
.
row
.
status
==
2
?
"继续"
:
'无法操作'
,
color
:
params
.
row
.
status
==
0
||
params
.
row
.
status
==
2
?
"#19be6b"
:
'#ccc'
,
title
:
params
.
row
.
status
==
0
?
"开始"
:
params
.
row
.
status
==
2
?
"继续"
:
''
,
// color: "#19be6b",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
params
.
row
.
status
==
0
||
params
.
row
.
status
==
2
?
this
.
updatestatus
(
params
.
row
.
id
,
1
)
:
null
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
1
)
}
}),
// h('op', {
// attrs: {
// icon: "ios-pause",
// type: "icon",
// title: "暂停",
// //color: "#19be6b",
// //disable: params.row.status == 1 ? false : true
// },
// on: {
// click: () => this.updatepart(params.row.id, 2)
// }
// }),
h
(
'op'
,
{
attrs
:
{
icon
:
"
ios-paus
e"
,
icon
:
"
md-checkbox-outlin
e"
,
type
:
"icon"
,
title
:
params
.
row
.
status
==
1
?
"暂停"
:
"无法操作"
,
color
:
params
.
row
.
status
==
1
?
"#19be6b"
:
"#ccc"
,
title
:
"完成"
,
//color: "#19be6b",
//disable: (params.row.status != 0 && params.row.status != 3) ? false : true
},
on
:
{
click
:
()
=>
params
.
row
.
status
==
1
?
this
.
updatestatus
(
params
.
row
.
id
,
2
)
:
null
}
}),
h
(
'op'
,
{
attrs
:
{
icon
:
"ios-close"
,
type
:
"icon"
,
title
:
params
.
row
.
status
!=
0
?
"完成"
:
"无法操作"
,
color
:
params
.
row
.
status
!=
0
?
"#19be6b"
:
"#ccc"
,
},
on
:
{
click
:
()
=>
params
.
row
.
status
!=
0
?
this
.
updatestatus
(
params
.
row
.
id
,
3
)
:
null
click
:
()
=>
this
.
updatepart
(
params
.
row
.
id
,
3
)
}
}),
h
(
'op'
,
{
attrs
:
{
icon
:
"md-add"
,
type
:
"icon"
,
title
:
params
.
row
.
status
!=
3
?
"新增记录"
:
"无法操作"
,
color
:
params
.
row
.
status
!=
3
?
"#19be6b"
:
"#ccc"
,
title
:
"新增记录"
,
//color: "#19be6b",
// disable: (params.row.status != 3 && params.row.status != 4) ? false : true
},
on
:
{
click
:
()
=>
params
.
row
.
status
!=
0
?
this
.
addRecord
(
params
.
row
.
id
)
:
null
click
:
()
=>
this
.
addRecord
(
params
.
row
.
id
)
}
}),
h
(
'op'
,
{
...
...
@@ -278,7 +282,8 @@ export default {
icon
:
"ios-create-outline"
,
type
:
"icon"
,
title
:
"修改"
,
color
:
"#2b85e4"
,
// color: "#2b85e4",
//disable: (params.row.status == 0 || params.row.status == 2) ? false : true
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
...
...
@@ -289,7 +294,9 @@ export default {
icon
:
"ios-trash-outline"
,
type
:
"icon"
,
title
:
"删除"
,
color
:
"#ed4014"
,
oprate
:
'delete'
,
//color: "#ed4014",
// disable: (params.row.status == 0 || params.row.status == 3) ? false : true
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
...
...
@@ -485,4 +492,19 @@ export default {
}
}
}
.actionCur {
a {
span {
padding: 4px;
}
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