feat: confirm 적용

main
donggyu97 3 years ago
parent 23a1adfb05
commit 3aa8376a0b

@ -23,7 +23,11 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
};
const onRemove = () => {
if (window.confirm('삭제 하시겠습니까?')) {
handleModalSave('DELETE', { scCode: rowData.scCode });
} else {
window.close();
}
};
const viewImg = (methodName) => {

@ -93,6 +93,40 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
// console.log(pair[0], pair[1]);
// }
//
if (scCarnum.length < 1) {
alert.show('차량번호는 필수입니다.');
return;
}
if (scName.length < 1) {
alert.show('성명은 필수입니다.');
return;
}
if (scDong.length < 1) {
alert.show('동명은(는) 필수입니다.');
return;
}
if (scCdate.length < 1) {
alert.show('접수일자는 필수입니다.');
return;
}
if (scWdate.length < 1) {
alert.show('위반일자는 필수입니다.');
return;
}
if (scJbtime.length < 1) {
alert.show('위반시간은 필수입니다.');
return;
}
if (zipcode1.length < 1) {
alert.show('우편번호는 필수입니다.');
return;
}
if (rowData.scPicad1.length < 1 || rowData.scFrecad1.length < 1 || rowData.scContad1.length < 1) {
alert.show('단속사진,진술서,첨부자료는 하나씩 업로드 되야합니다.');
return;
}
handleModalSave('SAVE', formData);
};

@ -65,6 +65,47 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
Object.values(contads).forEach((v) => {
formData.append('contadFiles', v);
});
// console.log(Object.values(picads)[0]);
//
if (scCarnum.length < 1) {
alert.show('차량번호는 필수입니다.');
return;
}
if (scName.length < 1) {
alert.show('성명은 필수입니다.');
return;
}
if (scDong.length < 1) {
alert.show('동명은(는) 필수입니다.');
return;
}
if (scCdate.length < 1) {
alert.show('접수일자는 필수입니다.');
return;
}
if (scWdate === null || scWdate === '') {
alert.show('위반일자는 필수입니다.');
return;
}
if (scJbtime === null || scJbtime === '') {
alert.show('위반시간은 필수입니다.');
return;
}
if (scPos.length < 1) {
alert.show('위반장소는 필수입니다.');
return;
}
if (zipcode1 === null || zipcode1 === '') {
alert.show('우편번호는 필수입니다.');
return;
}
if (Object.values(picads)[0] === undefined) {
alert.show('단속사진은 하나이상 업로드 해야 합니다.');
return;
}
handleModalSave('SAVE', formData);
};

@ -128,6 +128,7 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
const handleSaveResident = (type, payload) => {
switch (type) {
case 'SAVE':
if (window.confirm('저장 하시겠습니까?')) {
saveJudgeData(payload).then((res) => {
if (res?.success) {
setCreate(false);
@ -139,6 +140,9 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
showAlert.show(`${res?.data.message}`);
}
});
} else {
window.close();
}
break;
case 'DELETE':
removeJudgeData(payload).then((res) => {

@ -75,6 +75,7 @@ const JudgeRegistReview = ({ scDatagb, menuName }) => {
};
const handleSave = () => {
if (window.confirm('저장 하시겠습니까?')) {
if (selectionModel.length === 0) {
xitCmm.alertParam(`처리할 데이타가 없습니다`);
} else {
@ -82,6 +83,9 @@ const JudgeRegistReview = ({ scDatagb, menuName }) => {
setOpen(true);
// alert(` => ${selectRows}`);
}
} else {
window.close();
}
};
const submitResidentTargets = (params) => {

@ -67,6 +67,7 @@ const JudgeReview = ({ msDatagb, menuName }) => {
const deleteJudge = useCallback(
(row) => () => {
if (window.confirm('삭제 하시겠습니까?')) {
removeJudge(row).then((response) => {
if (response && response.success) {
setRowsState({
@ -78,6 +79,9 @@ const JudgeReview = ({ msDatagb, menuName }) => {
alert.show(response.message);
}
});
} else {
window.close();
}
},
[]
);

@ -68,12 +68,16 @@ const ParkingRegister = () => {
};
const handleSave = () => {
if (window.confirm('저장 하시겠습니까?')) {
if (selectionModel.length === 0) {
xitCmm.alertParam(`처리할 데이타가 없습니다`);
} else {
setOpen(true);
// alert(` => ${selectRows}`);
}
} else {
window.close();
}
};
const submitParkingTargets = (params) => {

@ -68,6 +68,7 @@ const ParkingReview = () => {
const removeJudge = useCallback(
(row) => () => {
if (window.confirm('삭제 하시겠습니까?')) {
removeParkingJudge(row).then((response) => {
if (response && response.success) {
setRowsState({
@ -79,6 +80,9 @@ const ParkingReview = () => {
alert.show(response.message);
}
});
} else {
window.close();
}
},
[]
);

@ -119,6 +119,7 @@ const Board = () => {
const submitBoard = (type, payload) => {
switch (type) {
case 'SAVE':
if (window.confirm('저장 하시겠습니까?')) {
saveBoard(payload).then((res) => {
if (res?.success) {
search();
@ -127,8 +128,12 @@ const Board = () => {
alert.show(`${res?.data.message}`);
}
}); // .then((res) => {
} else {
window.close();
}
break;
case 'DELETE':
if (window.confirm('삭제 하시겠습니까?')) {
removeBoard(payload).then((res) => {
if (res?.success) {
search();
@ -137,6 +142,9 @@ const Board = () => {
alert.show(`${res?.data.message}`);
}
}); // .then((res) => {
} else {
window.close();
}
break;
default:
}

@ -32,6 +32,20 @@ const ModifyBoardForm = (props) => {
ciPass: pass
};
const replaceContents = contents.replace('<p><br></p>', '').length;
if (subject.length < 1) {
alert('제목은 필수입니다.');
return;
}
if (replaceContents < 1) {
alert('내용은 필수입니다.');
return;
}
if (pass === undefined || pass === '') {
alert('비밀번호는 필수입니다.');
return;
}
handleModalSave('SAVE', saveData);
};

@ -32,6 +32,19 @@ const BoardForm = (props) => {
ciContents: contents,
ciPass: pass
};
const replaceContents = contents.replace('<p><br></p>', '').length;
if (subject.length < 1) {
alert('제목은 필수입니다.');
return;
}
if (replaceContents < 1) {
alert('내용은 필수입니다.');
return;
}
if (pass === undefined || pass === '') {
alert('비밀번호는 필수입니다.');
return;
}
handleModalSave('SAVE', saveData);
};

@ -21,8 +21,8 @@ const ModifyPublicBoardForm = (props) => {
const alert = useAlert();
const quillRef = useRef();
const [dept, setDept] = useState(rowData?.inDept);
const [subject, setSubject] = useState(rowData?.inTitle);
const [contents, setContents] = useState(rowData?.inContents);
const [subject, setSubject] = useState(rowData?.inTitle ?? '');
const [contents, setContents] = useState(rowData?.inContents ?? '');
const [filesInfo, setFilesInfo] = useState();
const [selectedFile, setSelectedFile] = useState(rowData?.inFilename); //
// const [fileData, setFileData] = useState();
@ -43,6 +43,12 @@ const ModifyPublicBoardForm = (props) => {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]);
}
const replaceContent = contents.replace('<p><br></p>', '').length;
if (subject.length < 1 || replaceContent < 1) {
alert.show('제목과 내용은 필수입니다.');
return;
}
handleModalSave('SAVE', formData);
};

@ -13,6 +13,7 @@ import InputLabel from 'ui-component/extended/Form/InputLabel';
import { List, Save } from '@mui/icons-material';
import FileForm from 'views/cmm/file-ctl/FileForm';
import PropTypes from 'prop-types';
import { value } from 'lodash/seq';
const NewPublicBoardForm = (props) => {
// eslint-disable-next-line react/prop-types
@ -41,6 +42,11 @@ const NewPublicBoardForm = (props) => {
// eslint-disable-next-line no-plusplus
for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]);
}
const replaceContent = contents.replace('<p><br></p>', '').length;
if (subject.length < 1 || replaceContent < 1) {
alert.show('제목과 내용은 필수입니다.');
return;
}
handleModalSave('SAVE', formData);
};
@ -98,7 +104,7 @@ const NewPublicBoardForm = (props) => {
</Grid>
<Grid item xs={4}>
<FormControl fullWidth>
<InputLabel required>업무구분</InputLabel>
<InputLabel>업무구분</InputLabel>
<Select size="small" label="업무구분" required value={dept} onChange={(e) => setDept(e.target.value)} fullWidth>
<MenuItem value="주정차위반">주정차위반</MenuItem>
<MenuItem value="장애인위반">장애인위반</MenuItem>

@ -103,6 +103,7 @@ const PublicBoard = () => {
const submitPublicBoard = (type, payload) => {
switch (type) {
case 'SAVE':
if (window.confirm('저장 하시겠습니까?')) {
savePublicBoard(payload).then((res) => {
if (res?.success) {
search();
@ -111,12 +112,19 @@ const PublicBoard = () => {
alert.show(`${res?.data.message}`);
}
}); // .then((res) => {
} else {
window.close();
}
break;
case 'DELETE':
if (window.confirm('삭제 하시겠습니까?')) {
removePublicBoard(payload).then(() => {
search();
setOpen(false);
}); // .then((res) => {
} else {
window.close();
}
break;
default:
}

@ -184,6 +184,7 @@ const UserManager = () => {
const handleModalSave = (type, payload) => {
switch (type) {
case 'SAVE':
if (window.confirm('저장 하시겠습니까?')) {
saveUser(payload).then((res) => {
if (res?.success) {
setRowsState((prevState) => ({
@ -196,8 +197,12 @@ const UserManager = () => {
alert.show(`${res?.data.message}`);
}
}); // .then((res) => {
} else {
window.close();
}
break;
case 'DELETE':
if (window.confirm('삭제 하시겠습니까?')) {
removeUser(payload).then((res) => {
if (res?.success) {
setRowsState({
@ -210,6 +215,9 @@ const UserManager = () => {
alert.show(`${res?.data.message}`);
}
}); // .then((res) => {
} else {
window.close();
}
break;
default:
}

@ -37,6 +37,14 @@ const UserManagementForm = (props) => {
isenable,
newYn: create ? 'Y' : 'N'
};
if (userid.length < 1) {
alert('사용자 ID는 필수입니다.');
return;
}
if (passwd.length < 1) {
alert('비밀번호는 필수입니다.');
return;
}
handleModalSave('SAVE', saveParam);
};

Loading…
Cancel
Save