shaogen1995 2 سال پیش
والد
کامیت
951cac551a

+ 5 - 3
管理后台/src/pages/A2Wall/WallAdd/index.module.scss

@@ -6,15 +6,17 @@
 
   :global {
     .main {
-      width: 800px;
-      padding: 24px;
+      width: 1200px;
+      padding: 24px 324px 0px 24px;
+      height: 800px;
+      overflow-y: auto;
 
       .myformBox {
         display: flex;
         margin-bottom: 20px;
 
         .label {
-          width: 94px;
+          width: 106px;
           text-align: right;
 
           &>span {

+ 21 - 2
管理后台/src/pages/A2Wall/WallAdd/index.tsx

@@ -38,6 +38,7 @@ import {
   DownloadOutlined,
 } from "@ant-design/icons";
 import { ReactSortable } from "react-sortablejs";
+import TextArea from "antd/es/input/TextArea";
 
 type Props = {
   id: number;
@@ -51,6 +52,7 @@ function WallAdd({ id, closeMoalFu, tableType }: Props) {
     FormBoxRef.current?.setFieldsValue({
       name: res.data.entity.name,
       display: res.data.entity.display,
+      description:res.data.entity.description
     });
     setTopType(res.data.entity.type);
 
@@ -216,7 +218,7 @@ function WallAdd({ id, closeMoalFu, tableType }: Props) {
 
   // 通过校验点击确定
   const onFinish = useCallback(
-    async (value: { name: string; display: 1 | 0 }) => {
+    async (value: { name: string; display: 1 | 0; description: string }) => {
       console.log("通过校验,点击确定");
       setImgCheck(true);
 
@@ -238,6 +240,7 @@ function WallAdd({ id, closeMoalFu, tableType }: Props) {
         layout: imgList.length,
         thumb: cover,
         display: value.display,
+        description: value.description,
       };
 
       const res = await setWallSave(obj);
@@ -255,7 +258,7 @@ function WallAdd({ id, closeMoalFu, tableType }: Props) {
 
   return (
     <div className={styles.WallAdd}>
-      <div className="main">
+      <div className="main mySorrl">
         <Form
           ref={FormBoxRef}
           name="basic"
@@ -287,6 +290,22 @@ function WallAdd({ id, closeMoalFu, tableType }: Props) {
           >
             <Input maxLength={25} showCount placeholder="请输入内容" />
           </Form.Item>
+
+          {topType === "img" ? (
+            <Form.Item
+              label="简介"
+              name="description"
+              // getValueFromEvent={(e) => e.target.value.trim()}
+            >
+              <TextArea
+                rows={4}
+                placeholder="请输入内容"
+                showCount
+                maxLength={500}
+              />
+            </Form.Item>
+          ) : null}
+
           {/* 封面图上传 */}
           <div className="myformBox myformBoxOne">
             <div className="label">

+ 2 - 2
管理后台/src/pages/A2Wall/WallTable/index.module.scss

@@ -6,7 +6,7 @@
 
   :global {
     .titleTxt {
-      width: 1000px;
+      width: 1400px;
       position: relative;
 
       .tableBtn {
@@ -26,7 +26,7 @@
 
     .table {
       margin-top: 20px;
-      width: 1000px;
+      width: 1400px;
 
       .ant-table-body {
         height: 565px;

+ 61 - 44
管理后台/src/pages/A2Wall/WallTable/index.tsx

@@ -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

+ 2 - 0
管理后台/src/types/api/A2Wall.d.ts

@@ -12,6 +12,7 @@ export type WallTableListType = {
   type: string;
   updateTime: string;
   thumb:string
+  description:string
 };
 
 export type WallUpSaveType ={
@@ -36,4 +37,5 @@ export type WallSaveAPIType ={
   type:'img'|'video'
   thumb:string
   display:0|1
+  description:string
 }