세금 계산서 및 달력 월 형태 수정
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||||
|
import { resultify } from '@/shared/lib/resultify';
|
||||||
|
import { NiceAxiosError } from '@/shared/@types/error';
|
||||||
|
import {
|
||||||
|
BusinessPropertyByMidParams,
|
||||||
|
BusinessPropertyByMidResponse
|
||||||
|
} from '../model/types';
|
||||||
|
import {
|
||||||
|
useMutation,
|
||||||
|
UseMutationOptions
|
||||||
|
} from '@tanstack/react-query';
|
||||||
|
|
||||||
|
export const businessPropertyByMid = (params: BusinessPropertyByMidParams) => {
|
||||||
|
return resultify(
|
||||||
|
axios.post<BusinessPropertyByMidResponse>(API_URL_USER.businessPropertyByMid(), params),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useBusinessPropertyByMidMutation = (options?: UseMutationOptions<BusinessPropertyByMidResponse, NiceAxiosError, BusinessPropertyByMidParams>) => {
|
||||||
|
const mutation = useMutation<BusinessPropertyByMidResponse, NiceAxiosError, BusinessPropertyByMidParams>({
|
||||||
|
...options,
|
||||||
|
mutationFn: (params: BusinessPropertyByMidParams) => businessPropertyByMid(params),
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...mutation,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
import { lens } from '@dhmk/zustand-lens';
|
import { lens } from '@dhmk/zustand-lens';
|
||||||
import { SetStateAction } from 'react';
|
import { SetStateAction } from 'react';
|
||||||
import { UserFavorite, UserInfo } from './types';
|
import { BusinessInfo, UserFavorite, UserInfo } from './types';
|
||||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
import { StorageKeys } from '@/shared/constants/local-storage';
|
||||||
|
|
||||||
export interface UserInfoState {
|
export interface UserInfoState {
|
||||||
userInfo: UserInfo;
|
userInfo: UserInfo;
|
||||||
setUserInfo: (update: SetStateAction<Partial<UserInfo>>) => void;
|
setUserInfo: (update: SetStateAction<Partial<UserInfo>>) => void;
|
||||||
resetUserInfo: () => void;
|
resetUserInfo: () => void;
|
||||||
|
businessInfo: BusinessInfo;
|
||||||
|
setBusinessInfo: (update: SetStateAction<Partial<BusinessInfo>>) => void;
|
||||||
|
|
||||||
userFavorite: Array<UserFavorite>;
|
userFavorite: Array<UserFavorite>;
|
||||||
setUserFavorite: (update: SetStateAction<Array<UserFavorite>>) => void;
|
setUserFavorite: (update: SetStateAction<Array<UserFavorite>>) => void;
|
||||||
userMids: Array<string>;
|
userMids: Array<string>;
|
||||||
@@ -21,6 +24,7 @@ export interface UserInfoState {
|
|||||||
|
|
||||||
const initialUserInfoState = {
|
const initialUserInfoState = {
|
||||||
userInfo: {} as UserInfo,
|
userInfo: {} as UserInfo,
|
||||||
|
businessInfo: {} as BusinessInfo,
|
||||||
userFavorite: [] as Array<UserFavorite>,
|
userFavorite: [] as Array<UserFavorite>,
|
||||||
userMids: [] as Array<string>,
|
userMids: [] as Array<string>,
|
||||||
selectOptionsMids: [] as Array<Record<string, string>>,
|
selectOptionsMids: [] as Array<Record<string, string>>,
|
||||||
@@ -43,6 +47,19 @@ export const createUserInfoStore = lens<UserInfoState>((set, get) => ({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
setBusinessInfo: (update) => {
|
||||||
|
set((state: UserInfoState) => {
|
||||||
|
const newBusinessInfo = (typeof update === 'function')
|
||||||
|
? update(state.businessInfo): update;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
businessInfo: {
|
||||||
|
...state.businessInfo,
|
||||||
|
...newBusinessInfo
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
resetUserInfo: () => {
|
resetUserInfo: () => {
|
||||||
window.localStorage.removeItem(StorageKeys.TokenType);
|
window.localStorage.removeItem(StorageKeys.TokenType);
|
||||||
window.localStorage.removeItem(StorageKeys.AccessToken);
|
window.localStorage.removeItem(StorageKeys.AccessToken);
|
||||||
|
|||||||
@@ -260,3 +260,14 @@ export interface ShortcutUserResponse {
|
|||||||
shortcuts: Array<Shortcuts>;
|
shortcuts: Array<Shortcuts>;
|
||||||
usingDefault: boolean;
|
usingDefault: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface BusinessPropertyByMidParams {
|
||||||
|
mid: string;
|
||||||
|
};
|
||||||
|
export interface BusinessPropertyByMidResponse {
|
||||||
|
companyNumber: string;
|
||||||
|
businessScaleTypeName: string;
|
||||||
|
};
|
||||||
|
export interface BusinessInfo extends BusinessPropertyByMidResponse {
|
||||||
|
|
||||||
|
};
|
||||||
@@ -26,8 +26,8 @@ export enum VatReturnTargetType {
|
|||||||
|
|
||||||
export interface VatReturnListParams {
|
export interface VatReturnListParams {
|
||||||
mid: string;
|
mid: string;
|
||||||
startDate?: string;
|
startMonth?: string;
|
||||||
endDate?: string;
|
endMonth?: string;
|
||||||
receiptType?: VatReturnReceiptType;
|
receiptType?: VatReturnReceiptType;
|
||||||
targetType?: VatReturnTargetType;
|
targetType?: VatReturnTargetType;
|
||||||
page?: DefaultRequestPagination;
|
page?: DefaultRequestPagination;
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ export interface ListFilterProps {
|
|||||||
filterOn: boolean;
|
filterOn: boolean;
|
||||||
setFilterOn: (filterOn: boolean) => void;
|
setFilterOn: (filterOn: boolean) => void;
|
||||||
mid: string;
|
mid: string;
|
||||||
startDate: string;
|
startMonth: string;
|
||||||
endDate: string;
|
endMonth: string;
|
||||||
receiptType: VatReturnReceiptType;
|
receiptType: VatReturnReceiptType;
|
||||||
targetType: VatReturnTargetType;
|
targetType: VatReturnTargetType;
|
||||||
setMid: (mid: string) => void;
|
setMid: (mid: string) => void;
|
||||||
setStartDate: (date: string) => void;
|
setStartMonth: (startMonth: string) => void;
|
||||||
setEndDate: (date: string) => void;
|
setEndMonth: (endMonth: string) => void;
|
||||||
setReceiptType: (receiptType: VatReturnReceiptType) => void;
|
setReceiptType: (receiptType: VatReturnReceiptType) => void;
|
||||||
setTargetType: (targetType: VatReturnTargetType) => void;
|
setTargetType: (targetType: VatReturnTargetType) => void;
|
||||||
};
|
};
|
||||||
@@ -28,20 +28,20 @@ export const ListFilter = ({
|
|||||||
filterOn,
|
filterOn,
|
||||||
setFilterOn,
|
setFilterOn,
|
||||||
mid,
|
mid,
|
||||||
startDate,
|
startMonth,
|
||||||
endDate,
|
endMonth,
|
||||||
receiptType,
|
receiptType,
|
||||||
targetType,
|
targetType,
|
||||||
setMid,
|
setMid,
|
||||||
setStartDate,
|
setStartMonth,
|
||||||
setEndDate,
|
setEndMonth,
|
||||||
setReceiptType,
|
setReceiptType,
|
||||||
setTargetType
|
setTargetType
|
||||||
}: ListFilterProps) => {
|
}: ListFilterProps) => {
|
||||||
|
|
||||||
const [filterMid, setFilterMid] = useState<string>(mid);
|
const [filterMid, setFilterMid] = useState<string>(mid);
|
||||||
const [filterStartDate, setFilterStartDate] = useState<string>(startDate);
|
const [filterStartMonth, setFilterStartMonth] = useState<string>(startMonth);
|
||||||
const [filterEndDate, setFilterEndDate] = useState<string>(endDate);
|
const [filterEndMonth, setFilterEndMonth] = useState<string>(endMonth);
|
||||||
const [filterReceiptType, setFIlterReceiptType] = useState<VatReturnReceiptType>(receiptType);
|
const [filterReceiptType, setFIlterReceiptType] = useState<VatReturnReceiptType>(receiptType);
|
||||||
const [filterTargetType, setFilterTargetType] = useState<VatReturnTargetType>(targetType);
|
const [filterTargetType, setFilterTargetType] = useState<VatReturnTargetType>(targetType);
|
||||||
|
|
||||||
@@ -53,8 +53,8 @@ export const ListFilter = ({
|
|||||||
|
|
||||||
const onClickToSetFilter = () => {
|
const onClickToSetFilter = () => {
|
||||||
setMid(filterMid);
|
setMid(filterMid);
|
||||||
setStartDate(filterStartDate);
|
setStartMonth(filterStartMonth);
|
||||||
setEndDate(filterEndDate);
|
setEndMonth(filterEndMonth);
|
||||||
setReceiptType(filterReceiptType);
|
setReceiptType(filterReceiptType);
|
||||||
setTargetType(filterTargetType);
|
setTargetType(filterTargetType);
|
||||||
onClickToClose();
|
onClickToClose();
|
||||||
@@ -95,10 +95,10 @@ export const ListFilter = ({
|
|||||||
></FilterSelect>
|
></FilterSelect>
|
||||||
<FilterCalendarMonth
|
<FilterCalendarMonth
|
||||||
title='발행월'
|
title='발행월'
|
||||||
startMonth={ filterStartDate }
|
startMonth={ filterStartMonth }
|
||||||
endMonth={ filterEndDate }
|
endMonth={ filterEndMonth }
|
||||||
setStartMonth={ setFilterStartDate }
|
setStartMonth={ setFilterStartMonth }
|
||||||
setEndMonth={ setFilterEndDate }
|
setEndMonth={ setFilterEndMonth }
|
||||||
></FilterCalendarMonth>
|
></FilterCalendarMonth>
|
||||||
<FilterButtonGroups
|
<FilterButtonGroups
|
||||||
title='영수구분'
|
title='영수구분'
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
import { useVatReturnListMutation } from '../api/use-vat-return-list-mutation';
|
import { useVatReturnListMutation } from '../api/use-vat-return-list-mutation';
|
||||||
import { ListDateGroup } from './list-date-group';
|
import { ListDateGroup } from './list-date-group';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
|
import { EmailBottomSheet } from '@/entities/common/ui/email-bottom-sheet';
|
||||||
|
|
||||||
export const ListWrap = () => {
|
export const ListWrap = () => {
|
||||||
const userMid = useStore.getState().UserStore.mid;
|
const userMid = useStore.getState().UserStore.mid;
|
||||||
@@ -25,11 +26,13 @@ export const ListWrap = () => {
|
|||||||
const [listItems, setListItems] = useState<Array<VatReturnListContent>>([]);
|
const [listItems, setListItems] = useState<Array<VatReturnListContent>>([]);
|
||||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||||
const [mid, setMid] = useState<string>(userMid);
|
const [mid, setMid] = useState<string>(userMid);
|
||||||
const [startDate, setStartDate] = useState(moment().subtract(1, 'month').format('YYYYMM'));
|
const [startMonth, setStartMonth] = useState<string>(moment().subtract(1, 'month').format('YYYYMM'));
|
||||||
const [endDate, setEndDate] = useState(moment().format('YYYYMM'));
|
const [endMonth, setEndMonth] = useState<string>(moment().format('YYYYMM'));
|
||||||
const [receiptType, setReceiptType] = useState<VatReturnReceiptType>(VatReturnReceiptType.ALL);
|
const [receiptType, setReceiptType] = useState<VatReturnReceiptType>(VatReturnReceiptType.ALL);
|
||||||
const [targetType, setTargetType] = useState<VatReturnTargetType>(VatReturnTargetType.ALL);
|
const [targetType, setTargetType] = useState<VatReturnTargetType>(VatReturnTargetType.ALL);
|
||||||
|
|
||||||
|
const [emailBottomSheetOn, setEmailBottomSheetOn] = useState<boolean>(false);
|
||||||
|
|
||||||
const { mutateAsync: vatReturnList } = useVatReturnListMutation();
|
const { mutateAsync: vatReturnList } = useVatReturnListMutation();
|
||||||
|
|
||||||
const callList = (option?: {
|
const callList = (option?: {
|
||||||
@@ -37,8 +40,8 @@ export const ListWrap = () => {
|
|||||||
}) => {
|
}) => {
|
||||||
let params: VatReturnListParams = {
|
let params: VatReturnListParams = {
|
||||||
mid: mid,
|
mid: mid,
|
||||||
startDate: startDate,
|
startMonth: startMonth,
|
||||||
endDate: endDate,
|
endMonth: endMonth,
|
||||||
receiptType: receiptType,
|
receiptType: receiptType,
|
||||||
targetType: targetType,
|
targetType: targetType,
|
||||||
page: pageParam
|
page: pageParam
|
||||||
@@ -59,10 +62,19 @@ export const ListWrap = () => {
|
|||||||
const onClickToSort = (sort: SortTypeKeys) => {
|
const onClickToSort = (sort: SortTypeKeys) => {
|
||||||
setSortType(sort);
|
setSortType(sort);
|
||||||
};
|
};
|
||||||
|
const onClickToDownloadExcel = () => {
|
||||||
|
setEmailBottomSheetOn(true);
|
||||||
|
};
|
||||||
|
const onRequestDownloadExcel = (userEmail?: string) => {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callList();
|
callList();
|
||||||
}, [mid, startDate, endDate, receiptType, targetType]);
|
}, [
|
||||||
|
mid, startMonth, endMonth,
|
||||||
|
receiptType, targetType
|
||||||
|
]);
|
||||||
|
|
||||||
const getListDateGroup = () => {
|
const getListDateGroup = () => {
|
||||||
let rs = [];
|
let rs = [];
|
||||||
@@ -115,7 +127,7 @@ export const ListWrap = () => {
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="credit-period"
|
className="credit-period"
|
||||||
value={ moment(startDate+'01').format('YYYY.MM') + '-' + moment(endDate+'01').format('YYYY.MM')}
|
value={ moment(startMonth+'01').format('YYYY.MM') + '-' + moment(endMonth+'01').format('YYYY.MM')}
|
||||||
readOnly={ true }
|
readOnly={ true }
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
@@ -132,6 +144,7 @@ export const ListWrap = () => {
|
|||||||
<img
|
<img
|
||||||
src={ IMAGE_ROOT + '/ico_download.svg' }
|
src={ IMAGE_ROOT + '/ico_download.svg' }
|
||||||
alt="다운로드"
|
alt="다운로드"
|
||||||
|
onClick={ onClickToDownloadExcel }
|
||||||
/>
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -149,16 +162,25 @@ export const ListWrap = () => {
|
|||||||
filterOn={ filterOn }
|
filterOn={ filterOn }
|
||||||
setFilterOn={ setFilterOn }
|
setFilterOn={ setFilterOn }
|
||||||
mid={ mid }
|
mid={ mid }
|
||||||
startDate={ startDate }
|
startMonth={ startMonth }
|
||||||
endDate={ endDate }
|
endMonth={ endMonth }
|
||||||
receiptType={ receiptType }
|
receiptType={ receiptType }
|
||||||
targetType={ targetType }
|
targetType={ targetType }
|
||||||
setMid={ setMid }
|
setMid={ setMid }
|
||||||
setStartDate={ setStartDate }
|
setStartMonth={ setStartMonth }
|
||||||
setEndDate={ setEndDate }
|
setEndMonth={ setEndMonth }
|
||||||
setReceiptType={ setReceiptType }
|
setReceiptType={ setReceiptType }
|
||||||
setTargetType={ setTargetType }
|
setTargetType={ setTargetType }
|
||||||
></ListFilter>
|
></ListFilter>
|
||||||
|
{ !!emailBottomSheetOn &&
|
||||||
|
<EmailBottomSheet
|
||||||
|
bottomSheetOn={ emailBottomSheetOn }
|
||||||
|
setBottomSheetOn={ setEmailBottomSheetOn }
|
||||||
|
imageSave={ false }
|
||||||
|
sendEmail={ true }
|
||||||
|
sendRequest={ onRequestDownloadExcel }
|
||||||
|
></EmailBottomSheet>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -57,5 +57,10 @@ export const API_URL_USER = {
|
|||||||
shortcutUser: () => {
|
shortcutUser: () => {
|
||||||
// 사용자 바로가기 메뉴 조회
|
// 사용자 바로가기 메뉴 조회
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/shortcut/user`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/shortcut/user`;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// mid 로 사업자 정보 조회
|
||||||
|
businessPropertyByMid: () => {
|
||||||
|
return `${API_BASE_URL}/api/v1/amsw/business-property/by-mid`;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
@@ -25,10 +25,10 @@ const NiceCalendarMonth = ({
|
|||||||
calendarType,
|
calendarType,
|
||||||
setNewMonth
|
setNewMonth
|
||||||
}: NiceCalendarProps) => {
|
}: NiceCalendarProps) => {
|
||||||
const [valueMonth, setValueMonth] = useState<string>();
|
const [valueYear, setValueYear] = useState<string>();
|
||||||
const [minMonth, setMinMonth] = useState<Date | undefined>();
|
const [minMonth, setMinMonth] = useState<Date | undefined>();
|
||||||
const [maxMonth, setMaxMonth] = useState<Date | undefined>();
|
const [maxMonth, setMaxMonth] = useState<Date | undefined>();
|
||||||
const onchangeToMonth = (selectedMonth: any) => {
|
const onChangeToMonth = (selectedMonth: any) => {
|
||||||
setNewMonth(moment(selectedMonth).format('YYYY.MM'));
|
setNewMonth(moment(selectedMonth).format('YYYY.MM'));
|
||||||
setCalendarOpen(false);
|
setCalendarOpen(false);
|
||||||
};
|
};
|
||||||
@@ -42,17 +42,17 @@ const NiceCalendarMonth = ({
|
|||||||
if(!!endMonth){
|
if(!!endMonth){
|
||||||
setMaxMonth(new Date(endMonth));
|
setMaxMonth(new Date(endMonth));
|
||||||
}
|
}
|
||||||
setValueMonth(startMonth);
|
setValueYear(startMonth?.substring(0, 4));
|
||||||
}
|
}
|
||||||
else if(calendarType === CalendarType.End){
|
else if(calendarType === CalendarType.End){
|
||||||
if(!!startMonth){
|
if(!!startMonth){
|
||||||
setMinMonth(new Date(startMonth));
|
setMinMonth(new Date(startMonth));
|
||||||
}
|
}
|
||||||
setMaxMonth(new Date());
|
setMaxMonth(new Date());
|
||||||
setValueMonth(endMonth);
|
setValueYear(endMonth?.substring(0, 4));
|
||||||
}
|
}
|
||||||
else if(calendarType === CalendarType.Single){
|
else if(calendarType === CalendarType.Single){
|
||||||
setValueMonth(singleMonth);
|
setValueYear(singleMonth?.substring(0,4));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ const NiceCalendarMonth = ({
|
|||||||
<Calendar
|
<Calendar
|
||||||
minDate={ minMonth }
|
minDate={ minMonth }
|
||||||
maxDate={ maxMonth }
|
maxDate={ maxMonth }
|
||||||
onClickMonth={ onchangeToMonth }
|
onClickMonth={ onChangeToMonth }
|
||||||
value={ valueMonth }
|
value={ valueYear }
|
||||||
formatMonthYear={ formatMonthYear }
|
formatMonthYear={ formatMonthYear }
|
||||||
formatYear= { formatYear }
|
formatYear= { formatYear }
|
||||||
formatMonth={ formmatMonth }
|
formatMonth={ formmatMonth }
|
||||||
|
|||||||
@@ -66,10 +66,10 @@ export const FilterCalendarMonth = ({
|
|||||||
const setNewMonth = (month: string) => {
|
const setNewMonth = (month: string) => {
|
||||||
console.log(month)
|
console.log(month)
|
||||||
if(calendarType === CalendarType.Start){
|
if(calendarType === CalendarType.Start){
|
||||||
setStartMonth(month);
|
setStartMonth(moment(month+'.01').format('YYYYMM'));
|
||||||
}
|
}
|
||||||
else if(calendarType === CalendarType.End){
|
else if(calendarType === CalendarType.End){
|
||||||
setEndMonth(month);
|
setEndMonth(moment(month+'.01').format('YYYYMM'));
|
||||||
}
|
}
|
||||||
setCalendarOpen(false);
|
setCalendarOpen(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,11 @@ import { useStore } from '@/shared/model/store';
|
|||||||
import { getLocalStorage, setLocalStorage } from '@/shared/lib';
|
import { getLocalStorage, setLocalStorage } from '@/shared/lib';
|
||||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
import { StorageKeys } from '@/shared/constants/local-storage';
|
||||||
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
import { HomeGroupsParams, HomeGroupsResponse } from '@/entities/home/model/types';
|
||||||
import { LoginResponse, ShortcutUserParams, ShortcutUserResponse } from '@/entities/user/model/types';
|
import { BusinessPropertyByMidParams, BusinessPropertyByMidResponse, LoginResponse, ShortcutUserParams, ShortcutUserResponse } from '@/entities/user/model/types';
|
||||||
import { useCodesListByCodeClMutation } from '@/entities/common/api/use-codes-list-by-codeCl-mutaion';
|
import { useCodesListByCodeClMutation } from '@/entities/common/api/use-codes-list-by-codeCl-mutaion';
|
||||||
import { useShortcutUserMutation } from '@/entities/user/api/use-shortcut-user-mutation';
|
import { useShortcutUserMutation } from '@/entities/user/api/use-shortcut-user-mutation';
|
||||||
import { useShortcutDefaultMutation } from '@/entities/user/api/use-shortcut-detault-mutation';
|
import { useShortcutDefaultMutation } from '@/entities/user/api/use-shortcut-detault-mutation';
|
||||||
|
import { useBusinessPropertyByMidMutation } from '@/entities/user/api/use-business-property-by-mid-mutation';
|
||||||
|
|
||||||
export interface ContextType {
|
export interface ContextType {
|
||||||
setOnBack: (onBack: () => void) => void;
|
setOnBack: (onBack: () => void) => void;
|
||||||
@@ -56,12 +57,14 @@ export const SubLayout = () => {
|
|||||||
const [favoriteEdit, setFavoriteEdit] = useState<boolean>(false);
|
const [favoriteEdit, setFavoriteEdit] = useState<boolean>(false);
|
||||||
const [headerNavigationKey, setHeaderNavigationKey] = useState<number>(1);
|
const [headerNavigationKey, setHeaderNavigationKey] = useState<number>(1);
|
||||||
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
||||||
|
const [mid, setMid] = useState<string>();
|
||||||
|
|
||||||
const { isNativeEnvironment } = useAppBridge();
|
const { isNativeEnvironment } = useAppBridge();
|
||||||
const { mutateAsync: homeGroups } = useHomeGroupsMutation();
|
const { mutateAsync: homeGroups } = useHomeGroupsMutation();
|
||||||
const { mutateAsync: codesListByCodeCl} = useCodesListByCodeClMutation();
|
const { mutateAsync: codesListByCodeCl} = useCodesListByCodeClMutation();
|
||||||
const { mutateAsync: shortcutUser } = useShortcutUserMutation();
|
const { mutateAsync: shortcutUser } = useShortcutUserMutation();
|
||||||
const { mutateAsync: shortcutDefault } = useShortcutDefaultMutation();
|
const { mutateAsync: shortcutDefault } = useShortcutDefaultMutation();
|
||||||
|
const { mutateAsync: businessPropertyByMid } = useBusinessPropertyByMidMutation();
|
||||||
|
|
||||||
const wrapperClassName = 'wrapper';
|
const wrapperClassName = 'wrapper';
|
||||||
|
|
||||||
@@ -82,6 +85,7 @@ export const SubLayout = () => {
|
|||||||
|
|
||||||
if(!!rs.mids[0]){
|
if(!!rs.mids[0]){
|
||||||
useStore.getState().UserStore.setMid(rs.mids[0]);
|
useStore.getState().UserStore.setMid(rs.mids[0]);
|
||||||
|
setMid(rs.mids[0]);
|
||||||
}
|
}
|
||||||
setLoginSuccess(true);
|
setLoginSuccess(true);
|
||||||
setHeaderNavigationKey(headerNavigationKey + 1);
|
setHeaderNavigationKey(headerNavigationKey + 1);
|
||||||
@@ -91,10 +95,21 @@ export const SubLayout = () => {
|
|||||||
codeCl: '0022',
|
codeCl: '0022',
|
||||||
code1Filter: filter0022
|
code1Filter: filter0022
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const callBusinessPropertyByMid = () => {
|
||||||
|
if(!!mid){
|
||||||
|
let params: BusinessPropertyByMidParams = {
|
||||||
|
mid: mid
|
||||||
|
};
|
||||||
|
businessPropertyByMid(params).then((rs: BusinessPropertyByMidResponse) => {
|
||||||
|
console.log(rs);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
const callSortcutDefault = () => {
|
const callSortcutDefault = () => {
|
||||||
console.log("============================callSortcutDefault")
|
console.log("============================callSortcutDefault")
|
||||||
let userInfo = useStore.getState().UserStore.userInfo;
|
let userInfo = useStore.getState().UserStore.userInfo;
|
||||||
@@ -196,8 +211,12 @@ export const SubLayout = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleLogin();
|
handleLogin();
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
useEffect(() => {
|
||||||
|
if(!!mid){
|
||||||
|
// callBusinessPropertyByMid();
|
||||||
|
}
|
||||||
|
}, [mid]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ wrapperClassName }>
|
<div className={ wrapperClassName }>
|
||||||
|
|||||||
Reference in New Issue
Block a user