@uniai-fe/uds-templates 0.6.21 → 0.6.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-templates",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "description": "UNIAI Design System; UI Templates Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -29,6 +29,7 @@ import { cctvRtcLiveRegistryAtom } from "../jotai/rtc";
29
29
  * isError, // 데이터 로딩 에러 상태
30
30
  * username, // 현재 사용자 계정 아이디
31
31
  * searchedKeyword, // 현재 검색어
32
+ * selectedGroupCode, // 선택된 업체가 속한 사육그룹 코드
32
33
  * selectedCompanyId, // 선택된 회사 ID
33
34
  * selectedCamId, // 선택된 카메라 ID
34
35
  * selectedCompany, // 선택된 회사 데이터
@@ -139,6 +140,9 @@ export default function useCctvContext(): UseCctvContextReturn {
139
140
  [selectedCompanyId, groups],
140
141
  );
141
142
 
143
+ // 현재 선택된 업체가 속한 그룹 코드를 계산한다.
144
+ const selectedGroupCode = selectedCompany?.group_code;
145
+
142
146
  // 선택된 회사의 카메라 리스트를 평탄화해 반환한다.
143
147
  const cams = useMemo(
144
148
  (): CctvCompanyCameraList[] => getCamList(groups, selectedCompanyId),
@@ -179,6 +183,7 @@ export default function useCctvContext(): UseCctvContextReturn {
179
183
  isError,
180
184
  username,
181
185
  searchedKeyword,
186
+ selectedGroupCode,
182
187
  selectedCompanyId,
183
188
  selectedCamId,
184
189
  selectedCompany,
@@ -165,6 +165,7 @@ export interface UseCctvCompanyDataReturn extends Omit<
165
165
  * @property {boolean} isError 데이터 로딩 에러 상태
166
166
  * @property {string} username 현재 사용자 계정 아이디
167
167
  * @property {string} searchedKeyword 현재 검색어
168
+ * @property {string | undefined} selectedGroupCode 선택된 업체가 속한 사육그룹 코드
168
169
  * @property {string | undefined} selectedCompanyId 선택된 업체 ID
169
170
  * @property {string | undefined} selectedCamId 선택된 카메라 ID
170
171
  * @property {CctvCompanyGroupItems | undefined} selectedCompany 선택된 업체 데이터
@@ -194,6 +195,10 @@ export interface UseCctvContextReturn extends UseFormReturn<CctvBaseContext> {
194
195
  * 현재 검색어
195
196
  */
196
197
  searchedKeyword: string;
198
+ /**
199
+ * 선택된 업체가 속한 사육그룹 코드
200
+ */
201
+ selectedGroupCode: string | undefined;
197
202
  /**
198
203
  * 선택된 업체 ID
199
204
  */
@@ -67,6 +67,7 @@ export interface CctvCompanyCameraList extends CctvCompanyCameraData {
67
67
  * @property {string} renderKey 렌더링 unique key
68
68
  * @property {boolean} selected 업체 선택 현황
69
69
  * @property {Function} [onSelect] 업체 선택 콜백 이벤트
70
+ * @property {string} group_code 업체가 속한 사육그룹 코드
70
71
  * @property {string} company_id 업체 id코드 (a.k.a site)
71
72
  * @property {string} company_name 업체명
72
73
  * @property {API_Res_CctvCompanyCameraList[]} cam_list 설치된 카메라 목록
@@ -77,6 +78,10 @@ export interface CctvCompanyGroupItems extends API_Res_CctvCompanyList {
77
78
  * 렌더링 unique key
78
79
  */
79
80
  renderKey: string;
81
+ /**
82
+ * 업체가 속한 사육그룹 코드
83
+ */
84
+ group_code: string;
80
85
  /**
81
86
  * 설치된 카메라 목록
82
87
  */
@@ -23,6 +23,7 @@ export function initCompanyList({
23
23
  return {
24
24
  ...d,
25
25
  renderKey: companyRenderKey,
26
+ group_code: group.group_code,
26
27
  selected: group_index === 0,
27
28
  cam_list: d.cam_list.map(
28
29
  (cam): CctvCompanyCameraList => ({