addfacility.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <template>
  2. <div id="deviceList">
  3. <el-row class="right">
  4. <span style="float: left">当前选择的设备类型:{{ category.name }}</span>
  5. <el-select
  6. v-model="showType"
  7. @change="initTable"
  8. style="width: 125px; margin-right: 10px; vertical-align: bottom"
  9. >
  10. <el-option
  11. v-for="item in showTypes"
  12. :key="item.value"
  13. :label="item.label"
  14. :value="item.value"
  15. ></el-option>
  16. </el-select>
  17. <span>增加</span>
  18. <el-input-number
  19. v-model="addNum"
  20. :controls="false"
  21. style="width: 50px"
  22. :min="1"
  23. :max="50"
  24. ></el-input-number>
  25. <span>个{{ category.name }}</span>
  26. <el-button @click="handleAddTableRow">增加</el-button>
  27. </el-row>
  28. <div class="tableBox">
  29. <div
  30. class="center middle_sty"
  31. style="flex: 2"
  32. v-show="tableData && !tableData.length"
  33. >
  34. <p>
  35. <i class="icon-wushuju iconfont"></i>
  36. 暂无数据
  37. </p>
  38. </div>
  39. <div class="tableLeft" v-show="tableData && tableData.length">
  40. <handson-table ref="table"></handson-table>
  41. </div>
  42. </div>
  43. <el-row class="center">
  44. <el-button
  45. type="primary"
  46. size="medium"
  47. @click="handleCreateTableData"
  48. class="create_button"
  49. :disabled="createDisable"
  50. >创建设备</el-button
  51. >
  52. </el-row>
  53. <!-- 多选枚举类型维护 -->
  54. <menum
  55. :dialog="myDialog"
  56. :updateInfoData="updateInfoData"
  57. :updateInput="updateInput"
  58. @change="handleChangeMenum"
  59. ></menum>
  60. <!-- 二维码弹窗 -->
  61. <qrcode
  62. :dialog="myDialog"
  63. :qrcodeUrl="qrcodeUrl"
  64. :addBody="true"
  65. ref="qrcode"
  66. ></qrcode>
  67. <upload-files-dialog
  68. :read="onlyRead ? true : false"
  69. ref="upload"
  70. @changeFile="fileChange"
  71. :keysArr="filesArr"
  72. :dialog="myDialog"
  73. >
  74. </upload-files-dialog>
  75. <upload-img-dialog
  76. :read="onlyRead ? true : false"
  77. @changeFile="imgChange"
  78. :keysArr="imgsArr"
  79. :dialog="myDialog"
  80. ></upload-img-dialog>
  81. <pic-dialog
  82. :read="onlyRead ? true : false"
  83. :dialog="myDialog"
  84. :keysArr="picsArr"
  85. @change="changePics"
  86. ></pic-dialog>
  87. <system-type
  88. :device="category"
  89. :dialog="myDialog"
  90. :type="onlyRead ? 'read' : 'edit'"
  91. @change="changeSystemType"
  92. :list="systemList"
  93. ></system-type>
  94. <details-dialog
  95. :iframeSrc="iframeSrc"
  96. v-if="myDialog.details"
  97. :dialog="myDialog"
  98. ></details-dialog>
  99. </div>
  100. </template>
  101. <script>
  102. import tools from "@/utils/old-adm/scan/tools";
  103. import showTools from "@/utils/old-adm/handsontable/notShow";
  104. import text from "@/utils/old-adm/handsontable/mainText";
  105. import storage from "@/utils/storageUtil";
  106. import BuildController from "@/controller/old-adm/buildController";
  107. import handsonTable from "@/components/old-adm/common/handsontable";
  108. import ScanController from "@/controller/old-adm/ScanController";
  109. import Dic from "@/controller/old-adm/dicController";
  110. import { mapGetters } from "vuex";
  111. import qrcode from "@/components/old-adm/ledger/components/lib/qrcode";
  112. import uploadFilesDialog from "@/components/old-adm/dialogs/list/filesDialog";
  113. import uploadImgDialog from "@/components/old-adm/dialogs/list/uploadImgDialog";
  114. import picDialog from "@/components/old-adm/dialogs/list/picDialog";
  115. import menum from "@/components/old-adm/dialogs/list/menum";
  116. import systemType from "@/components/old-adm/dialogs/list/systemType";
  117. export default {
  118. components: {
  119. qrcode, //二维码页面
  120. uploadFilesDialog,
  121. uploadImgDialog,
  122. picDialog,
  123. systemType,
  124. handsonTable,
  125. menum,
  126. },
  127. data() {
  128. return {
  129. addNum: 1,
  130. onlyRead: false,
  131. showTypes: [
  132. { value: "Visible", label: "只看需交付的" },
  133. { value: "all", label: "全部" },
  134. ],
  135. tableHeader: [],
  136. // tableData: session.get("deviceAddData")
  137. // ? session.get("deviceAddData").length
  138. // ? session.get("deviceAddData")
  139. // : [{ checked: 1 }]
  140. // : [{ checked: 1 }],
  141. tableData: storage.get("deviceAddData")
  142. ? storage.get("deviceAddData").length
  143. ? storage.get("deviceAddData")
  144. : []
  145. : [],
  146. copyTableData: [],
  147. category: "", //当前设备类
  148. myDialog: {
  149. qrcode: false, //二维码弹窗
  150. uploadFiles: false, //上传文件
  151. uploadImgs: false, //上传单个图片
  152. pic: false, //多个图片
  153. addDevice: false,
  154. systemType: false,
  155. details: false, //详情页
  156. changeRea: false,
  157. lookPic: false, //图片查看
  158. menum: false, //临时多选枚举类型信息点
  159. },
  160. inputMap: {
  161. flowBuild: {
  162. editable: true,
  163. code: "flowBuild",
  164. name: "建筑楼层",
  165. path: "flowBuild",
  166. category: "STATIC",
  167. dataType: "ENUM",
  168. },
  169. }, //信息点和输入方式映射表
  170. qrcodeUrl: "", //二维码图片地址
  171. filesArr: [], //保存临时的文件key
  172. imgsArr: [], //临时保存的图片key数组
  173. picsArr: [], //临时设备图片keys数组
  174. systemList: [], //关联的系统
  175. systemId: null,
  176. graphyId: null,
  177. id: 0,
  178. showType: this.$route.query.showType,
  179. EquipmentList: [],
  180. firmId: "", //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
  181. buildFloorData: [],
  182. floorFlag: true,
  183. createDisable: false,
  184. updateInfoData: {}, //当前信息点信息
  185. updateInfoPoint: "", //临时维护信息点键
  186. updateInput: "", //临时维护信息点值
  187. };
  188. },
  189. computed: {
  190. ...mapGetters("layout", ["projectId", "secret", "userId"]),
  191. },
  192. created() {
  193. this.category = this.$route.query;
  194. BuildController.getData(this.buildFloorData);
  195. this.getBelongs();
  196. this.getTableHeader();
  197. },
  198. methods: {
  199. //查询设备类对应的 族
  200. getBelongs() {
  201. let params = {
  202. data: {
  203. filters: `equipCode='${this.category.deviceId}'`,
  204. pageNumber: 1,
  205. pageSize: 50,
  206. },
  207. };
  208. ScanController.getEquipBelongs(params).then((res) => {
  209. if (res.content.length) {
  210. this.firmId = res.content[0].family;
  211. }
  212. });
  213. },
  214. //将数组转换成optiosn格式
  215. changeArr(arr) {
  216. return arr.map((item) => {
  217. if (item.floors && item.floors.length) {
  218. return {
  219. value: item.id,
  220. label: item.infos.BuildLocalName,
  221. children: item.floors.map((i) => {
  222. return {
  223. value: i.id,
  224. label: i.infos.FloorLocalName || "未知",
  225. };
  226. }),
  227. };
  228. } else {
  229. return {
  230. value: item.id,
  231. label: item.infos.BuildLocalName,
  232. children: null,
  233. isChilren: 1,
  234. };
  235. }
  236. });
  237. },
  238. // 获取表头数据(初始化表格)
  239. async getTableHeader() {
  240. let params = {
  241. orders: "sort asc, name desc",
  242. pageNumber: 1,
  243. pageSize: 1000,
  244. type: this.category.deviceId,
  245. };
  246. await Dic.getDataDictionary(params, (res) => {
  247. this.tableHeader = res.content;
  248. this.tableHeader.forEach((item) => {
  249. if (item.path) {
  250. this.inputMap[item.path] = item;
  251. }
  252. });
  253. this.initTable();
  254. });
  255. },
  256. // 创建设备数据
  257. async handleCreateTableData() {
  258. let newData = this.tableData.filter((item) => {
  259. let keys = Object.keys(item);
  260. keys.map((key) => {
  261. //将值为空字符串的属性删除
  262. if (item[key] == "") {
  263. delete item[key];
  264. }
  265. });
  266. let newK = Object.keys(item);
  267. if (
  268. (item.checked && newK.length > 1) ||
  269. (!item.checked && newK.length)
  270. ) {
  271. return item;
  272. }
  273. });
  274. if (!newData.length) {
  275. this.$message("创建信息为空,请录入信息后再创建!");
  276. return;
  277. }
  278. let flag = false;
  279. newData.map((item) => {
  280. if (!item.localName) {
  281. flag = true;
  282. }
  283. // 处理建筑-楼层
  284. if (item.flowBuild) {
  285. let bid = item.flowBuild.split("-");
  286. item.buildingId = item.flowBuild.split("-")[0];
  287. if (bid[1]) {
  288. item.floorId = item.flowBuild.split("-")[1];
  289. }
  290. }
  291. //处理关联的系统
  292. if (item.linkSystem && item.linkSystem.length) {
  293. item.SystemList = [];
  294. item.linkSystem.map((t) => {
  295. item.SystemList.push(t.id);
  296. });
  297. }
  298. // 关联创建资产
  299. // item.propertyId = !!item.checked;
  300. item.classCode = this.category.deviceId;
  301. });
  302. if (flag) {
  303. this.$message.info("存在设备的本地名称为空,请检查");
  304. return;
  305. }
  306. // for (let i = 0; i < newData.length; i++) {
  307. // let params = newData[i]
  308. // params.Family = this.firmId;
  309. // params.Category = this.category.deviceId;
  310. // if (newData[i].PropertyId) {//同时创建资产
  311. // await createPropertyData([params], async res => {
  312. // params.PropertyId = res.EntityList[0].EquipID
  313. // await createEquip([params], res => {
  314. // if (i == newData.length - 1) {
  315. // this.$router.push({
  316. // path: "/ledger/facility",
  317. // query: { deviceId: this.category.deviceId }
  318. // });
  319. // session.remove("deviceAddData")
  320. // }
  321. // })
  322. // })
  323. // } else {
  324. // await createEquip([params], res => {
  325. // if (i == newData.length - 1) {
  326. // this.$router.push({
  327. // path: "/ledger/facility",
  328. // query: { deviceId: this.category.deviceId }
  329. // });
  330. // session.remove("deviceAddData")
  331. // }
  332. // });
  333. // }
  334. // }
  335. this.createDisable = true;
  336. //待接口修改为关联创建即可修改
  337. let param = {
  338. cascade: [],
  339. content: newData,
  340. };
  341. ScanController.createEquipAndProperty(param).then((res) => {
  342. this.createDisable = false;
  343. this.$message.success("创建成功");
  344. storage.remove("deviceAddData");
  345. this.$router.push({
  346. name: "facilityLedger",
  347. params: {
  348. deviceId: this.category.deviceId,
  349. facility: this.category.name,
  350. },
  351. });
  352. });
  353. },
  354. // 删除表格行
  355. handleDeleteTableRow(a, b, c, d) {
  356. if (d && d === "ContextMenu.removeRow") {
  357. this.$message.success("删除成功");
  358. this.formaTableData();
  359. }
  360. },
  361. // 添加行
  362. handleAddTableRow() {
  363. let addRowLength = this.addNum;
  364. for (let i = 0; i < addRowLength; i++) {
  365. // this.tableData.push({ checked: 1 });
  366. this.tableData.push({});
  367. }
  368. this.initTable();
  369. this.formaTableData();
  370. },
  371. //修改
  372. handleUpdataTable(changeData, source) {
  373. if (!this.onlyRead && source != "ObserveChanges.change") {
  374. this.formaTableData();
  375. }
  376. },
  377. //保存去掉空字段的新增数据
  378. formaTableData() {
  379. let newData = this.tableData.filter((item) => {
  380. let keys = Object.keys(item);
  381. keys.map((key) => {
  382. //将值为空字符串的属性删除
  383. if (item[key] == "") {
  384. delete item[key];
  385. }
  386. });
  387. if (keys.length && Object.keys(item).length) {
  388. return item;
  389. }
  390. });
  391. storage.set("deviceAddData", newData);
  392. },
  393. //格式化表头显示的数据
  394. formatHeaderData(list) {
  395. let arr = tools.copyArr(list);
  396. let data = showTools.headerTextFilter(
  397. arr,
  398. "equipment",
  399. this.onlyRead,
  400. this.showType,
  401. true
  402. );
  403. // data.unshift("同时创建资产", "所属系统实例");
  404. data.unshift("所属系统实例");
  405. if (this.floorFlag) {
  406. data.splice(1, 0, "所属建筑楼层");
  407. }
  408. return data;
  409. },
  410. formatHeaderType(list) {
  411. //格式化表头头映射的数据
  412. let arr = tools.copyArr(list);
  413. let data = showTools.headerTypeFilter(
  414. arr,
  415. "equipment",
  416. this.onlyRead,
  417. this.showType,
  418. true
  419. );
  420. data.unshift(
  421. // {
  422. // type: "checkbox",
  423. // checkedTemplate: 1,
  424. // uncheckedTemplate: 0,
  425. // data: "checked",
  426. // label: {
  427. // position: "after",
  428. // },
  429. // },
  430. {
  431. data: "linkSystem",
  432. renderer: text.systemList,
  433. readOnly: true,
  434. }
  435. );
  436. if (this.floorFlag) {
  437. data.splice(1, 0, {
  438. data: "flowBuild",
  439. renderer: tools.customDropdownRenderer,
  440. editor: "chosen",
  441. chosenOptions: {
  442. // multiple: true,//多选
  443. data: this.buildFloorData,
  444. },
  445. });
  446. }
  447. return data;
  448. },
  449. initTable() {
  450. //实例化表格
  451. let settings = {
  452. data: this.tableData,
  453. colHeaders: this.formatHeaderData(this.tableHeader),
  454. columns: this.formatHeaderType(this.tableHeader),
  455. rowHeights: 30,
  456. fillHandle: "vertical", //允许纵向填充
  457. maxRows: this.tableData.length,
  458. contextMenu: this.onlyRead
  459. ? false
  460. : {
  461. items: {
  462. remove_row: {
  463. name: "删除设备",
  464. },
  465. },
  466. },
  467. // 事件
  468. afterChange: this.handleUpdataTable, //修改后
  469. afterFilter: this.trimmedRows, //排序前
  470. afterRemoveRow: this.handleDeleteTableRow, //右键删除
  471. afterOnCellMouseDown: this.handleTdClick, //鼠标点击
  472. };
  473. this.$nextTick(() => {
  474. this.tableExample = this.$refs.table.init(settings);
  475. });
  476. },
  477. //去除数组中相同的元素
  478. array_diff(a, b) {
  479. for (var i = 0; i < b.length; i++) {
  480. for (var j = 0; j < a.length; j++) {
  481. if (a[j] == b[i]) {
  482. a.splice(j, 1);
  483. j = j - 1;
  484. }
  485. }
  486. }
  487. return a;
  488. },
  489. //上传文件弹窗触发事件
  490. fileChange(keys) {
  491. this.setDataToMain(keys, this.messKey, this.row);
  492. },
  493. //上传图片弹窗触发事件
  494. imgChange(keys) {
  495. this.setDataToMain(keys, this.messKey, this.row);
  496. },
  497. //设备图片弹窗改变事件
  498. changePics(keys) {
  499. this.setDataToMain(keys, this.messKey, this.row);
  500. },
  501. //关联系统变更
  502. changeSystemType(data) {
  503. tools.setDataForKey(this.tableData[this.row], "linkSystem", data);
  504. },
  505. //表格点击事件
  506. handleTdClick(el, rowArr) {
  507. //点击的是表头
  508. if (rowArr.row < 0) {
  509. return;
  510. }
  511. //被筛选过后的数组
  512. let trimmedArr = this.trimmedRows();
  513. //是否启用了排序
  514. let isSort = this.tableExample.getPlugin("columnSorting").isSorted();
  515. if (trimmedArr.length && isSort) {
  516. let sortArr =
  517. this.myHotArr.getPlugin("columnSorting").rowsMapper.__arrayMap;
  518. let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
  519. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  520. } else if (isSort) {
  521. //排序后的数组
  522. let sortArr =
  523. this.tableExample.getPlugin("columnSorting").rowsMapper.__arrayMap;
  524. let infos = this.tableData[sortArr[rowArr.row]];
  525. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  526. } else if (trimmedArr.length) {
  527. let infos = this.tableData[trimmedArr[rowArr.row]];
  528. this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
  529. } else {
  530. let infos = this.tableData[rowArr.row];
  531. this.getInfors(infos, rowArr);
  532. }
  533. },
  534. //获取被筛选掉的行号
  535. trimmedRows() {
  536. var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
  537. let dataLength = this.tableData.length;
  538. let dataArr = new Array();
  539. for (let i = 0; i < dataLength; i++) {
  540. dataArr.push(i);
  541. }
  542. if (plugin.length <= 0) {
  543. dataArr = undefined;
  544. } else {
  545. dataArr = this.array_diff(dataArr, plugin);
  546. }
  547. return dataArr || [];
  548. },
  549. getInfors(infos, row) {
  550. let val = this.tableExample.colToProp(row.col);
  551. let inputData = this.inputMap[val];
  552. this.row = row.row;
  553. this.messKey = val;
  554. switch (val) {
  555. //操作
  556. case "caozuo":
  557. // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
  558. this.$message("开发中...");
  559. return false;
  560. case "defaultQRCode":
  561. this.qrcodeUrl = this.tableData[row.row][val];
  562. if (this.qrcodeUrl) {
  563. this.myDialog.qrcode = true;
  564. } else {
  565. this.$message("此设备没有设备二维码");
  566. }
  567. return false;
  568. // 同时创建资产
  569. case "checked":
  570. return false;
  571. //关联系统
  572. case "linkSystem":
  573. if (!this.onlyRead) {
  574. this.systemList = this.tableData[row.row].linkSystem || [];
  575. this.myDialog.systemType = true;
  576. }
  577. return false;
  578. //关联资产
  579. case "linkEquipLocalName":
  580. if (this.linkNameFalg) {
  581. this.myDialog.changeRea = true;
  582. }
  583. return false;
  584. /**
  585. * 关联资产后才可维护的信息点
  586. */
  587. // case 'flowBuild': //所属建筑楼层
  588. // case 'infos.productDate': //生产日期
  589. // case 'infos.serialNum': //出厂编号
  590. // case 'infos.assetID': //资产编号
  591. // case 'infos.purchasePrice': //采购价格
  592. // case 'infos.insuranceNum': //保险单号
  593. // case 'infos.insuranceFile': //保险文件
  594. // if (!this.onlyRead) {
  595. // const linkId = this.tableData[row.row].linkId;
  596. // if (!linkId) { //未关联资产
  597. // this.$confirm('您暂未关联设备对应的资产,该信息点不可编辑', '提示', {
  598. // confirmButtonText: '我知道了',
  599. // showCancelButton: false,
  600. // type: 'warning',
  601. // center: true
  602. // }).then(() => {
  603. // return false;
  604. // });
  605. // }
  606. // }
  607. // break
  608. //保险文件--设备文档--安装质检报告
  609. case "infos.insuranceFile": //保险文件
  610. case "infos.archive": //设备文档
  611. case "infos.checkReport": //安装质检报告
  612. case "infos.maintainManual": //维修保养手册
  613. case "infos.approachingAcceptance": //进场验收单
  614. case "infos.acceptanceReport": //验收报告
  615. case "infos.operationManual": //操作说明书
  616. case "infos.originalCertificate": //原厂证明
  617. case "infos.testReport": //检测报告
  618. case "infos.productCertification": //产品合格证
  619. case "infos.installInstruction": //安装说明书
  620. case "infos.supplierContract": //供应合同
  621. case "infos.drawing": //设备图纸
  622. case "infos.installDrawing": //安装图纸
  623. case "infos.designIDGraph": //设计工况空调机组处理过程焓湿图(F2)
  624. case "infos.fanCharacterCurve": //风机性能曲线(F1)
  625. let IPSdata = tools.dataForKey(this.tableData[row.row], val);
  626. this.filesArr = IPSdata ? IPSdata : [];
  627. this.myDialog.uploadFiles = true;
  628. return false;
  629. //安装照片--设备铭牌照片
  630. case "infos.installPic":
  631. case "infos.nameplate":
  632. let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
  633. this.imgsArr = SSPPdata ? SSPPdata : [];
  634. this.myDialog.uploadImgs = true;
  635. return false;
  636. //设备照片
  637. case "infos.pic":
  638. let Pdata = tools.dataForKey(this.tableData[row.row], val);
  639. this.picsArr = Pdata ? Pdata : [];
  640. this.myDialog.pic = true;
  641. return false;
  642. //包含的部件字段
  643. case "count":
  644. if (this.onlyRead) {
  645. this.$router.push({
  646. path: "/ledger/parts",
  647. query: { deviceId: infos.EquipID },
  648. });
  649. } else {
  650. this.$router.push({
  651. path: "/ledger/partsmanage",
  652. query: { deviceId: infos.EquipID, typeId: this.mess.deviceId },
  653. });
  654. }
  655. return false;
  656. default:
  657. break;
  658. }
  659. // 维护多选枚举值
  660. if (!this.onlyRead && inputData.dataType == "MENUM") {
  661. this.updateInfoData = inputData;
  662. this.updateInfoPoint = val;
  663. this.updateInput = tools.dataForKey(this.tableData[row.row], val);
  664. this.myDialog.menum = true;
  665. return false;
  666. }
  667. // 区间值和复数值暂无组件支持输入
  668. if (!this.onlyRead && (inputData.region || inputData.multiple)) {
  669. this.$confirm("该信息点为区间值/复数值,暂无组件支持输入!", "提示", {
  670. confirmButtonText: "我知道了",
  671. showCancelButton: false,
  672. type: "warning",
  673. center: true,
  674. }).then(() => {
  675. return false;
  676. });
  677. }
  678. if (!this.onlyRead && !inputData.editable) {
  679. this.$confirm("该信息点的值为自动生成,不可人工维护!", "提示", {
  680. confirmButtonText: "我知道了",
  681. showCancelButton: false,
  682. type: "warning",
  683. center: true,
  684. }).then(() => {
  685. return false;
  686. });
  687. }
  688. },
  689. utilToKey(key, name, data, messName) {
  690. if (key == name) {
  691. this.setDataToMain(data[key], messName, this.row);
  692. }
  693. },
  694. //多选枚举类型值修改
  695. handleChangeMenum(newValue) {
  696. tools.setDataForKey(
  697. this.tableData[this.row],
  698. this.updateInfoPoint,
  699. newValue
  700. );
  701. this.handleUpdataTable(
  702. [[this.row, this.updateInfoPoint, null, newValue]],
  703. "edit"
  704. );
  705. this.myDialog.menum = false;
  706. this.updateInput = "";
  707. },
  708. //判断是否有值,有值赋值
  709. setDataToMain(data, key, row) {
  710. if (!!data && data != "--") {
  711. if (!!this.tableData[row]) {
  712. //铭牌照片特殊处理
  713. tools.setDataForKey(this.tableData[row], key, data);
  714. // this.tableData[row][key] = data;
  715. } else {
  716. this.tableData[row] = {};
  717. tools.setDataForKey(this.tableData[row], key, data);
  718. }
  719. } else {
  720. tools.setDataForKey(this.tableData[row], key, "");
  721. }
  722. },
  723. },
  724. };
  725. </script>
  726. <style lang="less" scoped>
  727. #deviceList {
  728. overflow: hidden;
  729. height: 100%;
  730. background-color: #fff;
  731. padding: 10px;
  732. position: relative;
  733. .right {
  734. background: #fff;
  735. }
  736. .search-header {
  737. overflow: hidden;
  738. padding: 0 10px 10px 10px;
  739. border-bottom: 1px solid #bcbcbc;
  740. }
  741. .tableBox {
  742. display: flex;
  743. height: calc(100% - 100px);
  744. margin-top: 10px;
  745. .tableLeft {
  746. flex: 1;
  747. }
  748. }
  749. .create_button {
  750. margin-top: 10px;
  751. }
  752. }
  753. </style>