system.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. <template>
  2. <div style="height: calc(100% - 44.5px);padding: 0px 10px 10px;box-sizing: border-box;">
  3. <div class="hanson-bar">
  4. <div style="float:right;overflow:hidden;">
  5. <span>当前筛选条件下共{{page.total || '--'}}系统</span>
  6. </div>
  7. <el-select v-model="onlyRead" @change="getHeaderData(mess)" style="width:100px;margin-right:20px;vertical-align:bottom;">
  8. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
  9. </el-select>
  10. <el-select v-model="showType" @change="initTable" style="width:100px;margin-right:10px;vertical-align:bottom;">
  11. <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
  12. </el-select>
  13. <el-button size="small" style="width: 80px" @click="addDevice" icon="iconfont icon-tianjia">添加系统</el-button>
  14. <el-button size="small" style="width: 80px" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
  15. <el-button size="small" style="width: 80px" @click="undo" icon="iconfont icon-undo">撤销</el-button>
  16. </div>
  17. <qrcode :dialog="myDialog" :addBody="true" ref="qrcode"></qrcode>
  18. <upload-files-dialog ref="upload" @changeFile="fileChange" :keysArr="filesArr" :dialog="myDialog"></upload-files-dialog>
  19. <upload-img-dialog @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
  20. <pic-dialog :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
  21. <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
  22. <p><i class="icon-wushuju iconfont"></i>请选择系统类型</p>
  23. </div>
  24. <div class="center middle_sty" style="height: 91%" v-show="mess.deviceId && (!tableData || !tableData.length)">
  25. <p><i class="icon-wushuju iconfont"></i>暂无数据</p>
  26. </div>
  27. <div v-show="mess.deviceId && tableData && tableData.length" v-loading="loading" id="handsontable" ref="handsontable"></div>
  28. <div v-show="mess.deviceId && tableData && tableData.length" class="right">
  29. <my-pagination @change="getTableData" :page="page"></my-pagination>
  30. </div>
  31. <!-- <dialog-assets :assetType="[this.mess.deviceId]" @close="getClose" v-if="myDialog.addDevice" ref="assets" :dialog="myDialog"></dialog-assets> -->
  32. <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
  33. <system-relevance @close="reset" :id="systemId" :dialog="myDialog"></system-relevance>
  34. <!-- 不支持的输入方式 -->
  35. <editSysfloor ref="editFloor" @handleClickUpdate="handleClickUpdate"></editSysfloor>
  36. <!-- 新增系统 -->
  37. <el-dialog title="确定新增系统的类型" :visible.sync="myDialog.addDevice" width="30%">
  38. <el-row>
  39. <my-cascader ref="cascader" @change="changeAddType" :all="true"></my-cascader>
  40. </el-row>
  41. <span slot="footer" class="dialog-footer">
  42. <el-button type="primary" @click="toAddDevice">下 一 步</el-button>
  43. </span>
  44. </el-dialog>
  45. </div>
  46. </template>
  47. <script>
  48. import {
  49. BeatchQueryParam,
  50. getDataDictionary,
  51. queryLinkSys,
  52. updateGeneralSys,
  53. deleteGeneralSys
  54. } from "@/api/scan/request"
  55. import myCascader from "@/components/ledger/lib/system";
  56. import tools from "@/utils/scan/tools";
  57. import handsonUtils from "@/utils/scan/hasontableUtils"
  58. import showTools from "@/utils/handsontable/notShow"
  59. import qrcode from "@/components/business_space/lib/qrcode"
  60. import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
  61. import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
  62. import picDialog from "@/components/business_space/dialogs/list/picDialog"
  63. import myPagination from "@/components/common/myPagination"
  64. import dialogAssets from "@/components/ledger/addDialog/dialogSystem"
  65. import detailsDialog from "@/components/business_space/lib/detailsDia"
  66. import systemRelevance from "@/components/ledger/tableTransfers"
  67. import Handsontable from "handsontable-pro"
  68. import text from "@/utils/handsontable/mainText"
  69. import 'handsontable-pro/dist/handsontable.full.css'
  70. import editSysfloor from "@/components/ledger/lib/editSysFloor";
  71. import { mapGetters } from "vuex";
  72. export default {
  73. components: {
  74. qrcode, //二维码页面
  75. uploadFilesDialog,
  76. uploadImgDialog,
  77. picDialog,
  78. myPagination,
  79. dialogAssets,
  80. detailsDialog,
  81. systemRelevance,
  82. myCascader,
  83. editSysfloor
  84. },
  85. computed: {
  86. ...mapGetters("layout", ["projectId", "secret", "userId"]),
  87. showTypes() {
  88. return this.onlyRead ?
  89. [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }] :
  90. [{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }]
  91. }
  92. },
  93. data() {
  94. return {
  95. options: [{
  96. value: true,
  97. label: '只读模式'
  98. }, {
  99. value: false,
  100. label: '编辑模式'
  101. }],
  102. tableData: [],
  103. mess: {},
  104. tableHeader: null,
  105. page: {
  106. size: 50,
  107. sizes: [10, 30, 50, 100, 150, 200],
  108. total: 0,
  109. currentPage: 1
  110. },
  111. myDialog: {
  112. qrcode: false, //二维码弹窗
  113. firm: false, //厂商弹窗
  114. supply: false, //选择供应合同
  115. supplier: false, //供应商选择
  116. guarantee: false, //选择保单
  117. maintainer: false, //选择维修商
  118. insurer: false, //选择保险公司
  119. uploadFiles: false,//上传文件
  120. uploadImgs: false,//上传单个图片
  121. pic: false, //多个图片
  122. addDevice: false,
  123. details: false,//详情页
  124. relevance: false,//关联设备
  125. update: false,//临时维护信息点
  126. },
  127. row: null,//被修改的row
  128. filesArr: [],//保存临时的文件key
  129. messKey: null,
  130. imgsArr: [],//临时保存的图片key数组
  131. picsArr: [],//临时设备图片keys数组
  132. noShowList: ["SysID", "SysName"],
  133. copyMain: null,
  134. iframeSrc: "",
  135. systemId: "",
  136. onlyRead: true,
  137. showType: 'Visible',
  138. linkNameFalg: false,
  139. qrcodeUrl: "",//二维码图片地址
  140. loading: false,
  141. addData: {}, //添加设备选择的设备类型
  142. inputMap: {
  143. flowBuild: 'D1'
  144. }, //信息点和输入方式映射表
  145. updateInputShow: false, //是否显示临时维护输入框
  146. updateInfoPoint: '',//临时维护信息点
  147. updateInput: '', //临时维护信息点值
  148. };
  149. },
  150. created() {
  151. },
  152. mounted() { },
  153. methods: {
  154. //触发父组件change
  155. getClose(val) {
  156. this.$emit("close", val)
  157. },
  158. //获取表头
  159. getHeaderData(code) {
  160. this.mess = code
  161. if (this.mess.deviceId) {
  162. let params = {
  163. data: {
  164. Orders: "sort asc",
  165. PageNumber: 1,
  166. PageSize: 500
  167. },
  168. type: this.mess.deviceId
  169. }
  170. getDataDictionary(params, res => {
  171. this.tableHeader = res.Content;
  172. this.tableHeader.forEach(item => {
  173. if (item.Path && item.InputMode) {
  174. this.inputMap[item.Path] = item.InputMode
  175. }
  176. })
  177. this.getTableData()
  178. });
  179. }
  180. },
  181. changeWatch() {
  182. this.reset()
  183. },
  184. //获取主体数据
  185. getTableData() {
  186. let _this = this
  187. this.loading = true
  188. if (!!this.mess.deviceId) {
  189. let param = {
  190. PageSize: this.page.size,
  191. Orders: "createTime desc, SysID desc",
  192. PageNumber: this.page.currentPage,
  193. Filters: `category='${this.mess.deviceId}'`
  194. }
  195. if (this.mess.buildId == "noKnow") {
  196. param.Filters += `;buildingId isNull`
  197. } else if (this.mess.buildId && this.mess.buildId != "all") {
  198. param.Filters += `;buildingId='${this.mess.buildId}'`
  199. }
  200. queryLinkSys(param, res => {
  201. this.loading = false;
  202. _this.tableData = res.Content;
  203. _this.copyMain = tools.deepCopy(res.Content);
  204. _this.page.total = res.Total;
  205. if (res.Content && res.Content.length) {
  206. if (this.onlyRead) {
  207. this.getBatch(res.Content)
  208. }
  209. _this.initTable();
  210. }
  211. })
  212. }
  213. },
  214. //撤回
  215. undo() {
  216. this.hot.undo();
  217. },
  218. //刷新
  219. reset() {
  220. if (this.mess.deviceId) {
  221. this.getTableData();
  222. } else {
  223. this.$message({
  224. message: '请选择系统类型',
  225. type: 'warning'
  226. });
  227. }
  228. },
  229. //添加设备
  230. addDevice() {
  231. this.myDialog.addDevice = true
  232. if (this.mess.deviceId) {
  233. this.$nextTick(() => {
  234. this.$refs.cascader.setValue(this.mess.deviceId)
  235. })
  236. }
  237. },
  238. //下一步
  239. toAddDevice() {
  240. if (this.addData.Category) {
  241. this.$router.push({
  242. path: "/ledger/systemadd",
  243. query: this.addData
  244. });
  245. }
  246. },
  247. //选择设备类型-添加设备
  248. changeAddType(val) {
  249. this.addData.Category = val.Category;
  250. this.addData.CategoryName = val.CategoryName;
  251. },
  252. //格式化表头
  253. formatHeaderData(list) {
  254. let arr = tools.copyArr(list)
  255. let data = showTools.headerTextFilter(arr, 'system', this.onlyRead, this.showType)
  256. data.unshift("操作");
  257. if (this.showType == "all") {
  258. data.splice(3, 0, "所属建筑楼层")
  259. }
  260. return data;
  261. },
  262. //格式化表内容
  263. formatHeaderType(list) {
  264. let arr = tools.copyArr(list)
  265. let data = showTools.headerTypeFilter(arr, 'system', this.onlyRead, this.showType)
  266. data.unshift(
  267. {
  268. data: "caozuo",
  269. renderer: tools.lookDetails,
  270. readOnly: true
  271. },
  272. // {
  273. // data: "Count",
  274. // renderer: tools.num,
  275. // readOnly: true
  276. // }
  277. );
  278. if (this.onlyRead) {
  279. data.map(item => {
  280. item.readOnly = true
  281. })
  282. }
  283. if (this.showType == "all") {
  284. data.splice(3, 0, {
  285. data: "sysInBuildFloor",
  286. renderer: text.sysInBuildFloor,
  287. readOnly: this.onlyRead
  288. })
  289. }
  290. return data;
  291. },
  292. //获取动态参数
  293. getBatch(data) {
  294. let param = {
  295. secret: this.secret,
  296. ProjId: this.projectId,
  297. data: {
  298. criterias: []
  299. }
  300. }
  301. //一级遍历list
  302. this.tableHeader.map(head => {
  303. //如果一级标签为动态参数或者设定参数放入数据等待请求
  304. if (
  305. head.InputMode == "L" ||
  306. head.InputMode == "L1" ||
  307. head.InputMode == "L2" ||
  308. head.InputMode == "M"
  309. ) {
  310. data.map(item => {
  311. let cur = tools.dataForKey(item, head.Path);
  312. if (cur) {
  313. param.data.criterias.push({
  314. id: item.SysID,
  315. code: head.InfoPointCode
  316. });
  317. }
  318. });
  319. }
  320. })
  321. if (param.data.criterias.length) {
  322. BeatchQueryParam(param, res => {
  323. if (!this.onlyRead) {
  324. return false
  325. }
  326. this.tableData = data.map(item => {
  327. res.Content.map(child => {
  328. if (item.SysID == child.id) {
  329. if (!!child.data || child.data == 0) {
  330. this.tableHeader.map(head => {
  331. if (head.InfoPointCode == child.code) {
  332. tools.setDataForKey(item, head.Path, child.data);
  333. }
  334. });
  335. } else {
  336. this.tableHeader.map(head => {
  337. if (head.InfoPointCode == child.code) {
  338. tools.setDataForKey(
  339. item,
  340. head.Path,
  341. // child.error ? "表号功能号格式错误" : "表号功能号不存在"
  342. child.error ? child.value? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
  343. );
  344. }
  345. });
  346. }
  347. }
  348. })
  349. return item
  350. })
  351. this.hot.loadData(this.tableData)
  352. })
  353. }
  354. },
  355. //初始化插件
  356. initTable() {
  357. var container = document.getElementById("handsontable");
  358. let winHeight = document.documentElement.clientHeight;
  359. if (this.hot) {
  360. this.hot.destroy();
  361. this.hot = null;
  362. }
  363. this.hot = new Handsontable(container, {
  364. data: this.tableData,
  365. fixedColumnsLeft: 3,
  366. colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
  367. columns: this.formatHeaderType(this.tableHeader), //数据显示格式
  368. filters: true,
  369. maxRows: this.tableData.length,
  370. height: winHeight - 335,
  371. columnSorting: true, //添加排序
  372. sortIndicator: true, //添加排序
  373. renderAllRows: true,
  374. // colWidths: 200,
  375. autoColumnSize: true,
  376. language: "zh-CN",
  377. manualColumnResize: true,
  378. manualColumnMove: true,
  379. dropdownMenu: [
  380. "filter_by_condition",
  381. "filter_by_value",
  382. "filter_action_bar"
  383. ],
  384. contextMenu: {
  385. items: {
  386. remove_row: {
  387. name: "删除该系统"
  388. }
  389. }
  390. },
  391. // 事件
  392. afterChange: this.handleUpdataTable, //修改后
  393. afterFilter: this.trimmedRows, //排序前
  394. afterRemoveRow: this.handleDeleteTableRow, //右键删除
  395. afterOnCellMouseDown: this.eventClick //鼠标点击
  396. });
  397. let pro = document.getElementById("hot-display-license-info");
  398. if (!!pro) {
  399. pro.parentNode.removeChild(pro);
  400. }
  401. this.isLoading = false;
  402. },
  403. //表格中的点击
  404. eventClick(el, rowArr) {
  405. //点击的是表头
  406. if (rowArr.row < 0) {
  407. return;
  408. }
  409. //被筛选过后的数组
  410. let trimmedArr = this.trimmedRows();
  411. //是否启用了排序
  412. let isSort = this.hot.getPlugin("columnSorting").isSorted();
  413. if (trimmedArr.length && isSort) {
  414. let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
  415. .__arrayMap;
  416. let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
  417. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  418. } else if (isSort) {
  419. //排序后的数组
  420. let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
  421. let infos = this.tableData[sortArr[rowArr.row]];
  422. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  423. } else if (trimmedArr.length) {
  424. let infos = this.tableData[trimmedArr[rowArr.row]];
  425. this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
  426. } else {
  427. let infos = this.tableData[rowArr.row];
  428. this.getInfors(infos, rowArr);
  429. }
  430. },
  431. handleUpdataTable(changeData, source) {
  432. if (!this.onlyRead) {
  433. if (changeData) {
  434. let trimmedArr = this.trimmedRows();
  435. let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
  436. let data = [];
  437. for (let i = 0; i < param.length; i++) {
  438. data.push(param[i]);
  439. }
  440. //如果data中包含/且data长度为1,将其转换成.
  441. if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
  442. changeData[0][1] = changeData[0][1].split("/").join(".")
  443. }
  444. //存在data进行修改请求
  445. if (data && data.length) {
  446. this.updateBusiness(data, changeData);
  447. }
  448. }
  449. }
  450. },
  451. //删除资产
  452. async handleDeleteTableRow() {
  453. this.$confirm('此操作将删除该系统, 是否继续?', '提示', {
  454. confirmButtonText: '确定',
  455. cancelButtonText: '取消',
  456. type: 'warning'
  457. }).then(() => {
  458. let params = tools.differenceArr(this.tableData, this.copyMain)
  459. let param = []
  460. params.map(item => {
  461. param.push({ SysID: item.SysID })
  462. })
  463. this.removeSys(param)
  464. }).catch(() => {
  465. this.getTableData()
  466. this.$message('取消删除');
  467. });
  468. },
  469. async removeSys(param) {
  470. await deleteGeneralSys(param, res => {
  471. this.$message.success("删除成功")
  472. this.$emit('close', '')
  473. this.getTableData()
  474. })
  475. },
  476. // 修改
  477. updateBusiness(data, change) {
  478. let param = {
  479. Content: [],
  480. Projection: []
  481. }, keyList = [];
  482. //生成要修改字段列表
  483. change.map(item => {
  484. let key = item[1].split(".")[0]
  485. if (item[1] && keyList.indexOf(key) == -1) {
  486. keyList.push(key);
  487. }
  488. if (item[1] && item[3] == "" && param.Projection.indexOf(key) == -1) {
  489. param.Projection.push(key);
  490. }
  491. });
  492. //生成对应修改数据
  493. data.map((item, index) => {
  494. keyList.map(value => {
  495. let itemData = tools.dataForKey(item, value);
  496. tools.setDataForKey(item, value, itemData == "" ? null : itemData);
  497. });
  498. param.Content.push(item);
  499. });
  500. updateGeneralSys(param, res => { });
  501. },
  502. //获取到了正确的信息
  503. getInfors(infos, row) {
  504. //其他的开始判断
  505. let val = this.hot.colToProp(row.col);
  506. let inputMode = this.inputMap[val];
  507. this.systemId = infos.SysID
  508. this.row = row.row
  509. this.messKey = val
  510. switch (val) {
  511. //操作
  512. case 'caozuo':
  513. // window.open(`http://adm.sagacloud.cn:8058/system?id=${infos.id}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
  514. // this.$message("开发中...")
  515. this.$router.push({
  516. path: "/ledger/systemDetail",
  517. query: { SysID: infos.SysID, Name: infos.SysLocalName || infos.SysName, SysType:infos.Category }
  518. })
  519. return false
  520. //设备二维码图片
  521. case 'EquipQRCode':
  522. this.qrcodeUrl = this.tableData[row.row].EquipQRCode;
  523. if (!!this.qrcodeUrl) {
  524. this.myDialog.qrcode = true;
  525. } else {
  526. this.$message("此设备没有设备二维码");
  527. }
  528. return false
  529. //关联设备数量
  530. case 'Count':
  531. if (!this.onlyRead) {
  532. this.myDialog.relevance = true
  533. }
  534. return false
  535. default:
  536. break;
  537. }
  538. if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
  539. // this.updateInfoPoint = val
  540. // this.updateInput = tools.dataForKey(this.tableData[row.row], val)
  541. // console.log("this is ",this.tableData[row.row])
  542. // let floor = tools.dataForKey(this.tableData[row.row], val);
  543. this.$refs.editFloor.showDialog(this.tableData[row.row]);
  544. }
  545. },
  546. //更新临时维护信息点
  547. handleClickUpdate() {
  548. // this.$message("更新成功");
  549. // tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
  550. // this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
  551. // this.updateInputShow = false
  552. // this.myDialog.update = false
  553. // this.updateInput = ''
  554. },
  555. //获取被筛选掉的行号
  556. trimmedRows() {
  557. // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
  558. var plugin = this.hot.getPlugin("trimRows").trimmedRows;
  559. let dataLength = this.tableData.length;
  560. let dataArr = new Array();
  561. for (let i = 0; i < dataLength; i++) {
  562. dataArr.push(i);
  563. }
  564. if (plugin.length <= 0) {
  565. dataArr = undefined;
  566. } else {
  567. dataArr = this.array_diff(dataArr, plugin);
  568. }
  569. return dataArr || [];
  570. // var DataArray = new Array();
  571. // for (var i = 0; i < plugin.length; i++) {
  572. // // 通过行号获取数据
  573. // DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
  574. // }
  575. },
  576. //上传文件弹窗触发事件
  577. fileChange(keys) {
  578. this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
  579. // tools.setItem(this.deviceType.code, this.tableData)
  580. },
  581. //上传图片弹窗触发事件
  582. imgChange(keys) {
  583. this.setDataToMain(keys[0], this.messKey.split(".")[1], this.row)
  584. // tools.setItem(this.deviceType.code, this.tableData)
  585. },
  586. //设备图片弹窗改变事件
  587. changePics(keys) {
  588. this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
  589. // tools.setItem(this.deviceType.code, this.tableData)
  590. },
  591. //判断是否有值,有值赋值
  592. setDataToMain(data, key, row) {
  593. if (!!data && data != '--') {
  594. if (!!this.tableData[row].infos) {
  595. //falg确定每个的是否有值
  596. let falg = false
  597. if (!this.tableData[row].infos[key]) {
  598. falg = true
  599. }
  600. //铭牌照片特殊处理
  601. if (key == 'Nameplate') {
  602. this.tableData[row].infos[key] = {
  603. "systemId": "dataPlatform",
  604. "name": "铭牌照片",
  605. "type": "image",
  606. "key": data
  607. }
  608. } else {
  609. this.tableData[row].infos[key] = data
  610. }
  611. if (falg) {
  612. this.updateBusiness([this.tableData[row]], [[0, "infos." + key, null, data]])
  613. }
  614. } else {
  615. this.tableData[row].infos = {}
  616. if (key == 'Nameplate') {
  617. this.tableData[row].infos[key] = {
  618. "systemId": "dataPlatform",
  619. "name": "铭牌照片",
  620. "type": "image",
  621. "key": data
  622. }
  623. } else {
  624. this.tableData[row].infos[key] = data
  625. }
  626. }
  627. } else {
  628. this.tableData[row].infos[key] = ''
  629. }
  630. }
  631. },
  632. watch: {
  633. projectId() {
  634. this.tableData = []
  635. this.mess.deviceId = null
  636. this.page.total = 0
  637. },
  638. showTypes: {
  639. handler(newName, oldName) {
  640. if (newName && newName[0] && newName[0].value) {
  641. this.showType = newName[0].value
  642. } else {
  643. this.showType = ""
  644. }
  645. },
  646. immediate: true,
  647. deep: true
  648. }
  649. }
  650. };
  651. </script>
  652. <style lang="less">
  653. .hanson-bar {
  654. height: 40px;
  655. padding: 5px 0;
  656. font-size: 14px;
  657. overflow: hidden;
  658. margin-top: 0;
  659. line-height: 40px;
  660. .iconfont {
  661. font-size: 12px;
  662. }
  663. }
  664. </style>