Переглянути джерело

💊 修复标题显示年份问题

快乐的梦鱼 1 місяць тому
батько
коміт
b33bc04621

+ 1 - 3
src/pages/collect/assessment/evaluation-form-review.vue

@@ -195,8 +195,6 @@ const progressHint = computed(() => {
   return `${roleText}。`;
 });
 
-const currentYear = new Date().getFullYear();
-
 function levelTitleFromForm(f: SelfAssessmentDetail) {
   if (f.level === 23) return '国家级';
   if (f.level === 24) return '省级';
@@ -207,7 +205,7 @@ function levelTitleFromForm(f: SelfAssessmentDetail) {
 function loadEditorContent(f: SelfAssessmentDetail) {
   if (typeof f.content !== 'object' || f.content === null)
     f.content = {};
-  f.content.title = `传承人填写${currentYear}年1月1日至${currentYear}年12月31日${levelTitleFromForm(f)}非遗传承人义务履行和传承补助经费使用情况等,不超过1000字,如未履行职责请进行说明。参考提纲如下:`;
+  f.content.title = `传承人填写${f.year}年1月1日至${f.year}年12月31日${levelTitleFromForm(f)}非遗传承人义务履行和传承补助经费使用情况等,不超过1000字,如未履行职责请进行说明。参考提纲如下:`;
   for (let i = 0; i < 8; i++) {
     if (typeof f.content[`item${i}`] !== 'string')
       f.content[`item${i}`] = '';

+ 1 - 3
src/pages/collect/assessment/evaluation-form.vue

@@ -118,8 +118,6 @@ const currentFormCheckItems = ref<SelfAssessmentCheckItemAnswer[]>([]);
 const authStore = useAuthStore();
 const appConfig = injectAppConfiguration();
 
-const currentYear = new Date().getFullYear();
-
 const blockRef = ref<InstanceType<typeof SelfAssessmentFormDisplay> | null>(null);
 const signUploadCo = useImageSimpleUploadCo();
 const formOptions = buildSelfAssessmentFormOptions(signUploadCo, 'start');
@@ -139,7 +137,7 @@ function loadEditorContent() {
   if (typeof currentForm.value.content !== 'object' || currentForm.value.content === null) {
     currentForm.value!.content = {};
   }
-  currentForm.value!.content.title = `传承人填写${currentYear}年1月1日至${currentYear}年12月31日${levelTitle.value}非遗传承人义务履行和传承补助经费使用情况等,不超过1000字,如未履行职责请进行说明。参考提纲如下:`;
+  currentForm.value!.content.title = `传承人填写${currentForm.value.year}年1月1日至${currentForm.value.year}年12月31日${levelTitle.value}非遗传承人义务履行和传承补助经费使用情况等,不超过1000字,如未履行职责请进行说明。参考提纲如下:`;
   for (let i = 0; i < 8; i++) {
     if (typeof currentForm.value.content[`item${i}`] !== 'string') {
       currentForm.value.content[`item${i}`] = '';