123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <!--
- 系统清单
- -->
- <template>
- <div id="deviceList">
- <saga-title :mess="mess"></saga-title>
- <div class="table-main">
- <div class="search-header">
- <floor-cascader :type="'no'" @change="changeFloor"></floor-cascader>
- <my-cascader ref="cascader" @change="changeDevice"></my-cascader>
- </div>
- <hanson-table @close="close" ref="tableMain"></hanson-table>
- </div>
- <table-transfers></table-transfers>
- </div>
- </template>
- <script>
- import sagaTitle from "@/components/ledger/lib/title";
- import floorCascader from "@/components/ledger/lib/floorCascader";
- import myCascader from "@/components/ledger/lib/system";
- import hansonTable from "@/components/ledger/handsontables/system";
- import tableTransfers from "@/components/ledger/tableTransfers";
- import {
- mapGetters,
- mapActions
- } from "vuex";
- import { countGeneralSys } from "@/api/scan/request"
- import Handsontable from "handsontable-pro"
- import 'handsontable-pro/dist/handsontable.full.css'
- import zhCN from 'handsontable-pro/languages/zh-CN';
- export default {
- components: {
- sagaTitle,
- floorCascader,
- myCascader,
- hansonTable,
- tableTransfers
- },
- data() {
- return {
- mess: {
- perjectName: "",
- name: [
- {
- key: "系统",
- num: 0
- }
- ]
- },
- param: {
- buildId: "",
- floorId: "",
- deviceId: "",
- ProjId: '',
- secret: ''
- }
- };
- },
- computed: {
- ...mapGetters("layout", ["projectId", "secret", "userId"])
- },
- created() {
- this.param.ProjId = this.projectId
- this.param.secret = this.secret
- this.countGeneralSys()
- let deviceId = this.$route.params.deviceId;
- if (deviceId) {
- this.$nextTick(() => {
- this.$refs.cascader.changeVal([deviceId])
- })
- }
- },
- watch: {
- projectId() {
- this.param.ProjId = this.projectId
- this.param.secret = this.secret
- this.countGeneralSys()
- }
- },
- methods: {
- close(val) {
- this.countGeneralSys()
- if (!!val && !!val.Category) {
- if (this.$refs.cascader)
- this.$refs.cascader.changeVal([val.Category])
- }
- this.$refs.cascader.getData()
- },
- //获取系统统计信息
- countGeneralSys(){
- let param = {}
- countGeneralSys(param, res => {
- this.mess.name[0].num = res.Count
- })
- },
- //修改楼层
- changeFloor(value) {
- if (value[0]) {
- this.param.buildId = value[0]
- }
- if (value[1]) {
- this.param.floorId = value[1]
- } else {
- this.param.floorId = null
- }
- if (!!this.param.deviceId) {
- if (this.$refs.tableMain)
- this.$refs.tableMain.getHeaderData(this.param);
- }
- },
- //修改设备族
- changeDevice(value) {
- this.param.deviceId = value.Category
- if (value) {
- if (this.$refs.tableMain)
- this.$refs.tableMain.getHeaderData(this.param);
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- #deviceList {
- overflow: hidden;
- height: 100%;
- background-color: #fff;
- position: relative;
- .table-main {
- position: absolute;
- top: 87px;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #fff;
- // border-radius: 5px;
- // padding: 10px 0;
- }
- .search-header {
- overflow: hidden;
- padding: 0 10px 10px 10px;
- border-bottom: 1px solid #bcbcbc;
- }
- }
- </style>
|