fix(mobile): converge work report confirmation
This commit is contained in:
@@ -52,6 +52,29 @@ export const isCurrentWorkReportRequest = (
|
||||
currentAccountKey: string
|
||||
) => generation === currentGeneration && accountKey === currentAccountKey;
|
||||
|
||||
export const prepareWorkReportOrganizeInput = (
|
||||
transcript: string,
|
||||
currentDraft?: WorkReportDraft
|
||||
): { transcript: string; currentDraft?: WorkReportDraft } => {
|
||||
const addition = transcript.trim();
|
||||
if (!currentDraft) return { transcript: addition };
|
||||
|
||||
const currentContent = currentDraft.content.trim();
|
||||
const content = !currentContent
|
||||
? addition
|
||||
: !addition || currentContent === addition
|
||||
? currentContent
|
||||
: `${currentContent}\n${addition}`;
|
||||
|
||||
return {
|
||||
transcript: '',
|
||||
currentDraft: {
|
||||
...currentDraft,
|
||||
content
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const workReportTypes: Array<{ value: WorkReportType; label: string; desc: string; icon: string }> = [
|
||||
{ value: 'CASE', label: '优秀案例', desc: '现场处理得好的真实案例', icon: '⭐' },
|
||||
{ value: 'VIDEO', label: '操作视频', desc: '值得推广的操作演示视频', icon: '🎬' },
|
||||
|
||||
Reference in New Issue
Block a user