From 3d0b8d97cb710dc8659cbe4440629542a8d8b92b Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 16 一月 2026 14:35:48 +0800
Subject: [PATCH] 更新
---
subpackage/manager/progress.vue | 32 ++++++----------
pages/index/index.vue | 87 +++++++++++++++++++++++++++++++++++++------
2 files changed, 86 insertions(+), 33 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 87e9d47..8e38c80 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -70,7 +70,13 @@
<text class="chart-title">椤圭洰鏉愭枡杩涘害缁熻</text>
<!-- 鍥捐〃瀹瑰櫒 -->
<view class="chart-box">
- <qiun-data-charts type="bar" :opts="opts" :chartData="chartData" :tooltipShow="false" />
+ <qiun-data-charts
+ type="bar"
+ :opts="opts"
+ :chartData="chartData"
+ :tooltipShow="false"
+ @getIndex="handleChartTap"
+ />
</view>
</view>
<!-- 椤圭洰闃舵鎶樼嚎鍥� -->
@@ -107,7 +113,7 @@
</view>
<view class="quick-item" @click="goSchedule">
<view class="quick-icon quick-purple">
- <uni-icons type="folder" color="#fff" size="36"></uni-icons>
+ <uni-icons type="wallet" color="#fff" size="36"></uni-icons>
</view>
<text class="quick-label">鏃ョ▼</text>
</view>
@@ -206,14 +212,34 @@
chartData: {},
opts: {
color: ["#73C0DE", "#91CB74", "#EE6666"],
- padding: [15, 30, 0, 10],
+ padding: [15, 45, 0, 10],
enableScroll: true,
+ dataLabel: false,
legend: {},
- xAxis: { boundaryGap: "justify", disableGrid: false, min: 0, axisLine: false },
- yAxis: { data: [{ type: 'categories', disabled: false, fontSize: 10, formatter: (val) => val.length > 6 ? (val.substring(0, 6) + '...') : val }] },
+ xAxis: {
+ boundaryGap: "justify",
+ disableGrid: false,
+ min: 0,
+ axisLine: false,
+ format: 'int'
+ },
+ yAxis: {
+ data: [{
+ type: 'categories',
+ disabled: false,
+ fontSize: 12, // 澧炲ぇ杞存枃瀛楀ぇ灏�
+ formatter: (val) => val.length > 8 ? (val.substring(0, 8) + '...') : val // 澧炲姞鍚嶇О鏄剧ず闀垮害
+ }]
+ },
extra: {
- bar: { type: "stack", width: 32, categoryGap: 2, dataLabel: true, labelPosition: "right", labelWidth: 40 },
-
+ bar: {
+ type: "stack",
+ width: 30,
+ categoryGap: 8,
+ dataLabel: false, // 涓嶅湪琛ㄦ牸鍥句笂鐩存帴鏄剧ず鏁板��
+ labelPosition: "center",
+ labelWidth: 40
+ },
}
},
// 椤圭洰闃舵鎶樼嚎鍥炬暟鎹笌閰嶇疆
@@ -475,18 +501,53 @@
const base = this.selectedIds.length ? this.projectList.filter(p => this.selectedIds.includes(Number(p.id))) : this.projectList
console.log("绛涢�夊悗:{}", base)
const categories = base.map(p => p.projectName)
- const completed = base.map(p => p.co)
- const inProgress = base.map(p => p.co2)
- const notStarted = base.map(p => p.co3)
+
+ // 澶勭悊鏁版嵁锛氬皢 0 杞崲涓� null锛岄伩鍏嶅湪鍥捐〃涓樉绀� "0" 瀵艰嚧鏍囩鎸ゅ湪涓�璧�
+ const formatData = (val) => (val === 0 || val === '0') ? null : Number(val);
+
+ const completed = base.map(p => formatData(p.co))
+ const inProgress = base.map(p => formatData(p.co2))
+ const notStarted = base.map(p => formatData(p.co3))
+
this.chartData = {
categories,
series: [
- { name: '宸插鐞�', data: completed },
- { name: '寰呭鐞�', data: inProgress },
- { name: '鏈鐞�', data: notStarted }
+ { name: '宸插鐞�', data: completed, dataLabel: false },
+ { name: '寰呭鐞�', data: inProgress, dataLabel: false },
+ { name: '鏈鐞�', data: notStarted, dataLabel: false }
]
};
},
+ handleChartTap(e) {
+ // 鍏煎涓嶅悓骞冲彴鍜岀増鏈殑浜嬩欢缁撴瀯锛屽皾璇曚粠涓嶅悓浣嶇疆鑾峰彇 currentIndex
+ let index = -1;
+ if (e && typeof e.currentIndex !== 'undefined') {
+ index = e.currentIndex;
+ } else if (e && e.detail && typeof e.detail.currentIndex !== 'undefined') {
+ index = e.detail.currentIndex;
+ }
+ // 鍙湁鐐瑰嚮鍒版湁鏁堢殑鏌辩姸鍥撅紙绱㈠紩 >= 0锛夋椂鎵嶅鐞�
+ if (index.index >= 0) {
+ const projectName = this.chartData.categories[index.index];
+ let content = '';
+ if (this.chartData.series) {
+ this.chartData.series.forEach(serie => {
+
+ if (serie.data && serie.data[index.index] !== null && serie.data[index.index] !== undefined) {
+ content += `${serie.name}锛�${serie.data[index.index]}\r\n`;
+ }
+ });
+ }
+ if (content.trim()) {
+ uni.showModal({
+ title: projectName,
+ content: content.trim(),
+ showCancel: false,
+ confirmText: '纭畾'
+ });
+ }
+ }
+ },
// 椤圭洰闃舵鎶樼嚎鍥撅細x杞翠负 鍦ㄥ簱銆佸墠鏈熴�佸疄鏂姐�佺宸ワ紝妯℃嫙鐧惧垎姣旇秼鍔�
async buildPhaseChart() {
let categories = ['鍦ㄥ簱', '鍓嶆湡', '瀹炴柦', '绔e伐'];
diff --git a/subpackage/manager/progress.vue b/subpackage/manager/progress.vue
index 474c2fe..5b086a9 100644
--- a/subpackage/manager/progress.vue
+++ b/subpackage/manager/progress.vue
@@ -72,18 +72,18 @@
</view>
<view class="card-footer">
- <button
- v-if="item.processInsId"
- class="action-btn view-btn"
- @click="goToDetail(item)"
- >
- <uni-icons type="eye" size="16" color="#1E88E5"></uni-icons>
- <text>鏌ョ湅娴佺▼</text>
- </button>
+<!-- <button -->
+<!-- v-if="item.processInsId" -->
+<!-- class="action-btn view-btn" -->
+<!-- @click="goToDetail(item)"-->
+<!-- >-->
+<!-- <uni-icons type="eye" size="16" color="#1E88E5"></uni-icons>-->
+<!-- <text>鏌ョ湅娴佺▼</text>-->
+<!-- </button>-->
- <button
- v-if="isReserve"
- class="action-btn process-btn"
+ <button
+ v-if="isReserve && item.processInsId "
+ class="action-btn process-btn"
@click="openOpProcess(item)"
>
<uni-icons type="gear" size="16" color="#26A69A"></uni-icons>
@@ -244,15 +244,7 @@
const option = options.find(opt => opt.value == value)
return option ? option.label : value
},
-
- /** 鍓嶅線璇︽儏椤� */
- goToDetail(item) {
- uni.navigateTo({
-
- url: `/subpackage/manager/project-detail?data=${encodeURIComponent(JSON.stringify(item))}`
- })
- },
-
+
/** 鎵撳紑鎿嶄綔娴佺▼ */
openOpProcess(row) {
const params = {
--
Gitblit v1.8.0