فهرست منبع

双评是否展示,根据配置来决定

刘洋 1 سال پیش
والد
کامیت
21d0b85f8d
4فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 1 0
      .eslintrc.js
  2. 1 1
      package.json
  3. 4 1
      src/lib/watermark.ts
  4. 1 0
      src/types/index.ts

+ 1 - 0
.eslintrc.js

@@ -19,6 +19,7 @@ module.exports = {
     "@typescript-eslint/no-explicit-any": "off",
     "@typescript-eslint/no-var-requires": "off",
     "@typescript-eslint/explicit-module-boundary-types": "off",
+    "@typescript-eslint/no-unused-vars": "off",
     "no-var-requires": "off",
     "no-unused-vars": "off",
     "no-console": "off",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "stmmsproxy",
-  "version": "1.0.2",
+  "version": "1.3.2",
   "private": true,
   "scripts": {
     "start": "vue-cli-service serve",

+ 4 - 1
src/lib/watermark.ts

@@ -26,6 +26,9 @@ export async function addWatermark(
   colorMap: any = {},
   onlyUsePdf = false
 ): Promise<boolean | string> {
+  const canShowDouble = store.env.user.doubleTrack;
+  console.log("双评是否展示的配置为:", canShowDouble);
+
   const file = path.join(...filePath);
   if (
     index !== 1 &&
@@ -252,7 +255,7 @@ export async function addWatermark(
 
     for (let i = 0; i < tags.length; i++) {
       const tag = tags[i];
-      if (tag.content != undefined && !tag.hide) {
+      if (tag.content != undefined && (!tag.hide || canShowDouble)) {
         let top = tag.top;
         imgData
           .font(fontFile, fontSize)

+ 1 - 0
src/types/index.ts

@@ -11,6 +11,7 @@ export interface Store {
       userId: number;
       userName: string;
       userRole: string;
+      doubleTrack?: boolean;
     };
     exam: {
       id: number;