| | |
| | | <el-button v-permission="'config:visit-reasons:create'" type="primary" @click="openCreate">新增</el-button> |
| | | </div> |
| | | |
| | | <el-table :data="rows" v-loading="loading" stripe border> |
| | | <el-table-column label="序号" width="72" type="index" :index="indexMethod" /> |
| | | <el-table-column prop="reasonName" label="来访事由" min-width="220" show-overflow-tooltip /> |
| | | <el-table-column label="创建时间" width="180"> |
| | | <template #default="{ row }">{{ formatTime(row.createTime) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="160" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <div class="table-ops"> |
| | | <el-button |
| | | v-if="!isOtherReason(row)" |
| | | v-permission="'config:visit-reasons:update'" |
| | | type="primary" |
| | | link |
| | | @click="openEdit(row)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="!isOtherReason(row)" |
| | | v-permission="'config:visit-reasons:delete'" |
| | | 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="72" type="index" :index="indexMethod" /> |
| | | <el-table-column prop="reasonName" label="来访事由" min-width="220" show-overflow-tooltip /> |
| | | <el-table-column label="创建时间" width="180"> |
| | | <template #default="{ row }">{{ formatTime(row.createTime) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="160" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <div class="table-ops"> |
| | | <el-button |
| | | v-if="!isOtherReason(row)" |
| | | v-permission="'config:visit-reasons:update'" |
| | | type="primary" |
| | | link |
| | | @click="openEdit(row)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="!isOtherReason(row)" |
| | | v-permission="'config:visit-reasons:delete'" |
| | | type="primary" |
| | | link |
| | | @click="confirmDelete(row)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <el-pagination |
| | | class="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="460px" destroy-on-close> |
| | |
| | | dlg.value = true; |
| | | } |
| | | |
| | | function onSizeChange(nextSize: number) { |
| | | size.value = nextSize; |
| | | page.value = 1; |
| | | load(); |
| | | } |
| | | |
| | | function openEdit(row: Row) { |
| | | if (isOtherReason(row)) { |
| | | return; |
| | |
| | | <style scoped> |
| | | .page { |
| | | padding: 0; |
| | | display: flex; |
| | | flex-direction: column; |
| | | height: calc(100vh - 190px); |
| | | min-height: 420px; |
| | | } |
| | | .header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 12px; |
| | | flex: none; |
| | | } |
| | | .section-title { |
| | | font-size: 16px; |
| | |
| | | border-left: 3px solid #409eff; |
| | | color: #303133; |
| | | } |
| | | .table-wrap { |
| | | flex: 1; |
| | | min-height: 0; |
| | | } |
| | | .pager { |
| | | margin-top: 12px; |
| | | justify-content: flex-end; |
| | | flex: none; |
| | | } |
| | | </style> |