| <template> | 
|   <TableLayout :permissions="['business:holidays:query']"> | 
|     <!-- 搜索表单 --> | 
|     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
|       <el-form-item label="日期" prop="holiday"> | 
|         <el-date-picker v-model="searchForm.holiday" value-format="yyyy-MM-dd" placeholder="请输入日期" @change="search"/> | 
|       </el-form-item> | 
|       <section> | 
|         <el-button type="primary" @click="search">搜索</el-button> | 
|         <el-button @click="reset">重置</el-button> | 
|       </section> | 
|     </el-form> | 
|     <!-- 表格和分页 --> | 
|     <template v-slot:table-wrap> | 
|       <ul class="toolbar" v-permissions="['business:holidays:create']"> | 
|         <li><el-button type="primary" @click="$refs.operaHolidaysWindow.open('新建节假日')" icon="el-icon-plus" v-permissions="['business:holidays:create']">新建</el-button></li> | 
|       </ul> | 
|       <el-table | 
|         v-loading="isWorking.search" | 
|         :data="tableData.list" | 
|         stripe | 
|         border | 
|       > | 
|         <el-table-column prop="holiday" label="节假日日期" min-width="100px" align="center"></el-table-column> | 
|         <el-table-column | 
|           v-if="containPermissions(['business:holidays:update', 'business:holidays:delete'])" | 
|           label="操作" | 
|           min-width="120" | 
|           fixed="right" | 
|           align="center" | 
|         > | 
|           <template slot-scope="{row}"> | 
|             <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:holidays:delete']">删除</el-button> | 
|           </template> | 
|         </el-table-column> | 
|       </el-table> | 
|       <pagination | 
|         @size-change="handleSizeChange" | 
|         @current-change="handlePageChange" | 
|         :pagination="tableData.pagination" | 
|       > | 
|       </pagination> | 
|     </template> | 
|     <!-- 新建/修改 --> | 
|     <OperaHolidaysWindow ref="operaHolidaysWindow" @success="handlePageChange"/> | 
|   </TableLayout> | 
| </template> | 
|   | 
| <script> | 
| import BaseTable from '@/components/base/BaseTable' | 
| import TableLayout from '@/layouts/TableLayout' | 
| import Pagination from '@/components/common/Pagination' | 
| import OperaHolidaysWindow from '@/components/business/OperaHolidaysWindow' | 
| export default { | 
|   name: 'Holidays', | 
|   extends: BaseTable, | 
|   components: { TableLayout, Pagination, OperaHolidaysWindow }, | 
|   data () { | 
|     return { | 
|       // 搜索 | 
|       searchForm: { | 
|         id: '', | 
|         createDate: '', | 
|         creator: '', | 
|         editDate: '', | 
|         editor: '', | 
|         isdeleted: '', | 
|         info: '', | 
|         holiday: '' | 
|       } | 
|     } | 
|   }, | 
|   created () { | 
|     this.config({ | 
|       module: '节假日配置表', | 
|       api: '/business/holidays', | 
|       'field.id': 'id', | 
|       'field.main': 'id' | 
|     }) | 
|     this.search() | 
|   } | 
| } | 
| </script> |