wuheng пре 1 година
родитељ
комит
a3936fcd63

+ 11 - 2
src/views/archives/students/component/crud.ts

@@ -86,6 +86,9 @@ export default function createCrudOptions(crudOptionsProps: CreateCrudOptionsPro
       actionbar: {
         show: true,
         buttons: {
+          add: {
+            text: '添加学员档案'
+          },
           download: {
             text: '打包下载档案',
             title: '下载当前学员所有档案',
@@ -101,9 +104,15 @@ export default function createCrudOptions(crudOptionsProps: CreateCrudOptionsPro
               if (!crudOptionsProps.context) {
                 return;
               }
+              if (!crudOptionsProps.context.studentNumber) {
+                crudOptionsProps.context.message.info('没有筛选人员的情况下 , 不允许下载档案!');
+                return;
+              }
               const { data } = await downloadArchives(crudOptionsProps.context.studentNumber);
-              const fileUrl = `http://localhost:3200/proxy-pattern/archive/getFileByToken?archiveToken=${data}`;
-              window.location.href = fileUrl;
+              if (data) {
+                const fileUrl = `http://localhost:3200/proxy-pattern/archive/getFileByToken?archiveToken=${data}`;
+                window.location.href = fileUrl;
+              }
             }
           }
         }

+ 1 - 1
src/views/archives/students/component/index.vue

@@ -79,7 +79,7 @@ watch(
 </script>
 <style scoped lang="scss">
 .other-file {
-  margin-top: 30%;
+  margin-top: 20%;
   font-size: 30px;
 }
 </style>