visuddhinanda 3 лет назад
Родитель
Сommit
e84ab1df1a

+ 0 - 55
dashboard/src/components/course/LessonTreeShow.tsx

@@ -1,55 +0,0 @@
-//上传封面组件
-import React, { useState } from "react";
-import { LoadingOutlined, PlusOutlined } from "@ant-design/icons";
-import { message, Upload, Tree } from "antd";
-import type { UploadChangeParam } from "antd/es/upload";
-import type { RcFile, UploadFile, UploadProps } from "antd/es/upload/interface";
-
-import type { DataNode } from "antd/es/tree";
-/*
-const dig = (path = "0", level = 3) => {
-  const list = [];
-  for (let i = 0; i < 10; i += 1) {
-    const key = `a-${i}`;
-    const treeNode: DataNode = {
-      title: key,
-      key,
-    };
-
-    if (level > 0) {
-      treeNode.children = dig(key, level - 1);
-    }
-
-    list.push(treeNode);
-  }
-  return list;
-};
-
-const treeData = dig();
-*/
-const treeData: DataNode[] = [
-  {
-    title: "课程1",
-    key: "0-0",
-    children: [
-      { title: "课程1-0", key: "0-0-0", isLeaf: true },
-      { title: "课程1-1", key: "0-0-1", isLeaf: true },
-      { title: "课程1-2", key: "0-0-2", isLeaf: true },
-      { title: "课程1-3", key: "0-0-3", isLeaf: true },
-    ],
-  },
-  {
-    title: "课程2",
-    key: "0-1",
-    children: [
-      { title: "课程2-0", key: "0-1-0", isLeaf: true },
-      { title: "课程2-1", key: "0-1-1", isLeaf: true },
-      { title: "课程2-2", key: "0-1-2", isLeaf: true },
-    ],
-  },
-];
-const Widget = () => {
-  return <Tree treeData={treeData} height={233} defaultExpandAll />;
-};
-
-export default Widget;

+ 0 - 95
dashboard/src/components/course/StudentsSelect.tsx

@@ -1,95 +0,0 @@
-//选择讲师组件
-
-import { useIntl } from "react-intl";
-import { useState } from "react";
-import { ProList } from "@ant-design/pro-components";
-import { UserAddOutlined } from "@ant-design/icons";
-import { Space, Tag, Button, Layout } from "antd";
-import AddStudent from "./AddStudent";
-
-const { Content } = Layout;
-
-const defaultData = [
-  {
-    id: "1",
-    name: "小僧善巧",
-    tag: [{ title: "助教", color: "success" }],
-    image:
-      "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
-  },
-  {
-    id: "2",
-    name: "学员1",
-    tag: [{ title: "学员", color: "blue" }],
-    image:
-      "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
-  },
-  {
-    id: "3",
-    name: "学员2",
-    tag: [{ title: "学员", color: "blue" }],
-    image:
-      "https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg",
-  },
-];
-type DataItem = typeof defaultData[number];
-interface IWidge {
-  courseId?: string;
-}
-const Widget = ({ courseId }: IWidge) => {
-  const intl = useIntl(); //i18n
-  const [dataSource, setDataSource] = useState<DataItem[]>(defaultData);
-
-  return (
-    <>
-      <ProList<DataItem>
-        rowKey="id"
-        headerTitle={intl.formatMessage({
-          id: "forms.fields.studentsassistant.label",
-        })}
-        toolBarRender={() => {
-          return [<AddStudent courseId={courseId} />];
-        }}
-        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
-                size="small"
-                type="link"
-                danger
-                onClick={() => {}}
-                key="link"
-              >
-                {intl.formatMessage({ id: "buttons.remove" })}
-              </Button>,
-            ],
-          },
-        }}
-      />
-    </>
-  );
-};
-
-export default Widget;

+ 0 - 82
dashboard/src/components/course/TeacherSelect.tsx

@@ -1,82 +0,0 @@
-//选择讲师组件
-
-import { useIntl } from "react-intl";
-import { useState } from "react";
-import { ProList } from "@ant-design/pro-components";
-import { UserAddOutlined } from "@ant-design/icons";
-import { Space, Tag, Button, Layout } from "antd";
-import AddTeacher from "./AddTeacher";
-
-const { Content } = Layout;
-
-const defaultData = [
-  {
-    id: "1",
-    name: "小僧善巧",
-    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 Widget = ({ groupId }: IWidgetGroupFile) => {
-  const intl = useIntl(); //i18n
-  const [dataSource, setDataSource] = useState<DataItem[]>(defaultData);
-
-  return (
-    <Content>
-      <Space>{groupId}</Space>
-      <ProList<DataItem>
-        rowKey="id"
-        headerTitle={intl.formatMessage({ id: "forms.fields.teacher.label" })}
-        toolBarRender={() => {
-          return [<AddTeacher 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 Widget;