device.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  1. <template>
  2. <div style="height: 94%;">
  3. <div class="hanson-bar">
  4. <span
  5. style="width:20px;float:left;display:block;height:20px;cursor: pointer;"
  6. @click="changeAssetsFalg"
  7. >
  8. <i class="el-icon-fa el-icon-fa-compass"></i>
  9. </span>
  10. <span>当前筛选条件下共{{page.total || '--'}}设备</span>
  11. <div style="float:right;overflow:hidden;">
  12. <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button>
  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. <div style="width:200px;color:gray;float:right;font-size:12px;">
  18. <span v-if="!onlyRead">隐藏自动填充的信息点:</span>
  19. <el-tooltip v-if="!onlyRead" :content="'' + (isWatch ? '隐藏' : '不隐藏')" placement="top">
  20. <el-checkbox v-model="isWatch" @change="changeWatch"></el-checkbox>
  21. <!-- <el-switch
  22. @change="changeWatch"
  23. v-model="isWatch"
  24. active-color="#13ce66"
  25. inactive-color="gray"
  26. ></el-switch> -->
  27. </el-tooltip>
  28. <span v-if="onlyRead">只看要采集的信息</span>
  29. <el-tooltip v-if="onlyRead" :content="'' + (allMess ? '部分' : '全集')" placement="top">
  30. <el-checkbox v-model="allMess" @change="changeWatch"></el-checkbox>
  31. <!-- <el-switch
  32. @change="changeWatch"
  33. v-model="allMess"
  34. active-color="#13ce66"
  35. inactive-color="gray"
  36. ></el-switch> -->
  37. </el-tooltip>
  38. </div>
  39. <div
  40. style="width:100px;cursor: pointer;float:right; font-size:14px;margin-right:10px"
  41. >
  42. <el-select v-model="onlyRead" @click="changeRead" size="small">
  43. <el-option
  44. v-for="item in options"
  45. :key="item.value"
  46. :label="item.label"
  47. :value="item.value">
  48. </el-option>
  49. </el-select>
  50. <!-- <p v-if="onlyRead" @click="changeRead">
  51. <i class="iconfont icon-yulan"></i>
  52. <span>只读模式</span>
  53. </p>
  54. <p v-else @click="changeRead">
  55. <i class="iconfont icon-yulan"></i>
  56. <span>编辑模式</span>
  57. </p> -->
  58. </div>
  59. </div>
  60. <!-- 二维码弹窗 -->
  61. <qrcode :dialog="dialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
  62. <!-- 型号弹窗 -->
  63. <firm :mess="{deviceId: deviceType.code}" ref="firm" @changeFirm="firmChange" :dialog="dialog"></firm>
  64. <!-- 供应商合同弹窗 -->
  65. <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="dialog"></supply-dialog>
  66. <!-- 供应商弹窗 -->
  67. <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="dialog"></supplier-dialog>
  68. <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="dialog"></guarantee-dialog>
  69. <upload-files-dialog
  70. :read="onlyRead ? true : false"
  71. ref="upload"
  72. @changeFile="fileChange"
  73. :keysArr="filesArr"
  74. :dialog="dialog"
  75. ></upload-files-dialog>
  76. <upload-img-dialog
  77. :read="onlyRead ? true : false"
  78. @changeFile="imgChange"
  79. :keysArr="imgsArr"
  80. :dialog="dialog"
  81. ></upload-img-dialog>
  82. <maintainer-dialog @changeMaintainer="changeMaintainer" ref="maintainer" :dialog="dialog"></maintainer-dialog>
  83. <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="dialog"></insurer-dialog>
  84. <pic-dialog
  85. :read="onlyRead ? true : false"
  86. :dialog="dialog"
  87. :keysArr="picsArr"
  88. @change="changePics"
  89. ></pic-dialog>
  90. <div class=" middle_sty" style="height: 91%; text-align:center" v-show="!mess.deviceId && (!main || !main.length)">
  91. <p><i class="iconwushuju iconfont"></i>
  92. 请选择设备族</p>
  93. </div>
  94. <div class="center middle_sty" style="height: 91%" v-show="mess.deviceId && (!main || !main.length)">
  95. <p>
  96. <i class="iconwushuju iconfont"></i>
  97. 暂无数据
  98. </p>
  99. </div>
  100. <system-type :infos="systemId" :graphyId="graphyId" :dialog="dialog"></system-type>
  101. <!-- <div
  102. v-show="!main || !main.length"
  103. style="width:100%;text-align:center;font-size:30px;color:gray;"
  104. >{{ mess.deviceId ? '请选择设备族' : '无设备'}}</div> -->
  105. <!-- <div
  106. v-show="!mess.deviceId && (!main || !main.length)"
  107. style="width:100%;text-align:center;font-size:30px;color:gray;"
  108. >请选择设备族</div> -->
  109. <div v-show="mess.deviceId && main && main.length" v-loading="loading" id="handsontable" ref="handsontable"></div>
  110. <div v-show="mess.deviceId && main && main.length" class="right">
  111. <my-pagination @change="getMain" :page="page"></my-pagination>
  112. </div>
  113. <dialog-assets
  114. @close="getClose"
  115. :graphyId="graphyId"
  116. :assetType="[this.mess.deviceId]"
  117. ref="assets"
  118. :dialog="dialog"
  119. ></dialog-assets>
  120. <details-dialog :iframeSrc="iframeSrc" v-if="dialog.details" :dialog="dialog"></details-dialog>
  121. <change-rea @close="reset" :dialog="dialog" :category="category"></change-rea>
  122. <look-pic :dialog="dialog" :keysArr="picsArr"></look-pic>
  123. </div>
  124. </template>
  125. <script>
  126. import { getTableHeader, getSpaceFloor, getEquipmentFamily, getBillEquipList, BeatchQueryParam, delBatchList, updateBusiness } from "@/api/scan/request";
  127. import tools from "@/utils/scan/tools";
  128. import handsonUtils from "@/utils/hasontableUtils"
  129. import showTools from "@/utils/handsontable/notShow"
  130. import text from "@/utils/handsontable/mainText"
  131. import qrcode from "@/components/ledger/lib/qrcode";
  132. import firm from "@/components/dialogs/list/firm";
  133. import supplyDialog from "@/components/dialogs/list/supplyDialog";
  134. import supplierDialog from "@/components/dialogs/list/supplierDialog";
  135. import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
  136. import insurerDialog from "@/components/dialogs/list/insurerDialog";
  137. import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
  138. import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
  139. import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
  140. import picDialog from "@/components/dialogs/list/picDialog"
  141. import systemType from "@/components/dialogs/list/systemType"
  142. import myPagination from "@/components/ledger/lib/myPagination";
  143. import dialogAssets from "@/components/dialogs/addDialog/dialogDevice";
  144. import detailsDialog from "@/components/ledger/lib/detailsDia"
  145. import changeRea from "@/components/dialogs/changeRea"
  146. //图片查看
  147. import lookPic from "@/components/ledger/lib/lookImages"
  148. //下拉插件
  149. import "@/assets/js/chosen.jquery.min";
  150. import "@/assets/js/handsontable-chosen-editor";
  151. import {mapGetters, mapActions} from "vuex";
  152. import Handsontable from "handsontable-pro"
  153. import 'handsontable-pro/dist/handsontable.full.css'
  154. import zhCN from 'handsontable-pro/languages/zh-CN';
  155. export default {
  156. props: ["myParam"],
  157. components: {
  158. qrcode, //二维码页面
  159. firm, //
  160. supplyDialog,
  161. supplierDialog,
  162. guaranteeDialog,
  163. uploadFilesDialog,
  164. maintainerDialog,
  165. insurerDialog,
  166. uploadImgDialog,
  167. picDialog,
  168. myPagination,
  169. dialogAssets,
  170. systemType,
  171. detailsDialog,
  172. changeRea,
  173. lookPic
  174. },
  175. data() {
  176. return {
  177. options: [{
  178. value: true,
  179. label: '只读模式'
  180. }, {
  181. value: false,
  182. label: '编辑模式'
  183. }],
  184. main: [],
  185. mess: {},
  186. headers: null,
  187. page: {
  188. size: 50,
  189. sizes: [10, 30, 50, 100, 150, 200],
  190. total: 0,
  191. currentPage: 1
  192. },
  193. dialog: {
  194. qrcode: false, //二维码弹窗
  195. firm: false, //厂商弹窗
  196. supply: false, //选择供应合同
  197. supplier: false, //供应商选择
  198. guarantee: false, //选择保单
  199. maintainer: false, //选择维修商
  200. insurer: false, //选择保险公司
  201. uploadFiles: false,//上传文件
  202. uploadImgs: false,//上传单个图片
  203. pic: false, //多个图片
  204. addDevice: false,
  205. systemType: false,
  206. details: false,//详情页
  207. changeRea: false,
  208. lookPic: false,//图片查看
  209. },
  210. row: null,//被修改的row
  211. filesArr: [],//保存临时的文件key
  212. messKey: null,
  213. imgsArr: [],//临时保存的图片key数组
  214. picsArr: [],//临时设备图片keys数组
  215. projId: "",
  216. copyMain: null,
  217. graphyId: null,
  218. systemId: null,
  219. assetGroupList: [],
  220. iframeSrc: "",
  221. id: 0,
  222. isWatch: true,
  223. category: {},
  224. onlyRead: true,
  225. allMess: true,
  226. linkNameFalg: false,
  227. qrcodeUrl: "",//二维码图片地址
  228. loading: false,
  229. EquipmentList: [],//资产族
  230. deviceType: {},
  231. floorData: []
  232. };
  233. },
  234. created() {
  235. this.getEquipmentFamilyList()
  236. this.getFloorData()
  237. },
  238. computed: {
  239. ...mapGetters("layout", [
  240. "projectId",
  241. "secret",
  242. "userId"
  243. ])
  244. },
  245. methods: {
  246. //获取楼层数据
  247. getFloorData() {
  248. let param = {
  249. ProjId: this.projectId,
  250. secret: this.secret
  251. }
  252. getSpaceFloor(param).then(res => {
  253. if (res.data.Result == 'success') {
  254. let data = this.changeArr(res.data.Content), floorData = []
  255. data.map(item => {
  256. if (!!item.children) {
  257. item.children.unshift({
  258. value: '',
  259. label: "未明确楼层"
  260. })
  261. }
  262. return item
  263. })
  264. data.map(item => {
  265. if (!!item.children && item.children.length) {
  266. item.children.map(child => {
  267. floorData.push({
  268. Code: item.value + "-" + child.value,
  269. Name: item.label + "-" + child.label
  270. })
  271. })
  272. }
  273. })
  274. this.floorData = floorData
  275. } else {
  276. this.$message.error(res.data.ResultMsg)
  277. }
  278. }).catch(() => {
  279. this.$message.error("请求出错")
  280. })
  281. },
  282. //将数组转换成optiosn格式
  283. changeArr(arr) {
  284. return arr.map(item => {
  285. if (item.floors && item.floors.length) {
  286. return {
  287. value: item.id,
  288. label: item.infos.BuildLocalName,
  289. children: item.floors.map(i => {
  290. return {
  291. value: i.id,
  292. label: i.infos.FloorLocalName || "未知",
  293. }
  294. })
  295. }
  296. } else {
  297. return {
  298. value: item.id,
  299. label: item.infos.BuildLocalName,
  300. children: null,
  301. isChilren: 1,
  302. }
  303. }
  304. })
  305. },
  306. changeRead() {
  307. this.onlyRead = !this.onlyRead
  308. this.getMain()
  309. },
  310. getEquipmentFamilyList() {
  311. getEquipmentFamily(res => {
  312. this.EquipmentList = res.Content
  313. })
  314. },
  315. //触发父组件change
  316. getClose(val) {
  317. this.$emit("close", val)
  318. },
  319. setGraphyId(graphyId, assetGroupList) {
  320. this.graphyId = graphyId
  321. this.assetGroupList = assetGroupList
  322. },
  323. //获取表头
  324. getHeaderData(code) {
  325. this.page.currentPage = 1
  326. this.mess = code
  327. this.changeCader()
  328. if(this.mess.deviceId){
  329. getTableHeader({
  330. code: this.mess.deviceId,
  331. ProjId: this.projectId
  332. }).then(res => {
  333. this.headers = res.data.Content;
  334. this.getMain()
  335. });
  336. }
  337. },
  338. //获取主体数据
  339. getMain() {
  340. let _this = this
  341. this.loading = true
  342. let param = {
  343. data: {
  344. customInfo: true,
  345. "limit": { // 分页查询, 选填.
  346. "skip": this.page.size * (this.page.currentPage - 1), // 跳过多少数据
  347. "count": this.page.size // 查询跳过300条数据之后的50条 (默认按照创建时间从大-->小排序)
  348. },
  349. id: "",
  350. type: [this.mess.deviceId]
  351. },
  352. secret: this.secret,
  353. ProjId: this.projectId
  354. }
  355. if (this.mess.buildId == "all") {
  356. param.data.id = this.mess.ProjId
  357. } else if (this.mess.buildId == "noKnow") {
  358. param.data.id = this.mess.ProjId
  359. param.data.direct = true
  360. } else if (this.mess.floorId == "noKnow") {
  361. param.data.id = this.mess.buildId
  362. param.data.direct = true
  363. } else if (this.mess.floorId && this.mess.floorId != "all") {
  364. param.data.id = this.mess.floorId
  365. } else if (this.mess.floorId == 'all') {
  366. param.data.id = this.mess.buildId
  367. } else {
  368. param.data.id = this.mess.ProjId
  369. }
  370. //type存在发送请求
  371. if (!!this.mess.deviceId) {
  372. getBillEquipList(param, res => {
  373. if (res.Result == "success") {
  374. this.loading = false
  375. res.Content = res.Content.map(item => {
  376. item.linkName = item.linkEquipLocalName || item.linkEquipName
  377. if (!!item.linkFamily) {
  378. this.assetGroupList.map(child => {
  379. if (item.linkFamily == child.code) {
  380. item.linkFamily = child.name
  381. }
  382. })
  383. }
  384. if (!!item.infos.DPManufacturerID) {
  385. item.infos.DPManufacturerID = item.infos.DPManufacturerID + "-" + item.infos.Brand + "/" + item.infos.Specification
  386. }
  387. if (!!item.infos.DPSupplierID) {
  388. item.infos.DPSupplierID = item.infos.DPSupplierID + "-" + item.infos.Supplier
  389. }
  390. if (!!item.infos.DPMaintainerID) {
  391. item.infos.DPMaintainerID = item.infos.DPMaintainerID + "-" + item.infos.Maintainer
  392. }
  393. if (!!item.infos.DPInsurerID) {
  394. item.infos.DPInsurerID = item.infos.DPInsurerID + "-" + item.infos.Insurer
  395. }
  396. return item
  397. })
  398. if (_this.onlyRead) {
  399. this.getBatch(res.Content)
  400. }
  401. _this.main = res.Content
  402. _this.copyMain = tools.deepCopy(res.Content)
  403. _this.page.total = res.TotalCount
  404. if (!!_this.hot) {
  405. _this.hot.destroy();
  406. _this.hot = null;
  407. }
  408. if (!!res.Content && res.Content.length) {
  409. _this.initHot();
  410. }
  411. } else {
  412. this.loading = false
  413. this.$message.error("请求错误:" + res.ResultMsg)
  414. }
  415. })
  416. }
  417. },
  418. //获取动态参数
  419. getBatch(data) {
  420. let param = {
  421. secret: this.secret,
  422. ProjId: this.projectId,
  423. data: {
  424. criterias: []
  425. }
  426. }
  427. if (!!data && data.length) {
  428. //一级遍历list
  429. data.map(item => {
  430. if (!!item.infos) {
  431. // 二级遍历对象infos
  432. for (let key in item.infos) {
  433. //判断是否是设定参数和动态参数
  434. if (!!item.infos[key]) {
  435. this.headers.map(child => {
  436. //如果一级标签为动态参数或者设定参数放入数据等待请求
  437. if (key == child.InfoPointCode && (child.InputMode == "L" || child.InputMode == "L1" || child.InputMode == "L2")) {
  438. param.data.criterias.push({
  439. id: item.id,
  440. code: key
  441. })
  442. }
  443. })
  444. }
  445. }
  446. }
  447. })
  448. if (param.data.criterias.length) {
  449. BeatchQueryParam(param, res => {
  450. if (!this.onlyRead) {
  451. return false
  452. }
  453. this.main = data.map(item => {
  454. res.Content.map(child => {
  455. if (item.id == child.id) {
  456. if (!!child.data || child.data == 0) {
  457. item.infos[child.code] = child.data
  458. } else {
  459. item.infos[child.code] = child.error ? "表号功能号格式错误" : "表号功能号不存在"
  460. }
  461. }
  462. })
  463. return item
  464. })
  465. this.hot.loadData(this.main)
  466. })
  467. }
  468. }
  469. },
  470. changeAssetsFalg() {
  471. if (this.linkNameFalg) {
  472. this.linkNameFalg = false
  473. } else {
  474. this.$confirm('<p>真的要在这里修改设备关联的资产么?</p><p>真的能通过列表信息找到想关联的资产么?</p><p>在这里修改关联的资产一定是因为之前关联错了要修改么?</p>', '提示', {
  475. dangerouslyUseHTMLString: true,
  476. confirmButtonText: '没错!我要改关联的资产',
  477. cancelButtonText: '我就点开看看',
  478. confirmButtonClass: 'cancelButtonClass',
  479. cancelButtonClass: 'cancelButtonClass'
  480. }).then(_ => {
  481. this.linkNameFalg = true
  482. }).catch(_ => {
  483. this.$message("取消")
  484. })
  485. }
  486. },
  487. //switch改变
  488. changeWatch() {
  489. this.reset()
  490. },
  491. //撤回
  492. undo() {
  493. this.hot.undo();
  494. },
  495. //刷新
  496. reset() {
  497. this.getMain();
  498. },
  499. //添加设备
  500. addDevice() {
  501. this.dialog.addDevice = true
  502. this.$nextTick(() => {
  503. this.$refs.assets.step(0)
  504. })
  505. },
  506. //下载
  507. download() {
  508. if (!this.onlyRead) {
  509. if (!!this.hot) {
  510. let fileName = this.mess.name + "-页数:" + this.page.currentPage + "-个数:" + this.main.length + "-总个数:" + this.page.total
  511. this.hot.getPlugin('exportFile').downloadFile("csv", { filename: fileName, columnHeaders: true, exportHiddenRows: true, exportHiddenColumns: true, rowHeaders: true })
  512. } else {
  513. this.$message("请确定存在表格")
  514. }
  515. } else {
  516. this.$message("下载需在编辑状态下")
  517. }
  518. },
  519. /**
  520. * 表头文案处理函数
  521. * @param list header数组数据
  522. *
  523. * @return 处理好的文案
  524. */
  525. delHeader(list) {
  526. let arr = tools.copyArr(list)
  527. // 如果不是只读状态,添加四大厂商选择
  528. if (!this.onlyRead) {
  529. // arr = showTools.arrToArr(arr)
  530. }
  531. let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2", "F1", "F2"]
  532. if (!this.onlyRead) {
  533. readArr.push("Own")
  534. }
  535. let data = showTools.changeHeader(arr, readArr, this.onlyRead, this.isWatch, this.allMess)
  536. data.unshift("操作", "当前关联的资产", "所属系统实例");
  537. return data;
  538. },
  539. /**
  540. * 表头数据处理函数
  541. * @param list header数组数据
  542. *
  543. * @return 处理好的数据格式
  544. */
  545. getType(list) {
  546. let arr = tools.copyArr(list)
  547. // 如果不是只读状态,添加四大厂商选择
  548. if (!this.onlyRead) {
  549. // arr = showTools.arrToArr(arr)
  550. }
  551. let data = showTools.showTypes(arr, this.onlyRead, this.isWatch, this.allMess)
  552. data.map(item => {
  553. if (
  554. item.data == "infos." + "Drawing" ||
  555. item.data == "infos." + "Pic" ||
  556. item.data == "infos." + "Nameplate" ||
  557. item.data == "infos." + "InstallPic" ||
  558. item.data == "infos." + "InstallDrawing"
  559. ) {
  560. item.renderer = text.picType
  561. }
  562. if (item.data == "infos." + "Archive" ||
  563. item.data == "infos." + "CheckReport" ||
  564. item.data == "infos." + "InsuranceFile") {
  565. item.renderer = text.fileType
  566. }
  567. })
  568. data.unshift(
  569. {
  570. data: "caozuo",
  571. renderer: tools.lookDetails,
  572. readOnly: true
  573. },
  574. {
  575. data: "linkName",
  576. readOnly: true
  577. }, {
  578. data: "linkSystem",
  579. renderer: text.systemList,
  580. readOnly: true
  581. }
  582. );
  583. // data.splice(1, 0, {
  584. // data: "flowBuild",
  585. // renderer: tools.customDropdownRenderer,
  586. // editor: "chosen",
  587. // chosenOptions: {
  588. // // multiple: true,//多选
  589. // data: this.floorData
  590. // }
  591. // })
  592. if (!!this.onlyRead) {
  593. data.map(item => {
  594. item.readOnly = true
  595. })
  596. }
  597. return data;
  598. },
  599. messShow(item) {
  600. //二维码
  601. if (item.infopoint_code == "EquipQRCode") {
  602. return {
  603. data: "infos." + item.infopoint_code,
  604. renderer: text.lookQRCode,
  605. readOnly: true
  606. }
  607. }
  608. if (item.collection_cmpt_code == "Enum") {
  609. return {
  610. data: "infos." + item.infopoint_code,
  611. renderer: this.customDropdownRenderer,
  612. editor: "chosen",
  613. chosenOptions: {
  614. // multiple: true,//多选
  615. data: item.dataSource || ""
  616. }
  617. };
  618. } else if (item.collection_cmpt_code == "Num") {
  619. return {
  620. data: "infos." + item.infopoint_code,
  621. type: "numeric",
  622. numericFormat: {
  623. pattern: "0,0.00"
  624. // culture: 'de-DE' // use this for EUR (German),
  625. // more cultures available on http://numbrojs.com/languages.html
  626. }
  627. };
  628. } else if (item.collection_cmpt_code == "Time") {
  629. return {
  630. data: "infos." + item.infopoint_code,
  631. type: "date",
  632. dateFormat: "YYYY-MM-DD",
  633. correctFormat: true
  634. };
  635. } else if (item.collection_cmpt_code == "text") {
  636. return {
  637. data: "infos." + item.infopoint_code
  638. };
  639. } else if (
  640. (item.info_point_code == "设备ID" ||
  641. item.info_point_code == "设备名称")
  642. ) {
  643. return {
  644. data: "infos." + item.infopoint_code,
  645. readOnly: true
  646. };
  647. } else if (item.collection_cmpt_code == "checkBox") {
  648. return {
  649. data: "infos." + item.infopoint_code,
  650. renderer: this.customDropdownRenderer,
  651. editor: "chosen",
  652. chosenOptions: {
  653. multiple: true,//多选
  654. data: item.dataSource || ""
  655. }
  656. };
  657. } else {
  658. return {
  659. data: "infos." + item.infopoint_code,
  660. }
  661. }
  662. },
  663. changeItem(item) {
  664. //二维码
  665. if (item.infopoint_code == "EquipQRCode" && item.visible) {
  666. return {
  667. data: "infos." + item.infopoint_code,
  668. renderer: text.lookQRCode,
  669. readOnly: true
  670. }
  671. }
  672. //厂商选择
  673. // if ((item.infopoint_code == "Brand" || item.infopoint_code == "Specification") && item.visible) {
  674. // return {
  675. // data: "infos." + item.infopoint_code,
  676. // renderer: tools.lookDetails,
  677. // readOnly: true
  678. // }
  679. // }
  680. // if (item.infopoint_code == "SupplierContractID" && item.visible) {
  681. // return {
  682. // data: "infos." + item.infopoint_code,
  683. // renderer: tools.lookDetails,
  684. // readOnly: true
  685. // }
  686. // }
  687. if (item.infopoint_code == "InsuranceNum" && item.visible) {
  688. //选择保单
  689. return {
  690. data: "infos." + item.infopoint_code,
  691. renderer: tools.lookDetails,
  692. readOnly: true
  693. }
  694. }
  695. if ((item.infopoint_code == "InsuranceFile" || item.infopoint_code == "Archive") && item.visible) {
  696. return {
  697. data: "infos." + item.infopoint_code,
  698. renderer: tools.lookDetails,
  699. readOnly: true
  700. }
  701. }
  702. if (
  703. (
  704. item.infopoint_code == "InstallPic" ||
  705. item.infopoint_code == "InstallDrawing" ||
  706. item.infopoint_code == "Nameplate" ||
  707. item.infopoint_code == "Pic" ||
  708. item.infopoint_code == "Drawing"
  709. ) && item.visible
  710. ) {
  711. return {
  712. data: "infos." + item.infopoint_code,
  713. renderer: tools.lookDetails,
  714. readOnly: true
  715. }
  716. }
  717. if (
  718. (
  719. item.infopoint_code == "Maintainer" ||
  720. item.infopoint_code == "Supplier" ||
  721. item.infopoint_code == "Insurer" ||
  722. item.infopoint_code == "InsurerContactor"
  723. )
  724. && item.visible
  725. ) {
  726. return {
  727. data: "infos." + item.infopoint_code,
  728. }
  729. }
  730. if (item.collection_cmpt_code == "Enum" && item.visible) {
  731. return {
  732. data: "infos." + item.infopoint_code,
  733. renderer: this.customDropdownRenderer,
  734. editor: "chosen",
  735. chosenOptions: {
  736. // multiple: true,//多选
  737. data: item.dataSource || ""
  738. }
  739. };
  740. } else if (item.collection_cmpt_code == "Num" && item.visible) {
  741. return {
  742. data: "infos." + item.infopoint_code,
  743. type: "numeric",
  744. numericFormat: {
  745. pattern: "0,0.00"
  746. // culture: 'de-DE' // use this for EUR (German),
  747. // more cultures available on http://numbrojs.com/languages.html
  748. }
  749. };
  750. } else if (item.collection_cmpt_code == "Time" && item.visible) {
  751. return {
  752. data: "infos." + item.infopoint_code,
  753. type: "date",
  754. dateFormat: "YYYY-MM-DD",
  755. correctFormat: true
  756. };
  757. } else if (item.collection_cmpt_code == "text" && item.visible) {
  758. return {
  759. data: "infos." + item.infopoint_code
  760. };
  761. } else if (
  762. (item.info_point_code == "设备ID" ||
  763. item.info_point_code == "设备名称") && item.visible
  764. ) {
  765. return {
  766. data: "infos." + item.infopoint_code,
  767. readOnly: true
  768. };
  769. } else if (item.collection_cmpt_code == "checkBox" && item.visible) {
  770. return {
  771. data: "infos." + item.infopoint_code,
  772. renderer: this.customDropdownRenderer,
  773. editor: "chosen",
  774. chosenOptions: {
  775. multiple: true,//多选
  776. data: item.dataSource || ""
  777. }
  778. };
  779. } else if (item.collection_cmpt_code == "Own" && item.visible) {
  780. return {
  781. data: "infos." + item.infopoint_code,
  782. renderer: text.idType,
  783. }
  784. } else {
  785. return undefined
  786. }
  787. },
  788. //初始化插件
  789. initHot() {
  790. var container = document.getElementById("handsontable");
  791. let winHeight = document.documentElement.clientHeight;
  792. this.hot = new Handsontable(container, {
  793. data: this.main,
  794. fixedColumnsLeft: 5,
  795. colHeaders: this.delHeader(this.headers), //表头文案
  796. columns: this.getType(this.headers), //数据显示格式
  797. filters: true,
  798. maxRows: this.main.length,
  799. height: winHeight - 100 - 50 - 200,
  800. columnSorting: true, //添加排序
  801. sortIndicator: true, //添加排序
  802. renderAllRows: true,
  803. // colWidths: 200,
  804. autoColumnSize: true,
  805. language: "zh-CN",
  806. manualColumnResize: true,
  807. manualColumnMove: true,
  808. dropdownMenu: [
  809. "filter_by_condition",
  810. "filter_by_value",
  811. "filter_action_bar"
  812. ],
  813. contextMenu: {
  814. items: {
  815. remove_row: {
  816. name: "删除选中设备"
  817. }
  818. }
  819. },
  820. // 事件
  821. afterChange: this.tdChange, //修改后
  822. afterFilter: this.trimmedRows, //排序前
  823. afterRemoveRow: this.romoveFm, //右键删除
  824. afterOnCellMouseDown: this.eventClick //鼠标点击
  825. });
  826. let pro = document.getElementById("hot-display-license-info");
  827. if (!!pro) {
  828. pro.parentNode.removeChild(pro);
  829. }
  830. this.isLoading = false;
  831. },
  832. //表格中的点击
  833. eventClick(el, rowArr) {
  834. //点击的是表头
  835. if (rowArr.row < 0) {
  836. return;
  837. }
  838. //被筛选过后的数组
  839. let trimmedArr = this.trimmedRows();
  840. //是否启用了排序
  841. let isSort = this.hot.getPlugin("columnSorting").isSorted();
  842. if (trimmedArr.length && isSort) {
  843. let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
  844. .__arrayMap;
  845. let infos = this.main[trimmedArr[sortArr[rowArr.row]]];
  846. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  847. } else if (isSort) {
  848. //排序后的数组
  849. let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
  850. let infos = this.main[sortArr[rowArr.row]];
  851. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
  852. } else if (trimmedArr.length) {
  853. let infos = this.main[trimmedArr[rowArr.row]];
  854. this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
  855. } else {
  856. let infos = this.main[rowArr.row];
  857. this.getInfors(infos, rowArr);
  858. }
  859. },
  860. tdChange(changeData, source) {
  861. if (!this.onlyRead) {
  862. if (changeData) {
  863. let trimmedArr = this.trimmedRows();
  864. let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
  865. let data = [];
  866. for (let i = 0; i < param.length; i++) {
  867. data.push(param[i]);
  868. }
  869. //如果data中包含/且data长度为1,将其转换成.
  870. if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
  871. changeData[0][1] = changeData[0][1].split("/").join(".")
  872. }
  873. //存在data进行修改请求
  874. if (data && data.length) {
  875. this.updateBusiness(data, changeData);
  876. }
  877. }
  878. }
  879. },
  880. //删除资产
  881. romoveFm() {
  882. let params = tools.differenceArr(this.main, this.copyMain)
  883. let _this = this
  884. if (params.length < 1) {
  885. return
  886. }
  887. let param = {
  888. secret: this.mess.secret,
  889. ProjId: this.mess.ProjId,
  890. data: {
  891. "criterias": []
  892. }
  893. }
  894. params.map(item => {
  895. param.data.criterias.push({ id: item.id })
  896. })
  897. this.$confirm("此操作将删除设备,是否继续?", "提示", {
  898. confirmButtonText: '确定',
  899. cancelButtonText: '取消',
  900. type: 'warning'
  901. }).then(() => {
  902. this.removeSys(param)
  903. }).catch(() => {
  904. this.reset()
  905. this.$message("取消删除")
  906. })
  907. // delProperty(param, res => {
  908. // _this.$message.success("删除成功")
  909. // _this.getMain()
  910. // })
  911. },
  912. async removeSys(param) {
  913. await delBatchList(param, res => {
  914. this.$message.success("删除成功")
  915. this.getMain()
  916. })
  917. },
  918. // 修改
  919. updateBusiness(data, change) {
  920. // data.map(item => {
  921. // if (!!item.flowBuild) {
  922. // item.building_id = item.flowBuild.split("-")[0]
  923. // item.floor_id = item.flowBuild.split("-")[1] || null
  924. // //不存在floor字段去除floor
  925. // if (!item.floor_id) {
  926. // delete item.floor_id
  927. // }
  928. // delete item.flowBuild
  929. // }
  930. // })
  931. let param = {
  932. ProjId: this.mess.ProjId,
  933. secret: this.mess.secret,
  934. data: {
  935. criterias: []
  936. }
  937. };
  938. //生成对应修改数据
  939. data.map((item, index) => {
  940. let arr = change[index][1].split(".");
  941. let info = {};
  942. info[arr[1]] = [{ value: item[arr[0]][arr[1]] != "" ? item[arr[0]][arr[1]] : null }];
  943. param.data.criterias.push({
  944. id: item.id,
  945. infos: info
  946. });
  947. });
  948. //对五大厂商进行特殊处理
  949. param.data.criterias.map(item => {
  950. if (!!item.infos.DPSupplierID) {
  951. item.infos.DPSupplierID[0].value = item.infos.DPSupplierID[0].value.split("-")[0]
  952. }
  953. if (!!item.infos.DPManufacturerID) {
  954. item.infos.DPManufacturerID[0].value = item.infos.DPManufacturerID[0].value.split("-")[0]
  955. }
  956. if (!!item.infos.DPInsurerID) {
  957. item.infos.DPInsurerID[0].value = item.infos.DPInsurerID[0].value.split("-")[0]
  958. }
  959. if (!!item.infos.DPMaintainerID) {
  960. item.infos.DPMaintainerID[0].value = item.infos.DPMaintainerID[0].value.split("-")[0]
  961. }
  962. if (!!item.infos.DPSpecificationID) {
  963. item.infos.DPSpecificationID[0].value = item.infos.DPSpecificationID[0].value.split("-")[0]
  964. }
  965. return item
  966. })
  967. updateBusiness(param).then(res => {
  968. });
  969. },
  970. //修改设备类型
  971. changeCader() {
  972. this.EquipmentList.map(item => {
  973. if (!!item.content && item.content.length) {
  974. item.content.map(child => {
  975. if (child.code == this.mess.deviceId) {
  976. this.deviceType.assetType = item.code
  977. this.deviceType.assetName = item.name
  978. }
  979. })
  980. }
  981. })
  982. },
  983. //获取到了正确的信息
  984. getInfors(infos, row) {
  985. //其他的开始判断
  986. let val = this.hot.colToProp(row.col);
  987. this.row = row.row
  988. this.messKey = val
  989. this.systemId = infos.id
  990. if (val == "caozuo") {
  991. window.open(`
  992. http://47.94.89.44:8058/spread?id=${infos.id}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
  993. // this.iframeSrc =
  994. // process.env.BASE_URL +
  995. // ":8889/#/details?perjectId=" +
  996. // this.projectId +
  997. // "&secret=" +
  998. // this.secret +
  999. // "&FmId=" +
  1000. // infos.id +
  1001. // "&type=1&code=" +
  1002. // infos.category.substring(2, 6);
  1003. // this.dialog.details = true
  1004. }
  1005. //图片弹窗
  1006. if (
  1007. val == "infos.InstallPic" ||
  1008. val == "infos.InstallDrawing" ||
  1009. val == "infos.Nameplate" ||
  1010. val == "infos.Drawing"
  1011. ) {
  1012. if (this.onlyRead) {
  1013. this.dialog.lookPic = true
  1014. this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
  1015. } else {
  1016. this.imgsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
  1017. this.dialog.uploadImgs = true
  1018. }
  1019. }
  1020. if (val == "linkSystem") {
  1021. this.dialog.systemType = true
  1022. }
  1023. if (val == "infos.Pic") {
  1024. this.picsArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
  1025. if (this.onlyRead) {
  1026. this.dialog.lookPic = true
  1027. } else {
  1028. this.dialog.pic = true
  1029. }
  1030. }
  1031. if (val == "infos.InsuranceFile" || val == "infos.Archive" || val == "infos.CheckReport") {
  1032. this.filesArr = this.main[row.row].infos ? (this.main[row.row].infos[val.split(".")[1]] ? this.main[row.row].infos[val.split(".")[1]] : []) : []
  1033. this.dialog.uploadFiles = true
  1034. }
  1035. if (val == "linkName" && this.linkNameFalg) {
  1036. this.category = this.main[row.row]
  1037. this.dialog.changeRea = true
  1038. }
  1039. if (val == "infos.EquipQRCode") {
  1040. this.qrcodeUrl = this.main[row.row].infos.EquipQRCode
  1041. if (!!this.qrcodeUrl) {
  1042. this.dialog.qrcode = true;
  1043. } else {
  1044. this.$message("此设备没有设备二维码")
  1045. }
  1046. }
  1047. if (this.onlyRead) {
  1048. return
  1049. }
  1050. if (val == "infos.DPManufacturerID") {
  1051. this.dialog.firm = true;
  1052. }
  1053. if (val == "infos.SupplierContractID") {
  1054. let falg = null
  1055. if (!!this.main[row.row].infos) {
  1056. if (!!this.main[row.row].infos.DPSupplierID) {
  1057. falg = this.main[row.row].infos.DPSupplierID.split("-")[0]
  1058. }
  1059. }
  1060. if (!!falg) {
  1061. this.id = falg
  1062. this.dialog.supply = true;
  1063. } else {
  1064. this.$message("请先选择供应商")
  1065. }
  1066. }
  1067. if (val == "infos.InsuranceNum") {
  1068. //选择保单
  1069. let falg = null
  1070. if (!!this.main[row.row].infos) {
  1071. if (!!this.main[row.row].infos.DPInsurerID) {
  1072. falg = this.main[row.row].infos.DPInsurerID.split("-")[0]
  1073. }
  1074. }
  1075. if (!!falg) {
  1076. this.id = falg
  1077. this.dialog.guarantee = true;
  1078. } else {
  1079. this.$message("请先选择保险商")
  1080. }
  1081. }
  1082. if (
  1083. val == "infos.DPSupplierID"
  1084. ) {
  1085. if (!!infos.linkId) {
  1086. this.dialog.supplier = true;
  1087. } else {
  1088. this.$message("该设备无关联资产")
  1089. }
  1090. }
  1091. if (val == "infos.DPMaintainerID") {
  1092. if (!!infos.linkId) {
  1093. this.dialog.maintainer = true;
  1094. } else {
  1095. this.$message("该设备无关联资产")
  1096. }
  1097. }
  1098. if (
  1099. val == "infos.DPInsurerID") {
  1100. if (!!infos.linkId) {
  1101. this.dialog.insurer = true;
  1102. } else {
  1103. this.$message("该设备无关联资产")
  1104. }
  1105. }
  1106. },
  1107. //获取被筛选掉的行号
  1108. trimmedRows() {
  1109. // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
  1110. var plugin = this.hot.getPlugin("trimRows").trimmedRows;
  1111. let dataLength = this.main.length;
  1112. let dataArr = new Array();
  1113. for (let i = 0; i < dataLength; i++) {
  1114. dataArr.push(i);
  1115. }
  1116. if (plugin.length <= 0) {
  1117. dataArr = undefined;
  1118. } else {
  1119. dataArr = this.array_diff(dataArr, plugin);
  1120. }
  1121. return dataArr || [];
  1122. // var DataArray = new Array();
  1123. // for (var i = 0; i < plugin.length; i++) {
  1124. // // 通过行号获取数据
  1125. // DataArray.push(this.hot.getSourceDataAtRow(plugin[i]));
  1126. // }
  1127. },
  1128. //去除数组中相同的元素
  1129. array_diff(a, b) {
  1130. for (var i = 0; i < b.length; i++) {
  1131. for (var j = 0; j < a.length; j++) {
  1132. if (a[j] == b[i]) {
  1133. a.splice(j, 1);
  1134. j = j - 1;
  1135. }
  1136. }
  1137. }
  1138. return a;
  1139. },
  1140. //如果选择供应商之后
  1141. supplierChange(data) {
  1142. for (let key in data) {
  1143. if (key == "venderId") {
  1144. data[key] = data[key] + "-" + data.name
  1145. this.utilToKey(key, "venderId", data, "DPSupplierID")
  1146. }
  1147. }
  1148. // tools.setItem(this.deviceType.code, this.main)
  1149. },
  1150. supplyChange(data) {
  1151. let changeData = { id: data }
  1152. this.utilToKey("id", "id", changeData, "SupplierContractID")
  1153. // tools.setItem(this.deviceType.code, this.main)
  1154. },
  1155. //保险合同
  1156. guaranteeChange(data) {
  1157. for (let key in data) {
  1158. this.utilToKey(key, "insuranceNo", data, "InsuranceNum")
  1159. if (key == "contractFile") {
  1160. if (!!data[key]) {
  1161. data[key] = [data[key]]
  1162. }
  1163. }
  1164. this.utilToKey(key, "contractFile", data, "InsuranceFile")
  1165. }
  1166. // tools.setItem(this.deviceType.code, this.main)
  1167. },
  1168. //选择型号修改
  1169. firmChange(data) {
  1170. for (let key in data) {
  1171. // this.utilToKey(key, "name", data, "Supplier")
  1172. // this.utilToKey(key, "email", data, "SupplierEmail")
  1173. // this.utilToKey(key, "website", data, "SupplierWeb")
  1174. // this.utilToKey(key, "phone", data, "SupplierPhone")
  1175. // this.utilToKey(key, "fox", data, "SupplierFax")
  1176. // this.utilToKey(key, "man", data, "SupplierContactor")
  1177. if (key == "venderId") {
  1178. data[key] = data[key] + "-" + data.name + "/" + data.brand
  1179. this.utilToKey(key, "venderId", data, "DPManufacturerID")
  1180. }
  1181. this.utilToKey(key, "specificationId", data, "DPSpecificationID")
  1182. }
  1183. },
  1184. //保险商变更
  1185. changeInsurer(data) {
  1186. for (let key in data) {
  1187. // this.utilToKey(key, "name", data, "Insurer")
  1188. // this.utilToKey(key, "email", data, "InsurerEmail")
  1189. // this.utilToKey(key, "website", data, "InsurerWeb")
  1190. // this.utilToKey(key, "phone", data, "InsurerFax")
  1191. // this.utilToKey(key, "man", data, "InsurerContactor")
  1192. if (key == "venderId") {
  1193. data[key] = data[key] + "-" + data.name
  1194. this.utilToKey(key, "venderId", data, "DPInsurerID")
  1195. }
  1196. }
  1197. // tools.setItem(this.deviceType.code, this.main)
  1198. },
  1199. //维修商变更
  1200. changeMaintainer(data) {
  1201. for (let key in data) {
  1202. // this.utilToKey(key, "name", data, "Maintainer")
  1203. // this.utilToKey(key, "email", data, "MaintainerEmail")
  1204. // this.utilToKey(key, "website", data, "MaintainerWeb")
  1205. // this.utilToKey(key, "phone", data, "MaintainerPhone")
  1206. // this.utilToKey(key, "fox", data, "MaintainerFax")
  1207. // this.utilToKey(key, "man", data, "MaintainerContactor")
  1208. if (key == "venderId") {
  1209. data[key] = data[key] + "-" + data.name
  1210. this.utilToKey(key, "venderId", data, "DPMaintainerID")
  1211. }
  1212. }
  1213. // tools.setItem(this.deviceType.code, this.main)
  1214. },
  1215. //上传文件弹窗触发事件
  1216. fileChange(keys) {
  1217. this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
  1218. // tools.setItem(this.deviceType.code, this.main)
  1219. },
  1220. //上传图片弹窗触发事件
  1221. imgChange(keys) {
  1222. this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
  1223. // tools.setItem(this.deviceType.code, this.main)
  1224. },
  1225. //设备图片弹窗改变事件
  1226. changePics(keys) {
  1227. this.setDataToMain(keys, this.messKey.split(".")[1], this.row)
  1228. // tools.setItem(this.deviceType.code, this.main)
  1229. },
  1230. utilToKey(key, name, data, messName) {
  1231. if (key == name) {
  1232. this.setDataToMain(data[key], messName, this.row)
  1233. }
  1234. },
  1235. //判断是否有值,有值赋值
  1236. setDataToMain(data, key, row) {
  1237. if (!!data && data != '--') {
  1238. if (!!this.main[row].infos) {
  1239. //falg确定每个的是否有值
  1240. this.main[row].infos[key] = data
  1241. this.updateBusiness([this.main[row]], [[0, "infos." + key, null, data]])
  1242. } else {
  1243. this.main[row].infos = {}
  1244. this.main[row].infos[key] = data
  1245. }
  1246. } else {
  1247. this.main[row].infos[key] = ''
  1248. }
  1249. }
  1250. },
  1251. watch: {
  1252. projectId(){
  1253. this.main = []
  1254. this.mess.deviceId = null
  1255. this.page.total = 0
  1256. }
  1257. }
  1258. };
  1259. </script>
  1260. <style lang="less">
  1261. .hanson-bar {
  1262. height: 40px;
  1263. padding: 5px;
  1264. font-size: 14px;
  1265. overflow: hidden;
  1266. margin-top: 10px;
  1267. line-height: 40px;
  1268. .iconfont {
  1269. font-size: 12px;
  1270. }
  1271. .el-button {
  1272. // margin-right: 10px;
  1273. }
  1274. }
  1275. .cancelButtonClass {
  1276. width: 180px;
  1277. }
  1278. </style>