Selaa lähdekoodia

fix(util): 生成特征及内容文本方法变更

vian 5 vuotta sitten
vanhempi
commit
ab1b8b356a
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      util/src/bill.ts

+ 5 - 2
util/src/bill.ts

@@ -29,17 +29,20 @@ export const getJobsAndCharacterText = (
 ): IJobsAndCharacterText => {
 ): IJobsAndCharacterText => {
   const jobContentText = '';
   const jobContentText = '';
   let itemCharacterText = '';
   let itemCharacterText = '';
+  jobContents.sort((a, b) => a.seq - b.seq);
+  itemCharacters.sort((a, b) => a.seq - b.seq);
   const textArray: string[] = ['[项目特征]'];
   const textArray: string[] = ['[项目特征]'];
   let i = 1;
   let i = 1;
   for (const item of itemCharacters) {
   for (const item of itemCharacters) {
-    if (item.isChecked) textArray.push(`${i}. ${item.character}`);
+    if (item.isChecked)
+      textArray.push(`${i}. ${item.character || ''}: ${item.eigenvalue || ''}`);
     i += 1;
     i += 1;
   }
   }
 
 
   textArray.push('[工作内容]');
   textArray.push('[工作内容]');
   i = 1;
   i = 1;
   for (const job of jobContents) {
   for (const job of jobContents) {
-    if (job.isChecked) textArray.push(`${i}. ${job.content}`);
+    if (job.isChecked) textArray.push(`${i}. ${job.content || ''}`);
     i += 1;
     i += 1;
   }
   }
   itemCharacterText = textArray.join('\n');
   itemCharacterText = textArray.join('\n');