|  |  | 
 |  |  | import { logout } from '@/config.js'; | 
 |  |  | import EditView from './edit.vue' | 
 |  |  | import { formatMessage } from '@/utils/localeUtils.js'; | 
 |  |  | import useTableSearch from '@/utils/tableUtils.jsx'; | 
 |  |  | const context = getCurrentInstance()?.appContext.config.globalProperties; | 
 |  |  |  | 
 |  |  | const router = useRouter(); | 
 |  |  | 
 |  |  | let tableData = ref([]); | 
 |  |  | getPage(); | 
 |  |  |  | 
 |  |  | const { | 
 |  |  |   getColumnSearchProps, | 
 |  |  | } = useTableSearch(); | 
 |  |  |  | 
 |  |  | const columns = [ | 
 |  |  | @{TABLECOLUMNS} | 
 |  |  |   { | 
 |  |  |     title: '操作', | 
 |  |  |     title: formatMessage('common.operation', '操作'), | 
 |  |  |     name: 'oper', | 
 |  |  |     dataIndex: 'oper', | 
 |  |  |     key: 'oper', | 
 |  |  |     width: 140, | 
 |  |  |   }, | 
 |  |  | ]; | 
 |  |  |  | 
 |  |  | 
 |  |  |     content: formatMessage('page.delete.confirm', '确定删除该项吗?'), | 
 |  |  |     maskClosable: true, | 
 |  |  |     onOk: async () => { | 
 |  |  |       post('/api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { | 
 |  |  |         let result = resp.data; | 
 |  |  |         if (result.code === 200) { | 
 |  |  |           message.success(result.msg); | 
 |  |  |         } else { | 
 |  |  |           message.error(result.msg); | 
 |  |  |         } | 
 |  |  |         getPage() | 
 |  |  |       }) | 
 |  |  |       const hide = message.loading(formatMessage('common.loading', '请求中')); | 
 |  |  |       try { | 
 |  |  |         post('/api/@{SIMPLEENTITYNAME}/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { | 
 |  |  |           let result = resp.data; | 
 |  |  |           if (result.code === 200) { | 
 |  |  |             message.success(result.msg); | 
 |  |  |           } else { | 
 |  |  |             message.error(result.msg); | 
 |  |  |           } | 
 |  |  |           getPage() | 
 |  |  |           hide() | 
 |  |  |         }) | 
 |  |  |       } catch (error) { | 
 |  |  |         message.error(formatMessage('common.fail', '请求失败')); | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |   }); | 
 |  |  | } | 
 |  |  | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  | export default { | 
 |  |  |   name: '@{fullEntityName}' | 
 |  |  |   name: '@{TABLEDESC}' | 
 |  |  | } | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <template> | 
 |  |  |   <div> | 
 |  |  |     <EditView ref="editChild" @tableReload="handleTableReload" /> | 
 |  |  |     <div class="table-header"> | 
 |  |  |       <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" style="width: 200px;" @search="onSearch" /> | 
 |  |  |       <div class="table-header-right"> | 
 |  |  |         <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> | 
 |  |  |         <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> | 
 |  |  |       </div> | 
 |  |  |     </div> | 
 |  |  |     <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" | 
 |  |  |       :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" | 
 |  |  |       :pagination="{ total: tableData.total, onChange: onPageChange }" | 
 |  |  |       :scroll="{ y: 768, scrollToFirstRowOnChange: true }"> | 
 |  |  |       @{TABLECOLUMNS} | 
 |  |  |       <a-table-column title="类型" key="type" data-index="type" /> | 
 |  |  |       <a-table-column title="操作" key="oper" data-index="oper"> | 
 |  |  |         <template #default="{ record }"> | 
 |  |  |           <div style="display: flex;justify-content: space-evenly;"> | 
 |  |  |             <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button> | 
 |  |  |             <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除') }}</a-button> | 
 |  |  |           </div> | 
 |  |  |         </template> | 
 |  |  |       </a-table-column> | 
 |  |  |     </a-table> | 
 |  |  |   </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <template> | 
 |  |  |   <div> |