|
@@ -3,33 +3,33 @@ import text from "@/utils/handsontable/mainText"
|
|
|
import tools from "@/utils/scan/tools"
|
|
|
|
|
|
let noShowArr = [
|
|
|
- "Brand",
|
|
|
- "Specification",
|
|
|
- "Manufacturer",
|
|
|
- "Supplier",
|
|
|
- "SupplierContactor",
|
|
|
- "SupplierPhone",
|
|
|
- "SupplierEmail",
|
|
|
- "SupplierWeb",
|
|
|
- "SupplierFax",
|
|
|
- "Maintainer",
|
|
|
- "MaintainerContactor",
|
|
|
- "MaintainerPhone",
|
|
|
- "MaintainerEmail",
|
|
|
- "MaintainerWeb",
|
|
|
- "Principal",
|
|
|
- "MaintainerFax",
|
|
|
- "Insurer",
|
|
|
- "InsurerContactor",
|
|
|
- "InsurerPhone",
|
|
|
- "InsurerEmail",
|
|
|
- "InsurerWeb",
|
|
|
- "InsurerFax",
|
|
|
- "InsuranceFile",
|
|
|
- "EquipID",
|
|
|
- "EquipName",
|
|
|
-]
|
|
|
-
|
|
|
+ "Brand",
|
|
|
+ "Specification",
|
|
|
+ "Manufacturer",
|
|
|
+ "Supplier",
|
|
|
+ "SupplierContactor",
|
|
|
+ "SupplierPhone",
|
|
|
+ "SupplierEmail",
|
|
|
+ "SupplierWeb",
|
|
|
+ "SupplierFax",
|
|
|
+ "Maintainer",
|
|
|
+ "MaintainerContactor",
|
|
|
+ "MaintainerPhone",
|
|
|
+ "MaintainerEmail",
|
|
|
+ "MaintainerWeb",
|
|
|
+ "Principal",
|
|
|
+ "MaintainerFax",
|
|
|
+ "Insurer",
|
|
|
+ "InsurerContactor",
|
|
|
+ "InsurerPhone",
|
|
|
+ "InsurerEmail",
|
|
|
+ "InsurerWeb",
|
|
|
+ "InsurerFax",
|
|
|
+ "InsuranceFile",
|
|
|
+ "EquipID",
|
|
|
+ "EquipName",
|
|
|
+ ]
|
|
|
+
|
|
|
let cantShow = [
|
|
|
"EquipQRCode",
|
|
|
"EquipID",
|
|
@@ -85,23 +85,51 @@ let cutArr = [{
|
|
|
}]
|
|
|
|
|
|
let newData = [{
|
|
|
- name: "品牌型号",
|
|
|
- code: "DPManufacturerID",
|
|
|
- num: 2,
|
|
|
-}, {
|
|
|
- name: "供应商信息",
|
|
|
- code: "DPSupplierID",
|
|
|
- num: 8
|
|
|
-}, {
|
|
|
- name: "维修商信息",
|
|
|
- code: "DPMaintainerID",
|
|
|
- num: 35
|
|
|
-}, {
|
|
|
- name: "保险公司信息",
|
|
|
- code: "DPInsurerID",
|
|
|
- num: 42
|
|
|
-}]
|
|
|
-
|
|
|
+ name: "品牌型号",
|
|
|
+ code: "DPManufacturerID",
|
|
|
+ num: 2,
|
|
|
+ }, {
|
|
|
+ name: "供应商信息",
|
|
|
+ code: "DPSupplierID",
|
|
|
+ num: 8
|
|
|
+ }, {
|
|
|
+ name: "维修商信息",
|
|
|
+ code: "DPMaintainerID",
|
|
|
+ num: 35
|
|
|
+ }, {
|
|
|
+ name: "保险公司信息",
|
|
|
+ code: "DPInsurerID",
|
|
|
+ num: 42
|
|
|
+ }]
|
|
|
+
|
|
|
+let partsAddNoShow = [
|
|
|
+ 'EquipID',
|
|
|
+ 'EquipName',
|
|
|
+ 'EquipQRCode',
|
|
|
+ 'BIMID',
|
|
|
+ 'BIMLocation',
|
|
|
+ 'Brand',
|
|
|
+ 'Specification',
|
|
|
+ 'Manufacturer',
|
|
|
+ 'Supplier',
|
|
|
+ 'SupplierContactor',
|
|
|
+ 'SupplierPhone',
|
|
|
+ 'SupplierEmail',
|
|
|
+ 'SupplierWeb',
|
|
|
+ 'SupplierFax',
|
|
|
+ 'Maintainer',
|
|
|
+ 'MaintainerContactor',
|
|
|
+ 'MaintainerPhone',
|
|
|
+ 'MaintainerEmail',
|
|
|
+ 'MaintainerWeb',
|
|
|
+ 'MaintainerFax',
|
|
|
+ 'Insurer',
|
|
|
+ "InsurerContactor",
|
|
|
+ "InsurerPhone",
|
|
|
+ "InsurerEmail",
|
|
|
+ "InsurerWeb",
|
|
|
+ "InsurerFax",
|
|
|
+]
|
|
|
const showTools = {
|
|
|
addArr: () => {
|
|
|
return cutArr
|
|
@@ -115,7 +143,15 @@ const showTools = {
|
|
|
})
|
|
|
return falg
|
|
|
},
|
|
|
-
|
|
|
+ fixedNoShowField: (noShowList, code) => {
|
|
|
+ let flag = true
|
|
|
+ noShowList.map(item => {
|
|
|
+ if (item == code) {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return flag
|
|
|
+ },
|
|
|
|
|
|
technologyParam: (item) => {
|
|
|
if (
|
|
@@ -222,6 +258,7 @@ const showTools = {
|
|
|
arr.splice(item, 0, {
|
|
|
InfoPointName: "保险公司信息",
|
|
|
InfoPointCode: "DPInsurerID",
|
|
|
+ Path: 'DPInsurerID',
|
|
|
InputMode: "Own",
|
|
|
Unit: "",
|
|
|
SecondTag: "",
|
|
@@ -232,6 +269,7 @@ const showTools = {
|
|
|
arr.splice(item, 0, {
|
|
|
InfoPointName: "维修商信息",
|
|
|
InfoPointCode: "DPMaintainerID",
|
|
|
+ Path: 'DPMaintainerID',
|
|
|
InputMode: "Own",
|
|
|
Unit: "",
|
|
|
SecondTag: "",
|
|
@@ -242,6 +280,7 @@ const showTools = {
|
|
|
arr.splice(item, 0, {
|
|
|
InfoPointName: "供应商信息",
|
|
|
InfoPointCode: "DPSupplierID",
|
|
|
+ Path: 'DPSupplierID',
|
|
|
InputMode: "Own",
|
|
|
Unit: "",
|
|
|
SecondTag: "",
|
|
@@ -252,6 +291,7 @@ const showTools = {
|
|
|
arr.splice(item, 0, {
|
|
|
InfoPointName: "品牌型号",
|
|
|
InfoPointCode: "DPManufacturerID",
|
|
|
+ Path: 'DPManufacturerID',
|
|
|
InputMode: "Own",
|
|
|
Unit: "",
|
|
|
SecondTag: "",
|
|
@@ -514,7 +554,7 @@ const showTools = {
|
|
|
if (item.InfoPointCode == "BIMLocation") {
|
|
|
return undefined
|
|
|
}
|
|
|
- if (!!readArr && readArr.indexOf(item.InputMode) > -1 ) {
|
|
|
+ if (onlyRead || (!!readArr && readArr.indexOf(item.InputMode) > -1)) {
|
|
|
if (item.Visible || !allMess) {
|
|
|
if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
|
|
|
return undefined
|
|
@@ -542,9 +582,6 @@ const showTools = {
|
|
|
|
|
|
showHeaderTypes(arr, typeArr, onlyRead, isWatch, allMess, falg = false) {
|
|
|
let data = arr.map(item => {
|
|
|
- if (item.FirstTag && !item.FirstTag == "") {
|
|
|
- item.InfoPointCode = `${item.FirstTag}.${item.InfoPointCode}`
|
|
|
- }
|
|
|
if (falg) {
|
|
|
if (item.FirstTag == "控制参数" ||
|
|
|
item.FirstTag == "设定参数" ||
|
|
@@ -555,27 +592,27 @@ const showTools = {
|
|
|
if (item.InfoPointCode == "BIMLocation") {
|
|
|
return undefined
|
|
|
}
|
|
|
- if (!!typeArr && typeArr.indexOf(item.InputMode) > -1) {
|
|
|
+ if (onlyRead || (!!typeArr && typeArr.indexOf(item.InputMode) > -1)) {
|
|
|
if (item.Visible || !allMess) {
|
|
|
|
|
|
if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
|
|
|
return undefined
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!showTools.isShow(item.InfoPointCode)) {
|
|
|
if (isWatch && !onlyRead) {
|
|
|
return undefined
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (item.InfoPointCode == "EquipQRCode") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: text.lookQRCode,
|
|
|
readOnly: onlyRead
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (
|
|
|
item.InfoPointCode == "InstallPic" ||
|
|
@@ -585,47 +622,47 @@ const showTools = {
|
|
|
item.InfoPointCode == "Drawing"
|
|
|
) {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: text.picType,
|
|
|
readOnly: onlyRead
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
if (item.InfoPointCode == "InsuranceFile" ||
|
|
|
item.InfoPointCode == "Archive" ||
|
|
|
item.InfoPointCode == "CheckReport") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: text.fileType,
|
|
|
readOnly: onlyRead
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (item.InputMode == "D1" || item.InputMode == "E1") {
|
|
|
+
|
|
|
+ if (item.InputMode == "D1" || item.InputMode == "E1") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: tools.customDropdownRenderer,
|
|
|
editor: "chosen",
|
|
|
readOnly: onlyRead,
|
|
|
chosenOptions: {
|
|
|
- data: item.DataSource? tools.formatDataSource(item.DataSource): ""
|
|
|
+ data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
|
|
|
}
|
|
|
};
|
|
|
} else if (item.InputMode == "D2") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: tools.customDropdownRenderer,
|
|
|
editor: "chosen",
|
|
|
readOnly: onlyRead,
|
|
|
chosenOptions: {
|
|
|
multiple: true,
|
|
|
- data: item.DataSource? tools.formatDataSource(item.DataSource): ""
|
|
|
+ data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
|
|
|
}
|
|
|
};
|
|
|
} else if (item.InputMode == "A1" || item.InputMode == "A2") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
type: "numeric",
|
|
|
readOnly: onlyRead,
|
|
|
numericFormat: {
|
|
@@ -636,7 +673,7 @@ const showTools = {
|
|
|
};
|
|
|
} else if (item.InputMode == "C5") {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
type: "date",
|
|
|
dateFormat: "YYYY-MM-DD",
|
|
|
readOnly: onlyRead,
|
|
@@ -644,13 +681,13 @@ const showTools = {
|
|
|
};
|
|
|
} else if (item.InputMode == "Own" && !onlyRead) {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
renderer: text.idType,
|
|
|
readOnly: onlyRead
|
|
|
}
|
|
|
} else {
|
|
|
return {
|
|
|
- data: item.InfoPointCode,
|
|
|
+ data: item.Path,
|
|
|
readOnly: onlyRead
|
|
|
};
|
|
|
}
|
|
@@ -662,7 +699,166 @@ const showTools = {
|
|
|
}
|
|
|
}).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.InfoPointCode == "BIMLocation") {
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
+ if (onlyRead || (!!readArr && readArr.indexOf(item.InputMode) > -1)) {
|
|
|
+ if (item.Visible || !allMess) {
|
|
|
+ if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
+ if (!showTools.isShow(item.InfoPointCode) && !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 || (!!typeArr && typeArr.indexOf(item.InputMode) > -1)) {
|
|
|
+ if (item.Visible || !allMess) {
|
|
|
+
|
|
|
+ if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
+ if (!showTools.isShow(item.InfoPointCode) && !taizhang) {
|
|
|
+ if (isWatch && !onlyRead) {
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.InfoPointCode == "EquipQRCode") {
|
|
|
+ return {
|
|
|
+ data: item.Path,
|
|
|
+ renderer: text.lookQRCode,
|
|
|
+ readOnly: onlyRead
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (
|
|
|
+ item.InfoPointCode == "InstallPic" ||
|
|
|
+ item.InfoPointCode == "InstallDrawing" ||
|
|
|
+ item.InfoPointCode == "Nameplate" ||
|
|
|
+ item.InfoPointCode == "Pic" ||
|
|
|
+ item.InfoPointCode == "Drawing"
|
|
|
+ ) {
|
|
|
+ return {
|
|
|
+ data: item.Path,
|
|
|
+ renderer: text.picType,
|
|
|
+ readOnly: onlyRead
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (item.InfoPointCode == "InsuranceFile" ||
|
|
|
+ item.InfoPointCode == "Archive" ||
|
|
|
+ item.InfoPointCode == "CheckReport") {
|
|
|
+ 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
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
export default showTools
|