fix 修复代码缩进

This commit is contained in:
LiuHao 2024-04-05 14:16:29 +08:00
parent 0442bd638d
commit 11e8e9d19a

View File

@ -1,24 +1,53 @@
<template> <template>
<div class="p-2"> <div class="p-2">
<el-card shadow="never"> <el-card shadow="never">
<div style="display: flex;justify-content: space-between;"> <div style="display: flex; justify-content: space-between">
<div> <div>
<el-button :loading="buttonLoading" <el-button
v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && form.processInstanceVo.businessStatus && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" v-if="
type="info" @click="submitForm('draft')">暂存</el-button> routeParams.type === 'add' ||
<el-button :loading="buttonLoading" v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" (routeParams.type === 'update' &&
type="primary" @click="submitForm('submit')"> </el-button> form.processInstanceVo &&
<el-button :loading="buttonLoading" v-if="routeParams.type === 'approval' && form.processInstanceVo && form.processInstanceVo.businessStatus === 'waiting'" form.processInstanceVo.businessStatus &&
type="primary" @click="approvalVerifyOpen">审批</el-button> (form.processInstanceVo.businessStatus === 'draft' ||
<el-button @click="handleApprovalRecord" type="primary" v-if="processInstanceId">流程进度</el-button> form.processInstanceVo.businessStatus === 'cancel' ||
</div> form.processInstanceVo.businessStatus === 'back'))
<div> "
<el-button style="float: right" @click="goBack()">返回</el-button> :loading="buttonLoading"
</div> type="info"
@click="submitForm('draft')"
>暂存</el-button
>
<el-button
v-if="
routeParams.type === 'add' ||
(routeParams.type === 'update' &&
form.processInstanceVo &&
(form.processInstanceVo.businessStatus === 'draft' ||
form.processInstanceVo.businessStatus === 'cancel' ||
form.processInstanceVo.businessStatus === 'back'))
"
:loading="buttonLoading"
type="primary"
@click="submitForm('submit')"
> </el-button
>
<el-button
v-if="routeParams.type === 'approval' && form.processInstanceVo && form.processInstanceVo.businessStatus === 'waiting'"
:loading="buttonLoading"
type="primary"
@click="approvalVerifyOpen"
>审批</el-button
>
<el-button v-if="processInstanceId" type="primary" @click="handleApprovalRecord">流程进度</el-button>
</div> </div>
<div>
<el-button style="float: right" @click="goBack()">返回</el-button>
</div>
</div>
</el-card> </el-card>
<el-card shadow="never" style="height: 78vh;overflow-y: auto;"> <el-card shadow="never" style="height: 78vh; overflow-y: auto">
<el-form ref="leaveFormRef" :disabled="routeParams.type ==='view'" v-loading="loading" :model="form" :rules="rules" label-width="80px"> <el-form ref="leaveFormRef" v-loading="loading" :disabled="routeParams.type === 'view'" :model="form" :rules="rules" label-width="80px">
<el-form-item label="请假类型" prop="leaveType"> <el-form-item label="请假类型" prop="leaveType">
<el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%"> <el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
@ -64,8 +93,8 @@ const loading = ref(true);
const leaveTime = ref<Array<string>>([]); const leaveTime = ref<Array<string>>([]);
//id //id
const processInstanceId = ref(''); const processInstanceId = ref('');
// //
const routeParams = ref<Record<string, any>>({}) const routeParams = ref<Record<string, any>>({});
const options = [ const options = [
{ {
value: '1', value: '1',
@ -98,7 +127,6 @@ const submitFormData = ref<Record<string, any>>({
}); });
const taskVariables = ref<Record<string, any>>({}); const taskVariables = ref<Record<string, any>>({});
const initFormData: LeaveForm = { const initFormData: LeaveForm = {
id: undefined, id: undefined,
leaveType: undefined, leaveType: undefined,
@ -126,7 +154,6 @@ const data = reactive<PageData<LeaveForm, LeaveQuery>>({
const { form, rules } = toRefs(data); const { form, rules } = toRefs(data);
/** 表单重置 */ /** 表单重置 */
const reset = () => { const reset = () => {
form.value = { ...initFormData }; form.value = { ...initFormData };
@ -142,7 +169,7 @@ const changeLeaveTime = () => {
}; };
/** 获取详情 */ /** 获取详情 */
const getInfo = () => { const getInfo = () => {
loading.value = true loading.value = true;
buttonLoading.value = false; buttonLoading.value = false;
nextTick(async () => { nextTick(async () => {
const res = await getLeave(routeParams.value.id); const res = await getLeave(routeParams.value.id);
@ -150,10 +177,10 @@ const getInfo = () => {
leaveTime.value = []; leaveTime.value = [];
leaveTime.value.push(form.value.startDate); leaveTime.value.push(form.value.startDate);
leaveTime.value.push(form.value.endDate); leaveTime.value.push(form.value.endDate);
if(form.value.processInstanceVo){ if (form.value.processInstanceVo) {
processInstanceId.value = form.value.processInstanceVo.id processInstanceId.value = form.value.processInstanceVo.id;
} }
loading.value = false loading.value = false;
buttonLoading.value = false; buttonLoading.value = false;
}); });
}; };
@ -180,7 +207,7 @@ const submitForm = (status: string) => {
buttonLoading.value = false; buttonLoading.value = false;
proxy?.$modal.msgSuccess('暂存成功'); proxy?.$modal.msgSuccess('暂存成功');
proxy.$tab.closePage(proxy.$route); proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1) proxy.$router.go(-1);
} else { } else {
await handleStartWorkFlow(res.data); await handleStartWorkFlow(res.data);
} }
@ -212,27 +239,27 @@ const handleApprovalRecord = () => {
}; };
// //
const submitCallback = async () => { const submitCallback = async () => {
proxy.$tab.closePage(proxy.$route); await proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1) proxy.$router.go(-1);
}; };
// //
const goBack = () => { const goBack = () => {
proxy.$tab.closePage(proxy.$route); proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1) proxy.$router.go(-1);
} };
// //
const approvalVerifyOpen = async () => { const approvalVerifyOpen = async () => {
submitVerifyRef.value.openDialog(routeParams.value.taskId); submitVerifyRef.value.openDialog(routeParams.value.taskId);
}; };
onMounted(() => { onMounted(() => {
nextTick(async () => { nextTick(async () => {
routeParams.value = proxy.$route.query routeParams.value = proxy.$route.query;
reset(); reset();
loading.value = false loading.value = false;
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
getInfo() getInfo();
} }
}) });
}); });
</script> </script>