Browse Source

perf: 优化推送企业认证

master
wangxiang 2 years ago
parent
commit
d9543a71d4
  1. 2
      src/views/common/push/pushEnterprise/index.vue
  2. 2
      src/views/common/push/pushEnterpriseAudit/EnterpriseAuditModal.vue
  3. 2
      src/views/common/push/pushEnterpriseAudit/index.vue
  4. 27
      src/views/system/user/account/setting/entCertification/Step1.vue
  5. 4
      src/views/system/user/account/setting/entCertification/Step2.vue
  6. 20
      src/views/system/user/account/setting/entCertification/index.vue

2
src/views/common/push/pushEnterprise/index.vue

@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
fixed: false
},
searchInfo: {
status: '1'
status: 2
},
handleSearchInfoFn: () => clearSelectedRowKeys()
});

2
src/views/common/push/pushEnterpriseAudit/EnterpriseAuditModal.vue

@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
try {
const formData = await validate();
formData.license = Array(formData.license).join(',');
formData.status = '1';
formData.status = '2';
setModalProps({ confirmLoading: true });
await editPushEnterprise(formData);
closeModal();

2
src/views/common/push/pushEnterpriseAudit/index.vue

@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
fixed: false
},
searchInfo: {
status: '0'
status: 1
},
handleSearchInfoFn: () => clearSelectedRowKeys()
});

27
src/views/system/user/account/setting/entCertification/Step1.vue

@ -4,21 +4,28 @@ @@ -4,21 +4,28 @@
</div>
</template>
<script lang="ts">
import { defineComponent, ref, unref } from 'vue';
import { defineComponent, ref, unref, watchEffect } from 'vue';
import { BasicForm, useForm } from '/@/components/Form';
import { formSchema } from './data';
import { addPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { addPushEnterprise, editPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise';
import { useMessage } from '/@/hooks/web/useMessage';
import type { PushEnterprise } from '/@/api/platform/common/entity/pushEnterprise';
export default defineComponent({
components: {
BasicForm
},
props: {
pushEnterprise: {
type: Object as PropType<PushEnterprise>,
default: () => ({})
}
},
emits: ['next'],
setup(_, { emit }) {
setup(props, { emit }) {
const submitBtnLoading = ref(false);
const { createMessage } = useMessage();
const [registerForm, { validate }] = useForm({
const [registerForm , { validate, setFieldsValue }] = useForm({
labelWidth: 100,
schemas: formSchema,
submitButtonOptions: {
@ -32,15 +39,25 @@ @@ -32,15 +39,25 @@
},
showResetButton: false
});
setFieldsValue(props.pushEnterprise);
watchEffect(() => {
setFieldsValue(props.pushEnterprise);
});
async function handleSubmit() {
try {
const formData = await validate();
formData.status = 1;
formData.license = Array(formData.license).join(',');
submitBtnLoading.value = true;
if (!formData.id) {
await addPushEnterprise(formData);
} else {
await editPushEnterprise(formData);
}
createMessage.success('提交成功!');
emit('next');
emit('next', 1);
} finally {
submitBtnLoading.value = false;
}

4
src/views/system/user/account/setting/entCertification/Step2.vue

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<template>
<div class="step2">
<AResult v-if="props.pushEnterprise.status == -1"
<AResult v-if="props.pushEnterprise?.status == -1"
status="error"
title="审核位通过"
sub-title="请检查并修改以下信息,然后再重新提交。"
@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
});
async function handleSubmit() {
const contentText = props.pushEnterprise?.status == -1
const contentText = props.pushEnterprise?.status == 1
? '是否确认撤销审核?'
: '是否确认返回到填写企业信息?';
createConfirm({

20
src/views/system/user/account/setting/entCertification/index.vue

@ -13,14 +13,20 @@ @@ -13,14 +13,20 @@
</ASteps>
</div>
<div class="mt-5">
<Step1 v-show="state.current === 0" @next="state.current++"/>
<Step1 v-show="state.current === 0"
:push-enterprise="state.pushEnterprise"
@next=" val => {
state.current++
state.pushEnterprise.status = val
}"
/>
<Step2 v-show="state.current === 1" :push-enterprise="state.pushEnterprise" @previous="state.current--"/>
<Step3 v-show="state.current === 2"/>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, unref, computed, CSSProperties, reactive, onMounted } from 'vue';
import { ref, unref, computed, CSSProperties, reactive, onBeforeMount } from 'vue';
import Step1 from './Step1.vue';
import Step2 from './Step2.vue';
import Step3 from './Step3.vue';
@ -32,7 +38,7 @@ @@ -32,7 +38,7 @@
interface State {
current: number;
loadingStatus: boolean;
pushEnterprise: PushEnterprise | undefined;
pushEnterprise: PushEnterprise | {};
}
const ASteps = Steps;
@ -41,7 +47,7 @@ @@ -41,7 +47,7 @@
const state = reactive<State>({
current: 0,
loadingStatus: false,
pushEnterprise: undefined
pushEnterprise: {}
});
const { contentHeight } = useContentHeight(
computed(() => true),
@ -52,7 +58,7 @@ @@ -52,7 +58,7 @@
ref(30));
const getContentStyle = computed((): CSSProperties => ({ minHeight: `${unref(contentHeight)}px` }));
onMounted(async () => {
onBeforeMount(async () => {
await loadPushEnterprise();
});
@ -61,11 +67,11 @@ @@ -61,11 +67,11 @@
const pushEnterprise = await getAuthData();
state.pushEnterprise = pushEnterprise;
switch (pushEnterprise?.status) {
case 1:
case -1:
case 0:
state.current = 1;
break;
case 1:
case 2:
state.current = 2;
break;
default:

Loading…
Cancel
Save