Commit 62cd1a97 by 张杰

v1.6.0版本需求

1 parent f7b29813
This diff could not be displayed because it is too large.
......@@ -11,6 +11,7 @@
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules --config config/webpack.config.js"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"animate.css": "^3.7.0",
"axios": "^0.18.0",
"calendar-months": "^1.0.1",
......@@ -22,14 +23,13 @@
"es6-promise": "^4.2.4",
"font-awesome": "^4.7.0",
"moment": "^2.22.0",
"node-sass": "^7.0.1",
"qs": "^6.5.1",
"sass": "^1.45.1",
"vue": "^2.5.11",
"vue-infinite-loading": "^2.3.1",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"xlsx": "^0.14.0",
"node-sass":"7.0.1"
"xlsx": "^0.14.0"
},
"browserslist": [
"> 1%",
......
......@@ -25,26 +25,26 @@
</template>
<script>
import store from './vuex/store.js'
import { mapGetters, mapActions } from 'vuex'
import vSideBar from 'components/SideBar.vue'
import store from "./vuex/store.js";
import { mapGetters, mapActions } from "vuex";
import vSideBar from "components/SideBar.vue";
export default {
name: 'app',
name: "app",
data() {
return {
isQiankun: window.__POWERED_BY_QIANKUN__,
logo: require('images/logo.png')
}
return {
isQiankun: window.__POWERED_BY_QIANKUN__,
logo: require("images/logo.png"),
};
},
watch: {
$route(to, from) {
if(this.isQiankun) {
if (this.isQiankun) {
this.getBreadcrumb();
}
}
},
},
mounted(){
mounted() {
// store.dispatch('getDeviceResources')
// store.dispatch('getLoginUser').then((res)=>{
// if(store.state.common.username === 'gqgdcx'){
......@@ -62,90 +62,107 @@ export default {
// g = d.getElementsByTagName('body')[0],
// x = w.innerWidth || e.clientWidth || g.clientWidth,
// y = w.innerHeight|| e.clientHeight|| g.clientHeight;
// d.getElementsByTagName('main')[0].style['minHeight'] = y+'px'
// }
// window.onresize()
this.$onGlobalStateChange((state, prev) => {
if(state.isCollapsed != this.isCollapse) {
this.toggleCollapse()
if (state.isCollapsed != this.isCollapse) {
this.toggleCollapse();
}
})
});
},
computed: {
...mapGetters([
'isCollapse',
'isFullsize'
])
...mapGetters(["isCollapse", "isFullsize"]),
},
methods: {
getBreadcrumb() {
const { getters: {curBreadCrumb}} = this.$root.parentVuex;
let matched = this.$route.matched.filter(item => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const {
getters: { curBreadCrumb },
} = this.$root.parentVuex;
let matched = this.$route.matched.filter((item) => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const first = matched[0];
const { meta, path } = first;
const basePath = '/oEshield#';
const basePath = "/oEshield#";
let breadcrumb = [];
if(meta) {
if (meta) {
const { title, pushState } = meta;
if(pushState && title) {
if (pushState && title) {
breadcrumb.push({
name: title,
path: basePath + path
})
path: basePath + path,
});
history.state.pushState = pushState;
history.state.breadcrumb = [...curBreadCrumb, breadcrumb[0]];
// this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb]);
}
}
},
toggle(){
this.toggleCollapse()
toggle() {
this.toggleCollapse();
},
...mapActions([
'toggleCollapse'
]),
navigate(){
let routeData = this.$router.resolve({
path: '/notice',
query: {
}
...mapActions(["toggleCollapse"]),
navigate() {
let routeData = this.$router.resolve({
path: "/notice",
query: {},
});
window.open(routeData.href, '_blank');
}
window.open(routeData.href, "_blank");
},
},
components: {
vSideBar
vSideBar,
},
store
}
store,
};
</script>
<style scoped>
.topbar {
min-height: 50px;
padding: 15px 10px;
}
.toggle-btn, .logo{
vertical-align: middle;
}
.logo{
margin-left: 10px;
}
a.right-link{
color: #999;
font-size: 14px;
margin-right: 20px;
line-height: 30px;
text-decoration: none;
}
.full-size main{
margin: 0;
.topbar {
min-height: 50px;
padding: 15px 10px;
}
.toggle-btn,
.logo {
vertical-align: middle;
}
.logo {
margin-left: 10px;
}
a.right-link {
color: #999;
font-size: 14px;
margin-right: 20px;
line-height: 30px;
text-decoration: none;
}
.full-size main {
margin: 0;
}
.full-size .sidebar,
.full-size .topbar {
display: none;
}
</style>
<style lang="scss">
.el_table {
thead {
th {
background: rgba($color: #f2f2f2, $alpha: 0.5) !important;
}
}
.full-size .sidebar, .full-size .topbar{
display: none;
}
.links_group {
position: relative;
display: flex;
align-items: flex-end;
justify-content: space-between;
padding: 10px 0;
.name {
font-size: 18px;
font-weight: bold;
color: #666;
}
}
</style>
import request from './request'
// 新增围栏
export const SAVE_ELECFENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/add', 'POST')
}
// 更新围栏
export const UPDATE_ELECFENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/edit', 'POST')
}
// 获取围栏详情
export const GET_ELECFENCE_INFO = params => {
return request(params, '/trialdrive/elecfence/info')
}
//新增、编辑围栏-获取关联设备列表
export const GET_ELECFENCE_LINKEDDEVICES = params => {
return request(params, '/trialdrive/elecfence/linkedDevices')
}
//新增、编辑围栏-关联设备-获取用户权限设备列表接口
export const GET_VEHICLE_LINKSNS = params => {
return request(params, '/trialdrive/vehicle/linksns/search')
}
//新增、编辑围栏-批量删除关联设备
export const REMOVE_ELECFENCE_LINKEDDEVICES = params => {
return request(params, '/trialdrive/elecfence/batchUnlink')
}
//新增、编辑围栏-批量导入关联设备
export const IMPORT_ELECFENCE_LINKEDDEVICES = '/trialdrive/elecfence/batchImport'
\ No newline at end of file
......@@ -142,3 +142,8 @@ export default {
export const GET_DEVICEINFO_BYSNS = params => {
return request(params, '/trialdrive/monitor/vehiclelocation')
}
// 批量查询设备位置点
export const GET_DEVICE_LOCATION = params => {
return request(params, '/trialdrive/monitor/vehiclelocation', 'get')
}
\ No newline at end of file
This diff could not be displayed because it is too large.
......@@ -43,4 +43,7 @@
.icon-zoom_in.active { width: 19px; height: 19px; background-position: -57px -60px; }
.icon-zoom_in:active { width: 19px; height: 19px; background-position: -57px -60px; }
.icon-zoom_in:hover { background-position: -57px -60px; }
.icon-zoom_in { width: 19px; height: 19px; background-position: -82px 0px; }
\ No newline at end of file
.icon-zoom_in { width: 19px; height: 19px; background-position: -82px 0px; }
.icon-info_shop { width: 24px; height: 24px; background:url('./shop.png') no-repeat;background-size:24px auto; }
.icon-info_plate { width: 24px; height: 24px; background:url('./plate.png') no-repeat;background-size:24px auto; }
\ No newline at end of file
<template>
<el-cascader v-model="city" :options="cityList" :props="cascaderProps" :disabled="disabled" @change="onChange"></el-cascader>
</template>
<script>
import cityJson from "@/assets/json/city.json";
export default {
name: "CitySelect",
props: {
value: {
type: [String, Number],
default: "",
},
checkStrictly: {
type: Boolean,
default: false,
},
disabled: {
type: Boolean,
default: false,
},
},
data() {
return {
cityList: cityJson,
city: "",
cascaderProps: {
value: "code",
label: "name",
children: "children",
checkStrictly: this.checkStrictly,
},
};
},
watch: {
value: {
handler: function (n, o) {
if (n) {
this.init();
}
},
immediate: true,
},
},
mounted() {
//this.city = this.value;
},
methods: {
onChange(e) {
console.log(e);
let list = this.cityList;
let m = list.find((k) => k.code == e[0]);
let n = m.children.find((k) => k.code == e[1]);
let b = (n.children || []).find((k) => k.code == e[2]);
if (n) {
this.$emit("input", n.name);
}
this.$emit("change", { code: e, name: [m.name, n.name, b.name] });
},
// 初始化
init() {
let o = this.value;
let list = this.cityList;
let arr = [];
if (!o) {
return false;
}
let m = list.find((k) => {
let n = k.children.find((j) => j.name == o);
if (n) {
arr.push(k.code);
arr.push(n.code);
}
});
this.city = arr;
console.log(arr);
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
const MAP_KEY = '75116f653f3b2e4568116dad8cd9b899'
export const MAP_KEY = '75116f653f3b2e4568116dad8cd9b899'
// 地图插件
export const MAP_PLUGINS = [
'AMap.PolyEditor',
'AMap.CircleEditor',
'AMap.DistrictSearch',
'AMap.Autocomplete',
'AMap.MarkerClusterer',
'AMap.MouseTool',
'AMap.Text',
"AMap.RangingTool",
"AMap.Geolocation",
"AMap.PolygonEditor",
"AMap.PolylineEditor",
]
export const CONSTANT = {
//ROOT: process.env.NODE_ENV === 'development'?'ots/':'',
API_URL: '/ots/',
MAP_KEY,
MAP_PLUGINS,
AMAP_URL: `https://webapi.amap.com/maps?v=1.4.2&key=${MAP_KEY}&plugin=AMap.PolyEditor,AMap.CircleEditor,AMap.DistrictSearch,AMap.Autocomplete,AMap.MarkerClusterer,AMap.MouseTool,AMap.Text`
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import vFullLayout from 'pages/FullWidthLayout.vue'
import store from './vuex/store.js'
import App from './App.vue'
import Vue from 'vue'
Vue.component('vLayout',vLayout)
......@@ -40,6 +41,9 @@ function render({ data = {} , container } = {}) {
routes
});
store.commit('SET_BASE_URL', data.baseURL);
Vue.prototype.$parentCommon = data.common;
Vue.prototype.$parentRouter = data.router;
Vue.prototype.$parentVuex = data.store;
instance = new Vue({
router,
store,
......
......@@ -147,7 +147,18 @@
</div>
<div class="filter-dialog-body">
<div class="monitor-list">
<el-tree ref="tree" :key="treeKey" :data="treeData" :props="treeProps" lazy :load="loadNode" show-checkbox node-key="id" :render-content="renderTreeContent" :default-expanded-keys="expandedKeys" :default-checked-keys="checkedKeys" @check="handleCheck" v-loading="treeLoading" @check-change="handleCheckChange">
<el-tree ref="tree" :key="treeKey" :data="treeData" :props="treeProps" lazy :load="loadNode" show-checkbox node-key="id" :default-expanded-keys="expandedKeys" :default-checked-keys="checkedKeys" @check="handleCheck" v-loading="treeLoading" @check-change="handleCheckChange">
<span class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.data.leaf">
<div>姓名:{{node.data.label1 || "--"}}</div>
<div>设备号:{{node.data.label||'--'}}</div>
<div>车架号:{{node.data.label2}}</div>
<div v-if="showMore(node,data)" @click="loadNext(node, data)">查看更多</div>
</div>
<span v-else>
{{node.data.label}}
</span>
</span>
</el-tree>
</div>
......@@ -173,6 +184,7 @@ const MONITOR_SERVICE = services.monitor;
import { CONSTANT } from "@/constant";
import MapControll from "./MapControll.vue";
import { exportExcel } from "@/utils";
import AMapLoader from "@amap/amap-jsapi-loader";
export default {
data() {
let checkFilename = (rule, vaule, cb) => {
......@@ -231,6 +243,7 @@ export default {
treeLoading: true,
currentMessage: "", //当前是否有提示语弹框
treeKey: "",
treeDataList: {}, // 缓存车辆
};
},
computed: {
......@@ -507,20 +520,27 @@ export default {
}
MONITOR_SERVICE.getVehicleTreeUserList(oParams).then(({ data }) => {
if (data.length) {
let arr = [];
data.map((item) => {
item.leaf = true;
});
return resolve(data);
}
if (data.length > 100) {
arr = data.slice(0, 100);
this.treeDataList[node.data.id] = { data: data, idx: 1 };
} else {
arr = data;
}
return resolve(arr);
}
return resolve([]);
});
return;
}
}
}
return resolve(nodeData);
let isArray = Array.isArray(nodeData);
return resolve(isArray?nodeData:[]);
if (node.level === 0) {
return resolve([{ name: "region1" }, { name: "region2" }]);
......@@ -1096,6 +1116,33 @@ export default {
this.expandedKeys = [];
this.checkedKeys = [];
},
// 展示更多
showMore(node,data) {
console.log(data)
console.log(node);
console.log(this.treeDataList)
let o = this.treeDataList['u' + data.parentId];
// 不存在
if(!o){
return false;
}
let len = o.data.length;
let curr = o.idx||1;
// 判断是否有下一页
if(len>curr*10){
return true
}else{
return false;
}
},
// 加载下一页
loadNext(node,data){
console.log(data)
}
},
created() {
if (window.AMap) {
......
......@@ -4,7 +4,7 @@
<el-form ref="form" :model="form" :inline="false" size="mini" v-show="!showResult">
<el-upload ref="upload" class="upload-wrap"
action="ecFence/importDeviceManage"
:action="IMPORT_ELECFENCE_LINKEDDEVICES"
:on-change="changeFile"
:before-upload="beforeUpload"
:multiple="false"
......@@ -49,7 +49,7 @@
</template>
<script>
import {exportExcel} from 'utils'
import {IMPORT_ELECFENCE_LINKEDDEVICES} from '@/api/services/fence'
export default{
props: ['userImportModalVisible'],
data(){
......@@ -63,7 +63,8 @@
seqNo: '',
importing: false,
filename: '',
flag:[]
flag:[],
IMPORT_ELECFENCE_LINKEDDEVICES
}
},
methods: {
......@@ -149,19 +150,17 @@
return false
},
downloadTpl(){
exportExcel('ecFence/downTemplates')
exportExcel('/ecFence/downTemplates')
},
openDialog(){
this.$emit('onUserImportModalChange', true)
},
closeDialog(){
this.$emit('onUserImportModalChange', false);
},
errorUpload(err){
window.location.href = '../ots/login';
//window.location.href = '../ots/login';
}
}
}
......
import Vue from 'vue'
const EventBus = new Vue()
import { Message, MessageBox, Loading } from 'element-ui'
import moment from 'moment'
let loadingInstance = ''
export const Util = {
/**
* 简单alert
* title 标题
* message 内容
* className 自定义class
* showCancelButton 是否展示取消按钮
* confirmButtonText 确认按钮文案
* cancelButtonText 取消按钮文案
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
* type: success / info / warning / error
*/
msg: function (options) {
MessageBox({
title: options.title || '',
type: options.type || 'error',
message: options.message || '',
className: options.className || '',
showCancelButton: options.showCancelButton || false,
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true,
center: options.center || false,
callback: function (action, done) {
if (action == 'confirm') {
if (options.success) {
options.success(done)
}
} else {
console.log(done)
//done.close()
}
},
})
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
* 提示框
*/
Info: function (options) {
Message({
message: options.message || '提示',
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || '',
})
},
/**
* 轻提示
*/
Tips: function (options) {
Message({
message: options.message || '提示',
duration: options.duration || 3000,
type: options.type || 'text',
icon: options.icon || '',
})
},
/**
* loading
*/
loading: function (message) {
loadingInstance = Loading.service({
text: message || '加载中...',
})
},
/**
* 关闭loading
*/
closeLoading: function () {
loadingInstance.close()
},
/**
* 校验手机号码格式
*/
checkPhone: function (mobile) {
let myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
},
/**
* 校验固定电话
*/
validationTel: function (tel) {
let reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel)
},
/**
* 是否特殊字符
*/
isSpecialLetter: function (str) {
let reg = new RegExp(
"[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
)
return reg.test(str)
},
/**
* 获取当前时间
*/
getCurrentDate: function () {
let time = new Date()
let y = time.getFullYear()
let m = time.getMonth() + 1
let d = time.getDate()
return {
date: y + '/' + m + '/' + d,
}
},
/**
* 获取浏览器参数
*/
getUrlParams: function (name) {
let vars = [],
hash
let oParams = {}
let hashes = window.location.href
.slice(window.location.href.indexOf('?') + 1)
.split('&')
for (let i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=')
vars.push(hash[0])
oParams[hash[0]] = hash[1]
}
console.log(vars)
if (name) {
return oParams[name]
} else {
return oParams
}
},
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function (day) {
let date1 = new Date()
let date2 = new Date(date1)
let time = 30
if (day) {
time = day
}
date2.setDate(date1.getDate() + time)
let _date =
date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate()
return {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate(),
}
},
/**
* 日期格式转换
*/
dateFormate: function (str, type) {
let txt = 'YYYY-MM-DD'
if (!str) {
return ''
}
if (type) {
txt = type
}
const m = moment(str).format(txt)
return m
},
/**
* 字段截取
*/
cutStr: function (str, num) {
if (!str) {
return ''
}
let m = 10
let n = str
if (num) {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
},
/**
* 深克隆 所有原型链上的对象和属性
* 例: const bar=deepClone(foo)
* console.log(bar===foo) false
* @param {*} obj
*/
deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = Util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
},
// 传递消息
broadcast: function (msg, data) {
EventBus.$emit(msg, data)
},
// 接收消息
received: function (msg, callBack) {
EventBus.$off(msg)
EventBus.$on(msg, function (row) {
callBack(row)
})
},
}
export const showModal = Util.msg
export const showToast = Util.Info
export const showLoading = Util.loading
export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone
// export const broadcast = Util.broadcast
// export const received = Util.received
......@@ -84,6 +84,7 @@ const mutations = {
[types.vehicleGenerate](state, data) {
state.vehicleGenerate = data
},
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!