Commit 5269e924 by 吴娟华

'1.2.1'

1 parent 9213102a
......@@ -48,6 +48,10 @@ export default {
getHistoryLocation(params = {}) {
return request(params, '/devicemonitor/monitor/liststaypoint', 'get')
},
getOrgTree(params) {
return request(params, '/usercenter/organization/orgtree')
},
// 旧虎哥
/*车辆监控*/
// getCriteriaTreeList (request = {}) {
......
......@@ -53,7 +53,7 @@
</el-col>
<el-col :span="12">
<el-form-item class="special-shop-input" label="特约店" prop="specialShop">
<el-cascader
<!-- <el-cascader
v-model="form.specialShopName"
:value="form.specialShopName"
:placeholder="form.specialShopName || '请选择特约店名称'"
......@@ -63,7 +63,31 @@
@change="handleSpecialShopChange"
size="small"
:disabled="readonlyStatus"
></el-cascader>
></el-cascader> -->
<el-popover
v-model="filterVisible"
placement="top-end"
width="400"
@show="selectStore"
trigger="click">
<div v-loading="loading">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input>
<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>
<p style="text-align: right; margin-top: 10px">
<el-button @click="filterConfirm" type="primary">确定</el-button>
<el-button @click="closeFilter">取消</el-button>
</p>
</div>
<el-input
v-model="form.specialShopName"
:placeholder="form.specialShopName || '请选择特约店名称'"
slot="reference"
>
</el-input>
</el-popover>
</el-form-item>
</el-col>
</el-row>
......@@ -509,7 +533,12 @@ export default{
userListModalVisible:false,
selectedIds: [],
mapData: null,
polygonPath: []
polygonPath: [],
loading: true,
filterVisible: false,
filterText: "",
filterTextData: [],
// polygonPath: [
// ["113.989993", "22.588762"],
// ["113.993298", "22.590585"],
......@@ -549,7 +578,7 @@ export default{
created(){
let _this=this;
//this.getFenceSnsList();
this.getSpecialShopList();
//this.getSpecialShopList();
window.Vue.directive('loadmore', {
bind(el, binding) {
const selectWrap = el.querySelector('.el-table__body-wrapper')
......@@ -566,11 +595,58 @@ export default{
})
}
})
this.getStoreList()
},
mounted() {
this.listener();
},
methods: {
selectStore() {
if (this.isReadonly) return;
this.filterText = "";
this.filterDialogTitle = "选择所属组织";
if(!this.filterTextData.length) {
this.getStoreList();
}
//this.closeFilter();
},
closeFilter() {
this.filterVisible = !this.filterVisible;
},
getStoreList() {
let _this = this;
_this.loading = true;
MONITOR_SERVICE.getOrgTree({hasUserLeaf: true}).then((res) => {
const { code, data } = res;
_this.loading = false;
if (code == 200) {
this.filterTextData = data;
}
});
},
filterConfirm() {
const { label, id, origin } = this.$refs.tree.getCurrentNode();
if (origin.type != 'u') {
this.$message({
message: "请选择下级所属组织",
type: "error",
});
return;
}
this.form.specialShopName = label.split('/')[1]
this.form.specialShopCode = label.split('/')[0]
//this.$set(this, "form.specialShopName", label);
this.form.specialShopId = id;
this.closeFilter();
},
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
listener() {
const state = history.state;
if(!state) {
......
......@@ -14,9 +14,10 @@
size="small"
:popper-class="'search_auto'+(autocompleteHide?' search_auto_hide':'')"
v-model.trim="searchText"
maxlength="50"
:fetch-suggestions="querySearch"
:trigger-on-focus="false"
placeholder="请输入内容"
:placeholder="'请输入'+['6位以上设备号','6位以上车架号','2位以上姓名'][searchType-1]"
@select="handleSelect">
<!-- <el-input placeholder="请输入对应条件值" v-model.trim="searchText" size="small" class="input-with-select" @keyup.enter.native='searchSubmit'> -->
<el-select v-model="searchType" slot="prepend" placeholder="请选择" size="small" >
......@@ -246,7 +247,7 @@
['node-key']: 'id'
},
treeData: [],
expandedKeys: ['156'],
expandedKeys: [],
isTreeChecked: false,
checkedKeys: [],
autocompleteHide: true,
......@@ -290,6 +291,11 @@
return h('div', {class: 'custom-tree-node'},[
h('div', {
domProps: {
innerHTML: '姓名:'+node.data.label1||'--'
}
}),
h('div', {
domProps: {
innerHTML: '设备号:'+node.data.label
}
}),
......@@ -317,16 +323,18 @@
if(checked) {
//console.log(this.$refs.tree.getNode(data))
let node = this.$refs.tree.getNode(data)
console.log(1)
console.log(indeterminate)
//this.getAllChild(node)
//this.$refs.tree.store.defaultExpandAll = true
//this.$refs.tree.setCheckedKeys(['u8121'])
}
this.isTreeChecked = checked
this.expandedKeys = ['4593']
this.expandedKeys = []
},
handleCheck(data, node) {
console.log('node', data)
if(data.leaf) {
const item = {
sn: data.label,
......@@ -343,37 +351,61 @@
this.removeMonitor(item)
}
} else {
let action = MONITOR_SERVICE.getVehicleTreeUserIds
let params = {oId: data.id}
this.$confirm('当所选分组包含车辆过多时,请尝试分多次查询,以防等待时间过久。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let action = MONITOR_SERVICE.getVehicleTreeUserIds
let params = {oId: data.id}
if(data.origin.type === 'u') {
action = MONITOR_SERVICE.getVehicleTreeUserList
params = {uId: data.id}
}
this.treeLoading = true
action(params).then((res)=>{
this.treeLoading = false
const arr = res.data
const items = arr.map((item)=>{
return {
sn: item.label,
name: item.label1,
standNo: item.label2,
online: item.online,
id: item.id,
source: item.source==='有线'?'1':'0',
sourceType: item.source
if(data.origin.type === 'u') {
action = MONITOR_SERVICE.getVehicleTreeUserList
params = {uId: data.id}
}
this.treeLoading = true
action(params).then((res)=>{
this.treeLoading = false
let items = []
if(!res.tips) {
items = res.data.map((item)=>{
return {
sn: item.label,
name: item.label1,
standNo: item.label2,
online: item.online,
id: item.id,
source: item.source==='有线'?'1':'0',
sourceType: item.source
}
})
}else {
if(this.isTreeChecked) {
this.$message({
type: 'info',
message: res.tips
});
this.$refs.tree.setChecked(data, false)
if (data.children !== undefined) {
data.children.forEach((item, i) => {
this.$refs.tree.setChecked(item, false, true)
})
}
}
}
if(items.length) {
if(this.isTreeChecked) {
this.addMonitorByGroup(items)
}else{
this.removeMonitorByGroup(items)
}
}
})
//
console.log(items)
if(this.isTreeChecked) {
this.addMonitorByGroup(items)
}else{
this.removeMonitorByGroup(items)
}
})
}
},
......@@ -946,7 +978,7 @@
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 14px;
font-size: 12px;
padding-right: 8px;
line-height: 26px;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!