|
@@ -116,7 +116,7 @@ function WallTable({ tablePageIdFu, scrollNumInfo }: Props) {
|
|
|
);
|
|
|
|
|
|
const columns = useMemo(() => {
|
|
|
- return [
|
|
|
+ const arr: any = [
|
|
|
{
|
|
|
width: 80,
|
|
|
title: "序号",
|
|
@@ -139,50 +139,67 @@ function WallTable({ tablePageIdFu, scrollNumInfo }: Props) {
|
|
|
title: "名称",
|
|
|
render: (item: WallTableListType) => (item.name ? item.name : "(空)"),
|
|
|
},
|
|
|
- {
|
|
|
- title: "展示状态",
|
|
|
- render: (item: WallTableListType) => (
|
|
|
- <Switch
|
|
|
- checkedChildren="启用"
|
|
|
- unCheckedChildren="停用"
|
|
|
- checked={item.display === 1}
|
|
|
- onChange={(val) => isEnabledClickFu(val, item.id)}
|
|
|
- />
|
|
|
- ),
|
|
|
- },
|
|
|
- {
|
|
|
- title: "操作",
|
|
|
- render: (item: WallTableListType) => (
|
|
|
- <>
|
|
|
- <Button
|
|
|
- size="small"
|
|
|
- type="text"
|
|
|
- onClick={() => editTableFu(item.id)}
|
|
|
- >
|
|
|
- 编辑
|
|
|
- </Button>
|
|
|
- <Button
|
|
|
- size="small"
|
|
|
- type="text"
|
|
|
- onClick={() => tableLookFu(item.id, item.type)}
|
|
|
- >
|
|
|
- 预览
|
|
|
- </Button>
|
|
|
- <Popconfirm
|
|
|
- title="删除后无法恢复,是否删除?"
|
|
|
- okText="删除"
|
|
|
- cancelText="取消"
|
|
|
- onConfirm={() => delTableFu(item.id)}
|
|
|
- >
|
|
|
- <Button size="small" type="text" danger>
|
|
|
- 删除
|
|
|
- </Button>
|
|
|
- </Popconfirm>
|
|
|
- </>
|
|
|
- ),
|
|
|
- },
|
|
|
];
|
|
|
- }, [delTableFu, editTableFu, isEnabledClickFu, tableLookFu]);
|
|
|
+ if (A2TableType === "img") {
|
|
|
+ arr.push({
|
|
|
+ title: "简介",
|
|
|
+ render: (item: WallTableListType) =>
|
|
|
+ item.description ? (
|
|
|
+ item.description.length >= 25 ? (
|
|
|
+ <span style={{ cursor: "pointer" }} title={item.description}>
|
|
|
+ {item.description.substring(0, 25) + "..."}
|
|
|
+ </span>
|
|
|
+ ) : (
|
|
|
+ item.description
|
|
|
+ )
|
|
|
+ ) : (
|
|
|
+ "(空)"
|
|
|
+ ),
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ arr.push({
|
|
|
+ title: "展示状态",
|
|
|
+ render: (item: WallTableListType) => (
|
|
|
+ <Switch
|
|
|
+ checkedChildren="启用"
|
|
|
+ unCheckedChildren="停用"
|
|
|
+ checked={item.display === 1}
|
|
|
+ onChange={(val) => isEnabledClickFu(val, item.id)}
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ });
|
|
|
+
|
|
|
+ arr.push({
|
|
|
+ title: "操作",
|
|
|
+ render: (item: WallTableListType) => (
|
|
|
+ <>
|
|
|
+ <Button size="small" type="text" onClick={() => editTableFu(item.id)}>
|
|
|
+ 编辑
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ type="text"
|
|
|
+ onClick={() => tableLookFu(item.id, item.type)}
|
|
|
+ >
|
|
|
+ 预览
|
|
|
+ </Button>
|
|
|
+ <Popconfirm
|
|
|
+ title="删除后无法恢复,是否删除?"
|
|
|
+ okText="删除"
|
|
|
+ cancelText="取消"
|
|
|
+ onConfirm={() => delTableFu(item.id)}
|
|
|
+ >
|
|
|
+ <Button size="small" type="text" danger>
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </Popconfirm>
|
|
|
+ </>
|
|
|
+ ),
|
|
|
+ });
|
|
|
+
|
|
|
+ return arr;
|
|
|
+ }, [A2TableType, delTableFu, editTableFu, isEnabledClickFu, tableLookFu]);
|
|
|
|
|
|
// 表格拖动排序-----------------
|
|
|
interface DraggableBodyRowProps
|