فهرست منبع

:fire: 没用了

visuddhinanda 2 سال پیش
والد
کامیت
f679e41474
2فایلهای تغییر یافته به همراه0 افزوده شده و 151 حذف شده
  1. 0 71
      dashboard/src/components/course/AddLesson.tsx
  2. 0 80
      dashboard/src/components/course/LessonSelect.tsx

+ 0 - 71
dashboard/src/components/course/AddLesson.tsx

@@ -1,71 +0,0 @@
-import { useIntl } from "react-intl";
-import { ProForm, ProFormSelect } from "@ant-design/pro-components";
-import { Button, message, Popover } from "antd";
-import { UserAddOutlined } from "@ant-design/icons";
-import { get } from "../../request";
-
-import { IUserListResponse } from "../api/Auth";
-
-interface IFormData {
-  userId: string;
-}
-
-interface IWidget {
-  groupId?: string;
-}
-const AddLessonWidget = ({ groupId }: IWidget) => {
-  const intl = useIntl();
-
-  const form = (
-    <ProForm<IFormData>
-      onFinish={async (values: IFormData) => {
-        console.log(values);
-        message.success(intl.formatMessage({ id: "flashes.success" }));
-      }}
-    >
-      <ProForm.Group>
-        <ProFormSelect
-          name="userId"
-          label={intl.formatMessage({ id: "forms.fields.user.label" })}
-          showSearch
-          debounceTime={300}
-          request={async ({ keyWord }) => {
-            console.log("keyWord", keyWord);
-            const json = await get<IUserListResponse>(`/v2/user?view=key&key=`);
-            const userList = json.data.rows.map((item) => {
-              return {
-                value: item.id,
-                label: `${item.userName}-${item.nickName}`,
-              };
-            });
-            console.log("json", userList);
-            return userList;
-          }}
-          placeholder={intl.formatMessage({ id: "forms.fields.user.required" })}
-          rules={[
-            {
-              required: true,
-              message: intl.formatMessage({
-                id: "forms.message.user.required",
-              }),
-            },
-          ]}
-        />
-      </ProForm.Group>
-    </ProForm>
-  );
-  return (
-    <Popover
-      placement="bottom"
-      arrowPointAtCenter
-      content={form}
-      trigger="click"
-    >
-      <Button icon={<UserAddOutlined />} key="add" type="primary">
-        {intl.formatMessage({ id: "buttons.lesson.add.lesson" })}
-      </Button>
-    </Popover>
-  );
-};
-
-export default AddLessonWidget;

+ 0 - 80
dashboard/src/components/course/LessonSelect.tsx

@@ -1,80 +0,0 @@
-//选择讲师组件
-
-import { useIntl } from "react-intl";
-import { useState } from "react";
-import { ProList } from "@ant-design/pro-components";
-import { Button, Layout } from "antd";
-import AddLesson from "./AddLesson";
-
-const { Content } = Layout;
-
-const defaultData = [
-  {
-    id: "1",
-    name: "lesson0",
-    //tag: [{ title: "管理员", color: "success" }],
-    //image:
-    //  "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
-  },
-];
-type DataItem = (typeof defaultData)[number];
-interface IWidgetGroupFile {
-  groupId?: string;
-}
-const LessonSelectWidget = ({ groupId }: IWidgetGroupFile) => {
-  const intl = useIntl(); //i18n
-  const [dataSource, setDataSource] = useState<DataItem[]>(defaultData);
-
-  return (
-    <Content>
-      <ProList<DataItem>
-        rowKey="id"
-        headerTitle={intl.formatMessage({ id: "forms.fields.lesson.label" })}
-        toolBarRender={() => {
-          return [<AddLesson groupId={groupId} />];
-        }}
-        dataSource={dataSource}
-        showActions="hover"
-        onDataSourceChange={setDataSource}
-        metas={{
-          title: {
-            dataIndex: "name",
-          },
-          avatar: {
-            dataIndex: "image",
-            editable: false,
-          },
-          // subTitle: {
-          //   render: (text, row, index, action) => {
-          //     const showtag = row.tag.map((item, id) => {
-          //       return (
-          //         <Tag color={item.color} key={id}>
-          //           {item.title}
-          //         </Tag>
-          //       );
-          //     });
-          //     return <Space size={0}>{showtag}</Space>;
-          //   },
-          // },
-          actions: {
-            render: (text, row, index, action) => [
-              <Button
-                style={{ padding: 0, margin: 0 }}
-                type="link"
-                danger
-                onClick={() => {
-                  action?.startEditable(row.id);
-                }}
-                key="link"
-              >
-                {intl.formatMessage({ id: "buttons.remove" })}
-              </Button>,
-            ],
-          },
-        }}
-      />
-    </Content>
-  );
-};
-
-export default LessonSelectWidget;