Merge remote-tracking branch 'origin/dev' into warm-flw-future
This commit is contained in:
commit
681758494b
@ -30,3 +30,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
||||
|
||||
# websocket 开关 默认使用sse推送
|
||||
VITE_APP_WEBSOCKET = false
|
||||
|
||||
# sse 开关
|
||||
VITE_APP_SSE = true
|
||||
|
@ -33,3 +33,6 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
|
||||
|
||||
# websocket 开关 默认使用sse推送
|
||||
VITE_APP_WEBSOCKET = false
|
||||
|
||||
# sse 开关
|
||||
VITE_APP_SSE = true
|
||||
|
@ -73,7 +73,7 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse')
|
||||
initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse');
|
||||
});
|
||||
|
||||
const handleClickOutside = () => {
|
||||
|
1
src/types/env.d.ts
vendored
1
src/types/env.d.ts
vendored
@ -19,6 +19,7 @@ interface ImportMetaEnv {
|
||||
VITE_APP_RSA_PRIVATE_KEY: string;
|
||||
VITE_APP_CLIENT_ID: string;
|
||||
VITE_APP_WEBSOCKET: string;
|
||||
VITE_APP_SSE: string;
|
||||
}
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
|
@ -2,10 +2,12 @@ import { getToken } from '@/utils/auth';
|
||||
import { ElNotification } from 'element-plus';
|
||||
import useNoticeStore from '@/store/modules/notice';
|
||||
|
||||
let message = '';
|
||||
|
||||
// 初始化
|
||||
export const initSSE = (url: any) => {
|
||||
if (import.meta.env.VITE_APP_SSE === 'false') {
|
||||
return;
|
||||
}
|
||||
|
||||
url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID
|
||||
const {
|
||||
data,
|
||||
@ -15,13 +17,13 @@ export const initSSE = (url: any) => {
|
||||
retries: 10,
|
||||
delay: 3000,
|
||||
onFailed() {
|
||||
console.log('Failed to connect after 10 retries')
|
||||
},
|
||||
console.log('Failed to connect after 10 retries');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
watch(error, () => {
|
||||
console.log('SSE connection error:', error.value)
|
||||
console.log('SSE connection error:', error.value);
|
||||
error.value = null;
|
||||
});
|
||||
|
||||
@ -41,5 +43,3 @@ export const initSSE = (url: any) => {
|
||||
data.value = null;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
@ -198,7 +198,7 @@ const handleExport = () => {
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`config_${new Date().getTime()}.xlsx`
|
||||
`logininfor_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -23,10 +23,12 @@
|
||||
<el-form-item label="请假时间">
|
||||
<el-date-picker
|
||||
v-model="leaveTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="To"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||
@change="changeLeaveTime()"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -190,8 +192,8 @@ const handleStartWorkFlow = async (data: LeaveVO) => {
|
||||
taskVariables.value = {
|
||||
entity: data,
|
||||
leaveDays: data.leaveDays,
|
||||
userList: [1, 3],
|
||||
userList2: [1, 3]
|
||||
userList: ["1", "3"],
|
||||
userList2: ["1", "3"]
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user