From 11e8e9d19a95964db94fb432ababab6004989c8c Mon Sep 17 00:00:00 2001 From: LiuHao <liuhaoai545@gmail.com> Date: 星期五, 05 四月 2024 14:16:29 +0800 Subject: [PATCH] fix 修复代码缩进 --- src/views/workflow/leave/leaveEdit.vue | 99 +++++++++++++++++++++++++++++++------------------ 1 files changed, 63 insertions(+), 36 deletions(-) diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue index 124c09a..83d5cd6 100644 --- a/src/views/workflow/leave/leaveEdit.vue +++ b/src/views/workflow/leave/leaveEdit.vue @@ -1,24 +1,53 @@ <template> <div class="p-2"> <el-card shadow="never"> - <div style="display: flex;justify-content: space-between;"> - <div> - <el-button :loading="buttonLoading" - 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'))" - type="info" @click="submitForm('draft')">鏆傚瓨</el-button> - <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'))" - type="primary" @click="submitForm('submit')">鎻� 浜�</el-button> - <el-button :loading="buttonLoading" v-if="routeParams.type === 'approval' && form.processInstanceVo && form.processInstanceVo.businessStatus === 'waiting'" - type="primary" @click="approvalVerifyOpen">瀹℃壒</el-button> - <el-button @click="handleApprovalRecord" type="primary" v-if="processInstanceId">娴佺▼杩涘害</el-button> - </div> - <div> - <el-button style="float: right" @click="goBack()">杩斿洖</el-button> - </div> + <div style="display: flex; justify-content: space-between"> + <div> + <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')) + " + :loading="buttonLoading" + 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> + <el-button style="float: right" @click="goBack()">杩斿洖</el-button> + </div> + </div> </el-card> - <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-card shadow="never" style="height: 78vh; overflow-y: auto"> + <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-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" /> @@ -64,8 +93,8 @@ const leaveTime = ref<Array<string>>([]); //娴佺▼瀹炰緥id const processInstanceId = ref(''); -//璺敱鍙傛暟 -const routeParams = ref<Record<string, any>>({}) +//璺敱鍙傛暟 +const routeParams = ref<Record<string, any>>({}); const options = [ { value: '1', @@ -98,7 +127,6 @@ }); const taskVariables = ref<Record<string, any>>({}); - const initFormData: LeaveForm = { id: undefined, leaveType: undefined, @@ -126,7 +154,6 @@ const { form, rules } = toRefs(data); - /** 琛ㄥ崟閲嶇疆 */ const reset = () => { form.value = { ...initFormData }; @@ -142,7 +169,7 @@ }; /** 鑾峰彇璇︽儏 */ const getInfo = () => { - loading.value = true + loading.value = true; buttonLoading.value = false; nextTick(async () => { const res = await getLeave(routeParams.value.id); @@ -150,10 +177,10 @@ leaveTime.value = []; leaveTime.value.push(form.value.startDate); leaveTime.value.push(form.value.endDate); - if(form.value.processInstanceVo){ - processInstanceId.value = form.value.processInstanceVo.id + if (form.value.processInstanceVo) { + processInstanceId.value = form.value.processInstanceVo.id; } - loading.value = false + loading.value = false; buttonLoading.value = false; }); }; @@ -180,7 +207,7 @@ buttonLoading.value = false; proxy?.$modal.msgSuccess('鏆傚瓨鎴愬姛'); proxy.$tab.closePage(proxy.$route); - proxy.$router.go(-1) + proxy.$router.go(-1); } else { await handleStartWorkFlow(res.data); } @@ -212,27 +239,27 @@ }; //鎻愪氦鍥炶皟 const submitCallback = async () => { - proxy.$tab.closePage(proxy.$route); - proxy.$router.go(-1) + await proxy.$tab.closePage(proxy.$route); + proxy.$router.go(-1); }; //杩斿洖 const goBack = () => { proxy.$tab.closePage(proxy.$route); - proxy.$router.go(-1) -} + proxy.$router.go(-1); +}; //瀹℃壒 const approvalVerifyOpen = async () => { submitVerifyRef.value.openDialog(routeParams.value.taskId); }; onMounted(() => { nextTick(async () => { - routeParams.value = proxy.$route.query - reset(); - loading.value = false - if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { - getInfo() - } - }) + routeParams.value = proxy.$route.query; + reset(); + loading.value = false; + if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { + getInfo(); + } + }); }); </script> -- Gitblit v1.9.3