@banch0u/core-project-test-repository 1.8.4 → 1.9.1
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 +723 -0
- package/dist/assets/icons/index.js +182 -0
- package/dist/components/Button/index.module.scss +17 -5
- package/dist/components/ColSort/index.module.scss +22 -0
- package/dist/components/Delete/Delete.js +22 -0
- package/dist/components/Delete/Delete.module.scss +22 -0
- package/dist/components/DeleteModal/DeleteModal.js +31 -0
- package/dist/components/DeleteModal/DeleteModal.module.scss +11 -0
- package/dist/components/Filter/index.js +1 -1
- package/dist/components/Input/index.js +34 -6
- package/dist/components/Input/index.module.scss +55 -23
- package/dist/components/ProfileOptions/index.module.scss +3 -3
- package/dist/components/Select/index.js +47 -60
- package/dist/components/Select/index.module.scss +32 -0
- package/dist/components/Success/Success.js +19 -0
- package/dist/components/Success/Success.module.scss +26 -0
- package/dist/components/Table/index.js +4 -2
- package/dist/components/ViewModal/index.js +30 -0
- package/dist/helpers/paginationLength.js +3 -0
- package/dist/helpers/querySearch.js +22 -0
- package/dist/index.js +2 -0
- package/dist/layout/Header/AppSelect/index.js +28 -9
- package/dist/layout/Header/AppSelect/index.module.scss +6 -1
- package/dist/layout/Portal/index.js +23 -0
- package/dist/layout/QuestionnairesLayout/index.js +17 -0
- package/dist/layout/QuestionnairesLayout/index.module.scss +0 -0
- package/dist/layout/QuestionnairesSidebar/index.js +162 -0
- package/dist/layout/QuestionnairesSidebar/index.module.scss +76 -0
- package/dist/pages/Questionnnaires/Questionnaires.module.scss +194 -0
- package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesApplicationFormContent/index.js +255 -0
- package/dist/pages/Questionnnaires/QuestionnairesBrandsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesBrandsContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesChassisTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesChassisTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesColorsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesColorsContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesCountriesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesCountriesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesDeliveryMethodContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesDeliveryMethodContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentRecieveMethodsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentRecieveMethodsContent/index.js +258 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentTypeContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentTypeContent/index.js +284 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentWhomContent/constant.js +82 -0
- package/dist/pages/Questionnnaires/QuestionnairesDocumentWhomContent/index.js +331 -0
- package/dist/pages/Questionnnaires/QuestionnairesEngineTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesEngineTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesExecutionRulesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesExecutionRulesContent/index.js +258 -0
- package/dist/pages/Questionnnaires/QuestionnairesGearboxTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesGearboxTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesIssuedAuthoritiesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesIssuedAuthoritiesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesMarginNoteTextsContent/index.js +249 -0
- package/dist/pages/Questionnnaires/QuestionnairesModelsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesModelsContent/index.js +290 -0
- package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/constant.js +88 -0
- package/dist/pages/Questionnnaires/QuestionnairesOrganizationsContent/index.js +320 -0
- package/dist/pages/Questionnnaires/QuestionnairesOwnershipTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesOwnershipTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesStreetsContent/index.js +240 -0
- package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesStructuresContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesSubtopicContent/index.js +317 -0
- package/dist/pages/Questionnnaires/QuestionnairesTopicContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesTopicContent/index.js +271 -0
- package/dist/pages/Questionnnaires/QuestionnairesTransmitterTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesTransmitterTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/QuestionnairesVehicleTypesContent/constant.js +58 -0
- package/dist/pages/Questionnnaires/QuestionnairesVehicleTypesContent/index.js +247 -0
- package/dist/pages/Questionnnaires/index.js +5 -0
- package/dist/routes/QuestionnaireRoutes.js +178 -0
- package/dist/store/slices/global/index.js +174 -3
- package/dist/store/slices/questionnaire/index.js +5139 -0
- package/dist/store/slices/questionnaire/service.js +3030 -0
- package/dist/store/store.js +2 -1
- package/dist/utils/path.js +49 -1
- package/package.json +2 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.sidebar {
|
|
2
|
+
background: #fff !important;
|
|
3
|
+
border-radius: 12px;
|
|
4
|
+
border: none;
|
|
5
|
+
position: relative;
|
|
6
|
+
margin: 20px;
|
|
7
|
+
margin-right: 0;
|
|
8
|
+
.logo {
|
|
9
|
+
margin-top: 20px;
|
|
10
|
+
margin-bottom: 18px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
h2 {
|
|
13
|
+
font-family: Inter;
|
|
14
|
+
font-size: 24px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
color: var(--darkBlueColor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.search {
|
|
22
|
+
padding: 0 14px;
|
|
23
|
+
margin-bottom: 6px;
|
|
24
|
+
.search_input {
|
|
25
|
+
width: 100%;
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
height: 36px;
|
|
30
|
+
font-size: 16px !important;
|
|
31
|
+
font-weight: 500 !important;
|
|
32
|
+
line-height: 24px !important;
|
|
33
|
+
text-align: left !important;
|
|
34
|
+
border-radius: 6px;
|
|
35
|
+
padding: 6px 10px !important;
|
|
36
|
+
.search_icon {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
svg {
|
|
41
|
+
path {
|
|
42
|
+
transition: 250ms;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
svg:hover {
|
|
46
|
+
path {
|
|
47
|
+
stroke: var(--darkBlueColor);
|
|
48
|
+
transition: 250ms;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
.menu {
|
|
55
|
+
background: #fff;
|
|
56
|
+
border: none;
|
|
57
|
+
border-right: 0;
|
|
58
|
+
border-radius: 12px 12px 0 0;
|
|
59
|
+
margin-top: 0px;
|
|
60
|
+
li {
|
|
61
|
+
margin-inline: 14px;
|
|
62
|
+
width: 90%;
|
|
63
|
+
border-radius: 4px;
|
|
64
|
+
color: #828282;
|
|
65
|
+
// background: #f2f2f2;
|
|
66
|
+
font-family: Inter;
|
|
67
|
+
font-size: 18px;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
text-align: left;
|
|
70
|
+
height: 42px;
|
|
71
|
+
span {
|
|
72
|
+
margin-left: 8px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
.layout {
|
|
2
|
+
margin: 20px;
|
|
3
|
+
border-radius: 12px;
|
|
4
|
+
height: auto;
|
|
5
|
+
background: unset;
|
|
6
|
+
.content {
|
|
7
|
+
margin-bottom: 30px;
|
|
8
|
+
background: #fff;
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
max-height: calc(100vh - 85px) !important;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
.table_header {
|
|
13
|
+
padding: 14px;
|
|
14
|
+
padding-bottom: 18px;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: center;
|
|
18
|
+
h2 {
|
|
19
|
+
font-size: 26px;
|
|
20
|
+
font-weight: 500;
|
|
21
|
+
line-height: 39px;
|
|
22
|
+
text-align: left;
|
|
23
|
+
}
|
|
24
|
+
.buttons {
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
.search {
|
|
28
|
+
width: 168px;
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
height: 36px;
|
|
33
|
+
font-size: 16px !important;
|
|
34
|
+
font-weight: 500 !important;
|
|
35
|
+
line-height: 24px !important;
|
|
36
|
+
text-align: left !important;
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
padding: 6px 10px !important;
|
|
39
|
+
.search_icon {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
svg {
|
|
44
|
+
path {
|
|
45
|
+
transition: 250ms;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
svg:hover {
|
|
49
|
+
path {
|
|
50
|
+
stroke: var(--darkBlueColor);
|
|
51
|
+
transition: 250ms;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
.layout1 {
|
|
60
|
+
// margin-left: 24px;
|
|
61
|
+
// margin-right: 20px;
|
|
62
|
+
// margin-top: 20px;
|
|
63
|
+
border-radius: 12px;
|
|
64
|
+
height: auto;
|
|
65
|
+
background: unset;
|
|
66
|
+
.content {
|
|
67
|
+
margin-bottom: 0px;
|
|
68
|
+
background: #fff !important;
|
|
69
|
+
border-radius: 12px;
|
|
70
|
+
max-height: calc(100vh - 85px) !important;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
display: block;
|
|
73
|
+
border: 1px solid var(--blue);
|
|
74
|
+
padding: 0 !important;
|
|
75
|
+
padding-bottom: 10px !important;
|
|
76
|
+
|
|
77
|
+
table {
|
|
78
|
+
// th {
|
|
79
|
+
// text-align: left !important;
|
|
80
|
+
// padding-left: 5px !important;
|
|
81
|
+
// }
|
|
82
|
+
th:nth-child(2),
|
|
83
|
+
th:nth-child(3) {
|
|
84
|
+
text-align: left !important;
|
|
85
|
+
padding-left: 20px !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// td {
|
|
89
|
+
// text-align: left !important;
|
|
90
|
+
// padding-left: 5px !important;
|
|
91
|
+
// }
|
|
92
|
+
td:nth-child(2),
|
|
93
|
+
td:nth-child(3) {
|
|
94
|
+
text-align: left !important;
|
|
95
|
+
padding-left: 20px !important;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.content:first-child {
|
|
101
|
+
// display: flex;
|
|
102
|
+
justify-content: space-between;
|
|
103
|
+
align-items: center;
|
|
104
|
+
padding: 0;
|
|
105
|
+
flex: unset;
|
|
106
|
+
padding: 15px;
|
|
107
|
+
margin-bottom: 20px;
|
|
108
|
+
background: var(--lightBlue);
|
|
109
|
+
|
|
110
|
+
.header {
|
|
111
|
+
display: flex;
|
|
112
|
+
width: 100%;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
align-items: center;
|
|
115
|
+
button {
|
|
116
|
+
width: unset;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pagination {
|
|
122
|
+
margin-left: 15px;
|
|
123
|
+
margin-top: 1px;
|
|
124
|
+
display: flex;
|
|
125
|
+
gap: 10px;
|
|
126
|
+
align-items: center;
|
|
127
|
+
p {
|
|
128
|
+
margin-top: 10px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.search_filter {
|
|
134
|
+
button {
|
|
135
|
+
padding: 4px 8px;
|
|
136
|
+
font-size: 12px;
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
gap: 2px;
|
|
141
|
+
width: 90px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.number {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
p {
|
|
150
|
+
font-family: Inter !important;
|
|
151
|
+
font-size: 18px !important;
|
|
152
|
+
font-weight: 400 !important;
|
|
153
|
+
line-height: 21.78px !important;
|
|
154
|
+
}
|
|
155
|
+
.actions {
|
|
156
|
+
margin-left: 8%;
|
|
157
|
+
display: flex;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
vertical-align: middle;
|
|
160
|
+
background: transparent !important;
|
|
161
|
+
margin-right: 9px;
|
|
162
|
+
gap: 10px;
|
|
163
|
+
svg {
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
.actions > div {
|
|
169
|
+
background: #deeaf6;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
padding: 3px;
|
|
174
|
+
border-radius: 4px;
|
|
175
|
+
}
|
|
176
|
+
.actions > div:last-child {
|
|
177
|
+
background: #f6dedf;
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
padding: 3px;
|
|
182
|
+
border-radius: 4px;
|
|
183
|
+
}
|
|
184
|
+
.modal_input {
|
|
185
|
+
// padding: 9px 16px !important;
|
|
186
|
+
// border: 1px solid #bdbdbd !important;
|
|
187
|
+
border-radius: 6px !important;
|
|
188
|
+
font-size: 16px !important;
|
|
189
|
+
font-weight: 500 !important;
|
|
190
|
+
line-height: 24px !important;
|
|
191
|
+
text-align: left !important;
|
|
192
|
+
height: 48px;
|
|
193
|
+
width: 100%;
|
|
194
|
+
}
|
|
@@ -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: "Mövzu",
|
|
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,255 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import Cookies from "js-cookie";
|
|
8
|
+
import style from "../Questionnaires.module.scss";
|
|
9
|
+
import { Form, Input, Layout } from "antd";
|
|
10
|
+
import { PlusIcon } from "../../../assets/icons";
|
|
11
|
+
import FormModal from "../../../components/FormModal";
|
|
12
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
13
|
+
import Delete from "../../../components/Delete/Delete";
|
|
14
|
+
import DeleteModal from "../../../components/DeleteModal/DeleteModal";
|
|
15
|
+
import Success from "../../../components/Success/Success";
|
|
16
|
+
import { setDeleteModalVisible, setViewModalVisible } from "../../../store/slices/global";
|
|
17
|
+
import ViewModal from "../../../components/ViewModal";
|
|
18
|
+
import { getStreetColumns } from "./constant";
|
|
19
|
+
import Pagination from "../../../components/Pagination";
|
|
20
|
+
import ColSort from "../../../components/ColSort";
|
|
21
|
+
import { setPaginationLength } from "../../../helpers/paginationLength";
|
|
22
|
+
import Button from "../../../components/Button";
|
|
23
|
+
import Loading from "../../../components/Loading";
|
|
24
|
+
import Table from "../../../components/Table";
|
|
25
|
+
import Filter from "../../../components/Filter";
|
|
26
|
+
import { addApplicationForm, applicationFormVisibility, deleteApplicationForm, editApplicationForm, getApplicationForms } from "../../../store/slices/questionnaire";
|
|
27
|
+
var Content = Layout.Content;
|
|
28
|
+
var Item = Form.Item;
|
|
29
|
+
var QuestionnairesApplicationFormContent = function QuestionnairesApplicationFormContent() {
|
|
30
|
+
var _useState = useState(null),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
innerW = _useState2[0],
|
|
33
|
+
setInnerW = _useState2[1];
|
|
34
|
+
var ref = useRef();
|
|
35
|
+
var dispatch = useDispatch();
|
|
36
|
+
var _useState3 = useState(0),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
id = _useState4[0],
|
|
39
|
+
setId = _useState4[1];
|
|
40
|
+
var _useState5 = useState(1),
|
|
41
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
+
page = _useState6[0],
|
|
43
|
+
setPage = _useState6[1];
|
|
44
|
+
var _useState7 = useState(Cookies.get("pagination-size-questionnaire-application-form") ? JSON.parse(Cookies.get("pagination-size-questionnaire-application-form")) : 20),
|
|
45
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
46
|
+
size = _useState8[0],
|
|
47
|
+
setSize = _useState8[1];
|
|
48
|
+
var _useState9 = useState({
|
|
49
|
+
name: ""
|
|
50
|
+
}),
|
|
51
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
52
|
+
query = _useState10[0],
|
|
53
|
+
setQuery = _useState10[1];
|
|
54
|
+
var _useSelector = useSelector(function (state) {
|
|
55
|
+
return state.global;
|
|
56
|
+
}),
|
|
57
|
+
loading = _useSelector.loading,
|
|
58
|
+
applicationFormRender = _useSelector.applicationFormRender;
|
|
59
|
+
var applicationForms = useSelector(function (state) {
|
|
60
|
+
return state.questionnaire.applicationForms;
|
|
61
|
+
});
|
|
62
|
+
var paginationLength = setPaginationLength(applicationForms === null || applicationForms === void 0 ? void 0 : applicationForms.count, applicationForms === null || applicationForms === void 0 ? void 0 : applicationForms.size);
|
|
63
|
+
var onSubmit = useCallback(/*#__PURE__*/function () {
|
|
64
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
65
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
dispatch(addApplicationForm({
|
|
69
|
+
name: data === null || data === void 0 ? void 0 : data.name
|
|
70
|
+
}));
|
|
71
|
+
case 1:
|
|
72
|
+
case "end":
|
|
73
|
+
return _context.stop();
|
|
74
|
+
}
|
|
75
|
+
}, _callee);
|
|
76
|
+
}));
|
|
77
|
+
return function (_x) {
|
|
78
|
+
return _ref.apply(this, arguments);
|
|
79
|
+
};
|
|
80
|
+
}(), [dispatch]);
|
|
81
|
+
var onEdit = useCallback(function (id, record) {
|
|
82
|
+
var data = {
|
|
83
|
+
id: id,
|
|
84
|
+
name: record === null || record === void 0 ? void 0 : record.name
|
|
85
|
+
};
|
|
86
|
+
dispatch(editApplicationForm(data));
|
|
87
|
+
}, [dispatch]);
|
|
88
|
+
var onStatusChange = useCallback(function (data, checked) {
|
|
89
|
+
var data_ = {
|
|
90
|
+
id: data === null || data === void 0 ? void 0 : data.id,
|
|
91
|
+
checked: checked
|
|
92
|
+
};
|
|
93
|
+
dispatch(applicationFormVisibility(data_));
|
|
94
|
+
}, [dispatch]);
|
|
95
|
+
var closeOnViewModal = useCallback(function () {
|
|
96
|
+
dispatch(setViewModalVisible(false));
|
|
97
|
+
}, [dispatch]);
|
|
98
|
+
var onClickModal = function onClickModal() {
|
|
99
|
+
var _ref$current;
|
|
100
|
+
ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.open();
|
|
101
|
+
};
|
|
102
|
+
var onEditClick = useCallback(function (data) {
|
|
103
|
+
var _ref$current2;
|
|
104
|
+
ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.setEdit(data);
|
|
105
|
+
}, []);
|
|
106
|
+
var onDelete = useCallback(function (id) {
|
|
107
|
+
setId(id);
|
|
108
|
+
}, []);
|
|
109
|
+
var handleSearch = function handleSearch(value) {
|
|
110
|
+
setQuery({
|
|
111
|
+
name: value
|
|
112
|
+
});
|
|
113
|
+
setPage(1);
|
|
114
|
+
};
|
|
115
|
+
var handleColumnToggle = function handleColumnToggle(checked, dataIndex) {
|
|
116
|
+
setSelectedColumns(function (prevSelected) {
|
|
117
|
+
if (checked) {
|
|
118
|
+
return [].concat(_toConsumableArray(prevSelected), [dataIndex]);
|
|
119
|
+
} else {
|
|
120
|
+
return prevSelected.filter(function (col) {
|
|
121
|
+
return col !== dataIndex;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
var data = [];
|
|
127
|
+
if (applicationForms !== null && applicationForms !== void 0 && applicationForms.items) {
|
|
128
|
+
var _applicationForms$ite;
|
|
129
|
+
data = applicationForms === null || applicationForms === void 0 || (_applicationForms$ite = applicationForms.items) === null || _applicationForms$ite === void 0 ? void 0 : _applicationForms$ite.map(function (dataObj, i) {
|
|
130
|
+
return {
|
|
131
|
+
num: (applicationForms === null || applicationForms === void 0 ? void 0 : applicationForms.size) * (applicationForms === null || applicationForms === void 0 ? void 0 : applicationForms.page) + i + 1 - (applicationForms === null || applicationForms === void 0 ? void 0 : applicationForms.size),
|
|
132
|
+
id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
|
|
133
|
+
name: dataObj === null || dataObj === void 0 ? void 0 : dataObj.name,
|
|
134
|
+
isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
|
|
135
|
+
className: "rowClassName1"
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
var columns = useMemo(function () {
|
|
140
|
+
return getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch);
|
|
141
|
+
}, [onEditClick, onDelete, onStatusChange, dispatch]);
|
|
142
|
+
var _useState11 = useState(columns.map(function (col) {
|
|
143
|
+
return col.dataIndex;
|
|
144
|
+
})),
|
|
145
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
146
|
+
selectedColumns = _useState12[0],
|
|
147
|
+
setSelectedColumns = _useState12[1];
|
|
148
|
+
useEffect(function () {
|
|
149
|
+
if (window.innerWidth >= 1900) {
|
|
150
|
+
setInnerW(210);
|
|
151
|
+
} else {
|
|
152
|
+
setInnerW(155);
|
|
153
|
+
}
|
|
154
|
+
var data = {
|
|
155
|
+
page: page,
|
|
156
|
+
size: size,
|
|
157
|
+
query: query,
|
|
158
|
+
visibility: "nondeleted"
|
|
159
|
+
};
|
|
160
|
+
dispatch(getApplicationForms(data));
|
|
161
|
+
}, [dispatch, page, applicationFormRender, size, query]);
|
|
162
|
+
var updateSize = function updateSize(newSize) {
|
|
163
|
+
setSize(newSize); // Update state
|
|
164
|
+
Cookies.set("pagination-size-questionnaire-application-form", JSON.stringify(newSize), {
|
|
165
|
+
expires: 7
|
|
166
|
+
}); // Save to cookies
|
|
167
|
+
};
|
|
168
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement(Loading, null) : null, /*#__PURE__*/React.createElement(Layout, {
|
|
169
|
+
className: style.layout
|
|
170
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
171
|
+
className: style.content
|
|
172
|
+
}, /*#__PURE__*/React.createElement("header", {
|
|
173
|
+
className: style.header
|
|
174
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
175
|
+
onClick: onClickModal,
|
|
176
|
+
color: "green"
|
|
177
|
+
}, " ", /*#__PURE__*/React.createElement(PlusIcon, null), " Soraq\xE7a \u0259lav\u0259 et"), /*#__PURE__*/React.createElement(Filter, {
|
|
178
|
+
columns: columns,
|
|
179
|
+
selectedColumns: selectedColumns,
|
|
180
|
+
setQuery: setQuery,
|
|
181
|
+
disabledElementCount: 3,
|
|
182
|
+
setPage: setPage
|
|
183
|
+
}))), /*#__PURE__*/React.createElement(Layout, {
|
|
184
|
+
className: style.layout1
|
|
185
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
186
|
+
className: style.content
|
|
187
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
className: style.table_header
|
|
189
|
+
}, /*#__PURE__*/React.createElement("h2", null, "M\xFCraci\u0259t formalar\u0131"), /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
className: style.buttons
|
|
191
|
+
}, /*#__PURE__*/React.createElement(ColSort, {
|
|
192
|
+
columns: columns,
|
|
193
|
+
selectedColumns: selectedColumns,
|
|
194
|
+
handleColumnToggle: handleColumnToggle
|
|
195
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
196
|
+
className: "bigTable"
|
|
197
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
198
|
+
selectedColumns: selectedColumns,
|
|
199
|
+
innerW: innerW,
|
|
200
|
+
dataSource: data,
|
|
201
|
+
columns: columns,
|
|
202
|
+
disableDrag: true
|
|
203
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
className: style.pagination
|
|
205
|
+
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
206
|
+
size: size,
|
|
207
|
+
setSize: updateSize,
|
|
208
|
+
total: paginationLength,
|
|
209
|
+
page: page,
|
|
210
|
+
onChange: setPage
|
|
211
|
+
})), /*#__PURE__*/React.createElement(FormModal, {
|
|
212
|
+
ref: ref,
|
|
213
|
+
width: 454,
|
|
214
|
+
title: "Yeni soraqça yaratma",
|
|
215
|
+
titleEdit: "Soraqça redaktə etmə",
|
|
216
|
+
okText: "Yadda saxla",
|
|
217
|
+
cancelText: "Bağla",
|
|
218
|
+
onSubmit: onSubmit,
|
|
219
|
+
onEdit: onEdit,
|
|
220
|
+
className: "absolute",
|
|
221
|
+
centered: false
|
|
222
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
223
|
+
rules: [{
|
|
224
|
+
required: true,
|
|
225
|
+
message: ""
|
|
226
|
+
}, {
|
|
227
|
+
min: 3,
|
|
228
|
+
message: "Ən azından 3 simvol olmalıdır"
|
|
229
|
+
}],
|
|
230
|
+
name: "name",
|
|
231
|
+
label: "Ad"
|
|
232
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
233
|
+
className: style.modal_input
|
|
234
|
+
}))), /*#__PURE__*/React.createElement(DeleteModal, {
|
|
235
|
+
onCancel: function onCancel() {
|
|
236
|
+
return dispatch(setDeleteModalVisible(false));
|
|
237
|
+
},
|
|
238
|
+
width: 280
|
|
239
|
+
}, /*#__PURE__*/React.createElement(Delete, {
|
|
240
|
+
onDelete: function onDelete() {
|
|
241
|
+
return dispatch(deleteApplicationForm(id));
|
|
242
|
+
},
|
|
243
|
+
onCancel: function onCancel() {
|
|
244
|
+
return dispatch(setDeleteModalVisible(false));
|
|
245
|
+
},
|
|
246
|
+
value: "Soraqçanı"
|
|
247
|
+
})), /*#__PURE__*/React.createElement(ViewModal, {
|
|
248
|
+
onCancel: closeOnViewModal,
|
|
249
|
+
width: 695
|
|
250
|
+
}, /*#__PURE__*/React.createElement(Success, {
|
|
251
|
+
onClick: closeOnViewModal,
|
|
252
|
+
value: "Soraqça"
|
|
253
|
+
}))))));
|
|
254
|
+
};
|
|
255
|
+
export default QuestionnairesApplicationFormContent;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as 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: "Brend",
|
|
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
|
+
};
|