You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
4.8 KiB

4 weeks ago
import { MapApi } from "@/api/shorepower/map";
export const getOperationTypeLabel = (value: string | number | undefined | null, options: { label: string, value: string | number }[]) => {
4 weeks ago
try {
4 weeks ago
const item = options.find(opt => opt.value === value);
return item ? item.label : '';
4 weeks ago
} catch (error) {
return ''
}
4 weeks ago
};
// 装货/卸货
export const OPERATION_TYPE = [
{ label: '装货', value: 1 },
{ label: '卸货', value: 2 },
{ label: '卸货并装货', value: 2 },
]
// 获取类型
export const CARGO_CATEGORY = [
{ label: '空船', value: 0 },
{ label: '散货', value: 1 },
{ label: '集装箱', value: 2 },
{ label: '液体货物', value: 3 },
{ label: '件杂货', value: 4 },
{ label: '危险品', value: 5 },
{ label: '冷藏货物', value: 6 },
]
// 未使用岸电原因
export const UNUSED_SHORE_POWER_REASON = [
{ label: '岸电用电接口不匹配', value: 1 },
{ label: '岸电设施电压/频率不匹配', value: 2 },
{ label: '电缆长度不匹配', value: 3 },
{ label: '气象因素禁止作业', value: 4 },
{ label: '船电设施损坏', value: 5 },
{ label: '岸电设施维护中', value: 6 },
{ label: '无受电设备', value: 7 },
{ label: '拒绝使用岸电', value: 8 },
{ label: '其他', value: 9 },
]
// 港区map
export const HARBOR_DISTRICT = async () => {
const res = await MapApi.getHarborDistrictIdAndNameList()
return res.map(item => ({
...item,
label: item.name,
value: item.id
}))
}
// doc 码头map
export const DOCK_DISTRICT = async () => {
const res = await MapApi.getDockIdAndNameList()
return res.map(item => ({
...item,
label: item.name,
value: item.id
}))
}
4 weeks ago
// 泊位map
export const BERTH_DISTRICT = async () => {
const res = await MapApi.getBerthIdAndNameList()
return res.map(item => ({
...item,
label: item.name,
value: item.id
}))
}
4 weeks ago
// 岸电状态
export const SHORE_POWER_STATUS = [
{ label: '待靠泊', value: 1 },
{ label: '靠泊中', value: 2 },
{ label: '岸电接入中', value: 3 },
{ label: '用电中', value: 4 },
{ label: '岸电卸载中', value: 5 },
{ label: '岸电卸载完成', value: 6 },
{ label: '离泊', value: 7 },
{ label: '未使用岸电', value: 9 }
]
export const BERTH_TYPE = [
{ label: '左舷停舶', value: 'left' },
{ label: '右舷停舶', value: 'right' },
]
4 weeks ago
// 设施类型
export const FACILITY_TYPE = [
{ label: '港区', value: 1 },
{ label: '码头', value: 2 },
{ label: '岸电设施', value: 3 },
{ label: '泊位', value: 4 },
{ label: '用电接口', value: 5 },
]
4 weeks ago
// 贸易类型
export const TRADE_TYPE = [
{ label: '内贸', value: 1 },
{ label: '外贸', value: 2 },
]
// 作业状态
export const WORK_STATUS = [
{ label: '待作业', value: 1 },
{ label: '前往作业中', value: 2 },
{ label: '接电中', value: 3 },
{ label: '待拆除岸电', value: 4 },
{ label: '岸电卸载中', value: 5 },
{ label: '待上报数据', value: 6 },
{ label: '作业完成', value: 7 },
{ label: '未成功接入', value: 9 },
]
// 申请状态
export const APPLY_STATUS = [
{ label: '待签合同', value: 2 },
{ label: '待付款', value: 3 },
{ label: '待确认收款', value: 4 },
{ label: '待送电', value: 5 },
{ label: '用电中', value: 6 },
{ label: '信息收集中', value: 7 },
{ label: '待退款', value: 8 },
{ label: '用电完成', value: 9 },
{ label: '申请完成', value: 10 },
{ label: '已取消', value: 11 },
3 weeks ago
]
1 week ago
/* 岸电一级状态 */
export const SHORE_POWER_FIRST_STATUS = [
{ label: '故障', value: 1 }, // 检修
{ label: '故障', value: 2 }, // 跳闸
{ label: '在用', value: 3 }, // 合闸 → 正在供电使用
{ label: '正常', value: 4 }, // 分闸 → 空闲但正常
{ label: '故障', value: 5 }, // 通信异常
{ label: '故障', value: 8 }, // 无法解析设备状态
{ label: '正常', value: 9 }, // 未开始采集数据
]
/* 岸电二级状态 */
export const SHORE_POWER_SECOND_STATUS_MAP = [
{ label: '检修', value: 1 },
{ label: '跳闸', value: 2 },
{ label: '合闸', value: 3 },
{ label: '分闸', value: 4 },
{ label: '通信异常', value: 5 },
1 week ago
{ label: '超出最大容量', value: 6 },
1 week ago
{ label: '无法解析设备状态', value: 8 },
{ label: '未开始采集数据', value: 9 },
1 week ago
]
/* 船舶一级状态 */
export const SHIP_FIRST_STATUS = [
{ label: '在用', value: 1 },
{ label: '故障', value: 2 },
{ label: '正常', value: 3 },
{ label: '异常', value: 4 },
]
/* 船舶二级状态 */
export const SHIP_SECOND_STATUS_MAP = [
{ label: '在用', value: 1 },
{ label: '超容', value: 2 },
{ label: '故障', value: 3 },
{ label: '获取岸电容量失败', value: 4 },
{ label: '未使用岸电', value: 5 },
{ label: '跳闸', value: 6 },
]