Commit 5e0b0762 by 吴娟华

'1.2.1'

1 parent 5269e924
...@@ -66,6 +66,12 @@ export default { ...@@ -66,6 +66,12 @@ export default {
// d.getElementsByTagName('main')[0].style['minHeight'] = y+'px' // d.getElementsByTagName('main')[0].style['minHeight'] = y+'px'
// } // }
// window.onresize() // window.onresize()
this.$onGlobalStateChange((state, prev) => {
if(state.isCollapsed != this.isCollapse) {
this.toggleCollapse()
}
})
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
......
...@@ -65,10 +65,14 @@ export async function bootstrap() { ...@@ -65,10 +65,14 @@ export async function bootstrap() {
export async function mount(props) { export async function mount(props) {
console.log('props from main framework', props.data); console.log('props from main framework', props.data);
actions.setActions(props); actions.setActions(props);
Vue.prototype.$onGlobalStateChange = props.onGlobalStateChange
Vue.prototype.$setGlobalState = props.setGlobalState
render(props); render(props);
props.setGlobalState({ props.setGlobalState({
}) })
console.log(props)
} }
export async function unmount() { export async function unmount() {
......
...@@ -564,7 +564,15 @@ export default{ ...@@ -564,7 +564,15 @@ export default{
}, },
lat(newVal){ lat(newVal){
//this.transfer() //this.transfer()
} },
filterText(val) {
this._timeout && clearTimeout(this._timeout)
this._timeout = setTimeout(()=>{
this.$refs.tree.filter(val)
},500)
}
}, },
computed: { computed: {
......
...@@ -351,63 +351,71 @@ ...@@ -351,63 +351,71 @@
this.removeMonitor(item) this.removeMonitor(item)
} }
} else { } else {
this.$confirm('当所选分组包含车辆过多时,请尝试分多次查询,以防等待时间过久。', '提示', { if(this.isTreeChecked) {
confirmButtonText: '确定', this.$confirm('当所选分组包含车辆过多时,请尝试分多次查询,以防等待时间过久。', '提示', {
cancelButtonText: '取消', confirmButtonText: '确定',
type: 'warning' cancelButtonText: '取消',
}).then(() => { type: 'warning'
let action = MONITOR_SERVICE.getVehicleTreeUserIds }).then(() => {
let params = {oId: data.id} this.checkFlow(data,node)
})
}else{
this.checkFlow(data,node)
}
}
},
checkFlow(data, node) {
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
let items = [] let items = []
if(!res.tips) { if(!res.tips) {
items = res.data.map((item)=>{ items = res.data.map((item)=>{
return { return {
sn: item.label, sn: item.label,
name: item.label1, name: item.label1,
standNo: item.label2, standNo: item.label2,
online: item.online, online: item.online,
id: item.id, id: item.id,
source: item.source==='有线'?'1':'0', source: item.source==='有线'?'1':'0',
sourceType: item.source 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)
}
} }
}) })
}) }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)
}
}
})
}, },
getAllChild(node) { getAllChild(node) {
if(node.childNodes.length === 0 && !node.data.test) { if(node.childNodes.length === 0 && !node.data.test) {
...@@ -1004,4 +1012,8 @@ ...@@ -1004,4 +1012,8 @@
.el-autocomplete-suggestion li:last-child{ .el-autocomplete-suggestion li:last-child{
border-bottom: none; border-bottom: none;
} }
.full-width .main-wrap.full-width{
left: 0;
width: 100%;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -349,11 +349,11 @@ MapService.prototype = { ...@@ -349,11 +349,11 @@ MapService.prototype = {
if(info.alarmTypeSet && info.alarmTypeSet.length){ if(info.alarmTypeSet && info.alarmTypeSet.length){
let _html = '<i class="icon icon-info_device_alarm"></i>报警状态:' let _html = '<i class="icon icon-info_device_alarm"></i>报警状态:'
info.alarmTypeSet.forEach((item)=>{ info.alarmTypeSet.forEach((alarmType)=>{
if(item.alarmType === 1){ if(alarmType === 1){
_html+=`<button type="button" class="el-button el-button--mini el-button--danger" data-alarmoff data-alarmtime="${item.alarmTime}">断电</button>` _html+=`<button type="button" class="el-button el-button--mini el-button--danger" data-alarmoff >断电</button>`
}else if(item.alarmType === 99){ }else if(alarmType === 99){
_html+=`<button type="button" class="el-button el-button--mini el-button--danger" data-alarmlight data-alarmtime="${item.alarmTime}">光感</button>` _html+=`<button type="button" class="el-button el-button--mini el-button--danger" data-alarmlight >光感</button>`
} }
}); });
infoDiv.querySelector('[data-alarm]').innerHTML = _html; infoDiv.querySelector('[data-alarm]').innerHTML = _html;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!