Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lbs-gpsbd-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yangkaiyi
lbs-gpsbd-web
Commits
889ff121
Commit
889ff121
authored
May 30, 2021
by
yangkaiyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
存档
parent
7eb1fa4a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
362 additions
and
112 deletions
+362
-112
util.js
src/utils/util.js
+6
-6
websocket.js
src/utils/websocket.js
+40
-1
Menu.vue
src/views/map/components/menu/Menu.vue
+227
-30
Message.vue
src/views/map/components/tools/Message.vue
+4
-4
devices.vue
src/views/system/devices.vue
+75
-61
user.js
src/vuex/modules/user.js
+8
-8
mutations.js
src/vuex/mutations.js
+2
-2
No files found.
src/utils/util.js
View file @
889ff121
...
@@ -123,12 +123,12 @@ export default {
...
@@ -123,12 +123,12 @@ export default {
]
+
]
+
"]"
"]"
:
""
),
:
""
),
messages
[
store
.
state
.
common
.
system
.
lang
].
map
.
popupMileage
+
//
messages[store.state.common.system.lang].map.popupMileage +
":"
+
//
":" +
(
attributes
.
todaytrip
?
attributes
.
todaytrip
:
0
)
+
//
(attributes.todaytrip ? attributes.todaytrip : 0) +
"/"
+
//
"/" +
(
attributes
.
trip
?
attributes
.
trip
:
0
)
+
//
(attributes.trip ? attributes.trip : 0) +
" km"
,
//
" km",
messages
[
store
.
state
.
common
.
system
.
lang
].
common
.
time
+
messages
[
store
.
state
.
common
.
system
.
lang
].
common
.
time
+
":"
+
":"
+
this
.
dateFormat
(
device
.
position
.
time
,
"YYYY-MM-DD HH:mm:ss"
),
this
.
dateFormat
(
device
.
position
.
time
,
"YYYY-MM-DD HH:mm:ss"
),
...
...
src/utils/websocket.js
View file @
889ff121
import
{
Message
}
from
"element-ui"
;
import
{
Message
,
Notification
}
from
"element-ui"
;
import
util
from
"./util"
;
let
token
=
""
;
let
token
=
""
;
if
(
localStorage
.
user
)
{
if
(
localStorage
.
user
)
{
...
@@ -31,18 +32,56 @@ const ws = {
...
@@ -31,18 +32,56 @@ const ws = {
}
}
};
};
this
.
websocket
.
onmessage
=
function
(
evt
)
{
this
.
websocket
.
onmessage
=
function
(
evt
)
{
console
.
log
(
"evt"
,
JSON
.
parse
(
evt
.
data
));
if
(
evt
.
data
)
{
if
(
evt
.
data
)
{
let
socketMsg
=
JSON
.
parse
(
evt
.
data
);
let
socketMsg
=
JSON
.
parse
(
evt
.
data
);
if
(
socketMsg
.
positions
)
{
if
(
socketMsg
.
positions
)
{
self
.
$store
.
dispatch
(
"updateDevicePosition"
,
socketMsg
.
positions
);
self
.
$store
.
dispatch
(
"updateDevicePosition"
,
socketMsg
.
positions
);
}
else
if
(
socketMsg
.
devices
)
{
}
else
if
(
socketMsg
.
devices
)
{
self
.
$store
.
dispatch
(
"updateDeviceStatus"
,
socketMsg
.
devices
);
self
.
$store
.
dispatch
(
"updateDeviceStatus"
,
socketMsg
.
devices
);
const
name
=
self
.
$store
.
state
.
user
.
devices
.
list
[
self
.
$store
.
state
.
user
.
devices
.
index
[
socketMsg
.
devices
[
0
].
deviceId
]
].
name
;
let
type
;
try
{
type
=
JSON
.
parse
(
socketMsg
.
devices
[
0
].
attributes
).
alarm
;
}
catch
(
e
)
{
type
=
socketMsg
.
devices
[
0
].
attributes
.
alarm
;
}
const
txt
=
{
sos
:
"求救报警"
,
idle
:
"静默报警"
,
vibration
:
"vibration"
,
powerOff
:
"断电,请及时查看"
,
powerCut
:
"断电,请及时查看"
,
lowBattery
:
"低电报警"
,
removing
:
"拆除报警"
,
fault
:
"fault"
,
};
Notification
({
title
:
`
${
name
}
${
txt
[
type
]}
`
,
message
:
util
.
dateFormat
(
socketMsg
.
devices
[
0
].
time
,
"YYYY-MM-DD HH:mm:ss"
),
duration
:
0
,
type
:
"warning"
,
});
}
else
if
(
socketMsg
.
commands
)
{
}
else
if
(
socketMsg
.
commands
)
{
self
.
$store
.
dispatch
(
"responseCommand"
,
socketMsg
.
commands
);
self
.
$store
.
dispatch
(
"responseCommand"
,
socketMsg
.
commands
);
}
}
}
}
};
};
this
.
websocket
.
onerror
=
function
(
evt
)
{};
this
.
websocket
.
onerror
=
function
(
evt
)
{};
// test代码
// let str = {
// data:
// '{"devices":[{"attributes":"{\\"alarm\\":\\"powerCut\\"}","deviceId":45,"id":45,"status":9,"time":1621495646355}]}',
// };
// this.websocket.onmessage(str);
},
},
reconnection
:
function
(
val
)
{
reconnection
:
function
(
val
)
{
ws
.
connection
=
false
;
ws
.
connection
=
false
;
...
...
src/views/map/components/menu/Menu.vue
View file @
889ff121
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</el-tooltip>
</el-tooltip>
</div>
</div>
</
template
>
</
template
>
<el-row>
<el-row
style=
"margin-top: 5px"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<div
class=
"title"
>
<div
class=
"title"
>
<el-button-group>
<el-button-group>
...
@@ -65,17 +65,19 @@
...
@@ -65,17 +65,19 @@
type=
"primary"
type=
"primary"
size=
"small"
size=
"small"
>
>
<el-dropdown
@
command=
"deviceHandler
"
>
<el-dropdown
trigger=
"click
"
>
<span
style=
"color: #fff
"
>
生物管理
</span>
<span
class=
"mybutton
"
>
生物管理
</span>
<span
class=
"el-dropdown-link"
>
<span
class=
"el-dropdown-link"
>
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</span>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"add"
icon=
"el-icon-plus"
>
{{
$t("map.menuDeviceAdd")
}}
</el-dropdown-item>
<el-dropdown-item
<el-dropdown-item
command=
"edit"
@
click
.
native=
"handlerAdd"
icon=
"el-icon-plus"
>
{{ $t("map.menuDeviceAdd") }}
</el-dropdown-item
>
<el-dropdown-item
@
click
.
native=
"handleEdit"
icon=
"el-icon-edit"
icon=
"el-icon-edit"
:disabled=
"
:disabled=
"
this.$store.state.user.devices.selectId == 0
this.$store.state.user.devices.selectId == 0
...
@@ -83,7 +85,7 @@
...
@@ -83,7 +85,7 @@
>
{{ $t("common.edit") }}
</el-dropdown-item
>
{{ $t("common.edit") }}
</el-dropdown-item
>
>
<el-dropdown-item
<el-dropdown-item
command=
"del
"
@
click
.
native=
"handleDelete
"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
:disabled=
"
:disabled=
"
this.$store.state.user.devices.selectId == 0
this.$store.state.user.devices.selectId == 0
...
@@ -106,7 +108,7 @@
...
@@ -106,7 +108,7 @@
>
>
{{ $t("map.userGroupManage") }}
{{ $t("map.userGroupManage") }}
</el-button>
</el-button>
<
!-- <
el-tooltip
<el-tooltip
class=
"item"
class=
"item"
effect=
"dark"
effect=
"dark"
content=
"历史轨迹"
content=
"历史轨迹"
...
@@ -121,7 +123,7 @@
...
@@ -121,7 +123,7 @@
:disabled=
"this.$store.state.user.devices.selectId == 0"
:disabled=
"this.$store.state.user.devices.selectId == 0"
></el-button>
></el-button>
</el-tooltip>
</el-tooltip>
<el-tooltip
<
!-- <
el-tooltip
class="item"
class="item"
effect="dark"
effect="dark"
content="地理围栏"
content="地理围栏"
...
@@ -285,6 +287,86 @@
...
@@ -285,6 +287,86 @@
<DeviceBox></DeviceBox>
<DeviceBox></DeviceBox>
</el-collapse-item>
</el-collapse-item>
</el-collapse>
</el-collapse>
<!-- 新增、编辑弹窗 -->
<el-dialog
class=
"form-dialog"
:title=
"`${isEdit ? '编辑' : '添加'}重要有害植物`"
:visible
.
sync=
"editDialogVisible"
width=
"50%"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form
:model=
"editForm"
ref=
"editFormRef"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"名称"
prop=
"name"
:rules=
"[
{
required: true,
message: '请输入有害植物名称',
trigger: ['blur', 'change'],
},
]"
>
<el-input
v-model=
"editForm.name"
auto-complete=
"off"
:disabled=
"isEdit"
></el-input>
</el-form-item>
<el-form-item
label=
"IMEI"
prop=
"imei"
:rules=
"[
{
required: true,
message: '请输入IMEI',
trigger: ['blur', 'change'],
},
]"
>
<el-input
v-model=
"editForm.imei"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"报关号"
prop=
"clearanceID"
>
<el-input
v-model=
"editForm.clearanceID"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"来源国"
prop=
"countryOfOrigin"
>
<el-input
v-model=
"editForm.countryOfOrigin"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"携带有害生物"
prop=
"carryPestName"
>
<el-input
v-model=
"editForm.carryPestName"
auto-complete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remarks"
>
<el-input
v-model=
"editForm.remarks"
></el-input>
</el-form-item>
</el-form>
</el-col>
<el-col
:span=
"12"
>
<GroupTree
@
handleNodeClick=
"handleNodeClick"
:currentKey=
"editForm.groupId"
></GroupTree>
</el-col>
</el-row>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"editDialogVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handlerSubmit"
>
确 定
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -298,12 +380,18 @@ import Records from "../command/Records";
...
@@ -298,12 +380,18 @@ import Records from "../command/Records";
import
Medias
from
"../media/index"
;
import
Medias
from
"../media/index"
;
import
Stop
from
"../statistics/Stop"
;
import
Stop
from
"../statistics/Stop"
;
import
UserTree
from
"@/views/layout/components/UserTree"
;
import
UserTree
from
"@/views/layout/components/UserTree"
;
import
GroupTree
from
"./GroupTree"
;
import
{
import
{
delDevice
,
delDevice
,
updateDevice
,
updateDevice
,
deleteGroup
,
deleteGroup
,
moveGroup
,
moveGroup
,
sendMedia
,
sendMedia
,
getAllDevices
,
getDevices
,
addDevices
,
updateDevices
,
deleteDevices
,
}
from
"@/api/api"
;
}
from
"@/api/api"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
export
default
{
export
default
{
...
@@ -363,6 +451,11 @@ export default {
...
@@ -363,6 +451,11 @@ export default {
label
:
"name"
,
label
:
"name"
,
},
},
commands
:
[],
commands
:
[],
editDialogVisible
:
false
,
editForm
:
{
roleIds
:
[],
},
isEdit
:
false
,
};
};
},
},
...
@@ -374,25 +467,6 @@ export default {
...
@@ -374,25 +467,6 @@ export default {
this
.
commands
=
[];
this
.
commands
=
[];
}
}
},
},
// loadCommand(){
// this.optionsMenu[3].children=[];
// var cmdIds = this.$store.state.user.dict.cmdIdsByType[this.selectDevice.typeId];
//
// var cmdViews = this.$store.state.user.dict.commandViews;
// if(cmdIds){
// cmdIds.forEach(cmdId => {
// this.optionsMenu[3].children.push({
// value: cmdId,
// label: cmdViews[cmdId].name
// })
//
// });
// this.optionsMenu[3].children.push({
// value: 0,
// label: '[命令记录]'
// })
// }
// },
loadCommand
()
{
loadCommand
()
{
var
cmdIds
=
this
.
$store
.
state
.
user
.
dict
.
cmdIdsByType
[
var
cmdIds
=
this
.
$store
.
state
.
user
.
dict
.
cmdIdsByType
[
this
.
selectDevice
.
typeId
this
.
selectDevice
.
typeId
...
@@ -407,6 +481,7 @@ export default {
...
@@ -407,6 +481,7 @@ export default {
});
});
}
}
},
},
// 旧方法
deviceHandler
(
v
)
{
deviceHandler
(
v
)
{
switch
(
v
)
{
switch
(
v
)
{
case
"add"
:
case
"add"
:
...
@@ -450,6 +525,106 @@ export default {
...
@@ -450,6 +525,106 @@ export default {
default
:
default
:
}
}
},
},
handleNodeClick
(
node
)
{
this
.
editForm
.
groupId
=
node
.
id
;
},
// 弹窗提交
handlerSubmit
()
{
this
.
$refs
[
"editFormRef"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
const
empty
=
""
;
const
placeholderData
=
{
attributes
:
{
todaytrip
:
0
,
trip
:
0
,
},
carryPestName
:
empty
,
clearanceID
:
empty
,
countryOfOrigin
:
empty
,
groupId
:
0
,
icon
:
empty
,
id
:
0
,
imei
:
empty
,
intercom
:
0
,
lastUpdate
:
moment
()
.
subtract
(
"10000"
,
"ms"
)
.
format
(
"YYYY-MM-DDTHH:mm:ss.0000"
),
name
:
empty
,
positionId
:
0
,
remarks
:
empty
,
sim
:
new
Date
()
*
1
,
speedLimit
:
0
,
status
:
0
,
time
:
moment
()
.
subtract
(
"10000"
,
"ms"
)
.
format
(
"YYYY-MM-DDTHH:mm:ss.0000"
),
typeId
:
0
,
uuid
:
new
Date
()
*
1
,
video
:
empty
,
};
const
formData
=
Object
.
assign
(
placeholderData
,
this
.
editForm
);
if
(
!
this
.
isEdit
)
{
addDevices
(
formData
).
then
((
data
)
=>
{
this
.
$message
({
type
:
"success"
,
message
:
"保存成功!"
,
});
this
.
editForm
=
{};
this
.
editDialogVisible
=
false
;
this
.
$store
.
dispatch
(
"initData"
);
//初始化重要有害植物数据
});
}
else
{
updateDevices
(
formData
).
then
((
data
)
=>
{
console
.
log
(
45565656
,
data
);
this
.
$message
({
type
:
"success"
,
message
:
"更新成功!"
,
});
this
.
editForm
=
{};
this
.
editDialogVisible
=
false
;
this
.
$store
.
dispatch
(
"initData"
);
//初始化重要有害植物数据
});
}
}
});
},
// 打开添加弹窗
handlerAdd
()
{
this
.
isEdit
=
false
;
this
.
editForm
=
{};
this
.
editDialogVisible
=
true
;
},
// 打开编辑弹窗
handleEdit
()
{
let
index
=
this
.
$store
.
state
.
user
.
devices
.
index
[
this
.
$store
.
state
.
user
.
devices
.
selectId
];
let
device
=
this
.
$store
.
state
.
user
.
devices
.
list
[
index
];
console
.
log
(
112222
,
device
);
this
.
isEdit
=
true
;
this
.
editForm
=
device
;
this
.
editDialogVisible
=
true
;
},
// 点删除
handleDelete
()
{
let
index
=
this
.
$store
.
state
.
user
.
devices
.
index
[
this
.
$store
.
state
.
user
.
devices
.
selectId
];
let
device
=
this
.
$store
.
state
.
user
.
devices
.
list
[
index
];
this
.
$confirm
(
"是否确定删除该有害植物?"
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
,
}).
then
(()
=>
{
deleteDevices
(
device
.
id
).
then
((
data
)
=>
{
this
.
$message
({
type
:
"success"
,
message
:
"删除成功!"
,
});
this
.
$store
.
dispatch
(
"initData"
);
//初始化重要有害植物数据
});
});
},
commandHandler
(
v
)
{
commandHandler
(
v
)
{
console
.
log
(
v
);
console
.
log
(
v
);
this
.
commandId
=
v
;
this
.
commandId
=
v
;
...
@@ -849,6 +1024,7 @@ export default {
...
@@ -849,6 +1024,7 @@ export default {
Medias
,
Medias
,
Stop
,
Stop
,
UserTree
,
UserTree
,
GroupTree
,
},
},
mounted
()
{
mounted
()
{
var
_this
=
this
;
var
_this
=
this
;
...
@@ -867,7 +1043,28 @@ export default {
...
@@ -867,7 +1043,28 @@ export default {
},
},
};
};
</
script
>
</
script
>
<
style
>
<
style
lang=
"scss"
>
.mybutton
{
color
:
#fff
;
position
:
relative
;
&
:after
{
position
:
absolute
;
content
:
""
;
display
:
block
;
left
:
-15px
;
right
:
-35px
;
top
:
-7px
;
bottom
:
-7px
;
}
}
.form-dialog
{
.el-row
{
margin-bottom
:
20px
;
&
:last-child
{
margin-bottom
:
0
;
}
}
}
.oper-menu
{
.oper-menu
{
float
:
right
;
float
:
right
;
position
:
absolute
;
position
:
absolute
;
...
...
src/views/map/components/tools/Message.vue
View file @
889ff121
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
>
>
<el-option
:key=
"-1"
label=
"全部"
:value=
"-1"
/>
<el-option
:key=
"-1"
label=
"全部"
:value=
"-1"
/>
<el-option
<el-option
v-for=
"
item
in $store.state.user.devices.list"
v-for=
"
(item, i)
in $store.state.user.devices.list"
:key=
"i
tem.id
"
:key=
"i"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
>
>
...
@@ -18,8 +18,8 @@
...
@@ -18,8 +18,8 @@
<el-select
size=
"mini"
v-model=
"typeId"
placeholder=
"请类型"
@
change=
"init"
>
<el-select
size=
"mini"
v-model=
"typeId"
placeholder=
"请类型"
@
change=
"init"
>
<el-option
label=
"全部"
:value=
"-1"
/>
<el-option
label=
"全部"
:value=
"-1"
/>
<el-option
<el-option
v-for=
"
item
in eventTypes"
v-for=
"
(item, i)
in eventTypes"
:key=
"i
tem.id
"
:key=
"i"
:label=
"item.name"
:label=
"item.name"
:value=
"item.id"
:value=
"item.id"
>
>
...
...
src/views/system/devices.vue
View file @
889ff121
...
@@ -155,71 +155,80 @@
...
@@ -155,71 +155,80 @@
:devices=
"selectDevices"
:devices=
"selectDevices"
@
visible=
"closeDialog"
@
visible=
"closeDialog"
></TransferDevice>
></TransferDevice>
<!--
编辑
-->
<!--
新增、编辑弹窗
-->
<el-dialog
<el-dialog
:title=
"`${isEdit ? '编辑' : '添加'}重要有害植物`"
:title=
"`${isEdit ? '编辑' : '添加'}重要有害植物`"
:visible
.
sync=
"editDialogVisible"
:visible
.
sync=
"editDialogVisible"
width=
"
4
0%"
width=
"
5
0%"
>
>
<el-form
<el-row
:gutter=
"20"
>
:model=
"editForm"
<el-col
:span=
"12"
>
ref=
"editFormRef"
<el-form
label-width=
"100px"
:model=
"editForm"
class=
"demo-ruleForm"
ref=
"editFormRef"
>
label-width=
"100px"
<!-- 新增、编辑弹窗 -->
class=
"demo-ruleForm"
<el-form-item
>
label=
"名称"
<el-form-item
prop=
"name"
label=
"名称"
:rules=
"[
prop=
"name"
{
:rules=
"[
required: true,
{
message: '请输入有害植物名称',
required: true,
trigger: ['blur', 'change'],
message: '请输入有害植物名称',
},
trigger: ['blur', 'change'],
]"
},
>
]"
<el-input
>
v-model=
"editForm.name"
<el-input
auto-complete=
"off"
v-model=
"editForm.name"
:disabled=
"isEdit"
auto-complete=
"off"
></el-input>
:disabled=
"isEdit"
</el-form-item>
></el-input>
<el-form-item
</el-form-item>
label=
"IMEI"
<el-form-item
prop=
"imei"
label=
"IMEI"
:rules=
"[
prop=
"imei"
{
:rules=
"[
required: true,
{
message: '请输入IMEI',
required: true,
trigger: ['blur', 'change'],
message: '请输入IMEI',
},
trigger: ['blur', 'change'],
]"
},
>
]"
<el-input
v-model=
"editForm.imei"
auto-complete=
"off"
></el-input>
>
</el-form-item>
<el-input
v-model=
"editForm.imei"
auto-complete=
"off"
></el-input>
<el-form-item
label=
"报关号"
prop=
"clearanceID"
>
</el-form-item>
<el-input
<el-form-item
label=
"报关号"
prop=
"clearanceID"
>
v-model=
"editForm.clearanceID"
<el-input
auto-complete=
"off"
v-model=
"editForm.clearanceID"
></el-input>
auto-complete=
"off"
</el-form-item>
></el-input>
<el-form-item
label=
"来源国"
prop=
"countryOfOrigin"
>
</el-form-item>
<el-input
<el-form-item
label=
"来源国"
prop=
"countryOfOrigin"
>
v-model=
"editForm.countryOfOrigin"
<el-input
auto-complete=
"off"
v-model=
"editForm.countryOfOrigin"
></el-input>
auto-complete=
"off"
</el-form-item>
></el-input>
<el-form-item
label=
"携带有害生物"
prop=
"carryPestName"
>
</el-form-item>
<el-input
<el-form-item
label=
"携带有害生物"
prop=
"carryPestName"
>
v-model=
"editForm.carryPestName"
<el-input
auto-complete=
"off"
v-model=
"editForm.carryPestName"
></el-input>
auto-complete=
"off"
</el-form-item>
></el-input>
<el-form-item
label=
"备注"
prop=
"remarks"
>
</el-form-item>
<el-input
v-model=
"editForm.remarks"
></el-input>
<el-form-item
label=
"备注"
prop=
"remarks"
>
</el-form-item>
<el-input
v-model=
"editForm.remarks"
></el-input>
</el-form>
</el-form-item>
</el-form>
</el-col>
<el-col
:span=
"12"
>
<GroupTree
@
handleNodeClick=
"handleNodeClick"
:currentKey=
"editForm.groupId"
></GroupTree>
</el-col>
</el-row>
<span
slot=
"footer"
class=
"dialog-footer"
>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"editDialogVisible = false"
>
取 消
</el-button>
<el-button
@
click=
"editDialogVisible = false"
>
取 消
</el-button>
...
@@ -234,6 +243,7 @@ import moment from "moment";
...
@@ -234,6 +243,7 @@ import moment from "moment";
import
util
from
"@/utils/util"
;
import
util
from
"@/utils/util"
;
import
InDevice
from
"./components/InDevice"
;
import
InDevice
from
"./components/InDevice"
;
import
TransferDevice
from
"./components/TransferDevice"
;
import
TransferDevice
from
"./components/TransferDevice"
;
import
GroupTree
from
"../map/components/menu/GroupTree"
;
import
{
import
{
getAllDevices
,
getAllDevices
,
getDevices
,
getDevices
,
...
@@ -307,6 +317,9 @@ export default {
...
@@ -307,6 +317,9 @@ export default {
this
.
data
=
data
;
this
.
data
=
data
;
});
});
},
},
handleNodeClick
(
node
)
{
this
.
editForm
.
groupId
=
node
.
id
;
},
// 弹窗提交
// 弹窗提交
handlerSubmit
()
{
handlerSubmit
()
{
this
.
$refs
[
"editFormRef"
].
validate
((
valid
)
=>
{
this
.
$refs
[
"editFormRef"
].
validate
((
valid
)
=>
{
...
@@ -478,6 +491,7 @@ export default {
...
@@ -478,6 +491,7 @@ export default {
components
:
{
components
:
{
InDevice
,
InDevice
,
TransferDevice
,
TransferDevice
,
GroupTree
,
},
},
};
};
</
script
>
</
script
>
...
...
src/vuex/modules/user.js
View file @
889ff121
...
@@ -77,12 +77,12 @@ export const moduleUser = {
...
@@ -77,12 +77,12 @@ export const moduleUser = {
enable
:
false
,
enable
:
false
,
},
},
status
:
{
status
:
{
0
:
"eventOffline"
,
0
:
"eventOffline"
,
//上线
1
:
"eventOnline"
,
1
:
"eventOnline"
,
//下线
2
:
"eventFenceEnter"
,
2
:
"eventFenceEnter"
,
//进围栏
3
:
"eventFenceExit"
,
3
:
"eventFenceExit"
,
//出围栏
4
:
"eventOverSpeed"
,
4
:
"eventOverSpeed"
,
//超速
9
:
"eventAlarm"
,
9
:
"eventAlarm"
,
//重要有害植物报警
},
//事件状态字典
},
//事件状态字典
alarms
:
{
alarms
:
{
sos
:
"求救报警"
,
sos
:
"求救报警"
,
...
@@ -185,8 +185,8 @@ export const moduleUser = {
...
@@ -185,8 +185,8 @@ export const moduleUser = {
userConfig
:
{
userConfig
:
{
events
:
{
events
:
{
0
:
false
,
0
:
false
,
1
:
tru
e
,
1
:
fals
e
,
2
:
tru
e
,
2
:
fals
e
,
3
:
true
,
3
:
true
,
4
:
true
,
4
:
true
,
5
:
false
,
5
:
false
,
...
...
src/vuex/mutations.js
View file @
889ff121
...
@@ -120,6 +120,7 @@ export default {
...
@@ -120,6 +120,7 @@ export default {
);
);
}
}
if
(
state
.
user
.
userConfig
.
events
[
devstatus
.
status
])
{
if
(
state
.
user
.
userConfig
.
events
[
devstatus
.
status
])
{
// TODO:需不需要提示?devstatus.status是配置什么
Notification
({
Notification
({
title
:
title
:
state
.
user
.
devices
.
list
[
index
].
name
+
state
.
user
.
devices
.
list
[
index
].
name
+
...
@@ -129,8 +130,7 @@ export default {
...
@@ -129,8 +130,7 @@ export default {
],
],
message
:
util
.
dateFormat
(
devstatus
.
time
,
"YYYY-MM-DD HH:mm:ss"
),
message
:
util
.
dateFormat
(
devstatus
.
time
,
"YYYY-MM-DD HH:mm:ss"
),
type
:
devstatus
.
status
==
1
?
"success"
:
"warning"
,
type
:
devstatus
.
status
==
1
?
"success"
:
"warning"
,
duration
:
60000
,
duration
:
0
,
offset
:
60
,
});
});
state
.
user
.
playAlarmSound
=
true
;
state
.
user
.
playAlarmSound
=
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment