mirror of
https://github.com/PlayEdu/backend
synced 2025-07-19 11:39:35 +08:00
学院列表所属部门
This commit is contained in:
parent
57ff9638b5
commit
20e64cd56c
@ -81,6 +81,10 @@ code {
|
|||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ml-24{
|
||||||
|
margin-left: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
.ml-42 {
|
.ml-42 {
|
||||||
margin-left: 42px;
|
margin-left: 42px;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
const [createVisible, setCreateVisible] = useState<boolean>(false);
|
const [createVisible, setCreateVisible] = useState<boolean>(false);
|
||||||
const [updateVisible, setUpdateVisible] = useState<boolean>(false);
|
const [updateVisible, setUpdateVisible] = useState<boolean>(false);
|
||||||
const [mid, setMid] = useState<number>(0);
|
const [mid, setMid] = useState<number>(0);
|
||||||
const [course_dep_ids, setCourseDepIds] = useState<any>({});
|
const [user_dep_ids, setUserDepIds] = useState<any>({});
|
||||||
const [departments, setDepartments] = useState<any>({});
|
const [departments, setDepartments] = useState<any>({});
|
||||||
|
|
||||||
const columns: ColumnsType<DataType> = [
|
const columns: ColumnsType<DataType> = [
|
||||||
@ -71,11 +71,11 @@ export const MemberPage: React.FC = () => {
|
|||||||
dataIndex: "id",
|
dataIndex: "id",
|
||||||
render: (id: number) => (
|
render: (id: number) => (
|
||||||
<div className="float-left">
|
<div className="float-left">
|
||||||
{course_dep_ids[id] &&
|
{user_dep_ids[id] &&
|
||||||
course_dep_ids[id].map((item: any, index: number) => {
|
user_dep_ids[id].map((item: any, index: number) => {
|
||||||
return (
|
return (
|
||||||
<span key={index}>
|
<span key={index}>
|
||||||
{index === course_dep_ids[id].length - 1
|
{index === user_dep_ids[id].length - 1
|
||||||
? departments[item]
|
? departments[item]
|
||||||
: departments[item] + "、"}
|
: departments[item] + "、"}
|
||||||
</span>
|
</span>
|
||||||
@ -143,6 +143,8 @@ export const MemberPage: React.FC = () => {
|
|||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setList(res.data.data);
|
setList(res.data.data);
|
||||||
|
setDepartments(res.data.departments);
|
||||||
|
setUserDepIds(res.data.user_dep_ids);
|
||||||
setTotal(res.data.total);
|
setTotal(res.data.total);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { Row, Col, Form, Input, Image, Button, message } from "antd";
|
import { Row, Col, Form, Input, Image, Button, Tabs, message } from "antd";
|
||||||
import styles from "./update.module.less";
|
import styles from "./index.module.less";
|
||||||
import { appConfig } from "../../api/index";
|
import { appConfig } from "../../api/index";
|
||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { useParams, useNavigate } from "react-router-dom";
|
||||||
import { UploadImageButton } from "../../compenents";
|
import { UploadImageButton } from "../../compenents";
|
||||||
|
import type { TabsProps } from "antd";
|
||||||
|
|
||||||
export const SystemIndexPage: React.FC = () => {
|
export const SystemIndexPage: React.FC = () => {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
@ -11,6 +12,7 @@ export const SystemIndexPage: React.FC = () => {
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [logo, setLogo] = useState<string>("");
|
const [logo, setLogo] = useState<string>("");
|
||||||
|
const [tabKey, setTabKey] = useState(1);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDetail();
|
getDetail();
|
||||||
@ -64,63 +66,86 @@ export const SystemIndexPage: React.FC = () => {
|
|||||||
console.log("Failed:", errorInfo);
|
console.log("Failed:", errorInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const items: TabsProps["items"] = [
|
||||||
|
{
|
||||||
|
key: "1",
|
||||||
|
label: `网站设置`,
|
||||||
|
children: (
|
||||||
|
<div className="float-left mt-24">
|
||||||
|
<Form
|
||||||
|
form={form}
|
||||||
|
name="basic"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
wrapperCol={{ span: 18 }}
|
||||||
|
style={{ width: 800 }}
|
||||||
|
initialValues={{ remember: true }}
|
||||||
|
onFinish={onFinish}
|
||||||
|
onFinishFailed={onFinishFailed}
|
||||||
|
autoComplete="off"
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
label="网站Logo"
|
||||||
|
name="system.logo"
|
||||||
|
labelCol={{ style: { marginTop: 8, marginLeft: 61 } }}
|
||||||
|
>
|
||||||
|
<div className="d-flex">
|
||||||
|
{logo && (
|
||||||
|
<Image preview={false} width={150} height={50} src={logo} />
|
||||||
|
)}
|
||||||
|
<div className="d-flex ml-24">
|
||||||
|
<UploadImageButton
|
||||||
|
onSelected={(url) => {
|
||||||
|
setLogo(url);
|
||||||
|
form.setFieldsValue({ "system.logo": url });
|
||||||
|
}}
|
||||||
|
></UploadImageButton>
|
||||||
|
</div>
|
||||||
|
<div className="helper-text ml-24">
|
||||||
|
(推荐尺寸:240x80px,支持JPG、PNG)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="网站标题" name="system.name">
|
||||||
|
<Input style={{ width: 274 }} placeholder="请填写网站标题" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="API访问地址" name="system.api_url">
|
||||||
|
<Input style={{ width: 274 }} placeholder="请填写API访问地址" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="PC端访问地址" name="system.pc_url">
|
||||||
|
<Input style={{ width: 274 }} placeholder="请填写PC端访问地址" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="H5端访问地址" name="system.h5_url">
|
||||||
|
<Input style={{ width: 274 }} placeholder="请填写H5端访问地址" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item wrapperCol={{ offset: 4, span: 18 }}>
|
||||||
|
<Button type="primary" htmlType="submit" loading={loading}>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "2",
|
||||||
|
label: `播放设置`,
|
||||||
|
children: <div className="float-left mt-24"></div>,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const onChange = (key: string) => {
|
||||||
|
setTabKey(Number(key));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Row className="playedu-main-body">
|
<Row className="playedu-main-body">
|
||||||
<Col>
|
<Tabs
|
||||||
<div className="float-left">
|
className="float-left"
|
||||||
<Form
|
defaultActiveKey="1"
|
||||||
form={form}
|
items={items}
|
||||||
name="basic"
|
onChange={onChange}
|
||||||
labelCol={{ span: 8 }}
|
/>
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
style={{ width: 600 }}
|
|
||||||
initialValues={{ remember: true }}
|
|
||||||
onFinish={onFinish}
|
|
||||||
onFinishFailed={onFinishFailed}
|
|
||||||
autoComplete="off"
|
|
||||||
>
|
|
||||||
<Form.Item label="网站名" name="system.name">
|
|
||||||
<Input placeholder="请输入网站名" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="Logo" name="system.logo">
|
|
||||||
<div className="c-flex">
|
|
||||||
<div className="d-flex">
|
|
||||||
<UploadImageButton
|
|
||||||
onSelected={(url) => {
|
|
||||||
setLogo(url);
|
|
||||||
form.setFieldsValue({ "system.logo": url });
|
|
||||||
}}
|
|
||||||
></UploadImageButton>
|
|
||||||
</div>
|
|
||||||
{logo && (
|
|
||||||
<Image
|
|
||||||
className="mt-10"
|
|
||||||
preview={false}
|
|
||||||
width={200}
|
|
||||||
height={74}
|
|
||||||
src={logo}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="API访问地址" name="system.api_url">
|
|
||||||
<Input placeholder="请输入API访问地址" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="PC端口访问地址" name="system.pc_url">
|
|
||||||
<Input placeholder="请输入PC端口访问地址" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="H5端口访问地址" name="system.h5_url">
|
|
||||||
<Input placeholder="请输入H5端口访问地址" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item wrapperCol={{ offset: 8, span: 16 }}>
|
|
||||||
<Button type="primary" htmlType="submit" loading={loading}>
|
|
||||||
保存
|
|
||||||
</Button>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
</Row>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user