@banch0u/core-project-test-repository 1.9.1 → 1.9.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.
- package/dist/assets/css/antd.css +3 -3
- package/dist/assets/css/variables.css +2 -0
- package/dist/assets/icons/index.js +33 -0
- package/dist/components/ImagePreviewModal/index.js +129 -0
- package/dist/components/ImagePreviewModal/index.module.scss +27 -0
- package/dist/components/ViewMoreModal/index.js +30 -0
- package/dist/index.js +1 -0
- package/dist/layout/QuestionnairesLayout/index.module.scss +3 -0
- package/dist/layout/QuestionnairesSidebar/index.js +97 -5
- package/dist/layout/QuestionnairesSidebar/index.module.scss +4 -3
- package/dist/pages/Questionnnaires/Questionnaires.module.scss +4 -3
- package/dist/pages/Questionnnaires/{QuestionnairesStreetsContent → QuestionnairesAcademicdegreesContent}/constant.js +1 -1
- package/dist/pages/Questionnnaires/QuestionnairesAcademicdegreesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesAreasContent/constant.js +63 -0
- package/dist/pages/Questionnnaires/QuestionnairesAreasContent/index.js +271 -0
- package/dist/pages/Questionnnaires/QuestionnairesCategoriesContent/constant.js +69 -0
- package/dist/pages/Questionnnaires/QuestionnairesCategoriesContent/index.js +304 -0
- package/dist/pages/Questionnnaires/QuestionnairesCompaniesContent/constant.js +62 -0
- package/dist/pages/Questionnnaires/QuestionnairesCompaniesContent/index.js +278 -0
- package/dist/pages/Questionnnaires/QuestionnairesDisabilitystatusesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesDisabilitystatusesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentTypeContent/constant.js +1 -1
- package/dist/pages/Questionnnaires/QuestionnairesDrivingcategoriesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/{QuestionnairesStreetsContent → QuestionnairesDrivingcategoriesContent}/index.js +41 -31
- package/dist/pages/Questionnnaires/QuestionnairesEducationinstitutionsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesEducationinstitutionsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesEducationlevelsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesEducationlevelsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesEducationpaymentsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesEducationpaymentsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesGeneralstructurestatusesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesGeneralstructurestatusesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesGeneralstructuretypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesGeneralstructuretypesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesHallsContent/constant.js +67 -0
- package/dist/pages/Questionnnaires/QuestionnairesHallsContent/index.js +294 -0
- package/dist/pages/Questionnnaires/QuestionnairesHonorarytitlesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesHonorarytitlesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarycategoriesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarycategoriesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarygroupsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarygroupsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitaryranksContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitaryranksContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarystaffsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesMilitarystaffsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesPositionsContent/constant.js +72 -0
- package/dist/pages/Questionnnaires/QuestionnairesPositionsContent/index.js +428 -0
- package/dist/pages/Questionnnaires/QuestionnairesRegionsContent/constant.js +68 -0
- package/dist/pages/Questionnnaires/QuestionnairesRegionsContent/index.js +320 -0
- package/dist/pages/Questionnnaires/QuestionnairesReprimandtypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesReprimandtypesContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesSpecialdaysContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesSpecialdaysContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesSpecializationsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesSpecializationsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesWarparticipantsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesWarparticipantsContent/index.js +269 -0
- package/dist/pages/Questionnnaires/QuestionnairesWorkschedulesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesWorkschedulesContent/index.js +269 -0
- package/dist/routes/QuestionnaireRoutes.js +169 -8
- package/dist/store/slices/global/index.js +147 -3
- package/dist/store/slices/questionnaire/index.js +5005 -99
- package/dist/store/slices/questionnaire/service.js +2446 -0
- package/dist/utils/path.js +49 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Switch, Tooltip } from "antd";
|
|
3
|
+
import style from "../Questionnaires.module.scss";
|
|
4
|
+
import { setDeleteModalVisible } from "../../../store/slices/global";
|
|
5
|
+
import { DeleteIconQ, EditIcon } from "../../../assets/icons";
|
|
6
|
+
export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
|
|
7
|
+
return [{
|
|
8
|
+
title: "№",
|
|
9
|
+
dataIndex: "num",
|
|
10
|
+
showCheckbox: false,
|
|
11
|
+
ellipsis: true,
|
|
12
|
+
width: 35
|
|
13
|
+
}, {
|
|
14
|
+
title: "Ad",
|
|
15
|
+
dataIndex: "name",
|
|
16
|
+
width: innerW,
|
|
17
|
+
disabled: true,
|
|
18
|
+
ellipsis: true
|
|
19
|
+
}, {
|
|
20
|
+
title: "Status",
|
|
21
|
+
key: "status",
|
|
22
|
+
disabled: true,
|
|
23
|
+
filter: false,
|
|
24
|
+
render: function render(data) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
26
|
+
placement: "top",
|
|
27
|
+
title: "Statusu d\u0259yi\u015F"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
29
|
+
size: "medium",
|
|
30
|
+
checked: data === null || data === void 0 ? void 0 : data.isActive,
|
|
31
|
+
onChange: function onChange(checked) {
|
|
32
|
+
return onStatusChange(data, checked, dispatch);
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
title: "",
|
|
38
|
+
key: "actions",
|
|
39
|
+
showCheckbox: false,
|
|
40
|
+
width: 80,
|
|
41
|
+
render: function render(data) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: style.number
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: style.actions
|
|
46
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return onEditClick(data);
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
onDelete(data === null || data === void 0 ? void 0 : data.id);
|
|
53
|
+
dispatch(setDeleteModalVisible(true));
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import Cookies from "js-cookie";
|
|
11
|
+
import style from "../Questionnaires.module.scss";
|
|
12
|
+
import { Form, Input, Layout } from "antd";
|
|
13
|
+
import { PlusIcon } from "../../../assets/icons";
|
|
14
|
+
import FormModal from "../../../components/FormModal";
|
|
15
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
16
|
+
import Delete from "../../../components/Delete/Delete";
|
|
17
|
+
import DeleteModal from "../../../components/DeleteModal/DeleteModal";
|
|
18
|
+
import Success from "../../../components/Success/Success";
|
|
19
|
+
import { setDeleteModalVisible, setViewModalVisible } from "../../../store/slices/global";
|
|
20
|
+
import ViewModal from "../../../components/ViewModal";
|
|
21
|
+
import { getStreetColumns } from "./constant";
|
|
22
|
+
import Pagination from "../../../components/Pagination";
|
|
23
|
+
import ColSort from "../../../components/ColSort";
|
|
24
|
+
import { setPaginationLength } from "../../../helpers/paginationLength";
|
|
25
|
+
import Button from "../../../components/Button";
|
|
26
|
+
import Loading from "../../../components/Loading";
|
|
27
|
+
import Table from "../../../components/Table";
|
|
28
|
+
import Filter from "../../../components/Filter";
|
|
29
|
+
import { addDisabilitystatuses, deleteDisabilitystatuses, disabilitystatusesVisibility, editDisabilitystatuses, getDisabilitystatuses } from "../../../store/slices/questionnaire";
|
|
30
|
+
var Content = Layout.Content;
|
|
31
|
+
var Item = Form.Item;
|
|
32
|
+
var QuestionnairesDocumentTypeContent = function QuestionnairesDocumentTypeContent() {
|
|
33
|
+
var _useState = useState(null),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
innerW = _useState2[0],
|
|
36
|
+
setInnerW = _useState2[1];
|
|
37
|
+
var ref = useRef();
|
|
38
|
+
var dispatch = useDispatch();
|
|
39
|
+
var _useState3 = useState(0),
|
|
40
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
41
|
+
id = _useState4[0],
|
|
42
|
+
setId = _useState4[1];
|
|
43
|
+
var _useState5 = useState(1),
|
|
44
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
45
|
+
page = _useState6[0],
|
|
46
|
+
setPage = _useState6[1];
|
|
47
|
+
var _useState7 = useState(Cookies.get("pagination-size-questionnaire-document-type") ? JSON.parse(Cookies.get("pagination-size-questionnaire-document-type")) : 20),
|
|
48
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
+
size = _useState8[0],
|
|
50
|
+
setSize = _useState8[1];
|
|
51
|
+
var _useState9 = useState({
|
|
52
|
+
name: ""
|
|
53
|
+
}),
|
|
54
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
55
|
+
query = _useState10[0],
|
|
56
|
+
setQuery = _useState10[1];
|
|
57
|
+
var _useState11 = useState(1),
|
|
58
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
59
|
+
typeSelect = _useState12[0],
|
|
60
|
+
setTypeSelect = _useState12[1];
|
|
61
|
+
var _useSelector = useSelector(function (state) {
|
|
62
|
+
return state.global;
|
|
63
|
+
}),
|
|
64
|
+
loading = _useSelector.loading,
|
|
65
|
+
disabilitystatusesRender = _useSelector.disabilitystatusesRender;
|
|
66
|
+
var disabilitystatuses = useSelector(function (state) {
|
|
67
|
+
return state.questionnaire.disabilitystatuses;
|
|
68
|
+
});
|
|
69
|
+
var paginationLength = setPaginationLength(disabilitystatuses === null || disabilitystatuses === void 0 ? void 0 : disabilitystatuses.count, disabilitystatuses === null || disabilitystatuses === void 0 ? void 0 : disabilitystatuses.size);
|
|
70
|
+
var onSubmit = useCallback(/*#__PURE__*/function () {
|
|
71
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
72
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
73
|
+
while (1) switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
dispatch(addDisabilitystatuses(_objectSpread(_objectSpread({}, data), {}, {
|
|
76
|
+
category: typeSelect
|
|
77
|
+
})));
|
|
78
|
+
case 1:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context.stop();
|
|
81
|
+
}
|
|
82
|
+
}, _callee);
|
|
83
|
+
}));
|
|
84
|
+
return function (_x) {
|
|
85
|
+
return _ref.apply(this, arguments);
|
|
86
|
+
};
|
|
87
|
+
}(), [dispatch, typeSelect]);
|
|
88
|
+
var onEdit = useCallback(function (id, record) {
|
|
89
|
+
var data = {
|
|
90
|
+
id: id,
|
|
91
|
+
name: record === null || record === void 0 ? void 0 : record.name,
|
|
92
|
+
category: typeSelect
|
|
93
|
+
};
|
|
94
|
+
dispatch(editDisabilitystatuses(data));
|
|
95
|
+
}, [dispatch, typeSelect]);
|
|
96
|
+
var onStatusChange = useCallback(function (data, checked) {
|
|
97
|
+
var data_ = {
|
|
98
|
+
id: data === null || data === void 0 ? void 0 : data.id,
|
|
99
|
+
checked: checked
|
|
100
|
+
};
|
|
101
|
+
dispatch(disabilitystatusesVisibility(data_));
|
|
102
|
+
}, [dispatch]);
|
|
103
|
+
var closeOnViewModal = useCallback(function () {
|
|
104
|
+
dispatch(setViewModalVisible(false));
|
|
105
|
+
}, [dispatch]);
|
|
106
|
+
var onClickModal = function onClickModal() {
|
|
107
|
+
var _ref$current;
|
|
108
|
+
ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.open();
|
|
109
|
+
};
|
|
110
|
+
var onEditClick = useCallback(function (data) {
|
|
111
|
+
var _ref$current2;
|
|
112
|
+
ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.setEdit(data);
|
|
113
|
+
}, []);
|
|
114
|
+
var onDelete = useCallback(function (id) {
|
|
115
|
+
setId(id);
|
|
116
|
+
}, []);
|
|
117
|
+
var handleSearch = function handleSearch(value) {
|
|
118
|
+
setQuery({
|
|
119
|
+
name: value
|
|
120
|
+
});
|
|
121
|
+
setPage(1);
|
|
122
|
+
};
|
|
123
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
124
|
+
if (e.key === "Enter") {
|
|
125
|
+
handleSearch(e.target.value);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var handleColumnToggle = function handleColumnToggle(checked, dataIndex) {
|
|
129
|
+
setSelectedColumns(function (prevSelected) {
|
|
130
|
+
if (checked) {
|
|
131
|
+
return [].concat(_toConsumableArray(prevSelected), [dataIndex]);
|
|
132
|
+
} else {
|
|
133
|
+
return prevSelected.filter(function (col) {
|
|
134
|
+
return col !== dataIndex;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
var data = [];
|
|
140
|
+
if (disabilitystatuses !== null && disabilitystatuses !== void 0 && disabilitystatuses.items) {
|
|
141
|
+
var _disabilitystatuses$i;
|
|
142
|
+
data = disabilitystatuses === null || disabilitystatuses === void 0 || (_disabilitystatuses$i = disabilitystatuses.items) === null || _disabilitystatuses$i === void 0 ? void 0 : _disabilitystatuses$i.map(function (dataObj, i) {
|
|
143
|
+
return {
|
|
144
|
+
num: (disabilitystatuses === null || disabilitystatuses === void 0 ? void 0 : disabilitystatuses.size) * (disabilitystatuses === null || disabilitystatuses === void 0 ? void 0 : disabilitystatuses.page) + i + 1 - (disabilitystatuses === null || disabilitystatuses === void 0 ? void 0 : disabilitystatuses.size),
|
|
145
|
+
id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
|
|
146
|
+
name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
|
|
147
|
+
isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
|
|
148
|
+
className: "rowClassName1"
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
var columns = useMemo(function () {
|
|
153
|
+
return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
|
|
154
|
+
}, [onEditClick, onDelete, onStatusChange, dispatch]);
|
|
155
|
+
var _useState13 = useState(columns.map(function (col) {
|
|
156
|
+
return col.dataIndex;
|
|
157
|
+
})),
|
|
158
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
159
|
+
selectedColumns = _useState14[0],
|
|
160
|
+
setSelectedColumns = _useState14[1];
|
|
161
|
+
useEffect(function () {
|
|
162
|
+
if (window.innerWidth >= 1900) {
|
|
163
|
+
setInnerW(210);
|
|
164
|
+
} else {
|
|
165
|
+
setInnerW(155);
|
|
166
|
+
}
|
|
167
|
+
var data = {
|
|
168
|
+
page: page,
|
|
169
|
+
size: size,
|
|
170
|
+
query: query,
|
|
171
|
+
visibility: "nondeleted",
|
|
172
|
+
category: typeSelect
|
|
173
|
+
};
|
|
174
|
+
dispatch(getDisabilitystatuses(data));
|
|
175
|
+
}, [dispatch, page, disabilitystatusesRender, typeSelect, size, query]);
|
|
176
|
+
var updateSize = function updateSize(newSize) {
|
|
177
|
+
setSize(newSize); // Update state
|
|
178
|
+
Cookies.set("pagination-size-questionnaire-document-type", JSON.stringify(newSize), {
|
|
179
|
+
expires: 7
|
|
180
|
+
}); // Save to cookies
|
|
181
|
+
};
|
|
182
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(Loading, null) : null, /*#__PURE__*/React.createElement(Layout, {
|
|
183
|
+
className: style.layout
|
|
184
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
185
|
+
className: style.content
|
|
186
|
+
}, /*#__PURE__*/React.createElement("header", {
|
|
187
|
+
className: style.header
|
|
188
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
189
|
+
onClick: onClickModal,
|
|
190
|
+
color: "green"
|
|
191
|
+
}, " ", /*#__PURE__*/React.createElement(PlusIcon, null), " Soraq\xE7a \u0259lav\u0259 et"), /*#__PURE__*/React.createElement(Filter, {
|
|
192
|
+
columns: columns,
|
|
193
|
+
selectedColumns: selectedColumns,
|
|
194
|
+
setQuery: setQuery,
|
|
195
|
+
disabledElementCount: 3,
|
|
196
|
+
setPage: setPage
|
|
197
|
+
}))), /*#__PURE__*/React.createElement(Layout, {
|
|
198
|
+
className: style.layout1
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
200
|
+
className: style.content
|
|
201
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
202
|
+
className: style.table_header
|
|
203
|
+
}, /*#__PURE__*/React.createElement("h2", null, "\u018Flillik statuslar\u0131"), /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
className: style.buttons
|
|
205
|
+
}, /*#__PURE__*/React.createElement(ColSort, {
|
|
206
|
+
columns: columns,
|
|
207
|
+
selectedColumns: selectedColumns,
|
|
208
|
+
handleColumnToggle: handleColumnToggle
|
|
209
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
className: "bigTable"
|
|
211
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
212
|
+
selectedColumns: selectedColumns,
|
|
213
|
+
innerW: innerW,
|
|
214
|
+
dataSource: data,
|
|
215
|
+
columns: columns,
|
|
216
|
+
disableDrag: true
|
|
217
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
className: style.pagination
|
|
219
|
+
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
220
|
+
size: size,
|
|
221
|
+
setSize: updateSize,
|
|
222
|
+
total: paginationLength,
|
|
223
|
+
page: page,
|
|
224
|
+
onChange: setPage
|
|
225
|
+
})), /*#__PURE__*/React.createElement(FormModal, {
|
|
226
|
+
ref: ref,
|
|
227
|
+
width: 454,
|
|
228
|
+
title: "Yeni soraqça yaratma",
|
|
229
|
+
titleEdit: "Soraqça redaktə etmə",
|
|
230
|
+
okText: "Yadda saxla",
|
|
231
|
+
cancelText: "Bağla",
|
|
232
|
+
onSubmit: onSubmit,
|
|
233
|
+
onEdit: onEdit,
|
|
234
|
+
className: "absolute",
|
|
235
|
+
centered: false
|
|
236
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
237
|
+
rules: [{
|
|
238
|
+
required: true,
|
|
239
|
+
message: ""
|
|
240
|
+
}, {
|
|
241
|
+
min: 3,
|
|
242
|
+
message: "Ən azından 3 simvol olmalıdır"
|
|
243
|
+
}],
|
|
244
|
+
name: "name",
|
|
245
|
+
label: "Ad"
|
|
246
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
247
|
+
className: style.modal_input
|
|
248
|
+
}))), /*#__PURE__*/React.createElement(DeleteModal, {
|
|
249
|
+
onCancel: function onCancel() {
|
|
250
|
+
return dispatch(setDeleteModalVisible(false));
|
|
251
|
+
},
|
|
252
|
+
width: 280
|
|
253
|
+
}, /*#__PURE__*/React.createElement(Delete, {
|
|
254
|
+
onDelete: function onDelete() {
|
|
255
|
+
return dispatch(deleteDisabilitystatuses(id));
|
|
256
|
+
},
|
|
257
|
+
onCancel: function onCancel() {
|
|
258
|
+
return dispatch(setDeleteModalVisible(false));
|
|
259
|
+
},
|
|
260
|
+
value: "Soraqçanı"
|
|
261
|
+
})), /*#__PURE__*/React.createElement(ViewModal, {
|
|
262
|
+
onCancel: closeOnViewModal,
|
|
263
|
+
width: 695
|
|
264
|
+
}, /*#__PURE__*/React.createElement(Success, {
|
|
265
|
+
onClick: closeOnViewModal,
|
|
266
|
+
value: "Soraqça"
|
|
267
|
+
}))))));
|
|
268
|
+
};
|
|
269
|
+
export default QuestionnairesDocumentTypeContent;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Switch, Tooltip } from "antd";
|
|
3
|
+
import style from "../Questionnaires.module.scss";
|
|
4
|
+
import { setDeleteModalVisible } from "../../../store/slices/global";
|
|
5
|
+
import { DeleteIconQ, EditIcon } from "../../../assets/icons";
|
|
6
|
+
export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
|
|
7
|
+
return [{
|
|
8
|
+
title: "№",
|
|
9
|
+
dataIndex: "num",
|
|
10
|
+
showCheckbox: false,
|
|
11
|
+
ellipsis: true,
|
|
12
|
+
width: 35
|
|
13
|
+
}, {
|
|
14
|
+
title: "Ad",
|
|
15
|
+
dataIndex: "name",
|
|
16
|
+
width: innerW,
|
|
17
|
+
disabled: true,
|
|
18
|
+
ellipsis: true
|
|
19
|
+
}, {
|
|
20
|
+
title: "Status",
|
|
21
|
+
key: "status",
|
|
22
|
+
disabled: true,
|
|
23
|
+
filter: false,
|
|
24
|
+
render: function render(data) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
26
|
+
placement: "top",
|
|
27
|
+
title: "Statusu d\u0259yi\u015F"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
29
|
+
size: "medium",
|
|
30
|
+
checked: data === null || data === void 0 ? void 0 : data.isActive,
|
|
31
|
+
onChange: function onChange(checked) {
|
|
32
|
+
return onStatusChange(data, checked, dispatch);
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
title: "",
|
|
38
|
+
key: "actions",
|
|
39
|
+
showCheckbox: false,
|
|
40
|
+
width: 80,
|
|
41
|
+
render: function render(data) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: style.number
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: style.actions
|
|
46
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return onEditClick(data);
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
onDelete(data === null || data === void 0 ? void 0 : data.id);
|
|
53
|
+
dispatch(setDeleteModalVisible(true));
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
8
|
import React from "react";
|
|
6
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
10
|
import Cookies from "js-cookie";
|
|
@@ -21,11 +24,12 @@ import ColSort from "../../../components/ColSort";
|
|
|
21
24
|
import { setPaginationLength } from "../../../helpers/paginationLength";
|
|
22
25
|
import Button from "../../../components/Button";
|
|
23
26
|
import Loading from "../../../components/Loading";
|
|
27
|
+
import Table from "../../../components/Table";
|
|
24
28
|
import Filter from "../../../components/Filter";
|
|
25
|
-
import {
|
|
29
|
+
import { addDrivingcategories, deleteDrivingcategories, drivingcategoriesVisibility, editDrivingcategories, getDrivingcategories } from "../../../store/slices/questionnaire";
|
|
26
30
|
var Content = Layout.Content;
|
|
27
31
|
var Item = Form.Item;
|
|
28
|
-
var
|
|
32
|
+
var QuestionnairesDocumentTypeContent = function QuestionnairesDocumentTypeContent() {
|
|
29
33
|
var _useState = useState(null),
|
|
30
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
35
|
innerW = _useState2[0],
|
|
@@ -40,7 +44,7 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
40
44
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
45
|
page = _useState6[0],
|
|
42
46
|
setPage = _useState6[1];
|
|
43
|
-
var _useState7 = useState(Cookies.get("pagination-size-questionnaire-
|
|
47
|
+
var _useState7 = useState(Cookies.get("pagination-size-questionnaire-document-type") ? JSON.parse(Cookies.get("pagination-size-questionnaire-document-type")) : 20),
|
|
44
48
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
49
|
size = _useState8[0],
|
|
46
50
|
setSize = _useState8[1];
|
|
@@ -54,17 +58,17 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
54
58
|
return state.global;
|
|
55
59
|
}),
|
|
56
60
|
loading = _useSelector.loading,
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
return state.questionnaire.
|
|
61
|
+
drivingcategoriesRender = _useSelector.drivingcategoriesRender;
|
|
62
|
+
var drivingcategories = useSelector(function (state) {
|
|
63
|
+
return state.questionnaire.drivingcategories;
|
|
60
64
|
});
|
|
61
|
-
var paginationLength = setPaginationLength(
|
|
65
|
+
var paginationLength = setPaginationLength(drivingcategories === null || drivingcategories === void 0 ? void 0 : drivingcategories.count, drivingcategories === null || drivingcategories === void 0 ? void 0 : drivingcategories.size);
|
|
62
66
|
var onSubmit = useCallback(/*#__PURE__*/function () {
|
|
63
67
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
64
68
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
65
69
|
while (1) switch (_context.prev = _context.next) {
|
|
66
70
|
case 0:
|
|
67
|
-
dispatch(
|
|
71
|
+
dispatch(addDrivingcategories(_objectSpread({}, data)));
|
|
68
72
|
case 1:
|
|
69
73
|
case "end":
|
|
70
74
|
return _context.stop();
|
|
@@ -76,18 +80,19 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
76
80
|
};
|
|
77
81
|
}(), [dispatch]);
|
|
78
82
|
var onEdit = useCallback(function (id, record) {
|
|
83
|
+
console.log(record);
|
|
79
84
|
var data = {
|
|
80
85
|
id: id,
|
|
81
86
|
name: record === null || record === void 0 ? void 0 : record.name
|
|
82
87
|
};
|
|
83
|
-
dispatch(
|
|
88
|
+
dispatch(editDrivingcategories(data));
|
|
84
89
|
}, [dispatch]);
|
|
85
90
|
var onStatusChange = useCallback(function (data, checked) {
|
|
86
91
|
var data_ = {
|
|
87
92
|
id: data === null || data === void 0 ? void 0 : data.id,
|
|
88
93
|
checked: checked
|
|
89
94
|
};
|
|
90
|
-
dispatch(
|
|
95
|
+
dispatch(drivingcategoriesVisibility(data_));
|
|
91
96
|
}, [dispatch]);
|
|
92
97
|
var closeOnViewModal = useCallback(function () {
|
|
93
98
|
dispatch(setViewModalVisible(false));
|
|
@@ -115,11 +120,11 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
115
120
|
});
|
|
116
121
|
};
|
|
117
122
|
var data = [];
|
|
118
|
-
if (
|
|
119
|
-
var
|
|
120
|
-
data =
|
|
123
|
+
if (drivingcategories !== null && drivingcategories !== void 0 && drivingcategories.items) {
|
|
124
|
+
var _drivingcategories$it;
|
|
125
|
+
data = drivingcategories === null || drivingcategories === void 0 || (_drivingcategories$it = drivingcategories.items) === null || _drivingcategories$it === void 0 ? void 0 : _drivingcategories$it.map(function (dataObj, i) {
|
|
121
126
|
return {
|
|
122
|
-
num: (
|
|
127
|
+
num: (drivingcategories === null || drivingcategories === void 0 ? void 0 : drivingcategories.size) * (drivingcategories === null || drivingcategories === void 0 ? void 0 : drivingcategories.page) + i + 1 - (drivingcategories === null || drivingcategories === void 0 ? void 0 : drivingcategories.size),
|
|
123
128
|
id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
|
|
124
129
|
name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
|
|
125
130
|
isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
|
|
@@ -142,17 +147,17 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
142
147
|
} else {
|
|
143
148
|
setInnerW(155);
|
|
144
149
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}, [dispatch, page,
|
|
150
|
+
var data = {
|
|
151
|
+
page: page,
|
|
152
|
+
size: size,
|
|
153
|
+
query: query,
|
|
154
|
+
visibility: "nondeleted"
|
|
155
|
+
};
|
|
156
|
+
dispatch(getDrivingcategories(data));
|
|
157
|
+
}, [dispatch, page, drivingcategoriesRender, size, query]);
|
|
153
158
|
var updateSize = function updateSize(newSize) {
|
|
154
159
|
setSize(newSize); // Update state
|
|
155
|
-
Cookies.set("pagination-size-questionnaire-
|
|
160
|
+
Cookies.set("pagination-size-questionnaire-document-type", JSON.stringify(newSize), {
|
|
156
161
|
expires: 7
|
|
157
162
|
}); // Save to cookies
|
|
158
163
|
};
|
|
@@ -177,7 +182,7 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
177
182
|
className: style.content
|
|
178
183
|
}, /*#__PURE__*/React.createElement("div", {
|
|
179
184
|
className: style.table_header
|
|
180
|
-
}, /*#__PURE__*/React.createElement("h2", null, "
|
|
185
|
+
}, /*#__PURE__*/React.createElement("h2", null, "S\xFCr\xFCc\xFCl\xFCk kateqoriyalar\u0131"), /*#__PURE__*/React.createElement("div", {
|
|
181
186
|
className: style.buttons
|
|
182
187
|
}, /*#__PURE__*/React.createElement(ColSort, {
|
|
183
188
|
columns: columns,
|
|
@@ -185,7 +190,13 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
185
190
|
handleColumnToggle: handleColumnToggle
|
|
186
191
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
187
192
|
className: "bigTable"
|
|
188
|
-
}
|
|
193
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
194
|
+
selectedColumns: selectedColumns,
|
|
195
|
+
innerW: innerW,
|
|
196
|
+
dataSource: data,
|
|
197
|
+
columns: columns,
|
|
198
|
+
disableDrag: true
|
|
199
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
189
200
|
className: style.pagination
|
|
190
201
|
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
191
202
|
size: size,
|
|
@@ -205,17 +216,16 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
205
216
|
className: "absolute",
|
|
206
217
|
centered: false
|
|
207
218
|
}, /*#__PURE__*/React.createElement(Item, {
|
|
219
|
+
className: style.label,
|
|
208
220
|
rules: [{
|
|
209
221
|
required: true,
|
|
210
222
|
message: ""
|
|
211
|
-
}, {
|
|
212
|
-
min: 3,
|
|
213
|
-
message: "Ən azından 3 simvol olmalıdır"
|
|
214
223
|
}],
|
|
215
224
|
name: "name",
|
|
216
225
|
label: "Ad"
|
|
217
226
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
218
|
-
className: style.modal_input
|
|
227
|
+
className: style.modal_input,
|
|
228
|
+
type: "text"
|
|
219
229
|
}))), /*#__PURE__*/React.createElement(DeleteModal, {
|
|
220
230
|
onCancel: function onCancel() {
|
|
221
231
|
return dispatch(setDeleteModalVisible(false));
|
|
@@ -223,7 +233,7 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
223
233
|
width: 280
|
|
224
234
|
}, /*#__PURE__*/React.createElement(Delete, {
|
|
225
235
|
onDelete: function onDelete() {
|
|
226
|
-
return dispatch(
|
|
236
|
+
return dispatch(deleteDrivingcategories(id));
|
|
227
237
|
},
|
|
228
238
|
onCancel: function onCancel() {
|
|
229
239
|
return dispatch(setDeleteModalVisible(false));
|
|
@@ -237,4 +247,4 @@ var QuestionnairesStreetsContent = function QuestionnairesStreetsContent() {
|
|
|
237
247
|
value: "Soraqça"
|
|
238
248
|
}))))));
|
|
239
249
|
};
|
|
240
|
-
export default
|
|
250
|
+
export default QuestionnairesDocumentTypeContent;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Switch, Tooltip } from "antd";
|
|
3
|
+
import style from "../Questionnaires.module.scss";
|
|
4
|
+
import { setDeleteModalVisible } from "../../../store/slices/global";
|
|
5
|
+
import { DeleteIconQ, EditIcon } from "../../../assets/icons";
|
|
6
|
+
export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
|
|
7
|
+
return [{
|
|
8
|
+
title: "№",
|
|
9
|
+
dataIndex: "num",
|
|
10
|
+
showCheckbox: false,
|
|
11
|
+
ellipsis: true,
|
|
12
|
+
width: 35
|
|
13
|
+
}, {
|
|
14
|
+
title: "Ad",
|
|
15
|
+
dataIndex: "name",
|
|
16
|
+
width: innerW,
|
|
17
|
+
disabled: true,
|
|
18
|
+
ellipsis: true
|
|
19
|
+
}, {
|
|
20
|
+
title: "Status",
|
|
21
|
+
key: "status",
|
|
22
|
+
disabled: true,
|
|
23
|
+
filter: false,
|
|
24
|
+
render: function render(data) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
26
|
+
placement: "top",
|
|
27
|
+
title: "Statusu d\u0259yi\u015F"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
29
|
+
size: "medium",
|
|
30
|
+
checked: data === null || data === void 0 ? void 0 : data.isActive,
|
|
31
|
+
onChange: function onChange(checked) {
|
|
32
|
+
return onStatusChange(data, checked, dispatch);
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
title: "",
|
|
38
|
+
key: "actions",
|
|
39
|
+
showCheckbox: false,
|
|
40
|
+
width: 80,
|
|
41
|
+
render: function render(data) {
|
|
42
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: style.number
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
className: style.actions
|
|
46
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return onEditClick(data);
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
onDelete(data === null || data === void 0 ? void 0 : data.id);
|
|
53
|
+
dispatch(setDeleteModalVisible(true));
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
};
|