浏览代码

删除无用方法

haojianlong 4 年之前
父节点
当前提交
68a58ad989
共有 1 个文件被更改,包括 0 次插入341 次删除
  1. 0 341
      src/utils/handsontable/notShow.js

+ 0 - 341
src/utils/handsontable/notShow.js

@@ -150,9 +150,6 @@ const mapToArr = () => {
 }
 const showTools = {
   inputModeArr: mapToArr(),
-  addArr: () => {
-    return cutArr
-  },
   cantShow: (code) => {
     let falg = true
     cantShow.map(item => {
@@ -171,16 +168,6 @@ const showTools = {
     })
     return flag
   },
-  //几种类型不显示
-  technologyParam: (item) => {
-    if (
-      item.firstTag == "控制参数" &&
-      item.firstTag == "设定参数" &&
-      item.firstTag == "运行参数"
-    ) {
-      return undefined
-    }
-  },
   isShow: (code) => {
     let falg = true
     noShowArr.map(item => {
@@ -190,41 +177,6 @@ const showTools = {
     })
     return falg
   },
-  //插入需要的关系
-  insertionRea: (data) => {
-    cutArr.map(item => {
-      data.splice(item.num, 0, item.name)
-    })
-    return data
-  },
-
-  insertionRea2: (data) => {
-    newData.map(item => {
-      data.splice(item.num, 0, item.name)
-    })
-    return data
-  },
-
-  insertionType: (data, callback) => {
-    cutArr.map(item => {
-      data.splice(item.num, 0, {
-        data: "infos." + item.code,
-        renderer: callback,
-        readOnly: false
-      })
-    })
-    return data
-  },
-  insertionType2: (data, callback) => {
-    newData.map(item => {
-      data.splice(item.num, 0, {
-        data: "infos." + item.code,
-        renderer: callback,
-        readOnly: false
-      })
-    })
-    return data
-  },
   arrToArr(arr, showType) {
     let first = 0,
       scound = 0,
@@ -485,7 +437,6 @@ const showTools = {
     }).filter(item => item);
     return data
   },
-
   changeHeader(arr, readArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
     let data = arr.map(item => {
       if (falg) {
@@ -524,298 +475,6 @@ const showTools = {
     }).filter(d => d);
     return data
   },
-
-  showHeaderTypes(arr, typeArr, onlyRead, isWatch, allMess, falg = false) {
-    let data = arr.map(item => {
-      if (falg) {
-        if (item.firstTag == "控制参数" ||
-          item.firstTag == "设定参数" ||
-          item.firstTag == "运行参数") {
-          return undefined
-        }
-      }
-      if (item.code == "BIMLocation") {
-        return undefined
-      }
-      if (onlyRead || inputModeArr.indexOf(item.inputMode) > -1) {
-        if (item.Visible || !allMess) {
-          //固定不显示的code
-          if (!showTools.cantShow(item.code) && !onlyRead) {
-            return undefined
-          }
-
-          if (!showTools.isShow(item.code)) {
-            if (isWatch && !onlyRead) {
-              return undefined
-            }
-          }
-
-          if (item.code == "EquipQRCode") {
-            return {
-              data: item.Path,
-              renderer: text.lookQRCode,
-              readOnly: onlyRead
-            }
-          }
-
-          //图片类型
-          if (
-            item.code == "InstallPic" ||
-            item.code == "Nameplate" ||
-            item.code == "Pic"
-          ) {
-            return {
-              data: item.Path,
-              renderer: text.picType,
-              readOnly: onlyRead
-            }
-          }
-
-          //文件类型
-          if (item.code == "InsuranceFile" ||
-            item.code == "Archive" ||
-            item.code == "CheckReport" ||
-            item.code == "MaintainManual" ||
-            item.code == "ApproachingAcceptance" ||
-            item.code == "AcceptanceReport" ||
-            item.code == "OperationManual" ||
-            item.code == "OriginalCertificate" ||
-            item.code == "TestReport" ||
-            item.code == "ProductCertification" ||
-            item.code == "InstallInstruction" ||
-            item.code == "SupplierContract" ||
-            item.code == "Drawing" ||
-            item.code == "InstallDrawing"
-          ) {
-            return {
-              data: item.Path,
-              renderer: text.fileType,
-              readOnly: onlyRead
-            }
-          }
-
-          if (item.inputMode == "D1" || item.inputMode == "E1") { //单选
-            return {
-              data: item.Path,
-              renderer: tools.customDropdownRenderer,
-              editor: "chosen",
-              readOnly: onlyRead,
-              chosenOptions: {
-                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
-              }
-            };
-          } else if (item.inputMode == "D2") {
-            return {
-              data: item.Path,
-              renderer: tools.customDropdownRenderer,
-              editor: "chosen",
-              readOnly: onlyRead,
-              chosenOptions: {
-                multiple: true, //多选
-                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
-              }
-            };
-          } else if (item.inputMode == "A1" || item.inputMode == "A2") {
-            return {
-              data: item.Path,
-              type: "numeric",
-              readOnly: onlyRead,
-              numericFormat: {
-                pattern: "0,0.00"
-              }
-            };
-          } else if (item.inputMode == "C5") {
-            return {
-              data: item.Path,
-              type: "date",
-              dateFormat: "YYYY-MM-DD",
-              readOnly: onlyRead,
-              correctFormat: true
-            };
-          } else if (item.inputMode == "Own" && !onlyRead) {
-            return {
-              data: item.Path,
-              renderer: text.idType,
-              readOnly: onlyRead
-            }
-          } else {
-            return {
-              data: item.Path,
-              readOnly: onlyRead
-            };
-          }
-        } else {
-          return undefined
-        }
-      } else {
-        return undefined
-      }
-    }).filter(item => item);
-    return data
-  },
-
-  tableHeadFilter(arr, readArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
-    if (!taizhang) {
-      arr = showTools.arrToArr(arr)
-    }
-    let data = arr.map(item => {
-      if (falg) {
-        if (item.firstTag == "控制参数" ||
-          item.firstTag == "设定参数" ||
-          item.firstTag == "运行参数") {
-          return undefined
-        }
-      }
-
-      if (item.code == "BIMLocation") {
-        return undefined
-      }
-      if (onlyRead || inputModeArr.indexOf(item.inputMode) > -1) {
-        if (item.Visible || !allMess) {
-          if (!showTools.fixedNoShowField(partsAddNoShow, item.code) && !onlyRead && !taizhang) {
-            return undefined
-          }
-          if (!showTools.isShow(item.code) && !taizhang) {
-            if (isWatch && !onlyRead) {
-              return undefined
-            }
-          }
-          if (!item.Unit || item.Unit == "") {
-            return item.InfoPointName;
-          } else {
-            return item.InfoPointName + "(" + item.Unit + ")";
-          }
-        } else {
-          return undefined
-        }
-      } else {
-        return undefined;
-      }
-    }).filter(d => d);
-    return data
-  },
-  tableHeaderTypes(arr, typeArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
-    if (!taizhang) {
-      arr = showTools.arrToArr(arr)
-    }
-    let data = arr.map(item => {
-      if (falg) {
-        if (item.firstTag == "控制参数" ||
-          item.firstTag == "设定参数" ||
-          item.firstTag == "运行参数") {
-          return undefined
-        }
-      }
-      if (item.Path == "BIMLocation") {
-        return undefined
-      }
-      if (onlyRead || inputModeArr.indexOf(item.inputMode) > -1) {
-        if (item.Visible || !allMess) {
-          //固定不显示的code
-          if (!showTools.fixedNoShowField(partsAddNoShow, item.code) && !onlyRead && !taizhang) {
-            return undefined
-          }
-          if (!showTools.isShow(item.code) && !taizhang) {
-            if (isWatch && !onlyRead) {
-              return undefined
-            }
-          }
-          if (item.code == "EquipQRCode") {
-            return {
-              data: item.Path,
-              renderer: text.lookQRCode,
-              readOnly: onlyRead
-            }
-          }
-          //图片类型
-          if (
-            item.code == "InstallPic" ||
-            item.code == "Nameplate" ||
-            item.code == "Pic"
-          ) {
-            return {
-              data: item.Path,
-              renderer: text.picType,
-              readOnly: onlyRead
-            }
-          }
-
-          //文件类型
-          if (item.code == "InsuranceFile" ||
-            item.code == "Archive" ||
-            item.code == "CheckReport" ||
-            item.code == "MaintainManual" ||
-            item.code == "ApproachingAcceptance" ||
-            item.code == "AcceptanceReport" ||
-            item.code == "OperationManual" ||
-            item.code == "OriginalCertificate" ||
-            item.code == "TestReport" ||
-            item.code == "ProductCertification" ||
-            item.code == "InstallInstruction" ||
-            item.code == "SupplierContract" ||
-            item.code == "Drawing" ||
-            item.code == "InstallDrawing"
-          ) {
-            return {
-              data: item.Path,
-              renderer: text.fileType,
-              readOnly: onlyRead
-            }
-          }
-
-          if (item.inputMode == "D1" || item.inputMode == "E1") { //单选
-            return {
-              data: item.Path,
-              renderer: tools.customDropdownRenderer,
-              editor: "chosen",
-              readOnly: onlyRead,
-              chosenOptions: {
-                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
-              }
-            };
-          } else if (item.inputMode == "D2") {
-            return {
-              data: item.Path,
-              renderer: tools.customDropdownRenderer,
-              editor: "chosen",
-              readOnly: onlyRead,
-              chosenOptions: {
-                multiple: true, //多选
-                data: item.dataSource ? tools.formatDataSource(item.dataSource) : ""
-              }
-            };
-          } else if (item.inputMode == "A1" || item.inputMode == "A2") {
-            return {
-              data: item.Path,
-              type: "numeric",
-              readOnly: onlyRead,
-              numericFormat: {
-                pattern: "0,0.00"
-              }
-            };
-          } else if (item.inputMode == "C5") {
-            return {
-              data: item.Path,
-              type: "date",
-              dateFormat: "YYYY-MM-DD",
-              readOnly: onlyRead,
-              correctFormat: true
-            };
-          } else {
-            return {
-              data: item.Path,
-              readOnly: onlyRead
-            };
-          }
-        } else {
-          return undefined
-        }
-      } else {
-        return undefined
-      }
-    }).filter(item => item);
-    return data
-  },
   /**
    *
    * @param {*} arr 原始表头数组