system.vue 22 KB

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