Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
33dcd21e
Commit
33dcd21e
authored
Jun 10, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
7ac77e06
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
443 additions
and
123 deletions
+443
-123
index.js
src/api/classroom/index.js
+12
-0
not-use.png
src/assets/images/classroom/not-use.png
+0
-0
useing.png
src/assets/images/classroom/useing.png
+0
-0
Scheduling.vue
src/pages/classroom/Scheduling.vue
+2
-2
classroomNav.vue
src/pages/classroom/components/classroomNav.vue
+38
-50
comSummary.css
src/pages/classroom/components/css/comSummary.css
+4
-3
lunarCalendar.js
src/pages/classroom/components/js/lunarCalendar.js
+19
-1
scenicSummary.vue
src/pages/classroom/components/scenicSummary.vue
+244
-25
useRecord.vue
src/pages/classroom/useRecord.vue
+124
-42
No files found.
src/api/classroom/index.js
View file @
33dcd21e
...
@@ -23,3 +23,15 @@ export function getSchoolAndRoomNav(data) {
...
@@ -23,3 +23,15 @@ export function getSchoolAndRoomNav(data) {
data
data
})
})
}
}
/**
* 获取教室使用记录
* @param {JSON参数} data
*/
export
function
getClassRoomTimeList
(
data
)
{
return
request
({
url
:
'/ClassRoom/GetClassRoomTimeList'
,
method
:
'post'
,
data
})
}
src/assets/images/classroom/not-use.png
0 → 100644
View file @
33dcd21e
595 Bytes
src/assets/images/classroom/useing.png
0 → 100644
View file @
33dcd21e
578 Bytes
src/pages/classroom/Scheduling.vue
View file @
33dcd21e
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<i
class=
"el-icon-picture-outline"
></i>
<i
class=
"el-icon-picture-outline"
></i>
</div>
</div>
</el-image>
</el-image>
<div
class=
"classroom-name"
>
{{
_item
.
RoomName
}}
<div
class=
"classroom-name"
@
click=
"goUrl"
>
{{
_item
.
RoomName
}}
<!--
<img
src=
"../../assets/images/classroom/warning.png"
class=
"q-ml-sm"
v-if=
"_item.warn"
>
<!--
<img
src=
"../../assets/images/classroom/warning.png"
class=
"q-ml-sm"
v-if=
"_item.warn"
>
<img
src=
"../../assets/images/classroom/normal.png"
class=
"q-ml-sm"
v-if=
"!_item.warn"
>
-->
<img
src=
"../../assets/images/classroom/normal.png"
class=
"q-ml-sm"
v-if=
"!_item.warn"
>
-->
</div>
</div>
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
class=
"q-ma-md classroom-user"
class=
"q-ma-md classroom-user"
readonly
readonly
style=
"text-align: center"
style=
"text-align: center"
>
>
{{
_item
.
UserRate
}}
%
{{
_item
.
UserRate
}}
%
<br/>
<br/>
使用率
使用率
...
...
src/pages/classroom/components/classroomNav.vue
View file @
33dcd21e
<
template
>
<
template
>
<div
class=
""
>
<div
class=
""
>
<q-list
style=
"width:180px;overflow:hidden;background-color: rgb(245, 246, 247);"
>
<q-list
style=
"width:180px;overflow:hidden;background-color: rgb(245, 246, 247);"
>
<template
v-for=
"(x,i) in
secondNavs
"
>
<template
v-for=
"(x,i) in
NavData
"
>
<q-item
:to=
"x.MenuUrl"
clickable
v-ripple
:active=
"currentPath==x.MenuUrl"
v-if=
"x.Sub
List.length==0"
<q-item
to=
""
clickable
v-ripple
:active=
"currentNav==x.key"
@
click=
"chooseNav(x)"
v-if=
"x.Room
List.length==0"
:key=
"i"
>
:key=
"i"
>
<
q-item-section
avatar
style=
"min-width:30px;"
>
<
!--
<q-item-section
avatar
style=
"min-width:30px;"
>
--
>
<
q-icon
:name=
"x.MenuIcon"
size=
"20px"
/
>
<
!--
<q-icon
:name=
"x.MenuIcon"
size=
"20px"
/>
--
>
<
/q-item-section
>
<
!--
</q-item-section>
--
>
<q-item-section>
{{
x
.
Menu
Name
}}
</q-item-section>
<q-item-section>
{{
x
.
School
Name
}}
</q-item-section>
</q-item>
</q-item>
<q-expansion-item
v-else
:label=
"x.
MenuName
"
>
<q-expansion-item
v-else
:label=
"x.
SchoolName"
@
show=
"showNav($event,x.Key)
"
>
<q-item
:to=
"y.MenuUrl"
clickable
v-ripple
:active=
"currentPath==y.MenuUrl
"
<q-item
to=
""
clickable
v-ripple
:active=
"currentNav==y.RoomId
"
v-for=
"(y, yi) in x.
SubList"
:key=
"yi
"
>
v-for=
"(y, yi) in x.
RoomList"
:key=
"y.RoomId"
@
click=
"chooseNav(y)
"
>
<
q-item-section
avatar
style=
"padding-right:0;min-width:30px;"
>
<
!--
<q-item-section
avatar
style=
"padding-right:0;min-width:30px;"
>
--
>
<
q-icon
:name=
"y.MenuIcon"
size=
"20px"
/
>
<
!--
<q-icon
:name=
"y.MenuIcon"
size=
"20px"
/>
--
>
<
/q-item-section
>
<
!--
</q-item-section>
--
>
<q-item-section
>
{{
y
.
Menu
Name
}}
</q-item-section>
<q-item-section
style=
"padding-left:20px"
>
{{
y
.
Room
Name
}}
</q-item-section>
</q-item>
</q-item>
</q-expansion-item>
</q-expansion-item>
</
template
>
</
template
>
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
active
}
from
'src/pages/financial/lang/zh'
;
export
default
{
export
default
{
meta
:
{
meta
:
{
title
:
"使用记录"
title
:
"使用记录"
...
@@ -31,52 +32,39 @@
...
@@ -31,52 +32,39 @@
props
:{
props
:{
NavData
:{
NavData
:{
type
:
Array
,
type
:
Array
,
default
:()
=>
{
default
:[]
},
[
activeNav
:{
{
type
:[
Number
,
String
],
MenuName
:
"总部"
,
default
:
0
MenuIcon
:
""
,
}
MenuUrl
:
""
,
},
SubList
:[
watch
:{
{
MenuName
:
"樱花教室"
,
MenuUrl
:
"/"
,
MenuIcon
:
""
},
activeNav
(
val
){
{
MenuName
:
"菊花教室"
,
MenuUrl
:
"/"
,
MenuIcon
:
""
}
if
(
val
!=
this
.
currentNav
){
]
this
.
currentNav
=
val
}
console
.
log
(
45
,
this
.
currentNav
)
]
}
}
}
}
},
},
watch
:
{
$route
:
{
handler
:
function
(
route
)
{
this
.
currentPath
=
route
.
path
},
immediate
:
true
},
},
data
()
{
data
()
{
return
{
return
{
currentPath
:
""
,
currentNav
:
1
,
secondNavs
:[
schoolId
:
0
,
{
MenuName
:
"总部"
,
MenuIcon
:
""
,
SubList
:[
{
MenuName
:
"樱花教室"
,
MenuUrl
:
""
,
MenuIcon
:
""
},
{
MenuName
:
"菊花教室"
,
MenuUrl
:
""
,
MenuIcon
:
""
}
]
}
]
};
};
},
},
mounted
(){
mounted
(){
},
},
methods
:{
methods
:{
showNav
(
val
,
id
){
this
.
schoolId
=
id
},
chooseNav
(
i
){
this
.
currentNav
=
i
.
RoomId
this
.
$emit
(
"success"
,{...
i
,...{
schoolId
:
this
.
schoolId
}})
}
}
}
};
};
...
...
src/pages/classroom/components/css/comSummary.css
View file @
33dcd21e
...
@@ -225,14 +225,15 @@
...
@@ -225,14 +225,15 @@
.comSummary
.mainSummary
{
.comSummary
.mainSummary
{
width
:
100%
;
width
:
100%
;
/* min-height: 500px; */
/* min-height: 500px; */
margin
-top
:
3
0px
;
margin
:
1
0px
;
overflow
:
auto
;
overflow
:
auto
;
}
}
.comSummary
.summaryTable
{
.comSummary
.summaryTable
{
width
:
100%
;
width
:
100%
;
min-width
:
1400px
;
min-width
:
1400px
;
border-radius
:
4px
;
border-radius
:
4px
;
background-color
:
#E6E6E6
;
/* background-color:#E6E6E6; */
background-color
:
#F1F6FB
;
/* table-layout:fixed;word-break:break-all; */
/* table-layout:fixed;word-break:break-all; */
}
}
...
@@ -360,7 +361,7 @@
...
@@ -360,7 +361,7 @@
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.summaryTable
th
:first-child
{
.summaryTable
th
:first-child
{
/* width:180px; */
width
:
50px
;
cursor
:
default
;
cursor
:
default
;
}
}
.dayListTable
td
{
.dayListTable
td
{
...
...
src/pages/classroom/components/js/lunarCalendar.js
View file @
33dcd21e
...
@@ -196,18 +196,36 @@ var lunarCalendar = {
...
@@ -196,18 +196,36 @@ var lunarCalendar = {
* @param m solar month
* @param m solar month
* @return Array
* @return Array
*/
*/
initLunar
:
function
(
yearStr
,
monthStr
,
dayNum
)
{
initLunar
:
function
(
yearStr
,
monthStr
,
dayNum
,
dateStr
)
{
//年份限定、上限
//年份限定、上限
if
(
yearStr
<
1900
||
yearStr
>
2100
)
{
if
(
yearStr
<
1900
||
yearStr
>
2100
)
{
return
-
1
;
return
-
1
;
}
}
var
objDate
=
new
Date
();
var
objDate
=
new
Date
();
var
endDate
=
new
Date
();
var
endDate
=
new
Date
();
if
(
dateStr
)
{
console
.
log
(
dateStr
)
let
d
=
Date
.
parse
(
dateStr
)
let
res
=
new
Date
(
d
);
console
.
log
(
res
,
'res'
);
objDate
=
res
endDate
=
res
}
console
.
log
(
211
,
objDate
.
getTime
(),
objDate
)
endDate
.
setDate
(
endDate
.
getDate
()
+
dayNum
);
endDate
.
setDate
(
endDate
.
getDate
()
+
dayNum
);
console
.
log
(
222
,
endDate
.
getTime
(),
endDate
)
console
.
log
(
endDate
.
getTime
()
-
objDate
.
getTime
(),
'time'
);
//修正ymd参数
//修正ymd参数
var
m
=
objDate
.
getMonth
()
+
1
,
d
=
objDate
.
getDate
();
var
m
=
objDate
.
getMonth
()
+
1
,
d
=
objDate
.
getDate
();
var
totalMonthDay
=
lunarCalendar
.
solarDays
(
yearStr
,
m
);
var
totalMonthDay
=
lunarCalendar
.
solarDays
(
yearStr
,
m
);
var
array
=
[];
var
array
=
[];
while
((
endDate
.
getTime
()
-
objDate
.
getTime
())
>
0
)
{
while
((
endDate
.
getTime
()
-
objDate
.
getTime
())
>
0
)
{
//星期几
//星期几
var
nWeek
=
objDate
.
getDay
(),
cWeek
=
lunarCalendar
.
weekStr
[
nWeek
];
var
nWeek
=
objDate
.
getDay
(),
cWeek
=
lunarCalendar
.
weekStr
[
nWeek
];
...
...
src/pages/classroom/components/scenicSummary.vue
View file @
33dcd21e
This diff is collapsed.
Click to expand it.
src/pages/classroom/useRecord.vue
View file @
33dcd21e
<
template
>
<
template
>
<div
class=
"page-body con"
>
<div
class=
"page-body con"
>
<div
class=
"left"
>
<div
class=
"left"
>
<div
class=
"dateModel col-5 q-mb-sm cursor-pointer shadow-1"
>
<ClassroomNav/>
<div
class=
"q-mb-sm"
>
开始日期:
{{
dateModel
}}
</div>
<q-btn
label=
"重新选择"
color=
"primary"
size=
"sm"
>
<q-popup-proxy
transition-show=
"scale"
transition-hide=
"scale"
>
<q-date
now-btn
v-model=
"dateModel"
mask=
"YYYY-MM-DD"
@
input=
"dateChoose"
>
<div
class=
"row items-center justify-end"
>
<q-btn
v-close-popup
label=
"关闭"
color=
"primary q-px-md"
flat
/>
</div>
</q-date>
</q-popup-proxy>
</q-btn>
</div>
<ClassroomNav
:NavData=
"navData"
:activeNav=
"msg.RoomId"
@
success=
"successNav"
/>
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<!--
<el-timeline
:reverse=
"reverse"
>
<Calendar
:tbodayData=
"tbodayData"
:startT=
"dateModel"
@
change=
"CalendarChange"
></Calendar>
<el-timeline-item
v-for=
"(activity, index) in activities"
:key=
"index"
:timestamp=
"activity.timestamp"
>
</el-timeline-item>
</el-timeline>
-->
<Calendar></Calendar>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -22,60 +25,131 @@
...
@@ -22,60 +25,131 @@
import
ClassroomNav
from
"./components/classroomNav"
;
import
ClassroomNav
from
"./components/classroomNav"
;
import
Calendar
from
'./components/scenicSummary.vue'
import
Calendar
from
'./components/scenicSummary.vue'
import
{
import
{
getSchoolAndRoomNav
getSchoolAndRoomNav
,
getClassRoomTimeList
}
from
'../../api/classroom/index'
;
}
from
'../../api/classroom/index'
;
export
default
{
export
default
{
meta
:
{
meta
:
{
title
:
"
使用记录
"
title
:
"
教室状态
"
},
},
components
:{
components
:{
ClassroomNav
,
ClassroomNav
,
Calendar
,
Calendar
,
},
},
data
()
{
data
()
{
return
{
return
{
dateModel
:
""
,
loading
:
true
,
loading
:
true
,
msg
:
{
schoolId
:
0
,
pageIndex
:
1
,
pageSize
:
12
,
},
navData
:[],
navData
:[],
reverse
:
true
,
activities
:
[{
msg
:{
timestamp
:
'09:30'
RoomId
:
0
,
},
{
SchoolId
:
0
,
StartTime
:
"2020-07-08"
,
timestamp
:
'09:45'
EndTime
:
""
},
{
},
tbodayData
:[]
timestamp
:
'10:00'
}]
};
};
},
},
created
(){
let
d
=
new
Date
();
let
year
=
d
.
getFullYear
();
let
month
=
d
.
getMonth
()
+
1
;
month
=
month
<
10
?
'0'
+
month
:
month
;
let
day
=
d
.
getDate
();
day
=
day
<
10
?
'0'
+
day
:
day
;
let
today
=
year
+
'-'
+
month
+
'-'
+
day
;
this
.
msg
.
StartTime
=
today
;
this
.
dateModel
=
today
;
let
endDate
=
new
Date
(
d
.
getTime
()
+
6
*
24
*
60
*
60
*
1000
);
let
endYear
=
endDate
.
getFullYear
();
let
enDMonth
=
endDate
.
getMonth
()
+
1
if
(
enDMonth
<
10
)
{
enDMonth
=
'0'
+
enDMonth
}
let
endDay
=
endDate
.
getDate
()
if
(
endDay
<
10
)
{
endDay
=
'0'
+
endDay
}
let
end
=
endYear
+
'-'
+
enDMonth
+
'-'
+
endDay
this
.
msg
.
EndTime
=
end
;
},
mounted
(){
mounted
(){
this
.
getNavList
();
this
.
getNavList
();
// this.getClassRoomTimeList();
},
},
methods
:{
methods
:{
// goUrl(){
// 获取校区教室导航列表
// this.$router.push({
getNavList
()
{
// path:"/classroom/useRecord",
let
that
=
this
// query:{
// }
// })
// },
getNavList
()
{
getSchoolAndRoomNav
({}).
then
(
res
=>
{
getSchoolAndRoomNav
({}).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
.
Code
===
1
){
if
(
res
.
Code
===
1
){
this
.
navData
=
res
.
Data
this
.
navData
=
res
.
Data
this
.
msg
.
SchoolId
=
res
.
Data
[
0
].
Key
this
.
msg
.
RoomId
=
res
.
Data
[
0
].
RoomList
[
0
].
RoomId
that
.
getClassRoomTimeList
()
}
}).
catch
(()
=>
{
})
},
//获取教室使用记录
getClassRoomTimeList
()
{
getClassRoomTimeList
(
this
.
msg
).
then
(
res
=>
{
this
.
loading
=
false
if
(
res
.
Code
===
1
){
this
.
tbodayData
=
res
.
Data
}
}
}).
catch
(()
=>
{
}).
catch
(()
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
})
})
},
},
//选择校区教室导航
successNav
(
val
){
this
.
msg
.
RoomId
=
val
.
RoomId
this
.
msg
.
SchoolId
=
val
.
SchoolId
this
.
getClassRoomTimeList
();
this
.
$forceUpdate
()
},
dateChoose
(
value
,
reason
,
details
){
console
.
log
(
112
,
this
.
dateModel
)
},
//获取结束日期
getEndTime
(
date
){
let
d
=
Date
.
parse
(
date
)
let
endDate
=
new
Date
(
d
+
6
*
24
*
60
*
60
*
1000
);
let
endYear
=
endDate
.
getFullYear
();
let
enDMonth
=
endDate
.
getMonth
()
+
1
if
(
enDMonth
<
10
)
{
enDMonth
=
'0'
+
enDMonth
}
let
endDay
=
endDate
.
getDate
()
if
(
endDay
<
10
)
{
endDay
=
'0'
+
endDay
}
let
end
=
endYear
+
'-'
+
enDMonth
+
'-'
+
endDay
this
.
msg
.
EndTime
=
end
;
},
//切换日历
CalendarChange
(
val
){
let
arr
=
val
.
split
(
'-'
);
if
(
arr
[
1
].
length
==
1
){
let
month
=
parseInt
(
arr
[
1
])
if
(
month
<
10
){
arr
[
1
]
=
'0'
+
arr
[
1
]
}
}
let
newVal
=
arr
.
join
(
"-"
)
this
.
dateModel
=
newVal
this
.
msg
.
StartTime
=
newVal
this
.
getEndTime
(
newVal
)
this
.
getClassRoomTimeList
();
this
.
$forceUpdate
()
}
}
}
};
};
...
@@ -85,8 +159,16 @@
...
@@ -85,8 +159,16 @@
padding
:
5px
!
important
;
padding
:
5px
!
important
;
display
:
flex
;
display
:
flex
;
.left
{
.left
{
width
:
200px
;
background-color
:
rgb
(
245
,
246
,
247
);
background-color
:
rgb
(
245
,
246
,
247
);
}
}
}
}
.dateModel
{
// height: 50px;
padding
:
20px
10px
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
center
;
align-content
:
space-around
;
}
</
style
>
</
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