feat(staff): 沟通数弹框加汇总说明(对齐云客:总X人次,重复Y,剩余Z条,玉绿左边框)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,8 @@ const props = defineProps<{
|
||||
/** fetcher(page, page_size) → Page<T>。宽松 Page<any>:Customer 无 index signature,
|
||||
* 不可直接赋 Page<Record<string,unknown>>,故用 any 接纳 Page<Customer> 等。 */
|
||||
fetcher: (page: number, page_size: number) => Promise<Page<any>>
|
||||
/** 弹框顶部汇总说明(对齐云客) */
|
||||
summaryText?: string
|
||||
pageSizes?: number[]
|
||||
}>()
|
||||
const emit = defineEmits<{ 'update:modelValue': [boolean] }>()
|
||||
@@ -63,6 +65,8 @@ watch(
|
||||
width="900px"
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
>
|
||||
<div v-if="summaryText" class="yk-detail-modal__summary">{{ summaryText }}</div>
|
||||
|
||||
<el-table v-loading="loading" :data="items" border style="width: 100%" size="small">
|
||||
<el-table-column
|
||||
v-for="c in cols"
|
||||
|
||||
@@ -279,6 +279,7 @@ const detailFetcher = ref<(p: number, s: number) => Promise<any>>(
|
||||
async () => ({ items: [], total: 0 }),
|
||||
)
|
||||
const detailCols = ref<any[]>([])
|
||||
const detailSummary = ref('')
|
||||
|
||||
const fmtTime = (_r: any, _c: any, v: any): string =>
|
||||
typeof v === 'number' && v > 0 ? formatTime(v) : v ? String(v) : '--'
|
||||
@@ -450,6 +451,10 @@ function openWechatCommModal(row: Account, metric: ChatMetric): void {
|
||||
staff_info: staffInfo,
|
||||
staff_wx: staffWx,
|
||||
}))
|
||||
// 汇总说明(对齐云客)
|
||||
const metricTitle = METRIC_TITLES[metric]
|
||||
const statCount = stats.summary?.[metric === 'chat' ? 'chat_count' : metric === 'effective' ? 'effective_count' : metric === 'follow' ? 'follow_count' : metric === 'last_reply' ? 'last_reply_count' : 'no_reply_count'] ?? 0
|
||||
detailSummary.value = `${metricTitle}总${statCount}人次,其中重复客户${Math.max(0, statCount - filtered.length)}人次 剩余${filtered.length}条记录:`
|
||||
return { items, total: filtered.length, page, page_size }
|
||||
}
|
||||
detailOpen.value = true
|
||||
@@ -930,6 +935,7 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<YkStaffDetailModal
|
||||
:summary-text="detailSummary"
|
||||
v-model="detailOpen"
|
||||
:title="detailTitle"
|
||||
:cols="detailCols"
|
||||
|
||||
Reference in New Issue
Block a user