Commit 4e10ae55 authored by wangxiaoming's avatar wangxiaoming

平台修改 维护

parent 858179d4
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>巡检平台</title> <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"> <script type="text/javascript">
...@@ -27,4 +27,5 @@ ...@@ -27,4 +27,5 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
This diff is collapsed.
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
console.log("liveUrl"+url); console.log("liveUrl"+url);
//"webrtc://152.136.233.116/live/livestream" //"webrtc://152.136.233.116/live/livestream"
var urlObject = parse_rtmp_url(url); var urlObject = parse_rtmp_url(url);
/*urlObject*/
var schema = window.location.protocol; var schema = window.location.protocol;
// Close PC when user replay. // Close PC when user replay.
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
return pc.setLocalDescription(offer).then(function(){ return offer; }); return pc.setLocalDescription(offer).then(function(){ return offer; });
}).then(function(offer) { }).then(function(offer) {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
var port = urlObject.port || 1985; var port = 1985;
// @see https://github.com/rtcdn/rtcdn-draft // @see https://github.com/rtcdn/rtcdn-draft
var api = urlObject.user_query.play || '/rtc/v1/play/'; var api = urlObject.user_query.play || '/rtc/v1/play/';
...@@ -94,7 +95,7 @@ ...@@ -94,7 +95,7 @@
} }
// Replace /rtc/v1/play/&k=v to /rtc/v1/play/?k=v // Replace /rtc/v1/play/&k=v to /rtc/v1/play/?k=v
url = url.replace(api + '&', api + '?'); url = url.replace(api + '&', api + '?');
url=url.replace('https', 'http');
// @see https://github.com/rtcdn/rtcdn-draft // @see https://github.com/rtcdn/rtcdn-draft
var data = { var data = {
api: url, streamurl: urlObject.url, clientip: null, sdp: offer.sdp api: url, streamurl: urlObject.url, clientip: null, sdp: offer.sdp
...@@ -102,7 +103,7 @@ ...@@ -102,7 +103,7 @@
console.log("Generated offer: ", data); console.log("Generated offer: ", data);
$.ajax({ $.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' contentType:'application/json', dataType: 'json'
}).done(function(data) { }).done(function(data) {
console.log("Got answer: ", 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 address = '/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000'; const videoAddress = 'https://xj.roadgrids.com';
const photoAddress = 'http://106.52.130.113:8000'; const photoAddress = 'https://xj.roadgrids.com';
const imgAddress = '/roadlinks/';// 测试环境 const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台'; const title = '道路综合巡检平台';
export { export {
address, photoAddress, imgAddress, videoAddress, address, photoAddress, imgAddress, videoAddress,
}; };
...@@ -2,7 +2,7 @@ const address = '/roadlinks/'; ...@@ -2,7 +2,7 @@ const address = '/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000'; const videoAddress = 'http://106.52.130.113:8000';
const photoAddress = 'http://106.52.130.113:8000'; const photoAddress = 'http://106.52.130.113:8000';
const imgAddress = '/roadlinks/';// 测试环境 const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台'; const title = '道路综合巡检平台';
export { export {
address, photoAddress, imgAddress, videoAddress, address, photoAddress, imgAddress, videoAddress,
}; };
const address = '/roadlinks/'; const address = 'http://localhost:8088/roadlinks/';
const videoAddress = 'http://106.52.130.113:8000'; const videoAddress = 'https://xj.roadgrids.com';
const photoAddress = 'http://106.52.130.113:8000'; const photoAddress = 'https://xj.roadgrids.com';
const imgAddress = '/roadlinks/';// 测试环境 const imgAddress = '/roadlinks/';// 测试环境
const title = '安徽省道路综合巡检平台'; const title = '道路综合巡检平台';
export { export {
address, photoAddress, imgAddress, videoAddress, 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, { ...@@ -32,12 +32,28 @@ Vue.use(BaiduMap, {
Object.defineProperty(Vue.prototype, '$moment', { value: moment }); Object.defineProperty(Vue.prototype, '$moment', { value: moment });
Object.defineProperty(Vue.prototype, '$_', { value: _ }); 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; Vue.config.productionTip = false;
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
window.scrollTo(0, 0); window.scrollTo(0, 0);
if (to.matched.some(record => record.meta.requireAuth)) { if (to.matched.some(record => record.meta.requireAuth)) {
// 判断该路由是否需要登录权限 // 判断该路由是否需要登录权限
if (Cookies.get('id')) { // 判断当前的token是否存在 if (Cookies.get('id')) { // 判断当前的token是否存在
if (_hmt) {
if (to.path) {
_hmt.push(['_trackPageview', `/#${to.fullPath}`]);
}
}
next(); next();
} else { } else {
// next(); // next();
...@@ -55,7 +71,7 @@ axios.interceptors.request.use( ...@@ -55,7 +71,7 @@ axios.interceptors.request.use(
(config) => { (config) => {
config.baseURL = '/'; config.baseURL = '/';
config.withCredentials = true; // 允许携带token ,这个是解决跨域产生的相关问题 config.withCredentials = true; // 允许携带token ,这个是解决跨域产生的相关问题
config.timeout = 6000; config.timeout = 60000;
const token = Cookies.get('id'); const token = Cookies.get('id');
if (token) { if (token) {
config.headers = { config.headers = {
...@@ -84,7 +100,8 @@ const permission = { ...@@ -84,7 +100,8 @@ const permission = {
const roles = JSON.parse(localStorage.getItem('permission')); const roles = JSON.parse(localStorage.getItem('permission'));
if (value && value instanceof Array && value.length > 0) { if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value; const permissionRoles = value;
const hasPermission = roles.some(role => permissionRoles.includes(role));
const hasPermission = roles ? roles.some(role => permissionRoles.includes(role)) : false;
if (!hasPermission) { if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el); el.parentNode && el.parentNode.removeChild(el);
} }
......
...@@ -5,6 +5,9 @@ const permission = { ...@@ -5,6 +5,9 @@ const permission = {
userAuthorization: '004', userAuthorization: '004',
equipmentList_edit: '002.001', equipmentList_edit: '002.001',
userManagement_edit: '003.001', userManagement_edit: '003.001',
resultCheck_edit: '005.001',
provincePermission: '2',
cityPermission: '3',
}; };
export { export {
permission, permission,
......
...@@ -7,6 +7,46 @@ ...@@ -7,6 +7,46 @@
<!--搜索栏--> <!--搜索栏-->
<el-col :span="24" class="toolbar"> <el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters"> <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-form-item>
<el-select <el-select
v-model="filters.capitalType" v-model="filters.capitalType"
...@@ -30,7 +70,7 @@ ...@@ -30,7 +70,7 @@
></el-autocomplete>--> ></el-autocomplete>-->
</el-form-item> </el-form-item>
<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-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -44,6 +84,7 @@ ...@@ -44,6 +84,7 @@
:highlight-current-row="true" :highlight-current-row="true"
> >
<el-table-column label="序号" prop="no"></el-table-column> <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="name"></el-table-column>
<el-table-column label="道路资产位置信息" prop="position"></el-table-column> <el-table-column label="道路资产位置信息" prop="position"></el-table-column>
</el-table> </el-table>
...@@ -74,13 +115,20 @@ import { Message } from 'element-ui'; ...@@ -74,13 +115,20 @@ import { Message } from 'element-ui';
import echarts from 'echarts'; import echarts from 'echarts';
import moment from 'moment'; import moment from 'moment';
import { address, photoAddress } from '../config'; import { address, photoAddress } from '../config';
import { permission } from '../permission';
export default { export default {
name: 'detail', name: 'detail',
data() { data() {
return { return {
searchLoading: false,
permission,
provinceOptions: [],
cityOptions: [],
tableData: [], tableData: [],
filters: { filters: {
cityIds: [],
provinceIds: [],
capitalType: [], capitalType: [],
}, },
showCol: false, showCol: false,
...@@ -94,14 +142,68 @@ export default { ...@@ -94,14 +142,68 @@ export default {
}, },
mounted() {}, mounted() {},
created() { 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 = []; this.filters.capitalType = [];
if (this.$route.params.capitalName) { if (this.$route.params.capitalName) {
this.filters.capitalType.push(this.$route.params.capitalName); this.filters.capitalType.push(this.$route.params.capitalName);
} }
this.getCapitalDetails(); this.getCapitalDetails();
this.getAllCapitals(); this.getAllCapitals();
this.queryAllProvinceByPermission();
}, },
methods: { 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) { linkPic(index, row) {
this.getCurrentDate(); this.getCurrentDate();
const photoDate = row.finalOnlineTime const photoDate = row.finalOnlineTime
...@@ -235,8 +337,8 @@ export default { ...@@ -235,8 +337,8 @@ export default {
if (response.data.code === 200) { if (response.data.code === 200) {
this.capitalOptions = []; this.capitalOptions = [];
if (response.data.data) { if (response.data.data) {
/* console.log(response.data.data);*/ /* console.log(response.data.data); */
const capitals = response.data.data; const capitals = response.data.data.sdServices;
const nameSet = new Set(); const nameSet = new Set();
capitals.forEach((val) => { capitals.forEach((val) => {
nameSet.add(val.capitalName); nameSet.add(val.capitalName);
...@@ -254,6 +356,12 @@ export default { ...@@ -254,6 +356,12 @@ export default {
}); });
}, },
getCapitalDetails() { 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; this.currentPage = 1;
let capitalName = ''; let capitalName = '';
if (this.filters.capitalType) { if (this.filters.capitalType) {
...@@ -265,12 +373,21 @@ export default { ...@@ -265,12 +373,21 @@ export default {
} }
}); });
} }
this.searchLoading = true;
sessionStorage.setItem(
'detailSearchVal',
JSON.stringify(this.filters),
);
axios axios
.post(`${address}getCapitalDetails`, { .post(`${address}getCapitalDetails`, {
capitalName, capitalName,
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
}) })
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
this.searchLoading = false;
this.tableData = []; this.tableData = [];
this.no = 0; this.no = 0;
if (response.data.data) { if (response.data.data) {
...@@ -286,6 +403,7 @@ export default { ...@@ -286,6 +403,7 @@ export default {
nameMap.set(val.capitalName, num); nameMap.set(val.capitalName, num);
} }
this.tableData.push({ this.tableData.push({
office: val.office,
no: ++this.no, no: ++this.no,
name: val.capitalName + num, name: val.capitalName + num,
position: val.position, position: val.position,
...@@ -295,6 +413,7 @@ export default { ...@@ -295,6 +413,7 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
this.searchLoading = false;
console.log(error); console.log(error);
}); });
}, },
......
...@@ -13,9 +13,16 @@ ...@@ -13,9 +13,16 @@
<div v-if="provinceId ==109"> <div v-if="provinceId ==109">
<img style="width:100px;height:80px" src="../assets/logo_anhui.png" alt /> <img style="width:100px;height:80px" src="../assets/logo_anhui.png" alt />
</div> </div>
<div v-else-if="provinceId != 109"> <div v-else-if="provinceId == 239">
<img style="width:100px;height:80px" src="../assets/logo_new.png" alt /> <img style="width:100px;height:100px" src="../assets/logo_guangxi.png" alt />
</div> </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> </div>
<el-submenu index="1"> <el-submenu index="1">
...@@ -94,7 +101,7 @@ ...@@ -94,7 +101,7 @@
</el-menu-item> </el-menu-item>
</el-submenu> </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> <span slot="title" class="submenu_parent" >&nbsp;&nbsp;账户管理&nbsp;&nbsp;</span>
<el-menu-item <el-menu-item
v-permission="[permission.userManagement]" v-permission="[permission.userManagement]"
...@@ -112,13 +119,13 @@ ...@@ -112,13 +119,13 @@
> >
<span slot="title" style="font-size: 16px">授权账户</span> <span slot="title" style="font-size: 16px">授权账户</span>
</el-menu-item> </el-menu-item>
<!-- <el-menu-item <el-menu-item
index="6-3" index="6-3"
@click="goTo('/resetPassword')" @click="goTo('/resetPassword')"
style="background:#252639 !important" style="background:#252639 !important"
> >
<span slot="title" style="font-size: 16px">修改密码</span> <span slot="title" style="font-size: 16px">修改密码</span>
</el-menu-item>--> </el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
......
...@@ -6,6 +6,45 @@ ...@@ -6,6 +6,45 @@
<!--搜索栏--> <!--搜索栏-->
<el-col :span="24" class="toolbar"> <el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters"> <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-form-item>
<el-select <el-select
v-model="filters.equipment" v-model="filters.equipment"
...@@ -60,8 +99,8 @@ ...@@ -60,8 +99,8 @@
</div> </div>
</div> </div>
<el-dialog :visible.sync="isShowVideo" width="1000px" height="5900px"> <el-dialog :visible.sync="isShowVideo" width="760px" height="550px">
<iframe style="width:100%;height:600px" id="live" :src=playerSrc></iframe> <iframe style="width:100%;height:580px" id="live" :src=playerSrc></iframe>
<!-- <video-player <!-- <video-player
@play="onPlayerPlay($event)" @play="onPlayerPlay($event)"
...@@ -105,11 +144,15 @@ import 'video.js/dist/video-js.css'; ...@@ -105,11 +144,15 @@ import 'video.js/dist/video-js.css';
import 'vue-video-player/src/custom-theme.css'; import 'vue-video-player/src/custom-theme.css';
import 'videojs-flash'; import 'videojs-flash';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { permission } from '../permission';
export default { export default {
name: 'video', name: 'video',
data() { data() {
return { return {
permission,
provinceOptions: [],
cityOptions: [],
playerSrc: '', playerSrc: '',
isShowTip: false, isShowTip: false,
plateNoOptions: [], plateNoOptions: [],
...@@ -123,6 +166,8 @@ export default { ...@@ -123,6 +166,8 @@ export default {
totalCount: 0, totalCount: 0,
}, },
filters: { filters: {
cityIds: [],
provinceIds: [],
equipment: [], equipment: [],
}, },
loading: false, loading: false,
...@@ -174,8 +219,8 @@ export default { ...@@ -174,8 +219,8 @@ export default {
}, },
timer: '', timer: '',
liveUrl: 'webrtc://152.136.233.116/live/', liveUrl: 'webrtc://146.56.198.18:8080/live/',
liveIp: '?eip=152.136.233.116', liveIp: '?eip=146.56.198.18',
}; };
}, },
watch: { watch: {
...@@ -189,8 +234,9 @@ export default { ...@@ -189,8 +234,9 @@ export default {
this.timer = setInterval(this.watchLive, 10000); this.timer = setInterval(this.watchLive, 10000);
}, },
created() { created() {
this.queryAllProvinceByPermission();
this.queryAllEquipment(); this.queryAllEquipment();
const searchVal = sessionStorage.getItem('videoSearchVal'); const searchVal = sessionStorage.getItem('liveSearchVal');
const that = this; const that = this;
if (this.$route.params.startTime) { if (this.$route.params.startTime) {
...@@ -211,10 +257,62 @@ export default { ...@@ -211,10 +257,62 @@ export default {
} else if (searchVal) { } else if (searchVal) {
this.filters = JSON.parse(searchVal); this.filters = JSON.parse(searchVal);
} }
if (this.filters.provinceIds.length > 0) {
this.getCityOptions();
}
this.getParkVideos(); this.getParkVideos();
this.getLiveUrl();
}, },
methods: { 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() { liveStop() {
this.playerOptions.sources[0].src = ''; this.playerOptions.sources[0].src = '';
axios axios
...@@ -314,9 +412,10 @@ export default { ...@@ -314,9 +412,10 @@ export default {
if (response.data.data && response.data.data.length > 0) { if (response.data.data && response.data.data.length > 0) {
const channelAndDevid = `${item.code}_${item.channelCode}`; const channelAndDevid = `${item.code}_${item.channelCode}`;
const random = Math.random(); 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}DefaultstringE3060400FFFBEBBF_zjhn${this.liveIp}&random=${random}`;
this.playerSrc = `players/rtc_player.html?url=${this.liveUrl}${channelAndDevid}${this.liveIp}&random=${random}`; this.playerSrc = `players/rtc_player.html?url=${this.liveUrl}${channelAndDevid}${this.liveIp}&random=${random}`;
/* const channel = item.channelCode; /* const channel = item.channelCode;
const devid = item.code; const devid = item.code;
const src = `http://152.136.233.116:1965/live/${devid}_${channel}.m3u8`; const src = `http://152.136.233.116:1965/live/${devid}_${channel}.m3u8`;
...@@ -355,7 +454,7 @@ export default { ...@@ -355,7 +454,7 @@ export default {
Message({ Message({
message: response.data.message, message: response.data.message,
duration: 3 * 1000, duration: 3 * 1000,
type: 'error', type: 'error',
// duration: '800', // duration: '800',
}); });
} }
...@@ -366,13 +465,23 @@ export default { ...@@ -366,13 +465,23 @@ export default {
}, },
getParkVideos() { 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; this.searchLoading = true;
const that = this; const that = this;
sessionStorage.setItem('liveSearchVal', JSON.stringify(this.filters));
axios axios
.post(`${address}getParkLives`, { .post(`${address}getParkLives`, {
cityIds: that.filters.cityIds,
provinceIds: that.filters.provinceIds,
equipment: that.filters.equipment, equipment: that.filters.equipment,
pageIndex: this.pageOption.pageIndex, pageIndex: that.pageOption.pageIndex,
pageSize: this.pageOption.pageSize, pageSize: that.pageOption.pageSize,
}) })
.then((response) => { .then((response) => {
that.searchLoading = false; that.searchLoading = false;
......
...@@ -14,20 +14,20 @@ ...@@ -14,20 +14,20 @@
> >
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
auto-complete="new-password"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
v-model="loginForm.username" v-model="loginForm.username"
auto-complete="off" placeholder="请输入用户名"
placeholder="请输入手机号"
> >
<i slot="prefix" class="elxingmingyonghumingnicheng"></i> <i slot="prefix" class="elxingmingyonghumingnicheng"></i>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input
auto-complete="new-password"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
:type="passwordType" :type="passwordType"
v-model="loginForm.password" v-model="loginForm.password"
auto-complete="off"
placeholder="请输入密码" placeholder="请输入密码"
> >
<i <i
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
...@@ -84,7 +86,7 @@ export default { ...@@ -84,7 +86,7 @@ export default {
loginRules: { loginRules: {
// 绑定在form表单中的验证规则 // 绑定在form表单中的验证规则
username: [ username: [
{ required: true, message: '请输入手机号', trigger: 'blur' }, { required: true, message: '请输入用户名', trigger: 'blur' },
{ validator: this.isExists, trigger: 'blur' }, { validator: this.isExists, trigger: 'blur' },
], ],
...@@ -104,6 +106,21 @@ export default { ...@@ -104,6 +106,21 @@ export default {
computed: {}, computed: {},
props: [], props: [],
methods: { 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) { isExists(rule, value, callback) {
axios axios
.post(`${address}getUserInfoByUserName`, { .post(`${address}getUserInfoByUserName`, {
...@@ -111,12 +128,12 @@ export default { ...@@ -111,12 +128,12 @@ export default {
}).then((res) => { }).then((res) => {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (res.data.code != 200) { if (res.data.code != 200) {
callback(new Error('手机号不存在')); callback(new Error('用户名不存在'));
} else { } else {
callback(); callback();
} }
}).catch(() => { }).catch(() => {
callback(new Error('手机号不存在')); callback(new Error('用户名不存在'));
}); });
}, },
// 跳转到home页 // 跳转到home页
...@@ -142,6 +159,8 @@ export default { ...@@ -142,6 +159,8 @@ export default {
? (this.passwordType = 'password') ? (this.passwordType = 'password')
: (this.passwordType = ''); : (this.passwordType = '');
}, },
// 点击登入按钮 // 点击登入按钮
handleLogin() { handleLogin() {
this.$refs.loginForm.validate((valid) => { this.$refs.loginForm.validate((valid) => {
...@@ -154,13 +173,16 @@ export default { ...@@ -154,13 +173,16 @@ export default {
}) })
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
sessionStorage.clear();
Cookies.set('id', response.data.data.id); Cookies.set('id', response.data.data.id);
Cookies.set('username', this.loginForm.username); Cookies.set('username', this.loginForm.username);
Cookies.set('sessionId', response.data.data.sessionId); Cookies.set('sessionId', response.data.data.sessionId);
sessionStorage.setItem('modifyPasswordStatus', response.data.data.modifyStatus);
store.state.provinceId = response.data.data.provinceId; store.state.provinceId = response.data.data.provinceId;
store.state.permissionList = response.data.data.permissionList; store.state.permissionList = response.data.data.permissionList;
localStorage.setItem('permission', JSON.stringify(store.state.permissionList)); localStorage.setItem('permission', JSON.stringify(store.state.permissionList));
localStorage.setItem('provinceId', store.state.provinceId); localStorage.setItem('provinceId', store.state.provinceId);
this.changeFavicon(store.state.provinceId);
this.goToHome(); this.goToHome();
} else { } else {
Message({ Message({
......
<template> <template>
<div class="overview"> <div class="overview">
<div class="box"> <div class="box">
<el-row class="warp"> <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"> <div class="overview-table">
<el-table <el-table
...@@ -45,9 +94,22 @@ ...@@ -45,9 +94,22 @@
<h3>任务统计</h3> <h3>任务统计</h3>
<div class="echarts-box" id="echarts-box"></div> <div class="echarts-box" id="echarts-box"></div>
</div>--> </div>-->
</el-row>
</div> </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> </div>
</template> </template>
<script> <script>
...@@ -55,13 +117,20 @@ import axios from 'axios'; ...@@ -55,13 +117,20 @@ import axios from 'axios';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
import echarts from 'echarts'; import echarts from 'echarts';
import moment from 'moment'; import moment from 'moment';
import Cookies from 'js-cookie';
import { address } from '../config'; import { address } from '../config';
import { permission } from '../permission';
export default { export default {
name: 'overview', name: 'overview',
data() { data() {
return { return {
office: '淮南', dialogVisible: false,
permission,
searchLoading: false,
provinceOptions: [],
cityOptions: [],
office: '',
tableData: [], tableData: [],
typeData: [ typeData: [
{ value: 0, label: '全部' }, { value: 0, label: '全部' },
...@@ -74,6 +143,8 @@ export default { ...@@ -74,6 +143,8 @@ export default {
{ value: false, label: '未启用' }, { value: false, label: '未启用' },
], ],
filters: { filters: {
cityIds: [],
provinceIds: [],
equipmentNo: '', equipmentNo: '',
plateNo: '', plateNo: '',
channel: '', channel: '',
...@@ -97,10 +168,110 @@ export default { ...@@ -97,10 +168,110 @@ export default {
}, },
mounted() {}, mounted() {},
created() { 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.getCurrentDate();
this.getAllCapitals(); this.getAllCapitals();
this.queryAllProvinceByPermission();
this.changeFavicon(localStorage.getItem('provinceId'));
/* this.awaitDemo(); */
}, },
methods: { 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({ setUpFont({
row, column, rowIndex, columnIndex, row, column, rowIndex, columnIndex,
}) { }) {
...@@ -113,6 +284,8 @@ export default { ...@@ -113,6 +284,8 @@ export default {
this.$router.push({ this.$router.push({
name: 'detail', name: 'detail',
params: { params: {
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
capitalName: row.name, capitalName: row.name,
}, },
}); });
...@@ -196,16 +369,33 @@ export default { ...@@ -196,16 +369,33 @@ export default {
console.log(this.currentPage); // 点击第几页 console.log(this.currentPage); // 点击第几页
}, },
getAllCapitals() { 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 axios
.post(`${address}getAllCapitals`, {}) .post(`${address}getAllCapitals`, {
provinceIds: this.filters.provinceIds,
cityIds: this.filters.cityIds,
})
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
this.searchLoading = false;
this.tableData = []; this.tableData = [];
this.no = 0; this.no = 0;
this.tableId = 0; this.tableId = 0;
if (response.data.data) { if (response.data.data) {
/* console.log(`llllll${JSON.stringify(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; this.totalnum = capitals.length;
const capitalTypeMap = new Map(); const capitalTypeMap = new Map();
const capitalNameMap = new Map(); const capitalNameMap = new Map();
...@@ -269,11 +459,11 @@ export default { ...@@ -269,11 +459,11 @@ export default {
} }
this.tableData.push(tableItem); this.tableData.push(tableItem);
} }
/* console.log(`llllllll${JSON.stringify(this.tableData)}`); */
} }
} }
}) })
.catch((error) => { .catch((error) => {
this.searchLoading = false;
console.log(error); console.log(error);
}); });
}, },
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
</div> </div>
<div class="formBody"> <div class="formBody">
<h1 class="section-title" data-i18n-text>注册账户</h1> <h1 class="section-title" data-i18n-text>注册账户</h1>
<el-form <el-form
:model="ruleForm2" :model="ruleForm2"
status-icon status-icon
...@@ -15,8 +16,13 @@ ...@@ -15,8 +16,13 @@
label-width="120px" label-width="120px"
class="demo-ruleForm" class="demo-ruleForm"
> >
<el-form-item label="手机号" prop="user"> <input type="text" style="display: none;" >
<el-input v-model="ruleForm2.user" placeholder="请输入手机号"></el-input> <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>
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
<el-input v-model="ruleForm2.realName" placeholder="请输入姓名"></el-input> <el-input v-model="ruleForm2.realName" placeholder="请输入姓名"></el-input>
...@@ -43,6 +49,7 @@ ...@@ -43,6 +49,7 @@
clearable clearable
filterable filterable
placeholder="请选择市区" placeholder="请选择市区"
autocomplete="new-password"
> >
<el-option <el-option
v-for="item in cityOptions" v-for="item in cityOptions"
...@@ -56,10 +63,10 @@ ...@@ -56,10 +63,10 @@
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="pass"> <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>
<el-form-item label="确认密码" prop="checkPass"> <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>
<el-form-item style="text-align: center ;margin-left:-120px"> <el-form-item style="text-align: center ;margin-left:-120px">
...@@ -103,6 +110,7 @@ export default { ...@@ -103,6 +110,7 @@ export default {
provinceOptions: [], provinceOptions: [],
cityOptions: [], cityOptions: [],
ruleForm2: { ruleForm2: {
phoneNum: '',
provinceId: '', provinceId: '',
cityId: '', cityId: '',
realName: '', realName: '',
...@@ -119,16 +127,21 @@ export default { ...@@ -119,16 +127,21 @@ export default {
{ validator: validatePass2, trigger: 'blur' }, { validator: validatePass2, trigger: 'blur' },
{ min: 6, message: '密码长度最少为6位', 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}$/, 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', trigger: 'blur',
}, },
{ validator: this.isAuth, trigger: 'blur' }], ],
}, },
}; };
...@@ -140,7 +153,7 @@ export default { ...@@ -140,7 +153,7 @@ export default {
isAuth(rule, value, callback) { isAuth(rule, value, callback) {
axios axios
.post(`${address}getUserAuthInfoByUserName`, { .post(`${address}getUserAuthInfoByUserName`, {
username: this.ruleForm2.user, username: this.ruleForm2.phoneNum,
}).then((res) => { }).then((res) => {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (res.data.code != 200) { if (res.data.code != 200) {
...@@ -154,14 +167,17 @@ export default { ...@@ -154,14 +167,17 @@ export default {
}, },
getCityOptions() { getCityOptions() {
this.cityOptions = []; this.cityOptions = [];
if (this.ruleForm2.provinceId) { if (this.ruleForm2.provinceId) {
this.queryCityByProvince(this.ruleForm2.provinceId); this.queryCityByProvince(this.ruleForm2.provinceId);
} }
}, },
queryCityByProvince(provinceId) { queryCityByProvince(provinceId) {
const parentIds = [];
parentIds.push(provinceId);
axios axios
.post(`${address}selectAllAreasByLevelByParent`, { .post(`${address}selectAllAreasByLevelByParent`, {
parentId: provinceId, parentIds,
}) })
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
...@@ -208,12 +224,13 @@ export default { ...@@ -208,12 +224,13 @@ export default {
console.log(this.ruleForm2.user + this.ruleForm2.pass); console.log(this.ruleForm2.user + this.ruleForm2.pass);
axios axios
.post(`${address}register`, { .post(`${address}register`, {
phoneNum: this.ruleForm2.phoneNum,
username: this.ruleForm2.user, username: this.ruleForm2.user,
password: this.ruleForm2.pass, password: this.ruleForm2.pass,
status: 1, status: 1,
cityId:this.ruleForm2.cityId, cityId: this.ruleForm2.cityId,
provinceId:this.ruleForm2.provinceId, provinceId: this.ruleForm2.provinceId,
realName:this.ruleForm2.realName, realName: this.ruleForm2.realName,
}) })
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -6,6 +6,46 @@ ...@@ -6,6 +6,46 @@
<!--搜索栏--> <!--搜索栏-->
<el-col :span="24" class="toolbar"> <el-col :span="24" class="toolbar">
<el-form :inline="true" :model="filters"> <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-form-item>
<el-select <el-select
v-model="filters.equipment" v-model="filters.equipment"
...@@ -98,11 +138,15 @@ import axios from 'axios'; ...@@ -98,11 +138,15 @@ import axios from 'axios';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
import moment from 'moment'; import moment from 'moment';
import { address, videoAddress } from '../config'; import { address, videoAddress } from '../config';
import { permission } from '../permission';
export default { export default {
name: 'video', name: 'video',
data() { data() {
return { return {
permission,
provinceOptions: [],
cityOptions: [],
plateNoOptions: [], plateNoOptions: [],
searchData: [], searchData: [],
tableData: [], tableData: [],
...@@ -114,6 +158,8 @@ export default { ...@@ -114,6 +158,8 @@ export default {
totalCount: 0, totalCount: 0,
}, },
filters: { filters: {
cityIds: [],
provinceIds: [],
equipment: [], equipment: [],
dateTime: [], dateTime: [],
}, },
...@@ -173,9 +219,9 @@ export default { ...@@ -173,9 +219,9 @@ export default {
}, },
mounted() {}, mounted() {},
created() { created() {
this.queryAllProvinceByPermission();
this.queryAllEquipment(); this.queryAllEquipment();
const searchVal = sessionStorage.getItem('videoSearchVal'); const searchVal = localStorage.getItem('videoSearchVal');
const that = this; const that = this;
if (this.$route.params.startTime) { if (this.$route.params.startTime) {
that.startTime = this.$route.params.startTime; that.startTime = this.$route.params.startTime;
...@@ -196,9 +242,60 @@ export default { ...@@ -196,9 +242,60 @@ export default {
this.filters = JSON.parse(searchVal); 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(); this.getParkVideos();
}, },
methods: { 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) { playVideos(item) {
const videoUrl = videoAddress + item.filePath; const videoUrl = videoAddress + item.filePath;
this.playerOptions.sources[0].src = videoUrl; this.playerOptions.sources[0].src = videoUrl;
...@@ -228,7 +325,7 @@ export default { ...@@ -228,7 +325,7 @@ export default {
Message({ Message({
message: response.data.message, message: response.data.message,
duration: 3 * 1000, duration: 3 * 1000,
type: 'error', type: 'error',
// duration: '800', // duration: '800',
}); });
} }
...@@ -238,6 +335,12 @@ export default { ...@@ -238,6 +335,12 @@ export default {
}); });
}, },
getParkVideos() { 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) { if (this.filters.dateTime) {
// eslint-disable-next-line eqeqeq // eslint-disable-next-line eqeqeq
if (this.filters.dateTime.length == 0) { if (this.filters.dateTime.length == 0) {
...@@ -257,10 +360,13 @@ export default { ...@@ -257,10 +360,13 @@ export default {
} else { } else {
this.$message.info('请选择时间'); this.$message.info('请选择时间');
} }
localStorage.setItem('videoSearchVal', JSON.stringify(this.filters));
this.searchLoading = true; this.searchLoading = true;
const that = this; const that = this;
axios axios
.post(`${address}getParkVideos`, { .post(`${address}getParkVideos`, {
cityIds: this.filters.cityIds,
provinceIds: this.filters.provinceIds,
startTime: this.filters.dateTime[0], startTime: this.filters.dateTime[0],
endTime: this.filters.dateTime[1], endTime: this.filters.dateTime[1],
equipment: that.filters.equipment, equipment: that.filters.equipment,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-table-column width="240" label="车身照片" prop="images" align="center"> <el-table-column width="240" label="车身照片" prop="images" align="center">
<template slot-scope="scope"> <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" :key="index"
:src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/> :src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<el-table-column width="240" label="车身照片" prop="images" align="center"> <el-table-column width="240" label="车身照片" prop="images" align="center">
<template slot-scope="scope"> <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" :key="index"
:src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/> :src="thisPhotoAddress+item.smallFilePath" style="width: 70px"/>
...@@ -144,6 +144,11 @@ ...@@ -144,6 +144,11 @@
<el-button type="primary" @click="isShowDialog = false">取消</el-button> <el-button type="primary" @click="isShowDialog = false">取消</el-button>
</span> </span>
</el-dialog> </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> </div>
</template> </template>
...@@ -162,6 +167,8 @@ export default { ...@@ -162,6 +167,8 @@ export default {
name: 'equipmentCheck', name: 'equipmentCheck',
data() { data() {
return { return {
bigImgUrl: '',
isShowPicture: false,
thisPhotoAddress: photoAddress, thisPhotoAddress: photoAddress,
rejectReason: '', rejectReason: '',
operateOptions: [{ operateOptions: [{
...@@ -195,6 +202,10 @@ export default { ...@@ -195,6 +202,10 @@ export default {
this.queryAllEquipment(); this.queryAllEquipment();
}, },
methods: { methods: {
showBigPicture(row) {
this.bigImgUrl = photoAddress + row.filePath;
this.isShowPicture = true;
},
doCheckReject() { doCheckReject() {
if (this.rejectReason) { if (this.rejectReason) {
this.checkFail(this.checkFailId, this.rejectReason); this.checkFail(this.checkFailId, this.rejectReason);
...@@ -266,7 +277,7 @@ export default { ...@@ -266,7 +277,7 @@ export default {
type: 'success', type: 'success',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
showClose: true, showClose: true,
duration:3000, duration: 3000,
message: '驳回成功', message: '驳回成功',
}); });
this.queryAllEquipment(); this.queryAllEquipment();
...@@ -298,7 +309,7 @@ export default { ...@@ -298,7 +309,7 @@ export default {
type: 'success', type: 'success',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
showClose: true, showClose: true,
duration:3000, duration: 3000,
message: '审核成功', message: '审核成功',
}); });
this.queryAllEquipment(); this.queryAllEquipment();
...@@ -341,7 +352,7 @@ export default { ...@@ -341,7 +352,7 @@ export default {
Message({ Message({
message: response.data.message, message: response.data.message,
duration: 3 * 1000, duration: 3 * 1000,
type: 'error', type: 'error',
// duration: '800', // duration: '800',
}); });
} }
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<el-form-item label="手机号:" prop="phoneNum"> <el-form-item label="手机号:" prop="phoneNum">
<el-input placeholder="请输入手机号" style="width:325px" <el-input placeholder="请输入手机号" style="width:325px"
v-model="createForm.phoneNum" clearable /> v-model="createForm.phoneNum" clearable />
</el-form-item> </el-form-item>
...@@ -108,13 +108,13 @@ export default { ...@@ -108,13 +108,13 @@ export default {
rules: { rules: {
phoneNum: [ 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}$/, 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', trigger: 'blur',
}, },
], ],
...@@ -159,7 +159,7 @@ export default { ...@@ -159,7 +159,7 @@ export default {
}, },
queryAllProvince() { queryAllProvince() {
axios axios
.post(`${address}selectAllAreasByLevelByParent`, {}) .post(`${address}selectAllAreasByLevelByParentByPermission`, {})
.then((response) => { .then((response) => {
if (response.data.code === 200) { if (response.data.code === 200) {
if (response.data.data) { if (response.data.data) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<el-form :inline="true" :model="filters"> <el-form :inline="true" :model="filters">
<el-form-item> <el-form-item>
<el-select <el-select
v-permission="[permission.provincePermission]"
@change="getCityOptions" @change="getCityOptions"
v-model="filters.provinceIds" v-model="filters.provinceIds"
style="width:160px" style="width:160px"
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select
v-permission="[permission.provincePermission]"
v-model="filters.cityIds" v-model="filters.cityIds"
multiple multiple
collapse-tags collapse-tags
...@@ -41,7 +43,7 @@ ...@@ -41,7 +43,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input placeholder="请输入手机号码" style="width:160px" <el-input placeholder="请输入用户名" style="width:160px"
v-model="filters.phoneNum" clearable /> v-model="filters.phoneNum" clearable />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -134,7 +136,9 @@ ...@@ -134,7 +136,9 @@
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column width="100" label="市" prop="cityStr" <el-table-column width="100" label="市" prop="cityStr"
align="center"></el-table-column> 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> align="center"></el-table-column>
<el-table-column width="160" label="创建人" prop="createByStr" <el-table-column width="160" label="创建人" prop="createByStr"
align="center"></el-table-column> align="center"></el-table-column>
...@@ -316,7 +320,7 @@ export default { ...@@ -316,7 +320,7 @@ export default {
const tHeader = [ const tHeader = [
'省', '省',
'市', '市',
'手机号', '用户名',
'创建人', '创建人',
'创建时间', '创建时间',
'状态', '状态',
...@@ -342,7 +346,7 @@ export default { ...@@ -342,7 +346,7 @@ export default {
}, },
getCityOptions() { getCityOptions() {
this.cityOptions = []; this.cityOptions = [];
if (this.filters.provinceIds) { if (this.filters.provinceIds.length>0) {
this.queryCityByProvince(this.filters.provinceIds); this.queryCityByProvince(this.filters.provinceIds);
} }
}, },
...@@ -443,8 +447,9 @@ export default { ...@@ -443,8 +447,9 @@ export default {
this.tableData = response.data.data.list; this.tableData = response.data.data.list;
this.tableData.forEach((e) => { this.tableData.forEach((e) => {
const reg = /^(\d{3})\d{4}(\d{4})$/; const reg = /^(\d{3})\d{4}(\d{4})$/;
if (e.phoneNum) {
e.userName = e.userName.replace(reg, '$1****$2'); e.phoneNum = e.phoneNum.replace(reg, '$1****$2');
}
}); });
} }
} else { } 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