|
|
@@ -1,8 +1,91 @@
|
|
|
<template>
|
|
|
- <div>group</div>
|
|
|
+ <a-row :gutter="[8, 8]" >
|
|
|
+ <a-col :lg="5" :md="8" :xs="24">
|
|
|
+ <a-card style="height: 100%;" >
|
|
|
+ <template #title >
|
|
|
+ <a-row justify="space-between" align="middle" >
|
|
|
+ <a-col><a-button type="primary" >+ 新增设备群组</a-button></a-col>
|
|
|
+ <a-col><ReloadIconTsx :loading="state.groupLoading" @reload="getDeviceGroup"/></a-col>
|
|
|
+ </a-row>
|
|
|
+ </template>
|
|
|
+ <a-tree
|
|
|
+ v-model:expandedKeys="expandedKeys"
|
|
|
+ v-model:selectedKeys="selectedKeys"
|
|
|
+ v-model:checkedKeys="checkedKeys"
|
|
|
+ :tree-data="treeData"
|
|
|
+ >
|
|
|
+ <template #title="{ title, key }">
|
|
|
+ <a-space >
|
|
|
+ <span> {{ title }} </span>
|
|
|
+ <plus-circle-outlined />
|
|
|
+ <delete-outlined />
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ </a-tree>
|
|
|
+ </a-card>
|
|
|
+ </a-col>
|
|
|
+ <a-col :lg="19" :md="16" :xs="24">
|
|
|
+ <a-card style="height: 100%;" >3</a-card>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup >
|
|
|
+import { ReloadIconTsx } from '@/components/MicroComponents/index'
|
|
|
+import { DeviceContriller } from '@/controller'
|
|
|
+import { onMounted, reactive, ref, watch } from 'vue'
|
|
|
+import { PlusCircleOutlined, DeleteOutlined } from '@ant-design/icons-vue'
|
|
|
+const treeData: TreeProps['treeData'] = [
|
|
|
+ {
|
|
|
+ title: '所有分组',
|
|
|
+ key: '0-0',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: 'parent 1-0',
|
|
|
+ key: '0-0-0',
|
|
|
+ children: [
|
|
|
+ { title: 'leaf', key: '0-0-0-0', disableCheckbox: true },
|
|
|
+ { title: 'leaf', key: '0-0-0-1' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'parent 1-1',
|
|
|
+ key: '0-0-1',
|
|
|
+ children: [{ key: '0-0-1-0', title: 'sss' }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+const expandedKeys = ref<string[]>(['0-0-0', '0-0-1'])
|
|
|
+const selectedKeys = ref<string[]>(['0-0-0', '0-0-1'])
|
|
|
+const checkedKeys = ref<string[]>(['0-0-0', '0-0-1'])
|
|
|
+watch(expandedKeys, () => {
|
|
|
+ console.log('expandedKeys', expandedKeys)
|
|
|
+})
|
|
|
+watch(selectedKeys, () => {
|
|
|
+ console.log('selectedKeys', selectedKeys)
|
|
|
+})
|
|
|
+watch(checkedKeys, () => {
|
|
|
+ console.log('checkedKeys', checkedKeys)
|
|
|
+})
|
|
|
+
|
|
|
+const state = reactive({
|
|
|
+ groupLoading: false,
|
|
|
+ groupDateSource: []
|
|
|
+})
|
|
|
+
|
|
|
+const getDeviceGroup = async () => {
|
|
|
+ state.groupLoading = true
|
|
|
+ const data = await DeviceContriller.listDeviceGroup({ upperGroupId: '' })
|
|
|
+ state.groupLoading = false
|
|
|
+ state.groupDateSource = data
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style>
|