Merge branch 'dev' into hugo
This commit is contained in:
commit
3d4b2647ae
21 files changed
+491
-158
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 627 KiB |
@@ -1000,9 +1000,9 @@ const messages = {
|
||||
},
|
||||
landing: {
|
||||
hero: {
|
||||
prefix: '释放',
|
||||
highlight: '生成式 AI 的强大力量',
|
||||
subtitle: '获取一套专为企业需求打造的强大 AI 智能体,安全、可扩展且智能。'
|
||||
prefix: '和信',
|
||||
highlight: '紧密 AI智能体 应用平台',
|
||||
subtitle: 'AI的世界,期望让你开心工作,快乐生活。'
|
||||
},
|
||||
agent: {
|
||||
role: 'AI 助手'
|
||||
|
||||
@@ -434,15 +434,17 @@ const input = ref('');
|
||||
const currentAgent = ref<any>(null);
|
||||
const showGeneralFeedbackDialog = ref(false);
|
||||
|
||||
const OA_LOGIN_URL = 'http://192.168.100.221:8888/login/Login.jsp?logintype=1';
|
||||
const OA_VERIFY_LOGIN_URL = 'http://192.168.100.221:8888/login/VerifyLogin.jsp';
|
||||
const OA_BASE_URL = 'http://oa.well-trust.com:8888';
|
||||
const OA_LOGIN_URL = `${OA_BASE_URL}/login/Login.jsp?logintype=1`;
|
||||
const OA_VERIFY_LOGIN_URL = `${OA_BASE_URL}/login/VerifyLogin.jsp`;
|
||||
const OA_LEAVE_APPLY_PATH = '/workflow/request/AddRequest.jsp?workflowid=652&isagent=0&beagenter=0&f_weaver_belongto_userid=';
|
||||
const OA_REQUEST_VIEW_PATH = '/workflow/request/ViewRequest.jsp?requestid=';
|
||||
const OA_AUTO_LOGIN_USERNAME = '26040006';
|
||||
const OA_AUTO_LOGIN_PASSWORD = '26040006';
|
||||
const OA_AUTO_LOGIN_TARGET = 'hxops-oa-leave-request';
|
||||
|
||||
const openOALeaveRequestDirectly = () => {
|
||||
const popup = window.open(OA_LOGIN_URL, OA_AUTO_LOGIN_TARGET);
|
||||
const openOAAutoLoginPage = (gopage: string, target = OA_AUTO_LOGIN_TARGET) => {
|
||||
const popup = window.open(OA_LOGIN_URL, target);
|
||||
if (!popup) {
|
||||
showMessageDialog('warning', '浏览器拦截了 OA 页面,请允许弹出窗口后重试。');
|
||||
return;
|
||||
@@ -451,13 +453,13 @@ const openOALeaveRequestDirectly = () => {
|
||||
const form = document.createElement('form');
|
||||
form.action = OA_VERIFY_LOGIN_URL;
|
||||
form.method = 'POST';
|
||||
form.target = OA_AUTO_LOGIN_TARGET;
|
||||
form.target = target;
|
||||
form.style.display = 'none';
|
||||
|
||||
const fields = {
|
||||
loginid: OA_AUTO_LOGIN_USERNAME,
|
||||
userpassword: OA_AUTO_LOGIN_PASSWORD,
|
||||
gopage: OA_LEAVE_APPLY_PATH,
|
||||
gopage,
|
||||
logintype: '1',
|
||||
};
|
||||
|
||||
@@ -476,6 +478,19 @@ const openOALeaveRequestDirectly = () => {
|
||||
}, 0);
|
||||
};
|
||||
|
||||
const openOALeaveRequestDirectly = () => {
|
||||
openOAAutoLoginPage(OA_LEAVE_APPLY_PATH);
|
||||
};
|
||||
|
||||
const openOARequestDirectly = (requestId: string) => {
|
||||
const normalizedRequestId = String(requestId || '').trim();
|
||||
if (!normalizedRequestId || normalizedRequestId === '-') {
|
||||
showMessageDialog('warning', '当前未获取到 OA 单据编号,暂时无法打开单据详情。');
|
||||
return;
|
||||
}
|
||||
openOAAutoLoginPage(`${OA_REQUEST_VIEW_PATH}${encodeURIComponent(normalizedRequestId)}`, `hxops-oa-request-${normalizedRequestId}`);
|
||||
};
|
||||
|
||||
const activeFeedbackMessageIndex = ref<number | null>(null);
|
||||
const browserPanelOpen = ref(false);
|
||||
const browserDraftUrl = ref('');
|
||||
@@ -516,8 +531,6 @@ const getLeaveTypeLabel = (val: string) => {
|
||||
return t ? t.label : val;
|
||||
};
|
||||
|
||||
const LEAVE_RESULT_QUERY_URL = 'http://192.168.100.221:8888/';
|
||||
|
||||
interface LeaveRequestFormData {
|
||||
applicantName: string;
|
||||
employeeId: string;
|
||||
@@ -666,11 +679,38 @@ const formatDurationLabel = (hours: number) => {
|
||||
return `${hours} 小时`;
|
||||
};
|
||||
|
||||
const createLeaveFormData = (): LeaveRequestFormData => {
|
||||
const extractLeaveTypeFromIntent = (content: string) => {
|
||||
if (!content) return '';
|
||||
const map: Record<string, string> = {
|
||||
'事假': '005',
|
||||
'病假': '006',
|
||||
'丧假': '007',
|
||||
'年假': '010',
|
||||
'因公出差': '021',
|
||||
'出差': '021',
|
||||
'调休': '025',
|
||||
'产假': '401',
|
||||
'陪产假': '402',
|
||||
'婚假': '403',
|
||||
'住院': '405',
|
||||
'工伤': '406',
|
||||
'育儿假': '408',
|
||||
'返乡': 'ZZ01',
|
||||
};
|
||||
for (const [key, val] of Object.entries(map)) {
|
||||
if (content.includes(key)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
const createLeaveFormData = (content?: string): LeaveRequestFormData => {
|
||||
const now = new Date();
|
||||
const oneHourLater = new Date(now.getTime() + 60 * 60 * 1000);
|
||||
const startTime = formatDateTime(now);
|
||||
const endTime = formatDateTime(oneHourLater);
|
||||
const initialLeaveType = extractLeaveTypeFromIntent(content || '');
|
||||
return {
|
||||
applicantName: currentUserDisplayName.value,
|
||||
employeeId: currentUserEmployeeId.value,
|
||||
@@ -680,7 +720,7 @@ const createLeaveFormData = (): LeaveRequestFormData => {
|
||||
agentUid: '',
|
||||
agentEmployeeId: '',
|
||||
agentName: '',
|
||||
leaveType: '',
|
||||
leaveType: initialLeaveType,
|
||||
startTime,
|
||||
endTime,
|
||||
durationHours: calculateDurationHours(startTime, endTime),
|
||||
@@ -705,8 +745,8 @@ const isStrongLeaveIntent = (content: string) => {
|
||||
// 弱意图(咨询流程/步骤)应走正常问答,不触发表单分流。
|
||||
const weakConsultationIntent = /(请假流程|请假怎么走|请假步骤|请假如何申请|请假如何走流程|请假怎么办|请假需要什么|请假规定)/;
|
||||
if (weakConsultationIntent.test(normalized)) return false;
|
||||
if (/^(请假|休假)$/.test(normalized)) return true;
|
||||
return /(我要请假|申请请假|发起请假|请假申请|我要休假|申请休假|我要请个假|想请假|帮我请假|代我请假|提交请假)/.test(normalized);
|
||||
if (/^(请假|休假|年假|事假|病假|调休)$/.test(normalized)) return true;
|
||||
return /(我要请|申请请|发起请|请假申请|我要休|申请休|想请|帮我请|代我请|提交请)/.test(normalized);
|
||||
};
|
||||
|
||||
const saveLocalMessageToBackend = async (msg: any, userQuery: string = '') => {
|
||||
@@ -744,7 +784,7 @@ const startLocalLeaveFlow = async (content: string) => {
|
||||
const formId = newLocalMessageId('leave-form');
|
||||
const payload: LeaveFormPayload = {
|
||||
formId,
|
||||
form: createLeaveFormData(),
|
||||
form: createLeaveFormData(content),
|
||||
submitting: false,
|
||||
confirmationGenerated: false,
|
||||
};
|
||||
@@ -1132,7 +1172,7 @@ const confirmLeaveSubmission = async (msg: any) => {
|
||||
const resultMsg = {
|
||||
role: 'assistant' as const,
|
||||
type: 'leave-result' as const,
|
||||
content: `请假单已提交到 OA,具体单据请到 ${LEAVE_RESULT_QUERY_URL} 查询。`,
|
||||
content: '请假单已推送到 OA,具体单据请 【 登录OA系统查看提交】',
|
||||
payload: {
|
||||
formId: payload.formId,
|
||||
success: true,
|
||||
@@ -1512,7 +1552,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">我今天可以怎么帮助你?</h2>
|
||||
<h2 class="text-center text-xl font-medium text-slate-800 dark:text-slate-100 md:text-2xl">你好,我是和信AI数字人</h2>
|
||||
</div>
|
||||
|
||||
<template v-for="(msg, index) in messages" :key="index">
|
||||
@@ -1736,7 +1776,17 @@ const showChatRating = ref(false);
|
||||
: '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="mt-2 whitespace-pre-wrap text-sm leading-7">{{ msg.content }}</div>
|
||||
<div v-if="getLeaveResultPayload(msg)!.success" class="mt-2 whitespace-pre-wrap text-sm leading-7">
|
||||
请假单已推送到 OA,具体单据请
|
||||
<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系统查看提交】
|
||||
</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>
|
||||
|
||||
@@ -14,6 +14,7 @@ import ThemeToggleButton from '../components/ThemeToggleButton.vue';
|
||||
import DeleteConfirmDialog from '../components/DeleteConfirmDialog.vue';
|
||||
import GeneralFeedbackDialog from '../components/GeneralFeedbackDialog.vue';
|
||||
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
import loginBg from '../assets/login-bg.png';
|
||||
|
||||
import {
|
||||
buildWecomLoginDialogContent,
|
||||
@@ -57,6 +58,12 @@ const { t, locale } = useI18n();
|
||||
const { showMessageDialog } = useGlobalMessageDialog();
|
||||
const router = useRouter();
|
||||
const { setThemePreference, appliedTheme } = useTheme();
|
||||
const loginBackgroundStyle = {
|
||||
backgroundImage: `url(${loginBg})`,
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: 'center',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
};
|
||||
|
||||
const loadLanguagePreference = () => {
|
||||
const storedLang = localStorage.getItem('hxops_lang');
|
||||
@@ -1324,8 +1331,13 @@ onMounted(async () => {
|
||||
</div>
|
||||
|
||||
<!-- Not Logged In (Login Screen) -->
|
||||
<div v-else-if="!isLoggedIn" class="min-h-[calc(100vh-4rem)] flex items-center justify-center">
|
||||
<div class="w-full max-w-6xl grid grid-cols-1 lg:grid-cols-2 gap-12 items-center p-4">
|
||||
<div
|
||||
v-else-if="!isLoggedIn"
|
||||
class="relative min-h-[calc(100vh-4rem)] overflow-hidden rounded-[2rem] flex items-center justify-center"
|
||||
:style="loginBackgroundStyle"
|
||||
>
|
||||
<div class="absolute inset-0 bg-white/55 backdrop-blur-[1px] dark:bg-slate-950/55"></div>
|
||||
<div class="relative z-10 w-full max-w-6xl grid grid-cols-1 lg:grid-cols-2 gap-12 items-center p-4">
|
||||
<!-- Hero Section -->
|
||||
<div class="hidden lg:block space-y-8 animate-slide-up">
|
||||
<!--
|
||||
@@ -1337,17 +1349,17 @@ onMounted(async () => {
|
||||
{{ $t('title') }}
|
||||
</div>
|
||||
-->
|
||||
<h1 class="text-5xl font-bold text-slate-900 leading-tight">
|
||||
<h1 class="text-5xl font-bold text-black leading-tight drop-shadow-sm">
|
||||
{{ $t('landing.hero.prefix') }} <br/>
|
||||
<span class="text-transparent bg-clip-text bg-gradient-to-r from-brand-600 to-purple-600">{{ $t('landing.hero.highlight') }}</span>
|
||||
<span class="text-transparent bg-clip-text bg-gradient-to-r from-[#005a9c] to-[#7a1fd0] drop-shadow-sm">{{ $t('landing.hero.highlight') }}</span>
|
||||
</h1>
|
||||
<p class="text-lg text-slate-600 max-w-md leading-relaxed">
|
||||
<p class="text-lg text-slate-800 max-w-md leading-relaxed font-semibold drop-shadow-sm">
|
||||
{{ $t('landing.hero.subtitle') }}
|
||||
</p>
|
||||
|
||||
<!-- Announcements List -->
|
||||
<div v-if="announcements.length > 0" class="bg-white/60 dark:bg-slate-900/70 backdrop-blur-sm rounded-2xl border border-slate-100 dark:border-slate-700 p-6 shadow-sm">
|
||||
<h3 class="text-sm font-bold text-slate-900 mb-4 flex items-center gap-2">
|
||||
<div v-if="announcements.length > 0" class="bg-white/70 dark:bg-slate-900/70 backdrop-blur-sm rounded-2xl border border-slate-200 dark:border-slate-700 p-6 shadow-sm">
|
||||
<h3 class="text-sm font-bold text-slate-950 mb-4 flex items-center gap-2">
|
||||
<Megaphone class="w-4 h-4 text-brand-600" />
|
||||
{{ $t('login.announcements') }}
|
||||
</h3>
|
||||
@@ -1356,10 +1368,10 @@ onMounted(async () => {
|
||||
class="group cursor-pointer hover:bg-white/50 dark:hover:bg-slate-800/70 p-2 rounded-lg transition-colors"
|
||||
@click="openAnnouncement(ann)">
|
||||
<div class="flex justify-between items-start gap-2">
|
||||
<h4 class="text-sm font-medium text-slate-800 group-hover:text-brand-700 line-clamp-1">{{ ann.title }}</h4>
|
||||
<span class="text-[10px] text-slate-400 whitespace-nowrap">{{ new Date(ann.created_at).toLocaleDateString() }}</span>
|
||||
<h4 class="text-sm font-semibold text-slate-900 group-hover:text-brand-800 line-clamp-1">{{ ann.title }}</h4>
|
||||
<span class="text-[10px] text-slate-500 whitespace-nowrap">{{ new Date(ann.created_at).toLocaleDateString() }}</span>
|
||||
</div>
|
||||
<p class="text-xs text-slate-500 line-clamp-2 mt-1">{{ ann.content }}</p>
|
||||
<p class="text-xs text-slate-700 line-clamp-2 mt-1">{{ ann.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1389,22 +1401,22 @@ onMounted(async () => {
|
||||
<Bot class="w-7 h-7" />
|
||||
</div>
|
||||
<h2 class="text-2xl font-bold text-slate-900 dark:text-slate-100">{{ $t('login.submit') }}</h2>
|
||||
<p class="text-slate-500 dark:text-slate-400 text-sm mt-2">{{ $t('login.subtitle') }}</p>
|
||||
<p class="text-slate-600 dark:text-slate-400 text-sm mt-2">{{ $t('login.subtitle') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="space-y-5">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-slate-700 uppercase ml-1">{{ $t('login.username') }}</label>
|
||||
<label class="text-xs font-semibold text-slate-800 uppercase ml-1">{{ $t('login.username') }}</label>
|
||||
<input v-model="loginUsername" type="text" class="input-field" :placeholder="$t('login.placeholder.username')" @keyup.enter="handleLogin" />
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-xs font-semibold text-slate-700 uppercase ml-1">{{ $t('login.password') }}</label>
|
||||
<label class="text-xs font-semibold text-slate-800 uppercase ml-1">{{ $t('login.password') }}</label>
|
||||
<input v-model="loginPassword" type="password" class="input-field" :placeholder="$t('login.placeholder.password')" @keyup.enter="handleLogin" />
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2 mt-2">
|
||||
<input type="checkbox" id="rememberMe" v-model="rememberMe" class="rounded border-slate-300 text-brand-600 focus:ring-brand-500 w-4 h-4" />
|
||||
<label for="rememberMe" class="text-sm text-slate-600 cursor-pointer select-none">{{ $t('login.rememberMe') }}</label>
|
||||
<label for="rememberMe" class="text-sm text-slate-700 cursor-pointer select-none">{{ $t('login.rememberMe') }}</label>
|
||||
</div>
|
||||
|
||||
<button type="button" @click="handleLogin" class="btn-primary w-full py-3 text-base shadow-brand-500/40 hover:shadow-brand-500/50 transform hover:-translate-y-0.5 transition-all mt-4">
|
||||
@@ -1422,7 +1434,7 @@ onMounted(async () => {
|
||||
</button>
|
||||
|
||||
<div class="flex justify-between items-center pt-4 mt-2 border-t border-slate-100/50">
|
||||
<button type="button" @click="showForgotPasswordModal = true" class="text-sm text-slate-500 hover:text-brand-600 transition-colors">
|
||||
<button type="button" @click="showForgotPasswordModal = true" class="text-sm text-slate-600 hover:text-brand-700 transition-colors">
|
||||
{{ $t('login.forgotPassword') }}
|
||||
</button>
|
||||
<!-- 点击注册 -->
|
||||
|
||||
Reference in new issue
Block a user