Explorar o código

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

vian %!s(int64=5) %!d(string=hai) anos
pai
achega
ab1b8b356a
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      util/src/bill.ts

+ 5 - 2
util/src/bill.ts

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