fix bugs
This commit is contained in:
1 parent
c0cb55dce6
commit
211763908a
4 files changed
+666
-271
No files matched your search
+500
-5
@@ -845,6 +845,57 @@ const messages = {
|
||||
loadingAgent: 'Loading agent...',
|
||||
thinking: 'Generating response...',
|
||||
disclaimer: 'AI can make mistakes. Please verify important information.',
|
||||
createNewChat: 'New Chat',
|
||||
clearAll: 'Clear All',
|
||||
clearOneRecord: 'Clear This Record',
|
||||
agents: 'Agents',
|
||||
noOtherAgents: 'No other agents',
|
||||
noAvailableAgents: 'No available agents',
|
||||
collapseAgents: 'Collapse agents',
|
||||
expandAgents: 'Expand agents',
|
||||
generalFeedback: 'Feedback',
|
||||
language: 'Language',
|
||||
langZhCn: 'Simplified Chinese',
|
||||
langEn: 'English',
|
||||
langZhTw: 'Traditional Chinese',
|
||||
langTh: 'Thai',
|
||||
logout: 'Logout',
|
||||
welcomeTitle: 'Hello, I am Hexin AI Digital Human',
|
||||
askAnything: 'Ask me anything...',
|
||||
voiceFeature: 'Voice feature',
|
||||
collapseBrowser: 'Collapse Browser',
|
||||
openBrowser: 'Open Browser',
|
||||
browser: 'Browser',
|
||||
closeBrowser: 'Close Browser',
|
||||
browserInputPlaceholder: 'Enter URL, e.g. https://example.com',
|
||||
open: 'Open',
|
||||
refresh: 'Refresh',
|
||||
openInNewTab: 'Open in new tab',
|
||||
browserHint1: 'Open webpages here while chatting.',
|
||||
browserHint2: 'Supports https://, localhost, and intranet IP.',
|
||||
feedbackSubmitSuccess: 'Feedback submitted successfully',
|
||||
noData: 'No data',
|
||||
loading: 'Loading...',
|
||||
loadMore: 'Load more',
|
||||
loadAll: 'Load all',
|
||||
noMoreData: 'No more data',
|
||||
loginOaSystem: 'Login OA System',
|
||||
employeeId: 'Employee ID',
|
||||
enterOaPassword: 'Please enter OA password',
|
||||
confirmLogin: 'Confirm login',
|
||||
currentUser: 'Current User',
|
||||
dayUnit: 'day',
|
||||
hourUnit: 'hour',
|
||||
leaveBalanceInsufficient: '**{label} balance is insufficient.**',
|
||||
leaveBalanceTableLeaveType: 'Leave Type',
|
||||
leaveBalanceTableYear: 'Year',
|
||||
leaveBalanceTableAvailable: 'Available',
|
||||
leaveBalanceTableUsed: 'Used',
|
||||
leaveBalanceTableRemaining: 'Remaining',
|
||||
leaveBalanceContactHr: 'If needed, please contact HR to confirm leave data.',
|
||||
leaveConfirmPrompt: 'Please confirm the following leave information before submitting to OA.',
|
||||
oaLeaveSubmitFailed: 'OA leave submission failed, please try again later.',
|
||||
leaveSubmitFailedPrefix: 'Leave submission failed: {error}',
|
||||
suggestions: {
|
||||
whatCanYouDo: 'What can you do?',
|
||||
helpWriteReport: 'Help me write a report',
|
||||
@@ -859,8 +910,81 @@ const messages = {
|
||||
selectRating: 'Please select a rating first',
|
||||
commentPlaceholder: 'Add a comment (optional)...',
|
||||
sent: 'Sent'
|
||||
}
|
||||
},
|
||||
oaPopupBlocked: 'Popup blocked. Please allow popups and retry.',
|
||||
oaLoggingTitle: 'Logging into OA...',
|
||||
oaLoggingBody: 'Logging into OA, please wait...',
|
||||
noEmployeeId: 'Cannot login OA without employee ID.',
|
||||
oaPasswordRequired: 'Please enter OA password.',
|
||||
oaRequestMissing: 'OA request ID is missing.',
|
||||
devComingSoon: 'This feature is under development',
|
||||
previewUnavailable: 'Preview is temporarily unavailable',
|
||||
invalidBrowserUrl: 'Please enter a valid URL such as https://example.com or localhost:8891',
|
||||
enterBrowserUrl: 'Please enter a URL first',
|
||||
queryLeaveBalance: 'Checking your leave balance, please wait...',
|
||||
leaveFormIntro: 'We generated the leave form for you. Fill and submit below, or ',
|
||||
oaLeaveDirectLink: 'apply directly in OA',
|
||||
oaLeaveDirectHintKey: 'or',
|
||||
leaveApplicantRequired: 'Leave applicant is required.',
|
||||
leaveTypeRequired: 'Please select leave type.',
|
||||
leaveAgentRequired: 'Please select agent.',
|
||||
startTimeRequired: 'Please select a valid start time.',
|
||||
endTimeRequired: 'Please select a valid end time.',
|
||||
durationInvalid: 'Duration must be greater than 0 hour.',
|
||||
leaveResultSubmitted: 'Leave request submitted to OA. Please check:',
|
||||
confirmClearHistory: 'Clear all chat history? This cannot be undone.',
|
||||
confirmDeleteHistoryItem: 'Delete this chat history?',
|
||||
leaveFiller: 'Filler',
|
||||
createdAt: 'Created At',
|
||||
leaveType: 'Leave Type',
|
||||
selectLeaveType: 'Select leave type',
|
||||
leaveApplicant: 'Applicant',
|
||||
selectLeaveApplicant: 'Select applicant',
|
||||
pickLeaveApplicant: 'Pick applicant',
|
||||
leaveAgent: 'Agent',
|
||||
selectLeaveAgent: 'Select agent',
|
||||
pickLeaveAgent: 'Pick agent',
|
||||
startTime: 'Start Time',
|
||||
endTime: 'End Time',
|
||||
duration: 'Duration',
|
||||
isOutOfOffice: 'Out of office',
|
||||
isWorkInjury: 'Work injury',
|
||||
yes: 'Yes',
|
||||
no: 'No',
|
||||
leaveConfirmGenerated: 'Confirmation generated. You can edit and submit again.',
|
||||
submitting: 'Submitting...',
|
||||
submit: 'Submit',
|
||||
leaveFillerInfo: 'Filler Info',
|
||||
leaveApplicantInfo: 'Applicant Info',
|
||||
leaveInfo: 'Leave Info',
|
||||
notSelected: 'Not selected',
|
||||
leaveFillerTitle: 'Filler Title',
|
||||
leaveFillerDept: 'Filler Department',
|
||||
leaveFillerCompany: 'Filler Company',
|
||||
leaveApplicantTitle: 'Applicant Title',
|
||||
leaveApplicantDept: 'Applicant Department',
|
||||
leaveApplicantCompany: 'Applicant Company',
|
||||
leaveAgentTitle: 'Agent Title',
|
||||
leaveAgentDept: 'Agent Department',
|
||||
leaveAgentCompany: 'Agent Company',
|
||||
backToEdit: 'Back to edit',
|
||||
confirming: 'Confirming...',
|
||||
confirmed: 'Confirmed',
|
||||
confirm: 'Confirm',
|
||||
oaSubmitResult: 'OA submit result',
|
||||
oaSubmitFailed: 'OA submit failed',
|
||||
leaveResultPrefix: 'Leave request submitted to OA. View:',
|
||||
leaveResultLinkText: '[ View in OA ]',
|
||||
requestNo: 'Request No',
|
||||
submitTime: 'Submitted At',
|
||||
sourceDocs: 'Source Documents',
|
||||
attributionParts: 'Attribution Parts',
|
||||
selectWho: 'Select {role}',
|
||||
oaDataConnected: 'Connected to OA database view query.',
|
||||
searchByNameOrEmployeeId: 'Search by name or employee ID, press Enter',
|
||||
name: 'Name',
|
||||
employeeIdRequired: 'Employee ID is required.'
|
||||
},
|
||||
profile: {
|
||||
title: 'Profile',
|
||||
personalInfo: 'Personal Information',
|
||||
@@ -1713,6 +1837,57 @@ const messages = {
|
||||
loadingAgent: '正在加载应用...',
|
||||
thinking: '正在生成回答...',
|
||||
disclaimer: 'AI 可能会犯错,请核实重要信息。',
|
||||
createNewChat: '创建新对话',
|
||||
clearAll: '清空全部',
|
||||
clearOneRecord: '清除该记录',
|
||||
agents: '智能体',
|
||||
noOtherAgents: '暂无其他智能体',
|
||||
noAvailableAgents: '暂无可用智能体',
|
||||
collapseAgents: '收起智能体',
|
||||
expandAgents: '展开智能体',
|
||||
generalFeedback: '意见反馈',
|
||||
language: '语言',
|
||||
langZhCn: '简体中文',
|
||||
langEn: 'English',
|
||||
langZhTw: '繁體中文',
|
||||
langTh: 'ไทย',
|
||||
logout: '退出登录',
|
||||
welcomeTitle: '你好,我是和信AI数字人',
|
||||
askAnything: '问我任何事...',
|
||||
voiceFeature: '语音功能',
|
||||
collapseBrowser: '收起浏览器',
|
||||
openBrowser: '打开浏览器',
|
||||
browser: '浏览器',
|
||||
closeBrowser: '关闭浏览器',
|
||||
browserInputPlaceholder: '输入网址,例如 https://example.com',
|
||||
open: '打开',
|
||||
refresh: '刷新',
|
||||
openInNewTab: '新标签打开',
|
||||
browserHint1: '在这里直接打开网页,边聊天边查看内容。',
|
||||
browserHint2: '支持输入 `https://`、`localhost` 或内网 IP 地址。',
|
||||
feedbackSubmitSuccess: '反馈提交成功',
|
||||
noData: '暂无数据',
|
||||
loading: '加载中...',
|
||||
loadMore: '加载更多',
|
||||
loadAll: '加载全部',
|
||||
noMoreData: '没有更多数据了',
|
||||
loginOaSystem: '登录OA系统',
|
||||
employeeId: '工号',
|
||||
enterOaPassword: '请输入OA登录密码',
|
||||
confirmLogin: '确认登录',
|
||||
currentUser: '当前用户',
|
||||
dayUnit: '天',
|
||||
hourUnit: '小时',
|
||||
leaveBalanceInsufficient: '**{label}余额不足,暂无可用假期。**',
|
||||
leaveBalanceTableLeaveType: '假别',
|
||||
leaveBalanceTableYear: '年度',
|
||||
leaveBalanceTableAvailable: '可休',
|
||||
leaveBalanceTableUsed: '已休',
|
||||
leaveBalanceTableRemaining: '当前剩余',
|
||||
leaveBalanceContactHr: '如有疑问,请联系人事部门确认假期数据。',
|
||||
leaveConfirmPrompt: '请确认以下请假信息,确认无误后再提交到 OA。',
|
||||
oaLeaveSubmitFailed: 'OA 请假提交失败,请稍后重试。',
|
||||
leaveSubmitFailedPrefix: '请假单提交失败:{error}',
|
||||
suggestions: {
|
||||
whatCanYouDo: '你能做什么?',
|
||||
helpWriteReport: '帮我写一份报告',
|
||||
@@ -1727,7 +1902,80 @@ const messages = {
|
||||
selectRating: '请先选择评分',
|
||||
commentPlaceholder: '添加评论(可选)...',
|
||||
sent: '已发送'
|
||||
}
|
||||
},
|
||||
oaPopupBlocked: '浏览器拦截了 OA 页面,请允许弹出窗口后重试。',
|
||||
oaLoggingTitle: '正在登录OA系统...',
|
||||
oaLoggingBody: '正在登录OA系统,请稍候...',
|
||||
noEmployeeId: '没有工号信息无法登录OA系统!',
|
||||
oaPasswordRequired: '请输入OA登录密码!',
|
||||
oaRequestMissing: '当前未获取到 OA 单据编号,暂时无法打开单据详情。',
|
||||
devComingSoon: '该功能正在开发中',
|
||||
previewUnavailable: '当前源文件暂时无法预览',
|
||||
invalidBrowserUrl: '请输入有效的网址,例如 https://example.com 或 localhost:8891',
|
||||
enterBrowserUrl: '请先输入可打开的网址。',
|
||||
queryLeaveBalance: '正在查询您的假期余额,请稍候...',
|
||||
leaveFormIntro: '已为你生成请假申请表,请直接在下方填写并提交。或',
|
||||
oaLeaveDirectLink: '登录OA系统直接申请',
|
||||
oaLeaveDirectHintKey: '或登录OA系统直接申请',
|
||||
leaveApplicantRequired: '请假人不能为空。',
|
||||
leaveTypeRequired: '请选择假别。',
|
||||
leaveAgentRequired: '请选择代理人。',
|
||||
startTimeRequired: '请选择正确的开始时间。',
|
||||
endTimeRequired: '请选择正确的结束时间。',
|
||||
durationInvalid: '时长必须大于0小时,请检查开始时间和结束时间。',
|
||||
leaveResultSubmitted: '请假单已推送到 OA,具体单据请 【 登录OA系统查看提交】',
|
||||
confirmClearHistory: '确定要清除全部聊天历史记录吗?此操作不可恢复。',
|
||||
confirmDeleteHistoryItem: '确定要删除这条聊天记录吗?',
|
||||
leaveFiller: '填单人',
|
||||
createdAt: '创建时间',
|
||||
leaveType: '假别',
|
||||
selectLeaveType: '请选择假别',
|
||||
leaveApplicant: '请假人',
|
||||
selectLeaveApplicant: '请选择请假人',
|
||||
pickLeaveApplicant: '选择请假人',
|
||||
leaveAgent: '代理人',
|
||||
selectLeaveAgent: '请选择代理人',
|
||||
pickLeaveAgent: '选择代理人',
|
||||
startTime: '开始时间',
|
||||
endTime: '结束时间',
|
||||
duration: '时长',
|
||||
isOutOfOffice: '是否外出',
|
||||
isWorkInjury: '是否为工伤',
|
||||
yes: '是',
|
||||
no: '否',
|
||||
leaveConfirmGenerated: '已生成确认单,如需调整可直接修改表单后再次点击提交。',
|
||||
submitting: '提交中...',
|
||||
submit: '提交',
|
||||
leaveFillerInfo: '填单人信息',
|
||||
leaveApplicantInfo: '申请人信息',
|
||||
leaveInfo: '请假信息',
|
||||
notSelected: '未选择',
|
||||
leaveFillerTitle: '填单人职务',
|
||||
leaveFillerDept: '填单人部门',
|
||||
leaveFillerCompany: '填单人公司',
|
||||
leaveApplicantTitle: '申请人职务',
|
||||
leaveApplicantDept: '申请人部门',
|
||||
leaveApplicantCompany: '申请人公司',
|
||||
leaveAgentTitle: '代理人职务',
|
||||
leaveAgentDept: '代理人部门',
|
||||
leaveAgentCompany: '代理人公司',
|
||||
backToEdit: '返回修改',
|
||||
confirming: '确认中...',
|
||||
confirmed: '已确认',
|
||||
confirm: '确认',
|
||||
oaSubmitResult: 'OA 提交结果',
|
||||
oaSubmitFailed: 'OA 提交失败',
|
||||
leaveResultPrefix: '请假单已推送到 OA,具体单据请',
|
||||
leaveResultLinkText: '【 登录OA系统查看提交】',
|
||||
requestNo: '单据编号',
|
||||
submitTime: '提交时间',
|
||||
sourceDocs: '源文档',
|
||||
attributionParts: '生成内容归属部分',
|
||||
selectWho: '选择{role}',
|
||||
oaDataConnected: '已接入 OA 数据库视图查询。',
|
||||
searchByNameOrEmployeeId: '输入姓名或工号搜索,按回车键查询',
|
||||
name: '姓名',
|
||||
employeeIdRequired: '工号不能为空。'
|
||||
},
|
||||
profile: {
|
||||
title: '个人资料',
|
||||
@@ -2570,6 +2818,57 @@ const messages = {
|
||||
loadingAgent: '正在加載應用...',
|
||||
thinking: '正在生成回答...',
|
||||
disclaimer: 'AI 可能會犯錯,請核實重要信息。',
|
||||
createNewChat: '建立新對話',
|
||||
clearAll: '清空全部',
|
||||
clearOneRecord: '清除此記錄',
|
||||
agents: '智能體',
|
||||
noOtherAgents: '暫無其他智能體',
|
||||
noAvailableAgents: '暫無可用智能體',
|
||||
collapseAgents: '收起智能體',
|
||||
expandAgents: '展開智能體',
|
||||
generalFeedback: '意見反饋',
|
||||
language: '語言',
|
||||
langZhCn: '簡體中文',
|
||||
langEn: 'English',
|
||||
langZhTw: '繁體中文',
|
||||
langTh: 'ไทย',
|
||||
logout: '退出登入',
|
||||
welcomeTitle: '你好,我是和信AI數字人',
|
||||
askAnything: '問我任何事...',
|
||||
voiceFeature: '語音功能',
|
||||
collapseBrowser: '收起瀏覽器',
|
||||
openBrowser: '打開瀏覽器',
|
||||
browser: '瀏覽器',
|
||||
closeBrowser: '關閉瀏覽器',
|
||||
browserInputPlaceholder: '輸入網址,例如 https://example.com',
|
||||
open: '打開',
|
||||
refresh: '刷新',
|
||||
openInNewTab: '新分頁打開',
|
||||
browserHint1: '在這裡直接打開網頁,邊聊天邊查看內容。',
|
||||
browserHint2: '支持輸入 `https://`、`localhost` 或內網 IP 地址。',
|
||||
feedbackSubmitSuccess: '反饋提交成功',
|
||||
noData: '暫無資料',
|
||||
loading: '載入中...',
|
||||
loadMore: '載入更多',
|
||||
loadAll: '載入全部',
|
||||
noMoreData: '沒有更多資料了',
|
||||
loginOaSystem: '登入OA系統',
|
||||
employeeId: '工號',
|
||||
enterOaPassword: '請輸入OA登入密碼',
|
||||
confirmLogin: '確認登入',
|
||||
currentUser: '目前使用者',
|
||||
dayUnit: '天',
|
||||
hourUnit: '小時',
|
||||
leaveBalanceInsufficient: '**{label}餘額不足,暫無可用假期。**',
|
||||
leaveBalanceTableLeaveType: '假別',
|
||||
leaveBalanceTableYear: '年度',
|
||||
leaveBalanceTableAvailable: '可休',
|
||||
leaveBalanceTableUsed: '已休',
|
||||
leaveBalanceTableRemaining: '目前剩餘',
|
||||
leaveBalanceContactHr: '如有疑問,請聯繫人事部門確認假期資料。',
|
||||
leaveConfirmPrompt: '請確認以下請假資訊,確認無誤後再提交到 OA。',
|
||||
oaLeaveSubmitFailed: 'OA 請假提交失敗,請稍後重試。',
|
||||
leaveSubmitFailedPrefix: '請假單提交失敗:{error}',
|
||||
suggestions: {
|
||||
whatCanYouDo: '你能做什麼?',
|
||||
helpWriteReport: '幫我寫一份報告',
|
||||
@@ -2584,7 +2883,80 @@ const messages = {
|
||||
selectRating: '請先選擇評分',
|
||||
commentPlaceholder: '添加評論(可選)...',
|
||||
sent: '已發送'
|
||||
}
|
||||
},
|
||||
oaPopupBlocked: '瀏覽器攔截了 OA 頁面,請允許彈出視窗後重試。',
|
||||
oaLoggingTitle: '正在登入OA系統...',
|
||||
oaLoggingBody: '正在登入OA系統,請稍候...',
|
||||
noEmployeeId: '沒有工號資訊無法登入OA系統!',
|
||||
oaPasswordRequired: '請輸入OA登入密碼!',
|
||||
oaRequestMissing: '目前未取得 OA 單據編號,暫時無法開啟單據詳情。',
|
||||
devComingSoon: '該功能正在開發中',
|
||||
previewUnavailable: '目前源文件暫時無法預覽',
|
||||
invalidBrowserUrl: '請輸入有效網址,例如 https://example.com 或 localhost:8891',
|
||||
enterBrowserUrl: '請先輸入可開啟的網址。',
|
||||
queryLeaveBalance: '正在查詢您的假期餘額,請稍候...',
|
||||
leaveFormIntro: '已為你生成請假申請表,請直接在下方填寫並提交。或',
|
||||
oaLeaveDirectLink: '登入OA系統直接申請',
|
||||
oaLeaveDirectHintKey: '或登入OA系統直接申請',
|
||||
leaveApplicantRequired: '請假人不能為空。',
|
||||
leaveTypeRequired: '請選擇假別。',
|
||||
leaveAgentRequired: '請選擇代理人。',
|
||||
startTimeRequired: '請選擇正確的開始時間。',
|
||||
endTimeRequired: '請選擇正確的結束時間。',
|
||||
durationInvalid: '時長必須大於0小時,請檢查開始與結束時間。',
|
||||
leaveResultSubmitted: '請假單已推送到 OA,具體單據請 【 登入OA系統查看提交】',
|
||||
confirmClearHistory: '確定要清除全部聊天歷史記錄嗎?此操作不可恢復。',
|
||||
confirmDeleteHistoryItem: '確定要刪除這條聊天記錄嗎?',
|
||||
leaveFiller: '填單人',
|
||||
createdAt: '建立時間',
|
||||
leaveType: '假別',
|
||||
selectLeaveType: '請選擇假別',
|
||||
leaveApplicant: '請假人',
|
||||
selectLeaveApplicant: '請選擇請假人',
|
||||
pickLeaveApplicant: '選擇請假人',
|
||||
leaveAgent: '代理人',
|
||||
selectLeaveAgent: '請選擇代理人',
|
||||
pickLeaveAgent: '選擇代理人',
|
||||
startTime: '開始時間',
|
||||
endTime: '結束時間',
|
||||
duration: '時長',
|
||||
isOutOfOffice: '是否外出',
|
||||
isWorkInjury: '是否為工傷',
|
||||
yes: '是',
|
||||
no: '否',
|
||||
leaveConfirmGenerated: '已生成確認單,如需調整可直接修改表單後再次點擊提交。',
|
||||
submitting: '提交中...',
|
||||
submit: '提交',
|
||||
leaveFillerInfo: '填單人資訊',
|
||||
leaveApplicantInfo: '申請人資訊',
|
||||
leaveInfo: '請假資訊',
|
||||
notSelected: '未選擇',
|
||||
leaveFillerTitle: '填單人職務',
|
||||
leaveFillerDept: '填單人部門',
|
||||
leaveFillerCompany: '填單人公司',
|
||||
leaveApplicantTitle: '申請人職務',
|
||||
leaveApplicantDept: '申請人部門',
|
||||
leaveApplicantCompany: '申請人公司',
|
||||
leaveAgentTitle: '代理人職務',
|
||||
leaveAgentDept: '代理人部門',
|
||||
leaveAgentCompany: '代理人公司',
|
||||
backToEdit: '返回修改',
|
||||
confirming: '確認中...',
|
||||
confirmed: '已確認',
|
||||
confirm: '確認',
|
||||
oaSubmitResult: 'OA 提交結果',
|
||||
oaSubmitFailed: 'OA 提交失敗',
|
||||
leaveResultPrefix: '請假單已推送到 OA,具體單據請',
|
||||
leaveResultLinkText: '【 登入OA系統查看提交】',
|
||||
requestNo: '單據編號',
|
||||
submitTime: '提交時間',
|
||||
sourceDocs: '源文件',
|
||||
attributionParts: '生成內容歸屬部分',
|
||||
selectWho: '選擇{role}',
|
||||
oaDataConnected: '已接入 OA 資料庫視圖查詢。',
|
||||
searchByNameOrEmployeeId: '輸入姓名或工號搜尋,按 Enter 查詢',
|
||||
name: '姓名',
|
||||
employeeIdRequired: '工號不能為空。'
|
||||
},
|
||||
profile: {
|
||||
title: '個人資料',
|
||||
@@ -3427,6 +3799,57 @@ const messages = {
|
||||
loadingAgent: 'กำลังโหลดตัวแทน...',
|
||||
thinking: 'กำลังสร้างคำตอบ...',
|
||||
disclaimer: 'AI อาจทำผิดพลาดได้ โปรดตรวจสอบข้อมูลสำคัญ',
|
||||
createNewChat: 'แชทใหม่',
|
||||
clearAll: 'ล้างทั้งหมด',
|
||||
clearOneRecord: 'ลบรายการนี้',
|
||||
agents: 'ตัวแทน',
|
||||
noOtherAgents: 'ไม่มีตัวแทนอื่น',
|
||||
noAvailableAgents: 'ไม่มีตัวแทนที่ใช้ได้',
|
||||
collapseAgents: 'ย่อตัวแทน',
|
||||
expandAgents: 'ขยายตัวแทน',
|
||||
generalFeedback: 'ข้อเสนอแนะ',
|
||||
language: 'ภาษา',
|
||||
langZhCn: '简体中文',
|
||||
langEn: 'English',
|
||||
langZhTw: '繁體中文',
|
||||
langTh: 'ไทย',
|
||||
logout: 'ออกจากระบบ',
|
||||
welcomeTitle: 'สวัสดี ฉันคือ AI Digital Human ของ Hexin',
|
||||
askAnything: 'ถามฉันได้ทุกเรื่อง...',
|
||||
voiceFeature: 'ฟีเจอร์เสียง',
|
||||
collapseBrowser: 'ย่อเบราว์เซอร์',
|
||||
openBrowser: 'เปิดเบราว์เซอร์',
|
||||
browser: 'เบราว์เซอร์',
|
||||
closeBrowser: 'ปิดเบราว์เซอร์',
|
||||
browserInputPlaceholder: 'ใส่ URL เช่น https://example.com',
|
||||
open: 'เปิด',
|
||||
refresh: 'รีเฟรช',
|
||||
openInNewTab: 'เปิดในแท็บใหม่',
|
||||
browserHint1: 'เปิดเว็บได้ที่นี่พร้อมคุยไปด้วย',
|
||||
browserHint2: 'รองรับ https://, localhost และ IP ภายในเครือข่าย',
|
||||
feedbackSubmitSuccess: 'ส่งข้อเสนอแนะสำเร็จ',
|
||||
noData: 'ไม่มีข้อมูล',
|
||||
loading: 'กำลังโหลด...',
|
||||
loadMore: 'โหลดเพิ่ม',
|
||||
loadAll: 'โหลดทั้งหมด',
|
||||
noMoreData: 'ไม่มีข้อมูลเพิ่มเติมแล้ว',
|
||||
loginOaSystem: 'เข้าสู่ระบบ OA',
|
||||
employeeId: 'รหัสพนักงาน',
|
||||
enterOaPassword: 'กรอกรหัสผ่าน OA',
|
||||
confirmLogin: 'ยืนยันการเข้าสู่ระบบ',
|
||||
currentUser: 'ผู้ใช้ปัจจุบัน',
|
||||
dayUnit: 'วัน',
|
||||
hourUnit: 'ชั่วโมง',
|
||||
leaveBalanceInsufficient: '**ยอด{label}ไม่เพียงพอ**',
|
||||
leaveBalanceTableLeaveType: 'ประเภทลา',
|
||||
leaveBalanceTableYear: 'ปี',
|
||||
leaveBalanceTableAvailable: 'คงเหลือที่ใช้ได้',
|
||||
leaveBalanceTableUsed: 'ใช้ไปแล้ว',
|
||||
leaveBalanceTableRemaining: 'คงเหลือปัจจุบัน',
|
||||
leaveBalanceContactHr: 'หากมีข้อสงสัย โปรดติดต่อฝ่ายบุคคลเพื่อตรวจสอบข้อมูลวันลา',
|
||||
leaveConfirmPrompt: 'โปรดยืนยันข้อมูลการลาพนักงานก่อนส่งไปยัง OA',
|
||||
oaLeaveSubmitFailed: 'ส่งคำขอลา OA ไม่สำเร็จ กรุณาลองใหม่อีกครั้ง',
|
||||
leaveSubmitFailedPrefix: 'ส่งใบลาล้มเหลว: {error}',
|
||||
suggestions: {
|
||||
whatCanYouDo: 'คุณทำอะไรได้บ้าง?',
|
||||
helpWriteReport: 'ช่วยฉันเขียนรายงาน',
|
||||
@@ -3441,7 +3864,80 @@ const messages = {
|
||||
selectRating: 'กรุณาเลือกคะแนนก่อน',
|
||||
commentPlaceholder: 'เพิ่มความคิดเห็น (ไม่บังคับ)...',
|
||||
sent: 'ส่งแล้ว'
|
||||
}
|
||||
},
|
||||
oaPopupBlocked: 'เบราว์เซอร์บล็อกหน้าต่าง OA กรุณาอนุญาตป๊อปอัปแล้วลองใหม่',
|
||||
oaLoggingTitle: 'กำลังเข้าสู่ระบบ OA...',
|
||||
oaLoggingBody: 'กำลังเข้าสู่ระบบ OA โปรดรอสักครู่...',
|
||||
noEmployeeId: 'ไม่มีรหัสพนักงาน ไม่สามารถเข้าสู่ OA ได้',
|
||||
oaPasswordRequired: 'กรุณากรอกรหัสผ่าน OA',
|
||||
oaRequestMissing: 'ยังไม่ได้รับเลขเอกสาร OA จึงไม่สามารถเปิดรายละเอียดได้',
|
||||
devComingSoon: 'ฟีเจอร์นี้กำลังพัฒนา',
|
||||
previewUnavailable: 'ยังไม่สามารถพรีวิวไฟล์ต้นทางได้ชั่วคราว',
|
||||
invalidBrowserUrl: 'กรุณาใส่ URL ที่ถูกต้อง เช่น https://example.com หรือ localhost:8891',
|
||||
enterBrowserUrl: 'กรุณาใส่ URL ก่อน',
|
||||
queryLeaveBalance: 'กำลังตรวจสอบยอดสิทธิ์ลาของคุณ โปรดรอสักครู่...',
|
||||
leaveFormIntro: 'ระบบได้สร้างแบบฟอร์มลางานให้แล้ว กรุณากรอกและส่งด้านล่าง หรือ',
|
||||
oaLeaveDirectLink: 'ยื่นคำขอโดยตรงใน OA',
|
||||
oaLeaveDirectHintKey: 'หรือยื่นคำขอโดยตรงใน OA',
|
||||
leaveApplicantRequired: 'ผู้ขอลาห้ามว่าง',
|
||||
leaveTypeRequired: 'กรุณาเลือกประเภทการลา',
|
||||
leaveAgentRequired: 'กรุณาเลือกผู้แทน',
|
||||
startTimeRequired: 'กรุณาเลือกเวลาเริ่มต้นที่ถูกต้อง',
|
||||
endTimeRequired: 'กรุณาเลือกเวลาสิ้นสุดที่ถูกต้อง',
|
||||
durationInvalid: 'ระยะเวลาต้องมากกว่า 0 ชั่วโมง',
|
||||
leaveResultSubmitted: 'ส่งใบลางานไปยัง OA แล้ว กรุณาตรวจสอบที่ 【 ดูการส่งใน OA 】',
|
||||
confirmClearHistory: 'ยืนยันล้างประวัติแชททั้งหมด? การกระทำนี้ย้อนกลับไม่ได้',
|
||||
confirmDeleteHistoryItem: 'ยืนยันลบประวัติแชทรายการนี้?',
|
||||
leaveFiller: 'ผู้กรอก',
|
||||
createdAt: 'เวลาสร้าง',
|
||||
leaveType: 'ประเภทการลา',
|
||||
selectLeaveType: 'กรุณาเลือกประเภทการลา',
|
||||
leaveApplicant: 'ผู้ขอลา',
|
||||
selectLeaveApplicant: 'กรุณาเลือกผู้ขอลา',
|
||||
pickLeaveApplicant: 'เลือกผู้ขอลา',
|
||||
leaveAgent: 'ผู้แทน',
|
||||
selectLeaveAgent: 'กรุณาเลือกผู้แทน',
|
||||
pickLeaveAgent: 'เลือกผู้แทน',
|
||||
startTime: 'เวลาเริ่มต้น',
|
||||
endTime: 'เวลาสิ้นสุด',
|
||||
duration: 'ระยะเวลา',
|
||||
isOutOfOffice: 'ออกนอกสถานที่หรือไม่',
|
||||
isWorkInjury: 'เป็นอุบัติเหตุจากงานหรือไม่',
|
||||
yes: 'ใช่',
|
||||
no: 'ไม่',
|
||||
leaveConfirmGenerated: 'สร้างใบยืนยันแล้ว หากต้องการแก้ไขให้แก้ฟอร์มแล้วส่งอีกครั้ง',
|
||||
submitting: 'กำลังส่ง...',
|
||||
submit: 'ส่ง',
|
||||
leaveFillerInfo: 'ข้อมูลผู้กรอก',
|
||||
leaveApplicantInfo: 'ข้อมูลผู้ขอลา',
|
||||
leaveInfo: 'ข้อมูลการลา',
|
||||
notSelected: 'ยังไม่เลือก',
|
||||
leaveFillerTitle: 'ตำแหน่งผู้กรอก',
|
||||
leaveFillerDept: 'แผนกผู้กรอก',
|
||||
leaveFillerCompany: 'บริษัทผู้กรอก',
|
||||
leaveApplicantTitle: 'ตำแหน่งผู้ขอลา',
|
||||
leaveApplicantDept: 'แผนกผู้ขอลา',
|
||||
leaveApplicantCompany: 'บริษัทผู้ขอลา',
|
||||
leaveAgentTitle: 'ตำแหน่งผู้แทน',
|
||||
leaveAgentDept: 'แผนกผู้แทน',
|
||||
leaveAgentCompany: 'บริษัทผู้แทน',
|
||||
backToEdit: 'กลับไปแก้ไข',
|
||||
confirming: 'กำลังยืนยัน...',
|
||||
confirmed: 'ยืนยันแล้ว',
|
||||
confirm: 'ยืนยัน',
|
||||
oaSubmitResult: 'ผลการส่ง OA',
|
||||
oaSubmitFailed: 'ส่ง OA ล้มเหลว',
|
||||
leaveResultPrefix: 'ส่งใบลางานไปยัง OA แล้ว กรุณาตรวจสอบที่',
|
||||
leaveResultLinkText: '【 ดูการส่งใน OA 】',
|
||||
requestNo: 'เลขที่เอกสาร',
|
||||
submitTime: 'เวลาส่ง',
|
||||
sourceDocs: 'เอกสารต้นทาง',
|
||||
attributionParts: 'ส่วนแสดงแหล่งที่มา',
|
||||
selectWho: 'เลือก{role}',
|
||||
oaDataConnected: 'เชื่อมต่อการค้นหามุมมองฐานข้อมูล OA แล้ว',
|
||||
searchByNameOrEmployeeId: 'ค้นหาด้วยชื่อหรือรหัสพนักงาน แล้วกด Enter',
|
||||
name: 'ชื่อ',
|
||||
employeeIdRequired: 'รหัสพนักงานห้ามว่าง'
|
||||
},
|
||||
profile: {
|
||||
title: 'โปรไฟล์',
|
||||
@@ -3483,4 +3979,3 @@ const i18n = createI18n({
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
||||
@@ -22,7 +22,6 @@ import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
import { buildWecomAuditMeta, formatWecomAuditReason } from '../utils/wecom';
|
||||
import { getAuthHeaders } from '../utils/auth';
|
||||
import { listAdminSchedules, createAdminSchedule, updateAdminSchedule, deleteAdminSchedule, toggleAdminSchedule, runAdminSchedule, listAdminScheduleRuns, getAdminScheduleTaskConfig, testAdminScheduleSql, testAdminScheduleRun, type ScheduleTask, type ScheduleRun, type TestScheduleRunResult } from '../api/schedule';
|
||||
import { exportAdminScheduleUrl, importAdminSchedules } from '../api/schedule';
|
||||
import {
|
||||
ArrowLeft,
|
||||
// Save,
|
||||
@@ -39,7 +38,6 @@ import {
|
||||
MessageSquare,
|
||||
Globe,
|
||||
Download,
|
||||
ArrowUpFromLine,
|
||||
UserCog,
|
||||
Building,
|
||||
MessageCircleQuestion,
|
||||
@@ -710,8 +708,6 @@ const openScheduleCreateModal = async () => {
|
||||
const openScheduleEditModal = async (task: ScheduleTask) => {
|
||||
await Promise.all([loadAgents(), loadUsers()]);
|
||||
scheduleConfigCollapsed.value = true;
|
||||
scheduleNotifyFilterText.value = '';
|
||||
scheduleNotifyDropdownOpen.value = false;
|
||||
scheduleEditingId.value = task.id;
|
||||
scheduleCreateForm.value = {
|
||||
name: task.name || '',
|
||||
@@ -724,31 +720,6 @@ const openScheduleEditModal = async (task: ScheduleTask) => {
|
||||
enabled: !!task.enabled,
|
||||
data_source_type: (task.data_source_type || 'database') as 'database' | 'external_api',
|
||||
};
|
||||
scheduleSqlEditForm.value = {
|
||||
base_fetch_sql: '',
|
||||
fetch_where_conditions: '',
|
||||
fetch_order_by: '',
|
||||
detail_sql: '',
|
||||
writeback_sql: '',
|
||||
row_id_key: 'id',
|
||||
log_prefix: '',
|
||||
alias_order_str: '',
|
||||
detail_alias_order_str: '',
|
||||
header_labels_str: '{}',
|
||||
ds_db_type: 'sqlserver',
|
||||
ds_host: '',
|
||||
ds_port: '',
|
||||
ds_database: '',
|
||||
ds_username: '',
|
||||
ds_password: '',
|
||||
ds_driver: '',
|
||||
ds_encrypt: '',
|
||||
ds_trust_cert: '',
|
||||
api_url: '',
|
||||
api_method: 'POST',
|
||||
api_headers_str: '{}',
|
||||
api_body_template: '',
|
||||
};
|
||||
|
||||
try {
|
||||
const result = await getAdminScheduleTaskConfig(task.id);
|
||||
@@ -935,7 +906,6 @@ const selectedScheduleLatestRunAt = computed(
|
||||
const scheduleEnabledCount = computed(() => schedules.value.filter((item) => item.enabled).length);
|
||||
const scheduleDisabledCount = computed(() => schedules.value.filter((item) => !item.enabled).length);
|
||||
const scheduleRunningCount = computed(() => schedules.value.filter((item) => item.last_status === 'running').length);
|
||||
const scheduleImportInputRef = ref<HTMLInputElement | null>(null);
|
||||
|
||||
const loadSchedules = async () => {
|
||||
scheduleLoading.value = true;
|
||||
@@ -960,38 +930,6 @@ const loadSchedules = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const exportSchedule = async (taskId: number) => {
|
||||
const res = await fetch(exportAdminScheduleUrl(taskId), { headers: getAuthHeaders() });
|
||||
if (!res.ok) {
|
||||
showMessageDialog('error', '导出失败');
|
||||
return;
|
||||
}
|
||||
const blob = await res.blob();
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = `schedule_${taskId}_${new Date().toISOString().slice(0, 19).replace(/[:T]/g, '-')}.json`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
const importSchedulesFromFile = async (event: Event) => {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const file = input.files?.[0];
|
||||
if (!file) return;
|
||||
try {
|
||||
const text = await file.text();
|
||||
const payload = JSON.parse(text);
|
||||
const result = await importAdminSchedules(payload);
|
||||
showMessageDialog('success', `导入完成:${result.imported} 条,跳过 ${result.skipped} 条`);
|
||||
await loadSchedules();
|
||||
} catch (e: any) {
|
||||
showMessageDialog('error', e?.message || '导入失败');
|
||||
} finally {
|
||||
input.value = '';
|
||||
}
|
||||
};
|
||||
|
||||
const scheduleSqlEditForm = ref({
|
||||
base_fetch_sql: '',
|
||||
fetch_where_conditions: '',
|
||||
@@ -1042,24 +980,6 @@ const handleTestScheduleSql = async () => {
|
||||
};
|
||||
|
||||
const scheduleNotifyDropdownOpen = ref(false);
|
||||
const scheduleNotifyFilterText = ref('');
|
||||
|
||||
const filteredScheduleNotifyUsers = computed(() => {
|
||||
const keyword = scheduleNotifyFilterText.value.trim().toLowerCase();
|
||||
if (!keyword) return users.value;
|
||||
return users.value.filter((u) => {
|
||||
const fields = [
|
||||
u.real_name,
|
||||
u.username,
|
||||
u.employee_id,
|
||||
u.email,
|
||||
u.phone_number,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.map(v => String(v).toLowerCase());
|
||||
return fields.some(v => v.includes(keyword));
|
||||
});
|
||||
});
|
||||
|
||||
const getUserName = (uid: number) => {
|
||||
const u = users.value.find(x => x.id === uid);
|
||||
@@ -4321,7 +4241,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
|
||||
<template v-if="scheduleViewMode === 'overview'">
|
||||
<div class="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm">
|
||||
<div class="mb-5 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4">
|
||||
<div class="mb-5 grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4">
|
||||
<div class="rounded-2xl bg-slate-50 px-4 py-3">
|
||||
<div class="text-xl font-bold text-slate-900">{{ schedules.length }}</div>
|
||||
<div class="text-sm text-slate-500">排程总数</div>
|
||||
@@ -4352,13 +4272,6 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<Settings2 class="h-4 w-4" />
|
||||
</div>
|
||||
<div class="font-semibold text-slate-900">新增排程</div>
|
||||
<button
|
||||
class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-violet-200 text-violet-700 transition hover:bg-violet-50"
|
||||
title="汇入"
|
||||
@click="scheduleImportInputRef?.click()"
|
||||
>
|
||||
<ArrowUpFromLine class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="text-sm text-slate-500">
|
||||
点击按钮后弹窗录入排程字段。
|
||||
@@ -4371,13 +4284,6 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<Plus class="h-4 w-4" />
|
||||
新增排程
|
||||
</button>
|
||||
<input
|
||||
ref="scheduleImportInputRef"
|
||||
type="file"
|
||||
accept=".json,application/json"
|
||||
class="hidden"
|
||||
@change="importSchedulesFromFile"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4389,16 +4295,7 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<button class="w-full text-left" @click="openScheduleRunSubmenu(s.id)">
|
||||
<div class="min-h-[96px]">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="flex min-w-0 items-center gap-2">
|
||||
<div class="truncate text-base font-semibold text-slate-900">{{ s.name }}</div>
|
||||
<button
|
||||
class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-emerald-200 text-emerald-700 transition hover:bg-emerald-50"
|
||||
title="汇出"
|
||||
@click.stop="exportSchedule(s.id)"
|
||||
>
|
||||
<Download class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="truncate text-base font-semibold text-slate-900">{{ s.name }}</div>
|
||||
<span class="inline-flex shrink-0 items-center whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-semibold"
|
||||
:class="s.enabled ? 'bg-emerald-100 text-emerald-700' : 'bg-slate-200 text-slate-600'">
|
||||
{{ s.enabled ? '启用' : '停用' }}
|
||||
@@ -4406,6 +4303,12 @@ const handlePermissionImport = async (event: Event) => {
|
||||
</div>
|
||||
<div class="mt-2 text-sm text-slate-500">编号:{{ s.schedule_no }}</div>
|
||||
<div class="mt-1 text-sm text-slate-500">Cron:{{ s.cron_expr }}</div>
|
||||
<div
|
||||
v-if="s.schedule_type === 'platform_app' && s.platform_api_path"
|
||||
class="mt-1 text-sm text-slate-500"
|
||||
>
|
||||
配置:{{ s.platform_api_path }}
|
||||
</div>
|
||||
<div class="mt-1 text-sm text-slate-500">所有者:{{ s.owner_username || s.owner_user_id }}</div>
|
||||
</div>
|
||||
</button>
|
||||
@@ -6143,17 +6046,8 @@ const handlePermissionImport = async (event: Event) => {
|
||||
v-if="scheduleNotifyDropdownOpen"
|
||||
class="absolute z-50 mt-1 max-h-52 w-full overflow-auto rounded-xl border border-slate-200 bg-white shadow-lg"
|
||||
>
|
||||
<div class="sticky top-0 z-10 border-b border-slate-100 bg-white p-2">
|
||||
<input
|
||||
v-model.trim="scheduleNotifyFilterText"
|
||||
type="text"
|
||||
class="input-field !h-8 !rounded-lg !px-2.5 !py-1 !text-xs"
|
||||
placeholder="输入姓名 / 工号 / 用户名筛选"
|
||||
@click.stop
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-for="u in filteredScheduleNotifyUsers"
|
||||
v-for="u in users"
|
||||
:key="u.id"
|
||||
class="flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition hover:bg-slate-50"
|
||||
:class="scheduleCreateForm.notify_user_ids_json.includes(u.id) ? 'bg-blue-50/50' : ''"
|
||||
@@ -6169,9 +6063,6 @@ const handlePermissionImport = async (event: Event) => {
|
||||
/>
|
||||
<span class="text-slate-700">{{ u.real_name || u.username }}{{ u.employee_id ? '(' + u.employee_id + ')' : '' }}</span>
|
||||
</div>
|
||||
<div v-if="filteredScheduleNotifyUsers.length === 0" class="px-3 py-3 text-xs text-slate-400">
|
||||
未找到匹配人员
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+149
-140
@@ -23,7 +23,7 @@ import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
import { useIsMobile } from '../composables/useIsMobile';
|
||||
import { getAuthHeaders, getStoredAuthUser, clearAuthUser } from '../utils/auth';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
const { showMessageDialog } = useGlobalMessageDialog();
|
||||
const { isMobile } = useIsMobile();
|
||||
const showMobileAgentPopover = ref(false);
|
||||
@@ -91,8 +91,12 @@ const handleLogout = () => {
|
||||
router.push('/');
|
||||
};
|
||||
|
||||
watch(locale, (newLang) => {
|
||||
localStorage.setItem('hxops_lang', String(newLang));
|
||||
});
|
||||
|
||||
const handleVoiceFeatureClick = () => {
|
||||
showMessageDialog('info', '该功能正在开发中');
|
||||
showMessageDialog('info', t('chat.devComingSoon'));
|
||||
};
|
||||
|
||||
const stripReasoningPrelude = (text: string) => {
|
||||
@@ -563,7 +567,7 @@ const openPreview = async (file: SourceFileLink) => {
|
||||
previewFile.value = resolvedFile;
|
||||
filePreviewVisible.value = true;
|
||||
} catch (error: any) {
|
||||
showMessageDialog('warning', error?.message || '当前源文件暂时无法预览');
|
||||
showMessageDialog('warning', error?.message || t('chat.previewUnavailable'));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -611,16 +615,16 @@ const openOAAutoLoginPage = (gopage: string, username: string, password: string,
|
||||
// 直接在弹出窗口内写入自动提交表单,避免跨窗口时序问题
|
||||
const popup = window.open('about:blank', target);
|
||||
if (!popup) {
|
||||
showMessageDialog('warning', '浏览器拦截了 OA 页面,请允许弹出窗口后重试。');
|
||||
showMessageDialog('warning', t('chat.oaPopupBlocked'));
|
||||
return;
|
||||
}
|
||||
|
||||
const formHtml = `
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><meta charset="utf-8"><title>正在登录OA系统...</title></head>
|
||||
<head><meta charset="utf-8"><title>${t('chat.oaLoggingTitle')}</title></head>
|
||||
<body>
|
||||
<p style="text-align:center;margin-top:100px;font-family:sans-serif;color:#666;">正在登录OA系统,请稍候...</p>
|
||||
<p style="text-align:center;margin-top:100px;font-family:sans-serif;color:#666;">${t('chat.oaLoggingBody')}</p>
|
||||
<form id="oaLoginForm" action="${OA_VERIFY_LOGIN_URL}" method="POST">
|
||||
<input type="hidden" name="loginid" value="${username}" />
|
||||
<input type="hidden" name="userpassword" value="${password.replace(/"/g, '"')}" />
|
||||
@@ -640,7 +644,7 @@ const openOAAutoLoginPage = (gopage: string, username: string, password: string,
|
||||
const openOALeaveRequestDirectly = () => {
|
||||
const employeeId = currentUserEmployeeId.value;
|
||||
if (!employeeId || employeeId === '-') {
|
||||
showMessageDialog('warning', '没有工号信息无法登录OA系统!');
|
||||
showMessageDialog('warning', t('chat.noEmployeeId'));
|
||||
return;
|
||||
}
|
||||
oaLoginEmployeeId.value = employeeId;
|
||||
@@ -652,7 +656,7 @@ const openOALeaveRequestDirectly = () => {
|
||||
|
||||
const confirmOALogin = () => {
|
||||
if (!oaLoginPassword.value.trim()) {
|
||||
showMessageDialog('warning', '请输入OA登录密码!');
|
||||
showMessageDialog('warning', t('chat.oaPasswordRequired'));
|
||||
return;
|
||||
}
|
||||
// 记住密码到 localStorage
|
||||
@@ -668,12 +672,12 @@ const cancelOALogin = () => {
|
||||
const openOARequestDirectly = (requestId: string) => {
|
||||
const normalizedRequestId = String(requestId || '').trim();
|
||||
if (!normalizedRequestId || normalizedRequestId === '-') {
|
||||
showMessageDialog('warning', '当前未获取到 OA 单据编号,暂时无法打开单据详情。');
|
||||
showMessageDialog('warning', t('chat.oaRequestMissing'));
|
||||
return;
|
||||
}
|
||||
const employeeId = currentUserEmployeeId.value;
|
||||
if (!employeeId || employeeId === '-') {
|
||||
showMessageDialog('warning', '没有工号信息无法登录OA系统!');
|
||||
showMessageDialog('warning', t('chat.noEmployeeId'));
|
||||
return;
|
||||
}
|
||||
oaLoginEmployeeId.value = employeeId;
|
||||
@@ -887,12 +891,12 @@ const calculateDurationHours = (startTime: string, endTime: string) => {
|
||||
};
|
||||
|
||||
const formatDurationLabel = (hours: number) => {
|
||||
if (!hours) return '0 小时';
|
||||
if (!hours) return `0 ${t('chat.hourUnit')}`;
|
||||
if (hours >= 8 && Number.isInteger((hours / 8) * 10) && (hours / 8) >= 1) {
|
||||
const days = Number((hours / 8).toFixed(2));
|
||||
return `${days} 天 / ${hours} 小时`;
|
||||
return `${days} ${t('chat.dayUnit')} / ${hours} ${t('chat.hourUnit')}`;
|
||||
}
|
||||
return `${hours} 小时`;
|
||||
return `${hours} ${t('chat.hourUnit')}`;
|
||||
};
|
||||
|
||||
const extractLeaveTypeFromIntent = (content: string) => {
|
||||
@@ -999,7 +1003,7 @@ const saveLocalMessageToBackend = async (msg: any, userQuery: string = '') => {
|
||||
const NEED_BALANCE_CHECK_TYPES = new Set(['010', '408']);
|
||||
|
||||
const formatLeaveBalanceNumber = (value: any) => {
|
||||
if (value === null || value === undefined) return '暂无数据';
|
||||
if (value === null || value === undefined) return t('chat.noData');
|
||||
const num = Number(value);
|
||||
if (Number.isNaN(num)) return String(value);
|
||||
return Number.isInteger(num) ? String(num) : num.toFixed(2);
|
||||
@@ -1034,7 +1038,7 @@ const startLocalLeaveFlow = async (content: string) => {
|
||||
const thinkingMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'text' as const,
|
||||
content: '正在查询您的假期余额,请稍候...',
|
||||
content: t('chat.queryLeaveBalance'),
|
||||
};
|
||||
messages.value.push(thinkingMsg);
|
||||
|
||||
@@ -1046,15 +1050,15 @@ const startLocalLeaveFlow = async (content: string) => {
|
||||
}
|
||||
|
||||
if (balance && !balance.has_balance) {
|
||||
const unit = initialLeaveType === '010' ? '天' : '小时';
|
||||
const unit = initialLeaveType === '010' ? t('chat.dayUnit') : t('chat.hourUnit');
|
||||
const detailLines = [
|
||||
`**${balance.leave_type_label}余额不足,暂无可用假期。**`,
|
||||
t('chat.leaveBalanceInsufficient', { label: balance.leave_type_label }),
|
||||
'',
|
||||
`| 假别 | 年度 | 可休 | 已休 | 当前剩余 |`,
|
||||
`| ${t('chat.leaveBalanceTableLeaveType')} | ${t('chat.leaveBalanceTableYear')} | ${t('chat.leaveBalanceTableAvailable')} | ${t('chat.leaveBalanceTableUsed')} | ${t('chat.leaveBalanceTableRemaining')} |`,
|
||||
`| :---: | :---: | :---: | :---: | :---: |`,
|
||||
`| ${balance.leave_type_label} | ${balance.year} | ${formatLeaveBalanceNumber(balance.total_hours)}${unit} | ${formatLeaveBalanceNumber(balance.used_hours)}${unit} | ${formatLeaveBalanceNumber(balance.remaining_hours)}${unit} |`,
|
||||
'',
|
||||
'如有疑问,请联系人事部门确认假期数据。',
|
||||
t('chat.leaveBalanceContactHr'),
|
||||
];
|
||||
const noBalanceMsg = {
|
||||
role: 'assistant' as const,
|
||||
@@ -1085,7 +1089,7 @@ const startLocalLeaveFlow = async (content: string) => {
|
||||
const formMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'leave-form' as const,
|
||||
content: '已为你生成请假申请表,请直接在下方填写并提交。或登录OA系统直接申请',
|
||||
content: t('chat.leaveFormIntro'),
|
||||
payload,
|
||||
local_id: formId,
|
||||
local_only: true,
|
||||
@@ -1304,7 +1308,7 @@ const toggleBrowserPanel = () => {
|
||||
const loadBrowserPage = () => {
|
||||
const normalized = normalizeBrowserInput(browserDraftUrl.value);
|
||||
if (!normalized) {
|
||||
showMessageDialog('warning', '请输入有效的网址,例如 `https://example.com` 或 `localhost:8891`。');
|
||||
showMessageDialog('warning', t('chat.invalidBrowserUrl'));
|
||||
return;
|
||||
}
|
||||
browserCurrentUrl.value = normalized;
|
||||
@@ -1324,7 +1328,7 @@ const refreshBrowserPage = () => {
|
||||
const openBrowserInNewTab = () => {
|
||||
const normalized = browserCurrentUrl.value || normalizeBrowserInput(browserDraftUrl.value);
|
||||
if (!normalized) {
|
||||
showMessageDialog('warning', '请先输入可打开的网址。');
|
||||
showMessageDialog('warning', t('chat.enterBrowserUrl'));
|
||||
return;
|
||||
}
|
||||
window.open(normalized, '_blank', 'noopener,noreferrer');
|
||||
@@ -1435,13 +1439,13 @@ const handleSend = async (textOrEvent?: string | Event) => {
|
||||
};
|
||||
|
||||
const validateLeaveForm = (form: LeaveRequestFormData) => {
|
||||
if (!form.applicantName.trim()) return '请假人不能为空。';
|
||||
if (!form.employeeId.trim()) return '工号不能为空。';
|
||||
if (!form.leaveType.trim()) return '请选择假别。';
|
||||
if (!form.agentUid.trim()) return '请选择代理人。';
|
||||
if (!parseDateTime(form.startTime)) return '请选择正确的开始时间。';
|
||||
if (!parseDateTime(form.endTime)) return '请选择正确的结束时间。';
|
||||
if (calculateDurationHours(form.startTime, form.endTime) <= 0) return '时长必须大于0小时,请检查开始时间和结束时间。';
|
||||
if (!form.applicantName.trim()) return t('chat.leaveApplicantRequired');
|
||||
if (!form.employeeId.trim()) return t('chat.employeeIdRequired');
|
||||
if (!form.leaveType.trim()) return t('chat.leaveTypeRequired');
|
||||
if (!form.agentUid.trim()) return t('chat.leaveAgentRequired');
|
||||
if (!parseDateTime(form.startTime)) return t('chat.startTimeRequired');
|
||||
if (!parseDateTime(form.endTime)) return t('chat.endTimeRequired');
|
||||
if (calculateDurationHours(form.startTime, form.endTime) <= 0) return t('chat.durationInvalid');
|
||||
return '';
|
||||
};
|
||||
|
||||
@@ -1465,7 +1469,7 @@ const submitLeaveForm = (msg: any) => {
|
||||
const confirmMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'leave-confirmation' as const,
|
||||
content: '请确认以下请假信息,确认无误后再提交到 OA。',
|
||||
content: t('chat.leaveConfirmPrompt'),
|
||||
payload: {
|
||||
formId: payload.formId,
|
||||
form: summary,
|
||||
@@ -1525,13 +1529,13 @@ const confirmLeaveSubmission = async (msg: any) => {
|
||||
});
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok) {
|
||||
throw new Error(data?.error || 'OA 请假提交失败,请稍后重试。');
|
||||
throw new Error(data?.error || t('chat.oaLeaveSubmitFailed'));
|
||||
}
|
||||
|
||||
const resultMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'leave-result' as const,
|
||||
content: '请假单已推送到 OA,具体单据请 【 登录OA系统查看提交】',
|
||||
content: t('chat.leaveResultSubmitted'),
|
||||
payload: {
|
||||
formId: payload.formId,
|
||||
success: true,
|
||||
@@ -1548,12 +1552,12 @@ const confirmLeaveSubmission = async (msg: any) => {
|
||||
saveLocalMessageToBackend(msg);
|
||||
saveLocalMessageToBackend(resultMsg);
|
||||
} catch (error: any) {
|
||||
const errorMessage = error?.message || 'OA 请假提交失败,请稍后重试。';
|
||||
const errorMessage = error?.message || t('chat.oaLeaveSubmitFailed');
|
||||
showMessageDialog('error', errorMessage);
|
||||
const resultMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'leave-result' as const,
|
||||
content: `请假单提交失败:${errorMessage}`,
|
||||
content: t('chat.leaveSubmitFailedPrefix', { error: errorMessage }),
|
||||
payload: {
|
||||
formId: payload.formId,
|
||||
success: false,
|
||||
@@ -1609,7 +1613,7 @@ const loadHistory = async () => {
|
||||
};
|
||||
|
||||
const clearAllHistory = async () => {
|
||||
if (!confirm('确定要清除全部聊天历史记录吗?此操作不可恢复。')) return;
|
||||
if (!confirm(t('chat.confirmClearHistory'))) return;
|
||||
try {
|
||||
const res = await fetch(`/api/chat/sessions?agent_id=${agentId}`, {
|
||||
method: 'DELETE',
|
||||
@@ -1628,7 +1632,7 @@ const clearAllHistory = async () => {
|
||||
|
||||
const deleteHistoryItem = async (id: string, event: Event) => {
|
||||
event.stopPropagation();
|
||||
if (!confirm('确定要删除这条聊天记录吗?')) return;
|
||||
if (!confirm(t('chat.confirmDeleteHistoryItem'))) return;
|
||||
try {
|
||||
const res = await fetch(`/api/chat/sessions/${id}?agent_id=${agentId}`, {
|
||||
method: 'DELETE',
|
||||
@@ -1801,7 +1805,7 @@ const showChatRating = ref(false);
|
||||
<Sparkles class="h-5 w-5" />
|
||||
</div>
|
||||
|
||||
<button @click="startNewChat(); isSidebarOpen = false;" class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-slate-50 text-slate-700 shadow-sm transition-colors hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700" title="创建新对话">
|
||||
<button @click="startNewChat(); isSidebarOpen = false;" class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-slate-50 text-slate-700 shadow-sm transition-colors hover:bg-slate-100 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700" :title="$t('chat.createNewChat')">
|
||||
<Plus class="h-5 w-5" />
|
||||
</button>
|
||||
|
||||
@@ -1810,7 +1814,7 @@ const showChatRating = ref(false);
|
||||
<div class="flex h-8 w-8 items-center justify-center rounded-full bg-brand-600 text-sm font-bold text-white shadow-sm shadow-brand-500/20">
|
||||
{{ (currentUser?.username || 'I').charAt(0).toUpperCase() }}
|
||||
</div>
|
||||
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" title="意见反馈"><Mail class="h-5 w-5" /></button>
|
||||
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('chat.generalFeedback')"><Mail class="h-5 w-5" /></button>
|
||||
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Settings class="h-5 w-5" /></button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1829,14 +1833,14 @@ const showChatRating = ref(false);
|
||||
|
||||
<div class="px-4 pb-4">
|
||||
<button @click="startNewChat(); isSidebarOpen = false;" class="flex w-full items-center justify-center gap-2 rounded-xl border border-slate-200 bg-slate-50 py-3 text-sm font-medium text-slate-700 shadow-sm transition-colors hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700">
|
||||
<Plus class="h-4 w-4" /> 创建新对话
|
||||
<Plus class="h-4 w-4" /> {{ $t('chat.createNewChat') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between px-4 py-2">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">聊天记录</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.history') }}</span>
|
||||
<button v-if="history.length > 0" @click="clearAllHistory" class="text-xs text-slate-400 transition-colors hover:text-slate-600 dark:hover:text-slate-200">
|
||||
清空全部
|
||||
{{ $t('chat.clearAll') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -1861,7 +1865,7 @@ const showChatRating = ref(false);
|
||||
<button
|
||||
@click="deleteHistoryItem(item.conversation_id, $event)"
|
||||
class="absolute right-2 p-1.5 text-slate-400 opacity-0 transition-opacity hover:text-red-500 group-hover:opacity-100 dark:hover:text-red-400"
|
||||
title="清除该记录"
|
||||
:title="$t('chat.clearOneRecord')"
|
||||
>
|
||||
<X class="h-4 w-4" />
|
||||
</button>
|
||||
@@ -1872,7 +1876,7 @@ const showChatRating = ref(false);
|
||||
<div class="mt-auto flex flex-col p-4">
|
||||
<div v-if="userAgents.length > 0 && showAgentPanel" class="mb-4 rounded-2xl border border-slate-200 bg-slate-50/70 p-3 dark:border-slate-700 dark:bg-slate-800/60">
|
||||
<div class="mb-2 flex items-center gap-1.5 text-xs font-semibold text-slate-500 dark:text-slate-400">
|
||||
<LayoutGrid class="h-3.5 w-3.5" /> 智能体
|
||||
<LayoutGrid class="h-3.5 w-3.5" /> {{ $t('chat.agents') }}
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-x-2 gap-y-1.5">
|
||||
<button
|
||||
@@ -1902,22 +1906,32 @@ const showChatRating = ref(false);
|
||||
</div>
|
||||
<div class="overflow-hidden">
|
||||
<div class="text-sm font-bold text-slate-900 dark:text-slate-100 truncate">{{ currentUser?.username || 'User' }}</div>
|
||||
<div v-if="(currentUser as any)?.employee_id" class="text-xs text-slate-500 dark:text-slate-400 truncate">工号: {{ (currentUser as any).employee_id }}</div>
|
||||
<div v-if="(currentUser as any)?.employee_id" class="text-xs text-slate-500 dark:text-slate-400 truncate">{{ $t('chat.employeeId') }}: {{ (currentUser as any).employee_id }}</div>
|
||||
<div v-else class="text-xs text-slate-500 dark:text-slate-400 truncate">{{ currentUser?.role }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="px-4 pt-3 pb-1 text-xs font-medium text-slate-500 dark:text-slate-400">{{ $t('chat.language') }}</div>
|
||||
<div class="px-4 pb-2">
|
||||
<select v-model="locale" class="w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-700 outline-none transition focus:border-brand-400 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200">
|
||||
<option value="zh-CN">{{ $t('chat.langZhCn') }}</option>
|
||||
<option value="en">{{ $t('chat.langEn') }}</option>
|
||||
<option value="zh-TW">{{ $t('chat.langZhTw') }}</option>
|
||||
<option value="th">{{ $t('chat.langTh') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button @click="handleLogout" class="w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-red-50 flex items-center gap-2 transition-colors mt-1">
|
||||
<LogOut class="w-4 h-4" />
|
||||
退出登录
|
||||
{{ $t('chat.logout') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<button @click="userAgents.length === 0 ? undefined : (showAgentPanel = !showAgentPanel)" :class="showAgentPanel && userAgents.length > 0 ? 'text-brand-600 dark:text-brand-400' : ''" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="userAgents.length === 0 ? '暂无可用智能体' : (showAgentPanel ? '收起智能体' : '展开智能体')"><LayoutGrid class="h-4 w-4" /></button>
|
||||
<button @click="userAgents.length === 0 ? undefined : (showAgentPanel = !showAgentPanel)" :class="showAgentPanel && userAgents.length > 0 ? 'text-brand-600 dark:text-brand-400' : ''" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="userAgents.length === 0 ? $t('chat.noAvailableAgents') : (showAgentPanel ? $t('chat.collapseAgents') : $t('chat.expandAgents'))"><LayoutGrid class="h-4 w-4" /></button>
|
||||
<button class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Heart class="h-4 w-4" /></button>
|
||||
<button class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Bell class="h-4 w-4" /></button>
|
||||
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" title="意见反馈"><Mail class="h-4 w-4" /></button>
|
||||
<button @click="showGeneralFeedbackDialog = true" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200" :title="$t('chat.generalFeedback')"><Mail class="h-4 w-4" /></button>
|
||||
<button @click="router.push('/workspace?no_redirect=1')" class="transition-colors hover:text-slate-600 dark:hover:text-slate-200"><Settings class="h-4 w-4" /></button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1933,15 +1947,15 @@ const showChatRating = ref(false);
|
||||
<span class="text-sm font-semibold text-slate-800 dark:text-slate-100">{{ currentAgent?.name || 'AI' }}</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-1">
|
||||
<button @click="toggleMobileAgentPopover" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" title="智能体">
|
||||
<button @click="toggleMobileAgentPopover" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" :title="$t('chat.agents')">
|
||||
<LayoutGrid class="h-5 w-5" />
|
||||
</button>
|
||||
<button @click="router.push('/workspace?view=history')" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" title="历史记录">
|
||||
<button @click="router.push('/workspace?view=history')" class="flex h-9 w-9 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800" :title="$t('chat.history')">
|
||||
<History class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="showMobileAgentPopover" ref="mobileAgentPopoverRef" class="absolute right-4 top-12 z-50 w-72 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-slate-700 dark:bg-slate-800">
|
||||
<div class="mb-2 text-xs font-medium text-slate-400">智能体</div>
|
||||
<div class="mb-2 text-xs font-medium text-slate-400">{{ $t('chat.agents') }}</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<button
|
||||
v-for="agent in userAgents"
|
||||
@@ -1955,7 +1969,7 @@ const showChatRating = ref(false);
|
||||
<span class="w-full truncate text-xs font-medium text-slate-700 dark:text-slate-200">{{ agent.name }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="userAgents.length === 0" class="py-3 text-center text-xs text-slate-400">暂无其他智能体</div>
|
||||
<div v-if="userAgents.length === 0" class="py-3 text-center text-xs text-slate-400">{{ $t('chat.noOtherAgents') }}</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -1987,7 +2001,7 @@ const showChatRating = ref(false);
|
||||
<div class="mb-6 flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-brand-500 via-brand-600 to-sky-600 text-2xl font-bold text-white shadow-lg shadow-brand-500/20">
|
||||
AI
|
||||
</div>
|
||||
<h2 class="text-center text-xl font-medium text-slate-800 dark:text-slate-100 md:text-2xl">你好,我是和信AI数字人</h2>
|
||||
<h2 class="text-center text-xl font-medium text-slate-800 dark:text-slate-100 md:text-2xl">{{ $t('chat.welcomeTitle') }}</h2>
|
||||
</div>
|
||||
|
||||
<template v-for="(msg, index) in messages" :key="index">
|
||||
@@ -2014,16 +2028,11 @@ const showChatRating = ref(false);
|
||||
<div v-else>
|
||||
<div v-if="msg.type === 'leave-form'" class="space-y-4">
|
||||
<div class="text-sm font-medium text-slate-700 dark:text-slate-200">
|
||||
<template v-if="msg.content.includes('或登录OA系统直接申请')">
|
||||
已为你生成请假申请表,请直接在下方填写并提交。或 <a href="#" @click.prevent="openOALeaveRequestDirectly" class="text-brand-600 font-bold hover:underline">登录OA系统直接申请</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ msg.content }}
|
||||
</template>
|
||||
{{ $t('chat.leaveFormIntro') }} <a href="#" @click.prevent="openOALeaveRequestDirectly" class="text-brand-600 font-bold hover:underline">{{ $t('chat.oaLeaveDirectLink') }}</a>
|
||||
</div>
|
||||
<div v-if="getLeaveFormPayload(msg)" class="grid gap-4 md:grid-cols-2">
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">填单人</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.leaveFiller') }}</span>
|
||||
<input
|
||||
v-model="getLeaveFormPayload(msg)!.form.fillerName"
|
||||
type="text"
|
||||
@@ -2032,7 +2041,7 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">工号</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.employeeId') }}</span>
|
||||
<input
|
||||
v-model="getLeaveFormPayload(msg)!.form.employeeId"
|
||||
type="text"
|
||||
@@ -2041,7 +2050,7 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">创建时间</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.createdAt') }}</span>
|
||||
<input
|
||||
:value="getLeaveFormPayload(msg)!.form.applyTime.replace('T', ' ')"
|
||||
type="text"
|
||||
@@ -2050,23 +2059,23 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">假别</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.leaveType') }}</span>
|
||||
<select
|
||||
v-model="getLeaveFormPayload(msg)!.form.leaveType"
|
||||
class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm text-slate-700 outline-none transition focus:border-blue-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
>
|
||||
<option value="" disabled>请选择假别</option>
|
||||
<option value="" disabled>{{ $t('chat.selectLeaveType') }}</option>
|
||||
<option v-for="leaveType in LEAVE_TYPES" :key="leaveType.value" :value="leaveType.value">{{ leaveType.label }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">请假人</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.leaveApplicant') }}</span>
|
||||
<div class="relative">
|
||||
<input
|
||||
:value="getLeaveFormPayload(msg)!.form.applicantName ? `${getLeaveFormPayload(msg)!.form.applicantName} / ${getLeaveFormPayload(msg)!.form.employeeId}` : ''"
|
||||
type="text"
|
||||
placeholder="请选择请假人"
|
||||
:placeholder="$t('chat.selectLeaveApplicant')"
|
||||
readonly
|
||||
class="w-full rounded-xl border border-slate-200 bg-white px-3 py-2 pr-11 text-sm text-slate-700 outline-none transition focus:border-blue-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
@@ -2077,19 +2086,19 @@ const showChatRating = ref(false);
|
||||
class="absolute inset-y-0 right-0 flex w-11 items-center justify-center text-slate-400 transition hover:text-brand-600 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
@click="openLeaveAgentDialog(msg, 'applicant')"
|
||||
title="选择请假人"
|
||||
:title="$t('chat.pickLeaveApplicant')"
|
||||
>
|
||||
<Search class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">代理人</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.leaveAgent') }}</span>
|
||||
<div class="relative">
|
||||
<input
|
||||
:value="getLeaveAgentDisplayValue(getLeaveFormPayload(msg)!.form)"
|
||||
type="text"
|
||||
placeholder="请选择代理人"
|
||||
:placeholder="$t('chat.selectLeaveAgent')"
|
||||
readonly
|
||||
class="w-full rounded-xl border border-slate-200 bg-white px-3 py-2 pr-11 text-sm text-slate-700 outline-none transition focus:border-blue-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
@@ -2100,14 +2109,14 @@ const showChatRating = ref(false);
|
||||
class="absolute inset-y-0 right-0 flex w-11 items-center justify-center text-slate-400 transition hover:text-brand-600 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
@click="openLeaveAgentDialog(msg)"
|
||||
title="选择代理人"
|
||||
:title="$t('chat.pickLeaveAgent')"
|
||||
>
|
||||
<Search class="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">开始时间</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.startTime') }}</span>
|
||||
<input
|
||||
v-model="getLeaveFormPayload(msg)!.form.startTime"
|
||||
type="datetime-local"
|
||||
@@ -2117,7 +2126,7 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">结束时间</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.endTime') }}</span>
|
||||
<input
|
||||
v-model="getLeaveFormPayload(msg)!.form.endTime"
|
||||
type="datetime-local"
|
||||
@@ -2127,7 +2136,7 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">时长</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.duration') }}</span>
|
||||
<input
|
||||
:value="formatDurationLabel(getLeaveFormPayload(msg)!.form.durationHours)"
|
||||
type="text"
|
||||
@@ -2136,30 +2145,30 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="space-y-1.5">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">是否外出</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.isOutOfOffice') }}</span>
|
||||
<select
|
||||
v-model="getLeaveFormPayload(msg)!.form.isOutOfOffice"
|
||||
class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm text-slate-700 outline-none transition focus:border-blue-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
>
|
||||
<option :value="1">否</option>
|
||||
<option :value="0">是</option>
|
||||
<option :value="1">{{ $t('chat.no') }}</option>
|
||||
<option :value="0">{{ $t('chat.yes') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="space-y-1.5 md:col-span-2">
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">是否为工伤</span>
|
||||
<span class="text-xs font-semibold text-slate-500 dark:text-slate-400">{{ $t('chat.isWorkInjury') }}</span>
|
||||
<select
|
||||
v-model="getLeaveFormPayload(msg)!.form.isWorkInjury"
|
||||
class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm text-slate-700 outline-none transition focus:border-blue-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
:disabled="getLeaveFormPayload(msg)!.submitting || getLeaveFormPayload(msg)!.confirmationGenerated"
|
||||
>
|
||||
<option :value="1">否</option>
|
||||
<option :value="0">是</option>
|
||||
<option :value="1">{{ $t('chat.no') }}</option>
|
||||
<option :value="0">{{ $t('chat.yes') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div v-if="getLeaveFormPayload(msg)?.confirmationGenerated" class="rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-xs text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200">
|
||||
已生成确认单,如需调整可直接修改表单后再次点击提交。
|
||||
{{ $t('chat.leaveConfirmGenerated') }}
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
@@ -2167,42 +2176,42 @@ const showChatRating = ref(false);
|
||||
:disabled="getLeaveFormPayload(msg)?.submitting || getLeaveFormPayload(msg)?.confirmationGenerated"
|
||||
class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
{{ getLeaveFormPayload(msg)?.submitting ? '提交中...' : '提交' }}
|
||||
{{ getLeaveFormPayload(msg)?.submitting ? $t('chat.submitting') : $t('chat.submit') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="msg.type === 'leave-confirmation' && getLeaveConfirmationPayload(msg)" class="space-y-4">
|
||||
<div class="text-sm font-medium text-slate-700 dark:text-slate-200">{{ msg.content }}</div>
|
||||
<div class="rounded-2xl border border-slate-200 bg-slate-50/90 p-4 dark:border-slate-700 dark:bg-slate-800/60">
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">填单人信息</div>
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">{{ $t('chat.leaveFillerInfo') }}</div>
|
||||
<div class="grid gap-3 text-sm md:grid-cols-2">
|
||||
<div><span class="text-slate-500 dark:text-slate-400">填单人:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerName || '暂无数据' }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">创建时间:</span>{{ getLeaveConfirmationPayload(msg)!.form.applyTime.replace('T', ' ') }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle"><span class="text-slate-500 dark:text-slate-400">填单人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId"><span class="text-slate-500 dark:text-slate-400">填单人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">填单人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1 }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveFiller') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerName || $t('chat.noData') }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.createdAt') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.applyTime.replace('T', ' ') }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveFillerTitle') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerJobTitleName || getLeaveConfirmationPayload(msg)!.form.fillerJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveFillerDept') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerDepartmentName || getLeaveConfirmationPayload(msg)!.form.fillerDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveFillerCompany') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyName || getLeaveConfirmationPayload(msg)!.form.fillerSubCompanyId1 }}</div>
|
||||
</div>
|
||||
<div class="my-3 border-t border-slate-200 dark:border-slate-700"></div>
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">申请人信息</div>
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">{{ $t('chat.leaveApplicantInfo') }}</div>
|
||||
<div class="grid gap-3 text-sm md:grid-cols-2">
|
||||
<div><span class="text-slate-500 dark:text-slate-400">请假人:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantName }}({{ getLeaveConfirmationPayload(msg)!.form.employeeId }})</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle"><span class="text-slate-500 dark:text-slate-400">申请人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId"><span class="text-slate-500 dark:text-slate-400">申请人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">申请人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1 }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveApplicant') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantName }}({{ getLeaveConfirmationPayload(msg)!.form.employeeId }})</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveApplicantTitle') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantJobTitleName || getLeaveConfirmationPayload(msg)!.form.applicantJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveApplicantDept') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantDepartmentName || getLeaveConfirmationPayload(msg)!.form.applicantDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveApplicantCompany') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyName || getLeaveConfirmationPayload(msg)!.form.applicantSubCompanyId1 }}</div>
|
||||
</div>
|
||||
<div class="my-3 border-t border-slate-200 dark:border-slate-700"></div>
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">请假信息</div>
|
||||
<div class="mb-3 text-xs font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500">{{ $t('chat.leaveInfo') }}</div>
|
||||
<div class="grid gap-3 text-sm md:grid-cols-2">
|
||||
<div><span class="text-slate-500 dark:text-slate-400">代理人:</span>{{ getLeaveAgentDisplayValue(getLeaveConfirmationPayload(msg)!.form) || '未选择' }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle"><span class="text-slate-500 dark:text-slate-400">代理人职务:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId"><span class="text-slate-500 dark:text-slate-400">代理人部门:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">代理人公司:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1 }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">假别:</span>{{ getLeaveTypeLabel(getLeaveConfirmationPayload(msg)!.form.leaveType) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">时长:</span>{{ formatDurationLabel(getLeaveConfirmationPayload(msg)!.form.durationHours) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">开始时间:</span>{{ getLeaveConfirmationPayload(msg)!.form.startTime.replace('T', ' ') }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">结束时间:</span>{{ getLeaveConfirmationPayload(msg)!.form.endTime.replace('T', ' ') }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">是否外出:</span>{{ formatYesNoLabel(getLeaveConfirmationPayload(msg)!.form.isOutOfOffice) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">是否为工伤:</span>{{ formatYesNoLabel(getLeaveConfirmationPayload(msg)!.form.isWorkInjury) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveAgent') }}:</span>{{ getLeaveAgentDisplayValue(getLeaveConfirmationPayload(msg)!.form) || $t('chat.notSelected') }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveAgentTitle') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentJobTitleName || getLeaveConfirmationPayload(msg)!.form.agentJobTitle }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveAgentDept') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentDepartmentName || getLeaveConfirmationPayload(msg)!.form.agentDepartmentId }}</div>
|
||||
<div v-if="getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1"><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveAgentCompany') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.agentSubCompanyName || getLeaveConfirmationPayload(msg)!.form.agentSubCompanyId1 }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.leaveType') }}:</span>{{ getLeaveTypeLabel(getLeaveConfirmationPayload(msg)!.form.leaveType) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.duration') }}:</span>{{ formatDurationLabel(getLeaveConfirmationPayload(msg)!.form.durationHours) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.startTime') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.startTime.replace('T', ' ') }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.endTime') }}:</span>{{ getLeaveConfirmationPayload(msg)!.form.endTime.replace('T', ' ') }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.isOutOfOffice') }}:</span>{{ formatYesNoLabel(getLeaveConfirmationPayload(msg)!.form.isOutOfOffice) }}</div>
|
||||
<div><span class="text-slate-500 dark:text-slate-400">{{ $t('chat.isWorkInjury') }}:</span>{{ formatYesNoLabel(getLeaveConfirmationPayload(msg)!.form.isWorkInjury) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-3">
|
||||
@@ -2211,14 +2220,14 @@ const showChatRating = ref(false);
|
||||
@click="editLeaveConfirmation(msg, index)"
|
||||
class="rounded-xl border border-slate-200 px-4 py-2 text-sm font-medium text-slate-600 transition hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800"
|
||||
>
|
||||
返回修改
|
||||
{{ $t('chat.backToEdit') }}
|
||||
</button>
|
||||
<button
|
||||
@click="confirmLeaveSubmission(msg)"
|
||||
:disabled="getLeaveConfirmationPayload(msg)?.submitting || getLeaveConfirmationPayload(msg)?.confirmed"
|
||||
class="rounded-xl bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60"
|
||||
>
|
||||
{{ getLeaveConfirmationPayload(msg)?.submitting ? '确认中...' : (getLeaveConfirmationPayload(msg)?.confirmed ? '已确认' : '确认') }}
|
||||
{{ getLeaveConfirmationPayload(msg)?.submitting ? $t('chat.confirming') : (getLeaveConfirmationPayload(msg)?.confirmed ? $t('chat.confirmed') : $t('chat.confirm')) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2229,20 +2238,20 @@ const showChatRating = ref(false);
|
||||
? 'border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-100'
|
||||
: 'border-rose-200 bg-rose-50 text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-100'"
|
||||
>
|
||||
<div class="text-sm font-semibold">{{ getLeaveResultPayload(msg)!.success ? 'OA 提交结果' : 'OA 提交失败' }}</div>
|
||||
<div class="text-sm font-semibold">{{ getLeaveResultPayload(msg)!.success ? $t('chat.oaSubmitResult') : $t('chat.oaSubmitFailed') }}</div>
|
||||
<div v-if="getLeaveResultPayload(msg)!.success" class="mt-2 whitespace-pre-wrap text-sm leading-7">
|
||||
请假单已推送到 OA,具体单据请
|
||||
{{ $t('chat.leaveResultPrefix') }}
|
||||
<a
|
||||
href="#"
|
||||
@click.prevent="openOARequestDirectly(getLeaveResultPayload(msg)!.referenceNo)"
|
||||
class="ml-1 inline-flex items-center rounded-full border border-brand-200 bg-brand-50 px-3 py-0.5 font-bold text-brand-700 transition hover:bg-brand-100 hover:underline dark:border-brand-500/30 dark:bg-brand-500/10 dark:text-brand-200 dark:hover:bg-brand-500/20"
|
||||
>
|
||||
【 登录OA系统查看提交】
|
||||
{{ $t('chat.leaveResultLinkText') }}
|
||||
</a>
|
||||
</div>
|
||||
<div v-else class="mt-2 whitespace-pre-wrap text-sm leading-7">{{ msg.content }}</div>
|
||||
<div class="mt-3 text-xs opacity-80">单据编号:{{ getLeaveResultPayload(msg)!.referenceNo }}</div>
|
||||
<div class="mt-1 text-xs opacity-80">提交时间:{{ getLeaveResultPayload(msg)!.submittedAt }}</div>
|
||||
<div class="mt-3 text-xs opacity-80">{{ $t('chat.requestNo') }}:{{ getLeaveResultPayload(msg)!.referenceNo }}</div>
|
||||
<div class="mt-1 text-xs opacity-80">{{ $t('chat.submitTime') }}:{{ getLeaveResultPayload(msg)!.submittedAt }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -2276,7 +2285,7 @@ const showChatRating = ref(false);
|
||||
:open="shouldExpandSourceDetails(msg)"
|
||||
>
|
||||
<summary class="cursor-pointer text-xs font-semibold uppercase tracking-wide text-slate-600 dark:text-slate-300">
|
||||
源文档 ({{ getDisplayRetrieverResources(msg).length }})
|
||||
{{ $t('chat.sourceDocs') }} ({{ getDisplayRetrieverResources(msg).length }})
|
||||
</summary>
|
||||
<div class="mt-3 space-y-2">
|
||||
<div
|
||||
@@ -2297,7 +2306,7 @@ const showChatRating = ref(false);
|
||||
open
|
||||
>
|
||||
<summary class="cursor-pointer text-xs font-semibold uppercase tracking-wide text-slate-600 dark:text-slate-300">
|
||||
生成内容归属部分
|
||||
{{ $t('chat.attributionParts') }}
|
||||
</summary>
|
||||
<ul class="mt-3 space-y-2">
|
||||
<li
|
||||
@@ -2355,7 +2364,7 @@ const showChatRating = ref(false);
|
||||
v-if="showChatRating && !isThinking && !(msg as any).rated"
|
||||
@click="handleOpenFeedback(index)"
|
||||
class="rounded-md p-1.5 text-xs transition-colors hover:bg-slate-100 dark:hover:bg-slate-800"
|
||||
title="评价回答"
|
||||
:title="$t('chat.rate')"
|
||||
>
|
||||
<MessageSquareText class="h-3.5 w-3.5" />
|
||||
</button>
|
||||
@@ -2387,7 +2396,7 @@ const showChatRating = ref(false);
|
||||
v-model="input"
|
||||
@keydown.enter.prevent="handleSend"
|
||||
rows="1"
|
||||
placeholder="问我任何事..."
|
||||
:placeholder="$t('chat.askAnything')"
|
||||
class="w-full resize-none border-none bg-transparent px-3 py-2 text-[15px] leading-relaxed text-slate-800 placeholder-slate-400 focus:outline-none focus:ring-0 focus:border-transparent dark:text-slate-100"
|
||||
style="min-height: 44px; max-height: 220px;"
|
||||
:disabled="isThinking"
|
||||
@@ -2401,7 +2410,7 @@ const showChatRating = ref(false);
|
||||
<button
|
||||
@click="handleVoiceFeatureClick"
|
||||
type="button"
|
||||
title="语音功能"
|
||||
:title="$t('chat.voiceFeature')"
|
||||
class="text-slate-400 transition-colors hover:text-brand-600 dark:hover:text-brand-300"
|
||||
>
|
||||
<Mic class="h-5 w-5" />
|
||||
@@ -2435,7 +2444,7 @@ const showChatRating = ref(false);
|
||||
class="flex items-center gap-1 rounded-lg border border-slate-200 px-3 py-1.5 text-xs font-medium text-slate-600 transition-colors hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
||||
>
|
||||
<Globe class="h-3.5 w-3.5 text-brand-500" />
|
||||
{{ browserPanelOpen ? '收起浏览器' : '打开浏览器' }}
|
||||
{{ browserPanelOpen ? $t('chat.collapseBrowser') : $t('chat.openBrowser') }}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
@@ -2451,7 +2460,7 @@ const showChatRating = ref(false);
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3 text-center text-[11px] text-slate-400">
|
||||
AI 可能会犯错,请核实重要信息。
|
||||
{{ $t('chat.disclaimer') }}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
@@ -2482,12 +2491,12 @@ const showChatRating = ref(false);
|
||||
<div class="flex items-center justify-between border-b border-slate-200 px-4 py-3 dark:border-slate-800">
|
||||
<div class="flex items-center gap-2 text-sm font-semibold text-slate-700 dark:text-slate-100">
|
||||
<Globe class="h-4 w-4 text-brand-500" />
|
||||
浏览器
|
||||
{{ $t('chat.browser') }}
|
||||
</div>
|
||||
<button
|
||||
@click="browserPanelOpen = false"
|
||||
class="rounded-md p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800 dark:hover:text-slate-200"
|
||||
title="关闭浏览器"
|
||||
:title="$t('chat.closeBrowser')"
|
||||
>
|
||||
<X class="h-4 w-4" />
|
||||
</button>
|
||||
@@ -2497,7 +2506,7 @@ const showChatRating = ref(false);
|
||||
<input
|
||||
v-model="browserDraftUrl"
|
||||
type="text"
|
||||
placeholder="输入网址,例如 https://example.com"
|
||||
:placeholder="$t('chat.browserInputPlaceholder')"
|
||||
class="flex-1 rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm text-slate-800 outline-none transition focus:border-brand-400 focus:bg-white dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 dark:focus:bg-slate-950"
|
||||
@keydown="handleBrowserUrlEnter"
|
||||
/>
|
||||
@@ -2505,19 +2514,19 @@ const showChatRating = ref(false);
|
||||
@click="loadBrowserPage"
|
||||
class="rounded-xl bg-brand-600 px-3 py-2 text-xs font-medium text-white transition-colors hover:bg-brand-500"
|
||||
>
|
||||
打开
|
||||
{{ $t('chat.open') }}
|
||||
</button>
|
||||
<button
|
||||
@click="refreshBrowserPage"
|
||||
class="rounded-xl border border-slate-200 p-2 text-slate-500 transition-colors hover:bg-slate-50 hover:text-slate-700 dark:border-slate-700 dark:hover:bg-slate-800 dark:hover:text-slate-200"
|
||||
title="刷新"
|
||||
:title="$t('chat.refresh')"
|
||||
>
|
||||
<RotateCw class="h-4 w-4" />
|
||||
</button>
|
||||
<button
|
||||
@click="openBrowserInNewTab"
|
||||
class="rounded-xl border border-slate-200 p-2 text-slate-500 transition-colors hover:bg-slate-50 hover:text-slate-700 dark:border-slate-700 dark:hover:bg-slate-800 dark:hover:text-slate-200"
|
||||
title="新标签打开"
|
||||
:title="$t('chat.openInNewTab')"
|
||||
>
|
||||
<ExternalLink class="h-4 w-4" />
|
||||
</button>
|
||||
@@ -2529,8 +2538,8 @@ const showChatRating = ref(false);
|
||||
class="flex h-full flex-col items-center justify-center gap-3 px-8 text-center text-sm text-slate-500 dark:text-slate-400"
|
||||
>
|
||||
<Globe class="h-8 w-8 text-brand-500" />
|
||||
<div>在这里直接打开网页,边聊天边查看内容。</div>
|
||||
<div class="text-xs">支持输入 `https://`、`localhost` 或内网 IP 地址。</div>
|
||||
<div>{{ $t('chat.browserHint1') }}</div>
|
||||
<div class="text-xs">{{ $t('chat.browserHint2') }}</div>
|
||||
</div>
|
||||
<iframe
|
||||
v-else
|
||||
@@ -2561,7 +2570,7 @@ const showChatRating = ref(false);
|
||||
if (activeFeedbackMessageIndex !== null && messages[activeFeedbackMessageIndex]) {
|
||||
(messages[activeFeedbackMessageIndex] as any).rated = true;
|
||||
}
|
||||
showMessageDialog('success', '\u53cd\u9988\u63d0\u4ea4\u6210\u529f');
|
||||
showMessageDialog('success', t('chat.feedbackSubmitSuccess'));
|
||||
showGeneralFeedbackDialog = false;
|
||||
}"
|
||||
/>
|
||||
@@ -2573,8 +2582,8 @@ const showChatRating = ref(false);
|
||||
<div class="flex w-full max-w-2xl max-h-[80vh] flex-col rounded-2xl bg-white p-6 shadow-2xl dark:bg-slate-900">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<h3 class="text-lg font-bold text-slate-800 dark:text-slate-100">选择{{ leaveUserSelectRole === 'agent' ? '代理人' : '请假人' }}</h3>
|
||||
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">已接入 OA 数据库视图查询。</p>
|
||||
<h3 class="text-lg font-bold text-slate-800 dark:text-slate-100">{{ $t('chat.selectWho', { role: leaveUserSelectRole === 'agent' ? $t('chat.leaveAgent') : $t('chat.leaveApplicant') }) }}</h3>
|
||||
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">{{ $t('chat.oaDataConnected') }}</p>
|
||||
</div>
|
||||
<button @click="closeLeaveAgentDialog" class="text-slate-400 hover:text-slate-600 dark:hover:text-slate-200">
|
||||
<X class="h-5 w-5" />
|
||||
@@ -2586,7 +2595,7 @@ const showChatRating = ref(false);
|
||||
v-model="leaveAgentKeyword"
|
||||
@keydown.enter="handleAgentSearch"
|
||||
type="text"
|
||||
placeholder="输入姓名或工号搜索,按回车键查询"
|
||||
:placeholder="$t('chat.searchByNameOrEmployeeId')"
|
||||
class="w-full rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 pr-10 text-sm outline-none transition focus:border-brand-400 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100"
|
||||
/>
|
||||
<button @click="handleAgentSearch" class="absolute inset-y-0 right-0 flex w-10 items-center justify-center text-slate-400 hover:text-brand-600">
|
||||
@@ -2599,7 +2608,7 @@ const showChatRating = ref(false);
|
||||
<Loader2 class="h-6 w-6 animate-spin text-brand-500" />
|
||||
</div>
|
||||
<div v-else-if="leaveAgentOptions.length === 0" class="py-8 text-center text-sm text-slate-400">
|
||||
暂无数据
|
||||
{{ $t('chat.noData') }}
|
||||
</div>
|
||||
<template v-else>
|
||||
<button
|
||||
@@ -2614,8 +2623,8 @@ const showChatRating = ref(false);
|
||||
<div class="text-xs text-slate-500 dark:text-slate-400">UID:{{ option.uid }}</div>
|
||||
</div>
|
||||
<div class="text-right text-xs text-slate-500 dark:text-slate-400">
|
||||
<div>工号:{{ option.employeeId }}</div>
|
||||
<div>姓名:{{ option.name }}</div>
|
||||
<div>{{ $t('chat.employeeId') }}:{{ option.employeeId }}</div>
|
||||
<div>{{ $t('chat.name') }}:{{ option.name }}</div>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
@@ -2625,17 +2634,17 @@ const showChatRating = ref(false);
|
||||
:disabled="leaveAgentLoading"
|
||||
class="text-xs text-slate-500 hover:text-slate-700 disabled:opacity-50 dark:text-slate-400 dark:hover:text-slate-300"
|
||||
>
|
||||
加载全部
|
||||
{{ $t('chat.loadAll') }}
|
||||
</button>
|
||||
<button
|
||||
@click="loadMoreAgents"
|
||||
:disabled="leaveAgentLoading"
|
||||
class="text-xs text-brand-600 hover:text-brand-700 disabled:opacity-50"
|
||||
>
|
||||
{{ leaveAgentLoading ? '加载中...' : '加载更多' }}
|
||||
{{ leaveAgentLoading ? $t('chat.loading') : $t('chat.loadMore') }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-else class="py-4 text-center text-xs text-slate-400">没有更多数据了</div>
|
||||
<div v-else class="py-4 text-center text-xs text-slate-400">{{ $t('chat.noMoreData') }}</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2646,10 +2655,10 @@ const showChatRating = ref(false);
|
||||
<div v-if="showOALoginDialog" class="fixed inset-0 z-[9999] flex items-center justify-center">
|
||||
<div class="absolute inset-0 bg-black/40" @click="cancelOALogin"></div>
|
||||
<div class="relative w-full max-w-sm rounded-2xl bg-white p-6 shadow-2xl dark:bg-slate-800">
|
||||
<h3 class="mb-4 text-center text-lg font-bold text-slate-800 dark:text-slate-100">登录OA系统</h3>
|
||||
<h3 class="mb-4 text-center text-lg font-bold text-slate-800 dark:text-slate-100">{{ $t('chat.loginOaSystem') }}</h3>
|
||||
<div class="space-y-4">
|
||||
<label class="block space-y-1.5">
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-slate-300">工号</span>
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-slate-300">{{ $t('chat.employeeId') }}</span>
|
||||
<input
|
||||
v-model="oaLoginEmployeeId"
|
||||
type="text"
|
||||
@@ -2658,11 +2667,11 @@ const showChatRating = ref(false);
|
||||
/>
|
||||
</label>
|
||||
<label class="block space-y-1.5">
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-slate-300">密码</span>
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-slate-300">{{ $t('login.password') }}</span>
|
||||
<input
|
||||
v-model="oaLoginPassword"
|
||||
type="password"
|
||||
placeholder="请输入OA登录密码"
|
||||
:placeholder="$t('chat.enterOaPassword')"
|
||||
class="w-full rounded-xl border border-slate-200 bg-white px-3 py-2.5 text-sm text-slate-800 outline-none focus:border-brand-400 focus:ring-2 focus:ring-brand-100 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-100 dark:focus:border-brand-500 dark:focus:ring-brand-500/20"
|
||||
@keyup.enter="confirmOALogin"
|
||||
/>
|
||||
@@ -2673,13 +2682,13 @@ const showChatRating = ref(false);
|
||||
@click="cancelOALogin"
|
||||
class="rounded-xl border border-slate-200 px-4 py-2 text-sm font-medium text-slate-600 transition hover:bg-slate-50 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-slate-700"
|
||||
>
|
||||
取消
|
||||
{{ $t('profile.cancel') }}
|
||||
</button>
|
||||
<button
|
||||
@click="confirmOALogin"
|
||||
class="rounded-xl bg-brand-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-brand-700 dark:bg-brand-500 dark:hover:bg-brand-600"
|
||||
>
|
||||
确认登录
|
||||
{{ $t('chat.confirmLogin') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1578,6 +1578,14 @@ onMounted(async () => {
|
||||
<User class="h-4 w-4" />
|
||||
<span>个人中心</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="currentUser?.role === 'admin'"
|
||||
@click="openAdminPanel"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-slate-600 transition-all hover:bg-slate-50 hover:text-slate-900"
|
||||
>
|
||||
<Settings class="h-4 w-4" />
|
||||
<span>管理后台</span>
|
||||
</button>
|
||||
<button
|
||||
@click="navigateToApplications"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium transition-all"
|
||||
@@ -1630,14 +1638,6 @@ onMounted(async () => {
|
||||
<Bot class="h-4 w-4" />
|
||||
<span>返回聊天</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="currentUser?.role === 'admin'"
|
||||
@click="openAdminPanel"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-slate-600 transition-all hover:bg-slate-50 hover:text-slate-900"
|
||||
>
|
||||
<Settings class="h-4 w-4" />
|
||||
<span>管理后台</span>
|
||||
</button>
|
||||
<button
|
||||
@click="handleLogout"
|
||||
class="flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left text-[15px] font-medium text-red-500 transition-all hover:bg-red-50 hover:text-red-600"
|
||||
|
||||
Reference in new issue
Block a user