Xiaopeng Zhang 5 luni în urmă
părinte
comite
cbe9b4e890
4 a modificat fișierele cu 29 adăugiri și 87 ștergeri
  1. 1 1
      package.json
  2. 27 85
      src/Service.js
  3. 1 1
      src/Zjcs2.js
  4. 0 0
      src/tabulator_modern.css.map

+ 1 - 1
package.json

@@ -25,7 +25,7 @@
     "web-vitals": "^2.1.4"
   },
   "scripts": {
-    "start": "GENERATE_SOURCEMAP=true react-scripts start",
+    "start": "GENERATE_SOURCEMAP=false react-scripts start",
     "build": "react-scripts build",
     "test": "react-scripts test",
     "eject": "react-scripts eject",

+ 27 - 85
src/Service.js

@@ -12,13 +12,12 @@ class Service{
         this.mem_pointer_djcs = -1;
         this.qufei = [];
         this.qufeiEntry = null;
-        this.peibishu = {};
-        this.dingeshu = {};
+        
     }
     
     ip() {
         //return "/api"//return "http://127.0.0.1:8000"
-        return "http://192.168.31.48:1313/api"
+        return "http://127.0.0.1:1313/api"
     }
 
     clearCache() {//set qufei will clear cache
@@ -528,19 +527,10 @@ class Service{
 /////////////////////////////end of qingdan////////////////////////////////////
 
 async generateQingdanTuijian(name, bh, bt, bm) {
-    const response = await fetch(this.ip().concat( "/qingdantuijian/"), {
-        method : "POST",
-        headers: {
-            "Content-type": "application/json"
-        },
-        body: JSON.stringify(
-            {
-                "bh": bh,
-                "bt": bt,
-                "bm": bm,
-                "name": name
-            }
-        )
+    const response = await fetch(this.ip().concat( "/qingdantuijian/".concat(bm)), {
+        method : "GET",
+       
+       
     });
     if (!response.ok) {
         //const error = await response.json();
@@ -638,16 +628,9 @@ async generateQingdanTuijian(name, bh, bt, bm) {
     }
 
     async generatePeibiXilie(id) {
-        const response = await fetch(this.ip().concat( "/pbxl/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                    "name": id
-                }
-            )
+        const response = await fetch(this.ip().concat( "/pbxl/").concat(id), {
+            method : "GET",
+           
         });
         if (!response.ok) {
             //const error = await response.json();
@@ -658,65 +641,39 @@ async generateQingdanTuijian(name, bh, bt, bm) {
         }
     }
     async generatePeibishu(zhuanye) {
-        if (this.peibishu.hasOwnProperty(zhuanye)) {
-            return this.peibishu[zhuanye];
-        }
-        const response = await fetch(this.ip().concat( "/pbs/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                    "value": zhuanye
-                }
-            )
+        
+        const response = await fetch(this.ip().concat( "/pbs/").concat(zhuanye.toString()), {
+            method : "GET",
+            
         });
         if (!response.ok) {
             //const error = await response.json();
             console.error('error');
         } else {
             const data = await response.json();
-            this.peibishu[zhuanye] = data;
+            
             return data;
         }
     }
     async generateDingeshu(value) {
-        if (this.dingeshu.hasOwnProperty(value)) {
-            return this.dingeshu[value];
-        }
-        const response = await fetch(this.ip().concat( "/des/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                    "value": value
-                }
-            )
+        
+        const response = await fetch(this.ip().concat( "/des/").concat(value.toString()), {
+            method : "GET",
+            
         });
         if (!response.ok) {
             //const error = await response.json();
             console.error('error');
         } else {
             const data = await response.json();
-            this.dingeshu[value] = data;
+            
             return data;
         }
     }
     async generateDingeXilie(value, id) {//定额书的一个栏目的所有具体定额
-        const response = await fetch(this.ip().concat("/dexilie/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                    "value": value,
-                    "id": id
-                }
-            )
+        const response = await fetch(this.ip().concat("/dexilie/").concat(value.toString()).concat("/").concat(id), {
+            method : "GET",
+            
         });
         if (!response.ok) {
             //const error = await response.json();
@@ -727,17 +684,9 @@ async generateQingdanTuijian(name, bh, bt, bm) {
         }
     }
     async generateSingleDingeXilie(zhuanye, debh) {//清单页面展示用
-        const response = await fetch(this.ip().concat( "/singledexilie/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                    "debh": debh,
-                    "zhuanye": zhuanye
-                }
-            )
+        const response = await fetch(this.ip().concat( "/singledexilie/").concat(zhuanye.toString()).concat("/").concat(debh), {
+            method : "GET",
+           
         });
         if (!response.ok) {
             //const error = await response.json();
@@ -901,15 +850,8 @@ async generateQingdanTuijian(name, bh, bt, bm) {
     async cankao() { //参考费率
        
         const response = await fetch(this.ip().concat( "/cankao/"), {
-            method : "POST",
-            headers: {
-                "Content-type": "application/json"
-            },
-            body: JSON.stringify(
-                {
-                  
-                }
-            )
+            method : "GET",
+            
         });
         if (!response.ok) {
             //const error = await response.json();

+ 1 - 1
src/Zjcs2.js

@@ -214,7 +214,7 @@ export default function Zjcs2({name, bh, zjcsCallback}) {
         while(row.modules.dataTree.parent) {
           row = row.modules.dataTree.parent;
         }
-        if (row.data['名称'].includes('安全文明施工')) return false;
+        if (row.data['名称'] != null && row.data['名称'].includes('安全文明施工')) return false;
     
         return true; // only allow the name cell to be edited if the age is over 18
     }

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
src/tabulator_modern.css.map


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff