trithuc-mvc-react 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -32,6 +32,7 @@ DataManagement.propTypes = {
|
|
|
32
32
|
editorFields: PropTypes.array,
|
|
33
33
|
validationSchema: PropTypes.object,
|
|
34
34
|
disableStatus: PropTypes.bool,
|
|
35
|
+
disableAdd: PropTypes.bool,
|
|
35
36
|
statusKey: PropTypes.string,
|
|
36
37
|
tableActions: PropTypes.array,
|
|
37
38
|
disableEditor: PropTypes.bool,
|
|
@@ -50,6 +51,7 @@ function DataManagement({
|
|
|
50
51
|
validationSchema = {},
|
|
51
52
|
statusKey = "Status",
|
|
52
53
|
disableStatus = false,
|
|
54
|
+
disableAdd = false,
|
|
53
55
|
tableActions = [],
|
|
54
56
|
disableEditor = false,
|
|
55
57
|
onAddClick = () => {},
|
|
@@ -107,7 +109,7 @@ function DataManagement({
|
|
|
107
109
|
validationSchema,
|
|
108
110
|
statusKey,
|
|
109
111
|
disableStatus,
|
|
110
|
-
|
|
112
|
+
disableAdd,
|
|
111
113
|
tableActions
|
|
112
114
|
};
|
|
113
115
|
}, [tableName, selectedField, columns, selectedEditItem, dataSearch, setDataSearch, validationSchema, tableActions]);
|
|
@@ -119,7 +121,6 @@ function DataManagement({
|
|
|
119
121
|
}, [Permission, setPermission]);
|
|
120
122
|
const methods = useForm({ defaultValues: {} });
|
|
121
123
|
const { reset, setValue } = methods;
|
|
122
|
-
|
|
123
124
|
return (
|
|
124
125
|
<>
|
|
125
126
|
<DataTableContext.Provider value={values}>
|
|
@@ -148,20 +149,22 @@ function DataManagement({
|
|
|
148
149
|
|
|
149
150
|
<ExportExcelButton tableName={tableName} data={dataSearch} size={elementSize} />
|
|
150
151
|
{(!Permission || Permission.Create) && (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
(!disableAdd) && (
|
|
153
|
+
<Button
|
|
154
|
+
size={elementSize}
|
|
155
|
+
variant="contained"
|
|
156
|
+
startIcon={<Add />}
|
|
157
|
+
onClick={(e) => {
|
|
158
|
+
if (!disableEditor) {
|
|
159
|
+
setOpenEditorDialog(true);
|
|
160
|
+
setSelectedEditItem(null);
|
|
161
|
+
}
|
|
162
|
+
onAddClick(e);
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
Thêm
|
|
166
|
+
</Button>
|
|
167
|
+
)
|
|
165
168
|
)}
|
|
166
169
|
</Stack>
|
|
167
170
|
</Stack>
|
|
@@ -20,7 +20,8 @@ import {
|
|
|
20
20
|
ListItemText,
|
|
21
21
|
ListItemSecondaryAction,
|
|
22
22
|
IconButton,
|
|
23
|
-
Avatar
|
|
23
|
+
Avatar,
|
|
24
|
+
Link
|
|
24
25
|
} from "@mui/material";
|
|
25
26
|
// utils
|
|
26
27
|
import { bytesToSize, fData } from "../../../utils";
|
|
@@ -31,6 +32,7 @@ import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined";
|
|
|
31
32
|
// import { UploadIllustration } from '../../assets';
|
|
32
33
|
|
|
33
34
|
// ----------------------------------------------------------------------
|
|
35
|
+
let URL_APPLICATION = document.querySelector("#URL_APPLICATION").value;
|
|
34
36
|
|
|
35
37
|
const DropZoneStyle = styled("div")(({ theme }) => ({
|
|
36
38
|
outline: "none",
|
|
@@ -204,12 +206,14 @@ export default function UploadMultiFile({ error, showPreview = false, files, onR
|
|
|
204
206
|
{/* <Icon icon={fileFill} width={28} height={28} /> */}
|
|
205
207
|
<TextSnippetOutlinedIcon color="info" />
|
|
206
208
|
</ListItemIcon>
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
<Link href={URL_APPLICATION + file?.urlFile}>
|
|
210
|
+
<ListItemText
|
|
211
|
+
primary={isString(file) ? file : name}
|
|
212
|
+
secondary={isString(file) ? "" : size}
|
|
213
|
+
primaryTypographyProps={{ variant: "subtitle2" }}
|
|
214
|
+
secondaryTypographyProps={{ variant: "caption" }}
|
|
215
|
+
/>
|
|
216
|
+
</Link>
|
|
213
217
|
<ListItemSecondaryAction>
|
|
214
218
|
<IconButton edge="end" size="small" onClick={() => onRemove(file)}>
|
|
215
219
|
<CloseIcon />
|