|
|
@@ -4,9 +4,15 @@
|
|
|
margin
|
|
|
padding
|
|
|
background
|
|
|
+ horizontal
|
|
|
>
|
|
|
+ <department-tree
|
|
|
+ class="c-sibling-item c-sidebar u-width--md"
|
|
|
+ @change="onGroupChanged"
|
|
|
+ />
|
|
|
<schema-table
|
|
|
ref="table"
|
|
|
+ class="c-sibling-item far"
|
|
|
row-key="id"
|
|
|
:schema="schema"
|
|
|
@row-click="onRowClick"
|
|
|
@@ -78,7 +84,7 @@ import {
|
|
|
validLatitude
|
|
|
} from '@/utils/validate'
|
|
|
import {
|
|
|
- getDevices,
|
|
|
+ getDevicesByQuery,
|
|
|
getSubDevices,
|
|
|
activateDevice,
|
|
|
deactivateDevice,
|
|
|
@@ -91,7 +97,7 @@ export default {
|
|
|
return {
|
|
|
schema: {
|
|
|
keepalive: true,
|
|
|
- list: getDevices,
|
|
|
+ list: this.getDevicesByQuery,
|
|
|
transform: this.transform,
|
|
|
transformData: __SUB_DEVICE__ && this.transformTableData,
|
|
|
filters: [
|
|
|
@@ -127,7 +133,6 @@ export default {
|
|
|
type: 'warning',
|
|
|
label: '未设置'
|
|
|
} },
|
|
|
- { prop: 'address', label: '地址', 'min-width': 100 },
|
|
|
{ type: 'tag', render: ({ empty, activate, onlineStatus }) => empty
|
|
|
? null
|
|
|
: activate
|
|
|
@@ -149,6 +154,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onGroupChanged (group) {
|
|
|
+ this.$group = group
|
|
|
+ this.$refs.table?.pageTo(1)
|
|
|
+ },
|
|
|
+ getDevicesByQuery (params) {
|
|
|
+ if (!this.$group) {
|
|
|
+ return Promise.resolve({ data: [] })
|
|
|
+ }
|
|
|
+ return getDevicesByQuery({
|
|
|
+ org: this.$group.path,
|
|
|
+ ...params
|
|
|
+ })
|
|
|
+ },
|
|
|
transform (data) {
|
|
|
return {
|
|
|
...data,
|