assets.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293
  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 style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
  6. <i v-if="!onlyRead" class="el-icon-fa el-icon-fa-eye"></i>
  7. </span> -->
  8. <span>当前筛选条件下共{{ page.total || '--' }}资产</span>
  9. </div>
  10. <el-select v-model="onlyRead" @change="getHeaderData(mess)"
  11. style="width:100px;margin-right:20px;vertical-align:bottom;">
  12. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
  13. </el-select>
  14. <el-select v-model="showType" @change="initTable" style="width:130px;margin-right:10px;vertical-align:bottom;">
  15. <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
  16. </el-select>
  17. <el-button size="small" style="width: 80px;" @click="addDevice" icon="iconfont icon-tianjia">添加资产</el-button>
  18. <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点
  19. </el-button>
  20. <el-button size="small" style="width: 80px;" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
  21. <el-button v-show="!onlyRead" size="small" style="width: 80px;" @click="undo" icon="iconfont icon-undo">撤销
  22. </el-button>
  23. </div>
  24. <qrcode :qrcodeUrl="qrcodeUrl" :dialog="myDialog" :addBody="true" ref="qrcode"/>
  25. <upload-files-dialog
  26. :read="onlyRead ? true : false"
  27. ref="upload"
  28. @changeFile="fileChange"
  29. :keysArr="filesArr"
  30. :dialog="myDialog"
  31. :firmDataType="firmDataType"
  32. :infoType="infoType"
  33. />
  34. <upload-img-dialog
  35. :read="onlyRead ? true : false"
  36. @changeFile="imgChange"
  37. :keysArr="imgsArr"
  38. :dialog="myDialog"
  39. :firmDataType="firmDataType"
  40. :infoType="infoType"
  41. />
  42. <pic-dialog
  43. :read="onlyRead ? true : false"
  44. :dialog="myDialog"
  45. :keysArr="picsArr"
  46. @change="changePics"
  47. :firmDataType="firmDataType"
  48. :infoType="infoType"
  49. />
  50. <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
  51. <p>
  52. <i class="icon-wushuju iconfont"></i>
  53. 请选择设备族
  54. </p>
  55. </div>
  56. <div class="center middle_sty" style="height: 91%" v-show="mess.deviceId && (!tableData || !tableData.length)">
  57. <p>
  58. <i class="icon-wushuju iconfont"></i>
  59. 暂无数据
  60. </p>
  61. </div>
  62. <div v-show="mess.deviceId && tableData && tableData.length" v-loading="loading" id="handsontable"
  63. ref="handsontable"></div>
  64. <div v-show="tableData && tableData.length" class='right'>
  65. <my-pagination @change="getTableData" :page="page"/>
  66. </div>
  67. <!-- <dialog-assets :assetType="[this.mess.deviceId]" @close="closeDialog" ref="assets" v-if="myDialog.addDevice" :dialog="myDialog" ></dialog-assets> -->
  68. <!-- <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog> -->
  69. <look-pic :dialog="myDialog" :keysArr="picsArr"/>
  70. <!-- 不支持的输入方式 -->
  71. <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
  72. <el-row>
  73. 该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
  74. <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
  75. </el-row>
  76. <el-row style="margin-top:20px;" v-show="updateInputShow">
  77. <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
  78. v-model="updateInput"></el-input>
  79. </el-row>
  80. <span slot="footer" class="dialog-footer">
  81. <el-button @click="myDialog.update = false">取 消</el-button>
  82. <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
  83. </span>
  84. </el-dialog>
  85. <!-- 新增资产 -->
  86. <el-dialog class="add-assets" :title="showAddByDie?'未关联资产的设备批量创建资产':'确定新增资产类型'" @close="showAddByDie = false"
  87. :visible.sync="myDialog.addDevice"
  88. width="670px">
  89. <el-row>
  90. <my-cascader v-show="!showAddByDie" ref="cascader" :all="true" @change="changeCader"></my-cascader>
  91. <die-cascader v-show="showAddByDie" ref="dieCascader" :Family="addData.Family"
  92. @change="changeDevice"></die-cascader>
  93. <floor-cascader v-show="showAddByDie" @change="changeFloor"></floor-cascader>
  94. <div class="die-text" v-show="showAddByDie">当前筛选条件下有<span class="die-num">{{ dieNum }}</span>个设备可批量创建资产。</div>
  95. <el-link v-show="showAddByDie && dieNum" type="primary" :underline="false" @click="toDetaiPage"
  96. style="margin-left:10px;">查看详情
  97. </el-link>
  98. </el-row>
  99. <span slot="footer" class="dialog-footer">
  100. <el-button v-show="!showAddByDie" type="primary" @click="toAddbyDie">批量创建</el-button>
  101. <el-button v-show="!showAddByDie" type="primary" @click="toAddDevice">手动添加</el-button>
  102. <el-button v-show="showAddByDie" type="primary" @click="showAddByDie = false">返回</el-button>
  103. <el-button v-show="showAddByDie" type="primary" :disabled="dieNum == 0" @click="createByDie">批量创建</el-button>
  104. </span>
  105. </el-dialog>
  106. <!-- 维护信息弹窗-->
  107. <batchDialog
  108. ref="batchDialogs"
  109. @code="fourVendors"
  110. :firmName="firmName"
  111. :allObject="allObject"
  112. :page="batchPage"
  113. :newEnclosure="newEnclosure"
  114. @getAllData="getAllData"
  115. @multiples="multiples"
  116. @upDataDevice="upDataDevice"
  117. />
  118. </div>
  119. </template>
  120. <script>
  121. import {
  122. BeatchQueryParam,
  123. countPartsDie,
  124. createPropertys,
  125. deleteProperty,
  126. propertyLinkEq,
  127. propertyUpdate,
  128. queryProperty,
  129. updateProperty
  130. } from "@/api/scan/request";
  131. import {getDataDictionary} from "@/api/dict";
  132. import tools from "@/utils/scan/tools"
  133. import handsonUtils from "@/utils/scan/hasontableUtils"
  134. import showTools from "@/utils/handsontable/notShow"
  135. import buildFloor from '@/utils/handsontable/buildFloorData'
  136. import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
  137. import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
  138. import picDialog from "@/components/dialogs/list/picDialog"
  139. import qrcode from "@/components/business_space/lib/qrcode"
  140. import myPagination from "@/components/common/myPagination"
  141. import myCascader from "@/components/ledger/lib/assets"
  142. import floorCascader from "@/components/ledger/lib/floorCascader"
  143. import dieCascader from "@/components/ledger/lib/partsDieList"
  144. import {mapGetters} from "vuex"
  145. //图片查看
  146. import lookPic from "@/components/ledger/lib/lookImages"
  147. import Handsontable from "handsontable-pro"
  148. import 'handsontable-pro/dist/handsontable.full.css'
  149. import batchDialog from "../../dialogs/list/batchDialog";
  150. import dataTypeMap from "@/utils/handsontable/dataTypeMap"
  151. //下拉插件
  152. // import "@/assets/js/chosen.jquery.min";
  153. // import "@/assets/js/handsontable-chosen-editor";
  154. export default {
  155. components: {
  156. qrcode, //二维码页面
  157. uploadFilesDialog,
  158. uploadImgDialog,
  159. picDialog,
  160. myPagination,
  161. // dialogAssets,
  162. myCascader,
  163. floorCascader,
  164. dieCascader,
  165. // detailsDialog,
  166. lookPic,
  167. batchDialog
  168. },
  169. created() {
  170. buildFloor.getData(this.buildFloorData)
  171. },
  172. computed: {
  173. ...mapGetters("layout", ["projectId", "secret", "userId", 'group_code']),
  174. showTypes() {
  175. return this.onlyRead ?
  176. [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}] :
  177. [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
  178. }
  179. },
  180. data() {
  181. return {
  182. infoType: '',
  183. batchPage: {
  184. size: 100,
  185. sizes: [100, 200, 500, 1000],
  186. total: 0,
  187. currentPage: 1
  188. },
  189. newEnclosure: [],
  190. firmName: '',//维护信息显示厂家名称
  191. firmDataType: 'row',
  192. allObject: [],
  193. options: [{
  194. value: true,
  195. label: '只读模式'
  196. }, {
  197. value: false,
  198. label: '编辑模式'
  199. }],
  200. buildFloorData: [], //楼层数据
  201. tableData: [],
  202. mess: {},
  203. tableHeader: null,
  204. page: {
  205. size: 50,
  206. sizes: [10, 30, 50, 100, 150, 200],
  207. total: 0,
  208. currentPage: 1
  209. },
  210. myDialog: {
  211. qrcode: false, //二维码弹窗
  212. uploadFiles: false,//上传文件
  213. uploadImgs: false,//上传单个图片
  214. pic: false, //多个图片
  215. addDevice: false,//添加资产
  216. systemType: false,//关联系统
  217. details: false,//详情页
  218. changeRea: false,//关联资产
  219. lookPic: false,//图片查看
  220. update: false,//临时维护信息点
  221. },
  222. row: null, //被修改的row
  223. filesArr: [], //保存临时的文件key
  224. messKey: null,
  225. imgsArr: [], //临时保存的图片key数组
  226. picsArr: [], //临时资产图片keys数组
  227. copyMain: null,
  228. graphyId: null,
  229. assetGroupList: [],
  230. iframeSrc: "",
  231. id: 0,
  232. onlyRead: true,
  233. showType: 'Visible',
  234. linkNameFalg: false,
  235. qrcodeUrl: "", //二维码图片地址
  236. loading: false,
  237. deviceType: {}, //族3位编码及名称
  238. floorData: [],
  239. curDevice: '',//当前点击的资产id
  240. showAddByDie: false,//是否显示通过设备添加资产页面
  241. addData: {}, //添加资产选择的资产类型
  242. numParams: { // 查询设备部件数量条件
  243. category: '',
  244. buildId: '',
  245. floorId: '',
  246. Family: ''
  247. },
  248. dieNum: 0, // 查询设备部件数量
  249. inputMap: {
  250. flowBuild: {
  251. editable: true,
  252. code: "flowBuild",
  253. name: "建筑楼层",
  254. path: "flowBuild",
  255. category: 'STATIC',
  256. dataType: "ENUM"
  257. }
  258. }, //信息点和输入方式映射表
  259. updateInputShow: false, //是否显示临时维护输入框
  260. updateInfoPoint: '',//临时维护信息点
  261. updateInput: '', //临时维护信息点值
  262. };
  263. },
  264. methods: {
  265. //获取表头
  266. getHeaderData(code) {
  267. this.page.currentPage = 1
  268. this.mess = code
  269. if (this.mess.deviceId) {
  270. let params = {
  271. type: this.mess.deviceId,
  272. orders: "sort asc, name desc",
  273. };
  274. getDataDictionary(params, res => {
  275. this.tableHeader = res.content;
  276. this.codeToDataSource = {}
  277. this.tableHeader.forEach(item => {
  278. if (item.path) {
  279. this.inputMap[item.path] = item
  280. }
  281. if (item.dataSource) {
  282. try {
  283. this.codeToDataSource[item.code] = {}
  284. item.dataSource.forEach(dic => {
  285. this.codeToDataSource[item.code][dic.code] = dic.name;
  286. })
  287. } catch (e) {
  288. console.log(e);
  289. }
  290. }
  291. })
  292. this.getTableData()
  293. this.getAllData()
  294. // 信息维护
  295. this.newEnclosure = res.content.filter(i => i.dataType == dataTypeMap.ATTACHMENT)
  296. });
  297. }
  298. },
  299. //获取主体数据
  300. getTableData() {
  301. this.loading = true
  302. //type存在发送请求
  303. if (!!this.mess.deviceId) {
  304. let param = {
  305. pageSize: this.page.size,
  306. orders: "createTime desc, localName desc, localId desc, id desc",
  307. pageNumber: this.page.currentPage,
  308. filters: `family='${this.mess.deviceId}'`
  309. }
  310. if (this.mess.buildId == "noKnow") {
  311. param.filters += `;buildingId isNull`
  312. } else if (this.mess.buildId && this.mess.buildId != "all") {
  313. param.filters += `;buildingId='${this.mess.buildId}'`
  314. }
  315. if (this.mess.floorId == "noKnow") {
  316. param.filters += `;floorId isNull`
  317. } else if (this.mess.floorId && this.mess.floorId != "all") {
  318. param.filters += `;floorId='${this.mess.floorId}'`
  319. }
  320. propertyLinkEq(param, res => {
  321. this.loading = false
  322. this.tableData = res.content.map((item) => {
  323. if (item.hasOwnProperty("buildingId") && item.hasOwnProperty("floorId")) {
  324. item.flowBuild = item.buildingId + "-" + item.floorId
  325. } else if (item.hasOwnProperty("buildingId") && !item.hasOwnProperty("floorId")) {
  326. item.flowBuild = item.buildingId
  327. }
  328. return item
  329. })
  330. this.copyMain = tools.deepCopy(this.tableData)
  331. this.page.total = res.total
  332. if (this.tableData && this.tableData.length) {
  333. if (this.onlyRead) {
  334. this.getBatch(this.tableData)
  335. }
  336. this.initTable()
  337. }
  338. })
  339. }
  340. },
  341. //获取所以主体数据---用于维护信息
  342. getAllData() {
  343. if (!!this.mess.deviceId) {
  344. // 查询step2
  345. let params = {
  346. "cascade": [
  347. {
  348. "name": "building",
  349. "projection": [
  350. "localName",
  351. "name",
  352. "id"
  353. ]
  354. },
  355. {
  356. "name": "floor",
  357. "projection": [
  358. "localName",
  359. "name",
  360. "id"
  361. ]
  362. }
  363. ],
  364. filters: `family='${this.mess.deviceId}'`,
  365. pageSize: this.batchPage.size,
  366. orders: "createTime desc, equipId desc",
  367. pageNumber: this.batchPage.currentPage,
  368. "projection": [
  369. "buildingId",
  370. "floorId",
  371. "family",
  372. "localName",
  373. "localId",
  374. "equipId",
  375. "bimId",
  376. "id"
  377. ]
  378. };
  379. if (this.mess.buildId == "noKnow") {
  380. params.filters += `;buildingId isNull`
  381. } else if (this.mess.buildId && this.mess.buildId != "all") {
  382. params.filters += `;buildingId='${this.mess.buildId}'`
  383. }
  384. if (this.mess.floorId == "noKnow") {
  385. params.filters += `;floorId isNull`
  386. } else if (this.mess.floorId && this.mess.floorId != "all") {
  387. params.filters += `;floorId='${this.mess.floorId}'`
  388. }
  389. queryProperty(params, res => {
  390. this.allObject = res.content
  391. this.batchPage.total = res.total
  392. })
  393. }
  394. },
  395. //获取动态参数
  396. getBatch(data) {
  397. let param = {
  398. groupCode: this.group_code,
  399. appId: "datacenter",
  400. projectId: this.projectId,
  401. data: []
  402. };
  403. this.tableHeader.map(head => {
  404. if (head.category != 'STATIC') {
  405. data.map(item => {
  406. let cur = tools.dataForKey(item, head.path);
  407. if (cur) {
  408. param.data.push({
  409. objectId: item.id,
  410. infoCode: head.code
  411. });
  412. }
  413. });
  414. }
  415. });
  416. if (param.data.length) {
  417. BeatchQueryParam(param, res => {
  418. this.tableData = data.map(item => {
  419. res.data.map(child => {
  420. if (item.id == child.objectId) {
  421. if (child.data || child.data == 0) {
  422. this.tableHeader.map(head => {
  423. if (head.code == child.infoCode) {
  424. let contentVal = child.data
  425. if (this.codeToDataSource[child.infoCode]) {
  426. contentVal = this.codeToDataSource[child.infoCode][child.data]
  427. }
  428. tools.setDataForKey(item, head.path, contentVal);
  429. }
  430. });
  431. } else {
  432. this.tableHeader.map(head => {
  433. if (head.code == child.infoCode) {
  434. tools.setDataForKey(
  435. item,
  436. head.path,
  437. child.error ? child.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
  438. );
  439. }
  440. });
  441. }
  442. }
  443. });
  444. return item;
  445. });
  446. this.hot.loadData(this.tableData);
  447. });
  448. }
  449. },
  450. //撤回
  451. undo() {
  452. this.hot.undo();
  453. },
  454. //刷新-switch改变
  455. reset() {
  456. this.getTableData();
  457. },
  458. //添加资产
  459. addDevice() {
  460. this.myDialog.addDevice = true
  461. if (this.mess.deviceId) {
  462. this.$nextTick(() => {
  463. this.$refs.cascader.setValue(this.mess.deviceId)
  464. this.addData.Family = this.mess.deviceId
  465. this.numParams.Family = this.mess.deviceId
  466. })
  467. }
  468. },
  469. //手动创建
  470. toAddDevice() {
  471. if (this.addData.Family) {
  472. this.$router.push({
  473. path: "/ledger/propertyadd",
  474. query: this.addData
  475. });
  476. } else {
  477. this.$message("请选择设备族")
  478. }
  479. },
  480. //显示通过部件或设备创建资产页
  481. toAddbyDie() {
  482. if (this.addData.Family) {
  483. this.showAddByDie = true
  484. this.$nextTick(() => {
  485. this.$refs.dieCascader.getAllData()
  486. })
  487. } else {
  488. this.$message("请选择设备族")
  489. }
  490. },
  491. //格式化条件
  492. formatFilter() {
  493. let param = {
  494. filters: `classCode='${this.numParams.category}';propertyId isNull`
  495. }
  496. if (this.numParams.buildId == "noKnow") {
  497. param.filters += `;buildingId isNull`
  498. } else if (this.numParams.buildId && this.numParams.buildId != "all") {
  499. param.filters += `;buildingId='${this.numParams.buildId}'`
  500. }
  501. if (this.numParams.floorId == "noKnow") {
  502. param.filters += `;floorId isNull`
  503. } else if (this.numParams.floorId && this.numParams.floorId != "all") {
  504. param.filters += `;floorId='${this.numParams.floorId}'`
  505. }
  506. return param
  507. },
  508. //批量添加
  509. createByDie() {
  510. let param = this.formatFilter()
  511. createPropertys(param, res => {
  512. this.myDialog.addDevice = false
  513. this.$emit('getJson', { code: this.numParams.Family })
  514. this.$message.success("创建成功!")
  515. })
  516. },
  517. //获取未关联资产的设备或部件数量
  518. getNumDie() {
  519. let param = this.formatFilter()
  520. countPartsDie(param, res => {
  521. this.dieNum = res.count
  522. })
  523. },
  524. //查看详情
  525. toDetaiPage() {
  526. this.$router.push({
  527. path: "/ledger/addPropertys",
  528. query: this.numParams
  529. })
  530. },
  531. //选择设备类型-添加资产
  532. changeCader(val) {
  533. if (val.code && val.facility) {
  534. this.addData.Family = val.code
  535. this.addData.name = val.facility
  536. this.addData.showType = this.showType
  537. this.numParams.Family = val.code
  538. }
  539. },
  540. //选择设备或部件
  541. changeDevice(val) {
  542. if (val.code) {
  543. this.numParams.category = val.code
  544. } else {
  545. this.numParams.category = ''
  546. }
  547. this.getNumDie()
  548. },
  549. //选择建筑楼层
  550. changeFloor(value) {
  551. if (value[0]) {
  552. this.numParams.buildId = value[0]
  553. }
  554. if (value[1]) {
  555. this.numParams.floorId = value[1]
  556. } else {
  557. this.numParams.floorId = ''
  558. }
  559. this.getNumDie()
  560. },
  561. //下载
  562. download() {
  563. if (!this.onlyRead) {
  564. if (!!this.hot) {
  565. let fileName = this.mess.name + "-页数:" + this.page.currentPage + "-个数:" + this.tableData.length + "-总个数:" + this.page.total
  566. this.hot.getPlugin('exportFile').downloadFile("csv", {
  567. filename: fileName,
  568. columnHeaders: true,
  569. exportHiddenRows: true,
  570. exportHiddenColumns: true,
  571. rowHeaders: true
  572. })
  573. } else {
  574. this.$message("请确定存在表格")
  575. }
  576. } else {
  577. this.$message("下载需在编辑状态下")
  578. }
  579. },
  580. //格式化表头
  581. formatHeaderData(list) {
  582. let arr = tools.copyArr(list)
  583. let data = showTools.headerTextFilter(arr, 'property', this.onlyRead, this.showType, true)
  584. data.unshift("操作", "当前关联的设备")
  585. if (this.showType == "all") {
  586. data.splice(4, 0, "所属建筑楼层")
  587. }
  588. return data
  589. },
  590. //格式化表内容
  591. formatHeaderType(list) {
  592. let arr = tools.copyArr(list)
  593. let data = showTools.headerTypeFilter(arr, 'property', this.onlyRead, this.showType, true)
  594. data.unshift(
  595. {
  596. data: "caozuo",
  597. renderer: tools.lookDetails
  598. }, {
  599. data: "linkEquipLocalName",
  600. renderer: tools.LinkEquipLocalName,
  601. readOnly: true
  602. }
  603. )
  604. if (this.showType == "all") {
  605. data.splice(4, 0, {
  606. data: "flowBuild",
  607. renderer: tools.customDropdownRenderer,
  608. editor: "chosen",
  609. chosenOptions: {
  610. data: this.buildFloorData
  611. },
  612. readOnly: this.onlyRead
  613. })
  614. }
  615. return data
  616. },
  617. //初始化插件
  618. initTable() {
  619. var container = document.getElementById("handsontable");
  620. let winHeight = document.documentElement.clientHeight;
  621. if (this.hot) {
  622. this.hot.destroy();
  623. this.hot = null;
  624. }
  625. this.hot = new Handsontable(container, {
  626. data: this.tableData,
  627. fixedColumnsLeft: 4,
  628. colHeaders: this.formatHeaderData(this.tableHeader), //表头文案
  629. columns: this.formatHeaderType(this.tableHeader), //数据显示格式
  630. filters: true,
  631. maxRows: this.tableData.length,
  632. height: winHeight - 335,
  633. columnSorting: true, //添加排序
  634. sortIndicator: true, //添加排序
  635. renderAllRows: true,
  636. // observeChanges: false, //启用observeChanges插件
  637. // colWidths: 200,
  638. autoColumnSize: true,
  639. language: "zh-CN",
  640. manualColumnResize: true,
  641. manualColumnMove: true,
  642. dropdownMenu: [
  643. "filter_by_condition",
  644. "filter_by_value",
  645. "filter_action_bar"
  646. ],
  647. contextMenu: this.onlyRead ? false : {
  648. items: {
  649. remove_row: {
  650. name: "删除选中资产"
  651. }
  652. }
  653. },
  654. // 事件
  655. afterChange: this.handleUpdataTable, //修改后
  656. afterFilter: this.trimmedRows, //排序前
  657. afterRemoveRow: this.handleDeleteTableRow, //右键删除
  658. afterOnCellMouseDown: this.eventClick //鼠标点击
  659. });
  660. let pro = document.getElementById("hot-display-license-info");
  661. if (!!pro) {
  662. pro.parentNode.removeChild(pro);
  663. }
  664. this.isLoading = false;
  665. },
  666. //表格中的点击
  667. eventClick(el, rowArr) {
  668. //点击的是表头
  669. if (rowArr.row < 0) {
  670. return;
  671. }
  672. //被筛选过后的数组
  673. let trimmedArr = this.trimmedRows();
  674. //是否启用了排序
  675. let isSort = this.hot.getPlugin("columnSorting").isSorted();
  676. if (trimmedArr.length && isSort) {
  677. let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
  678. .__arrayMap;
  679. let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
  680. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col }, el);
  681. } else if (isSort) {
  682. //排序后的数组
  683. let sortArr = this.hot.getPlugin("columnSorting").rowsMapper.__arrayMap;
  684. let infos = this.tableData[sortArr[rowArr.row]];
  685. this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col }, el);
  686. } else if (trimmedArr.length) {
  687. let infos = this.tableData[trimmedArr[rowArr.row]];
  688. this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col }, el);
  689. } else {
  690. let infos = this.tableData[rowArr.row];
  691. this.getInfors(infos, rowArr, el);
  692. }
  693. },
  694. // 更新
  695. handleUpdataTable(changeData, source) {
  696. if (!this.onlyRead && source != 'ObserveChanges.change') {
  697. if (changeData) {
  698. let trimmedArr = this.trimmedRows();
  699. let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
  700. let data = [];
  701. for (let i = 0; i < param.length; i++) {
  702. data.push(param[i]);
  703. }
  704. //如果data中包含/且data长度为1,将其转换成.
  705. if (changeData.length == 1 && changeData[0][1].indexOf("/") > 0) {
  706. changeData[0][1] = changeData[0][1].split("/").join(".")
  707. }
  708. //存在data进行修改请求
  709. if (data && data.length) {
  710. this.updateProperty(data, changeData);
  711. }
  712. }
  713. }
  714. },
  715. //删除资产
  716. handleDeleteTableRow() {
  717. let params = tools.differenceArr(this.tableData, this.copyMain)
  718. let _this = this
  719. if (params.length < 1) {
  720. return
  721. }
  722. let param = []
  723. params.map(item => {
  724. param.push({ id: item.id })
  725. })
  726. this.$confirm("此操作将删除资产,是否继续?", "提示", {
  727. confirmButtonText: '确定',
  728. cancelButtonText: '取消',
  729. type: 'warning'
  730. }).then(() => {
  731. this.removeDevice(param)
  732. }).catch(() => {
  733. this.reset()
  734. this.$message("取消删除")
  735. })
  736. },
  737. // 删除资产
  738. async removeDevice(param) {
  739. await deleteProperty(param, res => {
  740. this.$message.success("删除成功")
  741. this.$emit('getJson', '')
  742. this.getTableData()
  743. })
  744. },
  745. // 更新
  746. updateProperty(data, change) {
  747. let param = {
  748. content: [],
  749. projection: []
  750. }, keyList = []
  751. //生成要修改字段列表
  752. change.map(item => {
  753. let key = item[1].split(".")[0]
  754. if (key == "flowBuild" && keyList.indexOf(key) == -1) {
  755. keyList.push("buildingId", "floorId")
  756. param.projection.push("buildingId", "floorId")
  757. }
  758. if (item[1] && keyList.indexOf(key) == -1) {
  759. keyList.push(key)
  760. }
  761. if (item[1] && item[3] == "" && param.projection.indexOf(key) == -1) {
  762. param.projection.push(key)
  763. }
  764. })
  765. //生成对应修改数据
  766. data.map((item, index) => {
  767. keyList.map(value => {
  768. if (value == "buildingId") {
  769. let itemData = tools.dataForKey(item, "flowBuild")
  770. if (itemData == "") {
  771. tools.setDataForKey(item, "buildingId", null)
  772. tools.setDataForKey(item, "floorId", null)
  773. } else {
  774. let BuildingId = itemData.split("-")[0]
  775. let FloorId = itemData.split("-")[1]
  776. if (BuildingId && FloorId) {
  777. tools.setDataForKey(item, "buildingId", BuildingId)
  778. tools.setDataForKey(item, "floorId", FloorId)
  779. } else if (BuildingId && !FloorId) {
  780. tools.setDataForKey(item, "buildingId", BuildingId)
  781. tools.setDataForKey(item, "floorId", null)
  782. }
  783. }
  784. } else {
  785. let itemData = tools.dataForKey(item, value)
  786. tools.setDataForKey(item, value, itemData == "" ? null : itemData)
  787. }
  788. });
  789. param.content.push(item)
  790. })
  791. updateProperty(param, res => {
  792. })
  793. },
  794. //修改资产类型
  795. // changeCader() {
  796. // if (this.mess.deviceId) {
  797. // let param = {
  798. // data: {
  799. // Filters: `EquipCode='${this.mess.deviceId}'`,
  800. // PageNumber: 1,
  801. // PageSize: 50
  802. // }
  803. // }
  804. // getEquipBelongs(param, res => {
  805. // if (res.Content.length) {
  806. // this.deviceType.assetType = res.Content[0].Family
  807. // this.deviceType.assetName = res.Content[0].FamilyName
  808. // }
  809. // })
  810. // }
  811. // },
  812. //获取到了正确的信息
  813. getInfors(infos, row, el) {
  814. let val = this.hot.colToProp(row.col);
  815. let inputData = this.inputMap[val];
  816. this.row = row.row;
  817. this.messKey = val;
  818. this.firmDataType = 'row'
  819. console.log(val, '=================================')
  820. switch (val) {
  821. //操作
  822. case 'caozuo':
  823. // window.open(`http://adm.sagacloud.cn:8058/spread?id=${infos.EquipID}&pid=${this.projectId}&secret=${this.secret}`,"_blank")
  824. // this.$message("开发中...")
  825. this.$router.push({
  826. path: "propertyDetails",
  827. query: {
  828. type: this.mess.deviceId,
  829. equipId: infos.id,
  830. equipName: infos.localName ? infos.localName : infos.name ? infos.name : '',
  831. equipCode: infos.localId ? infos.localId : '',
  832. data: this.tableData.map(item => {
  833. return {
  834. value: item.id,
  835. label: item.localName ? item.localName : item.name ? item.name : ''
  836. }
  837. })
  838. }
  839. })
  840. return false
  841. //资产二维码图片
  842. // case 'EquipQRCode':
  843. case 'defaultQRCode ':
  844. this.qrcodeUrl = this.tableData[row.row][val];
  845. if (!!this.qrcodeUrl) {
  846. this.myDialog.qrcode = true;
  847. } else {
  848. this.$message("此资产没有资产二维码");
  849. }
  850. return false
  851. //关联系统
  852. case 'linkSystem':
  853. if (!this.onlyRead) {
  854. this.curDevice = infos.EquipID;
  855. this.systemList = this.tableData[row.row].linkSystem || [];
  856. this.myDialog.systemType = true;
  857. }
  858. return false
  859. //关联资产
  860. case 'linkEquipLocalName':
  861. if (this.linkNameFalg) {
  862. this.myDialog.changeRea = true;
  863. }
  864. return false
  865. //保险文件--资产文档--安装质检报告
  866. case 'infos.insuranceFile': //保险文件
  867. case 'infos.archive': //设备文档
  868. case 'infos.checkReport': //安装质检报告
  869. case 'infos.maintainManual': //维修保养手册
  870. case 'infos.approachingAcceptance': //进场验收单
  871. case 'infos.acceptanceReport': //验收报告
  872. case 'infos.operationManual': //操作说明书
  873. case 'infos.originalCertificate': //原厂证明
  874. case 'infos.testReport': //检测报告
  875. case 'infos.productCertification': //产品合格证
  876. case 'infos.installInstruction': //安装说明书
  877. case 'infos.supplierContractID': //供应合同
  878. case 'infos.drawing': //设备图纸
  879. case 'infos.installDrawing': //安装图纸
  880. let IPSdata = tools.dataForKey(this.tableData[row.row], val);
  881. this.filesArr = IPSdata ? IPSdata : [];
  882. this.myDialog.uploadFiles = true;
  883. return false
  884. //安装照片--设备铭牌照片
  885. case 'infos.installPic':
  886. case 'infos.nameplate':
  887. let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
  888. this.imgsArr = SSPPdata ? SSPPdata : [];
  889. this.myDialog.uploadImgs = true;
  890. return false
  891. //设备照片
  892. case 'infos.pic':
  893. let Pdata = tools.dataForKey(this.tableData[row.row], val);
  894. this.picsArr = Pdata ? Pdata : [];
  895. this.myDialog.pic = true;
  896. return false
  897. //包含的部件字段
  898. case 'Count':
  899. if (this.onlyRead) {
  900. this.$router.push({ path: '/ledger/parts', query: { deviceId: infos.EquipID } });
  901. } else {
  902. this.$router.push({
  903. path: '/ledger/partsmanage',
  904. query: { deviceId: infos.EquipID, typeId: this.mess.deviceId }
  905. });
  906. }
  907. return false
  908. default:
  909. break;
  910. }
  911. if (!this.onlyRead && !inputData.editable) {
  912. this.$message("该信息点的值为自动生成,不可人工维护!");
  913. return false;
  914. }
  915. if (!this.onlyRead && showTools.inputModeArr.indexOf(inputData.dataType) == '-1') {
  916. this.updateInfoPoint = val;
  917. this.updateInput = tools.dataForKey(this.tableData[row.row], val);
  918. this.myDialog.update = true;
  919. return false;
  920. }
  921. },
  922. //关闭临时维护弹窗回调
  923. handleCloseUpdate() {
  924. this.updateInputShow = false
  925. this.updateInfoPoint = ''
  926. this.updateInput = ''
  927. },
  928. //更新临时维护信息点
  929. handleClickUpdate() {
  930. tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
  931. this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
  932. this.updateInputShow = false
  933. this.myDialog.update = false
  934. this.updateInput = ''
  935. },
  936. //获取被筛选掉的行号
  937. trimmedRows() {
  938. var plugin = this.hot.getPlugin("trimRows").trimmedRows;
  939. let dataLength = this.tableData.length;
  940. let dataArr = new Array();
  941. for (let i = 0; i < dataLength; i++) {
  942. dataArr.push(i);
  943. }
  944. if (plugin.length <= 0) {
  945. dataArr = undefined;
  946. } else {
  947. dataArr = this.array_diff(dataArr, plugin);
  948. }
  949. return dataArr || [];
  950. },
  951. //去除数组中相同的元素
  952. array_diff(a, b) {
  953. for (var i = 0; i < b.length; i++) {
  954. for (var j = 0; j < a.length; j++) {
  955. if (a[j] == b[i]) {
  956. a.splice(j, 1);
  957. j = j - 1;
  958. }
  959. }
  960. }
  961. return a;
  962. },
  963. //修改关联的资产
  964. changeProperty(val) {
  965. this.setDataToMain(val.propertyId, 'propertyId', this.row);
  966. this.setDataToMain(val.linkEquipLocalName, 'linkEquipLocalName', this.row);
  967. },
  968. //上传文件弹窗触发事件
  969. fileChange(keys, type, file) {
  970. if (type === 'dialog') {
  971. // this.information = keys
  972. this.newEnclosure.forEach(i => {
  973. if (i.path == keys) {
  974. this.$set(i, 'value', file)
  975. }
  976. return i
  977. })
  978. } else {
  979. this.setDataToMain(keys, this.messKey, this.row);
  980. }
  981. },
  982. //上传图片弹窗触发事件
  983. imgChange(keys, type, file) {
  984. if (type === 'dialog') {
  985. // this.information = keys
  986. this.newEnclosure.forEach(i => {
  987. if (i.path == keys) {
  988. this.$set(i, 'value', file)
  989. }
  990. return i
  991. })
  992. } else {
  993. this.setDataToMain(keys, this.messKey, this.row);
  994. }
  995. },
  996. //关联系统更改
  997. changeSystemType(data) {
  998. tools.setDataForKey(this.tableData[this.row], "linkSystem", data)
  999. },
  1000. //资产图片弹窗改变事件
  1001. changePics(keys, type, file) {
  1002. if (type === 'dialog') {
  1003. // this.information = keys
  1004. this.newEnclosure.forEach(i => {
  1005. if (i.path == keys) {
  1006. this.$set(i, 'value', file)
  1007. }
  1008. return i
  1009. })
  1010. } else {
  1011. this.setDataToMain(keys, this.messKey, this.row);
  1012. }
  1013. },
  1014. utilToKey(key, name, data, messName) {
  1015. if (key == name) {
  1016. this.setDataToMain(data[key], messName, this.row)
  1017. }
  1018. },
  1019. //判断是否有值,有值赋值
  1020. setDataToMain(data, key, row) {
  1021. if (!!data && data != '--') {
  1022. if (!!this.tableData[row]) {
  1023. tools.setDataForKey(this.tableData[row], key, data);
  1024. this.handleUpdataTable([[row, key, null, data]], "edit");
  1025. } else {
  1026. this.tableData[row] = {};
  1027. tools.setDataForKey(this.tableData[row], key, data);
  1028. }
  1029. } else {
  1030. tools.setDataForKey(this.tableData[row], key, "");
  1031. }
  1032. },
  1033. //未知
  1034. setGraphyId(graphyId, assetGroupList) {
  1035. this.graphyId = graphyId
  1036. this.assetGroupList = assetGroupList
  1037. },
  1038. // 批量信息维护
  1039. Batch() {
  1040. this.firmDataType = 'dialog'
  1041. this.$refs.batchDialogs.batchDialog = true
  1042. },
  1043. // 接受维护信息传来的code,显示弹窗
  1044. fourVendors(code) {
  1045. this.firmDataType = 'dialog'
  1046. switch (code) {
  1047. //品牌型号弹窗
  1048. case 'dpManufacturerId':
  1049. // this.dataFirmType = 'dia'
  1050. this.myDialog.firm = true;
  1051. break;
  1052. //供应商信息弹窗
  1053. case 'dpSupplierId':
  1054. this.myDialog.supplier = true;
  1055. break;
  1056. //维修商信息弹窗
  1057. case 'dpMaintainerId':
  1058. this.myDialog.maintainer = true;
  1059. break;
  1060. //保险公司信息
  1061. case 'dpInsurerId':
  1062. this.myDialog.insurer = true;
  1063. break;
  1064. }
  1065. },
  1066. forValue(arr, val) {
  1067. let enclosure = []
  1068. arr && arr.length && arr.map(i => {
  1069. if (i.Path == val) {
  1070. enclosure = i.value
  1071. }
  1072. })
  1073. return enclosure
  1074. },
  1075. multiples(val) {
  1076. this.firmDataType = 'dialog'
  1077. switch (val) {
  1078. case "infos.insuranceFile": //保险文件
  1079. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1080. this.infoType = val;
  1081. this.myDialog.uploadFiles = true;
  1082. break;
  1083. case "infos.archive": //设备文档
  1084. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1085. this.infoType = val;
  1086. this.myDialog.uploadFiles = true;
  1087. break;
  1088. case "infos.checkReport": //安装质检报告
  1089. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1090. this.infoType = val;
  1091. this.myDialog.uploadFiles = true;
  1092. break;
  1093. case "infos.maintainManual": //维修保养手册
  1094. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1095. this.infoType = val;
  1096. this.myDialog.uploadFiles = true;
  1097. break;
  1098. case "infos.approachingAcceptance": //进场验收单
  1099. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1100. this.infoType = val;
  1101. this.myDialog.uploadFiles = true;
  1102. break;
  1103. case "infos.acceptanceReport": //验收报告
  1104. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1105. this.infoType = val;
  1106. this.myDialog.uploadFiles = true;
  1107. break;
  1108. case "infos.operationManual": //操作说明书
  1109. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1110. this.infoType = val;
  1111. this.myDialog.uploadFiles = true;
  1112. break;
  1113. case "infos.originalCertificate": //原厂证明
  1114. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1115. this.infoType = val;
  1116. this.myDialog.uploadFiles = true;
  1117. break;
  1118. case "infos.testReport": //检测报告
  1119. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1120. this.infoType = val;
  1121. this.myDialog.uploadFiles = true;
  1122. break;
  1123. case "infos.productCertification": //产品合格证
  1124. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1125. this.infoType = val;
  1126. this.myDialog.uploadFiles = true;
  1127. break;
  1128. case "infos.installInstruction": //安装说明书
  1129. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1130. this.infoType = val;
  1131. this.myDialog.uploadFiles = true;
  1132. break;
  1133. case "infos.drawing": //设备图纸
  1134. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1135. this.infoType = val;
  1136. this.myDialog.uploadFiles = true;
  1137. break;
  1138. case "infos.installDrawing": //安装图纸
  1139. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1140. this.infoType = val;
  1141. this.myDialog.uploadFiles = true;
  1142. break;
  1143. case "infos.supplierContract": //供应合同
  1144. this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1145. this.infoType = val;
  1146. this.myDialog.uploadFiles = true;
  1147. break;
  1148. case "infos.installPic"://安装照片
  1149. this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1150. this.infoType = val
  1151. this.myDialog.uploadImgs = true;
  1152. break;
  1153. case "infos.nameplate"://设备铭牌照片
  1154. this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1155. this.infoType = val
  1156. this.myDialog.uploadImgs = true;
  1157. break;
  1158. //设备照片
  1159. case "infos.pic"://设备照片
  1160. this.picsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
  1161. this.infoType = val
  1162. this.myDialog.pic = true;
  1163. break;
  1164. }
  1165. },
  1166. upDataDevice(type, data1, data2) {
  1167. let param = { content: data1 }
  1168. let param1 = { content: data2 }
  1169. if (type === 1) { //增量
  1170. //LedgerParam
  1171. let filterParam = this.filterCheck(param, 'sole')
  1172. let filterParam1 = this.filterCheck(param1, 'multiple')
  1173. if (filterParam) {
  1174. updateProperty(param, res => {
  1175. });
  1176. }
  1177. if (filterParam1) {
  1178. param1.content.map(i => {
  1179. i.equipId = i.id
  1180. delete i.id
  1181. return i
  1182. })
  1183. setTimeout(() => {
  1184. propertyUpdate(param1, res => {
  1185. })
  1186. })
  1187. }
  1188. }
  1189. if (type === 2) {//覆盖
  1190. let filterParams = this.filterCheck(param, 'sole')
  1191. if (filterParams) {
  1192. updateProperty(param, res => {
  1193. });
  1194. }
  1195. }
  1196. setTimeout(() => {
  1197. this.getTableData()
  1198. this.getAllData()
  1199. }, 10)
  1200. },
  1201. filterCheck(arr, type) {
  1202. if (type === 'sole') {
  1203. for (let i of arr.content) {
  1204. for (let j in i.infos) {
  1205. if (Array.isArray(i.infos[j]) && i.infos[j].length < 1) {
  1206. delete i.infos[j]
  1207. }
  1208. }
  1209. return Object.keys(i.infos).length
  1210. }
  1211. } else if (type === 'multiple') {
  1212. let nArr = [];
  1213. arr.content.forEach(i => {
  1214. let { equipId, ...value } = i
  1215. nArr.push({ infos: value })
  1216. })
  1217. for (let j of nArr) {
  1218. return Object.keys(j.infos).length
  1219. }
  1220. }
  1221. }
  1222. },
  1223. watch: {
  1224. projectId() {
  1225. this.buildFloorData = []
  1226. buildFloor.getData(this.buildFloorData)
  1227. this.main = []
  1228. this.mess.deviceId = null
  1229. this.page.total = 0
  1230. },
  1231. showTypes: {
  1232. handler(newName, oldName) {
  1233. if (newName && newName[0] && newName[0].value) {
  1234. this.showType = newName[0].value
  1235. } else {
  1236. this.showType = ""
  1237. }
  1238. },
  1239. immediate: true,
  1240. deep: true
  1241. }
  1242. }
  1243. };
  1244. </script>
  1245. <style lang="less">
  1246. .hanson-bar {
  1247. height: 40px;
  1248. padding: 5px 0;
  1249. font-size: 14px;
  1250. overflow: hidden;
  1251. margin-top: 0;
  1252. line-height: 40px;
  1253. .iconfont {
  1254. font-size: 12px;
  1255. }
  1256. }
  1257. .add-assets {
  1258. .el-dialog__body {
  1259. height: 130px;
  1260. .die-text {
  1261. margin-left: 10px;
  1262. font-weight: bold;
  1263. clear: both;
  1264. padding-top: 25px;
  1265. padding-bottom: 10px;
  1266. .die-num {
  1267. width: 100px;
  1268. text-align: center;
  1269. display: inline-block;
  1270. border-bottom: 1px solid #333;
  1271. }
  1272. }
  1273. }
  1274. }
  1275. .cancelButtonClass {
  1276. width: 180px;
  1277. }
  1278. </style>