Ver Fonte

Add type selection to PlaymateApplyPage and update related types

- Introduced a new type selection field in the PlaymateApplyPage form, allowing users to choose an application type from PlaymateApplyTypeConsts.
- Updated the query parameters to include the selected type for better data handling.
- Enhanced the PlaymateApplyAdminQuery and PlaymateApplyAdminDTO interfaces to include the new type property, improving type safety and clarity.
- Added rendering logic for the type column in the application status table to display the selected type appropriately.
0es há 1 semana atrás
pai
commit
c15a3c6846

+ 39 - 0
src/app/(dashboard)/playmate/apply/page.tsx

@@ -188,6 +188,10 @@ const PlaymateApplyPage: React.FC = () => {
     () => getGroup("PlaymateApplyStatusConsts"),
     [getGroup],
   );
+  const playmateApplyTypeConsts = useMemo(
+    () => getGroup("PlaymateApplyTypeConsts"),
+    [getGroup],
+  );
 
   const renderStatusTagFromConsts = (status?: number) => {
     const item = getConstItemByNumberValue(playmateApplyStatusConsts, status);
@@ -250,6 +254,11 @@ const PlaymateApplyPage: React.FC = () => {
       statusValue === "" || statusValue === undefined || statusValue === null
         ? undefined
         : Number(statusValue);
+    const typeValue = values.type as unknown;
+    const typeNum =
+      typeValue === "" || typeValue === undefined || typeValue === null
+        ? undefined
+        : Number(typeValue);
     setQueryParams({
       ...queryParams,
       pageIndex: 1,
@@ -259,6 +268,8 @@ const PlaymateApplyPage: React.FC = () => {
         statusNum !== undefined && Number.isFinite(statusNum)
           ? statusNum
           : undefined,
+      type:
+        typeNum !== undefined && Number.isFinite(typeNum) ? typeNum : undefined,
     });
   };
 
@@ -374,6 +385,20 @@ const PlaymateApplyPage: React.FC = () => {
       width: 200,
       render: (v) => v || "-",
     },
+    {
+      title: "类型",
+      dataIndex: "type",
+      key: "type",
+      width: 120,
+      render: (v?: number) => {
+        const item = getConstItemByNumberValue(playmateApplyTypeConsts, v);
+        return item ? (
+          <Tag color={v ? "blue" : "purple"}>{item.name}</Tag>
+        ) : (
+          "-"
+        );
+      },
+    },
     {
       title: "状态",
       dataIndex: "status",
@@ -472,6 +497,20 @@ const PlaymateApplyPage: React.FC = () => {
               })}
             </Select>
           </Form.Item>
+          <Form.Item label="类型" name="type">
+            <Select placeholder="请选择类型" allowClear style={{ width: 160 }}>
+              {playmateApplyTypeConsts.map((item) => {
+                const raw = item.value;
+                const num = Number(raw);
+                const value = Number.isFinite(num) ? num : raw;
+                return (
+                  <Select.Option key={String(raw)} value={value}>
+                    {item.name || String(raw)}
+                  </Select.Option>
+                );
+              })}
+            </Select>
+          </Form.Item>
           <Form.Item style={{ marginLeft: "auto" }}>
             <Space>
               <Button

+ 3 - 0
src/app/(dashboard)/user/list/page.tsx

@@ -1118,6 +1118,9 @@ const UserListPage: React.FC = () => {
                     );
                   })()}
                 </Descriptions.Item>
+                <Descriptions.Item label="注册设备ID">
+                  {userDetail.userBaseInfo?.regDeviceId || "-"}
+                </Descriptions.Item>
               </Descriptions>
             </Card>
 

+ 8 - 0
src/types/api/playmateApply.ts

@@ -24,6 +24,10 @@ export interface PlaymateApplyAdminQuery {
    * 1:申请未审核,2:审核通过,3:审核拒绝
    */
   status?: number;
+  /**
+   * 申请类型(PlaymateApplyTypeConsts)
+   */
+  type?: number;
   skip?: number;
 }
 
@@ -35,6 +39,10 @@ export interface PlaymateApplyAdminDTO {
   age?: number;
   bizCategoryCode?: string;
   bizCategoryName?: string;
+  /**
+   * 申请类型(PlaymateApplyTypeConsts)
+   */
+  type?: number;
   /**
    * 1:申请未审核,2:审核通过,3:审核拒绝
    */

+ 1 - 0
src/types/api/user.ts

@@ -23,6 +23,7 @@ export interface UserInfoAdminDTO {
   regPlatform: number;
   regAppVersion: string;
   regType: number;
+  regDeviceId: string;
   userNo: string;
   nickname: string;
   // 用户个人简介