客户服务
This commit is contained in:
parent
db8186d055
commit
8d20a262eb
@ -3,7 +3,9 @@ import { EditOutlined } from '@ant-design/icons-vue';
|
|||||||
import {EchartsUI, type EchartsUIType, useEcharts} from "@vben/plugins/echarts";
|
import {EchartsUI, type EchartsUIType, useEcharts} from "@vben/plugins/echarts";
|
||||||
import {onMounted, ref} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
import {countsList} from '#/api/property/customerService/centerConsole'
|
import {countsList} from '#/api/property/customerService/centerConsole'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
const board = ref ({})
|
const board = ref ({})
|
||||||
const getBoard = async () => {
|
const getBoard = async () => {
|
||||||
board.value = await countsList();
|
board.value = await countsList();
|
||||||
@ -15,19 +17,21 @@ const seriesData = ref<any[]>([]);
|
|||||||
const workOrderCount = ref<EchartsUIType>();
|
const workOrderCount = ref<EchartsUIType>();
|
||||||
const { renderEcharts: renderWorkOrderCount } = useEcharts(workOrderCount);
|
const { renderEcharts: renderWorkOrderCount } = useEcharts(workOrderCount);
|
||||||
async function fetchWorkOrderCount() {
|
async function fetchWorkOrderCount() {
|
||||||
xAxisData.value = board.value.recentWeekWorkOrders
|
xAxisData.value = board.value.recentWeekWorkOrders.map(item => {
|
||||||
const result = xAxisData.value.map(item => {
|
|
||||||
const [year, month, day] = item.date.split('-');
|
const [year, month, day] = item.date.split('-');
|
||||||
const monthDay = `${month}-${day}`;
|
const monthDay = `${month}-${day}`;
|
||||||
return `${monthDay}${item.dayOfWeek}`;
|
return `${monthDay}${item.dayOfWeek}`;
|
||||||
});
|
});
|
||||||
console.log(result)
|
seriesData.value = board.value.recentWeekWorkOrders.map(item => {
|
||||||
|
return `${item.count}`;
|
||||||
|
});
|
||||||
|
console.log(xAxisData.value,seriesData.value)
|
||||||
renderWorkOrderCount({
|
renderWorkOrderCount({
|
||||||
tooltip: { trigger: 'axis' },
|
tooltip: { trigger: 'axis' },
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
boundaryGap: false,
|
boundaryGap: false,
|
||||||
data: ['06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二']
|
data: xAxisData.value
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@ -35,7 +39,7 @@ async function fetchWorkOrderCount() {
|
|||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: [6, 2, 0, 1, 0, 0, 1],
|
data: seriesData.value,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
areaStyle: {},
|
areaStyle: {},
|
||||||
smooth: true,
|
smooth: true,
|
||||||
@ -153,6 +157,10 @@ async function fetchOrderTyper() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const goToProperty = () => {
|
||||||
|
router.push('/property')
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getBoard()
|
await getBoard()
|
||||||
await fetchWorkOrderCount()
|
await fetchWorkOrderCount()
|
||||||
@ -172,7 +180,7 @@ onMounted(async () => {
|
|||||||
<div>
|
<div>
|
||||||
<div>工单总数:</div>
|
<div>工单总数:</div>
|
||||||
<div>{{ board.workOrdersTotal }}</div>
|
<div>{{ board.workOrdersTotal }}</div>
|
||||||
<div style="color: #1890FF">点击前往工单池</div>
|
<div style="color: #1890FF" @click="goToProperty()">点击前往工单池</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon-edit"><EditOutlined /></div>
|
<div class="icon-edit"><EditOutlined /></div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user