qingjiatankuang
This commit is contained in:
1 parent
8c8a65d838
commit
016f992346
1 file changed
+106
-2
@@ -429,6 +429,63 @@ const { messages, isThinking, conversationId, sendMessage } = useChat();
|
||||
const input = ref('');
|
||||
const currentAgent = ref<any>(null);
|
||||
const showGeneralFeedbackDialog = ref(false);
|
||||
const showOALoginModal = ref(false);
|
||||
const oaLoginForm = ref({ username: '', password: '' });
|
||||
|
||||
const openOALoginModal = () => {
|
||||
oaLoginForm.value = {
|
||||
username: currentUserEmployeeId.value || currentUser.value?.username || '',
|
||||
password: ''
|
||||
};
|
||||
showOALoginModal.value = true;
|
||||
};
|
||||
|
||||
const submitOALogin = () => {
|
||||
if (!oaLoginForm.value.username || !oaLoginForm.value.password) {
|
||||
showMessageDialog('error', '请输入账号和密码');
|
||||
return;
|
||||
}
|
||||
|
||||
// 要跳转的目标 OA 页面
|
||||
const targetUrl = '/workflow/request/AddRequest.jsp?workflowid=652&isagent=0&beagenter=0&f_weaver_belongto_userid=';
|
||||
|
||||
// 创建隐藏表单进行 POST 提交到 OA 登录接口
|
||||
const form = document.createElement('form');
|
||||
form.action = 'http://192.168.100.221:8888/login/VerifyLogin.jsp';
|
||||
form.method = 'POST';
|
||||
form.target = '_blank';
|
||||
|
||||
const inputLoginId = document.createElement('input');
|
||||
inputLoginId.type = 'hidden';
|
||||
inputLoginId.name = 'loginid';
|
||||
inputLoginId.value = oaLoginForm.value.username;
|
||||
form.appendChild(inputLoginId);
|
||||
|
||||
const inputPassword = document.createElement('input');
|
||||
inputPassword.type = 'hidden';
|
||||
inputPassword.name = 'userpassword';
|
||||
inputPassword.value = oaLoginForm.value.password;
|
||||
form.appendChild(inputPassword);
|
||||
|
||||
const inputGoPage = document.createElement('input');
|
||||
inputGoPage.type = 'hidden';
|
||||
inputGoPage.name = 'gopage';
|
||||
inputGoPage.value = targetUrl;
|
||||
form.appendChild(inputGoPage);
|
||||
|
||||
const inputLogintype = document.createElement('input');
|
||||
inputLogintype.type = 'hidden';
|
||||
inputLogintype.name = 'logintype';
|
||||
inputLogintype.value = '1';
|
||||
form.appendChild(inputLogintype);
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
document.body.removeChild(form);
|
||||
|
||||
showOALoginModal.value = false;
|
||||
};
|
||||
|
||||
const activeFeedbackMessageIndex = ref<number | null>(null);
|
||||
const browserPanelOpen = ref(false);
|
||||
const browserDraftUrl = ref('');
|
||||
@@ -586,7 +643,7 @@ const startLocalLeaveFlow = (content: string) => {
|
||||
messages.value.push({
|
||||
role: 'assistant',
|
||||
type: 'leave-form',
|
||||
content: '已为你生成请假申请表,请直接在下方填写并提交。',
|
||||
content: '已为你生成请假申请表,请直接在下方填写并提交。或登录OA系统直接申请',
|
||||
payload,
|
||||
local_id: formId,
|
||||
local_only: true,
|
||||
@@ -1196,7 +1253,14 @@ const showChatRating = ref(false);
|
||||
>{{ msg.content }}</div>
|
||||
<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">{{ msg.content }}</div>
|
||||
<div class="text-sm font-medium text-slate-700 dark:text-slate-200">
|
||||
<template v-if="msg.content.includes('或登录OA系统直接申请')">
|
||||
已为你生成请假申请表,请直接在下方填写并提交。或 <a href="#" @click.prevent="openOALoginModal" class="text-brand-600 font-bold hover:underline">登录OA系统直接申请</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ msg.content }}
|
||||
</template>
|
||||
</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>
|
||||
@@ -1671,6 +1735,46 @@ const showChatRating = ref(false);
|
||||
showGeneralFeedbackDialog = false;
|
||||
}"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="showOALoginModal"
|
||||
class="fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4"
|
||||
>
|
||||
<div class="w-full max-w-sm rounded-2xl bg-white p-6 shadow-2xl dark:bg-slate-900">
|
||||
<div class="mb-5 flex items-center justify-between">
|
||||
<h3 class="text-lg font-bold text-slate-800 dark:text-slate-100">登录OA系统</h3>
|
||||
<button @click="showOALoginModal = false" class="text-slate-400 hover:text-slate-600 dark:hover:text-slate-200">
|
||||
<X class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="space-y-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-sm font-semibold text-slate-600 dark:text-slate-300">账号</label>
|
||||
<input
|
||||
v-model="oaLoginForm.username"
|
||||
type="text"
|
||||
placeholder="请输入账号"
|
||||
class="w-full rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
||||
/>
|
||||
</div>
|
||||
<div class="space-y-1.5">
|
||||
<label class="text-sm font-semibold text-slate-600 dark:text-slate-300">密码</label>
|
||||
<input
|
||||
v-model="oaLoginForm.password"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
class="w-full rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm outline-none focus:border-brand-500 focus:ring-1 focus:ring-brand-500 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
@click="submitOALogin"
|
||||
class="mt-2 w-full rounded-xl bg-brand-600 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-brand-500"
|
||||
>
|
||||
确认登录
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in new issue
Block a user