Commit 95ea4664 authored by 杨勇飞's avatar 杨勇飞

修复部分显示问题

parent e0c1016e
{ {
"name": "zc-qiyeWxApp", "name": "zc-qiyewx-app",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
"dependencies": { "dependencies": {
"@dcloudio/uni-ui": "^1.5.7", "@dcloudio/uni-ui": "^1.5.7",
"@qiun/ucharts": "^2.5.0-20230101", "@qiun/ucharts": "^2.5.0-20230101",
"echarts": "^5.6.0" "echarts": "^5.6.0",
"lodash": "^4.17.21"
} }
}, },
"node_modules/@dcloudio/uni-ui": { "node_modules/@dcloudio/uni-ui": {
...@@ -32,6 +33,12 @@ ...@@ -32,6 +33,12 @@
"zrender": "5.6.1" "zrender": "5.6.1"
} }
}, },
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/tslib": { "node_modules/tslib": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"dependencies": { "dependencies": {
"@dcloudio/uni-ui": "^1.5.7", "@dcloudio/uni-ui": "^1.5.7",
"@qiun/ucharts": "^2.5.0-20230101", "@qiun/ucharts": "^2.5.0-20230101",
"echarts": "^5.6.0" "echarts": "^5.6.0",
"lodash": "^4.17.21"
} }
} }
...@@ -79,7 +79,16 @@ ...@@ -79,7 +79,16 @@
</view> </view>
</view> </view>
<view class="progress-bar"> <view class="progress-bar">
<view class="progress" :style="{ width: currentData.finance.receivable.profitRate + '%' }"></view> <view class="progress-bar" style="position: relative; height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden;">
<view class="progress" :style="{
backgroundColor: '#52C41A',
width: currentData.finance.receivable.profitRate + '%',
position: 'absolute',
height: '100%',
left: 0,
top: 0
}"></view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -111,11 +120,22 @@ ...@@ -111,11 +120,22 @@
</view> </view>
</view> </view>
</view> </view>
<view class="progress-bar"> <view class="progress-bar" style="position: relative; height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden;">
<view class="progress cash" :style="{ width: cashRatio }"></view> <view class="progress cash" :style="{
<view class="progress monthly" :style="{ backgroundColor: '#FFA940',
width: cashRatio,
position: 'absolute',
height: '100%',
left: 0,
top: 0
}"></view>
<view class="progress monthly" :style="{
backgroundColor: '#13C2C2',
position: 'absolute',
height: '100%',
left: cashRatio, left: cashRatio,
width: monthlyRatio width: monthlyRatio,
top: 0
}"></view> }"></view>
</view> </view>
</view> </view>
...@@ -353,6 +373,32 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -353,6 +373,32 @@ import { uniIcons } from '@dcloudio/uni-ui'
initChart() { initChart() {
this.myChart = echarts.init(document.getElementById('myChart')) this.myChart = echarts.init(document.getElementById('myChart'))
const baseSeries = [{
type: 'bar',
barGap: 0,
barWidth: 15,
itemStyle: {
color: '#52C41A'
}
}, {
type: 'bar',
barWidth: 15,
itemStyle: {
color: '#FF4D4F'
}
}, {
type: 'line',
yAxisIndex: 1,
symbol: 'circle',
symbolSize: 8,
itemStyle: {
color: '#1890FF'
},
lineStyle: {
width: 2
}
}]
const option = { const option = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
...@@ -406,39 +452,9 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -406,39 +452,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
} }
], ],
series: [ series: [
{ { ...baseSeries[0], data: this.currentData.chart.receivable },
name: '应收', { ...baseSeries[1], data: this.currentData.chart.payable },
type: 'bar', { ...baseSeries[2], data: this.currentData.chart.profitRate }
barGap: 0,
barWidth: 15,
itemStyle: {
color: '#52C41A'
},
data: this.currentData.chart.receivable
},
{
name: '应付',
type: 'bar',
barWidth: 15,
itemStyle: {
color: '#FF4D4F'
},
data: this.currentData.chart.payable
},
{
name: '利润率',
type: 'line',
yAxisIndex: 1,
symbol: 'circle',
symbolSize: 8,
itemStyle: {
color: '#1890FF'
},
lineStyle: {
width: 2
},
data: this.currentData.chart.profitRate
}
] ]
} }
...@@ -447,15 +463,7 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -447,15 +463,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
switchTime(time) { switchTime(time) {
this.activeTime = time this.activeTime = time
// 更新图表数据 // 更新图表数据
this.myChart.setOption({ this.updateChartSeries()
series: [{
data: this.currentData.chart.receivable
}, {
data: this.currentData.chart.payable
}, {
data: this.currentData.chart.profitRate
}]
})
}, },
onResize() { onResize() {
if (this.myChart) { if (this.myChart) {
...@@ -499,6 +507,15 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -499,6 +507,15 @@ import { uniIcons } from '@dcloudio/uni-ui'
data: sortArray.map(item => item.profitRate) data: sortArray.map(item => item.profitRate)
}] }]
}) })
},
updateChartSeries() {
this.myChart.setOption({
series: [
{ data: this.currentData.chart.receivable },
{ data: this.currentData.chart.payable },
{ data: this.currentData.chart.profitRate }
]
})
} }
}, },
beforeDestroy() { beforeDestroy() {
...@@ -518,92 +535,141 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -518,92 +535,141 @@ import { uniIcons } from '@dcloudio/uni-ui'
$info-color: #13C2C2; $info-color: #13C2C2;
$text-primary: #333; $text-primary: #333;
$text-secondary: #666; $text-secondary: #666;
$secondary-color: #1890FF;
$circle-size: 120px;
// 在样式文件顶部添加重置样式
page {
width: 100%;
height: 100%;
background-color: #F5F7FA;
}
uni-page-body {
width: 100%;
height: 100%;
}
.report-container { .report-container {
width: 100%;
box-sizing: border-box;
padding: 15px; padding: 15px;
background-color: #F5F7FA; background-color: #F5F7FA;
min-height: 100vh; min-height: 100vh;
> view {
width: 100%;
max-width: 1200px;
margin: 0 auto;
background-color: transparent;
}
.time-nav { .time-nav {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
padding: 10px; padding: 10px;
border-radius: 8px; border-radius: 8px;
margin-bottom: 15px; margin-bottom: 15px;
box-shadow: 0 2px 12px rgba(0,0,0,0.04);
.nav-item { .nav-item {
flex: 1; flex: 1;
text-align: center; text-align: center;
padding: 8px 0; padding: 6px 0;
font-size: 14px; font-size: 14px;
color: $text-secondary;
position: relative;
transition: all 0.3s ease;
&.active { &.active {
color: #1890FF; color: #1890FF;
font-weight: bold; font-weight: bold;
&::after {
content: '';
position: absolute;
left: 50%;
bottom: -2px;
transform: translateX(-50%);
width: 12px;
height: 2px;
background-color: #1890FF;
border-radius: 1px;
}
}
&:not(:last-child) {
border-right: 1px solid #f0f0f0;
} }
} }
} }
.project-card { .project-card {
background-color: #fff; display: flex;
padding: 15px; background-color: #fff !important;
width: 100%;
box-sizing: border-box;
padding: 15px 20px;
border-radius: 8px; border-radius: 8px;
margin-bottom: 15px; margin-bottom: 15px;
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
.overview-content { .overview-content {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0;
.progress-circle { .progress-circle {
width: 120px; width: $circle-size;
height: 120px; height: $circle-size;
position: relative; position: relative;
margin-right: 20px; margin-right: 40px;
.circle-wrapper { .circle-wrapper {
width: 100%;
height: 100%;
border-radius: 50%;
background: conic-gradient(#FF4B4B 0% 22.35%, #F5F5F5 22.35% 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%;
height: 100%;
border-radius: 50%;
&::after { &::after {
content: ''; content: '';
position: absolute; position: absolute;
top: 10px; top: 8px;
left: 10px; left: 8px;
right: 10px; right: 8px;
bottom: 10px; bottom: 8px;
background: #fff; background: #fff;
border-radius: 50%; border-radius: 50%;
z-index: 1;
} }
} }
.circle-text { .circle-text {
position: relative; position: relative;
z-index: 1; z-index: 2;
text-align: center; text-align: center;
.percentage { .percentage {
display: block; font-size: 28px;
font-size: 24px;
font-weight: bold;
color: #333; color: #333;
margin-bottom: 4px;
&::after {
content: '%';
font-size: 14px;
margin-left: 2px;
}
} }
.label { .label {
display: block;
font-size: 12px;
color: #666; color: #666;
margin: 2px 0; margin-bottom: 4px;
} }
.count { .count {
display: block; color: #666;
font-size: 14px;
color: #333;
} }
} }
} }
...@@ -613,30 +679,28 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -613,30 +679,28 @@ import { uniIcons } from '@dcloudio/uni-ui'
.stat-row { .stat-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-around;
margin-bottom: 15px; margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
.stat-item { .stat-item {
text-align: center;
.number { .number {
display: block; display: block;
font-size: 20px; font-size: 24px;
color: #00C8B1;
font-weight: bold; font-weight: bold;
color: #19c1b4 !important;
margin-bottom: 4px; margin-bottom: 4px;
&:nth-child(2n) { &:nth-child(2n) {
color: #FFA940; color: #19c1b4 !important;
} }
} }
.rate { .rate {
display: block; display: block;
font-size: 12px; font-size: 14px;
color: #666; color: #999;
} }
} }
} }
...@@ -665,8 +729,8 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -665,8 +729,8 @@ import { uniIcons } from '@dcloudio/uni-ui'
width: 60px; width: 60px;
margin-right: 20px; margin-right: 20px;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
padding: 10px 0; padding: 10px 0;
...@@ -676,8 +740,8 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -676,8 +740,8 @@ import { uniIcons } from '@dcloudio/uni-ui'
border-radius: 12px; border-radius: 12px;
font-size: 28px; font-size: 28px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #fff; color: #fff;
} }
} }
...@@ -731,15 +795,22 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -731,15 +795,22 @@ import { uniIcons } from '@dcloudio/uni-ui'
} }
.progress-bar { .progress-bar {
display: flex;
position: relative;
height: 4px; height: 4px;
background-color: #F5F5F5; background: #f0f0f0;
border-radius: 2px; border-radius: 2px;
overflow: hidden; overflow: hidden;
.progress { .progress {
height: 100%; position: absolute;
top: 0;
bottom: 0;
height: 100% !important;
border-radius: 2px; border-radius: 2px;
transition: width 0.3s ease; transition: width 0.3s ease;
&.cash { background-color: #FFA940; }
&.monthly { background-color: #13C2C2; }
} }
} }
} }
...@@ -789,17 +860,9 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -789,17 +860,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
position: relative; position: relative;
.progress { .progress {
&.cash { &.cash, &.monthly {
background-color: #FFA940;
position: absolute; position: absolute;
left: 0; height: 100%;
width: 48.93%;
}
&.monthly {
background-color: #13C2C2;
position: absolute;
left: 48.93%;
width: 51.07%;
} }
} }
} }
...@@ -809,6 +872,7 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -809,6 +872,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
} }
.chart-container { .chart-container {
display: block;
background-color: #fff; background-color: #fff;
padding: 15px; padding: 15px;
border-radius: 8px; border-radius: 8px;
...@@ -839,12 +903,15 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -839,12 +903,15 @@ import { uniIcons } from '@dcloudio/uni-ui'
border: 1px solid #E8E8E8; border: 1px solid #E8E8E8;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
.sort-icon { .sort-icon {
font-family: "custom-icon"; font-family: "custom-icon" !important;
font-size: 12px;
font-style: normal;
-webkit-font-smoothing: antialiased;
} }
&:hover { &:hover {
...@@ -863,12 +930,14 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -863,12 +930,14 @@ import { uniIcons } from '@dcloudio/uni-ui'
} }
.chart-scroll { .chart-scroll {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
} }
.chart-wrapper { .chart-wrapper {
height: 210px; height: 50vw;
max-height: 300px;
min-width: 150%; min-width: 150%;
width: max-content; width: max-content;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -879,6 +948,18 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -879,6 +948,18 @@ import { uniIcons } from '@dcloudio/uni-ui'
background-color: #fff; background-color: #fff;
padding: 15px; padding: 15px;
border-radius: 8px; border-radius: 8px;
.table-title {
display: block;
font-size: 16px;
font-weight: bold;
margin-bottom: 12px;
}
uni-th, uni-td {
padding: 12px !important;
text-align: center !important;
}
} }
} }
...@@ -888,6 +969,58 @@ import { uniIcons } from '@dcloudio/uni-ui' ...@@ -888,6 +969,58 @@ import { uniIcons } from '@dcloudio/uni-ui'
} }
.sort-icon::before { .sort-icon::before {
content: '\e737'; // 排序图标的 unicode content: '\e737';
font-family: "custom-icon" !important;
font-size: 12px;
font-style: normal;
-webkit-font-smoothing: antialiased;
}
// 添加基础修复
uni-table {
width: 100% !important;
&::before, &::after {
display: none !important; // 去除默认线条
}
}
// 解决iOS滚动条问题
.chart-scroll {
-webkit-overflow-scrolling: touch;
}
.common-block {
display: block;
}
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
// 应用示例:
.progress-circle .circle-wrapper {
@extend .flex-center;
}
.payable {
.progress-bar {
.progress {
height: 100%;
transition: all 0.3s ease;
&.cash {
left: 0;
z-index: 1;
}
&.monthly {
z-index: 2;
opacity: 0.8;
}
}
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment