6fd2bd04 by xiaomiao

Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev

2 parents 78f983c8 1f60e8e5
......@@ -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
......
/*
* @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')
}
......
......@@ -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);
......
<!--
* @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) {
......