Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-skynet-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-skynet-admin
Commits
8ad0bc8d
Commit
8ad0bc8d
authored
Sep 17, 2021
by
朱松文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建一个baseVue基类,维护公共属性,继承子类可以直接获取,无需每个地方都需要写
parent
ae9040be
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
126 additions
and
106 deletions
+126
-106
index.vue
src/components/Camera/index.vue
+3
-2
index.vue
src/components/DogInfo/index.vue
+102
-74
menu.vue
src/layout/compoments/menu.vue
+3
-6
main.vue
src/layout/main.vue
+3
-6
nav.vue
src/layout/nav.vue
+3
-6
baseVue.ts
src/types/baseVue.ts
+7
-0
index.vue
src/views/dashboard/index.vue
+2
-6
index.vue
src/views/sysSetting/index.vue
+3
-6
No files found.
src/components/Camera/index.vue
View file @
8ad0bc8d
...
@@ -19,12 +19,13 @@
...
@@ -19,12 +19,13 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Prop
}
from
"
vue-property-decorator
"
;
import
{
Component
,
Prop
}
from
"
vue-property-decorator
"
;
import
{
CameraItem
}
from
"
./data
"
;
import
{
CameraItem
}
from
"
./data
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({
components
:
{
Icon
}
})
@
Component
({
components
:
{
Icon
}
})
export
default
class
Camera
extends
Vue
{
export
default
class
Camera
extends
Base
Vue
{
@
Prop
()
private
cameraItem
!
:
CameraItem
;
@
Prop
()
private
cameraItem
!
:
CameraItem
;
showCarmera
=
true
;
showCarmera
=
true
;
...
...
src/components/DogInfo/index.vue
View file @
8ad0bc8d
<
template
>
<
template
>
<div
class=
"dog"
>
<div
:class=
"`$
{prefixCls}-dog`">
<div
class=
"dog-info"
>
<table>
<tbody>
<tr>
<td
class=
"td-img"
rowspan=
"6"
>
<div
class=
"dog-img"
>
<div
class=
"dog-img"
>
<img
:src=
"dog.picture"
alt
/>
<img
:src=
"dog.picture"
alt
/>
</div>
</div>
<div
class=
"dog-data"
>
</td
>
<div
class=
"row"
>
<td
>
<div
class=
"col-left"
>
识别开始时间
</div>
<div
class=
"col-left"
>
识别开始时间
</div>
<div
class=
"col"
>
{{
dog
.
beginTime
}}
</div>
</td>
</div>
<td>
<div
class=
"row"
>
<div>
{{
dog
.
beginTime
}}
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"col-left"
>
识别结束时间
</div>
<div
class=
"col-left"
>
识别结束时间
</div>
<div
class=
"col"
>
{{
dog
.
endTime
}}
</div>
</td>
</div>
<td>
<div
class=
"row"
>
<div>
{{
dog
.
endTime
}}
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"col-left"
>
识别时长
</div>
<div
class=
"col-left"
>
识别时长
</div>
<div
class=
"col"
>
{{
dog
.
totalTime
}}
</div>
</td>
</div>
<td>
<div
class=
"row"
>
<div>
{{
dog
.
totalTime
}}
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"col-left"
>
是否牵狗绳
</div>
<div
class=
"col-left"
>
是否牵狗绳
</div>
<div
class=
"col"
>
{{
dog
.
isHand
?
"
是
"
:
"
否
"
}}
</div>
</td>
</div>
<td>
<div
class=
"row"
>
<div>
{{
dog
.
isHand
?
"
是
"
:
"
否
"
}}
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"col-left"
>
品种
</div>
<div
class=
"col-left"
>
品种
</div>
<div
class=
"col"
>
{{
dog
.
dogType
}}
</div>
</td>
</div>
<td>
<div
class=
"row none-border-bottom"
>
<div>
{{
dog
.
dogType
}}
</div>
</td>
</tr>
<tr>
<td>
<div
class=
"col-left"
>
毛色
</div>
<div
class=
"col-left"
>
毛色
</div>
<div
class=
"col"
>
{{
dog
.
hairColor
}}
</div>
</td>
</div>
<td>
</div>
<div>
{{
dog
.
hairColor
}}
</div>
</div>
</td>
</tr>
<tr>
<td
colspan=
"3"
>
<div
class=
"dog-footer"
>
<div
class=
"dog-footer"
>
<a
v-on:click=
"play"
>
<a
v-on:click=
"play"
>
<Icon
name=
"bofang"
iconClass=
"icon-player"
/>
<Icon
name=
"bofang"
iconClass=
"icon-player"
/>
<span>
播放
</span>
<span>
播放
</span>
</a>
</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
,
Prop
}
from
"
vue-property-decorator
"
;
import
{
Component
,
Prop
}
from
"
vue-property-decorator
"
;
import
{
DogData
}
from
"
./data
"
;
import
{
DogData
}
from
"
./data
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({
components
:
{
Icon
}
})
@
Component
({
components
:
{
Icon
}
})
export
default
class
DogInfo
extends
Vue
{
export
default
class
DogInfo
extends
Base
Vue
{
@
Prop
()
private
dog
:
DogData
;
@
Prop
()
private
dog
:
DogData
;
play
():
void
{
play
():
void
{
...
@@ -56,51 +87,48 @@ export default class DogInfo extends Vue {
...
@@ -56,51 +87,48 @@ export default class DogInfo extends Vue {
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.dog
{
.
#{
$prefixCls
}
-dog
{
border
:
$border-color
;
margin-bottom
:
10px
;
background-color
:
black
;
font-size
:
12px
;
font-size
:
12px
;
font-weight
:
700
;
font-weight
:
700
;
.
none-border-bottom
{
.
td-img
{
border-bottom
:
0
!
important
;
width
:
120px
;
}
}
.dog-info
{
display
:
flex
;
.dog-img
{
.dog-img
{
width
:
100px
;
width
:
100px
;
height
:
100px
;
padding
:
10px
;
padding
:
10px
;
img
{
img
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
}
}
}
}
.dog-data
{
table
{
flex
:
1
;
width
:
100%
;
.row
{
margin-bottom
:
10px
;
display
:
flex
;
border-collapse
:
collapse
;
border-bottom
:
$border-color
;
.col-left
{
width
:
120px
;
text-align
:
center
;
border-right
:
$border-color
;
border-left
:
$border-color
;
height
:
20px
;
line-height
:
20px
;
}
}
.col
{
flex
:
1
;
table
,
padding-left
:
8px
;
th
,
td
{
border
:
$border-color
;
}
}
td
{
div
{
height
:
20px
;
line-height
:
20px
;
text-align
:
left
;
padding-left
:
10px
;
}
}
}
}
.col-left
{
text-align
:
center
;
}
}
.dog-footer
{
.dog-footer
{
height
:
30px
;
height
:
30px
;
line-height
:
30px
;
line-height
:
30px
;
text-align
:
center
;
text-align
:
center
;
color
:
#0079fe
;
color
:
#0079fe
;
border-top
:
$border-color
;
a
{
a
{
cursor
:
pointer
;
cursor
:
pointer
;
text-decoration
:
none
;
text-decoration
:
none
;
...
...
src/layout/compoments/menu.vue
View file @
8ad0bc8d
...
@@ -14,14 +14,15 @@
...
@@ -14,14 +14,15 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
}
from
"
vue-property-decorator
"
;
import
{
Component
}
from
"
vue-property-decorator
"
;
import
{
MenuItem
}
from
"
../data
"
;
import
{
MenuItem
}
from
"
../data
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
Icon
from
"
@/components/Icon/index.vue
"
;
import
{
MENU_CURRENT_PATH_KEY
,
CLICK_HOME_PAGE_EVENT
}
from
"
@/utils/constant
"
;
import
{
MENU_CURRENT_PATH_KEY
,
CLICK_HOME_PAGE_EVENT
}
from
"
@/utils/constant
"
;
import
eventBus
from
"
@/utils/eventBus
"
;
import
eventBus
from
"
@/utils/eventBus
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({
components
:
{
Icon
}
})
@
Component
({
components
:
{
Icon
}
})
export
default
class
Menu
extends
Vue
{
export
default
class
Menu
extends
Base
Vue
{
currentPath
=
"
/
"
;
currentPath
=
"
/
"
;
created
():
void
{
created
():
void
{
...
@@ -35,10 +36,6 @@ export default class Menu extends Vue {
...
@@ -35,10 +36,6 @@ export default class Menu extends Vue {
});
});
}
}
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
get
getMenus
():
MenuItem
[]
{
get
getMenus
():
MenuItem
[]
{
const
{
routes
}
=
this
.
$router
.
options
;
const
{
routes
}
=
this
.
$router
.
options
;
if
(
!
routes
)
return
[];
if
(
!
routes
)
return
[];
...
...
src/layout/main.vue
View file @
8ad0bc8d
...
@@ -5,12 +5,9 @@
...
@@ -5,12 +5,9 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
}
from
"
vue-property-decorator
"
;
import
{
Component
}
from
"
vue-property-decorator
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({})
@
Component
({})
export
default
class
Main
extends
Vue
{
export
default
class
Main
extends
BaseVue
{}
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
}
</
script
>
</
script
>
src/layout/nav.vue
View file @
8ad0bc8d
...
@@ -13,17 +13,14 @@
...
@@ -13,17 +13,14 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
}
from
"
vue-property-decorator
"
;
import
{
Component
}
from
"
vue-property-decorator
"
;
import
Menu
from
"
./compoments/menu.vue
"
;
import
Menu
from
"
./compoments/menu.vue
"
;
import
{
MENU_CURRENT_PATH_KEY
,
CLICK_HOME_PAGE_EVENT
}
from
"
@/utils/constant
"
;
import
{
MENU_CURRENT_PATH_KEY
,
CLICK_HOME_PAGE_EVENT
}
from
"
@/utils/constant
"
;
import
eventBus
from
"
@/utils/eventBus
"
;
import
eventBus
from
"
@/utils/eventBus
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({
components
:
{
Menu
}
})
@
Component
({
components
:
{
Menu
}
})
export
default
class
Nav
extends
Vue
{
export
default
class
Nav
extends
BaseVue
{
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
handleClick
():
void
{
handleClick
():
void
{
sessionStorage
.
setItem
(
MENU_CURRENT_PATH_KEY
,
"
/
"
);
sessionStorage
.
setItem
(
MENU_CURRENT_PATH_KEY
,
"
/
"
);
eventBus
.
$emit
(
CLICK_HOME_PAGE_EVENT
);
eventBus
.
$emit
(
CLICK_HOME_PAGE_EVENT
);
...
...
src/types/baseVue.ts
0 → 100644
View file @
8ad0bc8d
import
{
Vue
}
from
'
vue-property-decorator
'
export
default
class
BaseVue
extends
Vue
{
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
}
\ No newline at end of file
src/views/dashboard/index.vue
View file @
8ad0bc8d
...
@@ -26,14 +26,10 @@ import Camera from "@/components/Camera/index.vue";
...
@@ -26,14 +26,10 @@ import Camera from "@/components/Camera/index.vue";
import
{
DashBoardData
}
from
"
./data
"
;
import
{
DashBoardData
}
from
"
./data
"
;
import
DogInfo
from
"
@/components/DogInfo/index.vue
"
;
import
DogInfo
from
"
@/components/DogInfo/index.vue
"
;
import
Search
from
"
@/components/Camera/search.vue
"
;
import
Search
from
"
@/components/Camera/search.vue
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({
components
:
{
Camera
,
DogInfo
,
Search
}
})
@
Component
({
components
:
{
Camera
,
DogInfo
,
Search
}
})
export
default
class
Dashboard
extends
Vue
{
export
default
class
Dashboard
extends
BaseVue
{
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
//#region data
data
():
DashBoardData
{
data
():
DashBoardData
{
return
{
return
{
cameras
:
[
cameras
:
[
...
...
src/views/sysSetting/index.vue
View file @
8ad0bc8d
...
@@ -41,15 +41,12 @@
...
@@ -41,15 +41,12 @@
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Vue
}
from
"
vue-property-decorator
"
;
import
{
Component
}
from
"
vue-property-decorator
"
;
import
{
getCamera
}
from
"
@/service/CameraService
"
;
import
{
getCamera
}
from
"
@/service/CameraService
"
;
import
BaseVue
from
"
@/types/baseVue
"
;
@
Component
({})
@
Component
({})
export
default
class
SysSetting
extends
Vue
{
export
default
class
SysSetting
extends
BaseVue
{
get
prefixCls
():
string
{
return
process
.
env
.
VUE_APP_PRE_CSS
;
}
cameraData
=
[];
cameraData
=
[];
created
():
void
{
created
():
void
{
...
...
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