鸿蒙智能电子锁前端项目
whychdw
2024-10-11 d5ca37c6301ac1178702e0334c4feee6abf3ba9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<script lang="ts">
import { defineComponent } from 'vue';
import HdwCard from '@/components/HdwCard/index.vue';
 
export default defineComponent({
  name: 'LockManage',
  components: { HdwCard },
  data() {
    return {
      tableData: [
        {
          type: '蓝牙',
          lockName: '机柜蓝牙锁3',
          associatedArea: '武汉源畅科技',
          installState: '未安装'
        }
      ],
      page: {
        currentPage: 1,
        pageSize: 20,
        total: 0
      }
    };
  },
  methods: {
 
  }
});
</script>
 
<script lang="ts" setup>
import {
  Search,
  Plus
} from '@element-plus/icons-vue';
import HdwTree from '@/components/HdwTree/index.vue';
</script>
 
<template>
  <div class="lock-wrapper">
    <div class="lock-header">
      <div class="hdw-card-container">
        <hdw-card title="区域列表" is-full>
          <hdw-tree></hdw-tree>
        </hdw-card>
      </div>
    </div>
    <div class="lock-content">
      <hdw-card is-full>
        <div class="lock-content-wrapper">
          <div class="lock-content-tools">
            <el-button type="primary" size="small" :icon="Search">查询</el-button>
            <el-button type="success" size="small" :icon="Plus">添加</el-button>
            <el-button type="success" size="small" :icon="Plus">批量添加</el-button>
            <div class="tools-filter">
              <div class="tools-filter-item">
                <div class="filter-label"></div>
                <div class="filter-content"></div>
              </div>
            </div>
          </div>
          <div class="lock-content-table">
            <div class="pos-rel">
              <div class="pos-abs">
                <el-table :data="tableData" border style="width: 100%; height: 100%">
                  <el-table-column type="index" width="50" />
                  <el-table-column prop="type" label="类型" width="180" />
                  <el-table-column prop="lockName" label="锁具名称" width="180" />
                  <el-table-column prop="associatedArea" label="关联区域" width="180" />
                  <el-table-column prop="installState" label="安装状态" width="180" />
                  <el-table-column prop="lockImg" label="锁具图片" width="180" />
                  <el-table-column prop="address" label="地址" />
                  <el-table-column align="center" fixed="right" label="操作" width="180">
                    <template #default>
                      <el-button type="primary" size="small">编辑</el-button>
                      <el-button type="danger" size="small">删除</el-button>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
          <div class="lock-content-page">
            <div class="page-tool"></div>
            <div class="el-page-container">
              <el-pagination
                  v-model:current-page="page.currentPage"
                  v-model:page-size="page.pageSize"
                  :page-sizes="[20, 40, 60, 80, 100, 200, 300, 400]"
                  size="small"
                  :disabled="disabled"
                  :background="background"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="page.total"
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
              />
            </div>
            <div class="page-tool"></div>
          </div>
        </div>
      </hdw-card>
    </div>
    <div class="lock-footer"></div>
  </div>
</template>
 
<style scoped lang="scss">
.lock-wrapper {
  display: flex;
  flex-direction: row;
  padding: 8px;
  height: 100%;
  .lock-content {
    flex: 1;
  }
}
 
.lock-content-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  .lock-content-tools {
    padding-bottom: 8px;
  }
  .lock-content-table {
    flex: 1;
    margin-left: -8px;
    margin-right: -8px;
  }
  .lock-content-page {
    padding: 8px 8px 0 8px;
    text-align: center;
    .el-page-container {
      display: inline-block;
      padding: 0 16px;
    }
    .page-tool {
      display: inline-block;
    }
  }
}
 
.hdw-card-container {
  width: 320px;
  padding-right: 8px;
  height: 100%;
}
.pos-rel {
  position: relative;
  width: 100%;
  height: 100%;
  .pos-abs {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
  }
}
</style>