add admin parent detail api
このコミットが含まれているのは:
コミット
b2eee356fd
|
@ -106,20 +106,20 @@ class FathersController extends Controller {
|
|||
}
|
||||
|
||||
$result = [];
|
||||
$father_select = ['id', 'company', 'image'];
|
||||
$father_select = ['id', 'company', 'image', 'email'];
|
||||
$father_relation_select = ['created_at'];
|
||||
|
||||
if (null === ($list = Father::select($father_select)->where('company', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
|
||||
if (null === ($result = Father::select($father_select)->where('company', 'LIKE', '%'.$r->keyword.'%')->orderBy('created_at', 'desc')->get())) {
|
||||
// 親一覧の取得に失敗
|
||||
return ['status_code' => 400];
|
||||
}
|
||||
|
||||
foreach ($list as $i => $l) {
|
||||
$result[] = $l;
|
||||
if (null === ($result[$i]['relation'] = FatherRelation::select($father_relation_select)->where('father_id', $l->id)->first())) {
|
||||
return ['status_code' => 400];
|
||||
}
|
||||
}
|
||||
// foreach ($list as $i => $l) {
|
||||
// $result[] = $l;
|
||||
// if (null === ($result[$i]['relation'] = FatherRelation::select($father_relation_select)->where('father_id', $l->id)->first())) {
|
||||
// return ['status_code' => 400];
|
||||
// }
|
||||
// }
|
||||
|
||||
// 親一覧の取得に成功
|
||||
return ['status_code' => 200, 'params' => $result];
|
||||
|
@ -127,20 +127,20 @@ class FathersController extends Controller {
|
|||
|
||||
public function list () {
|
||||
$result = [];
|
||||
$father_select = ['id', 'company', 'image'];
|
||||
$father_select = ['id', 'company', 'image', 'email'];
|
||||
$father_relation_select = ['created_at'];
|
||||
|
||||
if (null === ($list = Father::select($father_select)->orderBy('created_at', 'desc')->get())) {
|
||||
if (null === ($result = Father::select($father_select)->orderBy('created_at', 'desc')->get())) {
|
||||
// 親一覧の取得に失敗
|
||||
return ['status_code' => 400];
|
||||
}
|
||||
|
||||
foreach ($list as $i => $l) {
|
||||
$result[] = $l;
|
||||
if (null === ($result[$i]['relation'] = FatherRelation::select($father_relation_select)->where('father_id', $l->id)->first())) {
|
||||
return ['status_code' => 400];
|
||||
}
|
||||
}
|
||||
// foreach ($list as $i => $l) {
|
||||
// $result[] = $l;
|
||||
// if (null === ($result[$i]['relation'] = FatherRelation::select($father_relation_select)->where('father_id', $l->id)->first())) {
|
||||
// return ['status_code' => 400];
|
||||
// }
|
||||
// }
|
||||
|
||||
// 親一覧の取得に成功
|
||||
return ['status_code' => 200, 'params' => $result];
|
||||
|
|
|
@ -28773,9 +28773,11 @@ var Child = function Child() {
|
|||
|
||||
setLoaded(false);
|
||||
setChildrenList(null);
|
||||
var formdata = new FormData();
|
||||
formdata.append('keyword', keyword);
|
||||
axios__WEBPACK_IMPORTED_MODULE_1___default().post('/api/admin/children/search', formdata).then(function (response) {
|
||||
axios__WEBPACK_IMPORTED_MODULE_1___default().get('/api/admin/children/search', {
|
||||
params: {
|
||||
keyword: keyword
|
||||
}
|
||||
}).then(function (response) {
|
||||
setLoaded(true);
|
||||
|
||||
if (response.data.status_code == 200) {
|
||||
|
@ -30589,12 +30591,30 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
|
||||
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/esm/react-router.js");
|
||||
/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material-ui/core/IconButton */ "./node_modules/@material-ui/core/IconButton/IconButton.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
||||
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
|
||||
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
|
||||
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/esm/react-router.js");
|
||||
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);
|
||||
/* harmony import */ var _material_ui_lab__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @material-ui/lab */ "./node_modules/@material-ui/lab/LoadingButton/LoadingButton.js");
|
||||
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material-ui/core */ "./node_modules/@material-ui/core/CircularProgress/CircularProgress.js");
|
||||
/* harmony import */ var _material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material-ui/core/IconButton */ "./node_modules/@material-ui/core/IconButton/IconButton.js");
|
||||
/* harmony import */ var _mui_material_Button__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @mui/material/Button */ "./node_modules/@mui/material/Button/Button.js");
|
||||
/* harmony import */ var _mui_material_Dialog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @mui/material/Dialog */ "./node_modules/@mui/material/Dialog/Dialog.js");
|
||||
/* harmony import */ var _mui_material_DialogActions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @mui/material/DialogActions */ "./node_modules/@mui/material/DialogActions/DialogActions.js");
|
||||
/* harmony import */ var _mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @mui/material/DialogContent */ "./node_modules/@mui/material/DialogContent/DialogContent.js");
|
||||
/* harmony import */ var _mui_material_DialogContentText__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @mui/material/DialogContentText */ "./node_modules/@mui/material/DialogContentText/DialogContentText.js");
|
||||
/* harmony import */ var _mui_material_Slide__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @mui/material/Slide */ "./node_modules/@mui/material/Slide/Slide.js");
|
||||
/* harmony import */ var _component_alert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../component/alert */ "./resources/js/component/alert.jsx");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
||||
|
||||
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
||||
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
@ -30607,6 +30627,11 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
|
||||
|
@ -30614,38 +30639,83 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|||
|
||||
|
||||
|
||||
var ParentDetail = function ParentDetail() {
|
||||
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('/assets/img/avatar/avatar-sample03@2x.png'),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var Transition = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(function Transition(props, ref) {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Slide__WEBPACK_IMPORTED_MODULE_5__.default, _objectSpread({
|
||||
direction: "up",
|
||||
ref: ref
|
||||
}, props));
|
||||
});
|
||||
|
||||
var ParentDetail = function ParentDetail(props) {
|
||||
var _props$match$params3, _props$match$params4;
|
||||
|
||||
var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_6__.useHistory)();
|
||||
|
||||
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('/assets/img/avatar/avatar-sample03@2x.png'),
|
||||
_useState2 = _slicedToArray(_useState, 2),
|
||||
image = _useState2[0],
|
||||
setImage = _useState2[1];
|
||||
|
||||
var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_3__.useHistory)();
|
||||
var parent = {
|
||||
id: 1,
|
||||
last_name: '田中',
|
||||
first_name: '達也',
|
||||
username: 'chankan',
|
||||
tel: '08012927104',
|
||||
email: 'chankan07@gmail.com',
|
||||
company: 'ああああああああああああああああああああああああああああああああああああああああああああああああああああああああ',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png'
|
||||
};
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
||||
var formdata = new FormData();
|
||||
var child_id = 1; // axios.get('/api/meetings/listOfNonApprovalOfChild', {child_id: child_id})
|
||||
// .then(response => {
|
||||
// if(response.data.status_code==200){
|
||||
// // window.location.href = '/register/c-account/complete';
|
||||
// }
|
||||
// else if(response.data.status_code==400){
|
||||
// // window.location.href = '/register/c-account/error';
|
||||
// }
|
||||
// else if(response.data.status_code==500){
|
||||
// // window.location.href = '/unknown-error';
|
||||
// }
|
||||
// })
|
||||
// .catch(err=>console.log(err))
|
||||
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
||||
_useState4 = _slicedToArray(_useState3, 2),
|
||||
open = _useState4[0],
|
||||
setOpen = _useState4[1];
|
||||
|
||||
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
||||
_useState6 = _slicedToArray(_useState5, 2),
|
||||
loaded = _useState6[0],
|
||||
setLoaded = _useState6[1];
|
||||
|
||||
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
||||
_useState8 = _slicedToArray(_useState7, 2),
|
||||
submit = _useState8[0],
|
||||
setSubmit = _useState8[1];
|
||||
|
||||
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
|
||||
_useState10 = _slicedToArray(_useState9, 2),
|
||||
parent = _useState10[0],
|
||||
setParent = _useState10[1];
|
||||
|
||||
var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
|
||||
_useState12 = _slicedToArray(_useState11, 2),
|
||||
_400error = _useState12[0],
|
||||
set400Error = _useState12[1];
|
||||
|
||||
var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
|
||||
image: ''
|
||||
}),
|
||||
_useState14 = _slicedToArray(_useState13, 2),
|
||||
_422errors = _useState14[0],
|
||||
set422Errors = _useState14[1];
|
||||
|
||||
var _useState15 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
|
||||
_useState16 = _slicedToArray(_useState15, 2),
|
||||
_success = _useState16[0],
|
||||
setSuccess = _useState16[1];
|
||||
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
||||
var _props$match$params;
|
||||
|
||||
setLoaded(false);
|
||||
axios__WEBPACK_IMPORTED_MODULE_2___default().get("/api/admin/fathers/detail/".concat((_props$match$params = props.match.params) === null || _props$match$params === void 0 ? void 0 : _props$match$params.father_id)).then(function (response) {
|
||||
setLoaded(true);
|
||||
|
||||
if (response.data.status_code == 200) {
|
||||
setParent(response.data.params[0]);
|
||||
}
|
||||
})["catch"](function (err) {
|
||||
return console.log(err);
|
||||
});
|
||||
}, []);
|
||||
|
||||
var handleImageChange = function handleImageChange(e) {
|
||||
|
@ -30655,32 +30725,152 @@ var ParentDetail = function ParentDetail() {
|
|||
reader.readAsDataURL(_file);
|
||||
|
||||
reader.onloadend = function () {
|
||||
setImage(reader.result);
|
||||
var _props$match$params2;
|
||||
|
||||
var request = {
|
||||
image: reader.result
|
||||
};
|
||||
axios__WEBPACK_IMPORTED_MODULE_2___default().put("/api/admin/fathers/updateImage/".concat((_props$match$params2 = props.match.params) === null || _props$match$params2 === void 0 ? void 0 : _props$match$params2.father_id), request).then(function (response) {
|
||||
switch (response.data.status_code) {
|
||||
case 200:
|
||||
{
|
||||
setImage(reader.result);
|
||||
setSuccess(response.data.success_messages);
|
||||
break;
|
||||
}
|
||||
|
||||
case 400:
|
||||
set400Error(response.data.error_messages);
|
||||
break;
|
||||
|
||||
case 422:
|
||||
set422Errors(response.data.error_messages);
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
function openModal() {
|
||||
return _openModal.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _openModal() {
|
||||
_openModal = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
|
||||
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
setOpen(true);
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee);
|
||||
}));
|
||||
return _openModal.apply(this, arguments);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
function closeModal() {
|
||||
return _closeModal.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _closeModal() {
|
||||
_closeModal = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee2() {
|
||||
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
setOpen(false);
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2);
|
||||
}));
|
||||
return _closeModal.apply(this, arguments);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
function handleAccept() {
|
||||
return _handleAccept.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _handleAccept() {
|
||||
_handleAccept = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee3() {
|
||||
var _props$match$params5;
|
||||
|
||||
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
try {
|
||||
setSubmit(true);
|
||||
axios__WEBPACK_IMPORTED_MODULE_2___default().delete("/api/admin/fathers/delete/".concat((_props$match$params5 = props.match.params) === null || _props$match$params5 === void 0 ? void 0 : _props$match$params5.father_id)).then(function (response) {
|
||||
closeModal();
|
||||
setSubmit(false);
|
||||
|
||||
if (response.data.status_code == 200) {
|
||||
setSuccess('削除に成功しました!');
|
||||
} else {
|
||||
set400Error("削除に失敗しました。");
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
}
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3);
|
||||
}));
|
||||
return _handleAccept.apply(this, arguments);
|
||||
}
|
||||
|
||||
;
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "l-content",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "l-content-w560",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "l-content__ttl",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "l-content__ttl__left",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("h2", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
|
||||
children: "\u89AA\u8A73\u7D30"
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "l-content-wrap",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("section", {
|
||||
className: "profile-container",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "profile-wrap",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "profile-wrap position-relative",
|
||||
style: {
|
||||
minHeight: '500px'
|
||||
},
|
||||
children: [!loaded && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_7__.default, {
|
||||
color: "secondary",
|
||||
style: {
|
||||
top: '30%',
|
||||
left: 'calc(50% - 22px)',
|
||||
color: 'green',
|
||||
position: 'absolute'
|
||||
}
|
||||
}), loaded && (parent ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "profile-content",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input", {
|
||||
type: "file",
|
||||
id: "avatar",
|
||||
name: "avatar",
|
||||
|
@ -30689,23 +30879,23 @@ var ParentDetail = function ParentDetail() {
|
|||
onChange: function onChange(e) {
|
||||
return handleImageChange(e);
|
||||
}
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "avatar-wrapper",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", {
|
||||
htmlFor: "avatar",
|
||||
className: "avatar-label",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_4__.default, {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_core_IconButton__WEBPACK_IMPORTED_MODULE_8__.default, {
|
||||
color: "primary",
|
||||
"aria-label": "upload picture",
|
||||
component: "span",
|
||||
className: "bg-yellow shadow-sm w-40-px h-40-px",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||
src: "/assets/img/icon/camera.svg",
|
||||
width: "20",
|
||||
height: "20"
|
||||
})
|
||||
})
|
||||
}), image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||
src: image,
|
||||
alt: "",
|
||||
width: "100%",
|
||||
|
@ -30714,96 +30904,147 @@ var ParentDetail = function ParentDetail() {
|
|||
borderRadius: '50%'
|
||||
}
|
||||
})]
|
||||
}), _422errors.image && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
||||
className: "l-alert__text--error ft-16 ft-md-14",
|
||||
children: _422errors.image
|
||||
})]
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p", {
|
||||
className: "profile-name",
|
||||
children: [parent.last_name, "\u3000", parent.first_name]
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
className: "profile-info",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "profile-name ft-xs-14",
|
||||
children: "".concat(parent.first_name, " ").concat(parent.last_name)
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
className: "profile-info ft-18 ft-xs-14",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "profile-info__item",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("a", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("a", {
|
||||
href: "mailto:".concat(parent.email),
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "profile-info__icon",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||
src: "/assets/img/icon/mail.svg",
|
||||
alt: "\u30E1\u30FC\u30EB"
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "txt",
|
||||
children: parent.email
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "profile-info__item",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("a", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("a", {
|
||||
href: "tel:".concat(parent.tel),
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "profile-info__icon",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||
src: "/assets/img/icon/phone.svg",
|
||||
alt: "\u96FB\u8A71"
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "txt",
|
||||
children: parent.tel
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "profile-info__item",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "txt",
|
||||
children: parent.company
|
||||
children: parent.profile
|
||||
})
|
||||
})]
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "p-profile-btn",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_9__.Link, {
|
||||
className: "btn-default btn-yellow btn-profile btn-r8 btn-h52 h-xs-45-px",
|
||||
onClick: function onClick(e) {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: "/admin/parent/edit/".concat(parent.id),
|
||||
state: {}
|
||||
});
|
||||
},
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
|
||||
to: "/admin/parent/edit/".concat((_props$match$params3 = props.match.params) === null || _props$match$params3 === void 0 ? void 0 : _props$match$params3.father_id),
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
||||
className: "ft-18 ft-xs-14",
|
||||
children: "\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u3092\u5909\u66F4\u3059\u308B"
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "p-profile-btn",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_9__.Link, {
|
||||
className: "btn-default btn-yellow btn-password btn-r8 btn-h52 h-xs-45-px",
|
||||
onClick: function onClick(e) {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: "/admin/parent/edit/password/".concat(parent.id),
|
||||
state: {}
|
||||
});
|
||||
},
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
|
||||
to: "/admin/parent/edit/password/".concat((_props$match$params4 = props.match.params) === null || _props$match$params4 === void 0 ? void 0 : _props$match$params4.father_id),
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
||||
className: "ft-18 ft-xs-14",
|
||||
children: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5909\u66F4\u3059\u308B"
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "p-profile-txtLink",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("a", {
|
||||
href: "",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", {
|
||||
className: "btn-default btn-password btn-r8 btn-h52 h-xs-45-px",
|
||||
onClick: openModal,
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
|
||||
className: "ft-xs-14",
|
||||
children: "\u524A\u9664\u3059\u308B"
|
||||
})
|
||||
})
|
||||
})]
|
||||
})
|
||||
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
className: "text-center py-5",
|
||||
children: "\u30C7\u30FC\u30BF\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u305B\u3093\u3002"
|
||||
}))]
|
||||
})
|
||||
})
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_Dialog__WEBPACK_IMPORTED_MODULE_10__.default, {
|
||||
open: open,
|
||||
TransitionComponent: Transition,
|
||||
keepMounted: true,
|
||||
"aria-describedby": "alert-dialog-slide-description",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_DialogContent__WEBPACK_IMPORTED_MODULE_11__.default, {
|
||||
style: {
|
||||
width: '290px',
|
||||
padding: '25px 25px 10px'
|
||||
},
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_DialogContentText__WEBPACK_IMPORTED_MODULE_12__.default, {
|
||||
id: "alert-dialog-slide-description",
|
||||
style: {
|
||||
fontSize: '20px',
|
||||
textAlign: 'center'
|
||||
},
|
||||
children: "\u672C\u5F53\u306B\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3057\u3087\u3046\u304B\uFF1F"
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_mui_material_DialogActions__WEBPACK_IMPORTED_MODULE_13__.default, {
|
||||
style: {
|
||||
justifyContent: 'space-evenly',
|
||||
padding: '0 20px 20px 20px'
|
||||
},
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_mui_material_Button__WEBPACK_IMPORTED_MODULE_14__.default, {
|
||||
onClick: closeModal,
|
||||
size: "large",
|
||||
style: {
|
||||
fontSize: '20px'
|
||||
},
|
||||
children: "\u3044\u3044\u3048"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_lab__WEBPACK_IMPORTED_MODULE_15__.default, {
|
||||
variant: "text",
|
||||
onClick: handleAccept,
|
||||
loading: submit,
|
||||
size: "large",
|
||||
style: {
|
||||
fontSize: '20px'
|
||||
},
|
||||
children: "\u306F\u3044"
|
||||
})]
|
||||
})]
|
||||
}), _400error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_component_alert__WEBPACK_IMPORTED_MODULE_3__.default, {
|
||||
type: "fail",
|
||||
hide: function hide() {
|
||||
return set400Error('');
|
||||
},
|
||||
children: _400error
|
||||
}), _success && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_component_alert__WEBPACK_IMPORTED_MODULE_3__.default, {
|
||||
type: "success",
|
||||
hide: function hide() {
|
||||
return history.push({
|
||||
pathname: "/admin/parent",
|
||||
state: {}
|
||||
});
|
||||
},
|
||||
children: _success
|
||||
})]
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -31093,13 +31334,13 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
|
||||
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material-ui/core */ "./node_modules/@material-ui/core/CircularProgress/CircularProgress.js");
|
||||
/* harmony import */ var react_toastify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-toastify */ "./node_modules/react-toastify/dist/react-toastify.esm.js");
|
||||
/* harmony import */ var react_toastify_dist_ReactToastify_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-toastify/dist/ReactToastify.css */ "./node_modules/react-toastify/dist/ReactToastify.css");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
|
||||
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/esm/react-router.js");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
||||
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core */ "./node_modules/@material-ui/core/CircularProgress/CircularProgress.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
|
||||
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/esm/react-router-dom.js");
|
||||
/* harmony import */ var _mui_material_IconButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @mui/material/IconButton */ "./node_modules/@mui/material/IconButton/IconButton.js");
|
||||
/* harmony import */ var _mui_icons_material_Search__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @mui/icons-material/Search */ "./node_modules/@mui/icons-material/Search.js");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
@ -31122,154 +31363,170 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|||
|
||||
|
||||
var Parent = function Parent() {
|
||||
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
||||
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
||||
_useState2 = _slicedToArray(_useState, 2),
|
||||
parent = _useState2[0],
|
||||
setParent = _useState2[1];
|
||||
keyword = _useState2[0],
|
||||
setKeyword = _useState2[1];
|
||||
|
||||
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
|
||||
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
||||
_useState4 = _slicedToArray(_useState3, 2),
|
||||
loading = _useState4[0],
|
||||
setLoading = _useState4[1];
|
||||
loaded = _useState4[0],
|
||||
setLoaded = _useState4[1];
|
||||
|
||||
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
||||
_useState6 = _slicedToArray(_useState5, 2),
|
||||
father_list = _useState6[0],
|
||||
setFatherList = _useState6[1];
|
||||
|
||||
var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({
|
||||
keyword: ''
|
||||
}),
|
||||
_useState8 = _slicedToArray(_useState7, 2),
|
||||
_422errors = _useState8[0],
|
||||
set422errors = _useState8[1];
|
||||
|
||||
var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(''),
|
||||
_useState10 = _slicedToArray(_useState9, 2),
|
||||
_400error = _useState10[0],
|
||||
set400error = _useState10[1];
|
||||
|
||||
var history = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useHistory)();
|
||||
var state = history.location.state;
|
||||
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
||||
// axios.get('/api/children/listOfFather', {params: { father_id: 1 }}).then((response) => {
|
||||
// if(response.data.status_code==200){
|
||||
// console.log(response.data.params);
|
||||
// setParent(response.data.params);
|
||||
// } else if(response.data.status_code==400){
|
||||
// //TODO
|
||||
// }
|
||||
// setLoading(false);
|
||||
// if(state?.message) {
|
||||
// toast.success(state?.message, {
|
||||
// position: "top-center",
|
||||
// autoClose: 5000,
|
||||
// className:"bg-success",
|
||||
// hideProgressBar: true,
|
||||
// closeOnClick: true,
|
||||
// pauseOnHover: true,
|
||||
// draggable: false,
|
||||
// progress: undefined,
|
||||
// style:{ color: '#ffffff', opacity: 0.95}
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
/////////////////////////////////////
|
||||
var obj = [{
|
||||
id: 1,
|
||||
last_name: '山口',
|
||||
first_name: '太一',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png',
|
||||
email: 'mailaddress@info.com'
|
||||
}, {
|
||||
id: 2,
|
||||
last_name: '山口',
|
||||
first_name: '太一',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png',
|
||||
email: 'mailaddress@info.com'
|
||||
}, {
|
||||
id: 3,
|
||||
last_name: '山口',
|
||||
first_name: '太一',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png',
|
||||
email: 'mailaddress@info.com'
|
||||
}, {
|
||||
id: 4,
|
||||
last_name: '山口',
|
||||
first_name: '太一',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png',
|
||||
email: 'mailaddress@info.com'
|
||||
}, {
|
||||
id: 5,
|
||||
last_name: '山口',
|
||||
first_name: '太一',
|
||||
image: '/assets/img/avatar/avatar-sample03@2x.png',
|
||||
email: 'mailaddress@info.com'
|
||||
}];
|
||||
setLoading(false);
|
||||
setParent(obj); ////////////////////////////////////
|
||||
setLoaded(false);
|
||||
axios__WEBPACK_IMPORTED_MODULE_1___default().get('/api/admin/fathers/list').then(function (response) {
|
||||
if (response.data.status_code == 200) {
|
||||
console.log(response.data.params);
|
||||
setFatherList(response.data.params);
|
||||
}
|
||||
|
||||
setLoaded(true);
|
||||
}); ////////////////////////////////////
|
||||
}, []);
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
|
||||
var handleSearch = function handleSearch(e) {
|
||||
e.preventDefault();
|
||||
initErrors();
|
||||
|
||||
if (keyword == '') {
|
||||
document.getElementById('keyword').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
setLoaded(false);
|
||||
setFatherList(null);
|
||||
axios__WEBPACK_IMPORTED_MODULE_1___default().get('/api/admin/fathers/search', {
|
||||
params: {
|
||||
keyword: keyword
|
||||
}
|
||||
}).then(function (response) {
|
||||
setLoaded(true);
|
||||
|
||||
if (response.data.status_code == 200) {
|
||||
setFatherList(response.data.params);
|
||||
} else if (response.data.status_code == 400) {//TODO
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var initErrors = function initErrors() {
|
||||
set422errors({
|
||||
keyword: ''
|
||||
});
|
||||
};
|
||||
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
className: "l-content",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_toastify__WEBPACK_IMPORTED_MODULE_1__.ToastContainer, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "l-content__ttl",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "l-content__ttl__left",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("h2", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("h2", {
|
||||
children: "\u89AA\u4E00\u89A7"
|
||||
})
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "l-content-wrap",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("section", {
|
||||
className: "search-container",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "meeting-head",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("form", {
|
||||
action: "",
|
||||
className: "meeting-form",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "meeting-head mt-4",
|
||||
onSubmit: handleSearch,
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("form", {
|
||||
className: "position-relative",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("label", {
|
||||
className: "control-label",
|
||||
htmlFor: "keyword",
|
||||
children: "\u30AD\u30FC\u30EF\u30FC\u30C9"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("input", {
|
||||
type: "search",
|
||||
name: "keyword",
|
||||
className: "input-default input-keyword input-w380",
|
||||
id: "keyword"
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("i", {
|
||||
className: "icon icon-search"
|
||||
className: "input-default input-keyword input-w380 input-h60",
|
||||
id: "keyword",
|
||||
value: keyword,
|
||||
onChange: function onChange(e) {
|
||||
return setKeyword(e.target.value);
|
||||
}
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_mui_material_IconButton__WEBPACK_IMPORTED_MODULE_3__.default, {
|
||||
size: "large",
|
||||
style: {
|
||||
position: 'absolute',
|
||||
bottom: '3px',
|
||||
right: '5px'
|
||||
},
|
||||
type: "submit",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_mui_icons_material_Search__WEBPACK_IMPORTED_MODULE_4__.default, {
|
||||
fontSize: "large",
|
||||
style: {
|
||||
color: '#d0d0d0'
|
||||
}
|
||||
})
|
||||
})]
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "search-wrap",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
className: "search-content",
|
||||
children: !loading ? parent === null || parent === void 0 ? void 0 : parent.map(function (parent, index) {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
className: "search-content position-relative",
|
||||
style: {
|
||||
minHeight: '100px'
|
||||
},
|
||||
children: [!loaded && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_5__.default, {
|
||||
color: "secondary",
|
||||
style: {
|
||||
top: '20px',
|
||||
left: 'calc(50% - 22px)',
|
||||
color: 'green',
|
||||
position: 'absolute'
|
||||
}
|
||||
}), loaded && (father_list && father_list.length > 0 ? father_list.map(function (father, k) {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "search-item",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("a", {
|
||||
onClick: function onClick(e) {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: "/admin/parent/detail/".concat(parent.id),
|
||||
state: {
|
||||
parent_id: parent.id
|
||||
}
|
||||
});
|
||||
},
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_6__.Link, {
|
||||
to: "/admin/parent/detail/".concat(father.id),
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
className: "user-wrap",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
||||
className: "user-avatar",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("img", {
|
||||
alt: "name",
|
||||
className: "avatar-img",
|
||||
src: parent.image
|
||||
src: father.image
|
||||
})
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
|
||||
className: "user-info",
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("p", {
|
||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
className: "user-name mb-1 font-weight-bold",
|
||||
children: [parent.last_name, " ", parent.first_name]
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
|
||||
children: father.company
|
||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
className: "user-tel",
|
||||
children: parent.email
|
||||
children: father.email
|
||||
})]
|
||||
})]
|
||||
})
|
||||
})
|
||||
});
|
||||
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
style: {
|
||||
position: "relative",
|
||||
left: "50%"
|
||||
},
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_6__.default, {})
|
||||
})
|
||||
}, k);
|
||||
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
|
||||
className: "text-center py-5",
|
||||
children: "\u30C7\u30FC\u30BF\u304C\u5B58\u5728\u3057\u3066\u3044\u307E\u305B\u3093\u3002"
|
||||
}))]
|
||||
})
|
||||
})]
|
||||
})
|
||||
|
|
|
@ -34,7 +34,7 @@ const ChildDetail = (props) => {
|
|||
const [child, setChild] = useState(null);
|
||||
|
||||
const [_400error, set400Error] = useState('');
|
||||
const [_422errors, set422Errors] = useState({image:''});
|
||||
const [_422errors, set422Errors] = useState({ image: '' });
|
||||
const [_success, setSuccess] = useState('');
|
||||
|
||||
useEffect(
|
||||
|
|
|
@ -42,10 +42,7 @@ const Child = () => {
|
|||
setLoaded(false);
|
||||
setChildrenList(null);
|
||||
|
||||
const formdata = new FormData();
|
||||
formdata.append('keyword', keyword);
|
||||
|
||||
axios.post('/api/admin/children/search',formdata)
|
||||
axios.get('/api/admin/children/search', {params:{keyword: keyword}})
|
||||
.then((response) => {
|
||||
|
||||
setLoaded(true);
|
||||
|
|
|
@ -1,43 +1,54 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
import { useHistory, Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
|
||||
import { LoadingButton } from '@material-ui/lab';
|
||||
import { CircularProgress } from '@material-ui/core';
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
|
||||
const ParentDetail = () => {
|
||||
import Button from '@mui/material/Button';
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import Slide from '@mui/material/Slide';
|
||||
|
||||
import Alert from '../../component/alert';
|
||||
|
||||
|
||||
const Transition = React.forwardRef(function Transition(props, ref) {
|
||||
return <Slide direction="up" ref={ref} {...props} />;
|
||||
});
|
||||
|
||||
|
||||
|
||||
const ParentDetail = (props) => {
|
||||
|
||||
const [image, setImage] = useState('/assets/img/avatar/avatar-sample03@2x.png');
|
||||
const history = useHistory();
|
||||
|
||||
const parent = {
|
||||
id: 1,
|
||||
last_name:'田中',
|
||||
first_name:'達也',
|
||||
username:'chankan',
|
||||
tel:'08012927104',
|
||||
email:'chankan07@gmail.com',
|
||||
company:'ああああああああああああああああああああああああああああああああああああああああああああああああああああああああ',
|
||||
image:'/assets/img/avatar/avatar-sample03@2x.png'
|
||||
}
|
||||
const [image, setImage] = useState('/assets/img/avatar/avatar-sample03@2x.png');
|
||||
const [open, setOpen] = useState(false);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [submit, setSubmit] = useState(false);
|
||||
const [parent, setParent] = useState(null);
|
||||
|
||||
const [_400error, set400Error] = useState('');
|
||||
const [_422errors, set422Errors] = useState({image: ''});
|
||||
const [_success, setSuccess] = useState('');
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
const formdata = new FormData();
|
||||
let child_id = 1;
|
||||
|
||||
// axios.get('/api/meetings/listOfNonApprovalOfChild', {child_id: child_id})
|
||||
// .then(response => {
|
||||
// if(response.data.status_code==200){
|
||||
// // window.location.href = '/register/c-account/complete';
|
||||
// }
|
||||
// else if(response.data.status_code==400){
|
||||
// // window.location.href = '/register/c-account/error';
|
||||
// }
|
||||
// else if(response.data.status_code==500){
|
||||
// // window.location.href = '/unknown-error';
|
||||
// }
|
||||
// })
|
||||
// .catch(err=>console.log(err))
|
||||
|
||||
setLoaded(false);
|
||||
axios.get(`/api/admin/fathers/detail/${props.match.params?.father_id}`)
|
||||
.then(response => {
|
||||
setLoaded(true);
|
||||
if(response.data.status_code==200){
|
||||
setParent(response.data.params[0]);
|
||||
}
|
||||
})
|
||||
.catch(err=>console.log(err))
|
||||
},[]
|
||||
);
|
||||
|
||||
|
@ -51,10 +62,52 @@ const ParentDetail = () => {
|
|||
reader.readAsDataURL(_file);
|
||||
|
||||
reader.onloadend = () => {
|
||||
setImage(reader.result);
|
||||
|
||||
var request = {image: reader.result};
|
||||
|
||||
axios.put(`/api/admin/fathers/updateImage/${props.match.params?.father_id}`, request)
|
||||
.then(response => {
|
||||
switch(response.data.status_code){
|
||||
case 200: {
|
||||
setImage(reader.result);
|
||||
setSuccess(response.data.success_messages);
|
||||
break;
|
||||
}
|
||||
case 400: set400Error(response.data.error_messages); break;
|
||||
case 422: set422Errors(response.data.error_messages); break;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
async function openModal() {
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
async function closeModal() {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
async function handleAccept() {
|
||||
try {
|
||||
setSubmit(true);
|
||||
axios.delete(`/api/admin/fathers/delete/${props.match.params?.father_id}`)
|
||||
.then(response => {
|
||||
closeModal();
|
||||
setSubmit(false);
|
||||
if(response.data.status_code == 200){
|
||||
setSuccess('削除に成功しました!');
|
||||
} else {
|
||||
set400Error("削除に失敗しました。");
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div className="l-content">
|
||||
|
@ -68,85 +121,125 @@ const ParentDetail = () => {
|
|||
|
||||
<div className="l-content-wrap">
|
||||
<section className="profile-container">
|
||||
<div className="profile-wrap">
|
||||
<div className="profile-content">
|
||||
|
||||
<div>
|
||||
<input type="file" id="avatar" name="avatar" className="d-none" accept=".png, .jpg, .jpeg" onChange={(e) => handleImageChange(e)}/>
|
||||
<div className="avatar-wrapper">
|
||||
<label htmlFor="avatar" className='avatar-label'>
|
||||
<IconButton color="primary" aria-label="upload picture" component="span" className="bg-yellow shadow-sm w-40-px h-40-px">
|
||||
<img src="/assets/img/icon/camera.svg" width="20" height="20"/>
|
||||
</IconButton>
|
||||
</label>
|
||||
{
|
||||
image &&
|
||||
<img src={image} alt="" width ="100%" height="100%" style={{borderRadius:'50%'}}/>
|
||||
<div className="profile-wrap position-relative" style={{ minHeight:'500px'}}>
|
||||
{
|
||||
!loaded &&
|
||||
<CircularProgress color="secondary" style={{top:'30%', left:'calc(50% - 22px)', color:'green', position:'absolute'}}/>
|
||||
}
|
||||
{
|
||||
loaded &&
|
||||
(
|
||||
parent ?
|
||||
<div className="profile-content">
|
||||
<div>
|
||||
<input type="file" id="avatar" name="avatar" className="d-none" accept=".png, .jpg, .jpeg" onChange={(e) => handleImageChange(e)}/>
|
||||
<div className="avatar-wrapper">
|
||||
<label htmlFor="avatar" className='avatar-label'>
|
||||
<IconButton color="primary" aria-label="upload picture" component="span" className="bg-yellow shadow-sm w-40-px h-40-px">
|
||||
<img src="/assets/img/icon/camera.svg" width="20" height="20"/>
|
||||
</IconButton>
|
||||
</label>
|
||||
<img src={image} alt="" width ="100%" height="100%" style={{borderRadius:'50%'}}/>
|
||||
</div>
|
||||
{
|
||||
_422errors.image &&
|
||||
<span className="l-alert__text--error ft-16 ft-md-14">
|
||||
{_422errors.image}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<p className="profile-name">{ parent.last_name } { parent.first_name }</p>
|
||||
<div className="profile-info">
|
||||
<div className="profile-info__item">
|
||||
<a href={`mailto:${parent.email}`}>
|
||||
<p className="profile-info__icon">
|
||||
<img src="/assets/img/icon/mail.svg" alt="メール"/>
|
||||
</p>
|
||||
<p className="txt">{parent.email}</p>
|
||||
<p className="profile-name ft-xs-14">{`${parent.first_name} ${parent.last_name}`}</p>
|
||||
<div className="profile-info ft-18 ft-xs-14">
|
||||
<div className="profile-info__item">
|
||||
<a href={`mailto:${parent.email}`}>
|
||||
<p className="profile-info__icon">
|
||||
<img src="/assets/img/icon/mail.svg" alt="メール"/>
|
||||
</p>
|
||||
<p className="txt">{parent.email}</p>
|
||||
</a>
|
||||
</div>
|
||||
<div className="profile-info__item">
|
||||
<a href={`tel:${parent.tel}`}>
|
||||
<p className="profile-info__icon">
|
||||
<img src="/assets/img/icon/phone.svg" alt="電話" />
|
||||
</p>
|
||||
<p className="txt">{parent.tel}</p>
|
||||
</a>
|
||||
</div>
|
||||
<div className="profile-info__item">
|
||||
<p className="txt">{parent.profile}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-btn">
|
||||
<Link className="btn-default btn-yellow btn-profile btn-r8 btn-h52 h-xs-45-px"
|
||||
to = {`/admin/parent/edit/${props.match.params?.father_id}`}
|
||||
>
|
||||
<span className="ft-18 ft-xs-14">プロフィールを変更する</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-btn">
|
||||
<Link className="btn-default btn-yellow btn-password btn-r8 btn-h52 h-xs-45-px"
|
||||
to = {`/admin/parent/edit/password/${props.match.params?.father_id}`}
|
||||
>
|
||||
<span className="ft-18 ft-xs-14">パスワードを変更する</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-txtLink">
|
||||
<a className="btn-default btn-password btn-r8 btn-h52 h-xs-45-px"
|
||||
onClick={openModal}
|
||||
>
|
||||
<span className="ft-xs-14">削除する</span>
|
||||
</a>
|
||||
</div>
|
||||
<div className="profile-info__item">
|
||||
<a href={`tel:${parent.tel}`}>
|
||||
<p className="profile-info__icon">
|
||||
<img src="/assets/img/icon/phone.svg" alt="電話" />
|
||||
</p>
|
||||
<p className="txt">{parent.tel}</p>
|
||||
</a>
|
||||
</div>
|
||||
<div className="profile-info__item">
|
||||
<p className="txt">{ parent.company }</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-btn">
|
||||
<a className="btn-default btn-yellow btn-profile btn-r8 btn-h52 h-xs-45-px"
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: `/admin/parent/edit/${parent.id}`,
|
||||
state: {}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="ft-18 ft-xs-14">プロフィールを変更する</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-btn">
|
||||
<a className="btn-default btn-yellow btn-password btn-r8 btn-h52 h-xs-45-px"
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: `/admin/parent/edit/password/${parent.id}`,
|
||||
state: {}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span className="ft-18 ft-xs-14">パスワードを変更する</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="p-profile-txtLink">
|
||||
<a href="">
|
||||
<span className="ft-xs-14">削除する</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
: <p className="text-center py-5">データが存在していません。</p>
|
||||
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Dialog
|
||||
open={open}
|
||||
TransitionComponent={Transition}
|
||||
keepMounted
|
||||
aria-describedby="alert-dialog-slide-description"
|
||||
>
|
||||
<DialogContent style={{width:'290px', padding:'25px 25px 10px'}}>
|
||||
<DialogContentText id="alert-dialog-slide-description" style={{fontSize:'20px', textAlign:'center'}}>
|
||||
本当に削除してもよろしいでしょうか?
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions style={{justifyContent:'space-evenly', padding:'0 20px 20px 20px'}}>
|
||||
<Button
|
||||
onClick={closeModal}
|
||||
size="large"
|
||||
style={{fontSize:'20px'}}>いいえ</Button>
|
||||
|
||||
<LoadingButton
|
||||
variant="text"
|
||||
onClick={handleAccept}
|
||||
loading={submit}
|
||||
size="large"
|
||||
style={{fontSize:'20px'}}>はい</LoadingButton>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
{
|
||||
_400error && <Alert type="fail" hide={()=>set400Error('')}>{_400error}</Alert>
|
||||
}
|
||||
{
|
||||
_success &&
|
||||
<Alert type="success"
|
||||
hide={()=>
|
||||
history.push({
|
||||
pathname: "/admin/parent",
|
||||
state: {}
|
||||
})}>{_success}</Alert>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,58 +1,65 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { CircularProgress } from '@material-ui/core';
|
||||
import { ToastContainer, toast } from 'react-toastify';
|
||||
import 'react-toastify/dist/ReactToastify.css';
|
||||
import axios from 'axios';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useHistory, Link } from 'react-router-dom';
|
||||
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
|
||||
|
||||
const Parent = () => {
|
||||
const [parent, setParent ] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const history = useHistory();
|
||||
const state = history.location.state
|
||||
|
||||
const [keyword, setKeyword] = useState('')
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [father_list, setFatherList ] = useState(null);
|
||||
const [_422errors, set422errors] = useState({keyword:''});
|
||||
const [_400error, set400error] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
// axios.get('/api/children/listOfFather', {params: { father_id: 1 }}).then((response) => {
|
||||
// if(response.data.status_code==200){
|
||||
// console.log(response.data.params);
|
||||
// setParent(response.data.params);
|
||||
// } else if(response.data.status_code==400){
|
||||
// //TODO
|
||||
// }
|
||||
// setLoading(false);
|
||||
// if(state?.message) {
|
||||
// toast.success(state?.message, {
|
||||
// position: "top-center",
|
||||
// autoClose: 5000,
|
||||
// className:"bg-success",
|
||||
// hideProgressBar: true,
|
||||
// closeOnClick: true,
|
||||
// pauseOnHover: true,
|
||||
// draggable: false,
|
||||
// progress: undefined,
|
||||
// style:{ color: '#ffffff', opacity: 0.95}
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
/////////////////////////////////////
|
||||
var obj = [
|
||||
{id:1, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'},
|
||||
{id:2, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'},
|
||||
{id:3, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'},
|
||||
{id:4, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'},
|
||||
{id:5, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'}
|
||||
];
|
||||
setLoading(false);
|
||||
setParent(obj);
|
||||
setLoaded(false);
|
||||
axios.get('/api/admin/fathers/list')
|
||||
.then((response) => {
|
||||
if(response.data.status_code==200){
|
||||
console.log(response.data.params)
|
||||
setFatherList(response.data.params);
|
||||
}
|
||||
setLoaded(true);
|
||||
});
|
||||
////////////////////////////////////
|
||||
}, []);
|
||||
|
||||
|
||||
const handleSearch = (e) => {
|
||||
e.preventDefault();
|
||||
initErrors();
|
||||
if(keyword == '')
|
||||
{
|
||||
document.getElementById('keyword').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
setLoaded(false);
|
||||
setFatherList(null);
|
||||
|
||||
axios.get('/api/admin/fathers/search',{params: {keyword: keyword}})
|
||||
.then((response) => {
|
||||
|
||||
setLoaded(true);
|
||||
if(response.data.status_code==200){
|
||||
setFatherList(response.data.params);
|
||||
} else if(response.data.status_code==400){
|
||||
//TODO
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const initErrors = () => {
|
||||
set422errors({keyword:''});
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="l-content">
|
||||
<ToastContainer />
|
||||
<div className="l-content__ttl">
|
||||
<div className="l-content__ttl__left">
|
||||
<h2>親一覧</h2>
|
||||
|
@ -61,39 +68,48 @@ const Parent = () => {
|
|||
<div className="l-content-wrap">
|
||||
<section className="search-container">
|
||||
|
||||
<div className="meeting-head">
|
||||
<form action="" className="meeting-form">
|
||||
<div className="meeting-head mt-4" onSubmit={handleSearch}>
|
||||
<form className="position-relative">
|
||||
<label className="control-label" htmlFor="keyword">キーワード</label>
|
||||
<input type="search" name="keyword" className="input-default input-keyword input-w380" id="keyword" />
|
||||
<i className="icon icon-search"></i>
|
||||
<input type="search" name="keyword"
|
||||
className="input-default input-keyword input-w380 input-h60"
|
||||
id="keyword" value={keyword}
|
||||
onChange={e=> setKeyword(e.target.value)}
|
||||
/>
|
||||
<IconButton size="large" style={{position:'absolute', bottom:'3px', right:'5px'}} type="submit">
|
||||
<SearchIcon fontSize="large" style={{color:'#d0d0d0'}}/>
|
||||
</IconButton>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div className="search-wrap">
|
||||
<div className="search-content">
|
||||
{ !loading ? parent?.map((parent, index) => {
|
||||
return (
|
||||
<div className="search-item">
|
||||
<a onClick={e => {
|
||||
e.preventDefault();
|
||||
history.push({
|
||||
pathname: `/admin/parent/detail/${parent.id}`,
|
||||
state: { parent_id : parent.id }
|
||||
});
|
||||
}} >
|
||||
<div className="user-wrap">
|
||||
<div className="user-avatar">
|
||||
<img alt="name" className="avatar-img" src={ parent.image } />
|
||||
</div>
|
||||
<div className="user-info">
|
||||
<p className="user-name mb-1 font-weight-bold">{ parent.last_name } { parent.first_name }</p>
|
||||
<p className="user-tel">{ parent.email }</p>
|
||||
</div>
|
||||
<div className="search-content position-relative" style={{minHeight:'100px'}}>
|
||||
{
|
||||
!loaded &&
|
||||
<CircularProgress color="secondary" style={{top:'20px', left:'calc(50% - 22px)', color:'green', position:'absolute'}}/>
|
||||
}
|
||||
{
|
||||
loaded &&
|
||||
(
|
||||
father_list && father_list.length>0 ?
|
||||
father_list.map((father, k) =>
|
||||
<div className="search-item" key={k}>
|
||||
<Link to = {`/admin/parent/detail/${father.id}`}>
|
||||
<div className="user-wrap">
|
||||
<div className="user-avatar">
|
||||
<img alt="name" className="avatar-img" src={ father.image } />
|
||||
</div>
|
||||
<div className="user-info">
|
||||
<p className="user-name mb-1 font-weight-bold">{ father.company }</p>
|
||||
<p className="user-tel">{ father.email }</p>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}) : <div style={{position: "relative", left: "50%"}}><CircularProgress /></div>}
|
||||
) : <p className="text-center py-5">データが存在していません。</p>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -25,19 +25,19 @@ Route::group(['prefix' => 'admin'], function () {
|
|||
// FathersController
|
||||
Route::group(['prefix' => 'fathers'], function () {
|
||||
Route::get('/list', '\App\Http\Controllers\Api\FathersController@list');
|
||||
Route::put('/search', '\App\Http\Controllers\Api\FathersController@search');
|
||||
Route::get('/search', '\App\Http\Controllers\Api\FathersController@search');
|
||||
Route::put('/updateImage/{father_id}', '\App\Http\Controllers\Api\FathersController@updateImage');
|
||||
Route::put('/updateProfile/{father_id}', '\App\Http\Controllers\Api\FathersController@updateProfile');
|
||||
Route::put('/updatePassword/{father_id}', '\App\Http\Controllers\Api\FathersController@updatePassword');
|
||||
Route::post('/detail/{father_id}', '\App\Http\Controllers\Api\FathersController@detail');
|
||||
Route::delete('/delete', '\App\Http\Controllers\Api\FathersController@withdrawal');
|
||||
Route::get('/detail/{father_id}', '\App\Http\Controllers\Api\FathersController@detail');
|
||||
Route::delete('/delete/{father_id}', '\App\Http\Controllers\Api\FathersController@withdrawal');
|
||||
Route::post('/registerTemporary', '\App\Http\Controllers\Api\FathersController@registerTemporary');
|
||||
});
|
||||
|
||||
// ChildrenController
|
||||
Route::group(['prefix' => 'children'], function () {
|
||||
Route::get('/list', '\App\Http\Controllers\Api\ChildrenController@list');
|
||||
Route::post('/search', '\App\Http\Controllers\Api\ChildrenController@search');
|
||||
Route::get('/search', '\App\Http\Controllers\Api\ChildrenController@search');
|
||||
Route::put('/updateProfile/{child_id}', '\App\Http\Controllers\Api\ChildrenController@updateProfile');
|
||||
Route::put('/updateImage/{child_id}', '\App\Http\Controllers\Api\ChildrenController@updateImage');
|
||||
Route::put('/updatePassword/{child_id}', '\App\Http\Controllers\Api\ChildrenController@updatePassword');
|
||||
|
|
新しいイシューから参照