no message
parent
4761f7036d
commit
173c639d5e
|
|
@ -19,7 +19,7 @@ export const columns: BasicColumn[] = [
|
|||
{
|
||||
title: '柜号',
|
||||
align: "center",
|
||||
width: '155px',
|
||||
width: '160px',
|
||||
dataIndex: 'conNo',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderTip(text);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
enum Api {
|
||||
loginfo = '/sys/loginfo',
|
||||
visitInfo = '/sys/visitInfo',
|
||||
getChartCardList = '/dashboard/getChartCardList',
|
||||
}
|
||||
/**
|
||||
* 日志统计信息
|
||||
|
|
@ -14,3 +15,5 @@ export const getLoginfo = (params) => defHttp.get({ url: Api.loginfo, params },
|
|||
* @param params
|
||||
*/
|
||||
export const getVisitInfo = (params) => defHttp.get({ url: Api.visitInfo, params }, { isTransformResponse: false });
|
||||
|
||||
export const getChartCardList = (params) => defHttp.get({ url: Api.getChartCardList, params }, { isTransformResponse: false });
|
||||
|
|
|
|||
|
|
@ -31,14 +31,13 @@
|
|||
<Bar :seriesColor="seriesColor" v-if="index === 2" :option="option" :chartData="chartData" height="50px"></Bar>
|
||||
|
||||
<Progress v-if="index === 3" :percent="78" :show-info="false"></Progress>
|
||||
|
||||
</div>
|
||||
<template #footer v-if="type === 'chart'">
|
||||
<span v-if="index !== 3"
|
||||
>{{ item.footer }}<span>{{ item.value }}</span></span
|
||||
>
|
||||
<Trend term="周同比" :percentage="12" v-if="index === 3" />
|
||||
<Trend term="日同比" :percentage="11" v-if="index === 3" :type="false" />
|
||||
<!-- <Trend term="周同比" :percentage="12" v-if="index === 3" />
|
||||
<Trend term="日同比" :percentage="11" v-if="index === 3" :type="false" />-->
|
||||
</template>
|
||||
<template #footer v-else>
|
||||
<span
|
||||
|
|
@ -50,15 +49,16 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { Icon } from '/@/components/Icon';
|
||||
import { Progress } from 'ant-design-vue';
|
||||
import ChartCard from '/@/components/chart/ChartCard.vue';
|
||||
import Trend from '/@/components/chart/Trend.vue';
|
||||
import Bar from '/@/components/chart/Bar.vue';
|
||||
import SingleLine from '/@/components/chart/SingleLine.vue';
|
||||
import { chartCardList, bdcCardList } from '../data';
|
||||
import { bdcCardList } from '../data';
|
||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||
import { getChartCardList } from '@/views/dashboard/Analysis/api';
|
||||
|
||||
const { getThemeColor } = useRootSetting();
|
||||
const props = defineProps({
|
||||
|
|
@ -70,7 +70,14 @@
|
|||
default: 'chart',
|
||||
},
|
||||
});
|
||||
const option = ref({ xAxis: { show: false, boundaryGap: false }, yAxis: { show: false, boundaryGap: false, max: 220 } });
|
||||
|
||||
const chartCardList = ref([]); // 动态获取的 chartCardList
|
||||
const chartLoading = ref(false);
|
||||
|
||||
const option = ref({
|
||||
xAxis: { show: false, boundaryGap: false },
|
||||
yAxis: { show: false, boundaryGap: false, max: 220 },
|
||||
});
|
||||
|
||||
const chartData = ref([
|
||||
{
|
||||
|
|
@ -100,10 +107,28 @@
|
|||
]);
|
||||
const seriesColor = computed(() => {
|
||||
return getThemeColor.value;
|
||||
})
|
||||
const dataList = computed(() => (props.type === 'dbc' ? bdcCardList : chartCardList));
|
||||
});
|
||||
const dataList = computed(() => (props.type === 'dbc' ? bdcCardList : chartCardList.value));
|
||||
|
||||
// 获取 chartCardList
|
||||
async function getChartCard() {
|
||||
chartLoading.value = true;
|
||||
try {
|
||||
const response = await getChartCardList({});
|
||||
console.log('获取 chartCardList 成功:', response);
|
||||
chartCardList.value = response.result || [];
|
||||
} catch (error) {
|
||||
console.error('获取 chartCardList 失败:', error);
|
||||
} finally {
|
||||
chartLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function getTotal(total, index) {
|
||||
return index === 0 ? `¥${total}` : index === 3 ? `${total}%` : total;
|
||||
return index === 0 ? `${total}` : index === 3 ? `${total}` : total;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getChartCard();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -45,30 +45,24 @@ export const growCardList: GrowCardItem[] = [
|
|||
|
||||
export const chartCardList: GrowCardItem[] = [
|
||||
{
|
||||
title: '总销售额',
|
||||
title: '总库存数量',
|
||||
icon: 'visit-count|svg',
|
||||
total: 126560,
|
||||
value: 234.56,
|
||||
footer: '日均销售额',
|
||||
},
|
||||
{
|
||||
title: '订单量',
|
||||
title: '日均入库量',
|
||||
icon: 'total-sales|svg',
|
||||
value: 1234,
|
||||
total: 8846,
|
||||
color: 'blue',
|
||||
footer: '日订单量',
|
||||
},
|
||||
{
|
||||
title: '支付笔数',
|
||||
title: '日均出库量',
|
||||
icon: 'download-count|svg',
|
||||
value: 60,
|
||||
total: 6560,
|
||||
color: 'orange',
|
||||
footer: '转化率',
|
||||
},
|
||||
{
|
||||
title: '运营活动效果',
|
||||
title: '库存周转率',
|
||||
icon: 'transaction|svg',
|
||||
total: 78,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="p-4">
|
||||
<ChartGroupCard class="enter-y" :loading="loading" type="chart" />
|
||||
<SaleTabCard class="!my-4 enter-y" :loading="loading" />
|
||||
<a-row>
|
||||
<!-- <a-row>
|
||||
<a-col :span="24">
|
||||
<a-card :loading="loading" :bordered="false" title="最近一周访问量统计">
|
||||
<div class="infoArea">
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<LineMulti :chartData="lineMultiData" height="33vh" type="line" :option="{ legend: { top: 'bottom' } }"></LineMulti>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-row>-->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
|
|
|||
Loading…
Reference in New Issue