|
@@ -2,7 +2,12 @@
|
|
|
<div class="p-4">
|
|
|
<BasicTable @register="registerTable">
|
|
|
<template #toolbar> </template>
|
|
|
- <template #action>
|
|
|
+
|
|
|
+ <template #createTime="{ record }">
|
|
|
+ <Time :value="record.createTime" mode="datetime" />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template #action="{ record }">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
@@ -18,9 +23,7 @@
|
|
|
label: '删除',
|
|
|
popConfirm: {
|
|
|
title: '是否确认删除',
|
|
|
- confirm: () => {
|
|
|
- createMessage.info(`暂未接入`);
|
|
|
- },
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
},
|
|
|
},
|
|
|
]"
|
|
@@ -36,10 +39,11 @@
|
|
|
// import { Tag } from 'ant-design-vue';
|
|
|
import { h } from 'vue';
|
|
|
import { Switch } from 'ant-design-vue';
|
|
|
- import { RentListApi } from '/@/api/bulletin/rent';
|
|
|
+ import { rentListApi, commonDeleteApi } from '/@/api/bulletin/rent';
|
|
|
+ import { Time } from '/@/components/Time';
|
|
|
// param type 2
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, TableAction },
|
|
|
+ components: { BasicTable, TableAction, Time },
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
const columns: BasicColumn[] = [
|
|
@@ -51,7 +55,8 @@
|
|
|
},
|
|
|
{
|
|
|
title: '发布时间',
|
|
|
- dataIndex: 'name',
|
|
|
+ dataIndex: 'createTime',
|
|
|
+ slots: { customRender: 'createTime' },
|
|
|
width: 230,
|
|
|
},
|
|
|
{
|
|
@@ -61,7 +66,7 @@
|
|
|
},
|
|
|
{
|
|
|
title: '发布账号',
|
|
|
- dataIndex: 'phone',
|
|
|
+ dataIndex: 'userName',
|
|
|
width: 120,
|
|
|
},
|
|
|
{
|
|
@@ -73,7 +78,7 @@
|
|
|
record.pendingStatus = false;
|
|
|
}
|
|
|
return h(Switch, {
|
|
|
- checked: record.state === '1',
|
|
|
+ checked: record.state === 0,
|
|
|
checkedChildren: '已启用',
|
|
|
unCheckedChildren: '已禁用',
|
|
|
loading: false,
|
|
@@ -137,7 +142,7 @@
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- field: 'phone',
|
|
|
+ field: 'userName',
|
|
|
label: '手机号',
|
|
|
component: 'Input',
|
|
|
colProps: {
|
|
@@ -157,7 +162,7 @@
|
|
|
// { getForm }
|
|
|
const [registerTable] = useTable({
|
|
|
title: '出租信息',
|
|
|
- api: RentListApi,
|
|
|
+ api: rentListApi,
|
|
|
columns: columns,
|
|
|
useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
@@ -165,10 +170,25 @@
|
|
|
tableSetting: { fullScreen: true },
|
|
|
showIndexColumn: false,
|
|
|
rowKey: 'id',
|
|
|
+ //TODO
|
|
|
+ fetchSetting: {
|
|
|
+ pageField: 'pageNum',
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ listField: 'list',
|
|
|
+ totalField: 'total',
|
|
|
+ },
|
|
|
});
|
|
|
- // pagination.value = { pageSize: 20 };
|
|
|
+
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
|
+ const data = await commonDeleteApi({
|
|
|
+ id: record.id,
|
|
|
+ });
|
|
|
+ console.log('data', data);
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
registerTable,
|
|
|
+ handleDelete,
|
|
|
createMessage,
|
|
|
};
|
|
|
},
|