feat(training): 企业培训迭代:推送深链接与签名下载、课程管理修复与收集模板调整
推送域(000155):
- 广播通知支持 link_url:demand_collect 场景自动签发教育训练需求表模板
匿名下载直链(HMAC token,20 天有效,免登录路由),企微消息尾部拼
「下载模板 + 查看更多详情」链接;站内文本保持纯文本不受影响
- 配置中心新增「推送链接基址」(notify_link_base_url,多入口/内外网部署固定
权威地址,留空跟随推送人访问地址)与「年培训计划收集推送文案」
(demand_collect_*,{year} 渲染收集年度);空标题/内容按模板回落渲染
- 迁移 000155:tr_training_notifications 增 link_url/link_token 列
课程管理:
- 修复点【发布/下线】报「不支持的操作」:动作取值兼容字面量路由(FullPath
末段)与 :action 通配两种注册形态
- 列表新增「创建人」列:creator_id 联查 users 带出姓名,导出 Excel 同步;
新增课程「所属部门」默认当前登录用户所在部门
- 导入加固:表头归一化 + 别名模糊匹配(兼容内置模板/旧口径/自定义模板变体);
导入与新增行支持按部门名兜底解析为 id(前端名册未命中时传 owner_dept_name)
年培训计划:
- 需求列表新增「创建人/创建时间」列(submitter_id 联查 users 带出姓名)
- 收集模板调整:下载时动态删除「培训费用(RMB)」列(旧版自定义模板同步归一,
右侧列/合并/下拉随删列平移);备注右侧追加「调研维度/培训策划要求」说明列
(合并至数据区末行,自动换行带边框,已带说明的自定义模板不覆盖)
开发工具:
- air 热重载适配 Windows:构建收敛到 scripts/air_build.sh(规避 air 经
PowerShell 执行不支持 bash 命令替换),产物改 .exe 后缀;CGO_CFLAGS 取
持久化值并集追加,不覆盖 go env -w 的头文件包含路径
This commit is contained in:
1 parent
242dd7e1a6
commit
4e25fce9aa
30 files changed
+1150
-143
No files matched your search
@@ -76,6 +76,9 @@
|
||||
</t-tooltip>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
<!-- 创建人(提报人姓名)/创建时间:记录需求由谁何时录入 -->
|
||||
<template #submitter_name="{ row }">{{ row.submitter_name || '-' }}</template>
|
||||
<template #created_at="{ row }">{{ fmtBeijingTime(row.created_at) || '-' }}</template>
|
||||
<template #check_status="{ row }">
|
||||
<t-tag v-if="row.check_status === 'passed'" theme="success" variant="light" size="small">已确认</t-tag>
|
||||
<t-tag v-else-if="row.check_status === 'pending'" theme="warning" variant="light" size="small">待核验</t-tag>
|
||||
@@ -194,7 +197,7 @@
|
||||
:autosize="{ minRows: 6 }"
|
||||
placeholder="或粘贴需求行:课程名称[,计划培训月份如 3] (支持中英文逗号)"
|
||||
/>
|
||||
<div class="form-hint">模板列对应:编号/部门/课程名称/适合人员/地点/培訓費用/内/外培训(内部或外部,下拉选择)/计划培训月份(1~12,下拉选择)/讲师/备注;适合人员可填多人(、/,分隔),讲师可填系统员工(按姓名自动匹配并带出部门)或外部讲师姓名;导入后统一为「待核验」,由部门经理核验确认。</div>
|
||||
<div class="form-hint">模板列对应:编号/部门/课程名称/适合人员/地点/内/外培训(下拉选择内部或外部)/计划培训月份(1~12,下拉选择)/讲师/备注;费用列已移除;备注右侧为「调研维度与培训策划要求」说明列,无需填写;适合人员可填多人(、/,分隔),讲师可填系统员工(按姓名自动匹配并带出部门)或外部讲师姓名;导入后统一为「待核验」,由部门经理核验确认。</div>
|
||||
<template #footer>
|
||||
<t-button theme="primary" :loading="saving" @click="onImportDemands">导入粘贴内容</t-button>
|
||||
</template>
|
||||
@@ -207,6 +210,7 @@
|
||||
<span class="collect-template-name">教育训练需求表模板(填写后经「批量导入」上传,或「在线提报需求」逐条填写)</span>
|
||||
<t-button variant="outline" size="small" @click="onDownloadDemandTemplate">下载模板</t-button>
|
||||
</div>
|
||||
<div class="form-hint">企微推送的消息尾部会自动附带「下载教育训练需求表模板」直链(20 天内有效)与「查看更多详情>>」入口,课长点击即可下载模板或进入企业培训系统。</div>
|
||||
<div class="collect-section-title">发送人员</div>
|
||||
<t-select
|
||||
v-model="collectForm.userIds"
|
||||
@@ -234,12 +238,16 @@
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import * as XLSX from 'xlsx'
|
||||
import { fmtBeijingTime } from '@/utils/datetime'
|
||||
import { DEMAND_TEMPLATE_KEY, downloadTrainingTemplate } from '../trainingTemplates'
|
||||
import { apiErrorMessage } from '@/utils/request'
|
||||
import {
|
||||
broadcastTrainingNotification,
|
||||
confirmDemand,
|
||||
DEFAULT_DEMAND_COLLECT_CONTENT,
|
||||
DEFAULT_DEMAND_COLLECT_TITLE,
|
||||
deleteDemand,
|
||||
fetchDemandCollectText,
|
||||
getMyProfile,
|
||||
importDemands,
|
||||
listCourseLibrary,
|
||||
@@ -385,6 +393,9 @@ const demandColumns = [
|
||||
{ colKey: 'train_type', title: '内/外培训', width: 90 },
|
||||
{ colKey: 'location', title: '地点', width: 100 },
|
||||
{ colKey: 'remark', title: '备注', minWidth: 140 },
|
||||
// 创建人(提报人)/创建时间:记录需求录入人员与时间
|
||||
{ colKey: 'submitter_name', title: '创建人', width: 96 },
|
||||
{ colKey: 'created_at', title: '创建时间', width: 140 },
|
||||
// 状态/操作固定在列表右侧,横向滚动时始终可见
|
||||
{ colKey: 'check_status', title: '状态', width: 84, fixed: 'right' },
|
||||
{ colKey: 'op', title: '操作', width: 160, fixed: 'right' },
|
||||
@@ -858,7 +869,10 @@ const collectVisible = ref(false)
|
||||
const collectSending = ref(false)
|
||||
const members = ref<TrainingMember[]>([])
|
||||
const membersLoading = ref(false)
|
||||
const collectForm = ref({ userIds: [] as string[], content: '' })
|
||||
const collectForm = ref({ userIds: [] as string[], title: '', content: '' })
|
||||
|
||||
// {year} 占位符替换为收集年度(下一年;与配置中心文案模板口径一致)
|
||||
const renderCollectTpl = (tpl: string) => tpl.split('{year}').join(String(nextYear))
|
||||
|
||||
// 推送人员下拉展示:姓名/工号 · 岗位 · 部门
|
||||
const memberLabel = (m: TrainingMember) =>
|
||||
@@ -874,10 +888,15 @@ const defaultCollectUserIds = () =>
|
||||
.map((m) => m.user_id)
|
||||
|
||||
const openCollect = async () => {
|
||||
collectForm.value.content =
|
||||
`请各部门于 ${nextYear} 年 1 月 31 日前,登录 AIDO → 企业培训 → 培训计划 → 年度需求收集,` +
|
||||
`提报 ${nextYear} 年度培训需求:可在线逐条提报,或下载「教育训练需求表模板」批量填写后导入。`
|
||||
// [2026-11 需求] 收集推送文案可配(配置中心「提醒推送文案」卡):先以内置
|
||||
// 默认渲染 {year} 打底(拉取失败也不空白),再异步回读配置覆盖预填文案
|
||||
collectForm.value.title = renderCollectTpl(DEFAULT_DEMAND_COLLECT_TITLE)
|
||||
collectForm.value.content = renderCollectTpl(DEFAULT_DEMAND_COLLECT_CONTENT)
|
||||
collectVisible.value = true
|
||||
fetchDemandCollectText().then((tpl) => {
|
||||
collectForm.value.title = renderCollectTpl(tpl.title)
|
||||
collectForm.value.content = renderCollectTpl(tpl.content)
|
||||
})
|
||||
// 名册只拉一次;每次打开按默认角色重置推送人员(支持在此基础上增删)
|
||||
if (!members.value.length) {
|
||||
membersLoading.value = true
|
||||
@@ -903,10 +922,12 @@ const onSendCollect = async () => {
|
||||
const res = await broadcastTrainingNotification({
|
||||
user_ids: collectForm.value.userIds,
|
||||
scene: 'demand_collect',
|
||||
title: `【培训需求收集】${nextYear}年度培训计划收集`,
|
||||
title: collectForm.value.title || renderCollectTpl(DEFAULT_DEMAND_COLLECT_TITLE),
|
||||
content: collectForm.value.content,
|
||||
ref_type: 'plan',
|
||||
ref_id: String(nextYear),
|
||||
// 前端 origin:后端据此在企微消息尾部拼模板签名下载链接与「查看更多详情」入口
|
||||
link_url: window.location.origin,
|
||||
})
|
||||
MessagePlugin.success(`已推送通知 ${unwrap(res)?.sent ?? 0} 人(站内 + 企业微信;未绑定企微的同事仅站内送达,可在配置中心查看推送记录)`)
|
||||
collectVisible.value = false
|
||||
|
||||
Reference in new issue
Block a user