4 changed files with 99 additions and 32 deletions
Unified View
Diff Options
-
6src/api/clue/index.ts
-
17src/views/sys/workbench/components/GrowCard.vue
-
46src/views/sys/workbench/data.ts
-
62src/views/sys/workbench/index.vue
@ -1,18 +1,68 @@ |
|||||
<template> |
<template> |
||||
<div> |
<div> |
||||
<WorkbenchHeader /> |
<WorkbenchHeader /> |
||||
<!-- <div class="p-4"> |
|
||||
<GrowCard :loading="loading" class="enter-y" /> |
|
||||
</div> --> |
|
||||
|
<div class="flex-row-center-space" style="padding: 12px 16px 0px 16px;"> |
||||
|
<span style="color: #333;text-align: center;font-size: 22px;">电邀数据统计</span> |
||||
|
<RangePicker v-model:value="value4" :format="dateFormat" :disabled-date="disabledDate" @change="fetchData"/> |
||||
|
</div> |
||||
|
<div class="p-4"> |
||||
|
<GrowCard :loading="loading" :data-list="growCardList" class="enter-y" /> |
||||
|
</div> |
||||
|
<div style="padding: 0px 16px;"> |
||||
|
<BasicTable @register="registerTable" /> |
||||
|
</div> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||
import { nextTick, ref } from 'vue'; |
|
||||
|
import { onMounted, ref } from 'vue'; |
||||
|
import moment, {Moment} from 'moment'; |
||||
|
import { formatToDate } from '/@/utils/dateUtil' |
||||
import WorkbenchHeader from './components/WorkbenchHeader.vue'; |
import WorkbenchHeader from './components/WorkbenchHeader.vue'; |
||||
import GrowCard from './components/GrowCard.vue'; |
import GrowCard from './components/GrowCard.vue'; |
||||
|
import { RangePicker } from 'ant-design-vue' |
||||
|
import { BasicTable, useTable } from '/@/components/Table' |
||||
|
import { tableColumns, growCardList } from './data' |
||||
|
import { getInvitationStatic, getInvitationData } from '/@/api/clue' |
||||
|
|
||||
|
const dateFormat = 'YYYY-MM-DD'; |
||||
|
const value4 = ref<any[]>([]) |
||||
const loading = ref(true); |
const loading = ref(true); |
||||
setTimeout(() => { |
|
||||
|
|
||||
|
onMounted(() => { |
||||
|
value4.value = [moment().format(dateFormat), moment().format(dateFormat)] |
||||
|
fetchData() |
||||
|
}) |
||||
|
|
||||
|
function disabledDate (current: Moment) { |
||||
|
return current && current >= moment().endOf('day'); |
||||
|
} |
||||
|
|
||||
|
async function fetchData(){ |
||||
|
loading.value = true; |
||||
|
const result = await getInvitationStatic({startTime: formatToDate(value4.value[0]), endTime: formatToDate(value4.value[1])}) |
||||
|
growCardList[0].value = result.obtainedQuantity |
||||
|
growCardList[1].value = result.allocationQuantity |
||||
|
growCardList[2].value = result.connectionQuantity |
||||
|
growCardList[3].value = result.appointmentQuantity |
||||
|
growCardList[4].value = result.followUpQuantity |
||||
|
await reload() |
||||
loading.value = false; |
loading.value = false; |
||||
}, 1000); |
|
||||
|
} |
||||
|
|
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
bordered: true, |
||||
|
immediate: false, |
||||
|
canResize: true, |
||||
|
useSearchForm: false, |
||||
|
showIndexColumn: true, |
||||
|
showTableSetting: false, |
||||
|
pagination: false, |
||||
|
columns: tableColumns, |
||||
|
api: getInvitationData, |
||||
|
beforeFetch: (arg) => { |
||||
|
arg.startTime = formatToDate(value4.value[0]) |
||||
|
arg.endTime = formatToDate(value4.value[1]) |
||||
|
}, |
||||
|
}) |
||||
|
|
||||
</script> |
</script> |
||||
Write
Preview
Loading…
Cancel
Save