Commit 4e10ae55 authored by wangxiaoming's avatar wangxiaoming

平台修改 维护

parent 858179d4
......@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>巡检平台</title>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<script type="text/javascript">
......@@ -27,4 +27,5 @@
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
This diff is collapsed.
......@@ -53,6 +53,7 @@
console.log("liveUrl"+url);
//"webrtc://152.136.233.116/live/livestream"
var urlObject = parse_rtmp_url(url);
/*urlObject*/
var schema = window.location.protocol;
// Close PC when user replay.
......@@ -78,7 +79,7 @@
return pc.setLocalDescription(offer).then(function(){ return offer; });
}).then(function(offer) {
return new Promise(function(resolve, reject) {
var port = urlObject.port || 1985;
var port = 1985;
// @see https://github.com/rtcdn/rtcdn-draft
var api = urlObject.user_query.play || '/rtc/v1/play/';
......@@ -94,7 +95,7 @@
}
// Replace /rtc/v1/play/&k=v to /rtc/v1/play/?k=v
url = url.replace(api + '&', api + '?');
url=url.replace('https', 'http');
// @see https://github.com/rtcdn/rtcdn-draft
var data = {
api: url, streamurl: urlObject.url, clientip: null, sdp: offer.sdp
......@@ -102,7 +103,7 @@
console.log("Generated offer: ", data);
$.ajax({
type: "POST", url: url, data: JSON.stringify(data),
type: "POST", url: "https://xj.roadgrids.com/liveUrl", data: JSON.stringify(data),
contentType:'application/json', dataType: 'json'
}).done(function(data) {
console.log("Got answer: ", data);
......
src/assets/logo_new.png

6.47 KB | W: | H:

src/assets/logo_new.png

19.6 KB | W: | H:

src/assets/logo_new.png
src/assets/logo_new.png
src/assets/logo_new.png
src/assets/logo_new.png
  • 2-up
  • Swipe
  • Onion skin
const address = '/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000';
const photoAddress = 'http://106.52.130.113:8000';
const videoAddress = 'https://xj.roadgrids.com';
const photoAddress = 'https://xj.roadgrids.com';
const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台';
const title = '道路综合巡检平台';
export {
address, photoAddress, imgAddress, videoAddress,
};
......@@ -2,7 +2,7 @@ const address = '/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000';
const photoAddress = 'http://106.52.130.113:8000';
const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台';
const title = '道路综合巡检平台';
export {
address, photoAddress, imgAddress, videoAddress,
};
const address = '/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000';
const photoAddress = 'http://106.52.130.113:8000';
const address = 'http://localhost:8088/roadlinks/';
const videoAddress = 'https://xj.roadgrids.com';
const photoAddress = 'https://xj.roadgrids.com';
const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台';
const title = '道路综合巡检平台';
export {
address, photoAddress, imgAddress, videoAddress,
};
// eslint-disable-next-line import/extensions
import requestBlob from '@/excel/request-blob.js';
import { address } from '../config';
export function exportResultDetail(data) {
return requestBlob({
url: `${address}exportResultDetail`,
method: 'post',
data,
});
}
import axios from 'axios';
import Cookies from 'js-cookie';
// create an axios instance
const service = axios.create({
baseURL: '/', // url = base url + request url
withCredentials: true, // send cookies when cross-domain requests
timeout: 1800000, // request timeout
});
// request interceptor
service.interceptors.request.use(
(config) => {
// do something before request is sent
const token = Cookies.get('id');
if (token) {
config.headers = {
AuthId: token,
Authorization: `Bearer ${token}`,
};
}
config.responseType = 'blob';
return config;
},
(error) => {
// do something with request error
console.log(error); // for debug
return Promise.reject(error);
},
);
export default service;
......@@ -32,12 +32,28 @@ Vue.use(BaiduMap, {
Object.defineProperty(Vue.prototype, '$moment', { value: moment });
Object.defineProperty(Vue.prototype, '$_', { value: _ });
var _hmt = _hmt || [];
window._hmt = _hmt; // 必须把_hmt挂载到window下,否则找不到
(function () {
const hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?264c2115edc746cbdd76f5fa44b60c26';
const s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
}());
Vue.config.productionTip = false;
router.beforeEach((to, from, next) => {
window.scrollTo(0, 0);
if (to.matched.some(record => record.meta.requireAuth)) {
// 判断该路由是否需要登录权限
if (Cookies.get('id')) { // 判断当前的token是否存在
if (_hmt) {
if (to.path) {
_hmt.push(['_trackPageview', `/#${to.fullPath}`]);
}
}
next();
} else {
// next();
......@@ -55,7 +71,7 @@ axios.interceptors.request.use(
(config) => {
config.baseURL = '/';
config.withCredentials = true; // 允许携带token ,这个是解决跨域产生的相关问题
config.timeout = 6000;
config.timeout = 60000;
const token = Cookies.get('id');
if (token) {
config.headers = {
......@@ -84,7 +100,8 @@ const permission = {
const roles = JSON.parse(localStorage.getItem('permission'));
if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value;
const hasPermission = roles.some(role => permissionRoles.includes(role));
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el);
}
......
......@@ -5,6 +5,9 @@ const permission = {
userAuthorization: '004',
equipmentList_edit: '002.001',
userManagement_edit: '003.001',
resultCheck_edit: '005.001',
provincePermission: '2',
cityPermission: '3',
};
export {
permission,
......
......@@ -7,6 +7,46 @@
<!--搜索栏-->
<el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters">
<el-form-item v-permission="[permission.provincePermission]">
<el-select
@change="getCityOptions"
v-model="filters.provinceIds"
style="width:260px"
multiple
collapse-tags
clearable
filterable
placeholder="请选择省份"
>
<el-option
v-for="item in provinceOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-permission="[permission.provincePermission]"
v-model="filters.cityIds"
multiple
collapse-tags
style="width:260px"
clearable
filterable
placeholder="请选择管理处"
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="filters.capitalType"
......@@ -30,7 +70,7 @@
></el-autocomplete>-->
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getCapitalDetails">搜索</el-button>
<el-button type="primary" @click="getCapitalDetails" v-loading="searchLoading">搜索</el-button>
</el-form-item>
</el-form>
</el-col>
......@@ -44,6 +84,7 @@
:highlight-current-row="true"
>
<el-table-column label="序号" prop="no"></el-table-column>
<el-table-column label="管理单位" prop="office"></el-table-column>
<el-table-column label="道路资产名称" prop="name"></el-table-column>
<el-table-column label="道路资产位置信息" prop="position"></el-table-column>
</el-table>
......@@ -74,13 +115,20 @@ import { Message } from 'element-ui';
import echarts from 'echarts';
import moment from 'moment';
import { address, photoAddress } from '../config';
import { permission } from '../permission';
export default {
name: 'detail',
data() {
return {
searchLoading: false,
permission,
provinceOptions: [],
cityOptions: [],
tableData: [],
filters: {
cityIds: [],
provinceIds: [],
capitalType: [],
},
showCol: false,
......@@ -94,14 +142,68 @@ export default {
},
mounted() {},
created() {
const searchVal = sessionStorage.getItem('detailSearchVal');
if (searchVal) {
this.filters = JSON.parse(searchVal);
}
if (this.$route.params.provinceIds) {
this.filters.provinceIds = this.$route.params.provinceIds;
}
if (this.$route.params.cityIds) {
this.filters.cityIds = this.$route.params.cityIds;
}
if (this.filters.provinceIds.length > 0) {
this.getCityOptions();
}
this.filters.capitalType = [];
if (this.$route.params.capitalName) {
this.filters.capitalType.push(this.$route.params.capitalName);
}
this.getCapitalDetails();
this.getAllCapitals();
this.queryAllProvinceByPermission();
},
methods: {
queryAllProvinceByPermission() {
axios
.post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.provinceOptions = response.data.data;
}
}
})
.catch((error) => {
console.log(error);
});
},
queryCityByProvince(provinceId) {
axios
.post(`${address}selectAllAreasByLevelByParent`, {
parentIds: provinceId,
})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.cityOptions = response.data.data;
this.cityOptions.forEach((e) => {
e.name += '管理处';
});
}
}
})
.catch((error) => {
console.log(error);
});
},
getCityOptions() {
this.cityOptions = [];
if (this.filters.provinceIds.length > 0) {
this.queryCityByProvince(this.filters.provinceIds);
}
},
linkPic(index, row) {
this.getCurrentDate();
const photoDate = row.finalOnlineTime
......@@ -235,8 +337,8 @@ export default {
if (response.data.code === 200) {
this.capitalOptions = [];
if (response.data.data) {
/* console.log(response.data.data);*/
const capitals = response.data.data;
/* console.log(response.data.data); */
const capitals = response.data.data.sdServices;
const nameSet = new Set();
capitals.forEach((val) => {
nameSet.add(val.capitalName);
......@@ -254,6 +356,12 @@ export default {
});
},
getCapitalDetails() {
const roles = JSON.parse(localStorage.getItem('permission'));
const permissionRoles = [permission.provincePermission];
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (hasPermission && this.filters.provinceIds.length == 0) {
return;
}
this.currentPage = 1;
let capitalName = '';
if (this.filters.capitalType) {
......@@ -265,12 +373,21 @@ export default {
}
});
}
this.searchLoading = true;
sessionStorage.setItem(
'detailSearchVal',
JSON.stringify(this.filters),
);
axios
.post(`${address}getCapitalDetails`, {
capitalName,
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
})
.then((response) => {
if (response.data.code === 200) {
this.searchLoading = false;
this.tableData = [];
this.no = 0;
if (response.data.data) {
......@@ -286,6 +403,7 @@ export default {
nameMap.set(val.capitalName, num);
}
this.tableData.push({
office: val.office,
no: ++this.no,
name: val.capitalName + num,
position: val.position,
......@@ -295,6 +413,7 @@ export default {
}
})
.catch((error) => {
this.searchLoading = false;
console.log(error);
});
},
......
......@@ -13,9 +13,16 @@
<div v-if="provinceId ==109">
<img style="width:100px;height:80px" src="../assets/logo_anhui.png" alt />
</div>
<div v-else-if="provinceId != 109">
<img style="width:100px;height:80px" src="../assets/logo_new.png" alt />
<div v-else-if="provinceId == 239">
<img style="width:100px;height:100px" src="../assets/logo_guangxi.png" alt />
</div>
<div v-else-if="provinceId == 1 && myId==9">
<img style="width:100px;height:100px" src="../assets/logo_zhongguogonglu.png" alt />
</div>
<div v-else-if="provinceId!=109">
<img style="width:180px;height:45px" src="../assets/logo_new.png" alt />
</div>
</div>
<el-submenu index="1">
......@@ -94,7 +101,7 @@
</el-menu-item>
</el-submenu>
<el-submenu index="6" v-permission="[permission.userAuthorization,permission.userManagement]">
<el-submenu index="6" >
<span slot="title" class="submenu_parent" >&nbsp;&nbsp;账户管理&nbsp;&nbsp;</span>
<el-menu-item
v-permission="[permission.userManagement]"
......@@ -112,13 +119,13 @@
>
<span slot="title" style="font-size: 16px">授权账户</span>
</el-menu-item>
<!-- <el-menu-item
<el-menu-item
index="6-3"
@click="goTo('/resetPassword')"
style="background:#252639 !important"
>
<span slot="title" style="font-size: 16px">修改密码</span>
</el-menu-item>-->
</el-menu-item>
</el-submenu>
</el-menu>
</el-scrollbar>
......
......@@ -6,6 +6,45 @@
<!--搜索栏-->
<el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters">
<el-form-item v-permission="[permission.provincePermission]">
<el-select
@change="getCityOptions"
v-model="filters.provinceIds"
style="width:260px"
multiple
collapse-tags
clearable
filterable
placeholder="请选择省份"
>
<el-option
v-for="item in provinceOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-permission="[permission.provincePermission]">
<el-select
v-model="filters.cityIds"
multiple
collapse-tags
style="width:260px"
clearable
filterable
placeholder="请选择管理处"
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="filters.equipment"
......@@ -60,8 +99,8 @@
</div>
</div>
<el-dialog :visible.sync="isShowVideo" width="1000px" height="5900px">
<iframe style="width:100%;height:600px" id="live" :src=playerSrc></iframe>
<el-dialog :visible.sync="isShowVideo" width="760px" height="550px">
<iframe style="width:100%;height:580px" id="live" :src=playerSrc></iframe>
<!-- <video-player
@play="onPlayerPlay($event)"
......@@ -105,11 +144,15 @@ import 'video.js/dist/video-js.css';
import 'vue-video-player/src/custom-theme.css';
import 'videojs-flash';
import Cookies from 'js-cookie';
import { permission } from '../permission';
export default {
name: 'video',
data() {
return {
permission,
provinceOptions: [],
cityOptions: [],
playerSrc: '',
isShowTip: false,
plateNoOptions: [],
......@@ -123,6 +166,8 @@ export default {
totalCount: 0,
},
filters: {
cityIds: [],
provinceIds: [],
equipment: [],
},
loading: false,
......@@ -174,8 +219,8 @@ export default {
},
timer: '',
liveUrl: 'webrtc://152.136.233.116/live/',
liveIp: '?eip=152.136.233.116',
liveUrl: 'webrtc://146.56.198.18:8080/live/',
liveIp: '?eip=146.56.198.18',
};
},
watch: {
......@@ -189,8 +234,9 @@ export default {
this.timer = setInterval(this.watchLive, 10000);
},
created() {
this.queryAllProvinceByPermission();
this.queryAllEquipment();
const searchVal = sessionStorage.getItem('videoSearchVal');
const searchVal = sessionStorage.getItem('liveSearchVal');
const that = this;
if (this.$route.params.startTime) {
......@@ -211,10 +257,62 @@ export default {
} else if (searchVal) {
this.filters = JSON.parse(searchVal);
}
if (this.filters.provinceIds.length > 0) {
this.getCityOptions();
}
this.getParkVideos();
this.getLiveUrl();
},
methods: {
getLiveUrl() {
axios
.get(`${address}getLiveIp`, {})
.then((response) => {
if (response.data.code === 200) {
this.liveUrl = `webrtc://${response.data.data}/live/`;
this.liveIp = `?eip=${response.data.data}`;
}
});
},
queryAllProvinceByPermission() {
axios
.post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.provinceOptions = response.data.data;
}
}
})
.catch((error) => {
console.log(error);
});
},
queryCityByProvince(provinceId) {
axios
.post(`${address}selectAllAreasByLevelByParent`, {
parentIds: provinceId,
})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.cityOptions = response.data.data;
this.cityOptions.forEach((e) => {
e.name += '管理处';
});
}
}
})
.catch((error) => {
console.log(error);
});
},
getCityOptions() {
this.cityOptions = [];
if (this.filters.provinceIds.length>0) {
this.queryCityByProvince(this.filters.provinceIds);
}
},
liveStop() {
this.playerOptions.sources[0].src = '';
axios
......@@ -314,9 +412,10 @@ export default {
if (response.data.data && response.data.data.length > 0) {
const channelAndDevid = `${item.code}_${item.channelCode}`;
const random = Math.random();
//webrtc:// 152.136.233.116/live/DefaultstringE3060400FFFBEBBF_zjhn?eip=152.136.233.116
// webrtc:// 152.136.233.116/live/DefaultstringE3060400FFFBEBBF_zjhn?eip=152.136.233.116
// this.playerSrc = `players/rtc_player.html?url=${this.liveUrl}DefaultstringE3060400FFFBEBBF_zjhn${this.liveIp}&random=${random}`;
this.playerSrc = `players/rtc_player.html?url=${this.liveUrl}${channelAndDevid}${this.liveIp}&random=${random}`;
/* const channel = item.channelCode;
const devid = item.code;
const src = `http://152.136.233.116:1965/live/${devid}_${channel}.m3u8`;
......@@ -355,7 +454,7 @@ export default {
Message({
message: response.data.message,
duration: 3 * 1000,
type: 'error',
type: 'error',
// duration: '800',
});
}
......@@ -366,13 +465,23 @@ export default {
},
getParkVideos() {
const roles = JSON.parse(localStorage.getItem('permission'));
const permissionRoles = [permission.provincePermission];
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (hasPermission && this.filters.provinceIds.length == 0 && this.filters.equipment.length == 0) {
return;
}
this.searchLoading = true;
const that = this;
sessionStorage.setItem('liveSearchVal', JSON.stringify(this.filters));
axios
.post(`${address}getParkLives`, {
cityIds: that.filters.cityIds,
provinceIds: that.filters.provinceIds,
equipment: that.filters.equipment,
pageIndex: this.pageOption.pageIndex,
pageSize: this.pageOption.pageSize,
pageIndex: that.pageOption.pageIndex,
pageSize: that.pageOption.pageSize,
})
.then((response) => {
that.searchLoading = false;
......
......@@ -14,20 +14,20 @@
>
<el-form-item prop="username">
<el-input
auto-complete="new-password"
@keyup.enter.native="handleLogin"
v-model="loginForm.username"
auto-complete="off"
placeholder="请输入手机号"
placeholder="请输入用户名"
>
<i slot="prefix" class="elxingmingyonghumingnicheng"></i>
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
auto-complete="new-password"
@keyup.enter.native="handleLogin"
:type="passwordType"
v-model="loginForm.password"
auto-complete="off"
placeholder="请输入密码"
>
<i
......@@ -57,6 +57,8 @@
</div>
</div>
</div>
</template>
<script>
......@@ -84,7 +86,7 @@ export default {
loginRules: {
// 绑定在form表单中的验证规则
username: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ validator: this.isExists, trigger: 'blur' },
],
......@@ -104,6 +106,21 @@ export default {
computed: {},
props: [],
methods: {
changeFavicon(provinceId) {
const $favicon = document.querySelector('link[rel="icon"]');
// If a <link rel="icon"> element already exists,
// change its href to the given link.
if ($favicon !== null) {
if (provinceId == 239) {
$favicon.href = 'favicon_guangxi.ico';
} else {
$favicon.href = 'favicon.ico';
}
// Otherwise, create a new element and append it to <head>.
}
},
isExists(rule, value, callback) {
axios
.post(`${address}getUserInfoByUserName`, {
......@@ -111,12 +128,12 @@ export default {
}).then((res) => {
// eslint-disable-next-line eqeqeq
if (res.data.code != 200) {
callback(new Error('手机号不存在'));
callback(new Error('用户名不存在'));
} else {
callback();
}
}).catch(() => {
callback(new Error('手机号不存在'));
callback(new Error('用户名不存在'));
});
},
// 跳转到home页
......@@ -142,6 +159,8 @@ export default {
? (this.passwordType = 'password')
: (this.passwordType = '');
},
// 点击登入按钮
handleLogin() {
this.$refs.loginForm.validate((valid) => {
......@@ -154,13 +173,16 @@ export default {
})
.then((response) => {
if (response.data.code === 200) {
sessionStorage.clear();
Cookies.set('id', response.data.data.id);
Cookies.set('username', this.loginForm.username);
Cookies.set('sessionId', response.data.data.sessionId);
sessionStorage.setItem('modifyPasswordStatus', response.data.data.modifyStatus);
store.state.provinceId = response.data.data.provinceId;
store.state.permissionList = response.data.data.permissionList;
localStorage.setItem('permission', JSON.stringify(store.state.permissionList));
localStorage.setItem('provinceId', store.state.provinceId);
this.changeFavicon(store.state.provinceId);
this.goToHome();
} else {
Message({
......
<template>
<div class="overview">
<div class="box">
<el-row class="warp">
<div class="overview-line">{{office}}管理处道路资产汇总情况如下,总共{{totalnum}}个。</div>
<el-col :span="24" class="warp-breadcrum" v-permission="[permission.provincePermission]">
<!--搜索栏-->
<el-form :inline="true" :model="filters">
<el-form-item>
<el-select
@change="getCityOptions"
v-model="filters.provinceIds"
style="width:260px"
multiple
collapse-tags
clearable
filterable
placeholder="请选择省份"
>
<el-option
v-for="item in provinceOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="filters.cityIds"
multiple
collapse-tags
style="width:260px"
clearable
filterable
placeholder="请选择管理处"
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-left:50px">
<el-button type="primary" v-loading="searchLoading"
@click="getAllCapitals">搜索
</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div class="overview-line" v-show="totalnum>0">{{office}} 资产汇总情况如下,总共{{totalnum}}个。</div>
<!-- 任务表 -->
<div class="overview-table">
<el-table
......@@ -45,9 +94,22 @@
<h3>任务统计</h3>
<div class="echarts-box" id="echarts-box"></div>
</div>-->
</el-row>
</div>
<el-dialog
:before-close="handleClose"
:visible.sync="dialogVisible"
width="30%">
<span style="color: orangered;font-size: large">为了保障您的账户安全,请修改密码</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="goModifyPass">确 定</el-button>
<el-button @click="handleClose">取 消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
......@@ -55,13 +117,20 @@ import axios from 'axios';
import { Message } from 'element-ui';
import echarts from 'echarts';
import moment from 'moment';
import Cookies from 'js-cookie';
import { address } from '../config';
import { permission } from '../permission';
export default {
name: 'overview',
data() {
return {
office: '淮南',
dialogVisible: false,
permission,
searchLoading: false,
provinceOptions: [],
cityOptions: [],
office: '',
tableData: [],
typeData: [
{ value: 0, label: '全部' },
......@@ -74,6 +143,8 @@ export default {
{ value: false, label: '未启用' },
],
filters: {
cityIds: [],
provinceIds: [],
equipmentNo: '',
plateNo: '',
channel: '',
......@@ -97,10 +168,110 @@ export default {
},
mounted() {},
created() {
this.dialogVisible = sessionStorage.getItem('modifyPasswordStatus') == 0;
const searchVal = sessionStorage.getItem('overviewSearchVal');
if (searchVal) {
this.filters = JSON.parse(searchVal);
}
if (this.filters.provinceIds.length > 0) {
this.getCityOptions();
}
// this.getCurrentDate();
this.getAllCapitals();
this.queryAllProvinceByPermission();
this.changeFavicon(localStorage.getItem('provinceId'));
/* this.awaitDemo(); */
},
methods: {
/* sleep(second) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(' enough sleep~');
}, second);
});
},
normalFunc() {
console.log('normalFunc');
},
async awaitDemo() {
await this.normalFunc();
console.log('something, ~~');
const result = await this.sleep(2000);
console.log(result);// 两秒之后会被打印出来
},
*/
changeFavicon(provinceId) {
const $favicon = document.querySelector('link[rel="icon"]');
// If a <link rel="icon"> element already exists,
// change its href to the given link.
if ($favicon !== null) {
if (provinceId == 239) {
$favicon.href = 'favicon_guangxi.ico';
} else if (provinceId == 1 && Cookies.get('id') == 9) {
$favicon.href = 'favicon_zhongguo.ico';
} else {
$favicon.href = 'favicon.ico';
}
// Otherwise, create a new element and append it to <head>.
}
},
handleClose() {
sessionStorage.removeItem('modifyPasswordStatus');
this.dialogVisible = false;
},
goModifyPass() {
sessionStorage.removeItem('modifyPasswordStatus');
this.$router.push({
name: 'resetPassword',
params: {
},
});
},
queryAllProvinceByPermission() {
axios
.post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.provinceOptions = response.data.data;
}
}
})
.catch((error) => {
console.log(error);
});
},
queryCityByProvince(provinceId) {
axios
.post(`${address}selectAllAreasByLevelByParent`, {
parentIds: provinceId,
})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.cityOptions = response.data.data;
this.cityOptions.forEach((e) => {
e.name += '管理处';
});
}
}
})
.catch((error) => {
console.log(error);
});
},
getCityOptions() {
this.cityOptions = [];
if (this.filters.provinceIds.length > 0) {
this.queryCityByProvince(this.filters.provinceIds);
}
},
setUpFont({
row, column, rowIndex, columnIndex,
}) {
......@@ -113,6 +284,8 @@ export default {
this.$router.push({
name: 'detail',
params: {
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
capitalName: row.name,
},
});
......@@ -196,16 +369,33 @@ export default {
console.log(this.currentPage); // 点击第几页
},
getAllCapitals() {
const roles = JSON.parse(localStorage.getItem('permission'));
const permissionRoles = [permission.provincePermission];
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (hasPermission && this.filters.provinceIds.length == 0) {
return;
}
this.searchLoading = true;
sessionStorage.setItem(
'overviewSearchVal',
JSON.stringify(this.filters),
);
axios
.post(`${address}getAllCapitals`, {})
.post(`${address}getAllCapitals`, {
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
})
.then((response) => {
if (response.data.code === 200) {
this.searchLoading = false;
this.tableData = [];
this.no = 0;
this.tableId = 0;
if (response.data.data) {
/* console.log(`llllll${JSON.stringify(response.data.data)}`); */
const capitals = response.data.data;
this.office = response.data.data.office;
const capitals = response.data.data.sdServices;
this.totalnum = capitals.length;
const capitalTypeMap = new Map();
const capitalNameMap = new Map();
......@@ -269,11 +459,11 @@ export default {
}
this.tableData.push(tableItem);
}
/* console.log(`llllllll${JSON.stringify(this.tableData)}`); */
}
}
})
.catch((error) => {
this.searchLoading = false;
console.log(error);
});
},
......
......@@ -7,6 +7,7 @@
</div>
<div class="formBody">
<h1 class="section-title" data-i18n-text>注册账户</h1>
<el-form
:model="ruleForm2"
status-icon
......@@ -15,8 +16,13 @@
label-width="120px"
class="demo-ruleForm"
>
<el-form-item label="手机号" prop="user">
<el-input v-model="ruleForm2.user" placeholder="请输入手机号"></el-input>
<input type="text" style="display: none;" >
<input type="password" style="display: none;" >
<el-form-item label="用户名" prop="user">
<el-input v-model="ruleForm2.user" placeholder="请输入用户名"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phoneNum">
<el-input v-model="ruleForm2.phoneNum" placeholder="请输入手机号"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="realName">
<el-input v-model="ruleForm2.realName" placeholder="请输入姓名"></el-input>
......@@ -43,6 +49,7 @@
clearable
filterable
placeholder="请选择市区"
autocomplete="new-password"
>
<el-option
v-for="item in cityOptions"
......@@ -56,10 +63,10 @@
</el-form-item>
<el-form-item label="密码" prop="pass">
<el-input type="password" v-model="ruleForm2.pass" autocomplete="off"></el-input>
<el-input type="password" v-model="ruleForm2.pass" auto-complete="new-password" ></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input type="password" v-model="ruleForm2.checkPass" autocomplete="off"></el-input>
<el-input type="password" v-model="ruleForm2.checkPass" auto-complete="new-password" ></el-input>
</el-form-item>
<el-form-item style="text-align: center ;margin-left:-120px">
......@@ -103,6 +110,7 @@ export default {
provinceOptions: [],
cityOptions: [],
ruleForm2: {
phoneNum: '',
provinceId: '',
cityId: '',
realName: '',
......@@ -119,16 +127,21 @@ export default {
{ validator: validatePass2, trigger: 'blur' },
{ min: 6, message: '密码长度最少为6位', trigger: 'blur' },
],
user: [{ required: true, message: '请输入手机号', trigger: 'blur' },
user: [{ required: true, message: '请输入用户名', trigger: 'blur' },
],
phoneNum: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
min: 11, max: 11, message: '请输入11位手机号码', trigger: 'blur',
min: 11, max: 11, message: '请输入11位用户名', trigger: 'blur',
},
{ validator: this.isAuth, trigger: 'blur' },
{
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
message: '请输入正确的手机号码',
message: '请输入正确的用户名',
trigger: 'blur',
},
{ validator: this.isAuth, trigger: 'blur' }],
],
},
};
......@@ -140,7 +153,7 @@ export default {
isAuth(rule, value, callback) {
axios
.post(`${address}getUserAuthInfoByUserName`, {
username: this.ruleForm2.user,
username: this.ruleForm2.phoneNum,
}).then((res) => {
// eslint-disable-next-line eqeqeq
if (res.data.code != 200) {
......@@ -154,14 +167,17 @@ export default {
},
getCityOptions() {
this.cityOptions = [];
if (this.ruleForm2.provinceId) {
this.queryCityByProvince(this.ruleForm2.provinceId);
}
},
queryCityByProvince(provinceId) {
const parentIds = [];
parentIds.push(provinceId);
axios
.post(`${address}selectAllAreasByLevelByParent`, {
parentId: provinceId,
parentIds,
})
.then((response) => {
if (response.data.code === 200) {
......@@ -208,12 +224,13 @@ export default {
console.log(this.ruleForm2.user + this.ruleForm2.pass);
axios
.post(`${address}register`, {
phoneNum: this.ruleForm2.phoneNum,
username: this.ruleForm2.user,
password: this.ruleForm2.pass,
status: 1,
cityId:this.ruleForm2.cityId,
provinceId:this.ruleForm2.provinceId,
realName:this.ruleForm2.realName,
cityId: this.ruleForm2.cityId,
provinceId: this.ruleForm2.provinceId,
realName: this.ruleForm2.realName,
})
.then((response) => {
if (response.data.code === 200) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,46 @@
<!--搜索栏-->
<el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters">
<el-form-item
v-permission="[permission.provincePermission]">
<el-select
@change="getCityOptions"
v-model="filters.provinceIds"
style="width:260px"
multiple
collapse-tags
clearable
filterable
placeholder="请选择省份"
>
<el-option
v-for="item in provinceOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
v-permission="[permission.provincePermission]">
<el-select
v-model="filters.cityIds"
multiple
collapse-tags
style="width:260px"
clearable
filterable
placeholder="请选择管理处"
>
<el-option
v-for="item in cityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="filters.equipment"
......@@ -98,11 +138,15 @@ import axios from 'axios';
import { Message } from 'element-ui';
import moment from 'moment';
import { address, videoAddress } from '../config';
import { permission } from '../permission';
export default {
name: 'video',
data() {
return {
permission,
provinceOptions: [],
cityOptions: [],
plateNoOptions: [],
searchData: [],
tableData: [],
......@@ -114,6 +158,8 @@ export default {
totalCount: 0,
},
filters: {
cityIds: [],
provinceIds: [],
equipment: [],
dateTime: [],
},
......@@ -173,9 +219,9 @@ export default {
},
mounted() {},
created() {
this.queryAllProvinceByPermission();
this.queryAllEquipment();
const searchVal = sessionStorage.getItem('videoSearchVal');
const searchVal = localStorage.getItem('videoSearchVal');
const that = this;
if (this.$route.params.startTime) {
that.startTime = this.$route.params.startTime;
......@@ -196,9 +242,60 @@ export default {
this.filters = JSON.parse(searchVal);
}
if (this.filters.dateTime.length == 0) {
this.filters.dateTime[0] = `${moment(
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24),
).format('YYYY-MM-DD')} 00:00:00`;
this.filters.dateTime[1] = `${moment(
new Date().setTime(new Date().getTime() - 3600 * 1000 * 24),
).format('YYYY-MM-DD')} 23:59:59`;
}
if (this.filters.provinceIds.length>0) {
this.getCityOptions();
}
this.getParkVideos();
},
methods: {
queryAllProvinceByPermission() {
axios
.post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.provinceOptions = response.data.data;
}
}
})
.catch((error) => {
console.log(error);
});
},
queryCityByProvince(provinceId) {
axios
.post(`${address}selectAllAreasByLevelByParent`, {
parentIds: provinceId,
})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
this.cityOptions = response.data.data;
this.cityOptions.forEach((e) => {
e.name += '管理处';
});
}
}
})
.catch((error) => {
console.log(error);
});
},
getCityOptions() {
this.cityOptions = [];
if (this.filters.provinceIds.length>0) {
this.queryCityByProvince(this.filters.provinceIds);
}
},
playVideos(item) {
const videoUrl = videoAddress + item.filePath;
this.playerOptions.sources[0].src = videoUrl;
......@@ -228,7 +325,7 @@ export default {
Message({
message: response.data.message,
duration: 3 * 1000,
type: 'error',
type: 'error',
// duration: '800',
});
}
......@@ -238,6 +335,12 @@ export default {
});
},
getParkVideos() {
const roles = JSON.parse(localStorage.getItem('permission'));
const permissionRoles = [permission.provincePermission];
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (hasPermission && this.filters.provinceIds.length == 0 && this.filters.equipment.length == 0) {
return;
}
if (this.filters.dateTime) {
// eslint-disable-next-line eqeqeq
if (this.filters.dateTime.length == 0) {
......@@ -257,10 +360,13 @@ export default {
} else {
this.$message.info('请选择时间');
}
localStorage.setItem('videoSearchVal', JSON.stringify(this.filters));
this.searchLoading = true;
const that = this;
axios
.post(`${address}getParkVideos`, {
cityIds: this.filters.cityIds,
provinceIds: this.filters.provinceIds,
startTime: this.filters.dateTime[0],
endTime: this.filters.dateTime[1],
equipment: that.filters.equipment,
......
......@@ -18,7 +18,7 @@
<el-table-column width="240" label="车身照片" prop="images" align="center">
<template slot-scope="scope">
<img v-for="(item,index) in scope.row.images"
<img v-for="(item,index) in scope.row.images" @click="showBigPicture(item)"
:key="index"
:src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/>
......@@ -77,7 +77,7 @@
<el-table-column width="240" label="车身照片" prop="images" align="center">
<template slot-scope="scope">
<img v-for="(item,index) in scope.row.images"
<img v-for="(item,index) in scope.row.images" @click="showBigPicture(item)"
:key="index"
:src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/>
......@@ -144,6 +144,11 @@
<el-button type="primary" @click="isShowDialog = false">取消</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="isShowPicture" custom-class="customWidth" width="900px" >
<img :src="bigImgUrl" ref="BGIMG" style="height:500px;width:860px" />
</el-dialog>
</div>
</template>
......@@ -162,6 +167,8 @@ export default {
name: 'equipmentCheck',
data() {
return {
bigImgUrl: '',
isShowPicture: false,
thisPhotoAddress: photoAddress,
rejectReason: '',
operateOptions: [{
......@@ -195,6 +202,10 @@ export default {
this.queryAllEquipment();
},
methods: {
showBigPicture(row) {
this.bigImgUrl = photoAddress + row.filePath;
this.isShowPicture = true;
},
doCheckReject() {
if (this.rejectReason) {
this.checkFail(this.checkFailId, this.rejectReason);
......@@ -266,7 +277,7 @@ export default {
type: 'success',
dangerouslyUseHTMLString: true,
showClose: true,
duration:3000,
duration: 3000,
message: '驳回成功',
});
this.queryAllEquipment();
......@@ -298,7 +309,7 @@ export default {
type: 'success',
dangerouslyUseHTMLString: true,
showClose: true,
duration:3000,
duration: 3000,
message: '审核成功',
});
this.queryAllEquipment();
......@@ -341,7 +352,7 @@ export default {
Message({
message: response.data.message,
duration: 3 * 1000,
type: 'error',
type: 'error',
// duration: '800',
});
}
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
<el-form-item label="手机号:" prop="phoneNum">
<el-input placeholder="请输入手机号" style="width:325px"
<el-input placeholder="请输入手机号" style="width:325px"
v-model="createForm.phoneNum" clearable />
</el-form-item>
......@@ -108,13 +108,13 @@ export default {
rules: {
phoneNum: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur',
min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur',
},
{
pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
message: '请输入正确的手机号',
message: '请输入正确的手机号',
trigger: 'blur',
},
],
......@@ -159,7 +159,7 @@ export default {
},
queryAllProvince() {
axios
.post(`${address}selectAllAreasByLevelByParent`, {})
.post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => {
if (response.data.code === 200) {
if (response.data.data) {
......
......@@ -5,6 +5,7 @@
<el-form :inline="true" :model="filters">
<el-form-item>
<el-select
v-permission="[permission.provincePermission]"
@change="getCityOptions"
v-model="filters.provinceIds"
style="width:160px"
......@@ -24,6 +25,7 @@
</el-form-item>
<el-form-item>
<el-select
v-permission="[permission.provincePermission]"
v-model="filters.cityIds"
multiple
collapse-tags
......@@ -41,7 +43,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-input placeholder="请输入手机号码" style="width:160px"
<el-input placeholder="请输入用户名" style="width:160px"
v-model="filters.phoneNum" clearable />
</el-form-item>
<el-form-item>
......@@ -134,7 +136,9 @@
align="center"></el-table-column>
<el-table-column width="100" label="市" prop="cityStr"
align="center"></el-table-column>
<el-table-column width="160" label="手机号" prop="userName"
<el-table-column width="160" label="用户名" prop="userName"
align="center"></el-table-column>
<el-table-column width="160" label="手机号" prop="phoneNum"
align="center"></el-table-column>
<el-table-column width="160" label="创建人" prop="createByStr"
align="center"></el-table-column>
......@@ -316,7 +320,7 @@ export default {
const tHeader = [
'省',
'市',
'手机号',
'用户名',
'创建人',
'创建时间',
'状态',
......@@ -342,7 +346,7 @@ export default {
},
getCityOptions() {
this.cityOptions = [];
if (this.filters.provinceIds) {
if (this.filters.provinceIds.length>0) {
this.queryCityByProvince(this.filters.provinceIds);
}
},
......@@ -443,8 +447,9 @@ export default {
this.tableData = response.data.data.list;
this.tableData.forEach((e) => {
const reg = /^(\d{3})\d{4}(\d{4})$/;
e.userName = e.userName.replace(reg, '$1****$2');
if (e.phoneNum) {
e.phoneNum = e.phoneNum.replace(reg, '$1****$2');
}
});
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment