notShow.js 30 KB

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