增加 bk futrue mock, 增加日历加载式样
This commit is contained in:
@@ -9,5 +9,37 @@ export default [
|
||||
count: 53,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/bookmark/api/v1/bookmark',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return [
|
||||
{
|
||||
bk_id: '001',
|
||||
bk_type_id: '2',
|
||||
bk_type_name: '3',
|
||||
comment: '4',
|
||||
url: '5'
|
||||
},
|
||||
{
|
||||
bk_id: '002',
|
||||
bk_type_id: '2',
|
||||
bk_type_name: '3',
|
||||
comment: '4',
|
||||
url: '5'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/bookmark/api/v1/bookmark_type',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return [
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
] as MockMethod[]
|
||||
|
||||
+102
@@ -130,5 +130,107 @@ export default [
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/trader/api/v1/accounts',
|
||||
method: 'get',
|
||||
response: ({ body, query }) => {
|
||||
return {
|
||||
accounts: [
|
||||
{
|
||||
gateway_name: 'cpt',
|
||||
account_id: '7788',
|
||||
balance: '7',
|
||||
frozen: '8',
|
||||
},
|
||||
{
|
||||
gateway_name: 'cpt',
|
||||
account_id: '778899',
|
||||
balance: '8',
|
||||
frozen: '9',
|
||||
}
|
||||
],
|
||||
positions: [
|
||||
{
|
||||
symbol: 'czce',
|
||||
exchange: 'RM301',
|
||||
direction: '1',
|
||||
volume: 222,
|
||||
price: 2500,
|
||||
frozen: 3,
|
||||
pnl: 2,
|
||||
yd_volume: 1,
|
||||
}
|
||||
],
|
||||
trades: [
|
||||
{
|
||||
symbol: 'string',
|
||||
exchange: 'string',
|
||||
direction: 'string',
|
||||
volume: 2,
|
||||
price: 4,
|
||||
orderid: 'string',
|
||||
tradeid: 'string',
|
||||
offset: 'string',
|
||||
}
|
||||
],
|
||||
orders: [{
|
||||
symbol: 'string',
|
||||
exchange: 'string',
|
||||
direction: 'string',
|
||||
volume: 6,
|
||||
price: 4,
|
||||
orderid: 'string',
|
||||
type: 'string',
|
||||
offset: 'string',
|
||||
traded: 7,
|
||||
status: 'string',
|
||||
// datetime :datetime
|
||||
reference: 'string',
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/trader/api/v1/strategy_file',
|
||||
method: 'get',
|
||||
response: ({ body, query }) => {
|
||||
return [
|
||||
{
|
||||
file_name: 'string',
|
||||
class_name: 'string',
|
||||
status: 'string',
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/trader/api/v1/strategies',
|
||||
method: 'get',
|
||||
response: ({ body, query }) => {
|
||||
return [
|
||||
{
|
||||
strategy_name: 'string',
|
||||
class_name: 'string',
|
||||
vt_symbol: 'string',
|
||||
setting: Object,
|
||||
status: 1,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/trader/api/v1/strategy_file/load',
|
||||
method: 'get',
|
||||
response: ({ body, query }) => {
|
||||
return [
|
||||
{
|
||||
class_names: 'asdasdas'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
] as MockMethod[]
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<el-calendar v-model="value">
|
||||
<template #dateCell="{ data }">
|
||||
<el-calendar v-model="value" v-if="isComponentActive" v-loading="isComponentLoading"
|
||||
element-loading-text="主人,别着急我在努力加载中^_^">
|
||||
<template #dateCell="{ data }" lo>
|
||||
<div class="date-cell-holiday" v-if="Object.keys(holidays).includes(toLocalDate(data.date))">
|
||||
<span style="color: red;" @click="onclick(data.date)"> {{ data.date.getDate() }}</span><br>
|
||||
<span>{{ holidays[toLocalDate(data.date)] }}</span>
|
||||
@@ -55,7 +56,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, reactive, ref } from 'vue'
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { get_holiday } from '@/service/calendar'
|
||||
import { toLocalDate } from '@/utils/date'
|
||||
import { get_event, put_event } from "@/api/calendar"
|
||||
@@ -80,6 +81,8 @@ const form = reactive({
|
||||
const value = ref(new Date())
|
||||
const dialogFormVisible = ref(false)
|
||||
const formLabelWidth = '140px'
|
||||
const isComponentActive = ref(false)
|
||||
const isComponentLoading = ref(true)
|
||||
|
||||
const checkedalerts = ref([])
|
||||
const alerts = ['email', 'messageBox', '手机短信', '微信通知']
|
||||
@@ -116,19 +119,24 @@ const handleCommand = (command: string) => {
|
||||
/**
|
||||
* AUTO INVOKE FUNCTION
|
||||
*/
|
||||
get_holiday().then((resp) => {
|
||||
onMounted(async () => {
|
||||
await get_holiday().then((resp) => {
|
||||
Object.keys(resp.data).forEach(element => {
|
||||
holidays[element] = resp.data[element]
|
||||
})
|
||||
})
|
||||
get_event().then((response) => {
|
||||
})
|
||||
await get_event().then((response) => {
|
||||
eventDataList.length = 0
|
||||
response.data.forEach((record: Event) => {
|
||||
eventDataList.push(record)
|
||||
eventDataObject[record.date] = record.title
|
||||
})
|
||||
})
|
||||
isComponentActive.value = true
|
||||
isComponentLoading.value = false
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user