oak-general-business/es/components/subscription/list/web.pc.js

80 lines
4.0 KiB
JavaScript

import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Table, Button, Space, Typography } from 'antd';
import PageHeader from '../../../components/common/pageHeader';
import Style from './web.module.less';
export default function Render(props) {
const { oakPagination, list = [], oakLoading, showBack, variant, oakFullpath, } = props.data;
const { pageSize, total, currentPage } = oakPagination || {};
const { t, setPageSize, setCurrentPage, goCreate, goDetail, goSetConfig, goUpdate, remove, } = props.methods;
return (_jsxs(Container, { variant: variant, children: [_jsx(Space, { style: { marginBottom: 16 }, children: _jsx(Button, { type: "primary", onClick: () => {
goCreate();
}, children: "\u6DFB\u52A0\u8BA2\u9605\u53F7" }) }), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
// {
// dataIndex: 'id',
// title: '序号',
// render: (value, record, index) => {
// return index + 1;
// },
// },
{
dataIndex: 'name',
title: '订阅号名称',
width: 300,
render: (value, record, index) => {
return (_jsx(Typography.Link, { onClick: () => {
goDetail(record.id);
}, children: value }));
},
},
{
dataIndex: 'description',
title: '描述',
width: 200,
ellipsis: true,
},
{
dataIndex: 'config',
title: '配置',
align: 'center',
render: (value, record, index) => {
return (_jsx(_Fragment, { children: _jsx(Button, { type: "link", onClick: () => {
goSetConfig(record.id);
}, children: "\u914D\u7F6E" }) }));
},
},
{
dataIndex: 'op',
width: 200,
title: '操作',
align: 'center',
render: (value, record, index) => {
return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "link", onClick: () => {
goDetail(record.id);
}, children: "\u8BE6\u60C5" }), _jsx(Button, { type: "link", onClick: () => {
goUpdate(record.id);
}, children: "\u66F4\u65B0" }), _jsx(Button, { type: "link", onClick: () => {
remove(record.id);
}, children: "\u5220\u9664" })] }));
},
fixed: 'right',
},
], pagination: {
total,
pageSize,
current: currentPage,
onShowSizeChange: (pageSize) => {
setPageSize(pageSize);
},
onChange: (current) => {
setCurrentPage(current);
},
} })] }));
}
function Container(props) {
const { children, variant = 'alone', showBack } = props;
if (['inline', 'dialog'].includes(variant)) {
return _jsx(_Fragment, { children: children });
}
return (_jsx(PageHeader, { showBack: showBack, title: "\u5E94\u7528\u7BA1\u7406", children: _jsx("div", { className: Style.container, children: children }) }));
}