Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcdj-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6fd2bd04
authored
2023-06-13 09:00:34 +0800
by
xiaomiao
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev' of
http://yun.pashanhoo.com:9090/bdc/bdcdj-web
into dev
2 parents
78f983c8
1f60e8e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
45 deletions
src/components/PhotoZoom/index.vue
src/permission.js
src/utils/request.js
src/views/components/imagePreview.vue
src/components/PhotoZoom/index.vue
View file @
6fd2bd0
...
...
@@ -7,36 +7,36 @@
</
template
>
<
script
>
import
vuePhotoZoomPro
from
'@/components/PhotoZoom/vue-photo-zoom-pro'
export
default
{
name
:
'PicZoom'
,
components
:
{
vuePhotoZoomPro
},
data
()
{
return
{
type
:
"square"
,
showType
:
false
,
}
},
props
:
{
url
:
{
type
:
String
,
required
:
true
,
// default: require('@/assets/vehicle_img/blank_vehicle.jpg')
import
vuePhotoZoomPro
from
'@/components/PhotoZoom/vue-photo-zoom-pro'
export
default
{
name
:
'PicZoom'
,
components
:
{
vuePhotoZoomPro
},
data
()
{
return
{
type
:
"square"
,
showType
:
false
,
}
},
bigWidth
:
{
type
:
Number
,
required
:
true
,
default
:
168
props
:
{
url
:
{
type
:
String
,
required
:
true
,
// default: require('@/assets/vehicle_img/blank_vehicle.jpg')
},
bigWidth
:
{
type
:
Number
,
required
:
true
,
default
:
168
},
scale
:
{
type
:
Number
,
required
:
true
,
default
:
2
},
overlayStyle
:
{
type
:
String
,
default
:
'width:100%;height:100%'
}
},
scale
:
{
type
:
Number
,
required
:
true
,
default
:
2
},
overlayStyle
:
{
type
:
String
,
default
:
'width:100%;height:100%'
}
},
}
}
</
script
>
\ No newline at end of file
...
...
src/permission.js
View file @
6fd2bd0
/*
* @Description: 项目权限
* @Autor: renchao
* @LastEditTime: 2023-06-
02 10:44:17
* @LastEditTime: 2023-06-
12 17:22:02
*/
import
Vue
from
'vue'
import
axios
from
'axios'
import
router
from
'./router'
import
store
from
'./store'
import
Cookies
from
'js-cookie'
import
{
getMenuInfo
}
from
'@/api/user'
import
{
getUrlParam
}
from
'@/utils/operation'
import
{
getMenuInfo
}
from
'@/api/user'
import
{
getUrlParam
}
from
'@/utils/operation'
import
NProgress
from
'nprogress'
// progress bar
import
'nprogress/nprogress.css'
// progress bar style
import
getPageTitle
from
'@/utils/get-page-title'
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
Vue
.
prototype
.
$currentRoute
=
to
...
...
@@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => {
let
hasAddDict
=
store
.
state
.
dict
.
addDict
let
hasAddRoute
=
store
.
state
.
permission
.
addRoutes
// cas操作
const
token
=
localStorage
.
getItem
(
"token"
)
||
Cookies
.
get
(
'
ACCESS_TOKEN
'
);
const
token
=
localStorage
.
getItem
(
"token"
)
||
Cookies
.
get
(
'
token
'
);
if
(
to
.
path
===
'/login'
)
{
if
(
token
)
{
next
(
'/'
)
...
...
@@ -46,7 +46,7 @@ router.beforeEach(async (to, from, next) => {
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
localStorage
.
setItem
(
'token'
,
res
.
data
.
content
.
accessToken
)
}
else
{
Cookies
.
set
(
'
ACCESS_TOKEN
'
,
res
.
data
.
content
.
accessToken
)
Cookies
.
set
(
'
token
'
,
res
.
data
.
content
.
accessToken
)
}
window
.
location
.
href
=
localStorage
.
getItem
(
'location'
)
...
...
@@ -61,7 +61,7 @@ router.beforeEach(async (to, from, next) => {
permission
()
}
async
function
permission
()
{
async
function
permission
()
{
if
(
!
hasAddDict
)
{
store
.
dispatch
(
'dict/generateDic'
)
}
...
...
@@ -69,14 +69,14 @@ router.beforeEach(async (to, from, next) => {
next
()
// next({ ...to, replace: true })
}
else
{
const
{
result
:
getMenuData
}
=
await
getMenuInfo
()
const
{
result
:
getMenuData
}
=
await
getMenuInfo
()
const
accessRoutes
=
await
store
.
dispatch
(
'permission/generateRoutes'
,
getMenuData
)
// 获取用户信息
await
store
.
dispatch
(
'user/getUserInfo'
)
router
.
addRoutes
([...
accessRoutes
,
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}])
router
.
addRoutes
([...
accessRoutes
,
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}])
const
routeTo
=
Cookies
.
get
(
'routerTo'
)
if
(
routeTo
&&
routeTo
!==
'/'
)
{
next
({
...
to
,
replace
:
true
})
next
({
...
to
,
replace
:
true
})
}
else
{
next
(
'/home'
)
}
...
...
src/utils/request.js
View file @
6fd2bd0
...
...
@@ -2,7 +2,7 @@
/*
* @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器
* @Autor: renchao
* @LastEditTime: 2023-06-
02 10:18:32
* @LastEditTime: 2023-06-
12 17:22:35
*/
import
axios
from
'axios'
import
Router
from
'@/router'
...
...
@@ -70,7 +70,7 @@ service.interceptors.response.use(
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
localStorage
.
removeItem
(
'token'
)
}
else
{
Cookies
.
remove
(
'
ACCESS_TOKEN
'
)
Cookies
.
remove
(
'
token
'
)
}
if
(
window
.
_config
.
casEnable
)
{
window
.
location
.
href
=
window
.
_config
.
casBaseURL
+
'/logout?service='
+
encodeURIComponent
(
locationUrl
);
...
...
src/views/components/imagePreview.vue
View file @
6fd2bd0
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-12 15:18:07
-->
<
template
>
<div
class=
"rlPopup"
>
<div
class=
"prev handle-btn"
@
click=
"prev()"
>
<div
class=
"prev handle-btn"
v-if=
"!isScan"
@
click=
"prev()"
>
<i
class=
"el-icon-arrow-left"
></i>
</div>
<div
class=
"next handle-btn"
@
click=
"next()"
>
<div
class=
"next handle-btn"
v-if=
"!isScan"
@
click=
"next()"
>
<i
class=
"el-icon-arrow-right"
></i>
</div>
<div
class=
"img-list-wrap"
>
<div
v-for=
"(img, i) in previewImg.imgList"
:key=
"i"
>
<img
src=
"http://127.0.0.1:38088/video=stream&camidx=0"
v-if=
"isScan"
alt=
"高拍仪"
>
<div
v-for=
"(img, i) in previewImg.imgList"
:key=
"i"
v-else
>
<photo-zoom
:url=
"img.fjurl"
:bigWidth=
"165"
v-if=
"i === previewImg.index"
:scale=
"2"
overlayStyle=
"width: 100%;height:100%"
>
</photo-zoom>
...
...
@@ -24,6 +30,8 @@
</el-upload>
<el-button
type=
"primary"
icon=
"el-icon-delete-solid"
@
click=
"handleDelete"
v-if=
"!this.$route.query.viewtype && thumbnailImages.length>0"
>
删除
</el-button>
<el-button
type=
"primary"
@
click=
"handleOpenScan"
>
{{
scanTitle
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handleViewScan"
v-if=
"isScan"
>
拍照
</el-button>
</div>
<ul>
<li
v-for=
"(img, index) in thumbnailImages"
:key=
"index"
:class=
"
{ active: previewImg.index === index }"
...
...
@@ -38,6 +46,7 @@
</div>
</
template
>
<
script
>
import
axios
from
'axios'
import
PhotoZoom
from
'@/components/PhotoZoom'
import
{
uploadSjClmx
,
deleteClmx
}
from
"@/api/clxx.js"
;
import
publicPicture
from
'@/components/publicPicture/index.vue'
...
...
@@ -55,6 +64,9 @@
},
data
()
{
return
{
isScan
:
false
,
// 打开高拍仪
scanTitle
:
'打开高拍仪'
,
transform
:
{
scale
:
1
,
degree
:
0
...
...
@@ -92,6 +104,31 @@
}
},
methods
:
{
/**
* @description: 打开高拍仪
* @author: renchao
*/
handleOpenScan
()
{
this
.
isScan
=
true
this
.
scanTitle
=
'关闭高拍仪'
},
/**
* @description: 拍照
* @author: renchao
*/
handleViewScan
()
{
let
data
=
{
"filepath"
:
"base64"
,
"rotate"
:
"0"
,
"cutpage"
:
"0"
,
"camidx"
:
"0"
,
"ColorMode"
:
"0"
,
"quality"
:
"3"
}
axios
.
post
(
"http://127.0.0.1:38088/video=grabimage"
,
JSON
.
stringify
(
data
)).
then
((
res
)
=>
{
console
.
log
(
res
.
data
);
})
},
prev
()
{
let
len
=
this
.
previewImg
.
imgList
.
length
if
(
this
.
isFirst
||
len
==
0
)
{
...
...
Please
register
or
sign in
to post a comment