Commit 590aa4c2 authored by wuhao's avatar wuhao 🎯

asder

parent b8a303e3
Pipeline #3411 passed with stages
in 5 minutes and 4 seconds
...@@ -5,12 +5,14 @@ export default { ...@@ -5,12 +5,14 @@ export default {
dev:{ dev:{
"REACT_APP_URL":"http://192.168.40.36:8044/vstp", // http://tasks-dev.nangaoyun.com "REACT_APP_URL":"http://192.168.40.36:8044/vstp", // http://tasks-dev.nangaoyun.com
"DEFAULT_HEAD_IMG":"./assets/images/avatars/avatar_21.jpg", "DEFAULT_HEAD_IMG":"./assets/images/avatars/avatar_21.jpg",
"DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg" "DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg",
"DOWNLOAD_URL":"http://192.168.40.2",
}, },
test:{ test:{
"REACT_APP_URL":"/vstp", "REACT_APP_URL":"/vstp",
"DEFAULT_HEAD_IMG":"./assets/images/avatars/avatar_21.jpg", "DEFAULT_HEAD_IMG":"./assets/images/avatars/avatar_21.jpg",
"DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg" "DEFAULT_404_IMG":"./assets/illustrations/illustration_404.svg",
"DOWNLOAD_URL":"http://192.168.40.2",
}, },
prod:{ prod:{
"REACT_APP_URL":"http://tasks.nangaoyun.com" "REACT_APP_URL":"http://tasks.nangaoyun.com"
......
import { Button, Stack, Typography } from "@mui/material"; import { Button, Stack, Typography } from "@mui/material";
import { useState } from "react"; import { useState } from "react";
import DraggableDialog from "../DraggableDialog"; import DraggableDialog from "../DraggableDialog";
import InitForm from "../InitForm" import InitForm from "../InitForm";
function ImportExcel() { function ImportExcel({importurl, downloadurl, refresh}) {
const [dialogprops, setdialogprops] = useState(); const [dialogprops, setdialogprops] = useState();
return ( return (
...@@ -15,6 +15,7 @@ function ImportExcel() { ...@@ -15,6 +15,7 @@ function ImportExcel() {
setdialogprops({ setdialogprops({
open: true, open: true,
title: "导入", title: "导入",
footer: false,
}); });
}} }}
> >
...@@ -22,11 +23,11 @@ function ImportExcel() { ...@@ -22,11 +23,11 @@ function ImportExcel() {
</Button> </Button>
<DraggableDialog <DraggableDialog
dialogprops={dialogprops} dialogprops={dialogprops}
handleClose={()=>{ handleClose={() => {
setdialogprops(s=>({ setdialogprops((s) => ({
...s, ...s,
open:false open: false,
})) }));
}} }}
formdom={ formdom={
<InitForm <InitForm
...@@ -37,11 +38,17 @@ function ImportExcel() { ...@@ -37,11 +38,17 @@ function ImportExcel() {
dataIndex: "file", dataIndex: "file",
key: "file", key: "file",
valueType: "uploadDragger", valueType: "uploadDragger",
url: importurl,
colProps: { colProps: {
span: 24, span: 24,
}, },
}, },
]} ]}
onValuesChange={(vals) => {
if(Object.values(vals)?.[0]?.url){
refresh?.()
}
}}
></InitForm> ></InitForm>
} }
> >
...@@ -55,7 +62,16 @@ function ImportExcel() { ...@@ -55,7 +62,16 @@ function ImportExcel() {
<Typography variant={"b"} color={"#999999"}> <Typography variant={"b"} color={"#999999"}>
*请先下载模板文件 *请先下载模板文件
</Typography> </Typography>
<Button variant="text">模板文件</Button> <Button
variant="text"
onClick={() => {
console.log(downloadurl);
window.open(DOWNLOAD_URL + downloadurl);
}}
>
模板文件
</Button>
</Stack> </Stack>
</Stack> </Stack>
</DraggableDialog> </DraggableDialog>
......
...@@ -1225,12 +1225,15 @@ function UploadImage({ item, colProps }) { ...@@ -1225,12 +1225,15 @@ function UploadImage({ item, colProps }) {
// uploadDragger // uploadDragger
function UploadDragger({ item, colProps }) { function UploadDragger({ item, colProps }) {
let token = localStorage.getItem("TOKENES");
return ( return (
<> <>
<ProFormUploadDragger <ProFormUploadDragger
fieldProps={{ fieldProps={{
...item?.fieldProps, ...item?.fieldProps,
action: REACT_APP_URL + "/file/upload", action: REACT_APP_URL + (item?.url ?? "/file/upload"),
headers: { token },
onPreview: (file) => { onPreview: (file) => {
let url = ""; let url = "";
if (file.response) { if (file.response) {
...@@ -1361,13 +1364,13 @@ function TableSelect({ item, value, onChange, params = {} }) { ...@@ -1361,13 +1364,13 @@ function TableSelect({ item, value, onChange, params = {} }) {
color: chooses.includes(it[rowKey]) ? "#1890ff" : "#333333", color: chooses.includes(it[rowKey]) ? "#1890ff" : "#333333",
transition: "all 0.4s", transition: "all 0.4s",
userSelect: "none", userSelect: "none",
paddingRight:12 paddingRight: 12,
}} }}
> >
{it[item.rowName??"name"]} {it[item.rowName ?? "name"]}
</span> </span>
<CloseOutlined <CloseOutlined
style={{color:"red"}} style={{ color: "red" }}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
let newvalue = value.filter( let newvalue = value.filter(
......
...@@ -37,12 +37,6 @@ ShopProductCard.propTypes = { ...@@ -37,12 +37,6 @@ ShopProductCard.propTypes = {
export default function ShopProductCard({ export default function ShopProductCard({
product, product,
remove,
edit,
copy,
publish,
authorized,
tauthorized,
}) { }) {
const { const {
trainName, trainName,
...@@ -53,15 +47,11 @@ export default function ShopProductCard({ ...@@ -53,15 +47,11 @@ export default function ShopProductCard({
deadline, deadline,
sectionNum, sectionNum,
experimentNum, experimentNum,
studentNum,
startTime, startTime,
totalSubmitExperimentNum,
totalExperimentNum,
} = product; } = product;
const [confirm, setconfirm] = useState(false); const [confirm, setconfirm] = useState(false);
const [shut, setshut] = useState(false); const [shut, setshut] = useState(false);
const ifs = type === 1 || type === 3;
return ( return (
<Card sx={{ borderRadius: 3 }} className="hovered" id="jikl"> <Card sx={{ borderRadius: 3 }} className="hovered" id="jikl">
......
...@@ -218,7 +218,7 @@ export default function ShopProductCard({ ...@@ -218,7 +218,7 @@ export default function ShopProductCard({
<Progress <Progress
type="circle" type="circle"
size={20} size={20}
percent={parseInt(Math.random() * 100)} percent={(totalSubmitExperimentNum*100) / (totalExperimentNum??1)}
strokeColor={{ strokeColor={{
"0%": "#00c6fb", "0%": "#00c6fb",
"100%": "#005bea", "100%": "#005bea",
...@@ -270,7 +270,7 @@ export default function ShopProductCard({ ...@@ -270,7 +270,7 @@ export default function ShopProductCard({
paddingLeft: 1, paddingLeft: 1,
}} }}
> >
{startTime ?? "-"}~{deadline} {startTime ?? "-"}~{deadline}
</Typography> </Typography>
</Stack> </Stack>
</Stack> </Stack>
......
...@@ -276,7 +276,13 @@ function Organization() { ...@@ -276,7 +276,13 @@ function Organization() {
> >
<Typography variant="h5">组织管理</Typography> <Typography variant="h5">组织管理</Typography>
<Stack spacing={2} direction="row"> <Stack spacing={2} direction="row">
<ImportExcel></ImportExcel> <ImportExcel
importurl="/organization/dataImport"
downloadurl="/download/组织架构导入模板.xlsx"
refresh={()=>{
actionRef?.current?.reload();
}}
></ImportExcel>
<PremButton <PremButton
btn={{ btn={{
variant: "contained", variant: "contained",
......
...@@ -655,7 +655,13 @@ function Student() { ...@@ -655,7 +655,13 @@ function Student() {
<Typography variant="h5">学生管理</Typography> <Typography variant="h5">学生管理</Typography>
{active === "1" ? ( {active === "1" ? (
<Stack spacing={2} direction="row"> <Stack spacing={2} direction="row">
<ImportExcel></ImportExcel> <ImportExcel
importurl="/user/studentImport"
downloadurl="/download/学生管理数据导入模板.xlsx"
refresh={() => {
actionRef?.current?.reload();
}}
></ImportExcel>
<PremButton <PremButton
btn={{ btn={{
variant: "contained", variant: "contained",
......
...@@ -488,10 +488,7 @@ function Teacher() { ...@@ -488,10 +488,7 @@ function Teacher() {
key: "1", key: "1",
label: `正式用户`, label: `正式用户`,
children: ( children: (
<Box <Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
boxShadow={"0 0 18px #f0f0f0"}
borderRadius={2}
>
<AutoTable <AutoTable
actionRef={actionRef} actionRef={actionRef}
scroll={{ x: 1366 }} scroll={{ x: 1366 }}
...@@ -519,10 +516,7 @@ function Teacher() { ...@@ -519,10 +516,7 @@ function Teacher() {
key: "2", key: "2",
label: `教师认证申请`, label: `教师认证申请`,
children: ( children: (
<Box <Box boxShadow={"0 0 18px #f0f0f0"} borderRadius={2}>
boxShadow={"0 0 18px #f0f0f0"}
borderRadius={2}
>
<AutoTable <AutoTable
actionRef={actionRefs} actionRef={actionRefs}
scroll={{ x: 1366 }} scroll={{ x: 1366 }}
...@@ -661,7 +655,13 @@ function Teacher() { ...@@ -661,7 +655,13 @@ function Teacher() {
<Typography variant="h5">教师管理</Typography> <Typography variant="h5">教师管理</Typography>
{active === "1" ? ( {active === "1" ? (
<Stack spacing={2} direction="row"> <Stack spacing={2} direction="row">
<ImportExcel></ImportExcel> <ImportExcel
importurl="/user/teacherImport"
downloadurl="/download/教师管理数据导入模板.xlsx"
refresh={() => {
actionRef?.current?.reload();
}}
></ImportExcel>
<PremButton <PremButton
btn={{ btn={{
variant: "contained", variant: "contained",
...@@ -678,8 +678,9 @@ function Teacher() { ...@@ -678,8 +678,9 @@ function Teacher() {
新增教师 新增教师
</PremButton> </PremButton>
</Stack> </Stack>
):<Box height={36}/> ) : (
} <Box height={36} />
)}
</Box> </Box>
<Tabs <Tabs
......
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