Commit 155f70ad by chenwq

feat(teamWork, searchBar): 实现列表跳转逻辑,修复请求参数并优化搜索框样式

新增统一跳转策略映射常量以集中管理箭头显示和跳转规则
修复团队列表请求参数错误,将 keywordsupervisorName 修正为 supervisorName
为团队列表项添加动态箭头显示与跳转处理逻辑,跳转逻辑暂留控制台打印
优化搜索框组件样式,调整图标尺寸与边框颜色格式
1 parent 47ec3a79
<template> <template>
<div class="search-bar-wrapper"> <div class="search-bar-wrapper">
<van-search <van-search v-model="keyword" :placeholder="placeholder" left-icon="https://img02.glsx.com.cn/weapp/resource/supervise-wecom/icon-search.png" shape="round" background="transparent" @search="onSearch" @clear="onClear" @cancel="onCancel" />
v-model="keyword"
:placeholder="placeholder"
left-icon="https://img02.glsx.com.cn/weapp/resource/supervise-wecom/icon-search.png"
shape="round"
background="transparent"
@search="onSearch"
@clear="onClear"
@cancel="onCancel"
/>
</div> </div>
</template> </template>
...@@ -64,7 +55,7 @@ export default { ...@@ -64,7 +55,7 @@ export default {
} }
:deep(.van-search__content) { :deep(.van-search__content) {
background-color: #f2f3f7; background-color: #f2f3f7;
border: 1px solid #DCDDE1; border: 1px solid #dcdde1;
} }
:deep(.van-cell) { :deep(.van-cell) {
height: 40px; height: 40px;
...@@ -72,5 +63,12 @@ export default { ...@@ -72,5 +63,12 @@ export default {
color: #00000066; color: #00000066;
padding: 8px 12px 8px 0; padding: 8px 12px 8px 0;
} }
:deep(.van-field__left-icon) {
margin-left: 8px;
}
:deep(.van-icon__image) {
width: 20px;
height: 20px;
}
} }
</style> </style>
...@@ -71,10 +71,17 @@ export const GRID_CONFIG_MAP = { ...@@ -71,10 +71,17 @@ export const GRID_CONFIG_MAP = {
{ label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' }, { label: '复盘任务', key: 'reviewTaskProgress', type: 'progress' },
{ label: '带教任务', key: 'teachingTaskProgress', type: 'progress' }, { label: '带教任务', key: 'teachingTaskProgress', type: 'progress' },
{ label: '录音提报', key: 'excellentCaseProgress', type: 'progress' }, { label: '录音提报', key: 'excellentCaseProgress', type: 'progress' },
{ label: '月报', key: 'monthReportStatus', type: 'monthStatus' } { label: '月报', key: 'monthReportStatus', type: 'monthStatus' },
] ]
} }
// 统一定义点击跳转与箭头展示的策略映射
export const JUMP_STRATEGY_MAP = {
0: { key: 'dailyReportDetailEnabled', msg: '跳转今日动态日报详情' },
2: { key: 'monthReportDetailEnabled', msg: '跳转月度总览月报详情' },
3: { key: null, msg: '跳转专项督办详情' } // null 表示无条件允许跳转
}
export default { export default {
STATIC_CARD_MAP, STATIC_CARD_MAP,
TAB_LIST, TAB_LIST,
...@@ -82,5 +89,6 @@ export default { ...@@ -82,5 +89,6 @@ export default {
DAILY_STATUS_MAP, DAILY_STATUS_MAP,
MONTH_STATUS_MAP, MONTH_STATUS_MAP,
STATUS_MAP, STATUS_MAP,
GRID_CONFIG_MAP GRID_CONFIG_MAP,
JUMP_STRATEGY_MAP
} }
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<span class="status-badge" :style="{ color: completionStatusMap[item.completionStatus]?.color, background: completionStatusMap[item.completionStatus]?.background }"> <span class="status-badge" :style="{ color: completionStatusMap[item.completionStatus]?.color, background: completionStatusMap[item.completionStatus]?.background }">
{{ completionStatusMap[item.completionStatus]?.name }} {{ completionStatusMap[item.completionStatus]?.name }}
</span> </span>
<van-icon name="arrow" v-if="item.dailyReportDetailEnabled" color="#000000E5;" size="12" style="margin-left: 4px;" /> <van-icon name="arrow" v-if="canShowArrow(item)" color="#000000E5" size="12" style="margin-left: 4px;" />
</div> </div>
</div> </div>
...@@ -189,6 +189,21 @@ export default { ...@@ -189,6 +189,21 @@ export default {
getSpecialProgressColor(val) { getSpecialProgressColor(val) {
return this.getProgressColor(val, true) return this.getProgressColor(val, true)
}, },
// 判断是否显示箭头
canShowArrow(item) {
const strategy = constantData.JUMP_STRATEGY_MAP[this.tabIndex]
// 只有配置了依赖字段,且该字段值为 true 时才显示箭头(tabIndex为3无依赖字段,不显示)
return strategy?.key ? item[strategy.key] === true : false
},
// 处理列表点击跳转
jump(item) {
const { key, msg } = constantData.JUMP_STRATEGY_MAP[this.tabIndex] || {}
// 未配置策略、或依赖的权限字段为 false 时,直接拦截跳转
if (!msg || (key && !item[key])) return
console.log(msg) // 后续可替换为 this.$router.push(path)
},
formatThousands(v) { formatThousands(v) {
const s = String(v) const s = String(v)
if (!s) return s if (!s) return s
...@@ -286,7 +301,7 @@ export default { ...@@ -286,7 +301,7 @@ export default {
endDate: this.endStr, endDate: this.endStr,
// pageNum: this.pageNum, // pageNum: this.pageNum,
// pageSize: 10, // pageSize: 10,
keywordsupervisorName: this.searchKeyword supervisorName: this.searchKeyword
} }
api.getMissionData(params).then(res => { api.getMissionData(params).then(res => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!