This commit is contained in:
parent
0ad61c0e69
commit
1710f687a6
|
|
@ -22,4 +22,9 @@ export async function editVarietyApi(params: any): Promise<any> {
|
||||||
//同步合约品种
|
//同步合约品种
|
||||||
export async function syncVarietyApi(): Promise<any> {
|
export async function syncVarietyApi(): Promise<any> {
|
||||||
return request.post<any>('/contractVariety/syncVariety', {})
|
return request.post<any>('/contractVariety/syncVariety', {})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取品种枚举
|
||||||
|
export async function getVarietyEnumsApi(): Promise<any> {
|
||||||
|
return request.get<any>('/contractVariety/getVarietyEnums')
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +80,7 @@ import {
|
||||||
editVarietyApi,
|
editVarietyApi,
|
||||||
createVarietyApi,
|
createVarietyApi,
|
||||||
syncVarietyApi,
|
syncVarietyApi,
|
||||||
|
getVarietyEnumsApi,
|
||||||
} from '@/api/modules/trade/variety'
|
} from '@/api/modules/trade/variety'
|
||||||
// 上传图片
|
// 上传图片
|
||||||
import { uploadImageApi } from '@/api/modules/upload'
|
import { uploadImageApi } from '@/api/modules/upload'
|
||||||
|
|
@ -160,28 +161,7 @@ const varietyFormRules = ref(rules())
|
||||||
const dialogFormItemOptions = ref(DialogFormItem)
|
const dialogFormItemOptions = ref(DialogFormItem)
|
||||||
const varietyFormOptionsMap = ref({
|
const varietyFormOptionsMap = ref({
|
||||||
group_id: [],
|
group_id: [],
|
||||||
type: [
|
type: [],
|
||||||
{
|
|
||||||
label: '外汇',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '金属',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '能源',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '指数',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '数字货币',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
// 选中行
|
// 选中行
|
||||||
const selectedRow = ref<any>(null)
|
const selectedRow = ref<any>(null)
|
||||||
|
|
@ -190,12 +170,19 @@ const colSpan = ref(12)
|
||||||
|
|
||||||
const fileList = ref([])
|
const fileList = ref([])
|
||||||
|
|
||||||
const typeMap: any = {
|
// 类型枚举列表
|
||||||
1: '外汇',
|
const typeList = ref<any[]>([])
|
||||||
2: '金属',
|
|
||||||
3: '能源',
|
// 获取品种枚举
|
||||||
4: '指数',
|
const getVarietyEnums = async () => {
|
||||||
5: '数字货币',
|
const res = await getVarietyEnumsApi()
|
||||||
|
if (res) {
|
||||||
|
typeList.value = res.map((item: any) => ({
|
||||||
|
label: item.name,
|
||||||
|
value: item.type,
|
||||||
|
}))
|
||||||
|
varietyFormOptionsMap.value.type = typeList.value as any
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -228,7 +215,7 @@ const getVarietyList = async () => {
|
||||||
longStockFee: item.fee_inventory_long,
|
longStockFee: item.fee_inventory_long,
|
||||||
shortStockFee: item.fee_inventory_short,
|
shortStockFee: item.fee_inventory_short,
|
||||||
profitLevel: item.stop_loss_level,
|
profitLevel: item.stop_loss_level,
|
||||||
type: typeMap[item.type],
|
type: typeList.value.find((t: any) => t.value === item.type)?.label || '',
|
||||||
image: item.image,
|
image: item.image,
|
||||||
}))
|
}))
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -249,6 +236,7 @@ const getTradeGroupList = async () => {
|
||||||
* @description: 页面加载完成需要请求的数据
|
* @description: 页面加载完成需要请求的数据
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getVarietyEnums()
|
||||||
getVarietyList()
|
getVarietyList()
|
||||||
getTradeGroupList()
|
getTradeGroupList()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue