刘洋 2 years ago
parent
commit
45eb994ef3

+ 3 - 0
public/styles/style.css

@@ -542,6 +542,9 @@ select, input[type="text"]:focus, input[type="password"]:focus {
 	border-radius: 10px;
 	border-radius: 10px;
 	padding: 50px 80px;
 	padding: 50px 80px;
 }
 }
+.login .form-item{
+	width:340px;
+}
 .login .logo {
 .login .logo {
 	padding-bottom: 20px;
 	padding-bottom: 20px;
 }
 }

+ 15 - 0
src/features/Image/Image.vue

@@ -42,6 +42,18 @@
           </p>
           </p>
         </td>
         </td>
       </tr>
       </tr>
+      <tr id="pdf-select">
+        <th>图片/PDF:</th>
+        <td>
+          <div class="input-radio">
+            <a-radio-group name="radioGroup" v-model:value="pdf">
+              <a-radio value="1">图片</a-radio>
+              <a-radio value="2">PDF</a-radio>
+              <a-radio value="3">图片+PDF</a-radio>
+            </a-radio-group>
+          </div>
+        </td>
+      </tr>
       <tr id="append-select">
       <tr id="append-select">
         <th>是否续传:</th>
         <th>是否续传:</th>
         <td>
         <td>
@@ -186,6 +198,7 @@ const router = useRouter();
 let type = ref("");
 let type = ref("");
 let template = ref("");
 let template = ref("");
 let dir = ref("");
 let dir = ref("");
+let pdf = ref("1");
 let append = ref(false);
 let append = ref(false);
 let failover = ref(true);
 let failover = ref(true);
 let watermark = ref(true);
 let watermark = ref(true);
@@ -200,6 +213,7 @@ if (config) {
   type.value = config.type;
   type.value = config.type;
   template.value = config.template;
   template.value = config.template;
   dir.value = config.dir;
   dir.value = config.dir;
+  pdf.value = config.pdf;
   append.value = config.append;
   append.value = config.append;
   failover.value = config.failover;
   failover.value = config.failover;
   watermark.value = config.watermark;
   watermark.value = config.watermark;
@@ -267,6 +281,7 @@ const start = (e: MouseEvent) => {
     type: type.value,
     type: type.value,
     template: template.value.trim(),
     template: template.value.trim(),
     dir: dir.value.trim(),
     dir: dir.value.trim(),
+    pdf: pdf.value,
     append: append.value,
     append: append.value,
     failover: failover.value,
     failover: failover.value,
     watermark: watermark.value,
     watermark: watermark.value,

+ 4 - 1
src/features/ImageDownload/ImageDownload.vue

@@ -227,7 +227,10 @@ onMounted(async () => {
           }
           }
           // 下载完一个学生
           // 下载完一个学生
           finishedCount.value += 1;
           finishedCount.value += 1;
-          if (resultImgList.length === sheetUrlsLength) {
+          if (
+            resultImgList.length === sheetUrlsLength &&
+            (config.pdf == "2" || config.pdf == "3")
+          ) {
             let imgName = "";
             let imgName = "";
             if (config.template.lastIndexOf("/") > -1) {
             if (config.template.lastIndexOf("/") > -1) {
               imgName = config.template.slice(
               imgName = config.template.slice(

+ 12 - 8
src/features/Login/Login.vue

@@ -3,26 +3,28 @@
     <div class="login">
     <div class="login">
       <div class="logo"><img src="img/logo_blue.png" /></div>
       <div class="logo"><img src="img/logo_blue.png" /></div>
       <a-form @submit="loginAction">
       <a-form @submit="loginAction">
-        <div>
+        <div class="form-item">
           <a-select
           <a-select
-            style="width: 100%; text-align: left"
+            style="width: 100%; text-align: left; padding: 0"
             mode="SECRET_COMBOBOX_MODE_DO_NOT_USE"
             mode="SECRET_COMBOBOX_MODE_DO_NOT_USE"
             v-model:value="server"
             v-model:value="server"
             :options="servers"
             :options="servers"
-            placeholder="请选择服务地址"
+            placeholder="请选择服务地址(如 http://192.168.10.225:8000)"
           >
           >
           </a-select>
           </a-select>
         </div>
         </div>
-        <div>
+        <div class="form-item">
           <a-input
           <a-input
+            style="width: 100%"
             v-model:value="loginName"
             v-model:value="loginName"
             id="loginName-input"
             id="loginName-input"
             type="text"
             type="text"
             placeholder="请输入账号"
             placeholder="请输入账号"
           />
           />
         </div>
         </div>
-        <div>
+        <div class="form-item">
           <a-input
           <a-input
+            style="width: 100%"
             v-model:value="password"
             v-model:value="password"
             id="password-input"
             id="password-input"
             type="password"
             type="password"
@@ -30,7 +32,9 @@
             @press-enter="loginAction"
             @press-enter="loginAction"
           />
           />
         </div>
         </div>
-        <div><a href="##" id="login-button" @click="loginAction">登录</a></div>
+        <div class="form-item">
+          <a href="##" id="login-button" @click="loginAction">登录</a>
+        </div>
       </a-form>
       </a-form>
     </div>
     </div>
     <div class="ft">
     <div class="ft">
@@ -79,13 +83,13 @@ const loginAction = () => {
   if (!server.value.startsWith("http")) {
   if (!server.value.startsWith("http")) {
     server.value = `http://${server.value}`;
     server.value = `http://${server.value}`;
   }
   }
-  let curServer = store.config.servers.find((v) => v.host === server.value) || {
+  let curServer = servers.value.find((v: any) => v.host === server.value) || {
     host: server.value,
     host: server.value,
     name: "自定义环境",
     name: "自定义环境",
   };
   };
   Object.assign(store.env, {
   Object.assign(store.env, {
     server:
     server:
-      store.config.servers.find((v) => v.host === server.value) || curServer,
+      servers.value.find((v: any) => v.host === server.value) || curServer,
     loginName: loginName.value,
     loginName: loginName.value,
     password: password.value,
     password: password.value,
   });
   });

+ 1 - 0
src/types/index.ts

@@ -37,6 +37,7 @@ export interface Store {
       type: string;
       type: string;
       template: string;
       template: string;
       dir: string;
       dir: string;
+      pdf: string;
       append: boolean;
       append: boolean;
       failover: boolean;
       failover: boolean;
       watermark: boolean;
       watermark: boolean;