Commit 5d8202d7 by 冒粤蓉

add fence

1 parent 8cc5ee82
var path = require('path') var path = require('path')
var webpack = require('webpack') var webpack = require('webpack')
const { port } = require("../package");
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
...@@ -13,6 +14,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl ...@@ -13,6 +14,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
//localhost:10500 //localhost:10500
const IS_DEV_MODE = process.env.NODE_ENV !== 'production' const IS_DEV_MODE = process.env.NODE_ENV !== 'production'
const getPublicPath = IS_DEV_MODE ? '' : '/ots/vue/build/'; const getPublicPath = IS_DEV_MODE ? '' : '/ots/vue/build/';
const resourcesPath = IS_DEV_MODE ? `//localhost:${port}` : 'http://eshield-perm.test.glsx.com.cn';
module.exports = { module.exports = {
mode: IS_DEV_MODE ? 'development':'production', mode: IS_DEV_MODE ? 'development':'production',
...@@ -87,15 +89,16 @@ module.exports = { ...@@ -87,15 +89,16 @@ module.exports = {
test: /\.(png|jpg|gif|svg)$/, test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader', loader: 'file-loader',
options: { options: {
name: 'images/[name].[ext]?[hash]' name: 'images/[name].[ext]?[hash]',
publicPath: resourcesPath
} }
}, },
{ {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader', loader: 'url-loader',
query: { options: {
limit: 10000, limit: 10000,
publicPath: '../', publicPath: resourcesPath,
name: 'fonts/[name].[hash:7].[ext]' name: 'fonts/[name].[hash:7].[ext]'
} }
} }
......
import request from './request' import request from './request'
export default { export default {
/*新虎哥围栏管理*/
getFenceList(params = {}) {
return request(params, '/trialdrive/fence/search', 'get')
},
deleteFence(params = {}) {
return request(params, '/trialdrive/fence/delete', 'get')
},
saveFence(params = {}) {
return request(params, '/trialdrive/fence/add', 'post')
},
updateFence(params = {}) {
return request(params, '/trialdrive/fence/edit', 'post')
},
getFenceDetailById(params = {}) {
return request(params, '/trialdrive/fence/info', 'get')
},
getVehicleSnList(params = {}) {
return request(params, '/trialdrive/vehicle/linksns/search', 'get')
},
/*新虎哥特约店列表*/
getSpecialShopList(params = {}) {
return request(params, '/trialdrive/specialshop/shopusers', 'get')
},
// 旧虎哥 // 旧虎哥
/*车辆监控*/ /*车辆监控*/
// getCriteriaTreeList (request = {}) { // getCriteriaTreeList (request = {}) {
...@@ -76,13 +100,5 @@ export default { ...@@ -76,13 +100,5 @@ export default {
// }, // },
// getFenceSnsList(request = {}) { // getFenceSnsList(request = {}) {
// return api.get('ecFence/getFenceSnsList', request) // return api.get('ecFence/getFenceSnsList', request)
// }, // },
/*新虎哥围栏管理*/
getFenceList(params = {}) {
return request(params, '/trialdrive/fence/search', 'get')
},
deleteFence(params = {}) {
return request(params, '/trialdrive/fence/delete', 'get')
}
} }
...@@ -390,7 +390,7 @@ export default{ ...@@ -390,7 +390,7 @@ export default{
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
MONITOR_SERVICE.deleteFence({fenceId: id}).then((res)=>{ MONITOR_SERVICE.deleteFence({fenceId: id}).then((res)=>{
if(res.returnCode == 0){ if(res.code == 200){
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'success' type: 'success'
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div class="map-seacrh-wrap"> <div class="map-seacrh-wrap">
<!-- <input type="text" id="fenceMapSearch"> --> <!-- <input type="text" id="fenceMapSearch"> -->
<el-input placeholder="请输入位置" id="fenceMapSearch" size="small" v-model="fenceMapSearch"> <el-input placeholder="请输入位置" id="fenceMapSearch" size="small" v-model="fenceMapSearch" :disabled="readonlyStatus">
<template slot="prepend">搜索</template> <template slot="prepend">搜索</template>
<!-- <el-button slot="append" icon="el-icon-search" @click="search"></el-button> --> <!-- <el-button slot="append" icon="el-icon-search" @click="search"></el-button> -->
</el-input> </el-input>
...@@ -57,7 +57,7 @@ const BUSINESS_SERVICE = services.business; ...@@ -57,7 +57,7 @@ const BUSINESS_SERVICE = services.business;
import {CONSTANT} from '../../constant' import {CONSTANT} from '../../constant'
export default{ export default{
props: ['fenceMapModalVisible', 'init'], props: ['fenceMapModalVisible', 'init', 'readonlyStatus'],
data(){ data(){
return { return {
fenceMapSearch: '', fenceMapSearch: '',
......
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
<el-form :model="form" :inline="false" size="mini" class="main-form" label-width="80px"> <el-form :model="form" :inline="false" size="mini" class="main-form" label-width="80px">
<el-row> <el-row>
<el-form-item label="用户查询" class="pull-left"> <el-form-item label="用户查询" class="pull-left">
<el-input placeholder="请输入对应条件值" v-model="form.queryTerm" size="small" class="input-with-select" style="width:340px" maxlength="50" clearable> <el-input placeholder="请输入对应条件值" v-model="form.term" size="small" class="input-with-select" style="width:340px" maxlength="50" clearable>
<el-select v-model="form.queryType" slot="prepend" style="width:100px;" placeholder="请选择" size="small"> <el-select v-model="form.termType" slot="prepend" style="width:100px;" placeholder="请选择" size="small">
<el-option label="设备号" value="1"></el-option> <el-option label="设备号" value="1"></el-option>
<el-option label="车架号" value="2"></el-option> <el-option label="车架号" value="2"></el-option>
<el-option label="姓名" value="3"></el-option> <el-option label="姓名" value="3"></el-option>
<el-option label="工单号" value="4"></el-option> <!-- <el-option label="工单号" value="4"></el-option> -->
</el-select> </el-select>
</el-input> </el-input>
<el-button type="primary" plain size="small" v-popover:popover>更多条件 <!-- <el-button type="primary" plain size="small" v-popover:popover>更多条件
<i class=" el-icon--right" :class="highSearchVisible?'el-icon-arrow-up':'el-icon-arrow-down'" ></i> <i class=" el-icon--right" :class="highSearchVisible?'el-icon-arrow-up':'el-icon-arrow-down'" ></i>
</el-button> </el-button> -->
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
</el-form-item> </el-form-item>
...@@ -98,10 +98,11 @@ ...@@ -98,10 +98,11 @@
<el-col :span="12" class="choose-list-wrap"> <el-col :span="12" class="choose-list-wrap">
<p>结果列表</p> <p>结果列表</p>
<ul class="choose-list"> <ul class="choose-list">
<li v-for="item in resultList" :key="item.standno"> <li v-for="item in resultList" :key="item.vin">
<el-checkbox v-model="item.checked" @change="checkedChange(item)" class="choose-list-checkbox"> <el-checkbox v-model="item.checked" @change="checkedChange(item)" class="choose-list-checkbox">
<div class="choose-list-content"> <div class="choose-list-content">
<p>{{item.name}}/{{item.standno}}</p> <!-- {{item.name}}/ -->
<p>{{item.vin}}</p>
<p class="choose-list-group"> <p class="choose-list-group">
<el-tag type="info" size="small" v-for="snItem in item.sns" :key="snItem">{{snItem}}</el-tag> <el-tag type="info" size="small" v-for="snItem in item.sns" :key="snItem">{{snItem}}</el-tag>
</p> </p>
...@@ -119,10 +120,10 @@ ...@@ -119,10 +120,10 @@
<el-col :span="12" class="choose-list-wrap"> <el-col :span="12" class="choose-list-wrap">
<p>已选列表</p> <p>已选列表</p>
<ul class="choose-list"> <ul class="choose-list">
<li v-for="item in chosenList" :key="item.standno"> <li v-for="item in chosenList" :key="item.vin">
<el-checkbox v-model="item.checked" @change="checkedChange(item)" class="choose-list-checkbox"> <el-checkbox v-model="item.checked" @change="checkedChange(item)" class="choose-list-checkbox">
<div class="choose-list-content"> <div class="choose-list-content">
<p>{{item.name}}/{{item.standno}}</p> <p>{{item.name}}/{{item.vin}}</p>
<p class="choose-list-group"> <p class="choose-list-group">
<el-tag type="info" size="small" v-for="snItem in item.sns" :key="snItem">{{snItem}}</el-tag> <el-tag type="info" size="small" v-for="snItem in item.sns" :key="snItem">{{snItem}}</el-tag>
</p> </p>
...@@ -162,8 +163,8 @@ export default{ ...@@ -162,8 +163,8 @@ export default{
data(){ data(){
return { return {
form: { form: {
queryTerm: '', term: '',
queryType: '1', termType: '1',
sTime: '', sTime: '',
eTime: '' eTime: ''
}, },
...@@ -197,7 +198,7 @@ export default{ ...@@ -197,7 +198,7 @@ export default{
resultItem:'', resultItem:'',
highSearchVisible: false, highSearchVisible: false,
userImportModalVisible: false, userImportModalVisible: false,
currentPage: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
maxPage: 1, maxPage: 1,
...@@ -250,7 +251,7 @@ export default{ ...@@ -250,7 +251,7 @@ export default{
if(newVal){ if(newVal){
this.resultList.forEach((item)=>{ this.resultList.forEach((item)=>{
item.checked = true; item.checked = true;
const findItem = this.chosenList.find((o)=>o.standno===item.standno) const findItem = this.chosenList.find((o)=>o.vin===item.vin)
if(!findItem){ if(!findItem){
this.chosenList.push(item) this.chosenList.push(item)
} }
...@@ -259,7 +260,7 @@ export default{ ...@@ -259,7 +260,7 @@ export default{
}else{ }else{
this.resultList.forEach((item)=>{ this.resultList.forEach((item)=>{
item.checked = false; item.checked = false;
const findItem = this.chosenList.find((o)=>o.standno===item.standno) const findItem = this.chosenList.find((o)=>o.vin===item.vin)
if(findItem){ if(findItem){
this.chosenList.splice(this.chosenList.indexOf(findItem), 1); this.chosenList.splice(this.chosenList.indexOf(findItem), 1);
} }
...@@ -290,7 +291,7 @@ export default{ ...@@ -290,7 +291,7 @@ export default{
userdata.push({ userdata.push({
sn: obj.sn, sn: obj.sn,
name: obj.name, name: obj.name,
standno: obj.standno, vin: obj.vin,
userTel:obj.userTel, userTel:obj.userTel,
time:obj.time, time:obj.time,
address:obj.address address:obj.address
...@@ -302,7 +303,7 @@ export default{ ...@@ -302,7 +303,7 @@ export default{
search(){ search(){
this.resultList = []; this.resultList = [];
//this.chosenList = []; //this.chosenList = [];
this.currentPage = 1; this.pageNumber = 1;
this.needInfinite = false; this.needInfinite = false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.infiniteLoading && this.$refs.infiniteLoading.$emit('$InfiniteLoading:reset'); this.$refs.infiniteLoading && this.$refs.infiniteLoading.$emit('$InfiniteLoading:reset');
...@@ -310,27 +311,30 @@ export default{ ...@@ -310,27 +311,30 @@ export default{
const params = this.params; const params = this.params;
delete params.sn; delete params.sn;
delete params.standNo; delete params.vin;
delete params.name; delete params.name;
delete params.workOrderNo; delete params.workOrderNo;
const queryTerm = this.form.queryTerm.trim(); let { term, termType } = this.form;
if(queryTerm){ term = term.trim();
switch(this.form.queryType){ params.term = term;
case '1': params.termType = termType;
params.sn = queryTerm; // if(term){
break; // switch(termType){
case '2': // case '1':
params.standNo = queryTerm; // params.sn = term;
break; // break;
case '3': // case '2':
params.name = queryTerm; // params.vin = term;
break; // break;
case '4': // case '3':
params.workOrderNo = queryTerm; // params.name = term;
break; // break;
} // case '4':
} // params.workOrderNo = term;
// break;
// }
// }
this.needInfinite = true; this.needInfinite = true;
}, },
...@@ -353,7 +357,7 @@ export default{ ...@@ -353,7 +357,7 @@ export default{
if(item.checked){ if(item.checked){
this.resultcheck= item.checked; this.resultcheck= item.checked;
this.resultItem = item; this.resultItem = item;
const findItem = this.chosenList.find((o)=>o.standno===item.standno); const findItem = this.chosenList.find((o)=>o.vin===item.vin);
if(findItem) return; if(findItem) return;
this.chosenList.push(item); this.chosenList.push(item);
this.checkedCancel = false; this.checkedCancel = false;
...@@ -445,38 +449,42 @@ export default{ ...@@ -445,38 +449,42 @@ export default{
}, },
infiniteHandler($state){ infiniteHandler($state){
if(this.currentPage> this.maxPage){ if(this.pageNumber> this.maxPage){
$state.complete(); $state.complete();
return; return;
} }
this.params.currentPage = this.currentPage; this.params.pageNumber = this.pageNumber;
this.params.pageSize = this.pageSize; this.params.pageSize = this.pageSize;
MONITOR_SERVICE.getVehicleSnList(this.params).then((res)=>{ MONITOR_SERVICE.getVehicleSnList(this.params).then((res)=>{
const data = res.data; const { code, data, message } = res;
if(!res.error && data && data.length){ if(code == 200) {
data.map((obj)=>{ const { list } = data;
if(obj.sn){ if(list && list.length > 0) {
obj.sns = obj.sn.split(',') list.map((obj)=>{
}else{ if(obj.sn){
obj.sns = []; obj.sns = obj.sn.split(',')
} }else{
}); obj.sns = [];
this.resultList = this.resultList.concat(data); }
this.total = res.recordsTotal; });
this.maxPage = Math.ceil(this.total/this.pageSize); this.resultList = this.resultList.concat(list);
this.currentPage++; this.total = res.recordsTotal;
$state.loaded() this.maxPage = Math.ceil(this.total/this.pageSize);
}else{ this.pageNumber++;
$state.loaded()
} else {
$state.complete();
}
} else {
$state.complete(); $state.complete();
} }
}) })
}, },
getData(curr=this.currentPage, size=this.pageSize){ getData(curr=this.pageNumber, size=this.pageSize){
this.loading = true; this.loading = true;
let params = this.getParams(); let params = this.getParams();
params.currentPage = curr; params.pageNumber = curr;
params.pageSize = size; params.pageSize = size;
BUSINESS_SERVICE.getWorkOrderList(params).then((response)=>{ BUSINESS_SERVICE.getWorkOrderList(params).then((response)=>{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!