Commit d4917b1b by chenwq

feat(teamWork): 新增专项任务列表页面及配置

新增移动端专项任务列表路由配置与页面组件,完善专项任务跳转策略配置,新增专项任务卡片展示常量。优化部分代码:替换let为const,修复文件末尾缺失的换行,调整注释格式与函数声明空格。
1 parent c0f1afec
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
*/ */
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
export { export {
ssoApi,
}
\ No newline at end of file \ No newline at end of file
ssoApi
}
...@@ -27,7 +27,7 @@ Vue.prototype.api = api ...@@ -27,7 +27,7 @@ Vue.prototype.api = api
Vue.prototype.bus = bus Vue.prototype.bus = bus
Vue.prototype.tools = tools Vue.prototype.tools = tools
Vue.prototype.local = local Vue.prototype.local = local
Vue.prototype.to = function (name, params) { Vue.prototype.to = function(name, params) {
if (name === -1) { if (name === -1) {
router.go(-1) router.go(-1)
return return
......
...@@ -14,6 +14,13 @@ export const mobilePages = { ...@@ -14,6 +14,13 @@ export const mobilePages = {
meta: { meta: {
title: '督导日报' title: '督导日报'
} }
},
{
name: 'teamWork/specialTaskList',
path: '/teamWork/specialTaskList',
meta: {
title: '专项任务列表'
}
} }
], ],
performance: [ performance: [
......
...@@ -82,7 +82,7 @@ export const GRID_CONFIG_MAP = { ...@@ -82,7 +82,7 @@ export const GRID_CONFIG_MAP = {
export const JUMP_STRATEGY_MAP = { export const JUMP_STRATEGY_MAP = {
dailyReport: { key: 'dailyReportDetailEnabled', msg: '跳转今日动态日报详情', path: '/teamWork/reportDetail', title: '督导日报', detailType: 'dailyReport', taskIdKey: 'dailyReportTaskId' }, dailyReport: { key: 'dailyReportDetailEnabled', msg: '跳转今日动态日报详情', path: '/teamWork/reportDetail', title: '督导日报', detailType: 'dailyReport', taskIdKey: 'dailyReportTaskId' },
monthReport: { key: 'monthReportDetailEnabled', msg: '跳转月度总览月报详情', path: '/teamWork/reportDetail', title: '督导月报', detailType: 'monthReport', taskIdKey: 'monthReportTaskId' }, monthReport: { key: 'monthReportDetailEnabled', msg: '跳转月度总览月报详情', path: '/teamWork/reportDetail', title: '督导月报', detailType: 'monthReport', taskIdKey: 'monthReportTaskId' },
specialTask: { key: null, msg: '跳转专项督办详情' } // null 表示无条件允许跳转 specialTask: { key: null, msg: '跳转专项督办详情', path: '/teamWork/specialTaskList', title: '专项任务列表', detailType: 'specialTask' } // null 表示无条件允许跳转
} }
// 统一定义详情页的展示配置 // 统一定义详情页的展示配置
...@@ -101,6 +101,28 @@ export const DETAIL_CONFIG_MAP = { ...@@ -101,6 +101,28 @@ export const DETAIL_CONFIG_MAP = {
] ]
} }
// 专项任务卡片配置
export const SPECIAL_TASK_CARD_CONFIG = [
{
icon: 'orders-o',
getLabel: () => '事项描述:',
getValue: (task) => task.taskDesc,
isShow: (task) => !!task.taskDesc
},
{
icon: 'passed',
getLabel: () => '专项任务:',
getValue: (task) => task.taskContext,
isShow: (task) => task.taskStatus === 2 && !!task.taskContext
},
{
icon: 'clock-o',
getLabel: (task) => task.taskStatus === 2 ? '完成时间:' : '创建时间:',
getValue: (task) => task.taskStatus === 2 ? task.updatedDate : task.createTime,
isShow: (task) => !!(task.taskStatus === 2 ? task.updatedDate : task.createTime)
}
]
export default { export default {
STATIC_CARD_MAP, STATIC_CARD_MAP,
TAB_LIST, TAB_LIST,
...@@ -110,5 +132,6 @@ export default { ...@@ -110,5 +132,6 @@ export default {
STATUS_MAP, STATUS_MAP,
GRID_CONFIG_MAP, GRID_CONFIG_MAP,
JUMP_STRATEGY_MAP, JUMP_STRATEGY_MAP,
DETAIL_CONFIG_MAP DETAIL_CONFIG_MAP,
SPECIAL_TASK_CARD_CONFIG
} }
<template>
<div class="special-task-list-page">
<div class="list-container">
<template v-if="list.length > 0">
<div class="task-card" v-for="(task, index) in list" :key="index">
<div class="card-header">
<span class="status-tag" :style="{ color: getStatus(task.taskStatus).color, background: getStatus(task.taskStatus).background }">
{{ getStatus(task.taskStatus).name }}
</span>
<span class="merchant-name">{{ task.merchantName }}</span>
</div>
<div class="card-body">
<template v-for="(item, i) in cardConfig">
<div class="info-row" v-if="item.isShow(task)" :key="i">
<van-icon :name="item.icon" class="icon" />
<span class="label">{{ item.getLabel(task) }}</span>
<span class="value">{{ item.getValue(task) }}</span>
</div>
</template>
</div>
<div class="card-footer">
<div class="view-btn" @click="viewDetail(task)">查看</div>
</div>
</div>
</template>
<van-empty v-else description="暂无专项任务" />
</div>
</div>
</template>
<script>
import constantData from './constantData.js'
export default {
name: 'SpecialTaskList',
data() {
return {
title: '专项任务列表',
list: [],
cardConfig: constantData.SPECIAL_TASK_CARD_CONFIG
}
},
created() {
this.title = this.$route.query.title || '专项任务列表'
try {
const storedItem = sessionStorage.getItem('reportDetailItem')
if (storedItem) {
const itemData = JSON.parse(storedItem)
this.list = itemData.specialTaskList || []
}
} catch (e) {
console.error('Failed to parse item data', e)
}
},
methods: {
onClickLeft() {
this.$router.go(-1)
},
getStatus(status) {
return constantData.STATUS_MAP[status] || { name: '未知', color: '#999999', background: '#f5f5f5' }
},
viewDetail(task) {
console.log('查看详情', task)
// TODO: 跳转到具体的专项任务详情
}
}
}
</script>
<style lang="scss" scoped>
.special-task-list-page {
background: #f2f3f7;
min-height: 100vh;
box-sizing: border-box;
padding-bottom: env(safe-area-inset-bottom);
.navigation-header {
:deep(.van-nav-bar__title) {
font-size: var(--fontSize34, 17px);
color: #000000E5;
font-weight: 600;
}
:deep(.van-icon) {
color: #000000E5;
}
}
.list-container {
padding: 12px;
.task-card {
background: #ffffff;
border-radius: 8px;
padding: 16px;
margin-bottom: 12px;
.card-header {
display: flex;
align-items: center;
margin-bottom: 16px;
.status-tag {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
margin-right: 8px;
flex-shrink: 0;
}
.merchant-name {
font-size: 14px;
font-weight: 500;
color: #000000E5;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.card-body {
.info-row {
display: flex;
align-items: center;
margin-bottom: 10px;
font-size: 12px;
color: #00000066;
&:last-child {
margin-bottom: 0;
}
.icon {
margin-right: 6px;
font-size: 14px;
color: #00000042;
}
.label {
flex-shrink: 0;
}
.value {
flex: 1;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.card-footer {
display: flex;
justify-content: flex-end;
margin-top: 12px;
.view-btn {
background: #F0F4FF;
color: #2C66F7;
font-size: 12px;
padding: 6px 16px;
border-radius: 14px;
}
}
}
}
}
</style>
...@@ -14,11 +14,11 @@ const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) ...@@ -14,11 +14,11 @@ const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
*/ */
const SpritesmithPlugin = require('webpack-spritesmith') const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => { const spritesmithFunction = data => {
let { spritesheet, sprites } = data const { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}` const shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites const perSprite = sprites
.map(sprite => { .map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite const { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}` return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}) })
.join('\n') .join('\n')
...@@ -97,7 +97,7 @@ module.exports = { ...@@ -97,7 +97,7 @@ module.exports = {
customTemplates: { customTemplates: {
function_based_template: spritesmithFunction function_based_template: spritesmithFunction
}, },
//background引用路径 // background引用路径
apiOptions: { apiOptions: {
cssImageRef: '../images/sprite.png' cssImageRef: '../images/sprite.png'
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!