Commit b5b58d86 by 张杰

v1.6.0版本需求

1 parent 521455cc
...@@ -34,7 +34,7 @@ module.exports = { ...@@ -34,7 +34,7 @@ module.exports = {
}, },
externals: { externals: {
vue: 'Vue', vue: 'Vue',
'element-ui': 'ElementUI' //'element-ui': 'ElementUI'
}, },
module: { module: {
rules: [ rules: [
......
import api from '../config.js' import api from '../config.js'
import request from './request'
export default { export default {
getLoginUser (request = {}) { getLoginUser(request = {}) {
return api.get('common/getLoginUser', request) return api.get('common/getLoginUser', request)
}, },
...@@ -11,7 +12,7 @@ export default { ...@@ -11,7 +12,7 @@ export default {
}, },
/*车辆品牌*/ /*车辆品牌*/
getAllVehicleBrand (request = {}) { getAllVehicleBrand(request = {}) {
return api.get('vehicle/getAllVehicleBrand', request) return api.get('vehicle/getAllVehicleBrand', request)
}, },
getBrandTypeByBrandId(request = {}) { getBrandTypeByBrandId(request = {}) {
...@@ -19,15 +20,21 @@ export default { ...@@ -19,15 +20,21 @@ export default {
}, },
/*车辆分组分类*/ /*车辆分组分类*/
getAllVehicleGroup (request = {}) { getAllVehicleGroup(request = {}) {
return api.get('vehiclegroup/getAllVehicleGroup', request) return api.get('vehiclegroup/getAllVehicleGroup', request)
}, },
getClassListByGroupId (request = {}) { getClassListByGroupId(request = {}) {
return api.get('vehicleclass/getClassListByGroupId', request) return api.get('vehicleclass/getClassListByGroupId', request)
}, },
/*获取菜单权限*/ /*获取菜单权限*/
getDeviceResources (request = {}) { getDeviceResources(request = {}) {
return api.get('user/userDeviceResources', request) return api.get('user/userDeviceResources', request)
} }
}
// 获取车辆树
export const GET_ORGANIZATION_TREE = params => {
return request(params, '/usercenter/organization/orgtree')
} }
\ No newline at end of file \ No newline at end of file
...@@ -23,8 +23,8 @@ export const GET_ELECFENCE_LINKEDDEVICES = params => { ...@@ -23,8 +23,8 @@ export const GET_ELECFENCE_LINKEDDEVICES = params => {
} }
//新增、编辑围栏-关联设备-获取用户权限设备列表接口 //新增、编辑围栏-关联设备-获取用户权限设备列表接口
export const GET_VEHICLE_LINKSNS = params => { export const GET_ELECFENCE_LINKSNS = params => {
return request(params, '/trialdrive/vehicle/linksns/search') return request(params, '/trialdrive/elecfence/linksns/search')
} }
//新增、编辑围栏-批量删除关联设备 //新增、编辑围栏-批量删除关联设备
......
...@@ -44,6 +44,3 @@ ...@@ -44,6 +44,3 @@
.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:hover { background-position: -57px -60px; }
.icon-zoom_in { width: 19px; height: 19px; background-position: -82px 0px; } .icon-zoom_in { width: 19px; height: 19px; background-position: -82px 0px; }
\ No newline at end of file \ No newline at end of file
.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 \ No newline at end of file
<template>
<div class="">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input>
<div v-loading="loading">
<el-tree style="max-height:50vh;overflow:auto" class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
</el-tree>
</div>
<p style="text-align: right; margin-top: 10px">
<el-button @click="filterConfirm" type="primary">确定</el-button>
<el-button @click="closeFilter">取消</el-button>
</p>
</div>
</template>
<script>
import { GET_ORGANIZATION_TREE } from "@/api/services/common";
import { showToast } from "@/utils/utils";
export default {
name: "GlsxOrganization",
data() {
return {
filterText: "",
filterTextData: [],
_timeout: "",
loading: false,
};
},
mounted() {
this.getTree();
},
watch: {
filterText(n) {
let _this = this;
_this.loading = true;
setTimeout(function () {
_this.$refs.tree.filter(n);
}, 100);
},
},
methods: {
// 确认选择树
filterConfirm() {
let o = this.$refs.tree.getCurrentNode();
if (!o) {
showToast({
message: "请选择所属组织",
type: "error",
});
return false;
}
const { label, id, origin } = o;
// if (origin && origin.type != "u") {
// showToast({
// message: "请选择下级所属组织",
// type: "error",
// });
// return false;
// }
console.log(o);
this.$emit("change", o);
// this.searchForm.specialShopName = label.split("/")[1];
// this.searchForm.specialShopCode = label.split("/")[0];
//this.$set(this, "form.specialShopName", label);
//this.searchForm.specialShopId = id;
//this.closeFilter();
},
// 获取组织机构树数据
getTree() {
GET_ORGANIZATION_TREE({ hasUserLeaf: true }).then((res) => {
const { data } = res;
this.filterTextData = data || [];
});
},
// 搜索树
filterNode(value, data) {
let _this = this;
if (!value) {
_this.loading = false;
return true;
}
setTimeout(function () {
_this.loading = false;
}, 1500);
return data.label.indexOf(value) !== -1;
},
// 关闭树
closeFilter() {
this.$emit("change");
},
// 搜索树
onChange(val) {
this.loading = true;
this.$refs.tree.filter(val);
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
import 'font-awesome/css/font-awesome.min.css' import 'font-awesome/css/font-awesome.min.css'
import './assets/scss/element-variables.scss' import './assets/scss/element-variables.scss'
//import Vue from 'vue' //import Vue from 'vue'
//import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import 'animate.css/animate.min.css' import 'animate.css/animate.min.css'
import './assets/scss/style.scss' import './assets/scss/style.scss'
//import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import './assets/spritesmith-generated/sprite.css' import './assets/spritesmith-generated/sprite.css'
import Router from 'vue-router' import Router from 'vue-router'
...@@ -24,7 +24,7 @@ import Vue from 'vue' ...@@ -24,7 +24,7 @@ import Vue from 'vue'
Vue.component('vLayout',vLayout) Vue.component('vLayout',vLayout)
Vue.component('vFullLayout',vFullLayout) Vue.component('vFullLayout',vFullLayout)
//Vue.use(ElementUI) Vue.use(ElementUI)
// new Vue({ // new Vue({
// el: '#app', // el: '#app',
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</el-form> </el-form>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="关联对象"> <el-tab-pane label="监控对象">
<div class="links_group"> <div class="links_group">
<div></div> <div></div>
<div> <div>
...@@ -74,10 +74,12 @@ ...@@ -74,10 +74,12 @@
<el-table class="el_table" :data="tableData" border height="300" size="small" v-loading="loading" @selection-change="selectChange" style="width: 100%;margin-bottom:40px"> <el-table class="el_table" :data="tableData" border height="300" size="small" v-loading="loading" @selection-change="selectChange" style="width: 100%;margin-bottom:40px">
<el-table-column :disabled="readonlyStatus" type="selection" width="40"></el-table-column> <el-table-column :disabled="readonlyStatus" type="selection" width="40"></el-table-column>
<el-table-column fixed type="index" label="序号" :index="getIndex" width="70"></el-table-column> <el-table-column fixed type="index" label="序号" :index="getIndex" width="70"></el-table-column>
<el-table-column fixed prop="name" label="姓名" min-width="80"></el-table-column> <el-table-column fixed prop="name" label="姓名" show-overflow-tooltip></el-table-column>
<el-table-column fixed prop="vin" label="车架号" min-width="160"></el-table-column> <el-table-column fixed prop="vin" label="车架号" show-overflow-tooltip></el-table-column>
<el-table-column prop="sn" label="设备号" min-width="160"></el-table-column> <el-table-column prop="sn" label="设备号" show-overflow-tooltip></el-table-column>
<el-table-column prop="userTel" label="联系方式" min-width="100"></el-table-column> <el-table-column prop="sn" label="GPS时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="sn" label="位置" show-overflow-tooltip></el-table-column>
<el-table-column prop="userTel" label="联系方式" show-overflow-tooltip></el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -98,7 +100,7 @@ import userList from "./fence_userlist.vue"; ...@@ -98,7 +100,7 @@ import userList from "./fence_userlist.vue";
import InfiniteLoading from "vue-infinite-loading"; import InfiniteLoading from "vue-infinite-loading";
import CitySelect from "@/components/area"; import CitySelect from "@/components/area";
const MONITOR_SERVICE = services.monitor; const MONITOR_SERVICE = services.monitor;
import { deepClone, showToast,showModal } from "@/utils/utils"; import { deepClone, showToast, showModal } from "@/utils/utils";
import { import {
GET_ELECFENCE_LINKEDDEVICES, GET_ELECFENCE_LINKEDDEVICES,
GET_ELECFENCE_INFO, GET_ELECFENCE_INFO,
...@@ -277,10 +279,10 @@ export default { ...@@ -277,10 +279,10 @@ export default {
// 监听表格选择 // 监听表格选择
selectChange(selection) { selectChange(selection) {
this.selectedIds = []; this.selectedIds = selection;
selection.map((obj) => { // selection.map((obj) => {
this.selectedIds.push(obj.id); // this.selectedIds.push(obj.sns);
}); // });
}, },
userListModalChange(isOpen) { userListModalChange(isOpen) {
...@@ -549,17 +551,52 @@ export default { ...@@ -549,17 +551,52 @@ export default {
}, },
// 批量删除 // 批量删除
batchRemove(){ batchRemove() {
let _this = this;
showModal({ showModal({
message:'确认删除选择的关联用户吗?', message: "确认删除选择的关联用户吗?",
showCancelButton:true, showCancelButton: true,
type:'warning', type: "warning",
success:function(){ success: function () {
_this.removeUserList();
},
});
},
} // 删除关联用户数据
}) removeUserList() {
let _this = this;
let list = _this.selectedIds || [];
let oList = this.tableData || [];
let arr = [];
// 新增围栏删除关联用户
if (!this.fenceId) {
this.tableData = oList.filter((k) => {
return list.findIndex((j) => j.sn == k.sn) < 0;
});
return false;
} }
list.map((k) => {
arr.push(k.sns);
});
let oParams = {};
oParams.linkSns = arr;
oParams.fenceId = _this.fenceId;
REMOVE_ELECFENCE_LINKEDDEVICES(oParams).then((res) => {
if (res.code == 200) {
showToast({
message: "删除成功",
type: "success",
});
_this.tableData = oList.filter((k) => {
return list.findIndex((j) => j.sn == k.sn) < 0;
});
}
});
},
}, },
}; };
</script> </script>
......
...@@ -20,16 +20,34 @@ ...@@ -20,16 +20,34 @@
<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>
<el-form-item> <el-form-item>
<el-button type="primary" size="small">高级搜索</el-button> <el-button type="primary" size="small" @click="restParams">重置</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="showHighSearch">高级搜索</el-button>
</el-form-item>
<div v-show="highSearchVisible">
<el-form-item>
<div class="pre_select_box">
<el-select v-model="form.timeType" class="small_select mr5" placeholder="请选择">
<el-option label="创建时间" value="1"></el-option>
</el-select>
<el-date-picker v-model="form.timeDate" class="data_picker" value-format="yyyy-MM-dd" type="daterange" range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</div>
</el-form-item>
<el-form-item label="车辆归属">
<el-popover v-model="showGlsxOranization" placement="bottom-start" width="400" trigger="click">
<div>
<glsx-organization @change="onChange"></glsx-organization>
</div>
<el-input v-model="form.orgName" placeholder="所属组织" slot="reference" readonly :clearable="true">
</el-input>
</el-popover>
</el-form-item>
</div>
</el-form> </el-form>
<!-- 搜索区域 end --> <!-- 搜索区域 end -->
<!-- 批量导入 开始 -->
<div class="links_group">
</div>
<!-- 批量导入 end -->
<el-row> <el-row>
<el-col :span="12" class="choose-list-wrap"> <el-col :span="12" class="choose-list-wrap">
<p class="right_title">结果列表</p> <p class="right_title">结果列表</p>
...@@ -55,7 +73,7 @@ ...@@ -55,7 +73,7 @@
<el-col :span="12" class="choose-list-wrap"> <el-col :span="12" class="choose-list-wrap">
<p class="right_title"> <p class="right_title">
<span>已选列表</span> <span>已选列表</span>
<el-button type="primary" plain size="small" @click="groupImport">批量导入</el-button> <!-- <el-button type="primary" plain size="small" @click="groupImport">批量导入</el-button> -->
</p> </p>
<ul class="choose-list"> <ul class="choose-list">
<li v-for="item in chosenList" :key="item.vin"> <li v-for="item in chosenList" :key="item.vin">
...@@ -80,7 +98,7 @@ ...@@ -80,7 +98,7 @@
<el-button @click="$emit('onUserListModalChange', false)" size="small">取消</el-button> <el-button @click="$emit('onUserListModalChange', false)" size="small">取消</el-button>
</div> </div>
<!-- 批量导入弹框 --> <!-- 批量导入弹框 -->
<user-list-import @exportDate="exportDate" v-if="userImportModalVisible" :userImportModalVisible="userImportModalVisible" @onUserImportModalChange="userImportModalChange" @onRefreshList="getData"></user-list-import> <!-- <user-list-import @exportDate="exportDate" v-if="userImportModalVisible" :userImportModalVisible="userImportModalVisible" @onUserImportModalChange="userImportModalChange" @onRefreshList="getData"></user-list-import> -->
<!-- 批量导入弹框 /--> <!-- 批量导入弹框 /-->
</el-dialog> </el-dialog>
<!-- 关联用户弹框 /--> <!-- 关联用户弹框 /-->
...@@ -90,7 +108,9 @@ ...@@ -90,7 +108,9 @@
import vVechicleSelect from "components/VechicleSelect.vue"; import vVechicleSelect from "components/VechicleSelect.vue";
import userListImport from "./userListImport.vue"; import userListImport from "./userListImport.vue";
import InfiniteLoading from "vue-infinite-loading"; import InfiniteLoading from "vue-infinite-loading";
import { GET_VEHICLE_LINKSNS } from "@/api/services/fence"; import GlsxOrganization from "@/components/glsx-organization";
import { GET_ELECFENCE_LINKSNS } from "@/api/services/fence";
import { deepClone } from "@/utils/utils";
export default { export default {
name: "UserList", name: "UserList",
props: ["userListModalVisible", "userData", "init", "shopId"], props: ["userListModalVisible", "userData", "init", "shopId"],
...@@ -98,47 +118,18 @@ export default { ...@@ -98,47 +118,18 @@ export default {
vVechicleSelect, vVechicleSelect,
InfiniteLoading, InfiniteLoading,
userListImport, userListImport,
GlsxOrganization,
}, },
data() { data() {
return { return {
form: { form: {
term: "",
termType: "1", termType: "1",
sTime: "", timeType: "1",
eTime: "",
}, },
dateType: "1", dateType: "1",
dateRange: [],
orderStatus: "",
orderStatusOpts: [
{
name: "已提交",
value: 2,
},
{
name: "已派单",
value: 3,
},
{
name: "已激活",
value: 4,
},
{
name: "已退单",
value: 5,
},
{
name: "已拆除",
value: 6,
},
{
name: "已删除",
value: 7,
},
],
resultcheck: false, resultcheck: false,
gender: "",
resultItem: "", resultItem: "",
highSearchVisible: false, highSearchVisible: false,
userImportModalVisible: false, userImportModalVisible: false,
...@@ -151,15 +142,11 @@ export default { ...@@ -151,15 +142,11 @@ export default {
chosenList: [], chosenList: [],
needInfinite: false, needInfinite: false,
groupId: "",
classIdList: "",
className: "",
tags: [],
checkedAll: false, checkedAll: false,
checkedCancel: false, checkedCancel: false,
params: {}, params: {},
showGlsxOranization: false,
orgInfo: {},
}; };
}, },
mounted() { mounted() {
...@@ -167,15 +154,6 @@ export default { ...@@ -167,15 +154,6 @@ export default {
this.search(); this.search();
}, },
watch: { watch: {
dateRange(newVal) {
if (newVal && newVal.length) {
this.form.sTime = moment(newVal[0]).format("YYYY-MM-DD HH:mm:ss");
this.form.eTime = moment(newVal[1]).format("YYYY-MM-DD HH:mm:ss");
} else {
this.form.sTime = "";
this.form.eTime = "";
}
},
checkedCancel(newVal) { checkedCancel(newVal) {
if (newVal) { if (newVal) {
this.chosenList.forEach((item) => { this.chosenList.forEach((item) => {
...@@ -233,6 +211,8 @@ export default { ...@@ -233,6 +211,8 @@ export default {
}); });
this.chosenList = arr; this.chosenList = arr;
}, },
// 保存数据
sure() { sure() {
const userdata = []; const userdata = [];
this.chosenList.forEach((obj) => { this.chosenList.forEach((obj) => {
...@@ -257,6 +237,8 @@ export default { ...@@ -257,6 +237,8 @@ export default {
this.$emit("onUpdateUserData", userdata); this.$emit("onUpdateUserData", userdata);
this.$emit("onUserListModalChange", false); this.$emit("onUserListModalChange", false);
}, },
// 获取列表
search() { search() {
this.resultList = []; this.resultList = [];
//this.chosenList = []; //this.chosenList = [];
...@@ -266,33 +248,9 @@ export default { ...@@ -266,33 +248,9 @@ export default {
this.$refs.infiniteLoading && this.$refs.infiniteLoading &&
this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset"); this.$refs.infiniteLoading.$emit("$InfiniteLoading:reset");
}); });
const params = this.params;
delete params.sn;
delete params.vin;
delete params.name;
delete params.workOrderNo;
let { term, termType } = this.form;
term = term.trim();
params.term = term;
params.termType = termType;
this.needInfinite = true; this.needInfinite = true;
}, },
highSearchSure() {
this.highSearchVisible = false;
this.tags = [];
this.params = this.getParams();
//this.needInfinite = true;
},
createTag(key, label, value) {
this.tags.push({
key: key,
name: label + ":" + value,
type: "",
});
},
checkedChange(item) { checkedChange(item) {
if (item.checked) { if (item.checked) {
this.resultcheck = item.checked; this.resultcheck = item.checked;
...@@ -325,83 +283,33 @@ export default { ...@@ -325,83 +283,33 @@ export default {
console.log(this.chosenList); console.log(this.chosenList);
console.log(obj); console.log(obj);
}, },
handleClose(tag) {
this.tags.splice(this.tags.indexOf(tag), 1);
switch (tag.key) {
case "activation":
delete this.params.activationSTime;
delete this.params.activationETime;
break; // 获取参数
case "expiration":
delete this.params.expirationSTime;
delete this.params.expirationETime;
break;
case "status":
delete this.params.businessStatus;
break;
case "sex":
delete this.params.sex;
break;
case "classIdList":
delete this.params.classIdList;
break;
}
},
getParams() { getParams() {
const form = this.form; let o = deepClone(this.form);
const params = {}; let oParams = {};
if (o.term) {
if (form.sTime && form.eTime) { oParams.term = o.term.trim();
if (this.dateType == "1") {
params.activationSTime = form.sTime;
params.activationETime = form.eTime;
this.createTag(
"activation",
"激活时间",
params.activationSTime + "至" + params.activationETime
);
} else if (this.dateType == "2") {
params.expirationSTime = form.sTime;
params.expirationETime = form.eTime;
this.createTag(
"expiration",
"到期时间",
params.expirationSTime + "至" + params.expirationETime
);
}
}
if (this.orderStatus) {
params.businessStatus = this.orderStatus;
const findItem = this.orderStatusOpts.find(
(obj) => obj.value == this.orderStatus
);
if (findItem) {
this.createTag("status", "业务工单状态", findItem.name);
}
}
if (this.gender) {
params.sex = this.gender;
this.createTag("sex", "性别", params.sex == "1" ? "男" : "女");
} }
if (this.classIdList) { oParams.termType = o.termType;
params.classIdList = this.classIdList; oParams.orgType = o.orgType;
this.createTag("classIdList", "客户归属", this.className); oParams.orgId = o.orgId;
if (o.timeDate && o.timeDate.length > 0) {
oParams.startTime = o.timeDate[0];
oParams.endTime = o.timeDate[1];
} }
return oParams;
return params;
}, },
infiniteHandler($state) { infiniteHandler($state) {
if (this.pageNumber > this.maxPage) { if (this.pageNumber > this.maxPage) {
$state.complete(); $state.complete();
return; return;
} }
this.params.pageNumber = this.pageNumber; let oParams = this.getParams();
this.params.pageSize = this.pageSize; oParams.pageNumber = this.pageNumber;
this.params.shopId = this.shopId; oParams.pageSize = this.pageSize;
GET_VEHICLE_LINKSNS(this.params).then((res) => { GET_ELECFENCE_LINKSNS(oParams).then((res) => {
const { code, data, message } = res; const { code, data, message } = res;
if (code == 200) { if (code == 200) {
const { list } = data; const { list } = data;
...@@ -441,6 +349,29 @@ export default { ...@@ -441,6 +349,29 @@ export default {
closeDialog() { closeDialog() {
this.$emit("onUserListModalChange", false); this.$emit("onUserListModalChange", false);
}, },
// 监听树
onChange(e) {
this.showGlsxOranization = false;
console.log(e);
if (e) {
this.orgInfo = e.origin;
this.form.orgId = e.origin.orgId;
this.form.orgType = e.origin.type;
this.form.orgName = e.origin.orgName;
}
},
// 打开高级搜索
showHighSearch() {
this.highSearchVisible = !this.highSearchVisible;
},
// 重置搜索条件
restParams() {
this.form = { termType: "1", timeType: "1" };
this.search();
},
}, },
}; };
</script> </script>
...@@ -518,4 +449,19 @@ ul.choose-list { ...@@ -518,4 +449,19 @@ ul.choose-list {
height: 32px; height: 32px;
padding: 4px 0; padding: 4px 0;
} }
.pre_select_box {
display: flex;
align-items: center;
.small_select {
width: 120px;
}
.data_picker {
width: 240px;
}
.mr5 {
margin-right: 5px;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -352,7 +352,8 @@ export default { ...@@ -352,7 +352,8 @@ export default {
} else { } else {
this.removeMonitor(item); this.removeMonitor(item);
} }
} else { return false;
}
if (this.isTreeChecked) { if (this.isTreeChecked) {
this.$confirm( this.$confirm(
"当所选分组包含车辆过多时,请尝试分多次查询,以防等待时间过久。", "当所选分组包含车辆过多时,请尝试分多次查询,以防等待时间过久。",
...@@ -362,13 +363,17 @@ export default { ...@@ -362,13 +363,17 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
} }
).then(() => { )
.then(() => {
this.checkFlow(data, node); this.checkFlow(data, node);
})
.catch(() => {
// 取消
this.$refs.tree.setChecked(data, false);
}); });
} else { return false;
this.checkFlow(data, node);
}
} }
this.checkFlow(data, node);
}, },
checkFlow(data, node) { checkFlow(data, node) {
...@@ -517,20 +522,14 @@ export default { ...@@ -517,20 +522,14 @@ export default {
oParams.termType = this.searchType; oParams.termType = this.searchType;
oParams.term = this.searchText; oParams.term = this.searchText;
} }
oParams.pageSize = 100;
oParams.pageNum = node.pageNum || 1
MONITOR_SERVICE.getVehicleTreeUserList(oParams).then(({ data }) => { MONITOR_SERVICE.getVehicleTreeUserList(oParams).then(({ data }) => {
if (data.length) { if (data.length) {
let arr = [];
data.map((item) => { data.map((item) => {
item.leaf = true; item.leaf = true;
}); });
if (data.length > 100) { return resolve(data);
arr = data.slice(0, 100);
this.treeDataList[node.data.id] = { data: data, idx: 1 };
} else {
arr = data;
}
return resolve(arr);
} }
return resolve([]); return resolve([]);
}); });
...@@ -1140,6 +1139,27 @@ export default { ...@@ -1140,6 +1139,27 @@ export default {
// 加载下一页 // 加载下一页
loadNext(node, data) { loadNext(node, data) {
console.log(data); console.log(data);
let oParams = {};
oParams.uId = nodeData.id;
oParams.termType = this.searchType;
oParams.term = this.searchText;
MONITOR_SERVICE.getVehicleTreeUserList(oParams).then(({ data }) => {
if (data.length) {
let arr = [];
data.map((item) => {
item.leaf = true;
});
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([]);
});
}, },
// 获取设备在线状态 // 获取设备在线状态
......
...@@ -67,7 +67,9 @@ export default { ...@@ -67,7 +67,9 @@ export default {
let query = this.$route.query; let query = this.$route.query;
let token = localStorage.getItem("token"); let token = localStorage.getItem("token");
this.uploadHeaders = { Authorization: token }; this.uploadHeaders = { Authorization: token };
if (query.id) {
this.uploadParams = { fenceId: query.id }; this.uploadParams = { fenceId: query.id };
}
}, },
methods: { methods: {
doneResult() { doneResult() {
......
...@@ -3,6 +3,7 @@ const EventBus = new Vue() ...@@ -3,6 +3,7 @@ const EventBus = new Vue()
import { Message, MessageBox, Loading } from 'element-ui' import { Message, MessageBox, Loading } from 'element-ui'
import moment from 'moment' import moment from 'moment'
let loadingInstance = '' let loadingInstance = ''
console.log(MessageBox)
export const Util = { export const Util = {
/** /**
* 简单alert * 简单alert
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!