Commit 5269e924 by 吴娟华

'1.2.1'

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