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

修复部分显示问题

parent e0c1016e
{
"name": "zc-qiyeWxApp",
"name": "zc-qiyewx-app",
"lockfileVersion": 3,
"requires": true,
"packages": {
......@@ -7,7 +7,8 @@
"dependencies": {
"@dcloudio/uni-ui": "^1.5.7",
"@qiun/ucharts": "^2.5.0-20230101",
"echarts": "^5.6.0"
"echarts": "^5.6.0",
"lodash": "^4.17.21"
}
},
"node_modules/@dcloudio/uni-ui": {
......@@ -32,6 +33,12 @@
"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": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
......
......@@ -2,6 +2,7 @@
"dependencies": {
"@dcloudio/uni-ui": "^1.5.7",
"@qiun/ucharts": "^2.5.0-20230101",
"echarts": "^5.6.0"
"echarts": "^5.6.0",
"lodash": "^4.17.21"
}
}
......@@ -79,7 +79,16 @@
</view>
</view>
<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>
......@@ -111,11 +120,22 @@
</view>
</view>
</view>
<view class="progress-bar">
<view class="progress cash" :style="{ width: cashRatio }"></view>
<view class="progress monthly" :style="{
<view class="progress-bar" style="position: relative; height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden;">
<view class="progress cash" :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,
width: monthlyRatio
width: monthlyRatio,
top: 0
}"></view>
</view>
</view>
......@@ -353,6 +373,32 @@ import { uniIcons } from '@dcloudio/uni-ui'
initChart() {
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 = {
tooltip: {
trigger: 'axis',
......@@ -406,39 +452,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
],
series: [
{
name: '应收',
type: 'bar',
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
}
{ ...baseSeries[0], data: this.currentData.chart.receivable },
{ ...baseSeries[1], data: this.currentData.chart.payable },
{ ...baseSeries[2], data: this.currentData.chart.profitRate }
]
}
......@@ -447,15 +463,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
switchTime(time) {
this.activeTime = time
// 更新图表数据
this.myChart.setOption({
series: [{
data: this.currentData.chart.receivable
}, {
data: this.currentData.chart.payable
}, {
data: this.currentData.chart.profitRate
}]
})
this.updateChartSeries()
},
onResize() {
if (this.myChart) {
......@@ -499,6 +507,15 @@ import { uniIcons } from '@dcloudio/uni-ui'
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() {
......@@ -518,92 +535,141 @@ import { uniIcons } from '@dcloudio/uni-ui'
$info-color: #13C2C2;
$text-primary: #333;
$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 {
width: 100%;
box-sizing: border-box;
padding: 15px;
background-color: #F5F7FA;
min-height: 100vh;
> view {
width: 100%;
max-width: 1200px;
margin: 0 auto;
background-color: transparent;
}
.time-nav {
display: flex;
background-color: #fff;
padding: 10px;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 12px rgba(0,0,0,0.04);
.nav-item {
flex: 1;
text-align: center;
padding: 8px 0;
padding: 6px 0;
font-size: 14px;
color: $text-secondary;
position: relative;
transition: all 0.3s ease;
&.active {
color: #1890FF;
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 {
background-color: #fff;
padding: 15px;
display: flex;
background-color: #fff !important;
width: 100%;
box-sizing: border-box;
padding: 15px 20px;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
.overview-content {
display: flex;
align-items: center;
padding: 0;
.progress-circle {
width: 120px;
height: 120px;
width: $circle-size;
height: $circle-size;
position: relative;
margin-right: 20px;
margin-right: 40px;
.circle-wrapper {
width: 100%;
height: 100%;
border-radius: 50%;
background: conic-gradient(#FF4B4B 0% 22.35%, #F5F5F5 22.35% 100%);
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border-radius: 50%;
&::after {
content: '';
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
top: 8px;
left: 8px;
right: 8px;
bottom: 8px;
background: #fff;
border-radius: 50%;
z-index: 1;
}
}
.circle-text {
position: relative;
z-index: 1;
z-index: 2;
text-align: center;
.percentage {
display: block;
font-size: 24px;
font-weight: bold;
font-size: 28px;
color: #333;
margin-bottom: 4px;
&::after {
content: '%';
font-size: 14px;
margin-left: 2px;
}
}
.label {
display: block;
font-size: 12px;
color: #666;
margin: 2px 0;
margin-bottom: 4px;
}
.count {
display: block;
font-size: 14px;
color: #333;
color: #666;
}
}
}
......@@ -613,30 +679,28 @@ import { uniIcons } from '@dcloudio/uni-ui'
.stat-row {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
&:last-child {
margin-bottom: 0;
}
justify-content: space-around;
margin-bottom: 20px;
.stat-item {
text-align: center;
.number {
display: block;
font-size: 20px;
color: #00C8B1;
font-size: 24px;
font-weight: bold;
color: #19c1b4 !important;
margin-bottom: 4px;
&:nth-child(2n) {
color: #FFA940;
color: #19c1b4 !important;
}
}
.rate {
display: block;
font-size: 12px;
color: #666;
font-size: 14px;
color: #999;
}
}
}
......@@ -665,8 +729,8 @@ import { uniIcons } from '@dcloudio/uni-ui'
width: 60px;
margin-right: 20px;
height: 100%;
display: flex;
flex-direction: column;
display: flex;
flex-direction: column;
justify-content: center;
padding: 10px 0;
......@@ -676,8 +740,8 @@ import { uniIcons } from '@dcloudio/uni-ui'
border-radius: 12px;
font-size: 28px;
display: flex;
align-items: center;
justify-content: center;
align-items: center;
justify-content: center;
color: #fff;
}
}
......@@ -731,15 +795,22 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
.progress-bar {
display: flex;
position: relative;
height: 4px;
background-color: #F5F5F5;
background: #f0f0f0;
border-radius: 2px;
overflow: hidden;
.progress {
height: 100%;
position: absolute;
top: 0;
bottom: 0;
height: 100% !important;
border-radius: 2px;
transition: width 0.3s ease;
&.cash { background-color: #FFA940; }
&.monthly { background-color: #13C2C2; }
}
}
}
......@@ -789,17 +860,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
position: relative;
.progress {
&.cash {
background-color: #FFA940;
&.cash, &.monthly {
position: absolute;
left: 0;
width: 48.93%;
}
&.monthly {
background-color: #13C2C2;
position: absolute;
left: 48.93%;
width: 51.07%;
height: 100%;
}
}
}
......@@ -809,6 +872,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
.chart-container {
display: block;
background-color: #fff;
padding: 15px;
border-radius: 8px;
......@@ -839,12 +903,15 @@ import { uniIcons } from '@dcloudio/uni-ui'
border: 1px solid #E8E8E8;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
display: flex;
align-items: center;
gap: 4px;
.sort-icon {
font-family: "custom-icon";
font-family: "custom-icon" !important;
font-size: 12px;
font-style: normal;
-webkit-font-smoothing: antialiased;
}
&:hover {
......@@ -863,12 +930,14 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
.chart-scroll {
width: 100%;
overflow: hidden;
}
.chart-wrapper {
height: 210px;
height: 50vw;
max-height: 300px;
min-width: 150%;
width: max-content;
margin-bottom: 10px;
......@@ -879,6 +948,18 @@ import { uniIcons } from '@dcloudio/uni-ui'
background-color: #fff;
padding: 15px;
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'
}
.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>
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