|
@@ -52,20 +52,6 @@
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
<Divider />
|
|
<Divider />
|
|
|
- <H3>佐证资料上传</H3>
|
|
|
|
|
- <Result v-if="!currentForm?.id" status="info" title="请先保存评估表后再上传佐证资料" />
|
|
|
|
|
- <Uploader
|
|
|
|
|
- v-else
|
|
|
|
|
- ref="uploaderRef"
|
|
|
|
|
- :upload="assessmentAnnexUpload"
|
|
|
|
|
- :max-upload-count="100"
|
|
|
|
|
- :max-file-size="20 * 1024 * 1024"
|
|
|
|
|
- :group-type="true"
|
|
|
|
|
- chooseType="file"
|
|
|
|
|
- list-type="list"
|
|
|
|
|
- />
|
|
|
|
|
- <Height :height="30" />
|
|
|
|
|
- <Divider />
|
|
|
|
|
<Button type="primary" block :loading="submitLoading" @click="saveForm">保存评估表</Button>
|
|
<Button type="primary" block :loading="submitLoading" @click="saveForm">保存评估表</Button>
|
|
|
<Button :loading="submitLoading" @click="downloadForm">下载评估表PDF</Button>
|
|
<Button :loading="submitLoading" @click="downloadForm">下载评估表PDF</Button>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
@@ -81,14 +67,12 @@ import { computed, ref } from 'vue';
|
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
-import { useAliOssUploadCo } from '@/common/components/upload/AliOssUploadCo';
|
|
|
|
|
import { assertNotNull, formatError, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
import { assertNotNull, formatError, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
import { toast, alert } from '@/components/dialog/CommonRoot';
|
|
import { toast, alert } from '@/components/dialog/CommonRoot';
|
|
|
import AssessmentContentApi, {
|
|
import AssessmentContentApi, {
|
|
|
SelfAssessmentDetail,
|
|
SelfAssessmentDetail,
|
|
|
CheckItemInfo,
|
|
CheckItemInfo,
|
|
|
SelfAssessmentCheckItemAnswer,
|
|
SelfAssessmentCheckItemAnswer,
|
|
|
- getCheckAnnexType,
|
|
|
|
|
} from '@/api/collect/AssessmentContent';
|
|
} from '@/api/collect/AssessmentContent';
|
|
|
import CommonRoot from '@/components/dialog/CommonRoot.vue';
|
|
import CommonRoot from '@/components/dialog/CommonRoot.vue';
|
|
|
import Button from '@/components/basic/Button.vue';
|
|
import Button from '@/components/basic/Button.vue';
|
|
@@ -96,14 +80,10 @@ import Result from '@/components/feedback/Result.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
|
import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
|
|
import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
|
|
|
-import H3 from '@/components/typography/H3.vue';
|
|
|
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
-import Uploader, { type UploaderInstance } from '@/components/form/Uploader.vue';
|
|
|
|
|
-import { getMimeType } from '@/common/components/upload/mimes';
|
|
|
|
|
import Divider from '@/components/display/Divider.vue';
|
|
import Divider from '@/components/display/Divider.vue';
|
|
|
-import { stringUrlToUploaderItem } from '@/components/form/Uploader';
|
|
|
|
|
import CheckBox from '@/components/form/CheckBox.vue';
|
|
import CheckBox from '@/components/form/CheckBox.vue';
|
|
|
import Field from '@/components/form/Field.vue';
|
|
import Field from '@/components/form/Field.vue';
|
|
|
import SelfAssessmentFormDisplay from './components/SelfAssessmentFormDisplay.vue';
|
|
import SelfAssessmentFormDisplay from './components/SelfAssessmentFormDisplay.vue';
|
|
@@ -135,24 +115,8 @@ const currentForm = ref<SelfAssessmentDetail | null>(null);
|
|
|
const currentFormCheckItems = ref<SelfAssessmentCheckItemAnswer[]>([]);
|
|
const currentFormCheckItems = ref<SelfAssessmentCheckItemAnswer[]>([]);
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
|
|
|
|
|
-const assessmentAnnexUpload = useAliOssUploadCo('assessment/annex', async (res, item) => {
|
|
|
|
|
- assertNotNull(currentForm.value, 'currentForm is null');
|
|
|
|
|
- const mimetype = getMimeType(item.filePath);
|
|
|
|
|
- await AssessmentContentApi.saveAnnex({
|
|
|
|
|
- name: item.name,
|
|
|
|
|
- formId: currentForm.value.id,
|
|
|
|
|
- url: res,
|
|
|
|
|
- type: getCheckAnnexType(mimetype),
|
|
|
|
|
- mimetype: mimetype,
|
|
|
|
|
- fileSize: item.size
|
|
|
|
|
- ? Math.max(1, Math.ceil(item.size / 1024))
|
|
|
|
|
- : undefined,
|
|
|
|
|
- });
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
const currentYear = new Date().getFullYear();
|
|
|
|
|
|
|
|
-const uploaderRef = ref<UploaderInstance | null>(null);
|
|
|
|
|
const blockRef = ref<InstanceType<typeof SelfAssessmentFormDisplay> | null>(null);
|
|
const blockRef = ref<InstanceType<typeof SelfAssessmentFormDisplay> | null>(null);
|
|
|
const signUploadCo = useImageSimpleUploadCo();
|
|
const signUploadCo = useImageSimpleUploadCo();
|
|
|
const formOptions = buildSelfAssessmentFormOptions(signUploadCo);
|
|
const formOptions = buildSelfAssessmentFormOptions(signUploadCo);
|
|
@@ -196,17 +160,6 @@ async function loadCheckItems() {
|
|
|
currentFormCheckItems.value = currentForm.value.checkItems.concat();
|
|
currentFormCheckItems.value = currentForm.value.checkItems.concat();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-async function loadAnnexList() {
|
|
|
|
|
- assertNotNull(currentForm.value, 'currentForm is null');
|
|
|
|
|
- console.log('awardTime', currentForm.value.awardTime);
|
|
|
|
|
- const annexList = await AssessmentContentApi.getAnnexList(currentForm.value.id);
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- if (uploaderRef.value) {
|
|
|
|
|
- uploaderRef.value.setList(annexList.data.map((item) => stringUrlToUploaderItem(item.url, item.name)));
|
|
|
|
|
- }
|
|
|
|
|
- }, 1000);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
|
|
|
|
|
|
async function createForm() {
|
|
async function createForm() {
|
|
@@ -275,7 +228,6 @@ const loader = useSimpleDataLoader(async () => {
|
|
|
currentForm.value = detail;
|
|
currentForm.value = detail;
|
|
|
loadEditorContent();
|
|
loadEditorContent();
|
|
|
await loadCheckItems();
|
|
await loadCheckItems();
|
|
|
- await loadAnnexList();
|
|
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const basicInfo = await AssessmentContentApi.getInheritorBasic(authStore.userInfo?.id);
|
|
const basicInfo = await AssessmentContentApi.getInheritorBasic(authStore.userInfo?.id);
|
|
@@ -286,7 +238,6 @@ const loader = useSimpleDataLoader(async () => {
|
|
|
);
|
|
);
|
|
|
currentForm.value = detail;
|
|
currentForm.value = detail;
|
|
|
loadEditorContent();
|
|
loadEditorContent();
|
|
|
- await loadAnnexList();
|
|
|
|
|
await loadCheckItems();
|
|
await loadCheckItems();
|
|
|
} else {
|
|
} else {
|
|
|
currentForm.value = null;
|
|
currentForm.value = null;
|