Commit a31a3320 authored by wuhao's avatar wuhao 🎯

jkasd

parent 3e200d52
......@@ -85,7 +85,7 @@ export default function ShopProductCard({
<Box className="masker"></Box>
{type == 1 && (
<Box className="edit">
<Tooltip title="编辑">
<Tooltip placement="bottom-start" title="编辑">
<IconButton
onClick={() => {
edit(product);
......@@ -97,7 +97,7 @@ export default function ShopProductCard({
</IconButton>
</Tooltip>
<Tooltip title={confirm ? "确认删除" : "删除"}>
<Tooltip placement="bottom-start" title={confirm ? "确认删除" : "删除"}>
{confirm ? (
<IconButton
disabled={confirm === "1"}
......@@ -150,7 +150,7 @@ export default function ShopProductCard({
<div></div>
{type !== 3 && (
<Tooltip title={shut ? "确认关闭" : "关闭"}>
<Tooltip placement="bottom-start" title={shut ? "确认关闭" : "关闭"}>
{shut ? (
<IconButton
disabled={shut === "1"}
......@@ -200,14 +200,14 @@ export default function ShopProductCard({
overflow={"hidden"}
alignItems={"center"}
>
<Tooltip title={courseName}>
<Tooltip placement="bottom-start" title={courseName}>
<Typography variant="subtitle2" noWrap>
{courseName}
</Typography>
</Tooltip>
<Box width={60} textAlign={"right"} flexShrink={0}>
<Tooltip title={createTime}>
<Tooltip placement="bottom-start" title={createTime}>
<Typography
component="span"
variant="body2"
......@@ -229,7 +229,7 @@ export default function ShopProductCard({
{type == 3 ? (
<div></div>
) : (
<Tooltip title={type == 1 ? "发布" : type == 2 ? "取消发布" : ""}>
<Tooltip placement="bottom-start" title={type == 1 ? "发布" : type == 2 ? "取消发布" : ""}>
<IconButton
onClick={() => {
publish(product);
......@@ -250,7 +250,7 @@ export default function ShopProductCard({
</Tooltip>
)}
{type === 1 ? (
<Tooltip title="授权">
<Tooltip placement="bottom-start" title="授权">
<IconButton
onClick={() => {
authorized(product);
......@@ -269,7 +269,7 @@ export default function ShopProductCard({
<Stack direction={"row"} spacing={1}>
{type === 1 && (
<Tooltip title="备课">
<Tooltip placement="bottom-start" title="备课">
<IconButton
onClick={() => {
history.push("/work/dolessons/" + product.id);
......@@ -283,7 +283,7 @@ export default function ShopProductCard({
</Tooltip>
)}
<Tooltip title="复制创建">
<Tooltip placement="bottom-start" title="复制创建">
<IconButton
onClick={() => {
copy(product);
......
This diff is collapsed.
......@@ -64,10 +64,9 @@ function TreeRender({
});
const [expandall, setexpandall] = useState(false);
const [expandedKeys, onExpand] = useState();
const { data, refresh } = useRequest(() => {
const { data, refresh, loading } = useRequest(() => {
return doFetch({ url, params: params ?? {} });
});
console.log(data);
const [autoExpandParent, setAutoExpandParent] = useState(true);
const allkeys = useMemo(() => {
......@@ -367,6 +366,9 @@ function TreeRender({
open: false,
}));
}}
okButtonProps={{
loading,
}}
onOk={() => {
return new Promise((resolve, reject) => {
if (drawer?.item) {
......@@ -419,6 +421,9 @@ function TreeRender({
visible: false,
}));
}}
okButtonProps={{
loading,
}}
onOk={() => {
if (modal.okText == "修改") {
return new Promise((resolve, reject) => {
......
......@@ -63,10 +63,9 @@ function TreeRender({
});
const [expandall, setexpandall] = useState(false);
const [expandedKeys, onExpand] = useState();
const { data, refresh } = useRequest(() => {
const { data, refresh, loading } = useRequest(() => {
return doFetch({ url, params: params ?? {} });
});
console.log(data);
const [autoExpandParent, setAutoExpandParent] = useState(true);
const allkeys = useMemo(() => {
......@@ -341,6 +340,7 @@ function TreeRender({
>
<AddIcon style={{ fontSize: 20, color: colors.blue[600] }}></AddIcon>
</IconButton>
<Modal
{...drawer}
closable={false}
......@@ -354,6 +354,9 @@ function TreeRender({
open: false,
}));
}}
okButtonProps={{
loading,
}}
onOk={() => {
return new Promise((resolve, reject) => {
if (drawer?.item) {
......@@ -406,6 +409,9 @@ function TreeRender({
visible: false,
}));
}}
okButtonProps={{
loading,
}}
onOk={() => {
if (modal.okText == "修改") {
return new Promise((resolve, reject) => {
......
......@@ -15,7 +15,6 @@ import { Empty, Input, message } from "antd";
import { useMemo, useState } from "react";
import "./index.less";
function Lessons() {
const [dialogprops, setdialogprops] = useState({
open: false,
......@@ -46,7 +45,6 @@ function Lessons() {
const datalist = useRequest(
async () => {
let res = await doFetch({ url: "/busTrain/list", params });
return res?.data?.dataList;
},
......@@ -57,7 +55,6 @@ function Lessons() {
);
const edit = (row) => {
setdialogprops({
open: true,
defaultFormValue: { ...row },
......@@ -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) => {
runAsync({
url: "/busTrain/delete",
......@@ -93,7 +107,7 @@ function Lessons() {
const type = row?.type === 1 ? 2 : row?.type === 2 ? 1 : null;
const extra = params ?? { type };
runAsync({
url: "/busTrain/pubOrNotPub",
url: "/busTrain/updateType",
params: { id: row.id, ...extra },
});
};
......@@ -188,6 +202,65 @@ function Lessons() {
});
}}
></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
defaultFormValue={{
......@@ -420,6 +493,7 @@ function Lessons() {
remove={remove}
publish={publish}
authorized={authorized}
tauthorized={tauthorized}
/>
</Grid>
))
......
......@@ -117,7 +117,7 @@ function Dolessons() {
cancelText: "取消",
onConfirm: async () => {
await runAsync({
url: "/courseQuestion/delete",
url: "/busTrainQuestion/delete",
params: { id: row?.id },
});
},
......@@ -328,7 +328,7 @@ function Dolessons() {
],
},
]}
path="/courseQuestion/page"
path="/busTrainQuestion/page"
extraparams={{
trainId: params?.id,
}}
......@@ -502,7 +502,7 @@ function Dolessons() {
break;
}
runAsync({
url: "/courseQuestion/saveOrUpdate",
url: "/busTrainQuestion/saveOrUpdate",
params: postdata,
});
}}
......
......@@ -299,7 +299,6 @@ function Lessons() {
} else {
news = [...news, val];
}
console.log(news);
return {
...s,
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