| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556 |
- import { useEnumStore } from '@/stores'
- const { getEnumTypeList, getEnumTypeName } = useEnumStore()
- /**
- * 买卖方向
- */
- export enum BuyOrSell {
- Buy = 0, // 买
- Sell = 1, // 卖
- }
- /**
- * 委托单据类型
- */
- export enum BuildType {
- Open = 1, // 建仓
- Close = 2, // 平仓
- CloseOpen = 3, // 先平后建
- }
- /**
- * 取价方式
- */
- export enum PriceMode {
- Market = 1, // 市价
- Limit = 2, // 限价
- }
- /// 仓单贸易类型
- export enum WrTradeType {
- Liting = 1,
- DeListing = 2,
- }
- /// 价格方式 - 1:固定价 2-浮动价 - [挂牌]
- export enum WrPriceType {
- Fix = 1,
- Float = 2,
- }
- /// 支付状态
- export enum PayStatus {
- UnPay = 1,
- Pay = 2,
- }
- /// 付款方式 - 1:冻结 2:扣款
- export enum PaymentType {
- Freeze = 1,
- Blance = 2,
- }
- /// 交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
- export enum TradeStatus {
- Normal = 1,
- Limit = 2,
- Freeze = 3,
- NoOpen = 4,
- NoTrade = 5,
- UnActivate = 6,
- LoginOut = 7
- }
- /**
- * 获取买卖方向列表
- * @returns
- */
- export function getBuyOrSellList() {
- return [
- { label: '买入', value: BuyOrSell.Buy },
- { label: '卖出', value: BuyOrSell.Sell },
- ]
- }
- /**
- * 获取交易状态列表
- * @returns
- */
- export function getTradeStatusList() {
- return [
- { label: '正常', value: TradeStatus.Normal },
- { label: '受限', value: TradeStatus.Limit },
- { label: '冻结', value: TradeStatus.Freeze },
- { label: '禁止建仓(人工受限)', value: TradeStatus.NoOpen },
- { label: '禁止交易(人工冻结)', value: TradeStatus.NoTrade },
- { label: '待激活', value: TradeStatus.UnActivate },
- { label: '已注销', value: TradeStatus.LoginOut },
- ]
- }
- /**
- * 获取仓单贸易类型列表
- * @returns
- */
- export function getWrTradeTypeList() {
- return [
- { label: '挂牌', value: WrTradeType.Liting },
- { label: '摘牌', value: WrTradeType.DeListing },
- ]
- }
- /**
- * 获取仓单贸易价格方式类型列表
- * @returns
- */
- export function getWRPriceTypeList() {
- return [
- { label: '一口价', value: WrPriceType.Fix },
- { label: '浮动价', value: WrPriceType.Float },
- ]
- }
- /**
- * 获取仓单贸易付款方式
- * @returns
- */
- export function getPaymentTypeList() {
- return [
- { label: '冻结', value: PaymentType.Freeze },
- { label: '扣款', value: PaymentType.Blance },
- ]
- }
- /**
- * 获取交易状态名称
- * @returns
- */
- export function getTradeStatusName(value: number) {
- return getEnumTypeName(getTradeStatusList(), value)
- }
- /**
- * 获取买卖方向名称
- * @returns
- */
- export function getBuyOrSellName(value: number) {
- return getEnumTypeName(getBuyOrSellList(), value)
- }
- /**
- * 获取仓单贸易类型名称
- * @returns
- */
- export function getWrTradeTypeName(value: number) {
- return getEnumTypeName(getWrTradeTypeList(), value)
- }
- /**
- * 获取仓单贸易付款方式
- * @returns
- */
- export function getPaymentTypeName(value: number) {
- return getEnumTypeName(getPaymentTypeList(), value)
- }
- /**
- * 获取仓单贸易价格类型名称
- * @returns
- */
- export function getWrPriceTypeName(value: number) {
- return getEnumTypeName(getWRPriceTypeList(), value)
- }
- /**
- * 获取委托单据类型列表
- * @returns
- */
- export function getBuildTypeList() {
- return getEnumTypeList('buildtype')
- }
- /**
- * 获取委托单据类型名称
- * @returns
- */
- export function getBuildTypeName(value: number) {
- return getEnumTypeName(getBuildTypeList(), value)
- }
- /**
- * 获取交割方式类型列表
- * @returns
- */
- export function getTHJDeliveryModeList() {
- return getEnumTypeList('THJDeliveryMode')
- }
- /**
- * 获取交割方式类型名称
- * @returns
- */
- export function getTHJDeliveryModeName(value: number) {
- const enums = getTHJDeliveryModeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取单据状态类型列表
- * @returns
- */
- export function getTHJOrderStatusList() {
- return getEnumTypeList('thjOrderStatus')
- }
- /**
- * 获取单据状态类型名称
- * @returns
- */
- export function getTHJOrderStatusName(value: number) {
- const enums = getTHJOrderStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取申请状态类型列表
- * @returns
- */
- export function getApplyStatusList() {
- return getEnumTypeList('WROutInApplyStatus2')
- }
- /**
- * 获取申请状态类型名称
- * @returns
- */
- export function getApplyStatusName(value: number) {
- const enums = getApplyStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取出入金申请状态类型列表
- * @returns
- */
- export function getInOutApplyStatusList() {
- return getEnumTypeList('applystatus')
- }
- /**
- * 获取出入金申请状态类型名称
- * @returns
- */
- export function getInOutApplyStatusName(value: number) {
- const enums = getInOutApplyStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取出入金申请类型列表
- * @returns
- */
- export function getInOutExecuteTypeList() {
- return getEnumTypeList('executetype')
- }
- /**
- * 获取出入金申请类型名称
- * @returns
- */
- export function getInOutExecuteTypeName(value: number) {
- const enums = getInOutExecuteTypeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取转让状态列表
- * @returns
- */
- export function getTHJTransferStatusList() {
- return getEnumTypeList('THJTransferStatus')
- }
- /**
- * 获取转让状态名称
- * @returns
- */
- export function getTHJTransferStatusName(value: number) {
- const enums = getTHJTransferStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取委托状态列表
- * @returns
- */
- export function getWRTradeOrderStatusList() {
- return getEnumTypeList('WRTradeOrderStatus')
- }
- /**
- * 获取委托状态名称
- * @returns
- */
- export function getWRTradeOrderStatusName(value: number) {
- const enums = getWRTradeOrderStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取提货方式列表
- * @returns
- */
- export function getAppointmentModelOutList() {
- return getEnumTypeList('appointmentModelOut')
- }
- /**
- * 获取委托状态列表
- * @returns
- */
- export function getOrderStatusList() {
- return getEnumTypeList('orderstatus')
- }
- /**
- * 获取委托状态名称
- * @returns
- */
- export function getOrderStatusName(value: number) {
- const enums = getOrderStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取取价方式列表
- * @returns
- */
- export function getPricemode2List() {
- return getEnumTypeList('Pricemode2')
- }
- /**
- * 获取取价方式名称
- * @returns
- */
- export function getPricemode2Name(value: number) {
- const enums = getPricemode2List()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取履约状态类型列表
- * @returns
- */
- export function getPerformanceStatusList() {
- return getEnumTypeList('performanceStatus')
- }
- /**
- * 获取履约状态类型名称
- * @returns
- */
- export function getPerformanceStatusName(value: number) {
- const enums = getPerformanceStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取履约步骤状态类型列表
- * @returns
- */
- export function getPerformanceStepStatusList() {
- return getEnumTypeList('stepStatus')
- }
- /**
- * 获取履约步骤状态类型名称
- * @returns
- */
- export function getPerformanceStepStatusName(value: number) {
- const enums = getPerformanceStepStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取履约类型列表
- * @returns
- */
- export function getPerformanceTypeList() {
- return getEnumTypeList('performanceType')
- }
- /**
- * 获取履约类型名称
- * @returns
- */
- export function getPerformanceTypeName(value: number) {
- const enums = getPerformanceTypeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取预售持仓状态列表
- * @returns
- */
- export function getHandleStatusList() {
- return getEnumTypeList('handlestatus')
- }
- /**
- * 获取预售持仓状态名称
- * @returns
- */
- export function getHandleStatusName(value: number) {
- const enums = getHandleStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取支付状态列表
- * @returns
- */
- export function getPayStatusList() {
- return [
- { label: '未支付', value: PayStatus.UnPay },
- { label: '已支付', value: PayStatus.Pay },
- ]
- }
- /**
- * 获取支付状态名称
- * @returns
- */
- export function getPayStatusName(value: number) {
- const enums = getPayStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取挂牌点选类型列表
- * @returns
- */
- export function getListingSelectTypeList() {
- return getEnumTypeList('listingselecttype')
- }
- /**
- * 获取挂牌点选类型名称
- * @returns
- */
- export function getListingSelectTypeName(value: number) {
- const enums = getListingSelectTypeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取交收单状态2类型列表
- * @returns
- */
- export function getDeliveryStatusList() {
- return getEnumTypeList('deliveryStatus')
- }
- /**
- * 获取交收单状态2类型名称
- * @returns
- */
- export function getDeliveryStatusName(value: number) {
- const enums = getDeliveryStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取付款方式类型列表
- * @returns
- */
- export function getDeliveryPayModeList() {
- return getEnumTypeList('deliveryPayMode')
- }
- /**
- * 获取付款方式类型名称
- * @returns
- */
- export function getDeliveryPayModeName(value: number) {
- const enums = getDeliveryPayModeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取确认状态类型列表
- * @returns
- */
- export function getConfirmStatusList() {
- return getEnumTypeList('confirmStatus')
- }
- /**
- * 获取确认状态类型名称
- * @returns
- */
- export function getConfirmStatusName(value: number) {
- const enums = getConfirmStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取预售状态列表
- * @returns
- */
- export function getWRPresaleStatusList() {
- return getEnumTypeList('WRPresaleStatus')
- }
- /**
- * 获取预售状态类型名称
- * @returns
- */
- export function getWRPresaleStatusName(value: number) {
- const enums = getWRPresaleStatusList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取操作类型列表
- * @returns
- */
- export function getOperateTypeList() {
- return getEnumTypeList('operateType')
- }
- /**
- * 获取操作类型名称
- * @returns
- */
- export function getOperateTypeName(value: number) {
- const enums = getOperateTypeList()
- return getEnumTypeName(enums, value)
- }
- /**
- * 获取操作类型查询列表
- * @returns
- */
- export function getOperateTypeSearchList() {
- return getEnumTypeList('operatetypesearch')
- }
- /**
- * 获取过户申请状态列表
- * @returns
- */
- export function getTransferApplyStatusList() {
- return getEnumTypeList('transferapplystatus')
- }
- /**
- * 获取过户申请状态名称
- * @returns
- */
- export function getTransferApplyStatusName(value: number) {
- const enums = getTransferApplyStatusList()
- return getEnumTypeName(enums, value)
- }
|