瀏覽代碼

主要设备清单接口初步调试

zhulizhen1111 4 年之前
父節點
當前提交
4b8e6d9bb4

+ 2 - 2
src/api/equipmentList.js

@@ -1,7 +1,7 @@
 import httputils from "@/api/httputils"
 // 设备设施设备-设备清单接口
-export function queryEquipmentList({ getParams }) {
-    return httputils.getJson(`/api/data/glsms_asset/query`, getParams)
+export function queryEquipmentList({ data, postParams }) {
+    return httputils.fetchJson(`/api/data/glsms_asset/query`, data, postParams)
 }
 // 设备设施设备-材料清单接口
 export function queryMaterialList({ getParams }) {

+ 12 - 11
src/store/index.js

@@ -1,6 +1,6 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-import { login } from '@/api/login.js'
+import Vue from "vue"
+import Vuex from "vuex"
+import { login } from "@/api/login.js"
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
@@ -8,10 +8,11 @@ export default new Vuex.Store({
         permissions: [], //权限信息 "GLSMS_VIEW":"说明书查看"、"GLSMS_SYMBOL_MANAGE": "图例库管理"、 "GLSMS_PLANARGRAPH_MANAGE":"平面图维护"
         plazas: [], //项目列表
         userInfo: {
-            employeename: '', //用户名称:艾宇;
-            orgCode: '',
-            username: 'aiyu6', //账户名称
+            employeename: "", //用户名称:艾宇;
+            orgCode: "",
+            username: "aiyu6", //账户名称
         },
+        plazaId: "1001145",
     },
 
     mutations: {
@@ -38,12 +39,12 @@ export default new Vuex.Store({
             await login({
                 username: palyload,
             }).then((res) => {
-                if (res.result == 'success') {
-                    commit('SETISREQUESTtAUTH', true)
-                    commit('SETAUTHMSG', res)
+                if (res.result == "success") {
+                    commit("SETISREQUESTtAUTH", true)
+                    commit("SETAUTHMSG", res)
                 } else {
-                    console.log('接口报错!!')
-                    commit('SETISREQUESTtAUTH', false)
+                    console.log("接口报错!!")
+                    commit("SETISREQUESTtAUTH", false)
                 }
             })
         },

+ 5 - 3
src/utils/plugins/components.js

@@ -99,10 +99,12 @@ var system = [
                         {
                             label: "冷热源机房内",
                             id: "NTQD1",
+                            param: { CLASSSTRUCTUREID: "1572" },
                         },
                         {
                             label: "楼层末端",
                             id: "NTQD2",
+                            param: { CLASSSTRUCTUREID: "1592" },
                         },
                     ],
                     id: "NTQD",
@@ -273,17 +275,17 @@ var system = [
                         {
                             label: "BA楼宇智能化",
                             id: "RDQD1",
-                            param: { sblx: ["BA"] },
+                            param: { CLASSSTRUCTUREID: "1572" },
                         },
                         {
                             label: "门禁管理",
                             id: "RDQD2",
-                            param: { sblx: ["MJ"] },
+                            param: { CLASSSTRUCTUREID: "1622" },
                         },
                         {
                             label: "视频监控",
                             id: "RDQD3",
-                            param: { sblx: ["JK"] },
+                            param: { CLASSSTRUCTUREID: "1559" },
                         },
                     ],
                 },

+ 16 - 9
src/views/equipment/eqDialog.vue

@@ -4,20 +4,26 @@
         <el-dialog :title='`${systemName}-${dialogInfo.label}`' :visible.sync='visible' :fullscreen='true'>
             <div class='top'></div>
             <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
-                <el-tab-pane v-for='(value,index) in dialogInfo.children' :key='"u"+index' :label='`${value.label}`' :name='`${value.id}`'>
+                <el-tab-pane
+                    v-for='(value,index) in dialogInfo.children'
+                    :key='"u"+index'
+                    :label='`${value.label}`'
+                    :name='`${value.param.CLASSSTRUCTUREID}`'
+                >
                     <div v-if='value.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
                         <rotation :rotationImg='rotationImg'></rotation>
                     </div>
-                    <tableList v-if='value.id=="GDWB1"' ref='list'></tableList>
-                    <tableList v-if='value.id=="GDWB2"' ref='list'></tableList>
-                    <tableList v-else ref='list'></tableList>
+                    <tableList v-if='value.id.slice(0,4)=="RDQD"' ref='list' :param='param' major='弱电'></tableList>
+                    <tableList v-if='value.id.slice(0,4)=="NTQD"' ref='list' :param='param' major='暖通'></tableList>
                 </el-tab-pane>
             </el-tabs>
+            <tj-table v-if='Object.keys(dialogInfo).length>0 && dialogInfo.id.slice(0,4)=="TJQD"' major='土建'></tj-table>
         </el-dialog>
     </div>
 </template>
 <script>
 import tableList from './table/eqListTable'
+import tjTable from './table/tjTable'
 
 export default {
     props: ['systemName'],
@@ -26,22 +32,23 @@ export default {
             activeName: '',
             visible: false,
             dialogInfo: {},
+            param: '',
             rotationImg: [require('@/assets/imgs/eq.jpg'), require('@/assets/imgs/survey_pop2.png'), require('@/assets/imgs/survey_pop1.png')]
         }
     },
     mounted() {},
-    components: { tableList },
+    components: { tableList, tjTable },
     methods: {
         showModal(item) {
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
-                this.activeName = this.dialogInfo.children[0].id
-                console.log(this.activeName)
+                this.activeName = this.dialogInfo.children[0].param.CLASSSTRUCTUREID
             }
         },
-        handleClick(tab, event) {
-            console.log(tab, event)
+        handleClick(tab) {
+            this.param = tab.name
+            console.log(tab)
         }
     }
 }

+ 21 - 15
src/views/equipment/table/eqListTable.vue

@@ -2,10 +2,10 @@
 <template>
     <div class='eq-list'>
         <div class='eq-list-top'>
-            <Select width='146' tipPlace='top' caption='品牌:' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
-            <Select width='120' tipPlace='top' caption='楼层:' :selectdata='dataSelect2' style='margin:0 12px'></Select>
-            <Select width='224' tipPlace='top' caption='生产厂商:' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
-            <a-input-search placeholder style='width: 192px;margin-left:12px;height:32px;' @search='onSearch' />
+            <Select width='146' tipPlace='top' caption='品牌:' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
+            <Select width='120' tipPlace='top' caption='楼层:' :selectdata='dataSelect2' style='margin:0 12px' @change='getList'></Select>
+            <Select width='224' tipPlace='top' caption='生产厂商:' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
+            <a-input-search placeholder style='width: 192px;margin-left:12px;height:32px;' @search='getList' />
         </div>
         <el-table :data='tableData' style='width: 100%'>
             <el-table-column type='index' label='序号' width='80'></el-table-column>
@@ -50,31 +50,37 @@ export default {
             size: 10
         }
     },
-    props: [],
+    props: ['param', 'major'],
     methods: {
-        handleChange() {},
-        onSearch() {},
         pageChanged(page, size) {
             this.currentPage = page
             this.size = size
             this.getList()
         },
         getList() {
-            let getParams = {
+            let postParams = {
+                CLASSSTRUCTUREID: this.param
+            }
+            let data = {
                 page: this.currentPage,
                 size: this.size,
-                major: '弱电',
-                system: 'MJ'
-                // orderBy: 1,
-                // keyword: ''
+                plazaId: this.$store.state.plazaId,
+                major: this.major
             }
-            queryEquipmentList({ getParams }).then(res => {
+            queryEquipmentList({ data, postParams }).then(res => {
                 console.log(res)
-                this.tableData = res.data
-                this.total = res.count
+                this.tableData = res.data.data
+                this.total = res.data.count
             })
         }
     },
+    watch: {
+        param(newV, oldV) {
+            if (newV !== oldV) {
+                this.getList()
+            }
+        }
+    },
     mounted() {
         this.getList()
     }

+ 8 - 18
src/views/equipment/table/tjTable.vue

@@ -25,28 +25,19 @@
     </div>
 </template>
 <script>
-import Select from '@/components/Select/Select.vue'
 import { queryEquipmentList } from '@/api/equipmentList.js'
 export default {
-    components: { Select },
     data() {
         return {
             pageSize: 10,
-            dataSelect2: [
-                { id: 'test1', name: '选择项' },
-                { id: 'test2', name: '单平米' },
-                { id: 'test3', name: '下级分项' },
-                { id: 'test4', name: '滑动平均滑动平均' }
-            ],
             tableData: [],
             total: 0,
             currentPage: 1,
             size: 10
         }
     },
-    props: [],
+    props: ['major'],
     methods: {
-        handleChange() {},
         onSearch() {},
         pageChanged(page, size) {
             this.currentPage = page
@@ -54,18 +45,17 @@ export default {
             this.getList()
         },
         getList() {
-            let getParams = {
+            let postParams = {}
+            let data = {
                 page: this.currentPage,
                 size: this.size,
-                major: '弱电',
-                system: 'MJ'
-                // orderBy: 1,
-                // keyword: ''
+                plazaId: this.$store.state.plazaId,
+                major: this.major
             }
-            queryEquipmentList({ getParams }).then(res => {
+            queryEquipmentList({ data, postParams }).then(res => {
                 console.log(res)
-                this.tableData = res.data
-                this.total = res.count
+                this.tableData = res.data.data
+                this.total = res.data.count
             })
         }
     },