| | |
| | | /> |
| | | </div> |
| | | </el-tab-pane> |
| | | |
| | | <!-- 餐饮店铺管理 --> |
| | | <el-tab-pane label="餐饮店铺管理" name="restaurants"> |
| | | <div class="tab-content"> |
| | | <!-- 搜索和添加按钮 --> |
| | | <div class="search-add-bar"> |
| | | <el-input |
| | | v-model="restaurantSearchQuery" |
| | | placeholder="搜索店铺" |
| | | style="width: 200px" |
| | | prefix-icon="el-icon-search" |
| | | /> |
| | | <el-button type="primary" @click="openRestaurantDialog"> |
| | | <el-icon><Plus /></el-icon> 添加店铺 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- 店铺表格 --> |
| | | <el-table :data="filteredRestaurants" style="width: 100%"> |
| | | <el-table-column prop="id" label="ID" width="80" /> |
| | | <el-table-column prop="name" label="店铺名称" /> |
| | | <el-table-column prop="address" label="地址" /> |
| | | <el-table-column prop="contact" label="联系人" /> |
| | | <el-table-column prop="phone" label="联系电话" /> |
| | | <el-table-column label="操作" width="250"> |
| | | <template #default="scope"> |
| | | <el-button size="small" @click="editRestaurant(scope.row)"> 编辑 </el-button> |
| | | <el-button size="small" type="danger" @click="deleteRestaurant(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | <el-button size="small" @click="manageDevices(scope.row)"> 设备管理 </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- 分页 --> |
| | | <el-pagination |
| | | v-model:current-page="restaurantCurrentPage" |
| | | v-model:page-size="restaurantPageSize" |
| | | :page-sizes="[10, 20, 50]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="restaurants.length" |
| | | style="margin-top: 20px" |
| | | /> |
| | | </div> |
| | | </el-tab-pane> |
| | | |
| | | <!-- 设备管理 --> |
| | | <el-tab-pane label="设备管理" name="devices"> |
| | | <div class="tab-content" v-if="selectedRestaurant"> |
| | | <h3>{{ selectedRestaurant.name }} - 设备列表</h3> |
| | | |
| | | <!-- 搜索和添加按钮 --> |
| | | <div class="search-add-bar"> |
| | | <el-input |
| | | v-model="deviceSearchQuery" |
| | | placeholder="搜索设备" |
| | | style="width: 200px" |
| | | prefix-icon="el-icon-search" |
| | | /> |
| | | <el-button type="primary" @click="openDeviceDialog"> |
| | | <el-icon><Plus /></el-icon> 添加设备 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <!-- 设备表格 --> |
| | | <el-table :data="filteredDevices" style="width: 100%"> |
| | | <el-table-column prop="id" label="ID" width="80" /> |
| | | <el-table-column prop="deviceId" label="设备编号" /> |
| | | <el-table-column prop="type" label="设备类型" /> |
| | | <el-table-column prop="status" label="状态"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'online' ? 'success' : 'danger'"> |
| | | {{ scope.row.status === 'online' ? '在线' : '离线' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="installDate" label="安装日期" /> |
| | | <el-table-column label="操作" width="200"> |
| | | <template #default="scope"> |
| | | <el-button size="small" @click="editDevice(scope.row)"> 编辑 </el-button> |
| | | <el-button size="small" type="danger" @click="deleteDevice(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- 分页 --> |
| | | <el-pagination |
| | | v-model:current-page="deviceCurrentPage" |
| | | v-model:page-size="devicePageSize" |
| | | :page-sizes="[10, 20, 50]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="devices.length" |
| | | style="margin-top: 20px" |
| | | /> |
| | | </div> |
| | | <div class="tab-content" v-else> |
| | | <el-empty description="请先选择一个餐饮店铺" /> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-card> |
| | | |
| | |
| | | |
| | | // 用户管理相关 |
| | | const users = ref([ |
| | | { id: 1, username: 'admin', name: '管理员', role: 'admin', status: 'active' }, |
| | | { id: 2, username: 'user1', name: '用户1', role: 'user', status: 'active' }, |
| | | { |
| | | id: 3, |
| | | username: 'restaurant1', |
| | | name: '店铺管理员1', |
| | | id: 1, |
| | | username: 'fuxiaojie', |
| | | name: '付小姐在成都', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { id: 2, username: 'jike', name: '吉刻联盟', role: 'restaurant_admin', status: 'active' }, |
| | | { id: 3, username: 'jiazaitala', name: '家在塔啦', role: 'restaurant_admin', status: 'active' }, |
| | | { id: 4, username: 'langlailiao', name: '狼来了', role: 'restaurant_admin', status: 'active' }, |
| | | { id: 5, username: 'lekaisai', name: '乐凯撒星游店', role: 'restaurant_admin', status: 'active' }, |
| | | { |
| | | id: 6, |
| | | username: 'xinyuan', |
| | | name: '馨远美食小镇(哈尼美食广场)', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { id: 7, username: 'bangyuehan', name: '棒约翰', role: 'restaurant_admin', status: 'active' }, |
| | | { id: 8, username: 'nangtang', name: '弄堂咪道', role: 'restaurant_admin', status: 'active' }, |
| | | { |
| | | id: 9, |
| | | username: 'yangji', |
| | | name: '杨记齐齐哈尔烤肉', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { |
| | | id: 10, |
| | | username: 'rensheng', |
| | | name: '上海稔传餐饮管理有限公司(人生一串)', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { id: 11, username: 'yuanjia', name: '缘家', role: 'restaurant_admin', status: 'active' }, |
| | | { |
| | | id: 12, |
| | | username: 'quansheng', |
| | | name: '泉盛餐饮(上海)有限公司(食其家)', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { id: 13, username: 'fengmao', name: '丰茂烤串', role: 'restaurant_admin', status: 'active' }, |
| | | { |
| | | id: 14, |
| | | username: 'taihuang', |
| | | name: '上海泰煌餐饮管理有限公司(泰煌鸡)', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |
| | | { |
| | | id: 15, |
| | | username: 'chenxi', |
| | | name: '徐汇区辰熙餐馆(小铁君串烧居酒屋)', |
| | | role: 'restaurant_admin', |
| | | status: 'active', |
| | | }, |