fix(stats/self_input): 渠道字典、财务脱敏与同日同渠道全局唯一

自媒体来源改推广渠道字典;非白名单隐藏账户消耗/ROI;部门展示完整路径;业绩与消耗按日期+渠道全局去重。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-22 12:02:12 +08:00
co-authored by Cursor
parent bba989c0af
commit e4f181e4fe
13 changed files with 277 additions and 65 deletions
@@ -14,15 +14,32 @@
@change="emit('change', $event)"
@visible-change="onVisibleChange"
>
<el-option v-for="item in options" :key="item" :label="item" :value="item" />
<el-option
v-for="item in normalizedOptions"
:key="item.name"
:label="item.name"
:value="item.name"
/>
<!-- 旧记录可能存在不在当前字典内的值保留显示避免编辑时反查不到 -->
<el-option
v-if="modelValue && !hasCurrentValue"
:key="`__legacy_${modelValue}`"
:label="`${modelValue}(已停用)`"
:value="modelValue"
/>
</el-select>
</template>
<script lang="ts" setup>
withDefaults(
interface OptionItem {
name: string
value?: string
}
const props = withDefaults(
defineProps<{
modelValue?: string
options: string[]
options: Array<OptionItem | string>
loading?: boolean
placeholder?: string
clearable?: boolean
@@ -49,6 +66,16 @@ const emit = defineEmits<{
'visible-change': [visible: boolean]
}>()
const normalizedOptions = computed<OptionItem[]>(() => {
return (props.options || []).map((item) =>
typeof item === 'string' ? { name: item } : { name: item.name, value: item.value }
)
})
const hasCurrentValue = computed(() => {
return normalizedOptions.value.some((item) => item.name === props.modelValue)
})
const onVisibleChange = (visible: boolean) => {
emit('visible-change', visible)
}