notShow.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. // 不显示的信息点数组
  2. import text from "@/utils/handsontable/mainText"
  3. import tools from "@/utils/scan/tools"
  4. let InputModeArr = ["A1", "A2", "B1", "C5", "D1", "D2", "E1", "L", "L1", "L2", "F1", "F2", "M", "Own"]
  5. //在编辑模式下并且勾选隐藏自动填充的信息点不显示的字段
  6. let noShowArr = [
  7. "Brand",
  8. "Specification",
  9. "Manufacturer",
  10. "Supplier",
  11. "SupplierContactor",
  12. "SupplierPhone",
  13. "SupplierEmail",
  14. "SupplierWeb",
  15. "SupplierFax",
  16. "Maintainer",
  17. "MaintainerContactor",
  18. "MaintainerPhone",
  19. "MaintainerEmail",
  20. "MaintainerWeb",
  21. "Principal",
  22. "MaintainerFax",
  23. "Insurer",
  24. "InsurerContactor",
  25. "InsurerPhone",
  26. "InsurerEmail",
  27. "InsurerWeb",
  28. "InsurerFax",
  29. "InsuranceFile",
  30. "EquipID",
  31. "EquipName",
  32. ]
  33. //在编辑模式下不显示的字段
  34. let cantShow = [
  35. "EquipQRCode",
  36. "EquipID",
  37. "EquipName",
  38. "BIMLocation",
  39. "Brand",
  40. "Specification",
  41. "Manufacturer",
  42. "Supplier",
  43. "SupplierContactor",
  44. "SupplierPhone",
  45. "SupplierEmail",
  46. "SupplierWeb",
  47. "SupplierFax",
  48. "Maintainer",
  49. "MaintainerContactor",
  50. "MaintainerPhone",
  51. "MaintainerEmail",
  52. "MaintainerWeb",
  53. "Principal",
  54. "MaintainerFax",
  55. "Insurer",
  56. "InsurerContactor",
  57. "InsurerPhone",
  58. "InsurerEmail",
  59. "InsurerWeb",
  60. "InsurerFax",
  61. "InsuranceFile",
  62. "EquipID",
  63. "EquipName",
  64. "SpaceCount",
  65. "SpaceList",
  66. "TenantID",
  67. "ShaftID"
  68. ]
  69. let cutArr = [{
  70. name: "品牌型号",
  71. code: "DPManufacturerID",
  72. num: 2,
  73. }, {
  74. name: "供应商信息",
  75. code: "DPSupplierID",
  76. num: 5
  77. }, {
  78. name: "维修商信息",
  79. code: "DPMaintainerID",
  80. num: 19
  81. }, {
  82. name: "保险公司信息",
  83. code: "DPInsurerID",
  84. num: 25
  85. }]
  86. let newData = [{
  87. name: "品牌型号",
  88. code: "DPManufacturerID",
  89. num: 2,
  90. }, {
  91. name: "供应商信息",
  92. code: "DPSupplierID",
  93. num: 8
  94. }, {
  95. name: "维修商信息",
  96. code: "DPMaintainerID",
  97. num: 35
  98. }, {
  99. name: "保险公司信息",
  100. code: "DPInsurerID",
  101. num: 42
  102. }]
  103. //创建部件固定不显示-管理部件固定不显示(即编辑模式)
  104. let partsAddNoShow = [
  105. 'EquipID',
  106. 'EquipName',
  107. 'EquipQRCode',
  108. 'BIMID',
  109. 'BIMLocation',
  110. 'Brand',
  111. 'Specification',
  112. 'Manufacturer',
  113. 'Supplier',
  114. 'SupplierContactor',
  115. 'SupplierPhone',
  116. 'SupplierEmail',
  117. 'SupplierWeb',
  118. 'SupplierFax',
  119. 'Maintainer',
  120. 'MaintainerContactor',
  121. 'MaintainerPhone',
  122. 'MaintainerEmail',
  123. 'MaintainerWeb',
  124. 'MaintainerFax',
  125. 'Insurer',
  126. "InsurerContactor",
  127. "InsurerPhone",
  128. "InsurerEmail",
  129. "InsurerWeb",
  130. "InsurerFax",
  131. ]
  132. const showTools = {
  133. addArr: () => {
  134. return cutArr
  135. },
  136. cantShow: (code) => {
  137. let falg = true
  138. cantShow.map(item => {
  139. if (item == code) {
  140. falg = false
  141. }
  142. })
  143. return falg
  144. },
  145. fixedNoShowField: (noShowList, code) => {
  146. let flag = true
  147. noShowList.map(item => {
  148. if (item == code) {
  149. flag = false
  150. }
  151. })
  152. return flag
  153. },
  154. //几种类型不显示
  155. technologyParam: (item) => {
  156. if (
  157. item.FirstTag == "控制参数" &&
  158. item.FirstTag == "设定参数" &&
  159. item.FirstTag == "运行参数"
  160. ) {
  161. return undefined
  162. }
  163. },
  164. isShow: (code) => {
  165. let falg = true
  166. noShowArr.map(item => {
  167. if (item == code) {
  168. falg = false
  169. }
  170. })
  171. return falg
  172. },
  173. //插入需要的关系
  174. insertionRea: (data) => {
  175. cutArr.map(item => {
  176. data.splice(item.num, 0, item.name)
  177. })
  178. return data
  179. },
  180. insertionRea2: (data) => {
  181. newData.map(item => {
  182. data.splice(item.num, 0, item.name)
  183. })
  184. return data
  185. },
  186. insertionType: (data, callback) => {
  187. cutArr.map(item => {
  188. data.splice(item.num, 0, {
  189. data: "infos." + item.code,
  190. renderer: callback,
  191. readOnly: false
  192. })
  193. })
  194. return data
  195. },
  196. insertionType2: (data, callback) => {
  197. newData.map(item => {
  198. data.splice(item.num, 0, {
  199. data: "infos." + item.code,
  200. renderer: callback,
  201. readOnly: false
  202. })
  203. })
  204. return data
  205. },
  206. arrToArr(arr) {
  207. let first = 0,
  208. scound = 0,
  209. three = 0,
  210. four = 0
  211. arr.find(function(value, index, arr) {
  212. if (
  213. (value.InfoPointName == "品牌" ||
  214. value.InfoPointName == "设备型号" ||
  215. value.InfoPointName == "生产厂家") && !first
  216. ) {
  217. first = index
  218. }
  219. if (
  220. (value.InfoPointName == "供应商单位名称" ||
  221. value.InfoPointName == "供应商联系人" ||
  222. value.InfoPointName == "供应商电子邮件" ||
  223. value.InfoPointName == "供应商网址" ||
  224. value.InfoPointName == "供应商传真" ||
  225. value.InfoPointName == "供应商联系电话") && !scound
  226. ) {
  227. scound = index
  228. }
  229. if (
  230. (value.InfoPointName == "维修商单位名称" ||
  231. value.InfoPointName == "维修商联系人" ||
  232. value.InfoPointName == "维修商联系电话" ||
  233. value.InfoPointName == "维修商电子邮件" ||
  234. value.InfoPointName == "维修商网址" ||
  235. value.InfoPointName == "维修商传真") && !three
  236. ) {
  237. three = index
  238. }
  239. if (
  240. (value.InfoPointName == "保险公司名称" ||
  241. value.InfoPointName == "保险公司联系人" ||
  242. value.InfoPointName == "保险公司联系电话" ||
  243. value.InfoPointName == "保险公司电子邮件" ||
  244. value.InfoPointName == "保险公司网址" ||
  245. value.InfoPointName == "保险公司传真") && !four
  246. ) {
  247. four = index
  248. }
  249. })
  250. let numList = [first, scound, three, four]
  251. numList.reverse().map((item, index) => {
  252. if (!!item) {
  253. if (index == 0) {
  254. arr.splice(item, 0, {
  255. InfoPointName: "保险公司信息",
  256. InfoPointCode: "DPInsurerID",
  257. Path: 'DPInsurerID',
  258. InputMode: "Own",
  259. Unit: "",
  260. SecondTag: "",
  261. FirstTag: "",
  262. Visible: true,
  263. })
  264. } else if (index == 1) {
  265. arr.splice(item, 0, {
  266. InfoPointName: "维修商信息",
  267. InfoPointCode: "DPMaintainerID",
  268. Path: 'DPMaintainerID',
  269. InputMode: "Own",
  270. Unit: "",
  271. SecondTag: "",
  272. FirstTag: "",
  273. Visible: true,
  274. })
  275. } else if (index == 2) {
  276. arr.splice(item, 0, {
  277. InfoPointName: "供应商信息",
  278. InfoPointCode: "DPSupplierID",
  279. Path: 'DPSupplierID',
  280. InputMode: "Own",
  281. Unit: "",
  282. SecondTag: "",
  283. FirstTag: "",
  284. Visible: true,
  285. })
  286. } else if (index == 3) {
  287. arr.splice(item, 0, {
  288. InfoPointName: "品牌型号",
  289. InfoPointCode: "DPManufacturerID",
  290. Path: 'DPManufacturerID',
  291. InputMode: "Own",
  292. Unit: "",
  293. SecondTag: "",
  294. FirstTag: "",
  295. Visible: true,
  296. })
  297. }
  298. }
  299. })
  300. return arr
  301. },
  302. changeTypes(arr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
  303. let data = arr.map(item => {
  304. if (falg) {
  305. if (item.FirstTag == "控制参数" ||
  306. item.FirstTag == "设定参数" ||
  307. item.FirstTag == "运行参数") {
  308. return undefined
  309. }
  310. }
  311. if (item.InfoPointCode == "BIMLocation") {
  312. return undefined
  313. }
  314. if (item.Visible || !allMess) {
  315. //固定不显示的code
  316. if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
  317. return undefined
  318. }
  319. if (!showTools.isShow(item.InfoPointCode) && !taizhang && !taizhang) {
  320. if (isWatch && !onlyRead) {
  321. return undefined
  322. }
  323. }
  324. if (item.InfoPointCode == "EquipQRCode") {
  325. return {
  326. data: "Infos." + item.InfoPointCode,
  327. renderer: text.lookQRCode,
  328. readOnly: true
  329. }
  330. }
  331. if (item.InputMode == "D1") {
  332. return {
  333. data: "Infos." + item.InfoPointCode,
  334. renderer: tools.customDropdownRenderer,
  335. editor: "chosen",
  336. chosenOptions: {
  337. // multiple: true,//多选
  338. data: item.DataSource || ""
  339. }
  340. };
  341. } else if (item.InputMode == "A1" || item.InputMode == "A2") {
  342. return {
  343. data: "Infos." + item.InfoPointCode,
  344. type: "numeric",
  345. numericFormat: {
  346. pattern: "0,0.00"
  347. // culture: 'de-DE' // use this for EUR (German),
  348. // more cultures available on http://numbrojs.com/languages.html
  349. }
  350. };
  351. } else if (item.InputMode == "C5") {
  352. return {
  353. data: "Infos." + item.InfoPointCode,
  354. type: "date",
  355. dateFormat: "YYYY-MM-DD",
  356. correctFormat: true
  357. };
  358. } else if (
  359. item.InputMode == "B1" ||
  360. item.InputMode == "L" ||
  361. item.InputMode == "L1" ||
  362. item.InputMode == "L2" ||
  363. item.InputMode == "M"
  364. ) {
  365. return {
  366. data: "Infos." + item.InfoPointCode
  367. };
  368. } else if (
  369. item.InputMode == "X"
  370. // item.InputMode == "L1" ||
  371. // item.InputMode == "L2"
  372. ) {
  373. // return undefined
  374. return {
  375. data: "Infos." + item.InfoPointCode,
  376. readOnly: true
  377. };
  378. } else if (item.InputMode == "D2") {
  379. return {
  380. data: "Infos." + item.InfoPointCode,
  381. renderer: tools.customDropdownRenderer,
  382. editor: "chosen",
  383. chosenOptions: {
  384. multiple: true, //多选
  385. data: item.DataSource || ""
  386. }
  387. };
  388. } else if (item.InputMode == "Own" && !onlyRead) {
  389. return {
  390. data: "Infos." + item.InfoPointCode,
  391. renderer: text.idType,
  392. }
  393. } else {
  394. return undefined;
  395. }
  396. } else {
  397. return undefined
  398. }
  399. }).filter(item => item);
  400. return data
  401. },
  402. showTypes(arr, onlyRead, isWatch, allMess, falg = false, typeArr = false) {
  403. let data = arr.map(item => {
  404. if (falg) {
  405. if (item.FirstTag == "控制参数" ||
  406. item.FirstTag == "设定参数" ||
  407. item.FirstTag == "运行参数") {
  408. return undefined
  409. }
  410. }
  411. if (item.InfoPointCode == "BIMLocation") {
  412. return undefined
  413. }
  414. if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
  415. if (item.Visible || !allMess) {
  416. //固定不显示的code
  417. if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
  418. return undefined
  419. }
  420. if (!showTools.isShow(item.InfoPointCode)) {
  421. if (isWatch && !onlyRead) {
  422. return undefined
  423. }
  424. }
  425. if (item.InfoPointCode == "EquipQRCode" || item.InfoPointCode == "RoomQRCode") {
  426. return {
  427. data: "infos." + item.InfoPointCode,
  428. renderer: text.lookQRCode,
  429. readOnly: true
  430. }
  431. }
  432. //图片类型
  433. if (
  434. item.InfoPointCode == "InstallPic" ||
  435. item.InfoPointCode == "InstallDrawing" ||
  436. item.InfoPointCode == "Nameplate" ||
  437. item.InfoPointCode == "Pic" ||
  438. item.InfoPointCode == "Drawing"
  439. ) {
  440. return {
  441. data: "infos." + item.InfoPointCode,
  442. renderer: text.picType,
  443. readOnly: true
  444. }
  445. }
  446. //文件类型
  447. if (item.InfoPointCode == "InsuranceFile" ||
  448. item.InfoPointCode == "Archive" ||
  449. item.InfoPointCode == "CheckReport") {
  450. return {
  451. data: "infos." + item.InfoPointCode,
  452. renderer: text.fileType,
  453. readOnly: true
  454. }
  455. }
  456. if (item.InputMode == "D1") {
  457. return {
  458. data: "infos." + item.InfoPointCode,
  459. renderer: tools.customDropdownRenderer,
  460. editor: "chosen",
  461. chosenOptions: {
  462. // multiple: true,//多选
  463. data: item.DataSource || ""
  464. }
  465. };
  466. } else if (item.InputMode == "A1" || item.InputMode == "A2") {
  467. return {
  468. data: "infos." + item.InfoPointCode,
  469. type: "numeric",
  470. numericFormat: {
  471. pattern: "0,0.00"
  472. // culture: 'de-DE' // use this for EUR (German),
  473. // more cultures available on http://numbrojs.com/languages.html
  474. }
  475. };
  476. } else if (item.InputMode == "C5") {
  477. return {
  478. data: "infos." + item.InfoPointCode,
  479. type: "date",
  480. dateFormat: "YYYY-MM-DD",
  481. correctFormat: true
  482. };
  483. } else if (
  484. item.InputMode == "B1" ||
  485. item.InputMode == "L" ||
  486. item.InputMode == "L1" ||
  487. item.InputMode == "L2" ||
  488. item.InputMode == "M"
  489. ) {
  490. return {
  491. data: "infos." + item.InfoPointCode
  492. }
  493. } else if (
  494. item.InputMode == "X" ||
  495. item.InputMode == "F2"
  496. ) {
  497. return {
  498. data: "infos." + item.InfoPointCode,
  499. readOnly: true
  500. };
  501. } else if (item.InputMode == "D2") {
  502. return {
  503. data: "infos." + item.InfoPointCode,
  504. renderer: tools.customDropdownRenderer,
  505. editor: "chosen",
  506. chosenOptions: {
  507. multiple: true, //多选
  508. data: item.DataSource || ""
  509. }
  510. };
  511. } else if (item.InputMode == "Own" && !onlyRead) {
  512. return {
  513. data: "infos." + item.InfoPointCode,
  514. renderer: text.idType,
  515. }
  516. } else {
  517. return {
  518. data: "infos." + item.InfoPointCode
  519. }
  520. }
  521. } else {
  522. return undefined
  523. }
  524. } else {
  525. return undefined
  526. }
  527. }).filter(item => item);
  528. return data
  529. },
  530. changeHeader(arr, readArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
  531. let data = arr.map(item => {
  532. if (falg) {
  533. if (item.FirstTag == "控制参数" ||
  534. item.FirstTag == "设定参数" ||
  535. item.FirstTag == "运行参数") {
  536. return undefined
  537. }
  538. }
  539. if (item.InfoPointCode == "BIMLocation") {
  540. return undefined
  541. }
  542. if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
  543. if (item.Visible || !allMess) {
  544. if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
  545. return undefined
  546. }
  547. if (!showTools.isShow(item.InfoPointCode) && !taizhang) {
  548. if (isWatch && !onlyRead) {
  549. return undefined
  550. }
  551. }
  552. if (!item.Unit || item.Unit == "") {
  553. return item.InfoPointName;
  554. } else {
  555. return item.InfoPointName + "(" + item.Unit + ")";
  556. }
  557. } else {
  558. return undefined
  559. }
  560. } else {
  561. return undefined
  562. }
  563. }).filter(d => d);
  564. return data
  565. },
  566. showHeaderTypes(arr, typeArr, onlyRead, isWatch, allMess, falg = false) {
  567. let data = arr.map(item => {
  568. if (falg) {
  569. if (item.FirstTag == "控制参数" ||
  570. item.FirstTag == "设定参数" ||
  571. item.FirstTag == "运行参数") {
  572. return undefined
  573. }
  574. }
  575. if (item.InfoPointCode == "BIMLocation") {
  576. return undefined
  577. }
  578. if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
  579. if (item.Visible || !allMess) {
  580. //固定不显示的code
  581. if (!showTools.cantShow(item.InfoPointCode) && !onlyRead) {
  582. return undefined
  583. }
  584. if (!showTools.isShow(item.InfoPointCode)) {
  585. if (isWatch && !onlyRead) {
  586. return undefined
  587. }
  588. }
  589. if (item.InfoPointCode == "EquipQRCode") {
  590. return {
  591. data: item.Path,
  592. renderer: text.lookQRCode,
  593. readOnly: onlyRead
  594. }
  595. }
  596. //图片类型
  597. if (
  598. item.InfoPointCode == "InstallPic" ||
  599. item.InfoPointCode == "InstallDrawing" ||
  600. item.InfoPointCode == "Nameplate" ||
  601. item.InfoPointCode == "Pic" ||
  602. item.InfoPointCode == "Drawing"
  603. ) {
  604. return {
  605. data: item.Path,
  606. renderer: text.picType,
  607. readOnly: onlyRead
  608. }
  609. }
  610. //文件类型
  611. if (item.InfoPointCode == "InsuranceFile" ||
  612. item.InfoPointCode == "Archive" ||
  613. item.InfoPointCode == "CheckReport") {
  614. return {
  615. data: item.Path,
  616. renderer: text.fileType,
  617. readOnly: onlyRead
  618. }
  619. }
  620. if (item.InputMode == "D1" || item.InputMode == "E1") { //单选
  621. return {
  622. data: item.Path,
  623. renderer: tools.customDropdownRenderer,
  624. editor: "chosen",
  625. readOnly: onlyRead,
  626. chosenOptions: {
  627. data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
  628. }
  629. };
  630. } else if (item.InputMode == "D2") {
  631. return {
  632. data: item.Path,
  633. renderer: tools.customDropdownRenderer,
  634. editor: "chosen",
  635. readOnly: onlyRead,
  636. chosenOptions: {
  637. multiple: true, //多选
  638. data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
  639. }
  640. };
  641. } else if (item.InputMode == "A1" || item.InputMode == "A2") {
  642. return {
  643. data: item.Path,
  644. type: "numeric",
  645. readOnly: onlyRead,
  646. numericFormat: {
  647. pattern: "0,0.00"
  648. // culture: 'de-DE' // use this for EUR (German),
  649. // more cultures available on http://numbrojs.com/languages.html
  650. }
  651. };
  652. } else if (item.InputMode == "C5") {
  653. return {
  654. data: item.Path,
  655. type: "date",
  656. dateFormat: "YYYY-MM-DD",
  657. readOnly: onlyRead,
  658. correctFormat: true
  659. };
  660. } else if (item.InputMode == "Own" && !onlyRead) {
  661. return {
  662. data: item.Path,
  663. renderer: text.idType,
  664. readOnly: onlyRead
  665. }
  666. } else {
  667. return {
  668. data: item.Path,
  669. readOnly: onlyRead
  670. };
  671. }
  672. } else {
  673. return undefined
  674. }
  675. } else {
  676. return undefined
  677. }
  678. }).filter(item => item);
  679. return data
  680. },
  681. tableHeadFilter(arr, readArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
  682. if (!taizhang) {
  683. arr = showTools.arrToArr(arr)
  684. }
  685. let data = arr.map(item => {
  686. if (falg) {
  687. if (item.FirstTag == "控制参数" ||
  688. item.FirstTag == "设定参数" ||
  689. item.FirstTag == "运行参数") {
  690. return undefined
  691. }
  692. }
  693. if (item.InfoPointCode == "BIMLocation") {
  694. return undefined
  695. }
  696. if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
  697. if (item.Visible || !allMess) {
  698. if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
  699. return undefined
  700. }
  701. if (!showTools.isShow(item.InfoPointCode) && !taizhang) {
  702. if (isWatch && !onlyRead) {
  703. return undefined
  704. }
  705. }
  706. if (!item.Unit || item.Unit == "") {
  707. return item.InfoPointName;
  708. } else {
  709. return item.InfoPointName + "(" + item.Unit + ")";
  710. }
  711. } else {
  712. return undefined
  713. }
  714. } else {
  715. return undefined;
  716. }
  717. }).filter(d => d);
  718. return data
  719. },
  720. tableHeaderTypes(arr, typeArr, onlyRead, isWatch, allMess, falg = false, taizhang = false) {
  721. if (!taizhang) {
  722. arr = showTools.arrToArr(arr)
  723. }
  724. let data = arr.map(item => {
  725. if (falg) {
  726. if (item.FirstTag == "控制参数" ||
  727. item.FirstTag == "设定参数" ||
  728. item.FirstTag == "运行参数") {
  729. return undefined
  730. }
  731. }
  732. if (item.Path == "BIMLocation") {
  733. return undefined
  734. }
  735. if (onlyRead || InputModeArr.indexOf(item.InputMode) > -1) {
  736. if (item.Visible || !allMess) {
  737. //固定不显示的code
  738. if (!showTools.fixedNoShowField(partsAddNoShow, item.InfoPointCode) && !onlyRead && !taizhang) {
  739. return undefined
  740. }
  741. if (!showTools.isShow(item.InfoPointCode) && !taizhang) {
  742. if (isWatch && !onlyRead) {
  743. return undefined
  744. }
  745. }
  746. if (item.InfoPointCode == "EquipQRCode") {
  747. return {
  748. data: item.Path,
  749. renderer: text.lookQRCode,
  750. readOnly: onlyRead
  751. }
  752. }
  753. //图片类型
  754. if (
  755. item.InfoPointCode == "InstallPic" ||
  756. item.InfoPointCode == "InstallDrawing" ||
  757. item.InfoPointCode == "Nameplate" ||
  758. item.InfoPointCode == "Pic" ||
  759. item.InfoPointCode == "Drawing"
  760. ) {
  761. return {
  762. data: item.Path,
  763. renderer: text.picType,
  764. readOnly: onlyRead
  765. }
  766. }
  767. //文件类型
  768. if (item.InfoPointCode == "InsuranceFile" ||
  769. item.InfoPointCode == "Archive" ||
  770. item.InfoPointCode == "CheckReport") {
  771. return {
  772. data: item.Path,
  773. renderer: text.fileType,
  774. readOnly: onlyRead
  775. }
  776. }
  777. if (item.InputMode == "D1" || item.InputMode == "E1") { //单选
  778. return {
  779. data: item.Path,
  780. renderer: tools.customDropdownRenderer,
  781. editor: "chosen",
  782. readOnly: onlyRead,
  783. chosenOptions: {
  784. data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
  785. }
  786. };
  787. } else if (item.InputMode == "D2") {
  788. return {
  789. data: item.Path,
  790. renderer: tools.customDropdownRenderer,
  791. editor: "chosen",
  792. readOnly: onlyRead,
  793. chosenOptions: {
  794. multiple: true, //多选
  795. data: item.DataSource ? tools.formatDataSource(item.DataSource) : ""
  796. }
  797. };
  798. } else if (item.InputMode == "A1" || item.InputMode == "A2") {
  799. return {
  800. data: item.Path,
  801. type: "numeric",
  802. readOnly: onlyRead,
  803. numericFormat: {
  804. pattern: "0,0.00"
  805. }
  806. };
  807. } else if (item.InputMode == "C5") {
  808. return {
  809. data: item.Path,
  810. type: "date",
  811. dateFormat: "YYYY-MM-DD",
  812. readOnly: onlyRead,
  813. correctFormat: true
  814. };
  815. } else if (item.InputMode == "Own" && !onlyRead) {
  816. return {
  817. data: item.Path,
  818. renderer: text.idType,
  819. readOnly: onlyRead
  820. }
  821. } else {
  822. return {
  823. data: item.Path,
  824. readOnly: onlyRead
  825. };
  826. }
  827. } else {
  828. return undefined
  829. }
  830. } else {
  831. return undefined
  832. }
  833. }).filter(item => item);
  834. return data
  835. },
  836. }
  837. export default showTools