Commit 5e0b0762 by 吴娟华

'1.2.1'

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