Commit 55e4ad7e by 周志凯

fix: fixed map url

1 parent 57be26a7
No preview for this file type
// export let url = 'http://192.168.9.208:20080/api/v1' // export let url = 'http://192.168.9.208:20080/api/v1'
// export let url = 'http://52.1.113.109:20080/api/v1' // export let url = 'http://52.1.113.109:20080/api/v1'
const { urls = '', picUrls = '' } = window.SECURITY_CONF const { urls = '', picUrls = '', mapUrls = '' } = window.SECURITY_CONF
export const mapUrl = mapUrls || location.host
export let IP = urls || location.host export let IP = urls || location.host
if (IP.indexOf('9.102') > -1 || IP.indexOf('localhost') > -1) { if (IP.indexOf('9.102') > -1 || IP.indexOf('localhost') > -1) {
IP = 'https://store.keliuyun.com/report' IP = 'https://store.keliuyun.com/report'
......
...@@ -48,6 +48,7 @@ export function tryHideFullScreenLoading() { ...@@ -48,6 +48,7 @@ export function tryHideFullScreenLoading() {
* 请求前的拦截器 * 请求前的拦截器
*/ */
service.interceptors.request.use(function (config) { service.interceptors.request.use(function (config) {
const token = localStorage.getItem('atoken');
//截取API添加时间戳防止请求缓存 //截取API添加时间戳防止请求缓存
if (config.method == "get") { if (config.method == "get") {
config.params = { config.params = {
...@@ -57,7 +58,6 @@ service.interceptors.request.use(function (config) { ...@@ -57,7 +58,6 @@ service.interceptors.request.use(function (config) {
} }
if (config.url.indexOf('codes/countries') < 1) { if (config.url.indexOf('codes/countries') < 1) {
if (config.url.indexOf('cates') < 1) { if (config.url.indexOf('cates') < 1) {
var token = localStorage.getItem('atoken');
if (token) { if (token) {
// config.headers.authorization = '4db5183a-721b-4eee-b623-1d143890e813'; // config.headers.authorization = '4db5183a-721b-4eee-b623-1d143890e813';
config.headers.authorization = token; config.headers.authorization = token;
...@@ -79,6 +79,15 @@ service.interceptors.request.use(function (config) { ...@@ -79,6 +79,15 @@ service.interceptors.request.use(function (config) {
*/ */
service.interceptors.response.use(function (res) { service.interceptors.response.use(function (res) {
//tryHideFullScreenLoading(); //tryHideFullScreenLoading();
if (res.data) {
if (res.data.ecode === 401) {
Message({
type: 'error',
message: res.data.enote
})
// router.push('/');
}
}
return res; return res;
}, function (err) { }, function (err) {
//tryHideFullScreenLoading(); //tryHideFullScreenLoading();
......
/**
* 校验身份证号码
*/
export function checkCardId(rule, value, callback) {
let cardIdReg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/
if (cardIdReg.test(value) || !value) {
return callback()
} else {
return callback(new Error('请输入正确的身份证号'))
}
}
/**
* 校验年龄
*/
export function checkAge(rule, value, callback) {
let ageReg = /^([1-9]\d?|1[01]\d|120)$/
if (ageReg.test(value) || !value) {
return callback()
} else {
return callback(new Error('请输入正确年龄'))
}
return
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="activitychart" id="activitychart" v-show="curshow == 'chart'&&!noImg"></div> <div class="activitychart" id="activitychart" v-show="curshow == 'chart'&&!noImg"></div>
<div class="imgbox" v-show="curshow == 'img'&&!noImg"> <div class="imgbox" v-show="curshow == 'img'&&!noImg">
<div v-for="(item,index) in imgData" class="item-img-box" :key="index"> <div v-for="(item,index) in imgData" class="item-img-box" :key="index">
<img :src="item.pic_url" alt=""> <img :src="API.picUrl+'picture/'+item.facePath+item.facePic" alt="">
</div> </div>
</div> </div>
<div class="" v-show="noImg"> <div class="" v-show="noImg">
...@@ -46,20 +46,20 @@ export default { ...@@ -46,20 +46,20 @@ export default {
}, },
methods:{ methods:{
initImg(data){ initImg(data){
this.imgData = []
this.show = true this.show = true
this.titlename = '抓拍图片' this.titlename = '抓拍图片'
this.curshow = 'img' this.curshow = 'img'
this.axios.get(this.API.url + '/faceRecognitions',{ this.axios.get(this.API.url + '/faceRecognitions',{
params:{ params:{
mallId:2, mallId: data.mallId,
personUnid:data.personUnid, personUnid:data.personUnid,
// countdate: this.common.formatDateFun(new Date(),"yyyy-MM-dd"),
sortName: "counttime", sortName: "counttime",
sortOrder: "DESC" sortOrder: "DESC"
} }
}).then(res => { }).then(res => {
if(res.data.list_data){ if(res.data.data){
this.imgData = res.data.list_data; this.imgData = res.data.data;
this.noImg=false; this.noImg=false;
}else{ }else{
this.noImg=true; this.noImg=true;
...@@ -196,6 +196,7 @@ export default { ...@@ -196,6 +196,7 @@ export default {
} }
.item-img-box{ .item-img-box{
width 155px width 155px
height 200px
float left float left
overflow hidden overflow hidden
border-radius 5px border-radius 5px
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
<el-table-column prop="gender" label="性别" :formatter="setSex" align="center"></el-table-column> <el-table-column prop="gender" label="性别" :formatter="setSex" align="center"></el-table-column>
<el-table-column label="出生日期" property="email" :formatter="setBirthday"> </el-table-column> <el-table-column label="出生日期" property="email" :formatter="setBirthday"> </el-table-column>
<el-table-column label="身份证号" property="tel"></el-table-column> <el-table-column label="身份证号" property="tel"></el-table-column>
<el-table-column label="最后出现时间" property="lastTime"></el-table-column>
<el-table-column label="抓拍次数" property="snapshotCount"></el-table-column>
<el-table-column label="操作" width="200" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab-btn-box"> <div class="tab-btn-box">
...@@ -135,8 +137,11 @@ export default { ...@@ -135,8 +137,11 @@ export default {
resident_unids: this.communityunid, resident_unids: this.communityunid,
} }
}).then( (response) =>{ }).then( (response) =>{
const { data } = response.data
if (data) {
this.tableData = response.data.data.list; this.tableData = response.data.data.list;
this.total = response.data.data.total; this.total = response.data.data.total;
}
}); });
}, },
handleCurrentChange(val){ handleCurrentChange(val){
......
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
                                                  })                                                   })
}); });
// var path = "http://192.168.9.62:20080/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png" // var path = "http://192.168.9.62:20080/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png"
var path = "http://19610hs911.iask.in/static/pics/qingdaoMap/roadmap/{z}/{x}/{y}.png" var path = _this.API.mapUrl + "/{z}/{x}/{y}.png"
var offlineMapLayer = new TileLayer({ var offlineMapLayer = new TileLayer({
source: new XYZ({ source: new XYZ({
// 设置本地离线瓦片所在路径,由于例子里面只有一张瓦片,页面显示时就只看得到一张瓦片。 // 设置本地离线瓦片所在路径,由于例子里面只有一张瓦片,页面显示时就只看得到一张瓦片。
......
...@@ -56,7 +56,9 @@ ...@@ -56,7 +56,9 @@
{{scope.row.gender | sexfn}} {{scope.row.gender | sexfn}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="age" label="年龄"></el-table-column> <el-table-column label="年龄">
<template slot-scope="scope">{{ scope.row.age | filterAgeText }}</template>
</el-table-column>
<el-table-column label="抓拍人像"> <el-table-column label="抓拍人像">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="accomimg-box"> <div class="accomimg-box">
...@@ -138,6 +140,16 @@ export default { ...@@ -138,6 +140,16 @@ export default {
filterNameText(val) { filterNameText(val) {
const cachePersonName = JSON.parse(sessionStorage.getItem('staffsName')) || {} const cachePersonName = JSON.parse(sessionStorage.getItem('staffsName')) || {}
return cachePersonName[val] || '--' return cachePersonName[val] || '--'
},
filterAgeText(val) {
const ageCode = {
1: '少年',
2: '青年',
3: '中年',
4: '老年'
// 5: '未知'
}
return ageCode[val] || '未知'
} }
}, },
methods: { methods: {
...@@ -159,10 +171,10 @@ export default { ...@@ -159,10 +171,10 @@ export default {
this.page.currentPage = 1; this.page.currentPage = 1;
}, },
fetchStaffName() { fetchStaffName() {
if (this.cachePersons) return if (this.cachePersons && Object.keys(this.cachePersons).length) return
this.axios.get(this.API.url + "/staffs",{ this.axios.get(this.API.url + "/persons",{
params:{ params:{
accountId:this.search.communityunid accountId:this.accountId
} }
}).then((response)=> { }).then((response)=> {
console.log('response', response) console.log('response', response)
......
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
<el-row> <el-row>
<div style="overflow:hidden"> <div style="overflow:hidden">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="姓名" :label-width="formLabelWidth" :rules="[ { required: true, message: '姓名不能为空'}]"> <el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="form.name" auto-complete="off"></el-input> <el-input v-model="form.name" auto-complete="off"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="库类型" prop="type" :label-width="formLabelWidth" :rules="[ { required: true, message: '请选择库类型'}]"> <el-form-item label="库类型" prop="type" :label-width="formLabelWidth">
<el-select v-model="form.type" > <el-select v-model="form.type" >
<el-option v-for="item in typeData" :key="item.unid" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in typeData" :key="item.unid" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="年龄" :label-width="formLabelWidth"> <el-form-item label="年龄" :label-width="formLabelWidth" prop="age">
<el-input v-model="form.age" auto-complete="off"></el-input> <el-input v-model="form.age" auto-complete="off"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="性别" :label-width="formLabelWidth" :rules="[ { required: true, message: '请选择性别'}]"> <el-form-item label="性别" :label-width="formLabelWidth" prop="gender">
<el-select v-model="form.gender" placeholder="请选择性别"> <el-select v-model="form.gender" placeholder="请选择性别">
<el-option label="男" :value="1"></el-option> <el-option label="男" :value="1"></el-option>
<el-option label="女" :value="0"></el-option> <el-option label="女" :value="0"></el-option>
...@@ -76,13 +76,13 @@ ...@@ -76,13 +76,13 @@
</div> </div>
<div style="overflow:hidden"> <div style="overflow:hidden">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="生日" :label-width="formLabelWidth"> <el-form-item label="生日" :label-width="formLabelWidth" prop="birthday">
<el-date-picker v-model="form.birthday" type="date" placeholder="选择日期" value-format="yyyy-MM-dd"> <el-date-picker v-model="form.birthday" type="date" placeholder="选择日期" value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="证件类型" :label-width="formLabelWidth"> <el-form-item label="证件类型" :label-width="formLabelWidth" prop="card_type">
<el-select v-model="form.card_type" placeholder="请选择证件类型"> <el-select v-model="form.card_type" placeholder="请选择证件类型">
<el-option v-for="item in cartypeData" :key="item.code" :label="item.name" :value="item.code"></el-option> <el-option v-for="item in cartypeData" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select> </el-select>
...@@ -91,13 +91,13 @@ ...@@ -91,13 +91,13 @@
</div> </div>
<div style="overflow:hidden"> <div style="overflow:hidden">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="证件号" :label-width="formLabelWidth"> <el-form-item label="证件号" :label-width="formLabelWidth" prop="card_id">
<el-input v-model="form.card_id" auto-complete="off"></el-input> <el-input v-model="form.card_id" auto-complete="off"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="籍贯" :label-width="formLabelWidth"> <el-form-item label="籍贯" :label-width="formLabelWidth" prop="info">
<el-input v-model="form.info" auto-complete="off"></el-input> <el-input v-model="form.info" auto-complete="off"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -157,9 +157,17 @@ ...@@ -157,9 +157,17 @@
</div> </div>
</template> </template>
<script> <script>
import { checkCardId, checkAge } from '@/util/validate.js';
import Facetable from "./faceTable"; import Facetable from "./faceTable";
export default { export default {
data() { data() {
const checkName = (rule, value, callback) => {
if (!value) {
return callback(new Error('姓名不能为空'))
} else {
return callback()
}
}
return { return {
typeData:[], typeData:[],
imageUrl:'', imageUrl:'',
...@@ -212,8 +220,20 @@ export default { ...@@ -212,8 +220,20 @@ export default {
pickerOptions0: {}, pickerOptions0: {},
deletStr:'', deletStr:'',
rules: { rules: {
name: [
{ required: true, validator: checkName, trigger: 'blur' }
],
type: [
{ required: true, message: '请选择库类型', trigger: 'change' }
],
age: [
{ validator: checkAge, trigger: 'blur' }
],
gender: [
{ required: true, message: '请选择性别'}
],
card_id: [ card_id: [
{ min: 0, max: 22, message: '请正确输入身份证号码!', trigger: 'blur' } { validator: checkCardId, trigger: 'blur' }
], ],
mphone: [ mphone: [
{ min: 0, max: 13, message: '请正确输入手机号!', trigger: 'blur' } { min: 0, max: 13, message: '请正确输入手机号!', trigger: 'blur' }
...@@ -272,9 +292,9 @@ export default { ...@@ -272,9 +292,9 @@ export default {
}, },
successImg(response, file, fileList) { successImg(response, file, fileList) {
console.log('r',response) // console.log('r',response)
console.log('f',file) // console.log('f',file)
console.log('fl',fileList) // console.log('fl',fileList)
//图片上传成功 //图片上传成功
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
...@@ -319,11 +339,11 @@ export default { ...@@ -319,11 +339,11 @@ export default {
this.form.name = data.name; this.form.name = data.name;
this.form.type = data.type; this.form.type = data.type;
this.form.gender=data.gender; this.form.gender=data.gender;
this.form.birthday = data.email; this.form.birthday = data.birthday;
this.form.card_type = 1; this.form.card_type = 1;
this.form.age = data.age; this.form.age = data.age;
this.form.card_id = data.tel; this.form.card_id = data.idCard;
this.form.info = data.personInfo; this.form.info = data.nativePlace;
// this.form.gender = data.gender; // this.form.gender = data.gender;
// this.form.mphone = data.mphone; // this.form.mphone = data.mphone;
// this.form.province = data.province; // this.form.province = data.province;
...@@ -356,6 +376,8 @@ export default { ...@@ -356,6 +376,8 @@ export default {
this.form.info = ""; this.form.info = "";
}, },
saveAddPersonnel() { saveAddPersonnel() {
console.log('saveAddPersonnel:::')
return;
/* eslint-disable no-undef */ /* eslint-disable no-undef */
let param = new FormData() // 创建form对象 let param = new FormData() // 创建form对象
param.append('file', this.file.raw) // 通过append向form对象添加数据 param.append('file', this.file.raw) // 通过append向form对象添加数据
...@@ -364,9 +386,9 @@ export default { ...@@ -364,9 +386,9 @@ export default {
param.append('type', this.form.type); param.append('type', this.form.type);
param.append('photo', this.imageUrl); param.append('photo', this.imageUrl);
param.append('age', this.form.age); param.append('age', this.form.age);
param.append('tel', this.form.card_id); param.append('idCard', this.form.card_id);
param.append('email', this.form.birthday); param.append('birthday', this.form.birthday);
param.append('personInfo', this.form.info); param.append('nativePlace', this.form.info);
param.append('accountId', this.form.accountId); param.append('accountId', this.form.accountId);
param.append('createType', 0); param.append('createType', 0);
let config = { let config = {
...@@ -395,9 +417,9 @@ export default { ...@@ -395,9 +417,9 @@ export default {
param.append('gender', this.form.gender); param.append('gender', this.form.gender);
param.append('type', this.form.type); param.append('type', this.form.type);
param.append('age', this.form.age); param.append('age', this.form.age);
param.append('tel', this.form.card_id); param.append('idCard', this.form.card_id);
param.append('email', this.form.birthday); param.append('birthday', this.form.birthday);
param.append('personInfo', this.form.info); param.append('nativePlace', this.form.info);
let config = { let config = {
headers: {'Content-Type': 'multipart/form-data'} headers: {'Content-Type': 'multipart/form-data'}
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<span class="info-label"> <span class="info-label">
<span class="info-label-name">生日:</span> <span class="info-label-name">生日:</span>
</span> </span>
<span class="info-text">{{faceInfo.email}}</span> <span class="info-text">{{faceInfo.birthday}}</span>
</el-col> </el-col>
<el-col :span="12" class="mt10 clear-both"> <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<span class="info-label"> <span class="info-label">
<span class="info-label-name">证件号:</span> <span class="info-label-name">证件号:</span>
</span> </span>
<span class="info-text">{{faceInfo.tel}}</span> <span class="info-text">{{faceInfo.idCard}}</span>
</el-col> </el-col>
<!-- <el-col :span="12" class="mt10 clear-both"> <!-- <el-col :span="12" class="mt10 clear-both">
<span class="info-label"> <span class="info-label">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<span class="info-label-name">籍贯:</span> <span class="info-label-name">籍贯:</span>
</span> </span>
<!-- <span class="info-text">{{showCity(faceInfo.province,faceInfo.city)}}</span> --> <!-- <span class="info-text">{{showCity(faceInfo.province,faceInfo.city)}}</span> -->
<span class="info-text">{{faceInfo.personInfo}}</span> <span class="info-text">{{faceInfo.nativePlace}}</span>
</el-col> </el-col>
<!-- 户籍库详细信息 --> <!-- 户籍库详细信息 -->
<el-row v-show="faceInfo.extra_info" v-if="faceInfo.extra_info"> <el-row v-show="faceInfo.extra_info" v-if="faceInfo.extra_info">
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<el-table-column label="姓名" property="name" type="name" width="180"></el-table-column> <el-table-column label="姓名" property="name" type="name" width="180"></el-table-column>
<el-table-column label="年龄" property="age" width="180"></el-table-column> <el-table-column label="年龄" property="age" width="180"></el-table-column>
<el-table-column label="性别" property="gender" :formatter="setSex" width="180"></el-table-column> <el-table-column label="性别" property="gender" :formatter="setSex" width="180"></el-table-column>
<el-table-column label="出生日期" property="email" :formatter="setBirthday"> </el-table-column> <el-table-column label="出生日期" property="birthday" :formatter="setBirthday"> </el-table-column>
<el-table-column label="身份证号" property="tel"></el-table-column> <el-table-column label="身份证号" property="idCard"></el-table-column>
<el-table-column label="籍贯" property="personInfo" :formatter="setCity"> <el-table-column label="籍贯" property="nativePlace" :formatter="setCity">
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300px" align="center"> <el-table-column label="操作" width="300px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
}); });
}, },
setCity(row, column, cellValue) { setCity(row, column, cellValue) {
if(!row.personInfo){ if(!row.nativePlace){
return '未知' return '未知'
}else{ }else{
return cellValue return cellValue
......
window.SECURITY_CONF = { window.SECURITY_CONF = {
// urls: 'http://15.72.10.193/report',
// picUrls: 'http://15.72.10.193/images/',
// mapUrls: 'http://15.72.10.193/map'
urls: 'https://store.keliuyun.com/report', urls: 'https://store.keliuyun.com/report',
picUrls: 'https://vion-retail.oss-cn-beijing.aliyuncs.com/' picUrls: 'https://vion-retail.oss-cn-beijing.aliyuncs.com/',
mapUrls: 'http://19610hs911.iask.in/static/pics/qingdaoMap/roadmap'
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!