@banch0u/core-project-test-repository 1.9.5 → 1.9.7
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/components/ProfileOptions/index.js +3 -3
- package/dist/components/ProfileOptions/index.module.scss +6 -2
- package/dist/components/Select/index.module.scss +8 -12
- package/dist/layout/Header/AppSelect/index.module.scss +4 -0
- package/dist/pages/Questionnnaires/Questionnaires.module.scss +16 -0
- package/dist/pages/Questionnnaires/QuestionnairesEmployeeConfigurations/constant.js +17 -38
- package/dist/pages/Questionnnaires/QuestionnairesEmployeeConfigurations/index.js +116 -25
- package/package.json +1 -1
|
@@ -96,10 +96,10 @@ var ProfileOptions = function ProfileOptions() {
|
|
|
96
96
|
minWidth: "16px",
|
|
97
97
|
lineHeight: "16px",
|
|
98
98
|
padding: "0 4px"
|
|
99
|
-
}
|
|
99
|
+
},
|
|
100
|
+
"data-no-invert-1": true
|
|
100
101
|
}, /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
className: style.icon_overlay
|
|
102
|
-
"data-no-invert": true
|
|
102
|
+
className: style.icon_overlay
|
|
103
103
|
}, /*#__PURE__*/React.createElement(NotificationBell, null)));
|
|
104
104
|
};
|
|
105
105
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -189,7 +189,9 @@
|
|
|
189
189
|
border-radius: 8px;
|
|
190
190
|
background: var(--lightBlue);
|
|
191
191
|
cursor: pointer;
|
|
192
|
-
width:
|
|
192
|
+
width: 280px;
|
|
193
|
+
max-width: 280px;
|
|
194
|
+
min-width: 280px;
|
|
193
195
|
|
|
194
196
|
.pp {
|
|
195
197
|
width: 32px;
|
|
@@ -229,7 +231,9 @@
|
|
|
229
231
|
position: absolute;
|
|
230
232
|
top: 100%;
|
|
231
233
|
right: -1px;
|
|
232
|
-
width:
|
|
234
|
+
width: 300px;
|
|
235
|
+
max-width: 300px;
|
|
236
|
+
min-width: 300px;
|
|
233
237
|
border-right: 1px solid var(--blue);
|
|
234
238
|
border-left: 1px solid var(--blue);
|
|
235
239
|
border-bottom: 1px solid var(--blue);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
.select > div {
|
|
2
2
|
padding: 5px 16px !important;
|
|
3
3
|
border-radius: 6px !important;
|
|
4
|
-
height: 48px;
|
|
4
|
+
min-height: 48px;
|
|
5
5
|
}
|
|
6
6
|
.select {
|
|
7
7
|
width: 100%;
|
|
8
|
-
height:
|
|
9
|
-
height: 48px;
|
|
8
|
+
min-height: 48px;
|
|
10
9
|
span {
|
|
11
10
|
font-size: 16px !important;
|
|
12
11
|
font-weight: 500 !important;
|
|
@@ -17,12 +16,11 @@
|
|
|
17
16
|
.select_xs > div {
|
|
18
17
|
padding: 5px 16px !important;
|
|
19
18
|
border-radius: 6px !important;
|
|
20
|
-
height: 26px;
|
|
19
|
+
min-height: 26px;
|
|
21
20
|
}
|
|
22
21
|
.select_xs {
|
|
23
22
|
width: 100%;
|
|
24
|
-
height:
|
|
25
|
-
height: 26px;
|
|
23
|
+
min-height: 26px;
|
|
26
24
|
span {
|
|
27
25
|
font-size: 16px !important;
|
|
28
26
|
font-weight: 500 !important;
|
|
@@ -34,12 +32,11 @@
|
|
|
34
32
|
.select_sm > div {
|
|
35
33
|
padding: 5px 16px !important;
|
|
36
34
|
border-radius: 6px !important;
|
|
37
|
-
height: 34px;
|
|
35
|
+
min-height: 34px;
|
|
38
36
|
}
|
|
39
37
|
.select_sm {
|
|
40
38
|
width: 100%;
|
|
41
|
-
height:
|
|
42
|
-
height: 34px;
|
|
39
|
+
min-height: 34px;
|
|
43
40
|
span {
|
|
44
41
|
font-size: 16px !important;
|
|
45
42
|
font-weight: 500 !important;
|
|
@@ -50,12 +47,11 @@
|
|
|
50
47
|
.select_md > div {
|
|
51
48
|
padding: 5px 16px !important;
|
|
52
49
|
border-radius: 6px !important;
|
|
53
|
-
height: 42px;
|
|
50
|
+
min-height: 42px;
|
|
54
51
|
}
|
|
55
52
|
.select_md {
|
|
56
53
|
width: 100%;
|
|
57
|
-
height:
|
|
58
|
-
height: 42px;
|
|
54
|
+
min-height: 42px;
|
|
59
55
|
span {
|
|
60
56
|
font-size: 16px !important;
|
|
61
57
|
font-weight: 500 !important;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
.accordion {
|
|
2
2
|
background: var(--blue);
|
|
3
3
|
width: 270px;
|
|
4
|
+
min-width: 270px;
|
|
5
|
+
max-width: 270px;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
.accordionHeader {
|
|
@@ -31,6 +33,8 @@
|
|
|
31
33
|
padding: 10px;
|
|
32
34
|
top: 81px !important;
|
|
33
35
|
width: 250px !important;
|
|
36
|
+
min-width: 250px !important;
|
|
37
|
+
max-width: 250px !important;
|
|
34
38
|
border-radius: 0 0 6px 6px;
|
|
35
39
|
}
|
|
36
40
|
|
|
@@ -193,3 +193,19 @@
|
|
|
193
193
|
height: 48px;
|
|
194
194
|
width: 100%;
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
.tree_select > div {
|
|
198
|
+
padding: 5px 16px !important;
|
|
199
|
+
border-radius: 6px !important;
|
|
200
|
+
min-height: 48px;
|
|
201
|
+
}
|
|
202
|
+
.tree_select {
|
|
203
|
+
width: 100%;
|
|
204
|
+
min-height: 48px;
|
|
205
|
+
span {
|
|
206
|
+
font-size: 16px !important;
|
|
207
|
+
font-weight: 500 !important;
|
|
208
|
+
line-height: 24px !important;
|
|
209
|
+
text-align: left !important;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Switch, Tooltip } from "antd";
|
|
3
2
|
import style from "../Questionnaires.module.scss";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, onStatusChange, dispatch, innerW) {
|
|
3
|
+
import { EditIcon } from "../../../assets/icons";
|
|
4
|
+
export var getStreetColumns = function getStreetColumns(onEditClick, innerW) {
|
|
7
5
|
return [{
|
|
8
6
|
title: "№",
|
|
9
7
|
dataIndex: "num",
|
|
@@ -12,56 +10,39 @@ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, o
|
|
|
12
10
|
width: 35
|
|
13
11
|
}, {
|
|
14
12
|
title: "Heyyət üzvü",
|
|
15
|
-
dataIndex: "
|
|
13
|
+
dataIndex: "EmployeeIds1",
|
|
16
14
|
width: innerW,
|
|
17
|
-
disabled:
|
|
15
|
+
disabled: false,
|
|
18
16
|
ellipsis: true
|
|
19
17
|
}, {
|
|
20
18
|
title: "Struktur vahidi",
|
|
21
|
-
dataIndex: "
|
|
19
|
+
dataIndex: "GeneralStructures1",
|
|
22
20
|
width: innerW,
|
|
23
|
-
disabled:
|
|
21
|
+
disabled: false,
|
|
24
22
|
ellipsis: true
|
|
25
23
|
}, {
|
|
26
24
|
title: "Vəzifələr",
|
|
27
|
-
dataIndex: "
|
|
25
|
+
dataIndex: "Positions1",
|
|
28
26
|
width: innerW,
|
|
29
|
-
disabled:
|
|
27
|
+
disabled: false,
|
|
30
28
|
ellipsis: true
|
|
31
29
|
}, {
|
|
32
30
|
title: "Məsul şəxs",
|
|
33
|
-
dataIndex: "
|
|
31
|
+
dataIndex: "PersonInChargeForFuelIds1",
|
|
34
32
|
width: innerW,
|
|
35
|
-
disabled:
|
|
33
|
+
disabled: false,
|
|
36
34
|
ellipsis: true
|
|
37
35
|
}, {
|
|
38
36
|
title: "İstismar şöbəsinin rəisi",
|
|
39
|
-
dataIndex: "
|
|
37
|
+
dataIndex: "OperatingManagerIds1",
|
|
40
38
|
width: innerW,
|
|
41
|
-
disabled:
|
|
39
|
+
disabled: false,
|
|
42
40
|
ellipsis: true
|
|
43
|
-
}, {
|
|
44
|
-
title: "Status",
|
|
45
|
-
key: "status",
|
|
46
|
-
disabled: true,
|
|
47
|
-
filter: false,
|
|
48
|
-
render: function render(data) {
|
|
49
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
50
|
-
placement: "top",
|
|
51
|
-
title: "Statusu d\u0259yi\u015F"
|
|
52
|
-
}, /*#__PURE__*/React.createElement(Switch, {
|
|
53
|
-
size: "medium",
|
|
54
|
-
checked: data === null || data === void 0 ? void 0 : data.isActive,
|
|
55
|
-
onChange: function onChange(checked) {
|
|
56
|
-
return onStatusChange(data, checked, dispatch);
|
|
57
|
-
}
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
41
|
}, {
|
|
61
42
|
title: "",
|
|
62
43
|
key: "actions",
|
|
63
44
|
showCheckbox: false,
|
|
64
|
-
width:
|
|
45
|
+
width: 40,
|
|
65
46
|
render: function render(data) {
|
|
66
47
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
67
48
|
className: style.number
|
|
@@ -70,13 +51,11 @@ export var getStreetColumns = function getStreetColumns(onEditClick, onDelete, o
|
|
|
70
51
|
}, /*#__PURE__*/React.createElement("div", {
|
|
71
52
|
onClick: function onClick() {
|
|
72
53
|
return onEditClick(data);
|
|
54
|
+
},
|
|
55
|
+
style: {
|
|
56
|
+
background: "#DEEAF6"
|
|
73
57
|
}
|
|
74
|
-
}, /*#__PURE__*/React.createElement(EditIcon, null))
|
|
75
|
-
onClick: function onClick() {
|
|
76
|
-
onDelete(data === null || data === void 0 ? void 0 : data.id);
|
|
77
|
-
dispatch(setDeleteModalVisible(true));
|
|
78
|
-
}
|
|
79
|
-
}, /*#__PURE__*/React.createElement(DeleteIconQ, null)))));
|
|
58
|
+
}, /*#__PURE__*/React.createElement(EditIcon, null)))));
|
|
80
59
|
}
|
|
81
60
|
}];
|
|
82
61
|
};
|
|
@@ -9,7 +9,7 @@ import React from "react";
|
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import Cookies from "js-cookie";
|
|
11
11
|
import style from "../Questionnaires.module.scss";
|
|
12
|
-
import { Form, Layout, Select as AntdSelect } from "antd";
|
|
12
|
+
import { Form, Layout, Select as AntdSelect, TreeSelect } from "antd";
|
|
13
13
|
import { PlusIcon } from "../../../assets/icons";
|
|
14
14
|
import FormModal from "../../../components/FormModal";
|
|
15
15
|
import { useDispatch, useSelector } from "react-redux";
|
|
@@ -28,7 +28,7 @@ import Table from "../../../components/Table";
|
|
|
28
28
|
import Filter from "../../../components/Filter";
|
|
29
29
|
import { addEmployeeConfigurations,
|
|
30
30
|
// addEmployeeConfigurations,
|
|
31
|
-
deleteEmployeeConfigurations, editEmployeeConfigurations, employeeConfigurationsVisibility, getEmployeeConfigurations, getPositionsAll } from "../../../store/slices/questionnaire";
|
|
31
|
+
deleteEmployeeConfigurations, editEmployeeConfigurations, employeeConfigurationsVisibility, getEmployeeConfigurations, getGeneralStructuresAll, getPositionsAll } from "../../../store/slices/questionnaire";
|
|
32
32
|
import { getTransportEmployeesAll } from "../../../store/slices/employees";
|
|
33
33
|
import Select from "../../../components/Select";
|
|
34
34
|
var Option = AntdSelect.Option;
|
|
@@ -71,6 +71,9 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
71
71
|
var employeeConfigurations = useSelector(function (state) {
|
|
72
72
|
return state.questionnaire.employeeConfigurations;
|
|
73
73
|
});
|
|
74
|
+
var generalStructuresAll = useSelector(function (state) {
|
|
75
|
+
return state.questionnaire.generalStructuresAll;
|
|
76
|
+
});
|
|
74
77
|
var transportEmployeesAll = useSelector(function (state) {
|
|
75
78
|
return state.employees.transportEmployeesAll;
|
|
76
79
|
});
|
|
@@ -80,7 +83,7 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
80
83
|
var paginationLength = setPaginationLength(employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.count, employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.size);
|
|
81
84
|
var onSubmit = useCallback(/*#__PURE__*/function () {
|
|
82
85
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data_) {
|
|
83
|
-
var _data_$EmployeeIds, _data_$Positions, _data_$PersonInCharge, _data_$OperatingManag;
|
|
86
|
+
var _data_$EmployeeIds, _data_$Positions, _data_$PersonInCharge, _data_$GeneralStructu, _data_$OperatingManag;
|
|
84
87
|
var data;
|
|
85
88
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
86
89
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -89,7 +92,7 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
89
92
|
EmployeeIds: ((_data_$EmployeeIds = data_.EmployeeIds) !== null && _data_$EmployeeIds !== void 0 ? _data_$EmployeeIds : []).join(","),
|
|
90
93
|
Positions: ((_data_$Positions = data_.Positions) !== null && _data_$Positions !== void 0 ? _data_$Positions : []).join(","),
|
|
91
94
|
PersonInChargeForFuelIds: ((_data_$PersonInCharge = data_.PersonInChargeForFuelIds) !== null && _data_$PersonInCharge !== void 0 ? _data_$PersonInCharge : []).join(","),
|
|
92
|
-
GeneralStructures: "
|
|
95
|
+
GeneralStructures: ((_data_$GeneralStructu = data_.GeneralStructures) !== null && _data_$GeneralStructu !== void 0 ? _data_$GeneralStructu : []).join(","),
|
|
93
96
|
OperatingManagerIds: ((_data_$OperatingManag = data_.OperatingManagerIds) !== null && _data_$OperatingManag !== void 0 ? _data_$OperatingManag : []).join(",")
|
|
94
97
|
});
|
|
95
98
|
console.log(data);
|
|
@@ -105,10 +108,14 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
105
108
|
};
|
|
106
109
|
}(), [dispatch, typeSelect]);
|
|
107
110
|
var onEdit = useCallback(function (id, record) {
|
|
111
|
+
var _record$EmployeeIds, _record$Positions, _record$PersonInCharg, _record$GeneralStruct, _record$OperatingMana;
|
|
108
112
|
var data = {
|
|
109
113
|
id: id,
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
EmployeeIds: ((_record$EmployeeIds = record === null || record === void 0 ? void 0 : record.EmployeeIds) !== null && _record$EmployeeIds !== void 0 ? _record$EmployeeIds : []).join(","),
|
|
115
|
+
Positions: ((_record$Positions = record === null || record === void 0 ? void 0 : record.Positions) !== null && _record$Positions !== void 0 ? _record$Positions : []).join(","),
|
|
116
|
+
PersonInChargeForFuelIds: ((_record$PersonInCharg = record === null || record === void 0 ? void 0 : record.PersonInChargeForFuelIds) !== null && _record$PersonInCharg !== void 0 ? _record$PersonInCharg : []).join(","),
|
|
117
|
+
GeneralStructures: ((_record$GeneralStruct = record === null || record === void 0 ? void 0 : record.GeneralStructures) !== null && _record$GeneralStruct !== void 0 ? _record$GeneralStruct : []).join(","),
|
|
118
|
+
OperatingManagerIds: ((_record$OperatingMana = record === null || record === void 0 ? void 0 : record.OperatingManagerIds) !== null && _record$OperatingMana !== void 0 ? _record$OperatingMana : []).join(",")
|
|
112
119
|
};
|
|
113
120
|
dispatch(editEmployeeConfigurations(data));
|
|
114
121
|
}, [dispatch, typeSelect]);
|
|
@@ -128,6 +135,7 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
128
135
|
};
|
|
129
136
|
var onEditClick = useCallback(function (data) {
|
|
130
137
|
var _ref$current2;
|
|
138
|
+
console.log(data);
|
|
131
139
|
ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.setEdit(data);
|
|
132
140
|
}, []);
|
|
133
141
|
var onDelete = useCallback(function (id) {
|
|
@@ -176,6 +184,34 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
176
184
|
return person ? "".concat(person.name, " ").concat(person.surname, " ").concat(person.patronymic) : "";
|
|
177
185
|
}).filter(Boolean).join(", ");
|
|
178
186
|
};
|
|
187
|
+
var formatGeneralStructures = function formatGeneralStructures(ids) {
|
|
188
|
+
if (!Array.isArray(ids)) {
|
|
189
|
+
if (typeof ids === "string") {
|
|
190
|
+
ids = ids.split(",").map(function (id) {
|
|
191
|
+
return parseInt(id.trim(), 10);
|
|
192
|
+
});
|
|
193
|
+
} else {
|
|
194
|
+
return "";
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var _flatten = function flatten(nodes) {
|
|
198
|
+
return nodes.reduce(function (acc, node) {
|
|
199
|
+
var _node$children;
|
|
200
|
+
acc.push(node);
|
|
201
|
+
if ((_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length) {
|
|
202
|
+
acc = acc.concat(_flatten(node.children));
|
|
203
|
+
}
|
|
204
|
+
return acc;
|
|
205
|
+
}, []);
|
|
206
|
+
};
|
|
207
|
+
var flatList = _flatten(generalStructuresAll || []);
|
|
208
|
+
return ids.map(function (id) {
|
|
209
|
+
var node = flatList.find(function (n) {
|
|
210
|
+
return n.id === id;
|
|
211
|
+
});
|
|
212
|
+
return (node === null || node === void 0 ? void 0 : node.name) || "";
|
|
213
|
+
}).filter(Boolean).join(", ");
|
|
214
|
+
};
|
|
179
215
|
var formatPositionNames = function formatPositionNames(ids) {
|
|
180
216
|
if (!Array.isArray(ids)) {
|
|
181
217
|
if (typeof ids === "string") {
|
|
@@ -187,27 +223,67 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
187
223
|
}
|
|
188
224
|
}
|
|
189
225
|
return ids.map(function (id) {
|
|
190
|
-
var pos = positionsAll.find(function (p) {
|
|
226
|
+
var pos = positionsAll === null || positionsAll === void 0 ? void 0 : positionsAll.find(function (p) {
|
|
191
227
|
return p.id === id;
|
|
192
228
|
});
|
|
193
229
|
return pos ? pos.name : "";
|
|
194
230
|
}).filter(Boolean).join(", ");
|
|
195
231
|
};
|
|
232
|
+
var toArray = function toArray(value) {
|
|
233
|
+
if (!value) return [];
|
|
234
|
+
if (Array.isArray(value)) return value;
|
|
235
|
+
if (typeof value === "string") {
|
|
236
|
+
return value.split(",").map(function (id) {
|
|
237
|
+
return parseInt(id.trim(), 10);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return [];
|
|
241
|
+
};
|
|
196
242
|
return {
|
|
197
243
|
num: (employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.size) * (employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.page) + i + 1 - (employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.size),
|
|
198
244
|
id: dataObj === null || dataObj === void 0 ? void 0 : dataObj.id,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
245
|
+
EmployeeIds1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.employeeIds),
|
|
246
|
+
GeneralStructures1: formatGeneralStructures(dataObj === null || dataObj === void 0 ? void 0 : dataObj.generalStructures),
|
|
247
|
+
OperatingManagerIds1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.operatingManagerIds),
|
|
248
|
+
PersonInChargeForFuelIds1: formatNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.personInChargeForFuelIds),
|
|
249
|
+
Positions1: formatPositionNames(dataObj === null || dataObj === void 0 ? void 0 : dataObj.positions),
|
|
250
|
+
EmployeeIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.employeeIds),
|
|
251
|
+
GeneralStructures: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.generalStructures),
|
|
252
|
+
OperatingManagerIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.operatingManagerIds),
|
|
253
|
+
PersonInChargeForFuelIds: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.personInChargeForFuelIds),
|
|
254
|
+
Positions: toArray(dataObj === null || dataObj === void 0 ? void 0 : dataObj.positions),
|
|
204
255
|
isActive: dataObj === null || dataObj === void 0 ? void 0 : dataObj.isActive,
|
|
205
256
|
className: "rowClassName1"
|
|
206
257
|
};
|
|
207
258
|
});
|
|
208
259
|
}
|
|
260
|
+
var _convertToTreeData = function convertToTreeData(nodes) {
|
|
261
|
+
return nodes.map(function (node) {
|
|
262
|
+
var _node$children2;
|
|
263
|
+
return {
|
|
264
|
+
title: node.name,
|
|
265
|
+
value: node.id,
|
|
266
|
+
key: node.id,
|
|
267
|
+
children: (_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length ? _convertToTreeData(node.children) : undefined
|
|
268
|
+
};
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
var treeData = useMemo(function () {
|
|
272
|
+
if (!generalStructuresAll || !Array.isArray(generalStructuresAll)) return [];
|
|
273
|
+
var _convertToTreeData2 = function convertToTreeData(nodes) {
|
|
274
|
+
return nodes.map(function (node) {
|
|
275
|
+
return {
|
|
276
|
+
title: node.name,
|
|
277
|
+
value: node.id,
|
|
278
|
+
key: node.id,
|
|
279
|
+
children: node.children && node.children.length > 0 ? _convertToTreeData2(node.children) : undefined
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
return _convertToTreeData2(generalStructuresAll);
|
|
284
|
+
}, [generalStructuresAll]);
|
|
209
285
|
var columns = useMemo(function () {
|
|
210
|
-
return getStreetColumns(onEditClick,
|
|
286
|
+
return getStreetColumns(onEditClick, dispatch);
|
|
211
287
|
}, [onEditClick, onDelete, onStatusChange, dispatch]);
|
|
212
288
|
var _useState13 = useState(columns.map(function (col) {
|
|
213
289
|
return col.dataIndex;
|
|
@@ -235,6 +311,7 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
235
311
|
dispatch(getPositionsAll({
|
|
236
312
|
visibility: "nondeleted"
|
|
237
313
|
}));
|
|
314
|
+
dispatch(getGeneralStructuresAll());
|
|
238
315
|
}, [dispatch]);
|
|
239
316
|
var updateSize = function updateSize(newSize) {
|
|
240
317
|
setSize(newSize); // Update state
|
|
@@ -267,10 +344,10 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
267
344
|
className: style.content
|
|
268
345
|
}, /*#__PURE__*/React.createElement("header", {
|
|
269
346
|
className: style.header
|
|
270
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
347
|
+
}, (employeeConfigurations === null || employeeConfigurations === void 0 ? void 0 : employeeConfigurations.count) === 0 ? /*#__PURE__*/React.createElement(Button, {
|
|
271
348
|
onClick: onClickModal,
|
|
272
349
|
color: "green"
|
|
273
|
-
},
|
|
350
|
+
}, /*#__PURE__*/React.createElement(PlusIcon, null), " Soraq\xE7a \u0259lav\u0259 et") : /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement(Filter, {
|
|
274
351
|
columns: columns,
|
|
275
352
|
selectedColumns: selectedColumns,
|
|
276
353
|
setQuery: setQuery,
|
|
@@ -317,17 +394,19 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
317
394
|
centered: false
|
|
318
395
|
}, /*#__PURE__*/React.createElement(Item, {
|
|
319
396
|
rules: [{
|
|
320
|
-
required:
|
|
397
|
+
required: false,
|
|
321
398
|
message: ""
|
|
322
399
|
}],
|
|
323
400
|
name: "EmployeeIds",
|
|
324
401
|
label: "Heyyət üzvü"
|
|
325
402
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
326
|
-
mode: "multiple"
|
|
403
|
+
mode: "multiple",
|
|
404
|
+
labelInValue: true
|
|
327
405
|
}, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
|
|
328
406
|
return /*#__PURE__*/React.createElement(Option, {
|
|
329
407
|
key: item.id,
|
|
330
|
-
value: item.id
|
|
408
|
+
value: item.id,
|
|
409
|
+
label: "".concat(item.name, " ").concat(item.surname)
|
|
331
410
|
}, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
|
|
332
411
|
}))), /*#__PURE__*/React.createElement(Item, {
|
|
333
412
|
rules: [{
|
|
@@ -336,8 +415,17 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
336
415
|
}],
|
|
337
416
|
name: "GeneralStructures",
|
|
338
417
|
label: "Struktur vahidi"
|
|
339
|
-
}, /*#__PURE__*/React.createElement(
|
|
340
|
-
|
|
418
|
+
}, /*#__PURE__*/React.createElement(TreeSelect, {
|
|
419
|
+
className: style.tree_select,
|
|
420
|
+
dropdownStyle: {
|
|
421
|
+
maxHeight: 400,
|
|
422
|
+
overflow: "auto"
|
|
423
|
+
},
|
|
424
|
+
placeholder: "",
|
|
425
|
+
allowClear: true,
|
|
426
|
+
multiple: true,
|
|
427
|
+
treeDefaultExpandAll: true,
|
|
428
|
+
treeData: treeData
|
|
341
429
|
})), /*#__PURE__*/React.createElement(Item, {
|
|
342
430
|
rules: [{
|
|
343
431
|
required: false,
|
|
@@ -350,11 +438,12 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
350
438
|
}, positionsAll === null || positionsAll === void 0 ? void 0 : positionsAll.map(function (item) {
|
|
351
439
|
return /*#__PURE__*/React.createElement(Option, {
|
|
352
440
|
key: item.id,
|
|
353
|
-
value: item.id
|
|
441
|
+
value: item.id,
|
|
442
|
+
label: "".concat(item.name)
|
|
354
443
|
}, "".concat(item.name));
|
|
355
444
|
}))), /*#__PURE__*/React.createElement(Item, {
|
|
356
445
|
rules: [{
|
|
357
|
-
required:
|
|
446
|
+
required: false,
|
|
358
447
|
message: ""
|
|
359
448
|
}],
|
|
360
449
|
name: "PersonInChargeForFuelIds",
|
|
@@ -364,11 +453,12 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
364
453
|
}, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
|
|
365
454
|
return /*#__PURE__*/React.createElement(Option, {
|
|
366
455
|
key: item.id,
|
|
367
|
-
value: item.id
|
|
456
|
+
value: item.id,
|
|
457
|
+
label: "".concat(item.name, " ").concat(item.surname)
|
|
368
458
|
}, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
|
|
369
459
|
}))), /*#__PURE__*/React.createElement(Item, {
|
|
370
460
|
rules: [{
|
|
371
|
-
required:
|
|
461
|
+
required: false,
|
|
372
462
|
message: ""
|
|
373
463
|
}],
|
|
374
464
|
name: "OperatingManagerIds",
|
|
@@ -378,7 +468,8 @@ var QuestionnairesEmployeeConfigurations = function QuestionnairesEmployeeConfig
|
|
|
378
468
|
}, transportEmployeesAll === null || transportEmployeesAll === void 0 ? void 0 : transportEmployeesAll.map(function (item) {
|
|
379
469
|
return /*#__PURE__*/React.createElement(Option, {
|
|
380
470
|
key: item.id,
|
|
381
|
-
value: item.id
|
|
471
|
+
value: item.id,
|
|
472
|
+
label: "".concat(item.name, " ").concat(item.surname)
|
|
382
473
|
}, "".concat(item.name, " ").concat(item.surname, " ").concat(item.patronymic, ", ").concat(item.generalStructureName, ", ").concat(item.positionName));
|
|
383
474
|
})))), /*#__PURE__*/React.createElement(DeleteModal, {
|
|
384
475
|
onCancel: function onCancel() {
|