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
19bafb12
Commit
19bafb12
authored
Apr 29, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工时组件开发。
parent
570ca4ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
0 deletions
+128
-0
inputTime.vue
components/page/inputTime.vue
+88
-0
time.vue
pages/test/time.vue
+38
-0
iview.js
plugins/iview.js
+2
-0
No files found.
components/page/inputTime.vue
0 → 100644
View file @
19bafb12
<
style
lang=
"less"
>
.timer {
.ivu-input-number {
width: 60px;
}
> span {
line-height: 30px;
}
}
</
style
>
<
template
>
<div
class=
"flex timer"
>
<div
class=
"fg1"
>
<InputNumber
v-model=
"hour"
:formatter=
"value => `$
{value}`" :min="0" :max="100" />
</div>
<span>
小时
</span>
<div
class=
"fg1"
>
<InputNumber
v-model=
"minute"
:formatter=
"value => `$
{value}`" :min="-1" :max="60" />
</div>
<span>
分钟
</span>
<div
class=
"fg1"
>
<InputNumber
v-model=
"second"
:formatter=
"value => `$
{value}`" :min="0" :max="60" />
</div>
<span>
秒
</span>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
hour
:
0
,
minute
:
0
,
second
:
0
};
},
model
:
{
prop
:
"value"
,
event
:
"on-change"
,
},
props
:
{
value
:
[
Number
],
},
mounted
(){
this
.
setTime
(
this
.
value
)
},
methods
:
{
setTime
(
v
)
{
let
h
=
parseInt
(
v
/
(
60
*
60
));
this
.
hour
=
h
;
this
.
minute
=
parseInt
((
v
-
h
*
60
*
60
)
/
60
);
this
.
second
=
parseInt
(
v
-
h
*
60
*
60
-
this
.
minute
*
60
);
},
change
(){
let
result
=
0
result
+=
this
.
hour
*
60
*
60
;
result
+=
this
.
minute
*
60
;
result
+=
this
.
second
;
this
.
$emit
(
"on-change"
,
result
);
}
},
watch
:
{
value
(
v
){
this
.
setTime
(
v
);
},
second
(
v
){
if
(
v
>=
60
){
this
.
second
=
0
this
.
minute
+=
1
;
}
this
.
change
();
},
minute
(
v
){
if
(
v
>=
60
){
this
.
minute
=
0
;
this
.
hour
+=
1
;
}
else
if
(
v
<
0
){
this
.
hour
-=
1
;
this
.
minute
=
59
;
}
this
.
change
();
},
hour
(
v
){
this
.
change
();
}
}
};
</
script
>
\ No newline at end of file
pages/test/time.vue
0 → 100644
View file @
19bafb12
<
template
>
<div>
<div
v-width=
"400"
>
<InputTime
v-model=
"time"
></InputTime>
</div>
{{
time
}}
</div>
</
template
>
<
script
>
export
default
{
layout
:
'empty'
,
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
'loadDictionary'
)
// 加载数据字典
},
data
()
{
return
{
time
:
39470
,
}
},
created
()
{
// this.setList();
// alert(1234321)
// var arrs = []
// for (let i = 0; i
<
5
;
i
++
)
{
// arrs.push(i)
// }
// this.list = arrs
},
mounted
()
{
},
methods
:
{
},
}
</
script
>
\ No newline at end of file
plugins/iview.js
View file @
19bafb12
...
...
@@ -44,6 +44,7 @@ import ProductNumberSelect from '@/components/page/productNumberSelect.vue'
import
ProductSelect
from
'@/components/page/productSelect.vue'
import
DTSpan
from
'@/components/page/dtSpan.vue'
import
DTSearch
from
'@/components/page/dtSearch.vue'
import
InputTime
from
'@/components/page/inputTime.vue'
// import FormMaking from 'form-making'
// import 'form-making/dist/FormMaking.css'
...
...
@@ -94,6 +95,7 @@ Vue.component("ProductNumberSelect", ProductNumberSelect)
Vue
.
component
(
"ProductSelect"
,
ProductSelect
)
Vue
.
component
(
"DTSpan"
,
DTSpan
)
Vue
.
component
(
"DTSearch"
,
DTSearch
)
Vue
.
component
(
"InputTime"
,
InputTime
)
//注入mock
// require("../mock")
...
...
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