初始化项目
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { MyPerson, myPersonListData } from '@jeesite/biz/api/biz/myPerson';
|
||||
|
||||
const { t } = useI18n('biz.myPerson');
|
||||
|
||||
const modalProps = {
|
||||
title: t('人员选择'),
|
||||
};
|
||||
|
||||
const searchForm: FormProps<MyPerson> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('姓名'),
|
||||
field: 'personName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('身份证号'),
|
||||
field: 'idCard',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<MyPerson>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('姓名'),
|
||||
dataIndex: 'personName',
|
||||
key: 'a.person_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('性别'),
|
||||
dataIndex: 'gender',
|
||||
key: 'a.gender',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'sys_user_sex',
|
||||
},
|
||||
{
|
||||
title: t('身份证号'),
|
||||
dataIndex: 'idCard',
|
||||
key: 'a.id_card',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('手机号码'),
|
||||
dataIndex: 'phone',
|
||||
key: 'a.phone',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('邮箱'),
|
||||
dataIndex: 'email',
|
||||
key: 'a.email',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('出生日期'),
|
||||
dataIndex: 'birthDate',
|
||||
key: 'a.birth_date',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('居住地址'),
|
||||
dataIndex: 'address',
|
||||
key: 'a.address',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('所属部门'),
|
||||
dataIndex: 'department',
|
||||
key: 'a.department',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('职位'),
|
||||
dataIndex: 'positionName',
|
||||
key: 'a.position_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('状态'),
|
||||
dataIndex: 'ustatus',
|
||||
key: 'a.ustatus',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'biz_status',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: BasicTableProps = {
|
||||
api: myPersonListData,
|
||||
beforeFetch: (params) => {
|
||||
params['isAll'] = true;
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
formConfig: searchForm,
|
||||
rowKey: 'personId',
|
||||
};
|
||||
|
||||
export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'personId',
|
||||
itemName: 'personName',
|
||||
isShowCode: true,
|
||||
};
|
||||
@@ -0,0 +1,115 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { MyScreenInfo, myScreenInfoListData } from '@jeesite/biz/api/biz/myScreenInfo';
|
||||
|
||||
const { t } = useI18n('biz.myScreenInfo');
|
||||
|
||||
const modalProps = {
|
||||
title: t('大屏选择'),
|
||||
};
|
||||
|
||||
const searchForm: FormProps<MyScreenInfo> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('大屏名称'),
|
||||
field: 'screenName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('大屏编码'),
|
||||
field: 'screenCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'biz_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<MyScreenInfo>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('大屏名称'),
|
||||
dataIndex: 'screenName',
|
||||
key: 'a.screen_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('大屏编码'),
|
||||
dataIndex: 'screenCode',
|
||||
key: 'a.screen_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('大屏标题'),
|
||||
dataIndex: 'screenTitle',
|
||||
key: 'a.screen_title',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('说明描述'),
|
||||
dataIndex: 'remark',
|
||||
key: 'a.remark',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('状态'),
|
||||
dataIndex: 'ustatus',
|
||||
key: 'a.ustatus',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'biz_status',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: BasicTableProps = {
|
||||
api: myScreenInfoListData,
|
||||
beforeFetch: (params) => {
|
||||
params['isAll'] = true;
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
formConfig: searchForm,
|
||||
rowKey: 'screenCode',
|
||||
};
|
||||
|
||||
export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'screenCode',
|
||||
itemName: 'screenTitle',
|
||||
isShowCode: true,
|
||||
};
|
||||
@@ -6,13 +6,6 @@
|
||||
</div>
|
||||
<div class="tabs-container">
|
||||
<div class="tabs-left">
|
||||
<div
|
||||
class="tab-item"
|
||||
:class="{ active: isHome }"
|
||||
@click="goHome"
|
||||
>
|
||||
<span>首页</span>
|
||||
</div>
|
||||
<div
|
||||
class="tab-item"
|
||||
v-for="item in allTabs"
|
||||
@@ -64,14 +57,9 @@ const getTitle = (title) => {
|
||||
};
|
||||
|
||||
const isHome = computed(() => {
|
||||
return route.path === '/bigScreen' || route.path === '/';
|
||||
return route.path === '/bigScreen/home' || route.path === '/';
|
||||
});
|
||||
|
||||
const goHome = () => {
|
||||
screenTitle.value = HOME_TITLE;
|
||||
router.push('/bigScreen/home').catch(() => {});
|
||||
};
|
||||
|
||||
const isCurrentTab = (routePath) => {
|
||||
return route.path === routePath;
|
||||
};
|
||||
|
||||
@@ -211,10 +211,10 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup name="ViewsBizMyScreenErpSetting">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ElMessage, ElButton, ElInput } from 'element-plus';
|
||||
// import { getChartListAll, getChartSetting } from '@/api/bizChart'
|
||||
import { MyChartInfo, myChartInfoListAll } from '@jeesite/biz/api/biz/myChartInfo';
|
||||
|
||||
const metric1 = ref([]);
|
||||
const metric2 = ref([]);
|
||||
@@ -233,7 +233,7 @@ const gridOriginalChartId = ref({
|
||||
const metricHistory = ref({});
|
||||
|
||||
const saveLoading = ref(false);
|
||||
const rawChartData = ref([]);
|
||||
const rawChartData = ref<MyChartInfo[]>();
|
||||
const searchKey = ref('');
|
||||
const dragItem = ref(null);
|
||||
|
||||
@@ -376,7 +376,7 @@ const getRandomColor = () => {
|
||||
async function getChartList() {
|
||||
try {
|
||||
const reqParams = { chartCode: 'erp' };
|
||||
const res = await getChartListAll(reqParams);
|
||||
const res = await myChartInfoListAll(reqParams);
|
||||
rawChartData.value = res || [];
|
||||
|
||||
metricHistory.value = {};
|
||||
|
||||
@@ -134,10 +134,10 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup name="ViewsBizMyScreenHomeSetting">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ElMessage, ElButton, ElInput } from 'element-plus';
|
||||
// import { getChartListAll, getChartSetting } from '@/api/bizChart'
|
||||
import { MyChartInfo, myChartInfoListAll } from '@jeesite/biz/api/biz/myChartInfo';
|
||||
|
||||
const metric1 = ref([]);
|
||||
const metric2 = ref([]);
|
||||
@@ -154,7 +154,7 @@ const gridOriginalChartId = ref({
|
||||
const metricHistory = ref({});
|
||||
|
||||
const saveLoading = ref(false);
|
||||
const rawChartData = ref([]);
|
||||
const rawChartData = ref<MyChartInfo[]>();
|
||||
const searchKey = ref('');
|
||||
const dragItem = ref(null);
|
||||
|
||||
@@ -297,7 +297,7 @@ const getRandomColor = () => {
|
||||
async function getChartList() {
|
||||
try {
|
||||
const reqParams = { chartCode: 'home' };
|
||||
const res = await getChartListAll(reqParams);
|
||||
const res = await myChartInfoListAll(reqParams);
|
||||
rawChartData.value = res || [];
|
||||
metricHistory.value = {};
|
||||
Object.keys(gridOriginalChartId.value).forEach(key => {
|
||||
|
||||
@@ -157,10 +157,10 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup name="ViewsBizMyScreenSysSetting">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ElMessage, ElButton, ElInput } from 'element-plus';
|
||||
// import { getChartListAll, getChartSetting } from '@/api/bizChart'
|
||||
import { MyChartInfo, myChartInfoListAll } from '@jeesite/biz/api/biz/myChartInfo';
|
||||
|
||||
const metric1 = ref([]);
|
||||
const metric2 = ref([]);
|
||||
@@ -179,7 +179,7 @@ const gridOriginalChartId = ref({
|
||||
const metricHistory = ref({});
|
||||
|
||||
const saveLoading = ref(false);
|
||||
const rawChartData = ref([]);
|
||||
const rawChartData = ref<MyChartInfo[]>();
|
||||
const searchKey = ref('');
|
||||
const dragItem = ref(null);
|
||||
|
||||
@@ -323,7 +323,7 @@ const getRandomColor = () => {
|
||||
async function getChartList() {
|
||||
try {
|
||||
const reqParams = { chartCode: 'sys' };
|
||||
const res = await getChartListAll(reqParams);
|
||||
const res = await myChartInfoListAll(reqParams);
|
||||
rawChartData.value = res || [];
|
||||
metricHistory.value = {};
|
||||
Object.keys(gridOriginalChartId.value).forEach(key => {
|
||||
|
||||
@@ -126,10 +126,10 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup name="ViewsBizMyScreenWorkSetting">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
// import { getChartListAll, getChartSetting } from '@/api/bizChart'
|
||||
import { MyChartInfo, myChartInfoListAll } from '@jeesite/biz/api/biz/myChartInfo';
|
||||
|
||||
const metric1 = ref([]);
|
||||
const metric2 = ref([]);
|
||||
@@ -147,7 +147,7 @@ const gridOriginalChartId = ref({
|
||||
const metricHistory = ref({});
|
||||
|
||||
const saveLoading = ref(false);
|
||||
const rawChartData = ref([]);
|
||||
const rawChartData = ref<MyChartInfo[]>();
|
||||
const searchKey = ref('');
|
||||
const dragItem = ref(null);
|
||||
|
||||
@@ -291,7 +291,7 @@ const getRandomColor = () => {
|
||||
async function getChartList() {
|
||||
try {
|
||||
const reqParams = { chartCode: 'work' };
|
||||
const res = await getChartListAll(reqParams);
|
||||
const res = await myChartInfoListAll(reqParams);
|
||||
rawChartData.value = res || [];
|
||||
metricHistory.value = {};
|
||||
Object.keys(gridOriginalChartId.value).forEach(key => {
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="chart-top-container">
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
<div class="num-value">{{ item.value }}</div>
|
||||
<div class="num-label">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
// import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "werpIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
if (container) {
|
||||
const height = container.parentElement.clientHeight
|
||||
container.style.height = `${height}px`
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => {},
|
||||
() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-top-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 4px;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
height: 85%;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/item/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.card-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
}
|
||||
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid rgba(224, 230, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
opacity: 0.9;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.icon-box:hover .icon-img {
|
||||
opacity: 1;
|
||||
transform: scale(1.05);
|
||||
filter: brightness(1.1) contrast(1.2);
|
||||
}
|
||||
|
||||
.card-text {
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.module-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.desc-text {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.card-right {
|
||||
text-align: right;
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.num-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
background: linear-gradient(to right, #3c9cff, #7472fe);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.num-label {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.card-item {
|
||||
min-width: 140px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.icon-box {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.module-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-top-container {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
gap: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.card-item {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
min-width: unset;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.card-item {
|
||||
height: 80%;
|
||||
}
|
||||
.icon-box {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">余额结构分析</span>
|
||||
<span class="total-amount">合计:¥{{ formatAmount(totalAmount) }}</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
|
||||
<teleport to="body">
|
||||
<div v-if="modalVisible" class="modal-overlay" @click.self="closeModal">
|
||||
<div class="modal-content">
|
||||
<IndexV01
|
||||
:account-data="selectedAccountData"
|
||||
@close="closeModal"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { ErpAccount, erpAccountListAll } from '@jeesite/erp/api/erp/account';
|
||||
import IndexV01 from './detail/indexV01.vue'
|
||||
|
||||
const vList = ref<ErpAccount[]>()
|
||||
const totalAmount = ref(0)
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
const modalVisible = ref(false)
|
||||
const selectedAccountData = ref({})
|
||||
|
||||
const formatAmount = (amount: any) => {
|
||||
return Number(amount).toFixed(2)
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const res = await erpAccountListAll()
|
||||
vList.value = res || []
|
||||
calculateTotalAmount(vList.value)
|
||||
initPieChart()
|
||||
} catch (error) {
|
||||
console.error('获取余额数据失败:', error)
|
||||
vList.value = []
|
||||
totalAmount.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
function calculateTotalAmount(data: any[]) {
|
||||
if (!Array.isArray(data)) {
|
||||
totalAmount.value = 0
|
||||
return
|
||||
}
|
||||
totalAmount.value = data.reduce((sum, item) => {
|
||||
const value = Number(item.currentBalance) || 0
|
||||
return sum + value
|
||||
}, 0)
|
||||
}
|
||||
|
||||
const closeModal = () => {
|
||||
modalVisible.value = false
|
||||
selectedAccountData.value = {}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => ({
|
||||
name: item.accountName || '未知账户',
|
||||
value: (Number(item.currentBalance) || 0) / 10000,
|
||||
originalValue: Number(item.currentBalance) || 0,
|
||||
rawData: item
|
||||
})).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params: any) {
|
||||
return `账户:${params.name}<br/>余额:${Number(params.data.originalValue).toFixed(2)}元<br/>占比:${params.percent.toFixed(2)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '余额',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: function(params: any) {
|
||||
return `${params.name} ${Number(params.value).toFixed(2)}万元 (${params.percent.toFixed(2)}%)`
|
||||
},
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
|
||||
chartInstance.on('click', (params: any) => {
|
||||
selectedAccountData.value = {
|
||||
name: params.name,
|
||||
originalValue: params.data.originalValue,
|
||||
value: params.data.value,
|
||||
percent: params.percent,
|
||||
rawData: params.data.rawData
|
||||
}
|
||||
modalVisible.value = true
|
||||
})
|
||||
|
||||
chartInstance.on('legendselectchanged', (params: any) => {
|
||||
const selectedNames = Object.keys(params.selected).filter(name => params.selected[name])
|
||||
const selectedData = vList.value.filter(item => {
|
||||
const accountName = item.accountName || '未知账户'
|
||||
return selectedNames.includes(accountName)
|
||||
})
|
||||
calculateTotalAmount(selectedData)
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@jeesite/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: rgba(0, 0, 0, 0.1) url("@jeesite/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.total-amount {
|
||||
font-size: 14px;
|
||||
color: #e0e6ff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:global(.modal-overlay) {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
:global(.modal-content) {
|
||||
width: 90vw;
|
||||
height: 90vh;
|
||||
max-width: 1400px;
|
||||
max-height: 800px;
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,240 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">年度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
|
||||
const resizeHandler = () => {
|
||||
chartInstance?.resize()
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
itemCode: 'ERP_YEARPMOM_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const xData = vList.value.map(item => item.xaxis || '')
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
const index04 = vList.value.map(item => item.index04 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6,
|
||||
formatter: params => {
|
||||
const idx = params[0].dataIndex
|
||||
return `
|
||||
<div style="text-align:center;font-weight:bold;margin-bottom:6px">${params[0].axisValue}</div>
|
||||
<table style="width:100%;border-collapse:collapse;text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">利润率(%)</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px;font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index01Yuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index02Yuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index03[idx]}</td>
|
||||
<td style="border:1px solid #409EFF;padding:4px">${index04[idx]}</td>
|
||||
</tr>
|
||||
</table>`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '利润率', '占比']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
data: xData,
|
||||
axisLabel: { fontSize: 11, interval: 0, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '比率 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: index01Wan,
|
||||
barWidth: '10%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'#85E868' },
|
||||
{ offset:1, color:'#67C23A' }
|
||||
]),
|
||||
borderRadius: [8,8,0,0]
|
||||
},
|
||||
label: { show:true, position:'top', fontSize:10, color:'#fff', formatter:'{c}' }
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: index02Wan,
|
||||
barWidth: '10%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'#FF8A8A' },
|
||||
{ offset:1, color:'#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8,8,0,0]
|
||||
},
|
||||
label: { show:true, position:'top', fontSize:10, color:'#fff', formatter:'{c}' }
|
||||
},
|
||||
{
|
||||
name: '利润率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: index03,
|
||||
smooth: true,
|
||||
lineStyle: { width:1.5, color:'#FCC367' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: { show:true, position:'outside', fontSize:10, color:'#FCC367', formatter:'{c}', offset:[0,-5] },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'rgba(252,195,103,0.3)' },
|
||||
{ offset:1, color:'rgba(252,195,103,0)' }
|
||||
])
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: index04,
|
||||
smooth: true,
|
||||
lineStyle: { width:1.5, color:'#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: { show:true, position:'outside', fontSize:10, color:'#409EFF', formatter:'{c}', offset:[0,-5] },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0,0,0,1,[
|
||||
{ offset:0, color:'rgba(64,158,255,0.3)' },
|
||||
{ offset:1, color:'rgba(64,158,255,0)' }
|
||||
])
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option, true)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList()
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
chartInstance?.dispose()
|
||||
chartInstance = null
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">账户收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_ACCOUNT_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '净利润 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '净利润',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03Yuan = vList.value.map(item => item.index03 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index03Wan = index03Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const netProfitVal = index03Yuan[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${netProfitVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03Wan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">支出结构分析</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_CATEGORY_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取支出数据失败:', error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => {
|
||||
const originalValue = item.index01 || 0
|
||||
const wanValue = (originalValue / 10000).toFixed(2)
|
||||
return {
|
||||
name: item.xaxis || '未知分类',
|
||||
value: Number(wanValue),
|
||||
originalValue: originalValue
|
||||
}
|
||||
}).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params) {
|
||||
return `分类:${params.name}<br/>支出:${params.data.originalValue}元<br/>占比:${params.percent.toFixed(1)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '支出',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: '{b} {c}万元 ({d}%)',
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
initPieChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/23.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">收入来源分析</span>
|
||||
</div>
|
||||
<div class="pie-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_CATEGORY_Y002',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取收入数据失败:', error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initPieChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const pieData = vList.value.map(item => {
|
||||
const originalValue = item.index01 || 0
|
||||
const wanValue = (originalValue / 10000).toFixed(2)
|
||||
return {
|
||||
name: item.xaxis || '未知分类',
|
||||
value: Number(wanValue),
|
||||
originalValue: originalValue
|
||||
}
|
||||
}).filter(item => item.value > 0)
|
||||
|
||||
const colorList = [
|
||||
'#409EFF', '#36CFc9', '#67C23A', '#E6A23C', '#F56C6C',
|
||||
'#909399', '#722ED1', '#EB2F96', '#1890FF', '#52C41A',
|
||||
'#FAAD14', '#F5222D', '#8C8C8C', '#A062D4', '#F7BA1E'
|
||||
]
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70', fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
borderRadius: 6,
|
||||
formatter: function(params) {
|
||||
return `分类:${params.name}<br/>收入:${params.data.originalValue}元<br/>占比:${params.percent.toFixed(1)}%`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
top: '10%',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 11, color: '#e0e6ff' },
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
itemGap: 10,
|
||||
pageIconColor: '#409EFF',
|
||||
pageTextStyle: { color: '#e0e6ff', fontSize: 10 },
|
||||
pageButtonItemGap: 6,
|
||||
pageButtonGap: 10,
|
||||
type: 'scroll'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'pie',
|
||||
radius: ['30%', '55%'],
|
||||
center: ['50%', '65%'],
|
||||
avoidLabelOverlap: true,
|
||||
itemStyle: {
|
||||
borderRadius: 4,
|
||||
borderColor: 'rgba(15, 52, 96, 0.9)',
|
||||
borderWidth: 1
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: '{b} {c}万元 ({d}%)',
|
||||
overflow: 'truncate',
|
||||
ellipsis: '...',
|
||||
distance: 8
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
length: 12,
|
||||
length2: 8,
|
||||
lineStyle: { color: '#e0e6ff', width: 1 },
|
||||
smooth: 0.2,
|
||||
minTurnAngle: 45
|
||||
},
|
||||
data: pieData,
|
||||
color: colorList
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
initPieChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/23.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.pie-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
|
||||
:deep(.echarts-legend-scroll) {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-text) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button) {
|
||||
border-color: #1a508b !important;
|
||||
}
|
||||
:deep(.echarts-legend-scroll-button-icon) {
|
||||
color: #409EFF !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label) {
|
||||
z-index: 9999 !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 10px !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
|
||||
:deep(.ec-label-line) {
|
||||
stroke: #e0e6ff !important;
|
||||
stroke-width: 1px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">月度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARPSAV_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '利润率', '净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '利润率 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '利润率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '净利润',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#FF9D28' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
fontSize: 10,
|
||||
color: '#FF9D28',
|
||||
formatter: '{c}'
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(255, 157, 40, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(255, 157, 40, 0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis.includes('月') ? xaxis : `${xaxis}月`;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
const index04Yuan = vList.value.map(item => item.index04 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index04Wan = index04Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const rateVal = index03[idx]
|
||||
const profitVal = index04Yuan[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">利润率(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rateVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${profitVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03
|
||||
baseOption.series[3].data = index04Wan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">支出排名分析</span>
|
||||
</div>
|
||||
<div class="rank-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARRANK_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const initRankChart = () => {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const sortedList = [...vList.value]
|
||||
.sort((a, b) => Number(b.index01 || 0) - Number(a.index01 || 0))
|
||||
.slice(0, 10)
|
||||
|
||||
const yData = sortedList.map((item, index) => `${index + 1}. ${item.xaxis || '未知'}`)
|
||||
const valueData = sortedList.map(item => Number((Number(item.index01 || 0) / 10000).toFixed(2)) || 0)
|
||||
const percentData = sortedList.map(item => Number(Number(item.index02 || 0).toFixed(2)) || 0)
|
||||
const originalData = sortedList.map(item => Number(item.index01 || 0))
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'shadow' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6,
|
||||
formatter: params => {
|
||||
const idx = params[0].dataIndex
|
||||
const name = params[0].name
|
||||
const amount = originalData[idx]
|
||||
const rate = percentData[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${name}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${amount}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rate}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '15%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
axisLabel: { fontSize: 11, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: yData,
|
||||
axisLabel: { fontSize: 11, color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
inverse: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
barWidth: '12%',
|
||||
data: valueData,
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{ offset: 0, color: '#409EFF' },
|
||||
{ offset: 0, color: '#409EFF' },
|
||||
{ offset: 1, color: '#1890FF' }
|
||||
])
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'right',
|
||||
fontSize: 10,
|
||||
color: '#e0e6ff',
|
||||
formatter: params => `${params.value} 万元 (${percentData[params.dataIndex]}%)`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
chartInstance.setOption(option)
|
||||
}
|
||||
|
||||
watch(() => props.formParams, () => {
|
||||
getList()
|
||||
}, { deep: true, immediate: true })
|
||||
|
||||
watch(vList, () => {
|
||||
initRankChart()
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initRankChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/23.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.rank-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,286 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">季度收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARQUAR_Y001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (!chartInstance) {
|
||||
chartInstance = echarts.init(el)
|
||||
}
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '占比']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '占比 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#85E868' },
|
||||
{ offset: 1, color: '#67C23A' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF8A8A' },
|
||||
{ offset: 1, color: '#F56C6C' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
fontSize: 10,
|
||||
color: '#409EFF',
|
||||
formatter: '{c}',
|
||||
offset: [0, -5]
|
||||
},
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis;
|
||||
})
|
||||
const index01Yuan = vList.value.map(item => item.index01 || 0)
|
||||
const index02Yuan = vList.value.map(item => item.index02 || 0)
|
||||
const index03 = vList.value.map(item => item.index03 || 0)
|
||||
|
||||
const index01Wan = index01Yuan.map(val => (val / 10000).toFixed(2))
|
||||
const index02Wan = index02Yuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
const incomeVal = index01Yuan[idx]
|
||||
const expenseVal = index02Yuan[idx]
|
||||
const rateVal = index03[idx]
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseVal}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rateVal}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = index01Wan
|
||||
baseOption.series[1].data = index02Wan
|
||||
baseOption.series[2].data = index03
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/23.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,416 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">环比收支分析</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
});
|
||||
|
||||
const vList = ref([])
|
||||
const chartRef = ref(null)
|
||||
let chartInstance = null
|
||||
const resizeHandler = () => chartInstance?.resize()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const params = {
|
||||
...props.formParams,
|
||||
itemCode: 'ERP_YEARDATA_M001',
|
||||
}
|
||||
const res = await getItemInfoList(params)
|
||||
vList.value = res || []
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
vList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
function initChart() {
|
||||
const el = chartRef.value
|
||||
if (!el) return
|
||||
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
}
|
||||
chartInstance = echarts.init(el)
|
||||
|
||||
const baseOption = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'cross' },
|
||||
backgroundColor: 'rgba(145, 200, 255, 0.9)',
|
||||
borderColor: '#409EFF',
|
||||
borderWidth: 1,
|
||||
textStyle: { color: '#0a3b70' },
|
||||
padding: [8, 12],
|
||||
borderRadius: 6
|
||||
},
|
||||
legend: {
|
||||
top: '10',
|
||||
left: 'center',
|
||||
textStyle: { fontSize: 12, color: '#e0e6ff' },
|
||||
data: ['收入', '支出', '占比', '上月收入', '上月支出', '收入环比', '支出环比', '本月净利润']
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
right: '5%',
|
||||
bottom: '10%',
|
||||
top: '15%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: {
|
||||
fontSize: 11,
|
||||
interval: 0,
|
||||
color: '#b4c7e7'
|
||||
},
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
boundaryGap: true
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '金额 (万元)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value}', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.3)' } }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '占比/环比 (%)',
|
||||
nameTextStyle: { fontSize: 12, color: '#b4c7e7' },
|
||||
axisLabel: { formatter: '{value} %', color: '#b4c7e7' },
|
||||
axisLine: { lineStyle: { color: '#1a508b' } },
|
||||
splitLine: { lineStyle: { color: 'rgba(26, 80, 139, 0.2)' } },
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
scale: true
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '收入',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#67C23A' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(103, 194, 58, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(103, 194, 58, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#F56C6C' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(245, 108, 108, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(245, 108, 108, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '占比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#409EFF' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(64, 158, 255, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(64, 158, 255, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '上月收入',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#36CFc9' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(54, 207, 201, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(54, 207, 201, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '上月支出',
|
||||
type: 'line',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#E6A23C' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(230, 162, 60, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(230, 162, 60, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '收入环比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#722ED1' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(114, 46, 209, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(114, 46, 209, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '支出环比',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
data: [],
|
||||
smooth: true,
|
||||
lineStyle: { width: 1.5, color: '#EB2F96' },
|
||||
symbol: 'circle',
|
||||
symbolSize: 5,
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: 'rgba(235, 47, 150, 0.3)' },
|
||||
{ offset: 1, color: 'rgba(235, 47, 150, 0.0)' }
|
||||
])
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: { width: 2 },
|
||||
symbolSize: 7
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '本月净利润',
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: [],
|
||||
barWidth: '12%',
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#FF9D28' },
|
||||
{ offset: 1, color: '#FAAD14' }
|
||||
]),
|
||||
borderRadius: [8, 8, 0, 0]
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'top',
|
||||
fontSize: 10,
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (vList.value.length > 0) {
|
||||
const xData = vList.value.map(item => {
|
||||
const xaxis = item.xaxis || ''
|
||||
return xaxis.includes('月') ? xaxis : `${xaxis}月`;
|
||||
})
|
||||
const incomeYuan = vList.value.map(item => Number(item.index01 || 0))
|
||||
const expenseYuan = vList.value.map(item => Number(item.index02 || 0))
|
||||
const rate = vList.value.map(item => Number(item.index03 || 0).toFixed(2))
|
||||
const lastMonthIncomeYuan = vList.value.map(item => Number(item.index04 || 0))
|
||||
const lastMonthExpenseYuan = vList.value.map(item => Number(item.index05 || 0))
|
||||
const netProfitYuan = vList.value.map(item => (Number(item.index01 || 0) - Number(item.index02 || 0)).toFixed(2))
|
||||
|
||||
const incomeRingRatio = vList.value.map((item, idx) => {
|
||||
const lastVal = lastMonthIncomeYuan[idx]
|
||||
const currVal = incomeYuan[idx] || 0
|
||||
return lastVal === 0 ? '0.00' : ((currVal - lastVal) / lastVal * 100).toFixed(2)
|
||||
})
|
||||
const expenseRingRatio = vList.value.map((item, idx) => {
|
||||
const lastVal = lastMonthExpenseYuan[idx]
|
||||
const currVal = expenseYuan[idx] || 0
|
||||
return lastVal === 0 ? '0.00' : ((currVal - lastVal) / lastVal * 100).toFixed(2)
|
||||
})
|
||||
|
||||
const incomeWan = incomeYuan.map(val => (val / 10000).toFixed(2))
|
||||
const expenseWan = expenseYuan.map(val => (val / 10000).toFixed(2))
|
||||
const lastMonthIncomeWan = lastMonthIncomeYuan.map(val => (val / 10000).toFixed(2))
|
||||
const lastMonthExpenseWan = lastMonthExpenseYuan.map(val => (val / 10000).toFixed(2))
|
||||
const netProfitWan = netProfitYuan.map(val => (val / 10000).toFixed(2))
|
||||
|
||||
baseOption.tooltip.formatter = function (params) {
|
||||
const title = params[0].axisValue
|
||||
const idx = params[0].dataIndex
|
||||
return `
|
||||
<div style="text-align:center; font-weight:bold; margin-bottom:6px">${title}</div>
|
||||
<table style="width:100%; border-collapse:collapse; text-align:center">
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">本月收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">本月支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">上月收入(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">上月支出(元)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">收入环比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">支出环比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">占比(%)</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px; font-weight:bold">净利润(元)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${lastMonthIncomeYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${lastMonthExpenseYuan[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${incomeRingRatio[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${expenseRingRatio[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${rate[idx]}</td>
|
||||
<td style="border:1px solid #409EFF; padding:4px">${netProfitYuan[idx]}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
baseOption.xAxis[0].data = xData
|
||||
baseOption.series[0].data = incomeWan
|
||||
baseOption.series[1].data = expenseWan
|
||||
baseOption.series[2].data = rate
|
||||
baseOption.series[3].data = lastMonthIncomeWan
|
||||
baseOption.series[4].data = lastMonthExpenseWan
|
||||
baseOption.series[5].data = incomeRingRatio
|
||||
baseOption.series[6].data = expenseRingRatio
|
||||
baseOption.series[7].data = netProfitWan
|
||||
}
|
||||
|
||||
chartInstance.setOption(baseOption, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getList()
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
watch(vList, () => {
|
||||
nextTick(() => initChart())
|
||||
}, { deep: true })
|
||||
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
chartInstance = null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/14.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip) {
|
||||
background-color: rgba(145, 200, 255, 0.9) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #0a3b70 !important;
|
||||
border-radius: 6px !important;
|
||||
white-space: nowrap !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<el-carousel height="100%" arrow="hover" trigger="click" :autoplay="false">
|
||||
<el-carousel-item>
|
||||
<div class="carousel-item-inner">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">账户收入分析</span>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<div class="custom-loading" v-if="dataLoading">
|
||||
<el-icon class="loading-icon"><Loading /></el-icon>
|
||||
<span class="loading-text">加载中...</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="incomeData"
|
||||
stripe
|
||||
empty-text="暂无账户收入数据"
|
||||
:row-style="{ background: 'transparent' }"
|
||||
:cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
:header-row-style="{ background: 'transparent' }"
|
||||
:header-cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
>
|
||||
<el-table-column prop="xaxis" label="账户名称" width="120" fixed="left" />
|
||||
<el-table-column v-for="m in 12" :key="`in-${m}`" :prop="`index${String(m).padStart(2, '0')}`" :label="`${m}月`" align="center" />
|
||||
<el-table-column prop="indexSum" label="合计" width="120" fixed="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
|
||||
<el-carousel-item>
|
||||
<div class="carousel-item-inner">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">账户支出分析</span>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<div class="custom-loading" v-if="dataLoading">
|
||||
<el-icon class="loading-icon"><Loading /></el-icon>
|
||||
<span class="loading-text">加载中...</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="expenseData"
|
||||
stripe
|
||||
empty-text="暂无账户支出数据"
|
||||
:row-style="{ background: 'transparent' }"
|
||||
:cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
:header-row-style="{ background: 'transparent' }"
|
||||
:header-cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
>
|
||||
<el-table-column prop="xaxis" label="账户名称" width="120" fixed="left" />
|
||||
<el-table-column v-for="m in 12" :key="`ex-${m}`" :prop="`index${String(m).padStart(2, '0')}`" :label="`${m}月`" align="center" />
|
||||
<el-table-column prop="indexSum" label="合计" width="120" fixed="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const incomeData = ref([])
|
||||
const expenseData = ref([])
|
||||
const dataLoading = ref(false)
|
||||
|
||||
async function getIncomeList() {
|
||||
try {
|
||||
const res = await getItemInfoList({ ...props.formParams, itemCode: 'ERP_YEAR_ACCOUNT_Y001' })
|
||||
incomeData.value = res || []
|
||||
} catch (e) {
|
||||
incomeData.value = []
|
||||
console.error('数据加载失败:', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function getExpenseList() {
|
||||
try {
|
||||
const res = await getItemInfoList({ ...props.formParams, itemCode: 'ERP_YEAR_ACCOUNT_Y002' })
|
||||
expenseData.value = res || []
|
||||
} catch (e) {
|
||||
expenseData.value = []
|
||||
console.error('数据加载失败:', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
dataLoading.value = true
|
||||
await Promise.all([getIncomeList(), getExpenseList()])
|
||||
dataLoading.value = false
|
||||
}
|
||||
|
||||
watch(() => props.formParams, () => getList(), { deep: true, immediate: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100% !important;
|
||||
}
|
||||
|
||||
.carousel-item-inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/14.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
background: transparent !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.custom-loading {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.1) !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.loading-icon {
|
||||
font-size: 24px;
|
||||
color: #409EFF;
|
||||
animation: loading-rotate 2s linear infinite;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 14px;
|
||||
color: #b4c7e7;
|
||||
}
|
||||
|
||||
@keyframes loading-rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-carousel),
|
||||
:deep(.el-carousel__container),
|
||||
:deep(.el-carousel__item) {
|
||||
height: 100% !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-bg-color: transparent !important;
|
||||
--el-table-text-color: #b4c7e7 !important;
|
||||
--el-table-header-text-color: #b4c7e7 !important;
|
||||
--el-table-row-hover-bg-color: rgba(26, 80, 139, 0.2) !important;
|
||||
--el-table-border-color: transparent !important;
|
||||
--el-table-stripe-row-bg-color: rgba(0, 0, 0, 0.1) !important;
|
||||
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
:deep(.el-table *),
|
||||
:deep(.el-table__inner-wrapper),
|
||||
:deep(.el-table__body-wrapper),
|
||||
:deep(.el-table__header-wrapper),
|
||||
:deep(.el-table__body),
|
||||
:deep(.el-table__header),
|
||||
:deep(.el-table__body tr),
|
||||
:deep(.el-table__header tr) {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__header th),
|
||||
:deep(.el-table__body td) {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(26, 80, 139, 0.3) !important;
|
||||
color: #b4c7e7 !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__empty-block),
|
||||
:deep(.el-table__empty-text) {
|
||||
background: transparent !important;
|
||||
color: #b4c7e7 !important;
|
||||
}
|
||||
|
||||
.table-container::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
.table-container::-webkit-scrollbar-thumb {
|
||||
background: rgba(26, 80, 139, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.table-container::-webkit-scrollbar-track {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<el-carousel height="100%" arrow="hover" trigger="click" :autoplay="false">
|
||||
<el-carousel-item>
|
||||
<div class="carousel-item-inner">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">分类收入分析</span>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<div class="custom-loading" v-if="dataLoading">
|
||||
<el-icon class="loading-icon"><Loading /></el-icon>
|
||||
<span class="loading-text">加载中...</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="incomeData"
|
||||
stripe
|
||||
empty-text="暂无分类收入数据"
|
||||
:row-style="{ background: 'transparent' }"
|
||||
:cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
:header-row-style="{ background: 'transparent' }"
|
||||
:header-cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
>
|
||||
<el-table-column prop="xaxis" label="分类名称" width="120" fixed="left" />
|
||||
<el-table-column v-for="m in 12" :key="`in-${m}`" :prop="`index${String(m).padStart(2, '0')}`" :label="`${m}月`" align="center" />
|
||||
<el-table-column prop="indexSum" label="合计" width="120" fixed="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
|
||||
<el-carousel-item>
|
||||
<div class="carousel-item-inner">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">分类支出分析</span>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<div class="custom-loading" v-if="dataLoading">
|
||||
<el-icon class="loading-icon"><Loading /></el-icon>
|
||||
<span class="loading-text">加载中...</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="expenseData"
|
||||
stripe
|
||||
empty-text="暂无分类支出数据"
|
||||
:row-style="{ background: 'transparent' }"
|
||||
:cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
:header-row-style="{ background: 'transparent' }"
|
||||
:header-cell-style="{ borderBottom: '1px solid rgba(26, 80, 139, 0.3)' }"
|
||||
>
|
||||
<el-table-column prop="xaxis" label="分类名称" width="120" fixed="left" />
|
||||
<el-table-column v-for="m in 12" :key="`ex-${m}`" :prop="`index${String(m).padStart(2, '0')}`" :label="`${m}月`" align="center" />
|
||||
<el-table-column prop="indexSum" label="合计" width="120" fixed="right" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
// import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const incomeData = ref([])
|
||||
const expenseData = ref([])
|
||||
const dataLoading = ref(false)
|
||||
|
||||
async function getIncomeList() {
|
||||
try {
|
||||
const res = await getItemInfoList({ ...props.formParams, itemCode: 'ERP_YEAR_CATE_Y001' })
|
||||
incomeData.value = res || []
|
||||
} catch (e) {
|
||||
incomeData.value = []
|
||||
console.error('数据加载失败:', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function getExpenseList() {
|
||||
try {
|
||||
const res = await getItemInfoList({ ...props.formParams, itemCode: 'ERP_YEAR_CATE_Y002' })
|
||||
expenseData.value = res || []
|
||||
} catch (e) {
|
||||
expenseData.value = []
|
||||
console.error('数据加载失败:', e)
|
||||
}
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
dataLoading.value = true
|
||||
await Promise.all([getIncomeList(), getExpenseList()])
|
||||
dataLoading.value = false
|
||||
}
|
||||
|
||||
watch(() => props.formParams, () => getList(), { deep: true, immediate: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100% !important;
|
||||
}
|
||||
|
||||
.carousel-item-inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/14.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
background: transparent !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.custom-loading {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.1) !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.loading-icon {
|
||||
font-size: 24px;
|
||||
color: #409EFF;
|
||||
animation: loading-rotate 2s linear infinite;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 14px;
|
||||
color: #b4c7e7;
|
||||
}
|
||||
|
||||
@keyframes loading-rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-carousel),
|
||||
:deep(.el-carousel__container),
|
||||
:deep(.el-carousel__item) {
|
||||
height: 100% !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-bg-color: transparent !important;
|
||||
--el-table-text-color: #b4c7e7 !important;
|
||||
--el-table-header-text-color: #b4c7e7 !important;
|
||||
--el-table-row-hover-bg-color: rgba(26, 80, 139, 0.2) !important;
|
||||
--el-table-border-color: transparent !important;
|
||||
--el-table-stripe-row-bg-color: rgba(0, 0, 0, 0.1) !important;
|
||||
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
:deep(.el-table *),
|
||||
:deep(.el-table__inner-wrapper),
|
||||
:deep(.el-table__body-wrapper),
|
||||
:deep(.el-table__header-wrapper),
|
||||
:deep(.el-table__body),
|
||||
:deep(.el-table__header),
|
||||
:deep(.el-table__body tr),
|
||||
:deep(.el-table__header tr) {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__header th),
|
||||
:deep(.el-table__body td) {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(26, 80, 139, 0.3) !important;
|
||||
color: #b4c7e7 !important;
|
||||
}
|
||||
|
||||
:deep(.el-table__empty-block),
|
||||
:deep(.el-table__empty-text) {
|
||||
background: transparent !important;
|
||||
color: #b4c7e7 !important;
|
||||
}
|
||||
|
||||
.table-container::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
.table-container::-webkit-scrollbar-thumb {
|
||||
background: rgba(26, 80, 139, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.table-container::-webkit-scrollbar-track {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,550 @@
|
||||
<template>
|
||||
<div class="detail-container">
|
||||
<div class="detail-header">
|
||||
<h3>{{ accountData.name }}详情</h3>
|
||||
<button class="close-btn" @click="handleClose">×</button>
|
||||
</div>
|
||||
<div class="split-line"></div>
|
||||
<div class="detail-body">
|
||||
<el-form :model="searchForm" class="search-form">
|
||||
<div class="form-items-wrapper">
|
||||
<el-form-item label="交易名称:" class="form-item">
|
||||
<el-input
|
||||
v-model="searchForm.flowName"
|
||||
placeholder="请输入交易名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="交易类型:" class="form-item">
|
||||
<el-select
|
||||
v-model="searchForm.transactionType"
|
||||
placeholder="请选择交易类型"
|
||||
clearable
|
||||
class="custom-select"
|
||||
teleport="body"
|
||||
popper-class="theme-select-popper"
|
||||
:popper-append-to-body="true"
|
||||
@change="getTranTypes"
|
||||
>
|
||||
<el-option label="收入" value="2" />
|
||||
<el-option label="支出" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="交易分类:" class="form-item">
|
||||
<el-select
|
||||
v-model="searchForm.categoryId"
|
||||
placeholder="请选择交易分类"
|
||||
clearable
|
||||
class="custom-select"
|
||||
teleport="body"
|
||||
popper-class="theme-select-popper"
|
||||
:popper-append-to-body="true"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tranTypes"
|
||||
:key="item.categoryId"
|
||||
:label="item.categoryName"
|
||||
:value="item.categoryId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item class="form-btn-group">
|
||||
<el-button type="primary" @click="handleSearch">查询</el-button>
|
||||
<el-button type="default" @click="handleReset" class="reset-btn">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="table-container">
|
||||
<div class="custom-loading" v-if="loading">
|
||||
<el-icon class="loading-icon"><Loading /></el-icon>
|
||||
<span class="loading-text">加载中...</span>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
empty-text="暂无相关交易数据"
|
||||
class="data-table"
|
||||
:header-row-style="{ background: 'transparent' }"
|
||||
:header-cell-style="{
|
||||
background: 'transparent',
|
||||
color: '#a0cfff',
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.3)'
|
||||
}"
|
||||
:row-style="{
|
||||
background: 'transparent',
|
||||
color: '#a0cfff',
|
||||
border: 'none'
|
||||
}"
|
||||
:cell-style="{
|
||||
border: 'none',
|
||||
borderBottom: '1px solid rgba(64, 158, 255, 0.2)'
|
||||
}"
|
||||
>
|
||||
<el-table-column prop="flowId" label="交易编号" />
|
||||
<el-table-column prop="flowName" label="交易名称" />
|
||||
<el-table-column prop="categoryName" label="交易分类" />
|
||||
<el-table-column prop="tranType" label="交易类型" />
|
||||
<el-table-column prop="amount" label="交易金额">
|
||||
<template #default="scope">
|
||||
¥{{ scope.row.amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="交易备注" />
|
||||
<el-table-column prop="transactionTime" label="交易时间" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-wrapper">
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[20,50,99]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
class="custom-pagination"
|
||||
teleport="body"
|
||||
popper-class="theme-pagination-popper"
|
||||
:popper-append-to-body="true"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, defineEmits, ref, onMounted, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
// import { getErpCategoryList, getErpTransactionFlowList } from '@/api/bizApi'
|
||||
|
||||
const props = defineProps({
|
||||
accountData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const handleClose = () => emit('close')
|
||||
|
||||
const tranTypes = ref();
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm = reactive({
|
||||
flowName: '',
|
||||
transactionType: '',
|
||||
categoryId: '',
|
||||
})
|
||||
|
||||
const tableData = ref([]);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = ref(20);
|
||||
const total = ref(0);
|
||||
|
||||
const handleSearch = () => {
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
Object.assign(searchForm, {
|
||||
flowName: '',
|
||||
transactionType: '',
|
||||
categoryId: '',
|
||||
})
|
||||
currentPage.value = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val;
|
||||
getList();
|
||||
}
|
||||
const handleCurrentChange = (val) => {
|
||||
currentPage.value = val;
|
||||
getList();
|
||||
}
|
||||
|
||||
async function getTranTypes(){
|
||||
try {
|
||||
const params = {
|
||||
categoryType: searchForm.transactionType,
|
||||
}
|
||||
const res = await getErpCategoryList(params);
|
||||
tranTypes.value = res || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
tranTypes.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const reqParmas = {
|
||||
... searchForm,
|
||||
pageNum: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
accountId: props.accountData.rawData?.accountId || '',
|
||||
}
|
||||
const res = await getErpTransactionFlowList(reqParmas);
|
||||
total.value = res.total;
|
||||
tableData.value = res.list || [];
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
tableData.value = [];
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await getTranTypes();
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
color: #e0e6ff;
|
||||
background: url('@jeesite/assets/chart/box/18.png') no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.detail-header h3 {
|
||||
margin: 0;
|
||||
color: #409EFF;
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
font-size: 18px;
|
||||
}
|
||||
.close-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 24px;
|
||||
color: #e0e6ff;
|
||||
cursor: pointer;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: color 0.2s;
|
||||
z-index: 10002;
|
||||
}
|
||||
.close-btn:hover {
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.split-line {
|
||||
height: 1px;
|
||||
background-color: #409EFF;
|
||||
opacity: 0.6;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-body {
|
||||
width: 100%;
|
||||
height: calc(100% - 80px);
|
||||
border: 1px solid #409EFF;
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
background-color: rgba(10, 30, 60, 0.2);
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
overflow: visible;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.3);
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
.form-items-wrapper {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 20px;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.form-item {
|
||||
flex: 1;
|
||||
margin-bottom: 0 !important;
|
||||
min-width: 180px;
|
||||
}
|
||||
.date-range-item {
|
||||
min-width: 280px !important;
|
||||
}
|
||||
.form-btn-group {
|
||||
margin-left: 20px;
|
||||
margin-bottom: 0 !important;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
.custom-loading {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.1) !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.loading-icon {
|
||||
font-size: 24px;
|
||||
color: #409EFF;
|
||||
animation: loading-rotate 2s linear infinite;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 14px;
|
||||
color: #b4c7e7;
|
||||
}
|
||||
|
||||
@keyframes loading-rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.pagination-wrapper {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(64, 158, 255, 0.2);
|
||||
background-color: rgba(10, 30, 60, 0.2);
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: #e0e6ff !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-select__wrapper),
|
||||
:deep(.el-date-editor__wrapper) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
box-shadow: none !important;
|
||||
width: 100% !important;
|
||||
position: relative;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-select__inner),
|
||||
:deep(.el-date-editor input) {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
:deep(.el-input__placeholder),
|
||||
:deep(.el-date-editor__placeholder) {
|
||||
color: rgba(224, 230, 255, 0.6) !important;
|
||||
}
|
||||
|
||||
:deep(.custom-pagination) {
|
||||
--el-pagination-text-color: #e0e6ff;
|
||||
--el-pagination-button-color: #e0e6ff;
|
||||
--el-pagination-button-hover-color: #409EFF;
|
||||
--el-pagination-button-active-color: #409EFF;
|
||||
--el-pagination-border-color: #409EFF;
|
||||
--el-pagination-bg-color: rgba(10, 30, 60, 0.2) !important;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-pagination button) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.el-pagination .el-pager li) {
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.el-pagination .el-pager li.active) {
|
||||
color: #409EFF !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-text-color: #a0cfff;
|
||||
--el-table-header-text-color: #a0cfff;
|
||||
--el-table-row-hover-bg-color: rgba(64, 158, 255, 0.2);
|
||||
--el-table-border-color: transparent !important;
|
||||
--el-table-stripe-row-bg-color: rgba(10, 30, 60, 0.3);
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-table th) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.3) !important;
|
||||
background-color: transparent !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
:deep(.el-table td) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
|
||||
background-color: transparent !important;
|
||||
color: #a0cfff !important;
|
||||
}
|
||||
:deep(.el-table--striped .el-table__row--striped td) {
|
||||
background-color: rgba(10, 30, 60, 0.3) !important;
|
||||
border-bottom-color: rgba(64, 158, 255, 0.2) !important;
|
||||
}
|
||||
:deep(.el-table__row:hover > td) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
border-bottom-color: rgba(64, 158, 255, 0.3) !important;
|
||||
}
|
||||
:deep(.el-table tr:last-child td) {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
:deep(.el-table-empty-text) {
|
||||
color: #a0cfff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
:deep(.el-button) {
|
||||
--el-button-text-color: #e0e6ff !important;
|
||||
--el-button-border-color: #409EFF !important;
|
||||
--el-button-hover-text-color: #fff !important;
|
||||
--el-button-hover-border-color: #409EFF !important;
|
||||
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
|
||||
height: 32px;
|
||||
padding: 0 16px;
|
||||
z-index: 10001;
|
||||
}
|
||||
:deep(.el-button--primary) {
|
||||
--el-button-text-color: #fff !important;
|
||||
--el-button-bg-color: rgba(64, 158, 255, 0.8) !important;
|
||||
--el-button-border-color: #409EFF !important;
|
||||
--el-button-hover-bg-color: #409EFF !important;
|
||||
}
|
||||
:deep(.reset-btn) {
|
||||
background-color: rgba(0, 0, 0, 0.2) !important;
|
||||
border-color: #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
}
|
||||
:deep(.reset-btn:hover) {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.el-loading-mask) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.detail-body::-webkit-scrollbar,
|
||||
:deep(.el-table__body-wrapper)::-webkit-scrollbar,
|
||||
.table-container::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
.detail-body::-webkit-scrollbar-track,
|
||||
.table-container::-webkit-scrollbar-track {
|
||||
background: rgba(10, 30, 60, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.detail-body::-webkit-scrollbar-thumb,
|
||||
.table-container::-webkit-scrollbar-thumb {
|
||||
background: rgba(64, 158, 255, 0.5);
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.theme-select-popper {
|
||||
background-color: rgba(10, 30, 60, 0.95) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
pointer-events: auto !important;
|
||||
position: fixed !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
padding: 6px 12px !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item:hover {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
.theme-select-popper .el-select-dropdown__item.selected {
|
||||
background-color: rgba(64, 158, 255, 0.5) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.theme-pagination-popper {
|
||||
background-color: rgba(10, 30, 60, 0.95) !important;
|
||||
border: 1px solid #409EFF !important;
|
||||
color: #e0e6ff !important;
|
||||
z-index: 99999 !important;
|
||||
pointer-events: auto !important;
|
||||
position: fixed !important;
|
||||
}
|
||||
.theme-pagination-popper .el-pagination__sizes-option {
|
||||
color: #e0e6ff !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
.theme-pagination-popper .el-pagination__sizes-option:hover {
|
||||
background-color: rgba(64, 158, 255, 0.2) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.modal-overlay {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
.modal-overlay .modal-content {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,367 @@
|
||||
<template>
|
||||
<div class="erp-layout-container">
|
||||
<div class="erp-section erp-top-header">
|
||||
<div class="erp-card full-card">
|
||||
<!-- <ChartTop /> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-upper-section">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(1, 3)"
|
||||
:key="item.sort"
|
||||
class="erp-col erp-col-1-3"
|
||||
>
|
||||
<div class="erp-card">
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-middle-section">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-inner-layout">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(4, 5)"
|
||||
:key="item.sort"
|
||||
class="erp-col erp-col-1-2"
|
||||
>
|
||||
<div class="erp-card">
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<component
|
||||
:is="componentMap[getComponentBySort(6)?.vueName || '']"
|
||||
:formParams="FormValues"
|
||||
v-if="getComponentBySort(6) && componentMap[getComponentBySort(6).vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="erp-section erp-lower-section">
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-inner-layout">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(7, 8)"
|
||||
:key="item.sort"
|
||||
class="erp-col erp-col-1-2"
|
||||
>
|
||||
<div class="erp-card">
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-col erp-col-1-2">
|
||||
<div class="erp-card">
|
||||
<component
|
||||
:is="componentMap[getComponentBySort(9)?.vueName || '']"
|
||||
:formParams="FormValues"
|
||||
v-if="getComponentBySort(9) && componentMap[getComponentBySort(9).vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch, onMounted, defineAsyncComponent } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import type { Component } from 'vue';
|
||||
import ChartTop from './components/ChartTop.vue';
|
||||
import { MyChartInfo, myChartInfoListAll } from '@jeesite/biz/api/biz/myChartInfo';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
// 1. 完善类型定义,避免 any 类型
|
||||
const FormValues = ref({
|
||||
reqParam: route.query.year || ''
|
||||
});
|
||||
|
||||
// 2. 定义组件映射的类型
|
||||
interface ComponentMap {
|
||||
[key: string]: Component;
|
||||
}
|
||||
|
||||
// 3. 初始化时赋空数组,避免 undefined 问题
|
||||
const componentMap = ref<ComponentMap>({});
|
||||
const chartData = ref<MyChartInfo[]>([]);
|
||||
|
||||
// 4. 优化空值处理
|
||||
const getComponentBySort = (sort: number): MyChartInfo | undefined => {
|
||||
if (!chartData.value.length) return undefined;
|
||||
return chartData.value.find(item => item.sort === sort);
|
||||
};
|
||||
|
||||
const getComponentsBySortRange = (start: number, end: number): MyChartInfo[] => {
|
||||
if (!chartData.value.length) return [];
|
||||
return chartData.value.filter(item => item.sort >= start && item.sort <= end);
|
||||
};
|
||||
|
||||
// 5. 优化组件加载函数
|
||||
const loadComponent = (vueName: string) => {
|
||||
return defineAsyncComponent({
|
||||
loader: () => import(`./components/${vueName}.vue`),
|
||||
delay: 200,
|
||||
timeout: 5000
|
||||
});
|
||||
};
|
||||
|
||||
// 6. 封装数据获取逻辑
|
||||
async function getChartList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
chartCode: 'erp'
|
||||
};
|
||||
const res = await myChartInfoListAll(reqParams);
|
||||
chartData.value = res || [];
|
||||
// 排序确保顺序正确
|
||||
chartData.value.sort((a, b) => a.sort - b.sort);
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
chartData.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
// 7. 监听路由参数变化
|
||||
watch(
|
||||
() => route.query.year,
|
||||
(newVal) => {
|
||||
FormValues.value.reqParam = newVal || '';
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await getChartList();
|
||||
|
||||
const newComponentMap: ComponentMap = {};
|
||||
// 获取唯一的组件名称
|
||||
const uniqueComponents = [...new Set(chartData.value.map(item => item.vueName))];
|
||||
|
||||
// 加载所有需要的组件
|
||||
for (const vueName of uniqueComponents) {
|
||||
if (vueName) {
|
||||
newComponentMap[vueName] = loadComponent(vueName);
|
||||
}
|
||||
}
|
||||
|
||||
componentMap.value = newComponentMap;
|
||||
} catch (error) {
|
||||
console.error('加载图表数据失败:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.erp-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-top-header {
|
||||
height: 10%;
|
||||
}
|
||||
|
||||
.erp-upper-section,
|
||||
.erp-middle-section,
|
||||
.erp-lower-section {
|
||||
height: 30%;
|
||||
}
|
||||
|
||||
.erp-col {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.erp-col-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
}
|
||||
|
||||
.erp-col-1-2 {
|
||||
width: calc((100% - 2px) / 2);
|
||||
}
|
||||
|
||||
.erp-inner-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.erp-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.1);
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(2px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.erp-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.erp-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.erp-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.empty-card {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #88a0c2;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* 优化移动端样式 */
|
||||
@media (max-width: 1600px) {
|
||||
.erp-layout-container {
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-section {
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-col-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
}
|
||||
.erp-col-1-2 {
|
||||
width: calc((100% - 2px) / 2);
|
||||
}
|
||||
.erp-inner-layout {
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 2px;
|
||||
}
|
||||
.erp-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.erp-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.erp-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100vh;
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.erp-section {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
min-height: 120px;
|
||||
gap: 2px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.erp-col-1-3,
|
||||
.erp-col-1-2 {
|
||||
width: 100%;
|
||||
height: 120px; /* 固定高度,避免计算错误 */
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.erp-inner-layout {
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 8px; /* 增加移动端内边距,提升体验 */
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.erp-layout-container {
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-section {
|
||||
gap: 2px;
|
||||
}
|
||||
.erp-card {
|
||||
padding: 2px;
|
||||
}
|
||||
.erp-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.erp-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="chart-top-container">
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
<div class="num-value">{{ item.value }}</div>
|
||||
<div class="num-label">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
// import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "homeIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
if (container) {
|
||||
const height = container.parentElement.clientHeight
|
||||
container.style.height = `${height}px`
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => {},
|
||||
() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-top-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 4px;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
height: 85%;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/item/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.card-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
}
|
||||
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid rgba(224, 230, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
opacity: 0.9;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.icon-box:hover .icon-img {
|
||||
opacity: 1;
|
||||
transform: scale(1.05);
|
||||
filter: brightness(1.1) contrast(1.2);
|
||||
}
|
||||
|
||||
.card-text {
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.module-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.desc-text {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.card-right {
|
||||
text-align: right;
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.num-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
background: linear-gradient(to right, #3c9cff, #7472fe);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.num-label {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.card-item {
|
||||
min-width: 140px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.icon-box {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.module-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-top-container {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
gap: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.card-item {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
min-width: unset;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.card-item {
|
||||
height: 80%;
|
||||
}
|
||||
.icon-box {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">1</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">2</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">3</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/box/16.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/title/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">4</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">5</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">6</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">7</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">8</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">9</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">10</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/k2style.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +1,281 @@
|
||||
<template>
|
||||
hhhhhhhhhhhhhhhhhh
|
||||
<div class="work-layout-container">
|
||||
<div class="work-section work-top-header">
|
||||
<div class="work-card full-card">
|
||||
<ChartTop />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-section work-main-section">
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(1, 3)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(4, 5)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-2"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(6, 7)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-2"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import ChartTop from './components/ChartTop.vue';
|
||||
// import { getChartListAll } from '@/api/bizChart'
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const FormValues = ref({
|
||||
reqParam: route.query.year
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.query.year,
|
||||
(newVal) => {
|
||||
FormValues.value.reqParam = newVal;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
const componentMap = ref({});
|
||||
const chartData = ref([]);
|
||||
|
||||
const getComponentsBySortRange = (start, end) => {
|
||||
return chartData.value.filter(item => item.sort >= start && item.sort <= end);
|
||||
};
|
||||
|
||||
const loadComponent = async (vueName) => {
|
||||
try {
|
||||
const module = await import(`./components/${vueName}.vue`);
|
||||
return module.default;
|
||||
} catch (error) {
|
||||
console.error('加载组件失败', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
async function getChartList(){
|
||||
try {
|
||||
const reqParams = {
|
||||
chartCode: 'home'
|
||||
}
|
||||
const res = await getChartListAll(reqParams)
|
||||
chartData.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
chartData.value = []
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await getChartList();
|
||||
chartData.value = chartData.value.sort((a, b) => a.sort - b.sort);
|
||||
const newComponentMap = {};
|
||||
const uniqueComponents = [...new Set(chartData.value.map(item => item.vueName))];
|
||||
for (const vueName of uniqueComponents) {
|
||||
const component = await loadComponent(vueName);
|
||||
if (component) {
|
||||
newComponentMap[vueName] = component;
|
||||
}
|
||||
}
|
||||
componentMap.value = newComponentMap;
|
||||
} catch (error) {
|
||||
console.error('加载图表数据失败:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style scoped>
|
||||
.work-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-top-header {
|
||||
height: 10%;
|
||||
}
|
||||
|
||||
.work-main-section {
|
||||
height: 90%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 行样式 */
|
||||
.work-row {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-row-1-3 {
|
||||
height: calc((100% - 4px) / 3);
|
||||
}
|
||||
|
||||
/* 一行 3 个时的卡片宽度 */
|
||||
.work-card-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 一行 2 个时的卡片宽度 */
|
||||
.work-card-1-2 {
|
||||
width: calc((100% - 2px) / 2);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.work-card {
|
||||
width: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.1);
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(2px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.work-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.work-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.work-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.empty-card {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #88a0c2;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.work-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.work-section {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
min-height: 120px;
|
||||
}
|
||||
.work-row-1-3 {
|
||||
height: auto;
|
||||
flex-direction: column;
|
||||
}
|
||||
.work-card-1-3,
|
||||
.work-card-1-2 {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="chart-top-container">
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
<div class="num-value">{{ item.value }}</div>
|
||||
<div class="num-label">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
// import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "sysIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
if (container) {
|
||||
const height = container.parentElement.clientHeight
|
||||
container.style.height = `${height}px`
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => {},
|
||||
() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-top-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 4px;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
height: 85%;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/item/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.card-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
}
|
||||
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid rgba(224, 230, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
opacity: 0.9;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.icon-box:hover .icon-img {
|
||||
opacity: 1;
|
||||
transform: scale(1.05);
|
||||
filter: brightness(1.1) contrast(1.2);
|
||||
}
|
||||
|
||||
.card-text {
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.module-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.desc-text {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.card-right {
|
||||
text-align: right;
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.num-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
background: linear-gradient(to right, #3c9cff, #7472fe);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.num-label {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.card-item {
|
||||
min-width: 140px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.icon-box {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.module-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-top-container {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
gap: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.card-item {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
min-width: unset;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.card-item {
|
||||
height: 80%;
|
||||
}
|
||||
.icon-box {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">1</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">2</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">3</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">4</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/deptk2.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">5</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">6</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">7</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">8</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">9</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">10</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,272 @@
|
||||
<template>
|
||||
<div class="work-layout-container">
|
||||
<div class="work-section work-top-header">
|
||||
<div class="work-card full-card">
|
||||
<ChartTop />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-section work-main-section">
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(1, 3)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(4, 6)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="work-row work-row-1-3">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(7, 9)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import ChartTop from './components/ChartTop.vue';
|
||||
// import { getChartListAll } from '@/api/bizChart'
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const FormValues = ref({
|
||||
reqParam: route.query.year
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.query.year,
|
||||
(newVal) => {
|
||||
FormValues.value.reqParam = newVal;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
const componentMap = ref({});
|
||||
const chartData = ref([]);
|
||||
|
||||
const getComponentsBySortRange = (start, end) => {
|
||||
return chartData.value.filter(item => item.sort >= start && item.sort <= end);
|
||||
};
|
||||
|
||||
const loadComponent = async (vueName) => {
|
||||
try {
|
||||
const module = await import(`./components/${vueName}.vue`);
|
||||
return module.default;
|
||||
} catch (error) {
|
||||
console.error('加载组件失败', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
async function getChartList(){
|
||||
try {
|
||||
const reqParams = {
|
||||
chartCode: 'sys'
|
||||
}
|
||||
const res = await getChartListAll(reqParams)
|
||||
chartData.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
chartData.value = []
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await getChartList();
|
||||
chartData.value = chartData.value.sort((a, b) => a.sort - b.sort);
|
||||
const newComponentMap = {};
|
||||
const uniqueComponents = [...new Set(chartData.value.map(item => item.vueName))];
|
||||
for (const vueName of uniqueComponents) {
|
||||
const component = await loadComponent(vueName);
|
||||
if (component) {
|
||||
newComponentMap[vueName] = component;
|
||||
}
|
||||
}
|
||||
componentMap.value = newComponentMap;
|
||||
} catch (error) {
|
||||
console.error('加载图表数据失败:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style scoped>
|
||||
.work-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-top-header {
|
||||
height: 10%;
|
||||
}
|
||||
|
||||
.work-main-section {
|
||||
height: 90%;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.work-row {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-row-1-3 {
|
||||
height: calc((100% - 4px) / 3);
|
||||
}
|
||||
|
||||
.work-card-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.work-card {
|
||||
width: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.1);
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(2px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.work-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.work-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.work-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.empty-card {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #88a0c2;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.work-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.work-section {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
min-height: 120px;
|
||||
}
|
||||
.work-row-1-3 {
|
||||
height: auto;
|
||||
flex-direction: column;
|
||||
}
|
||||
.work-card-1-3 {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,215 @@
|
||||
<template>
|
||||
<div class="chart-top-container">
|
||||
<div class="card-item" v-for="(item, index) in cardList" :key="index">
|
||||
<div class="card-left">
|
||||
<div class="icon-box">
|
||||
<img
|
||||
:src="item.iconImg"
|
||||
class="icon-img"
|
||||
:style="{ filter: item.iconFilter }"
|
||||
>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="module-name">{{ item.module }}</div>
|
||||
<div class="desc-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-right">
|
||||
<div class="num-value">{{ item.value }}</div>
|
||||
<div class="num-label">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
// import { getIndexInfoList } from '@/api/bizApi'
|
||||
const cardList = ref()
|
||||
|
||||
async function getList() {
|
||||
try {
|
||||
const reqParams = {
|
||||
indexCode: "workIndex"
|
||||
}
|
||||
const res = await getIndexInfoList(reqParams)
|
||||
cardList.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error)
|
||||
cardList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const resizeHandler = () => {
|
||||
const container = document.querySelector('.chart-top-container')
|
||||
if (container) {
|
||||
const height = container.parentElement.clientHeight
|
||||
container.style.height = `${height}px`
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
watch(
|
||||
() => {},
|
||||
() => {
|
||||
window.removeEventListener('resize', resizeHandler)
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-top-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 2px 4px;
|
||||
box-sizing: border-box;
|
||||
flex-wrap: wrap;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.card-item {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
height: 85%;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/chart/item/03.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.card-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
}
|
||||
|
||||
.card-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.icon-box {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: transparent;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border: 1px solid rgba(224, 230, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
opacity: 0.9;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.icon-box:hover .icon-img {
|
||||
opacity: 1;
|
||||
transform: scale(1.05);
|
||||
filter: brightness(1.1) contrast(1.2);
|
||||
}
|
||||
|
||||
.card-text {
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.module-name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.desc-text {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.card-right {
|
||||
text-align: right;
|
||||
color: #e0e6ff;
|
||||
}
|
||||
|
||||
.num-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
background: linear-gradient(to right, #3c9cff, #7472fe);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.num-label {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.card-item {
|
||||
min-width: 140px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.icon-box {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.module-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.chart-top-container {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
gap: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.card-item {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
min-width: unset;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.card-item {
|
||||
height: 80%;
|
||||
}
|
||||
.icon-box {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.num-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">1</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">2</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">3</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">4</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/deptk2.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">5</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">6</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">7</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">8</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">9</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="chart-card">
|
||||
<div class="chart-card-header">
|
||||
<span class="chart-card-title">10</span>
|
||||
</div>
|
||||
<div class="bar-line-chart-container" ref="chartRef"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import { getItemInfoList } from '@/api/bizApi'
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: rgba(0, 0, 0, 0.1) url("@/assets/images/desck3.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.chart-card-header {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 16px;
|
||||
background-color: rgba(26, 80, 139, 0.5);
|
||||
border-bottom: 1px solid #1a508b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.chart-card-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #409EFF;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.bar-line-chart-container {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,329 @@
|
||||
<template>
|
||||
<div class="work-layout-container">
|
||||
<div class="work-section work-top-header">
|
||||
<div class="work-card full-card">
|
||||
<ChartTop />
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-section work-main-section">
|
||||
<div class="work-col work-col-1-3 work-left-col">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(1, 3)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-col work-col-1-3 work-middle-col">
|
||||
<div
|
||||
:key="getComponentBySort(4)?.sort"
|
||||
class="work-card work-card-2-3"
|
||||
v-if="getComponentBySort(4)"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[getComponentBySort(4).vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[getComponentBySort(4).vueName]"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
:key="getComponentBySort(5)?.sort"
|
||||
class="work-card work-card-1-3"
|
||||
v-if="getComponentBySort(5)"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[getComponentBySort(5).vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[getComponentBySort(5).vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="work-col work-col-1-3 work-right-col">
|
||||
<div
|
||||
v-for="item in getComponentsBySortRange(6, 8)"
|
||||
:key="item.sort"
|
||||
class="work-card work-card-1-3"
|
||||
>
|
||||
<component
|
||||
:is="componentMap[item.vueName]"
|
||||
:formParams="FormValues"
|
||||
v-if="componentMap[item.vueName]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { ref, watch, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import ChartTop from './components/ChartTop.vue';
|
||||
// import { getChartListAll } from '@/api/bizChart'
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const FormValues = ref({
|
||||
reqParam: route.query.year
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.query.year,
|
||||
(newVal) => {
|
||||
FormValues.value.reqParam = newVal;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
|
||||
const componentMap = ref({});
|
||||
const chartData = ref([]);
|
||||
|
||||
const getComponentBySort = (sort) => {
|
||||
return chartData.value.find(item => item.sort === sort);
|
||||
};
|
||||
|
||||
const getComponentsBySortRange = (start, end) => {
|
||||
return chartData.value.filter(item => item.sort >= start && item.sort <= end);
|
||||
};
|
||||
|
||||
const loadComponent = async (vueName) => {
|
||||
try {
|
||||
const module = await import(`./components/${vueName}.vue`);
|
||||
return module.default;
|
||||
} catch (error) {
|
||||
console.error('加载组件失败', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
async function getChartList(){
|
||||
try {
|
||||
const reqParams = {
|
||||
chartCode: 'work'
|
||||
}
|
||||
const res = await getChartListAll(reqParams)
|
||||
chartData.value = res || []
|
||||
} catch (error) {
|
||||
console.error('获取数据失败:', error);
|
||||
chartData.value = []
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await getChartList();
|
||||
chartData.value = chartData.value.sort((a, b) => a.sort - b.sort);
|
||||
const newComponentMap = {};
|
||||
const uniqueComponents = [...new Set(chartData.value.map(item => item.vueName))];
|
||||
for (const vueName of uniqueComponents) {
|
||||
const component = await loadComponent(vueName);
|
||||
if (component) {
|
||||
newComponentMap[vueName] = component;
|
||||
}
|
||||
}
|
||||
componentMap.value = newComponentMap;
|
||||
} catch (error) {
|
||||
console.error('加载图表数据失败:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
.work-layout-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
margin: 0 !important;
|
||||
box-sizing: border-box;
|
||||
background-color: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-top-header {
|
||||
height: 10%;
|
||||
}
|
||||
|
||||
.work-main-section {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
.work-col {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.work-col-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
}
|
||||
|
||||
.work-left-col, .work-middle-col, .work-right-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.work-card-1-3 {
|
||||
height: calc((100% - 4px) / 3);
|
||||
}
|
||||
|
||||
.work-card-2-3 {
|
||||
height: calc(2 * ((100% - 4px) / 3) + 2px);
|
||||
}
|
||||
|
||||
.work-card {
|
||||
width: 100%;
|
||||
background-color: rgba(15, 52, 96, 0.1);
|
||||
border: 1px solid rgba(26, 80, 139, 0.3);
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #e0e6ff;
|
||||
backdrop-filter: blur(2px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.full-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.work-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(60, 156, 255, 0.2);
|
||||
border-color: rgba(60, 156, 255, 0.6);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.work-card h3 {
|
||||
font-size: 16px;
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: 1px;
|
||||
background: #3c9cff;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.work-card p {
|
||||
font-size: 13px;
|
||||
opacity: 0.75;
|
||||
color: #b4c7e7;
|
||||
text-align: center;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.empty-card {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #88a0c2;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 1600px) {
|
||||
.work-layout-container {
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
}
|
||||
.work-section {
|
||||
gap: 2px;
|
||||
}
|
||||
.work-col-1-3 {
|
||||
width: calc((100% - 4px) / 3);
|
||||
}
|
||||
.work-card-1-3 {
|
||||
height: calc((100% - 4px) / 3);
|
||||
}
|
||||
.work-card-2-3 {
|
||||
height: calc(2 * ((100% - 4px) / 3) + 2px);
|
||||
}
|
||||
.work-card {
|
||||
padding: 2px;
|
||||
}
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.work-layout-container {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.work-section {
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
min-height: 120px;
|
||||
gap: 2px;
|
||||
}
|
||||
.work-col-1-3 {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.work-left-col, .work-middle-col, .work-right-col {
|
||||
flex-direction: column;
|
||||
height: auto;
|
||||
gap: 2px;
|
||||
}
|
||||
.work-card-1-3, .work-card-2-3 {
|
||||
height: 120px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.work-card {
|
||||
padding: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 900px) {
|
||||
.work-layout-container {
|
||||
padding: 2px;
|
||||
gap: 2px;
|
||||
}
|
||||
.work-section {
|
||||
gap: 2px;
|
||||
}
|
||||
.work-card {
|
||||
padding: 2px;
|
||||
}
|
||||
.work-card h3 {
|
||||
font-size: 14px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.work-card p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
44
web-vue/packages/core/utils/desensitize.ts
Normal file
44
web-vue/packages/core/utils/desensitize.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* 全局数据脱敏工具函数
|
||||
* 支持:姓名、手机、身份证、银行卡、邮箱
|
||||
*/
|
||||
|
||||
/**
|
||||
* 姓名脱敏
|
||||
*/
|
||||
export function desensitizeName(value: string | null | undefined): string {
|
||||
if (!value || value.length <= 1) return value || ''
|
||||
return value.charAt(0) + '*'
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号脱敏
|
||||
*/
|
||||
export function desensitizePhone(value: string | null | undefined): string {
|
||||
if (!value || value.length !== 11) return value || ''
|
||||
return value.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2')
|
||||
}
|
||||
|
||||
/**
|
||||
* 身份证脱敏
|
||||
*/
|
||||
export function desensitizeIdCard(value: string | null | undefined): string {
|
||||
if (!value) return ''
|
||||
return value.replace(/(\d{6})\d{8}(\w{4})/, '$1********$2')
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行卡脱敏
|
||||
*/
|
||||
export function desensitizeBankCard(value: string | null | undefined): string {
|
||||
if (!value || value.length < 16) return value || ''
|
||||
return value.replace(/(\d{4})\d{10}(\d{2})/, '$1**********$2')
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮箱脱敏
|
||||
*/
|
||||
export function desensitizeEmail(value: string | null | undefined): string {
|
||||
if (!value) return ''
|
||||
return value.replace(/(.)(.*)(@.*)/, '$1***$3')
|
||||
}
|
||||
Reference in New Issue
Block a user