|
@@ -236,22 +236,25 @@ export default function useDraw(winId: number) {
|
|
* 获取文件存储路径,规则:学期/考试/课程/试卷编号/教学班/下载文件类型/学生图片
|
|
* 获取文件存储路径,规则:学期/考试/课程/试卷编号/教学班/下载文件类型/学生图片
|
|
*/
|
|
*/
|
|
function getOutputPath(type: PictureTypeEnum, index?: number) {
|
|
function getOutputPath(type: PictureTypeEnum, index?: number) {
|
|
|
|
+ const transfromStr = (str: string) => str.replace(/[*|:?<>]/g, '');
|
|
let filename =
|
|
let filename =
|
|
trackConfig.value.studentFileRule === 'CODE_NAME'
|
|
trackConfig.value.studentFileRule === 'CODE_NAME'
|
|
? `${rawTask.studentCode}-${rawTask.studentName}`
|
|
? `${rawTask.studentCode}-${rawTask.studentName}`
|
|
: rawTask.studentCode;
|
|
: rawTask.studentCode;
|
|
|
|
+ filename = transfromStr(filename);
|
|
|
|
|
|
if (index !== undefined) {
|
|
if (index !== undefined) {
|
|
filename += `-${index}`;
|
|
filename += `-${index}`;
|
|
}
|
|
}
|
|
filename += type === 'pdf' ? '.pdf' : '.jpg';
|
|
filename += type === 'pdf' ? '.pdf' : '.jpg';
|
|
|
|
+
|
|
const paths = [
|
|
const paths = [
|
|
trackConfig.value.curOutputDir,
|
|
trackConfig.value.curOutputDir,
|
|
- task.value.semesterName,
|
|
|
|
- task.value.examName,
|
|
|
|
- `${rawTask.courseName}(${rawTask.courseCode})`,
|
|
|
|
- rawTask.paperNumber,
|
|
|
|
- taskDetail.value.className,
|
|
|
|
|
|
+ transfromStr(task.value.semesterName),
|
|
|
|
+ transfromStr(task.value.examName),
|
|
|
|
+ transfromStr(`${rawTask.courseName}(${rawTask.courseCode})`),
|
|
|
|
+ transfromStr(rawTask.paperNumber),
|
|
|
|
+ transfromStr(taskDetail.value.className),
|
|
PICTURE_TYPE[type],
|
|
PICTURE_TYPE[type],
|
|
filename,
|
|
filename,
|
|
];
|
|
];
|