| | |
| | | <el-button @click="resetSearch">重置</el-button> |
| | | </el-form-item> |
| | | <el-form-item class="push-right"> |
| | | <el-button type="success" @click="openCreate">添加区域</el-button> |
| | | <el-button type="primary" @click="openCreate">添加区域</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-table :data="rows" v-loading="loading" stripe border> |
| | | <el-table-column label="序号" width="64" type="index" :index="indexMethod" /> |
| | | <el-table-column prop="areaName" label="区域名称" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="areaDesc" label="区域说明" min-width="180" show-overflow-tooltip /> |
| | | <el-table-column label="创建时间" width="170"> |
| | | <template #default="{ row }">{{ formatTime(row.createTime) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="220" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <div class="table-ops"> |
| | | <el-button type="primary" link @click="openEdit(row)">编辑</el-button> |
| | | <el-button v-if="!isSubMode" type="primary" link @click="goSub(row)">子区域管理</el-button> |
| | | <el-button type="primary" link @click="confirmDelete(row)">删除</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="table-wrap"> |
| | | <el-table :data="rows" v-loading="loading" stripe border height="100%"> |
| | | <el-table-column label="序号" width="64" type="index" :index="indexMethod" /> |
| | | <el-table-column prop="areaName" label="区域名称" min-width="140" show-overflow-tooltip /> |
| | | <el-table-column prop="areaDesc" label="区域说明" min-width="180" show-overflow-tooltip /> |
| | | <el-table-column label="创建时间" width="170"> |
| | | <template #default="{ row }">{{ formatTime(row.createTime) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="220" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <div class="table-ops"> |
| | | <el-button type="primary" link @click="openEdit(row)">编辑</el-button> |
| | | <el-button v-if="!isSubMode" type="primary" link @click="goSub(row)">子区域管理</el-button> |
| | | <el-button type="primary" link @click="confirmDelete(row)">删除</el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <el-pagination |
| | | class="pager" |
| | | class="main-pager" |
| | | background |
| | | layout="prev, pager, next" |
| | | layout="sizes, prev, pager, next" |
| | | :total="total" |
| | | :page-size="size" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | v-model:current-page="page" |
| | | @current-change="load" |
| | | @size-change="onSizeChange" |
| | | /> |
| | | |
| | | <el-dialog v-model="dlg" :title="dlgTitle" width="520px" destroy-on-close @closed="onDlgClosed"> |
| | |
| | | } |
| | | |
| | | function doSearch() { |
| | | page.value = 1; |
| | | load(); |
| | | } |
| | | |
| | | function onSizeChange(nextSize: number) { |
| | | size.value = nextSize; |
| | | page.value = 1; |
| | | load(); |
| | | } |
| | |
| | | <style scoped> |
| | | .page { |
| | | padding: 0; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: calc(100vh - 190px); |
| | | min-height: 420px; |
| | | } |
| | | .sub-hdr { |
| | | display: flex; |
| | |
| | | .search-form { |
| | | margin-bottom: 12px; |
| | | flex-wrap: wrap; |
| | | flex: none; |
| | | } |
| | | .push-right { |
| | | margin-left: auto; |
| | | } |
| | | .pager { |
| | | .table-wrap { |
| | | flex: 1; |
| | | min-height: 0; |
| | | } |
| | | .main-pager { |
| | | margin-top: 12px; |
| | | justify-content: flex-end; |
| | | flex: none; |
| | | } |
| | | .fullw { |
| | | width: 100%; |