Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev
Showing
4 changed files
with
82 additions
and
45 deletions
... | @@ -7,36 +7,36 @@ | ... | @@ -7,36 +7,36 @@ |
7 | </template> | 7 | </template> |
8 | 8 | ||
9 | <script> | 9 | <script> |
10 | import vuePhotoZoomPro from '@/components/PhotoZoom/vue-photo-zoom-pro' | 10 | import vuePhotoZoomPro from '@/components/PhotoZoom/vue-photo-zoom-pro' |
11 | export default { | 11 | export default { |
12 | name: 'PicZoom', | 12 | name: 'PicZoom', |
13 | components: { vuePhotoZoomPro }, | 13 | components: { vuePhotoZoomPro }, |
14 | data () { | 14 | data () { |
15 | return { | 15 | return { |
16 | type: "square", | 16 | type: "square", |
17 | showType: false, | 17 | showType: false, |
18 | } | 18 | } |
19 | }, | ||
20 | props: { | ||
21 | url: { | ||
22 | type: String, | ||
23 | required: true, | ||
24 | // default: require('@/assets/vehicle_img/blank_vehicle.jpg') | ||
25 | }, | 19 | }, |
26 | bigWidth: { | 20 | props: { |
27 | type: Number, | 21 | url: { |
28 | required: true, | 22 | type: String, |
29 | default: 168 | 23 | required: true, |
24 | // default: require('@/assets/vehicle_img/blank_vehicle.jpg') | ||
25 | }, | ||
26 | bigWidth: { | ||
27 | type: Number, | ||
28 | required: true, | ||
29 | default: 168 | ||
30 | }, | ||
31 | scale: { | ||
32 | type: Number, | ||
33 | required: true, | ||
34 | default: 2 | ||
35 | }, | ||
36 | overlayStyle: { | ||
37 | type: String, | ||
38 | default: 'width:100%;height:100%' | ||
39 | } | ||
30 | }, | 40 | }, |
31 | scale: { | 41 | } |
32 | type: Number, | ||
33 | required: true, | ||
34 | default: 2 | ||
35 | }, | ||
36 | overlayStyle: { | ||
37 | type: String, | ||
38 | default: 'width:100%;height:100%' | ||
39 | } | ||
40 | }, | ||
41 | } | ||
42 | </script> | 42 | </script> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | /* | 1 | /* |
2 | * @Description: 项目权限 | 2 | * @Description: 项目权限 |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-06-02 10:44:17 | 4 | * @LastEditTime: 2023-06-12 17:22:02 |
5 | */ | 5 | */ |
6 | import Vue from 'vue' | 6 | import Vue from 'vue' |
7 | import axios from 'axios' | 7 | import axios from 'axios' |
8 | import router from './router' | 8 | import router from './router' |
9 | import store from './store' | 9 | import store from './store' |
10 | import Cookies from 'js-cookie' | 10 | import Cookies from 'js-cookie' |
11 | import {getMenuInfo} from '@/api/user' | 11 | import { getMenuInfo } from '@/api/user' |
12 | import {getUrlParam} from '@/utils/operation' | 12 | import { getUrlParam } from '@/utils/operation' |
13 | import NProgress from 'nprogress' // progress bar | 13 | import NProgress from 'nprogress' // progress bar |
14 | import 'nprogress/nprogress.css' // progress bar style | 14 | import 'nprogress/nprogress.css' // progress bar style |
15 | import getPageTitle from '@/utils/get-page-title' | 15 | import getPageTitle from '@/utils/get-page-title' |
16 | 16 | ||
17 | NProgress.configure({showSpinner: false}) // NProgress Configuration | 17 | NProgress.configure({ showSpinner: false }) // NProgress Configuration |
18 | 18 | ||
19 | router.beforeEach(async (to, from, next) => { | 19 | router.beforeEach(async (to, from, next) => { |
20 | Vue.prototype.$currentRoute = to | 20 | Vue.prototype.$currentRoute = to |
... | @@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -23,7 +23,7 @@ router.beforeEach(async (to, from, next) => { |
23 | let hasAddDict = store.state.dict.addDict | 23 | let hasAddDict = store.state.dict.addDict |
24 | let hasAddRoute = store.state.permission.addRoutes | 24 | let hasAddRoute = store.state.permission.addRoutes |
25 | // cas操作 | 25 | // cas操作 |
26 | const token = localStorage.getItem("token") || Cookies.get('ACCESS_TOKEN'); | 26 | const token = localStorage.getItem("token") || Cookies.get('token'); |
27 | if (to.path === '/login') { | 27 | if (to.path === '/login') { |
28 | if (token) { | 28 | if (token) { |
29 | next('/') | 29 | next('/') |
... | @@ -46,7 +46,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -46,7 +46,7 @@ router.beforeEach(async (to, from, next) => { |
46 | if (process.env.NODE_ENV === 'development') { | 46 | if (process.env.NODE_ENV === 'development') { |
47 | localStorage.setItem('token', res.data.content.accessToken) | 47 | localStorage.setItem('token', res.data.content.accessToken) |
48 | } else { | 48 | } else { |
49 | Cookies.set('ACCESS_TOKEN', res.data.content.accessToken) | 49 | Cookies.set('token', res.data.content.accessToken) |
50 | } | 50 | } |
51 | window.location.href = localStorage.getItem('location') | 51 | window.location.href = localStorage.getItem('location') |
52 | 52 | ||
... | @@ -61,7 +61,7 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -61,7 +61,7 @@ router.beforeEach(async (to, from, next) => { |
61 | permission() | 61 | permission() |
62 | } | 62 | } |
63 | 63 | ||
64 | async function permission() { | 64 | async function permission () { |
65 | if (!hasAddDict) { | 65 | if (!hasAddDict) { |
66 | store.dispatch('dict/generateDic') | 66 | store.dispatch('dict/generateDic') |
67 | } | 67 | } |
... | @@ -69,14 +69,14 @@ router.beforeEach(async (to, from, next) => { | ... | @@ -69,14 +69,14 @@ router.beforeEach(async (to, from, next) => { |
69 | next() | 69 | next() |
70 | // next({ ...to, replace: true }) | 70 | // next({ ...to, replace: true }) |
71 | } else { | 71 | } else { |
72 | const {result: getMenuData} = await getMenuInfo() | 72 | const { result: getMenuData } = await getMenuInfo() |
73 | const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData) | 73 | const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData) |
74 | // 获取用户信息 | 74 | // 获取用户信息 |
75 | await store.dispatch('user/getUserInfo') | 75 | await store.dispatch('user/getUserInfo') |
76 | router.addRoutes([...accessRoutes, {path: '*', redirect: '/404', hidden: true}]) | 76 | router.addRoutes([...accessRoutes, { path: '*', redirect: '/404', hidden: true }]) |
77 | const routeTo = Cookies.get('routerTo') | 77 | const routeTo = Cookies.get('routerTo') |
78 | if (routeTo && routeTo !== '/') { | 78 | if (routeTo && routeTo !== '/') { |
79 | next({...to, replace: true}) | 79 | next({ ...to, replace: true }) |
80 | } else { | 80 | } else { |
81 | next('/home') | 81 | next('/home') |
82 | } | 82 | } | ... | ... |
... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
2 | /* | 2 | /* |
3 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 | 3 | * @Description: 此文件主要创建 axios 实例,然后添加请求拦截器和响应拦截器 |
4 | * @Autor: renchao | 4 | * @Autor: renchao |
5 | * @LastEditTime: 2023-06-02 10:18:32 | 5 | * @LastEditTime: 2023-06-12 17:22:35 |
6 | */ | 6 | */ |
7 | import axios from 'axios' | 7 | import axios from 'axios' |
8 | import Router from '@/router' | 8 | import Router from '@/router' |
... | @@ -70,7 +70,7 @@ service.interceptors.response.use( | ... | @@ -70,7 +70,7 @@ service.interceptors.response.use( |
70 | if (process.env.NODE_ENV === 'development') { | 70 | if (process.env.NODE_ENV === 'development') { |
71 | localStorage.removeItem('token') | 71 | localStorage.removeItem('token') |
72 | } else { | 72 | } else { |
73 | Cookies.remove('ACCESS_TOKEN') | 73 | Cookies.remove('token') |
74 | } | 74 | } |
75 | if (window._config.casEnable) { | 75 | if (window._config.casEnable) { |
76 | window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl); | 76 | window.location.href = window._config.casBaseURL + '/logout?service=' + encodeURIComponent(locationUrl); | ... | ... |
1 | <!-- | ||
2 | * @Description: | ||
3 | * @Autor: renchao | ||
4 | * @LastEditTime: 2023-06-12 15:18:07 | ||
5 | --> | ||
1 | <template> | 6 | <template> |
2 | <div class="rlPopup"> | 7 | <div class="rlPopup"> |
3 | <div class="prev handle-btn" @click="prev()"> | 8 | <div class="prev handle-btn" v-if="!isScan" @click="prev()"> |
4 | <i class="el-icon-arrow-left"></i> | 9 | <i class="el-icon-arrow-left"></i> |
5 | </div> | 10 | </div> |
6 | <div class="next handle-btn" @click="next()"> | 11 | <div class="next handle-btn" v-if="!isScan" @click="next()"> |
7 | <i class="el-icon-arrow-right"></i> | 12 | <i class="el-icon-arrow-right"></i> |
8 | </div> | 13 | </div> |
9 | <div class="img-list-wrap"> | 14 | <div class="img-list-wrap"> |
10 | <div v-for="(img, i) in previewImg.imgList" :key="i"> | 15 | <img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪"> |
16 | <div v-for="(img, i) in previewImg.imgList" :key="i" v-else> | ||
11 | <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" | 17 | <photo-zoom :url="img.fjurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2" |
12 | overlayStyle="width: 100%;height:100%"> | 18 | overlayStyle="width: 100%;height:100%"> |
13 | </photo-zoom> | 19 | </photo-zoom> |
... | @@ -24,6 +30,8 @@ | ... | @@ -24,6 +30,8 @@ |
24 | </el-upload> | 30 | </el-upload> |
25 | <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete" | 31 | <el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete" |
26 | v-if="!this.$route.query.viewtype && thumbnailImages.length>0">删除</el-button> | 32 | v-if="!this.$route.query.viewtype && thumbnailImages.length>0">删除</el-button> |
33 | <el-button type="primary" @click="handleOpenScan">{{scanTitle}}</el-button> | ||
34 | <el-button type="primary" @click="handleViewScan" v-if="isScan">拍照</el-button> | ||
27 | </div> | 35 | </div> |
28 | <ul> | 36 | <ul> |
29 | <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" | 37 | <li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }" |
... | @@ -38,6 +46,7 @@ | ... | @@ -38,6 +46,7 @@ |
38 | </div> | 46 | </div> |
39 | </template> | 47 | </template> |
40 | <script> | 48 | <script> |
49 | import axios from 'axios' | ||
41 | import PhotoZoom from '@/components/PhotoZoom' | 50 | import PhotoZoom from '@/components/PhotoZoom' |
42 | import { uploadSjClmx, deleteClmx } from "@/api/clxx.js"; | 51 | import { uploadSjClmx, deleteClmx } from "@/api/clxx.js"; |
43 | import publicPicture from '@/components/publicPicture/index.vue' | 52 | import publicPicture from '@/components/publicPicture/index.vue' |
... | @@ -55,6 +64,9 @@ | ... | @@ -55,6 +64,9 @@ |
55 | }, | 64 | }, |
56 | data () { | 65 | data () { |
57 | return { | 66 | return { |
67 | isScan: false, | ||
68 | // 打开高拍仪 | ||
69 | scanTitle: '打开高拍仪', | ||
58 | transform: { | 70 | transform: { |
59 | scale: 1, | 71 | scale: 1, |
60 | degree: 0 | 72 | degree: 0 |
... | @@ -92,6 +104,31 @@ | ... | @@ -92,6 +104,31 @@ |
92 | } | 104 | } |
93 | }, | 105 | }, |
94 | methods: { | 106 | methods: { |
107 | /** | ||
108 | * @description: 打开高拍仪 | ||
109 | * @author: renchao | ||
110 | */ | ||
111 | handleOpenScan () { | ||
112 | this.isScan = true | ||
113 | this.scanTitle = '关闭高拍仪' | ||
114 | }, | ||
115 | /** | ||
116 | * @description: 拍照 | ||
117 | * @author: renchao | ||
118 | */ | ||
119 | handleViewScan () { | ||
120 | let data = { | ||
121 | "filepath": "base64", | ||
122 | "rotate": "0", | ||
123 | "cutpage": "0", | ||
124 | "camidx": "0", | ||
125 | "ColorMode": "0", | ||
126 | "quality": "3" | ||
127 | } | ||
128 | axios.post("http://127.0.0.1:38088/video=grabimage", JSON.stringify(data)).then((res) => { | ||
129 | console.log(res.data); | ||
130 | }) | ||
131 | }, | ||
95 | prev () { | 132 | prev () { |
96 | let len = this.previewImg.imgList.length | 133 | let len = this.previewImg.imgList.length |
97 | if (this.isFirst || len == 0) { | 134 | if (this.isFirst || len == 0) { | ... | ... |
-
Please register or sign in to post a comment