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