Commit a31a3320 authored by wuhao's avatar wuhao 🎯

jkasd

parent 3e200d52
...@@ -85,7 +85,7 @@ export default function ShopProductCard({ ...@@ -85,7 +85,7 @@ export default function ShopProductCard({
<Box className="masker"></Box> <Box className="masker"></Box>
{type == 1 && ( {type == 1 && (
<Box className="edit"> <Box className="edit">
<Tooltip title="编辑"> <Tooltip placement="bottom-start" title="编辑">
<IconButton <IconButton
onClick={() => { onClick={() => {
edit(product); edit(product);
...@@ -97,7 +97,7 @@ export default function ShopProductCard({ ...@@ -97,7 +97,7 @@ export default function ShopProductCard({
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip title={confirm ? "确认删除" : "删除"}> <Tooltip placement="bottom-start" title={confirm ? "确认删除" : "删除"}>
{confirm ? ( {confirm ? (
<IconButton <IconButton
disabled={confirm === "1"} disabled={confirm === "1"}
...@@ -150,7 +150,7 @@ export default function ShopProductCard({ ...@@ -150,7 +150,7 @@ export default function ShopProductCard({
<div></div> <div></div>
{type !== 3 && ( {type !== 3 && (
<Tooltip title={shut ? "确认关闭" : "关闭"}> <Tooltip placement="bottom-start" title={shut ? "确认关闭" : "关闭"}>
{shut ? ( {shut ? (
<IconButton <IconButton
disabled={shut === "1"} disabled={shut === "1"}
...@@ -200,14 +200,14 @@ export default function ShopProductCard({ ...@@ -200,14 +200,14 @@ export default function ShopProductCard({
overflow={"hidden"} overflow={"hidden"}
alignItems={"center"} alignItems={"center"}
> >
<Tooltip title={courseName}> <Tooltip placement="bottom-start" title={courseName}>
<Typography variant="subtitle2" noWrap> <Typography variant="subtitle2" noWrap>
{courseName} {courseName}
</Typography> </Typography>
</Tooltip> </Tooltip>
<Box width={60} textAlign={"right"} flexShrink={0}> <Box width={60} textAlign={"right"} flexShrink={0}>
<Tooltip title={createTime}> <Tooltip placement="bottom-start" title={createTime}>
<Typography <Typography
component="span" component="span"
variant="body2" variant="body2"
...@@ -229,7 +229,7 @@ export default function ShopProductCard({ ...@@ -229,7 +229,7 @@ export default function ShopProductCard({
{type == 3 ? ( {type == 3 ? (
<div></div> <div></div>
) : ( ) : (
<Tooltip title={type == 1 ? "发布" : type == 2 ? "取消发布" : ""}> <Tooltip placement="bottom-start" title={type == 1 ? "发布" : type == 2 ? "取消发布" : ""}>
<IconButton <IconButton
onClick={() => { onClick={() => {
publish(product); publish(product);
...@@ -250,7 +250,7 @@ export default function ShopProductCard({ ...@@ -250,7 +250,7 @@ export default function ShopProductCard({
</Tooltip> </Tooltip>
)} )}
{type === 1 ? ( {type === 1 ? (
<Tooltip title="授权"> <Tooltip placement="bottom-start" title="授权">
<IconButton <IconButton
onClick={() => { onClick={() => {
authorized(product); authorized(product);
...@@ -269,7 +269,7 @@ export default function ShopProductCard({ ...@@ -269,7 +269,7 @@ export default function ShopProductCard({
<Stack direction={"row"} spacing={1}> <Stack direction={"row"} spacing={1}>
{type === 1 && ( {type === 1 && (
<Tooltip title="备课"> <Tooltip placement="bottom-start" title="备课">
<IconButton <IconButton
onClick={() => { onClick={() => {
history.push("/work/dolessons/" + product.id); history.push("/work/dolessons/" + product.id);
...@@ -283,7 +283,7 @@ export default function ShopProductCard({ ...@@ -283,7 +283,7 @@ export default function ShopProductCard({
</Tooltip> </Tooltip>
)} )}
<Tooltip title="复制创建"> <Tooltip placement="bottom-start" title="复制创建">
<IconButton <IconButton
onClick={() => { onClick={() => {
copy(product); copy(product);
......
This diff is collapsed.
...@@ -64,10 +64,9 @@ function TreeRender({ ...@@ -64,10 +64,9 @@ function TreeRender({
}); });
const [expandall, setexpandall] = useState(false); const [expandall, setexpandall] = useState(false);
const [expandedKeys, onExpand] = useState(); const [expandedKeys, onExpand] = useState();
const { data, refresh } = useRequest(() => { const { data, refresh, loading } = useRequest(() => {
return doFetch({ url, params: params ?? {} }); return doFetch({ url, params: params ?? {} });
}); });
console.log(data);
const [autoExpandParent, setAutoExpandParent] = useState(true); const [autoExpandParent, setAutoExpandParent] = useState(true);
const allkeys = useMemo(() => { const allkeys = useMemo(() => {
...@@ -367,6 +366,9 @@ function TreeRender({ ...@@ -367,6 +366,9 @@ function TreeRender({
open: false, open: false,
})); }));
}} }}
okButtonProps={{
loading,
}}
onOk={() => { onOk={() => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (drawer?.item) { if (drawer?.item) {
...@@ -419,6 +421,9 @@ function TreeRender({ ...@@ -419,6 +421,9 @@ function TreeRender({
visible: false, visible: false,
})); }));
}} }}
okButtonProps={{
loading,
}}
onOk={() => { onOk={() => {
if (modal.okText == "修改") { if (modal.okText == "修改") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
...@@ -63,10 +63,9 @@ function TreeRender({ ...@@ -63,10 +63,9 @@ function TreeRender({
}); });
const [expandall, setexpandall] = useState(false); const [expandall, setexpandall] = useState(false);
const [expandedKeys, onExpand] = useState(); const [expandedKeys, onExpand] = useState();
const { data, refresh } = useRequest(() => { const { data, refresh, loading } = useRequest(() => {
return doFetch({ url, params: params ?? {} }); return doFetch({ url, params: params ?? {} });
}); });
console.log(data);
const [autoExpandParent, setAutoExpandParent] = useState(true); const [autoExpandParent, setAutoExpandParent] = useState(true);
const allkeys = useMemo(() => { const allkeys = useMemo(() => {
...@@ -341,6 +340,7 @@ function TreeRender({ ...@@ -341,6 +340,7 @@ function TreeRender({
> >
<AddIcon style={{ fontSize: 20, color: colors.blue[600] }}></AddIcon> <AddIcon style={{ fontSize: 20, color: colors.blue[600] }}></AddIcon>
</IconButton> </IconButton>
<Modal <Modal
{...drawer} {...drawer}
closable={false} closable={false}
...@@ -354,6 +354,9 @@ function TreeRender({ ...@@ -354,6 +354,9 @@ function TreeRender({
open: false, open: false,
})); }));
}} }}
okButtonProps={{
loading,
}}
onOk={() => { onOk={() => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (drawer?.item) { if (drawer?.item) {
...@@ -406,6 +409,9 @@ function TreeRender({ ...@@ -406,6 +409,9 @@ function TreeRender({
visible: false, visible: false,
})); }));
}} }}
okButtonProps={{
loading,
}}
onOk={() => { onOk={() => {
if (modal.okText == "修改") { if (modal.okText == "修改") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
......
...@@ -15,7 +15,6 @@ import { Empty, Input, message } from "antd"; ...@@ -15,7 +15,6 @@ import { Empty, Input, message } from "antd";
import { useMemo, useState } from "react"; import { useMemo, useState } from "react";
import "./index.less"; import "./index.less";
function Lessons() { function Lessons() {
const [dialogprops, setdialogprops] = useState({ const [dialogprops, setdialogprops] = useState({
open: false, open: false,
...@@ -46,7 +45,6 @@ function Lessons() { ...@@ -46,7 +45,6 @@ function Lessons() {
const datalist = useRequest( const datalist = useRequest(
async () => { async () => {
let res = await doFetch({ url: "/busTrain/list", params }); let res = await doFetch({ url: "/busTrain/list", params });
return res?.data?.dataList; return res?.data?.dataList;
}, },
...@@ -57,7 +55,6 @@ function Lessons() { ...@@ -57,7 +55,6 @@ function Lessons() {
); );
const edit = (row) => { const edit = (row) => {
setdialogprops({ setdialogprops({
open: true, open: true,
defaultFormValue: { ...row }, defaultFormValue: { ...row },
...@@ -82,6 +79,23 @@ function Lessons() { ...@@ -82,6 +79,23 @@ function Lessons() {
}); });
}; };
const tauthorized = (row) => {
doFetch({
url: "/busTrainTeacher/queryRelationTeacher",
params: { trainId: row?.id },
}).then((res) => {
if (res.code === "0000") {
setdialogprops({
open: true,
maxWidth: "xl",
defaultFormValue: { ...row },
teacherIdList: res?.data?.dataList,
title: "协作教师",
});
}
});
};
const remove = (row) => { const remove = (row) => {
runAsync({ runAsync({
url: "/busTrain/delete", url: "/busTrain/delete",
...@@ -93,7 +107,7 @@ function Lessons() { ...@@ -93,7 +107,7 @@ function Lessons() {
const type = row?.type === 1 ? 2 : row?.type === 2 ? 1 : null; const type = row?.type === 1 ? 2 : row?.type === 2 ? 1 : null;
const extra = params ?? { type }; const extra = params ?? { type };
runAsync({ runAsync({
url: "/busTrain/pubOrNotPub", url: "/busTrain/updateType",
params: { id: row.id, ...extra }, params: { id: row.id, ...extra },
}); });
}; };
...@@ -188,6 +202,65 @@ function Lessons() { ...@@ -188,6 +202,65 @@ function Lessons() {
}); });
}} }}
></InitForm> ></InitForm>
) : dialogprops?.title === "协作教师" ? (
<InitForm
defaultFormValue={{
teacherIdList: dialogprops?.teacherIdList,
}}
fields={[
{
rowKey: "id",
rowName: "id",
valueType: "FormSelectList",
dataIndex: "teacherIdList",
colProps: {
span: 24,
},
columns: [
{
title: "账号",
key: "userAccount",
dataIndex: "userAccount",
editable: false,
},
{
title: "教师姓名",
key: "name",
dataIndex: "name",
editable: false,
},
{
title: "学校名称",
key: "schoolId",
dataIndex: "schoolName",
valueType: "select",
search: false,
editable: false,
},
{
title: "院系名称",
key: "departmentName",
dataIndex: "departmentName",
editable: false,
},
],
path: "/user/getAllTeacherByCurrentTeacherSchool",
params: {
type: "",
},
},
]}
onFinish={(val) => {
const teacherIdList = val?.teacherIdList?.map((it) => it?.id);
runAsync({
url: "/busTrainTeacher/relationTrainTeacher",
params: {
teacherIdList,
trainId: dialogprops?.defaultFormValue?.id,
},
});
}}
/>
) : ( ) : (
<InitForm <InitForm
defaultFormValue={{ defaultFormValue={{
...@@ -420,6 +493,7 @@ function Lessons() { ...@@ -420,6 +493,7 @@ function Lessons() {
remove={remove} remove={remove}
publish={publish} publish={publish}
authorized={authorized} authorized={authorized}
tauthorized={tauthorized}
/> />
</Grid> </Grid>
)) ))
......
...@@ -117,7 +117,7 @@ function Dolessons() { ...@@ -117,7 +117,7 @@ function Dolessons() {
cancelText: "取消", cancelText: "取消",
onConfirm: async () => { onConfirm: async () => {
await runAsync({ await runAsync({
url: "/courseQuestion/delete", url: "/busTrainQuestion/delete",
params: { id: row?.id }, params: { id: row?.id },
}); });
}, },
...@@ -328,7 +328,7 @@ function Dolessons() { ...@@ -328,7 +328,7 @@ function Dolessons() {
], ],
}, },
]} ]}
path="/courseQuestion/page" path="/busTrainQuestion/page"
extraparams={{ extraparams={{
trainId: params?.id, trainId: params?.id,
}} }}
...@@ -502,7 +502,7 @@ function Dolessons() { ...@@ -502,7 +502,7 @@ function Dolessons() {
break; break;
} }
runAsync({ runAsync({
url: "/courseQuestion/saveOrUpdate", url: "/busTrainQuestion/saveOrUpdate",
params: postdata, params: postdata,
}); });
}} }}
......
...@@ -299,7 +299,6 @@ function Lessons() { ...@@ -299,7 +299,6 @@ function Lessons() {
} else { } else {
news = [...news, val]; news = [...news, val];
} }
console.log(news);
return { return {
...s, ...s,
typeList: news, typeList: news,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment