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
6e38d436
Commit
6e38d436
authored
Oct 23, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装时间差页面
parent
30fd49e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
1 deletion
+93
-1
timeDifference.vue
components/page/timeDifference.vue
+76
-0
add.vue
pages/project/project/add.vue
+15
-0
iview.js
plugins/iview.js
+2
-1
No files found.
components/page/timeDifference.vue
0 → 100644
View file @
6e38d436
<
template
>
<div
class=
"time-view"
>
{{
date
}}
</div>
</
template
>
<
script
>
export
default
{
name
:
""
,
data
()
{
return
{};
},
props
:
{
timeValue
:
{
type
:
[
String
,
Object
],
default
:
""
,
},
// mode: {
// type: [String, Object],
// default: "",
// },
},
computed
:
{
date
()
{
var
date1
=
new
Date
(
this
.
timeValue
.
startDate
).
getTime
();
//开始时间,时间戳
var
date2
=
new
Date
(
this
.
timeValue
.
endDate
).
getTime
();
//结束时间,时间戳
var
date3
=
0
;
date3
=
date2
-
date1
;
var
timeSpanStr
;
if
(
date3
<=
1000
*
60
*
1
)
{
timeSpanStr
=
"刚刚"
;
}
else
if
(
1000
*
60
*
1
<
date3
&&
date3
<=
1000
*
60
*
60
)
{
timeSpanStr
=
Math
.
round
(
date3
/
(
1000
*
60
))
+
"分钟"
;
}
else
if
(
1000
*
60
*
60
*
1
<
date3
&&
date3
<=
1000
*
60
*
60
*
24
)
{
timeSpanStr
=
Math
.
round
(
date3
/
(
1000
*
60
*
60
))
+
"小时"
;
}
else
if
(
1000
*
60
*
60
*
24
<
date3
// && date3
<=
1000
*
60
*
60
*
24
*
30
)
{
timeSpanStr
=
Math
.
round
(
date3
/
(
1000
*
60
*
60
*
24
))
+
"天"
;
}
return
timeSpanStr
;
// var result = "";
// var minute = 1000 * 60;
// var hour = minute * 60;
// var day = hour * 24;
// var month = day * 30;
// if (date3
<
0
)
return
;
// var monthC = date3 / month;
// var weekC = date3 / (7 * day);
// var dayC = date3 / day;
// var hourC = date3 / hour;
// var minC = date3 / minute;
// if (monthC >= 1) {
// result = "" + parseInt(monthC) + "月";
// } else if (weekC >= 1) {
// result = "" + parseInt(weekC) + "周";
// } else if (dayC >= 1) {
// result = "" + parseInt(dayC) + "天";
// } else if (hourC >= 1) {
// result = "" + parseInt(hourC) + "小时";
// } else if (minC >= 1) {
// result = "" + parseInt(minC) + "分钟";
// } else {
// result = "刚刚";
// }
// return result;
},
},
mounted
()
{},
methods
:
{},
watch
:
{},
};
</
script
>
<
style
lang=
"less"
>
</
style
>
pages/project/project/add.vue
View file @
6e38d436
...
...
@@ -89,6 +89,7 @@
v-model=
"entity.endDate"
></DatePicker>
</FormItem
></Col>
<!--
<TimeDifference
:timeValue=
"timeValue"
></TimeDifference>
-->
<Col
:span=
"12"
><FormItem
:label=
"l('type')"
prop=
"type"
>
<Dictionary
...
...
@@ -137,6 +138,10 @@ export default {
name
:
"Add"
,
data
()
{
return
{
timeValue
:
{
startDate
:
""
,
endDate
:
""
,
},
imgName
:
""
,
avatorPath
:
""
,
entity
:
{
...
...
@@ -240,6 +245,16 @@ export default {
this
.
entity
.
picture
=
imgPathsArr
[
0
].
filePath
;
this
.
avatorPath
=
fileUrlDown
+
imgPathsArr
[
0
].
filePath
;
},
// "entity.startDate"(v) {
// if (v) {
// this.timeValue.startDate = v;
// }
// },
// "entity.endDate"(v) {
// if (v) {
// this.timeValue.endDate = v;
// }
// },
},
};
</
script
>
...
...
plugins/iview.js
View file @
6e38d436
...
...
@@ -72,6 +72,7 @@ import InputCode from '@/components/page/inputCode.vue'
import
Pictrue
from
'@/components/page/pictrue.vue'
import
WordTree
from
'@/components/page/wordTree.vue'
import
Actions
from
'@/components/page/actions.vue'
import
TimeDifference
from
'@/components/page/timeDifference.vue'
...
...
@@ -149,7 +150,7 @@ Vue.component("InputCode",InputCode)
Vue
.
component
(
"Pictrue"
,
Pictrue
)
Vue
.
component
(
"WordTree"
,
WordTree
)
Vue
.
component
(
"Actions"
,
Actions
)
Vue
.
component
(
"TimeDifference"
,
TimeDifference
)
...
...
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