From eb6479e7df9692aa3d79f36631c13c3f8b4b5797 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 04 七月 2024 10:56:30 +0800
Subject: [PATCH] 增加幂次计算

---
 src/components/tool/excel.vue                          |    4 +-
 index.html                                             |   66 ++++++++++++++-------------------
 src/components/do/b1-inspect-order-plan/Inspection.vue |   15 +++++--
 src/util/excelFountion.js                              |   30 ++++++++++++++-
 4 files changed, 69 insertions(+), 46 deletions(-)

diff --git a/index.html b/index.html
index ccfc162..5e2878a 100644
--- a/index.html
+++ b/index.html
@@ -1,42 +1,32 @@
 <!DOCTYPE html>
 <html>
-	<head>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
-		<meta http-equiv="Expires" CONTENT="0">
-		<meta http-equiv="Cache-Control" CONTENT="no-cache">
-		<meta http-equiv="Pragma" CONTENT="no-cache">
-    <link rel='stylesheet' href='/static/luckysheet\plugins\css/pluginsCss.css' />
-    <link rel='stylesheet' href='/static/luckysheet/plugins/plugins.css' />
-    <link rel='stylesheet' href='/static/luckysheet/css/luckysheet.css' />
-    <link rel='stylesheet' href='/static/luckysheet/assets/iconfont/iconfont.css' />
-		<script src="/static/luckysheet/plugins/js/plugin.js"></script>
-		<script src="/static/example.html/static/luckysheet/luckysheet.umd.js"></script>
-    <!-- <link rel='stylesheet' href='http://10.1.200.86/luckysheet\plugins\css/pluginsCss.css' />
-    <link rel='stylesheet' href='http://10.1.200.86/luckysheet/plugins/plugins.css' />
-    <link rel='stylesheet' href='http://10.1.200.86/luckysheet/css/luckysheet.css' />
-    <link rel='stylesheet' href='http://10.1.200.86/luckysheet/assets/iconfont/iconfont.css' />
-		<script src="http://10.1.200.86/luckysheet/plugins/js/plugin.js"></script>
-		<script src="http://10.1.200.86/luckysheet/luckysheet.umd.js"></script> -->
-		<title>LIMS瀹為獙瀹ょ鐞嗙郴缁�</title>
-		<link rel="icon" type="image/x-icon" href="./static/img/logo.png">
+<head>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+  <meta http-equiv="Expires" CONTENT="0">
+  <meta http-equiv="Cache-Control" CONTENT="no-cache">
+  <meta http-equiv="Pragma" CONTENT="no-cache">
+  <title>LIMS瀹為獙瀹ょ鐞嗙郴缁�</title>
+  <link rel="icon" type="image/x-icon" href="./static/img/logo.png">
 
-		<!-- <link href="./static/luckysheet/plugins/css/pluginsCss.css" rel="stylesheet" />
-		<link href="./static/luckysheet/plugins/plugins.css" rel="stylesheet" />
-		<link href="./static/luckysheet/css/luckysheet.css" rel="stylesheet" />
-		<link href="./static/luckysheet/assets/iconfont/iconfont.css" rel="stylesheet" /> -->
-    <style>
-      #app{
-        overflow: hidden;
-      }
-      .el-table-filter__list{
-        max-height: 70vh !important;
-        overflow-y: scroll !important;
-      }
-    </style>
-	</head>
-	<body>
-		<div id="app"></div>
-    <script type='text/javascript' src='http://10.16.173.59:81/web-apps/apps/api/documents/api.js'></script>
-	</body>
+  <link href="./static/luckysheet/plugins/css/pluginsCss.css" rel="stylesheet" />
+  <link href="./static/luckysheet/plugins/plugins.css" rel="stylesheet" />
+  <link href="./static/luckysheet/css/luckysheet.css" rel="stylesheet" />
+  <link href="./static/luckysheet/assets/iconfont/iconfont.css" rel="stylesheet" />
+  <style>
+    #app{
+      overflow: hidden;
+    }
+    .el-table-filter__list{
+      max-height: 70vh !important;
+      overflow-y: scroll !important;
+    }
+  </style>
+</head>
+<body>
+<div id="app"></div>
+<script type='text/javascript' src='http://10.16.173.59:81/web-apps/apps/api/documents/api.js'></script>
+<script src="<%= htmlWebpackPlugin.options.url %>/static/luckysheet/plugins/js/plugin.js"></script>
+<script src="<%= htmlWebpackPlugin.options.url %>/static/luckysheet/luckysheet.umd.js"></script>
+</body>
 </html>
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 9e6591a..27b091c 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -981,7 +981,6 @@
           row.resValue = row.comValue?Math.abs(row.comValue-20).toFixed(5):''
           this.param[row.id].resValue.v.v = row.resValue
           if(row.ask&&row.resValue){
-            console.log(row.ask,row.resValue)
             if(row.ask.includes('<')){
               row.insResult = row.resValue<row.ask.split('<')[1]?1:0
             }else if(row.ask.includes('>')){
@@ -1002,6 +1001,9 @@
         this.saveInsContext()
       },
       wareFormChange(m,type){
+        if(this.PROJECT!='妫�娴嬩腑蹇�'){
+          return
+        }
         if(m&&type){
           this.wareForm[type] = Number(m)
         }
@@ -1231,6 +1233,9 @@
         this.currentTab = null;
       },
       getReportModel(id){
+        if(this.PROJECT!='妫�娴嬩腑蹇�'){
+          return
+        }
         this.$axios.post(this.$api.insOrderPlan.getReportModel+'?sampleId='+id, {}).then(res => {
           this.fibers = res.data['鍏夌氦甯�']
           this.fiber = res.data['鍏夌氦']
@@ -1617,7 +1622,6 @@
           try {
             let equipValue = JSON.parse(a.insProductResult.equipValue)
             for (let i = 0; i < equipValue.length; i++) {
-              console.log(444,this.equipForm)
               if(this.tableLists.find(m=>m.templateId==this.currentTable)&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'){
                 // 娓╁害寰幆璧嬪��
                 this.$set(this.equipForm,`code`+i,equipValue[i].v)
@@ -1674,7 +1678,11 @@
                       }
                       if(this.getInspectionValueType(item.i)==1){
                         if (!isNaN(parseFloat(c.v.v))) {
-                          comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v)
+                          if(c.v.v.includes('^')){
+                            comValue[(tableCode + (c.r + 1))] = c.v.v
+                          }else{
+                            comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v)
+                          }
                         }
                       }else{
                         comValue[(tableCode + (c.r + 1))] = c.v.v
@@ -2190,7 +2198,6 @@
       },
       saveInsContext() {
         if(this.param){
-          console.log(33333,this.param)
           this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
             param: JSON.stringify(this.param)
           }).then(res => {
diff --git a/src/components/tool/excel.vue b/src/components/tool/excel.vue
index 4f3ca8a..93c755a 100644
--- a/src/components/tool/excel.vue
+++ b/src/components/tool/excel.vue
@@ -121,8 +121,8 @@
 				},
 				option.myFolderUrl = this.LOCATIONVUE + '/',
 				option.functionButton = '<i class="save_i el-icon-info" title="绯荤粺鏀寔鐨勫彉閲忥細&#10鏍峰搧缂栧彿&#10鏍峰搧鍨嬪彿&#10搴忓彿&#10妫�楠岄」&#10妫�楠屽瓙椤�&#10璁惧鍚嶇О&#10璁惧缂栫爜&#10鍗曚綅&#10瑕佹眰鍊�&#10璇曢獙鏂规硶 | 妫�娴嬫柟娉�&#10鏈�缁堝��&#10缁撹&#10璁$畻鍊�&#10妫�楠屽��"></i><button onClick="excelClosed()" class="save">淇濆瓨</button>'
-        console.log(window.luckysheet,luckysheet)
-				window.luckysheet.create(option)
+        console.log(luckysheet)
+				luckysheet.create(option)
 			}
 		}
 	}
diff --git a/src/util/excelFountion.js b/src/util/excelFountion.js
index 75988a1..1fa318f 100644
--- a/src/util/excelFountion.js
+++ b/src/util/excelFountion.js
@@ -133,6 +133,27 @@
   }
 }
 
+/**
+ * 璁$畻骞�
+ *
+ * @param str 瀛楃涓插舰寮忕殑骞傝〃杈惧紡锛屼緥濡�"2^3"
+ * @returns 杩斿洖璁$畻鍚庣殑骞傚�硷紝濡傛灉琛ㄨ揪寮忔棤鏁堝垯杩斿洖null
+ */
+function CalculatePower(str){
+  try {
+    if(str&&str.includes('^')){
+      let arr = str.split('^');
+      if(arr&&arr.length>1){
+        return Math.pow(arr[0],arr[1]);
+      }else{
+        return null;
+      }
+    }
+  } catch (error) {
+
+  }
+}
+
 
 
 /**
@@ -294,8 +315,13 @@
     // 鑾峰彇鍗曞厓鏍煎搴斿��
     let arr = getAllCell(f)
     for (var a in comValue) {
-      if(comValue[a]!=='undefine'&&comValue[a]!=='null'&&comValue[a]!==undefined){
-        arr[a] = comValue[a]
+      if(comValue[a]!=='undefined'&&comValue[a]!=='null'&&comValue[a]!==undefined){
+        if(typeof(comValue[a])=='string'&&comValue[a].includes('^')){
+          // 璁$畻骞傛
+          arr[a] = CalculatePower(comValue[a])
+        }else{
+          arr[a] = comValue[a]
+        }
       }
     }
     // 瑙f瀽鍏紡鍙傛暟锛岀壒鍒槸甯︼細鐨�

--
Gitblit v1.9.3