改太多

This commit is contained in:
minom committed 2026-10-30 17:47:01 +08:00
1 parent be5352efed
commit 1cb2a7a35e
48 files changed
+17970 -485

No files matched your search

+2 -2
View File
@@ -621,11 +621,11 @@
</template>
<!-- 功德項目欄位格式化 -->
<template v-for="meritItem in tab4MeritItems" v-slot:[`item.${meritItem}`]="{ item }">
<%--<template v-for="meritItem in tab4MeritItems" v-slot:[`item.${meritItem}`]="{ item }">
<span :class="{'grey--text': item[meritItem] === 0}">
{{ tab4.valueType === 'amount' ? formatCurrency(item[meritItem]) : (item[meritItem] || '-') }}
</span>
</template>
</template>--%>
<!-- 無資料提示 -->
<template v-slot:no-data>
+19 -16
View File
@@ -326,7 +326,7 @@
:page.sync="tab2CurrentPage"
:server-items-length="filteredRegistrations.length"
class="elevation-1"
item-key="報名編號"
item-key="功德序號"
:footer-props="{
'items-per-page-options': [10, 20, 50, 100]
}"
@@ -393,7 +393,7 @@
<v-col cols="12" md="3">
<v-text-field
v-model.number="tab3Filter.minCount"
label="最少參與次數"
label="最少功德數量"
type="number"
dense
outlined
@@ -416,8 +416,8 @@
<v-select
v-model="tab3SortBy"
:items="[
{text: '參與次數(降序)', value: 'count_desc'},
{text: '參與次數(升序)', value: 'count_asc'},
{text: '功德數量(降序)', value: 'count_desc'},
{text: '功德數量(升序)', value: 'count_asc'},
{text: '總金額(降序)', value: 'amount_desc'},
{text: '總金額(升序)', value: 'amount_asc'}
]"
@@ -434,16 +434,16 @@
<v-data-table
:headers="tab3Headers"
:items="filteredFollowerAnalysis"
:items-per-page="20"
:items-per-page="500"
class="elevation-1"
item-key="信眾編號"
>
<template v-slot:item.信眾編號="{ item }">
<v-chip small color="info">{{ item.信眾編號 }}</v-chip>
</template>
<template v-slot:item.參與次數="{ item }">
<v-chip small :color="item.參與次數 >= 5 ? 'success' : 'default'">
{{ item.參與次數 }}
<template v-slot:item.功德數量="{ item }">
<v-chip small :color="item.功德數量 >= 5 ? 'success' : 'default'">
{{ item.功德數量 }}
</v-chip>
</template>
<template v-slot:item.總金額="{ item }">
@@ -657,7 +657,7 @@
tab3Headers: [
{ text: '信眾編號', value: '信眾編號', width: 120 },
{ text: '姓名', value: '姓名', width: 120 },
{ text: '參與次數', value: '參與次數', width: 100, align: 'center' },
{ text: '功德數量', value: '功德數量', width: 100, align: 'center' },
{ text: '總金額', value: '總金額', width: 150, align: 'end' },
{ text: '平均金額', value: '平均金額', width: 150, align: 'end' },
{ text: '最近參與日期', value: '最近參與日期', width: 130 }
@@ -719,6 +719,9 @@
// Tab 2: 不重複信眾數
uniqueFollowersCount() {
//console.log("uniqueFollowersCount:", this.filteredRegistrations.length)
//let qq = this.filteredRegistrations.filter(x => x.信眾姓名 === "周阿着")
//console.log(qq);
if (!this.filteredRegistrations.length) return 0;
const followers = new Set(this.filteredRegistrations.map(x => x.信眾編號));
return followers.size;
@@ -747,13 +750,13 @@
followerMap[fNum] = {
信眾編號: fNum,
姓名: item.信眾姓名,
參與次數: 0,
功德數量: 0,
總金額: 0,
最近參與日期: item.報名日期
};
}
followerMap[fNum].參與次數++;
followerMap[fNum].功德數量++;
followerMap[fNum].總金額 += (item.金額 * item.數量);
// 更新最近參與日期
@@ -765,7 +768,7 @@
// 轉換為陣列,並計算平均金額
return Object.values(followerMap).map(f => ({
...f,
平均金額: Math.round(f.總金額 / f.參與次數)
平均金額: Math.round(f.總金額 / f.功德數量)
}));
},
@@ -778,9 +781,9 @@
data = data.filter(x => x.信眾編號 && x.信眾編號.includes(this.tab3Filter.followerCode));
}
// 過濾:最少參與次數
// 過濾:最少功德數量
if (this.tab3Filter.minCount) {
data = data.filter(x => x.參與次數 >= this.tab3Filter.minCount);
data = data.filter(x => x.功德數量 >= this.tab3Filter.minCount);
}
// 過濾:最少總金額
@@ -791,10 +794,10 @@
// 排序
switch (this.tab3SortBy) {
case 'count_desc':
data.sort((a, b) => b.參與次數 - a.參與次數);
data.sort((a, b) => b.功德數量 - a.功德數量);
break;
case 'count_asc':
data.sort((a, b) => a.參與次數 - b.參與次數);
data.sort((a, b) => a.功德數量 - b.功德數量);
break;
case 'amount_desc':
data.sort((a, b) => b.總金額 - a.總金額);