Parcourir la source

Merge remote-tracking branch 'origin/master'

zhoupeng il y a 1 an
Parent
commit
5f9013f626

+ 1 - 1
PrintServer/src/main/java/com/jd/printserver/controller/PrintServerController.java

@@ -149,7 +149,7 @@ public class PrintServerController extends BaseController {
             Attribute attr = attributes.get(PrinterIsAcceptingJobs.class);
 
             map = new HashMap<>();
-            map.put("printName", printService.toString());
+            map.put("printName", printService.getName());
             map.put("status", 0);
             // 判断打印机是否接受新的打印任务
             if (attr != null && attr instanceof PrinterIsAcceptingJobs) {

+ 20 - 4
chuanyi_client/src/utils/luckysheettool.js

@@ -1,6 +1,7 @@
-import {showAlertWin, withDateFormatLength} from "@/utils/cqcy";
+import {getNowFormatDate, showAlertWin, withDateFormatLength} from "@/utils/cqcy";
 import { parseString } from "cron-parser";
 import html2canvas from "html2canvas";
+import {getUsername} from "@/utils/auth";
 
 function setCellSize(l, e, t, o) {
     const {
@@ -331,13 +332,13 @@ function calculateMinutes(time1, time2) {
 function changeValStr(str) {
     if (str) {
 		if ((str + "").startsWith("${")) {
-			return "";
+			return changeBaseVal(str + "");
 		} else {
 			if (str.v && str.v.startsWith("${")) {
-			    return "";
+			    return changeBaseVal(str.v);
 			} else  {
 			    if (JSON.stringify(str).startsWith("${")) {
-			        return "";
+			        return changeBaseVal(JSON.stringify(str));
 			    }
 			}
 		}
@@ -347,6 +348,21 @@ function changeValStr(str) {
     }
 }
 
+function changeBaseVal(str) {
+    if (str.indexOf('${currDate}') > -1) {
+        return getNowFormatDate('yyyy-MM-dd')
+    } else if (str.indexOf('${currDateTime}') > -1) {
+        console.log(str)
+        return getNowFormatDate('yyyy-MM-dd HH:mm:ss')
+    } else if (str.indexOf('${userName}') > -1) {
+        return getUsername()
+    } else if (str.indexOf('${winUserName}') > -1) {
+        return process.env.VUE_APP_WINNAME
+    } else {
+        return ""
+    }
+}
+
 function getLegendHeight(clazzw, data){
         var height =0;