|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
import useAuthStore from '@/stores/Auth';
|
|
|
|
|
import { PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 产品管理 相关的预设数据
|
|
|
|
@ -89,17 +91,26 @@ export const useProductsAuditStatesMapVal = (value) => {
|
|
|
|
|
/**
|
|
|
|
|
* @ignore
|
|
|
|
|
*/
|
|
|
|
|
export const useProductsTypesFieldsets = (type, role) => {
|
|
|
|
|
const infoDefault = ['code', 'title'];
|
|
|
|
|
export const useProductsTypesFieldsets = (type) => {
|
|
|
|
|
const [isPermitted] = useAuthStore((state) => [state.isPermitted]);
|
|
|
|
|
const infoDefault = [['code'], ['title']];
|
|
|
|
|
const infoAdmin = ['remarks', 'dept', 'display_to_c'];
|
|
|
|
|
const infoTypesMap = {
|
|
|
|
|
'6': [],
|
|
|
|
|
'B': ['city_id', 'km'],
|
|
|
|
|
'J': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c'],
|
|
|
|
|
'Q': ['description', 'city_id', 'duration', ],
|
|
|
|
|
'D': ['description', 'city_id', 'recommends_rate','duration',],
|
|
|
|
|
'7': ['description', 'city_id', 'recommends_rate', 'duration', 'display_to_c', 'open_weekdays'], // todo: 怎么是2个图
|
|
|
|
|
'C': ['description', 'city_id',],
|
|
|
|
|
'8': [], // todo: ?
|
|
|
|
|
'6': [[],[]],
|
|
|
|
|
'B': [['city_id', 'km'], []],
|
|
|
|
|
'J': [['city_id', 'recommends_rate', 'duration', 'display_to_c'], ['description',]],
|
|
|
|
|
'Q': [['city_id', 'duration', ], ['description',]],
|
|
|
|
|
'D': [['city_id', 'recommends_rate','duration',], ['description',]],
|
|
|
|
|
'7': [['city_id', 'recommends_rate', 'duration', 'display_to_c', 'open_weekdays'], ['description',]], // todo: 怎么是2个图
|
|
|
|
|
'C': [['city_id',], ['description',]],
|
|
|
|
|
'8': [[],[]], // todo: ?
|
|
|
|
|
};
|
|
|
|
|
const thisTypeFieldset = (_type) => {
|
|
|
|
|
const adminSet = isPermitted(PERM_PRODUCTS_MANAGEMENT) ? infoAdmin : [];
|
|
|
|
|
return [
|
|
|
|
|
[...infoDefault[0], ...infoTypesMap[_type][0], ...adminSet],
|
|
|
|
|
[...infoDefault[1], ...infoTypesMap[_type][1]]
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
return thisTypeFieldset(type);
|
|
|
|
|
}
|
|
|
|
|