zhangkunling 2 lat temu
rodzic
commit
d2ce9b8a9c

+ 2 - 2
src/login/DownAllQualityReport.vue

@@ -1364,7 +1364,7 @@ export default {
     creatPie(pieData) {
       let sum = pieData.data.reduce((prev, current) => prev + current.value, 0) // 数组求和
       pieData.data.forEach((item)=> {
-        if (item.name == '其') {
+        if (item.name == '其') {
           item.labelLine = {
             lineStyle: {
               color: pieData.color[pieData.color.length-1]
@@ -1425,7 +1425,7 @@ export default {
               color: '#FFFFFF',
               fontSize: 12,
               formatter: function(params) {
-                if (params.data.name == '其') {
+                if (params.data.name == '其') {
                   return params.name + ':' + params.percent + '% (' + params.value + pieData.unit + ')'
                 } else {
                   return ''

+ 2 - 2
src/login/DownAppQualityReport.vue

@@ -993,7 +993,7 @@ export default {
     creatPie(pieData) {
       let sum = pieData.data.reduce((prev, current) => prev + current.value, 0) // 数组求和
       pieData.data.forEach((item)=> {
-        if (item.name == '其') {
+        if (item.name == '其') {
           item.labelLine = {
             lineStyle: {
               color: pieData.color[pieData.color.length-1]
@@ -1054,7 +1054,7 @@ export default {
               color: '#FFFFFF',
               fontSize: 12,
               formatter: function(params) {
-                if (params.data.name == '其') {
+                if (params.data.name == '其') {
                   return params.name + ':' + params.percent + '% (' + params.value + pieData.unit + ')'
                 } else {
                   return ''

+ 1 - 19
src/views/homecomponents/BasicInfomation/DeviceManage.vue

@@ -100,25 +100,7 @@ export default {
       this.level = level
       if (this.currentTabs == '设备管理') {
         this.$refs.device.tableParams.pageNum = 1
-        if (level == 2) {
-          this.$refs.device.tableParams.applicationId = arr[arr.length-1]
-          this.$refs.device.tableParams.equipmentType = ''
-        } else if (level == 3) {
-          this.$refs.device.tableParams.applicationId = arr[arr.length-2]
-          this.$refs.device.tableParams.equipmentType = arr[arr.length-1]
-        } else {
-          this.$refs.device.tableParams.applicationId = ''
-          this.$refs.device.tableParams.equipmentType = ''
-        }
-        // if (level == 2) {
-        //   this.currentAppId = arr[arr.length-1]
-        // } else if (level == 3) {
-        //   this.currentAppId = arr[arr.length-2]
-        //   this.currentEquTypeId = arr[arr.length-1]
-        // } else {
-        //   this.currentAppId = ''
-        //   this.currentEquTypeId = ''
-        // }
+        this.getParams ('device',arr,level)
         this.$refs.device.getTableData(arr,level)
       } else if(this.currentTabs == '设备类型管理'){
         this.$nextTick(()=> {

+ 0 - 2
src/views/homecomponents/BasicInfomation/DeviceManageIndex.vue

@@ -370,9 +370,7 @@ export default {
   //  },
   // },
   mounted() {
-    this.getType()
     this.getAppApplicate()
-    this.getTableData()
   },
   methods: {
     go (){

+ 1 - 1
src/views/homecomponents/BasicInfomation/DeviceTypeManage.vue

@@ -166,7 +166,7 @@ export default {
         name: [{
           required: true,
           message: '请输入应用名称',
-          trigger: 'change'
+          trigger: 'blur'
         }],
       }, 
     equipTypeData: [],

+ 11 - 50
src/views/homecomponents/BasicInfomation/InstruManage.vue

@@ -14,8 +14,8 @@
             <Tabs :value="currentTabs" @on-click="tabsClick" class="common-tabs">
               <TabPane v-for="tab in tabsData" :key="tab.label" :label="tab.label" :name="tab.label"></TabPane>
             </Tabs>
-            <instru-manage-index v-if="currentTabs=='仪表管理'" ref="device"></instru-manage-index>
-            <instru-type-manage  v-if="currentTabs=='仪表类型管理'" ref="deviceType" @changeTree="changeTree"></instru-type-manage>
+            <instru-manage-index v-if="currentTabs=='仪表管理'" ref="instrument" @changeTree="changeTree"></instru-manage-index>
+            <instru-type-manage  v-if="currentTabs=='仪表类型管理'" ref="instrumentType"></instru-type-manage>
           </div>
         </i-col>
       </Row>
@@ -44,16 +44,6 @@ export default {
   mounted() {
     this.getMetroLevel()
     this.currentTabs = sessionStorage.getItem('currentTabs') || '仪表管理'
-    if(this.currentTabs == '仪表管理'){
-       this.$nextTick(()=> {
-        // this.$refs.device.getType()
-        // this.$refs.device.getTableData()
-      })
-    } else if (this.currentTabs == '仪表类型管理') {
-      this.$nextTick(()=> {
-        this.$refs.deviceType.getTableData()
-      })
-    }
   },
   // 离开当前路由之前的钩子函数 
   beforeRouteLeave(to, form, next) {
@@ -86,45 +76,27 @@ export default {
     treeChange(arr,level) {
       this.level = level
       if (this.currentTabs == '仪表管理') {
-        this.$refs.device.tableParams.pageNum = 1
-        if (level == 2) {
-          this.$refs.device.tableParams.applicationId = arr[arr.length-1]
-          this.$refs.device.tableParams.equipmentType = ''
-        } else if (level == 3) {
-          this.$refs.device.tableParams.applicationId = arr[arr.length-2]
-          this.$refs.device.tableParams.equipmentType = arr[arr.length-1]
-        } else {
-          this.$refs.device.tableParams.applicationId = ''
-          this.$refs.device.tableParams.equipmentType = ''
-        }
-        // if (level == 2) {
-        //   this.currentAppId = arr[arr.length-1]
-        // } else if (level == 3) {
-        //   this.currentAppId = arr[arr.length-2]
-        //   this.currentEquTypeId = arr[arr.length-1]
-        // } else {
-        //   this.currentAppId = ''
-        //   this.currentEquTypeId = ''
-        // }
-        this.$refs.device.getTableData(arr,level)
+        this.$refs.instrument.tableParams.pageNum = 1
+        this.getParams ('instrument',arr,level)
+        this.$refs.instrument.getTableData(arr,level)
       } else if(this.currentTabs == '仪表类型管理'){
         this.$nextTick(()=> {
-          this.getParams ('deviceType',arr,level)
-          this.$refs.deviceType.tableParams.pageNum = 1
-          this.$refs.deviceType.getTableData()
+          this.getParams ('instrumentType',arr,level)
+          this.$refs.instrumentType.tableParams.pageNum = 1
+          this.$refs.instrumentType.getTableData()
         })
       }
 		},
     getParams (name,arr,level) {
      if (level == 2) {
         this.$refs[name].tableParams.applicationId = arr[arr.length-1]
-        this.$refs[name].tableParams.equipmentTypeId = ''
+        this.$refs[name].tableParams.instrumentType = ''
       } else if (level == 3) {
         this.$refs[name].tableParams.applicationId = arr[arr.length-2]
-        this.$refs[name].tableParams.equipmentTypeId = arr[arr.length-1]
+        this.$refs[name].tableParams.instrumentType = arr[arr.length-1]
       } else {
         this.$refs[name].tableParams.applicationId = ''
-        this.$refs[name].tableParams.equipmentTypeId = ''
+        this.$refs[name].tableParams.instrumentType = ''
       }
     },
     tabsClick (name) {
@@ -132,17 +104,6 @@ export default {
       sessionStorage.setItem("currentTabs",name)
       this.currentTabs = name
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
-      if (this.currentTabs == '仪表管理') {
-         this.$nextTick(()=> {
-          //  this.getMetroLevel()
-           this.$refs.device.getType()
-           this.$refs.device.getTableData()
-        })
-      } else if(this.currentTabs == '仪表类型管理'){
-        this.$nextTick(()=> {
-          this.$refs.deviceType.getTableData()
-        })
-      }
     },
     changeTree () {
      this.getMetroLevel()

+ 53 - 126
src/views/homecomponents/BasicInfomation/InstruManageIndex.vue

@@ -3,16 +3,16 @@
     <div class="search-list">
       <div class="search-left">
         <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
-          <!-- <FormItem label="" prop="lineId">
-            <Select v-model="tableParams.lineId" placeholder="能耗类型" @on-select="changeLine" label-in-value>
-              <Option v-for="item in instrumentTypeData" :value="item.id" :key="item.id">{{ item.lineName }}</Option>
+          <FormItem label="" prop="energyConsumptionId">
+            <Select v-model="tableParams.energyConsumptionId" placeholder="能耗类型">
+              <Option v-for="item in energyTypeData" :value="item.id" :key="item.id">{{ item.name }}</Option>
             </Select>
-          </FormItem> -->
-          <FormItem label="" prop="type">
+          </FormItem>
+          <!-- <FormItem label="" prop="type">
             <Select v-model="tableParams.type" placeholder="仪表类型">
               <Option v-for="item in instrumentTypeData" :value="item.id" :key="item.id">{{ item.name }}</Option>
             </Select>
-          </FormItem>
+          </FormItem> -->
           <FormItem label="" prop="equipmentStatus">
             <Select v-model="tableParams.equipmentStatus" placeholder="关联用途类项">
                 <Option v-for="item in associatedUseData" :value="item.value" :key="item.value">{{ item.label }}</Option>
@@ -28,8 +28,8 @@
                 <Option v-for="item in associatedEquipData" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
           </FormItem>
-          <FormItem label="" prop="equipmentName">
-            <Input placeholder="输入关键字查询" clearable search v-model="tableParams.equipmentName" />
+          <FormItem label="" prop="keywords">
+            <Input placeholder="输入关键字查询" clearable search v-model="tableParams.keywords" />
           </FormItem>
           <FormItem label="" >
             <Button type="primary" class="common-btn-search" @click="searchClick">
@@ -88,7 +88,7 @@
            <Input v-model.trim="formOption.name" type="textarea" :rows="3" maxlength="100" show-word-limit />
         </FormItem>
         <FormItem label="归属应用:" prop="applicationId" style="width:100%">
-           <Select v-model="formOption.applicationId" placeholder="归属应用" @on-change="selectModalApp">
+           <Select v-model="formOption.applicationId" placeholder="归属应用">
              <Option v-for="item in equipAppModalData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
           </Select>
         </FormItem>
@@ -189,25 +189,19 @@ export default {
         pageNum: 1,
         pageSize: 9999
       },
-      appParams: {
-        applicationId: '',
-        equipmentTypeId: '',
-        keywords: '',
-        pageNum: 1,
-        pageSize: 9999
-      },
+      // appParams: {
+      //   applicationId: '',
+      //   equipmentTypeId: '',
+      //   keywords: '',
+      //   pageNum: 1,
+      //   pageSize: 9999
+      // },
       loading: true,
-      // dateRange: [],
       tableParams: {
-        // lineId: '',
-        // stationId: '',
-        // equipmentStatus: '',
-        // keywords: '',
-        // applicationId:'', 
-        // equipmentType: '',
-        // useDateBegin: '',
-        // useDateEnd: '',
-        // equipmentName: '',
+        applicationId: '',
+        energyConsumptionId: '',
+        instrumentType: '',
+        keywords: '',
         pageNum: 1,
         pageSize: 10
       },
@@ -215,6 +209,8 @@ export default {
       tableTotal: 0,
       tablePage: 0,
       rowObj: {},
+      energyTypeData: [],
+      energyTypeModalData: [],
       instrumentTypeData: [],
       instrumentTypeModalData: [],
       stationTypeData: [],
@@ -293,14 +289,14 @@ export default {
           },
           {
             title: '仪表类型',
-            key: 'appName',
+            key: 'typeName',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '归属应用',
-            key: 'lineName',
+            key: 'applicationName',
             align: 'center',
             ellipsis: true,
             tooltip: true
@@ -308,20 +304,20 @@ export default {
           {
             title: '关联用途类项',
             align: 'center',
-            key: 'stationName',
+            key: 'relationUsage',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '关联能耗分户',
-            key: 'equipmentStatusValue',
+            key: 'relationAccount',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '关联设备名称',
-            key: 'useDate',
+            key: 'relationEquipment',
             align: 'center',
             ellipsis: true,
             tooltip: true
@@ -384,9 +380,8 @@ export default {
   //     }
   //  },
   // },
-  mounted() {
+  created() {
     this.getType()
-    this.getAppApplicate()
     this.getTableData()
   },
   methods: {
@@ -395,10 +390,6 @@ export default {
       // this.$router.push({path:'/MainPage/ApplicationManage/2'})
       this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
     },
-    // changePicker (date) {
-    //   this.tableParams.useDateBegin = date[0]
-    //   this.tableParams.useDateEnd = date[1]
-    // },
     rowClassName(row, index) {
       if (index % 2 == 0) {
         return "ivu-table-stripe-even";
@@ -417,40 +408,30 @@ export default {
       this.getTableData()
     },
     getType  () {
-      //获取所属线路
+      // 获取仪表类型
       this.$get('metroapi/instrumentType/queryInstrumentType').then(res=>{
         if (res.httpCode == 1 ){
           this.instrumentTypeModalData = JSON.parse(JSON.stringify(res.data))
           this.instrumentTypeData = res.data
           this.instrumentTypeData.unshift({ id: '-1', name: '仪表类型' })
-          // this.getStationData ('-1')
         } else {
           this.instrumentTypeData = []
+          this.instrumentTypeModalData = []
+        }
+      })
+      // 获取能耗类型
+      this.$get('metroapi/energyConsumption/queryEnergyConsumption').then(res=>{
+        if (res.httpCode == 1 ){
+          this.energyTypeModalData = JSON.parse(JSON.stringify(res.data))
+          this.energyTypeData = res.data
+          this.energyTypeData.unshift({ id: '-1', name: '能耗类型' })
+        } else {
+          this.energyTypeData = []
+          this.energyTypeModalData = []
         }
       })
-      // 获取仪表状态
-      // this.$get('metroapi/dic/queryDictionary', {name:'仪表状态'}).then(res=>{
-      //   if (res.httpCode == 1 ){
-      //     this.equipStateModalData = JSON.parse(JSON.stringify(res.data))
-      //     this.associatedUseData = res.data
-      //     this.associatedUseData.unshift({ id: '-1', value: '仪表状态' })
-      //   } else {
-      //     this.associatedUseData = []
-      //     this.equipStateModalData = []
-      //   }
-      // })
       // 获取归属应用
-      // this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
-      //   if (res.httpCode == 1 ){
-      //     this.equipAppModalData = res.data.data
-      //   } else {
-      //     this.equipAppModalData = []
-      //   }
-      // })
-    },
-    // 获取归属应用
-    getAppApplicate () {
-     this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
+      this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
         if (res.httpCode == 1 ){
           this.equipAppModalData = res.data.data
         } else {
@@ -458,6 +439,7 @@ export default {
         }
       })
     },
+    // 选择仪表类型
     selectInstruType (val) {
      if (val) {
         let results  = this.instrumentTypeModalData.find(item => item.id == val) //find 方法搜索的是使函数返回 true 的第一个(单个)元素
@@ -465,27 +447,6 @@ export default {
         this.formOption.energyConsumptionId = results.energyConsumptionId
      }
     },
-    // changeLine (val) {
-    //   // 获取站点类型
-    //   this.tableParams.stationId = ''
-    //   this.tableParams.lineId = val.value
-    //   if (this.tableParams.lineId) {
-    //     this.getStationData(val.value)
-    //   }
-    // },
-    // // 获取所属站点
-    // getStationData (lineId) {
-    //   if(lineId == '-1') {
-    //     this.stationTypeData = [{ id: '-1', stationName: '站点' }]
-    //   } else {
-    //     this.$get('metroapi/lineStation/queryStationByLineId', {lineId:lineId}).then(res=>{
-    //       if (res.httpCode == 1 ){
-    //         this.stationTypeData = res.data
-    //         this.stationTypeData.unshift({ id: '-1', stationName: '站点' })
-    //       }
-    //     })
-    //   }
-    // },
     // 获取表格数据
     getTableData () {
       let params = JSON.parse(JSON.stringify(this.tableParams))
@@ -493,7 +454,7 @@ export default {
       // params.stationId = params.stationId == '-1'?'':params.stationId
       // params.equipmentStatus = params.equipmentStatus == '-1' ?'':params.equipmentStatus
       this.loading = true
-      this.$get('metroapi/queryInstrumentPage', params).then(res=>{
+      this.$get('metroapi/instrument/queryInstrumentPage', params).then(res=>{
         this.loading = false
           if (res.httpCode == 1 ){
             this.tableData = res.data.data
@@ -513,51 +474,16 @@ export default {
           }
         })
     },
-    selectModalLine (val) {
-      this.formOption.stationId = ''
-      if (val) {
-        this.getStationData(val.value)
-      }
-    },
-    selectModalStation (val) {
-      if (val) {
-       this.formOption.stationId =val.value
-      }
-    },
-    selectModalApp (val) {
-      this.appParams.applicationId = val
-      this.formOption.equipmentType = ''
-      if (val) {
-        this.getAddEquipType(this.appParams)
-      }
-    },
-    // 获取新增仪表类型 
-    getAddEquipType (params) {
-      this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
-        if (res.httpCode == 1 ){
-          this.equipTypeModalData = res.data.data
-        } else {
-          this.equipTypeModalData = []
-        }
-      })
-    },
     searchClick () {
       this.tableParams.pageNum = 1
       this.getTableData()
       // this.$router.push({ path: '/MainPage/ApplicationManage',  query: {deptName: "2"}})
     },
     resetClick (name) {
-    //  this.dateRange = []
-    //  this.tableParams.useDateBegin = ''
-    //  this.tableParams.useDateEnd = ''
-     this.stationTypeData = [{ id: '-1', stationName: '站点' }]
      this.$refs[name].resetFields()
      this.tableParams.pageNum = 1
      this.getTableData()
     },   
-    changeMoldaPicker (val) {
-     this.formOption.useDate = val
-    },
     addClick () {
       this.formOption = JSON.parse(JSON.stringify(defaultFrom))
       this.title = '新增仪表'
@@ -577,11 +503,11 @@ export default {
     editClick (row) {
       this.rowObj = row
       this.formOption = JSON.parse(JSON.stringify(row));
-      this.formOption.lineId = this.formOption.lineId ? String(this.formOption.lineId) : '-1'
-      this.formOption.stationId = this.formOption.stationId ? String(this.formOption.stationId) : '-1'
-      this.getStationData(this.formOption.lineId)
-      this.appParams.applicationId = this.formOption.appId
-      this.getAddEquipType(this.appParams)
+      // this.formOption.lineId = this.formOption.lineId ? String(this.formOption.lineId) : '-1'
+      // this.formOption.stationId = this.formOption.stationId ? String(this.formOption.stationId) : '-1'
+      // this.getStationData(this.formOption.lineId)
+      // this.appParams.applicationId = this.formOption.appId
+      // this.getAddEquipType(this.appParams)
       this.title = '编辑仪表'
       this.showModal = true
     },
@@ -596,8 +522,6 @@ export default {
     modalChange (modalStatus) {
      if (!modalStatus) {
       this.$refs.formOption.resetFields();
-      this.stationTypeData = [{ id: '-1', stationName: '站点' }]
-      this.equipTypeModalData = []
      }
     },
     modalOk (formName) {
@@ -608,6 +532,7 @@ export default {
             this.$post('metroapi/instrument/addInstrument', params).then(res=>{
               if ( res.httpCode == 1 ){
                 this.showModal = false
+                this.$emit('changeTree')
                 this.$Message.info(res.msg)
                 this.getTableData()
               } else {
@@ -621,9 +546,10 @@ export default {
       } else {
         this.$refs[formName].validate((valid) => {
           if (valid) {
-            this.$post('metroapi/equipment/editEquipment', params).then(res=>{
+            this.$post('metroapi/instrument/editInstrument', params).then(res=>{
               if (res.httpCode == 1 ){
                 this.showModal = false
+                this.$emit('changeTree')
                 this.$Message.info(res.msg)
                 this.getTableData()
               } else {
@@ -653,6 +579,7 @@ export default {
       this.$get('metroapi/instrument/delInstrument',params).then(res=>{
         if (res.httpCode == 1 ){
           this.modalStatus = false
+          this.$emit('changeTree')
           this.$Message.info(res.msg)
           this.getTableData()
         } else {

+ 185 - 373
src/views/homecomponents/BasicInfomation/InstruTypeManage.vue

@@ -1,39 +1,63 @@
 <template>
   <div class="content-main common-scroll">
-    <div class="content-body">
-      <Row :gutter="8" style="width:100%;height:100%">
-        <i-col span="24" style="height:100%">
-          <div class="right-main">
-            <div class="manage-main-top">
-              <Button icon="ios-add" class="common-add-btn" @click="addClick">新增设备类型</Button>
-            </div>
-            <div class="manage-main-center">
-              <Table :columns="columns" :data="tableData" class="common-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
-                <template slot="loading">
-                    <Loading-animation></Loading-animation>
-                </template>
-                <template slot-scope="{ row }" slot="action">
-                  <Tooltip content="详情" placement="top">
-                      <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px" @click="detailClick(row)"></i>
-                  </Tooltip>
-                  <Tooltip content="编辑" placement="top">
-                      <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
-                  </Tooltip>
-                  <Tooltip content="删除" placement="top">
-                      <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px" @click="delClick(row)"></i>
-                  </Tooltip>
-                </template>
-              </Table>
-            </div>
-            <div class="common-page">
-              <div class="common-page-total">
-                共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
-              </div>
-              <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
-            </div>
-          </div>
-        </i-col>
-      </Row>
+    <div class="search-list">
+      <div class="search-left">
+        <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
+          <FormItem label="" prop="energyConsumptionId">
+            <Select v-model="tableParams.energyConsumptionId" placeholder="能耗类型">
+              <Option v-for="item in energyTypeData" :value="item.id" :key="item.id">{{ item.name }}</Option>
+            </Select>
+          </FormItem>
+          <!-- <FormItem label="" prop="type">
+            <Select v-model="tableParams.type" placeholder="仪表类型">
+              <Option v-for="item in instrumentTypeData" :value="item.id" :key="item.id">{{ item.name }}</Option>
+            </Select>
+          </FormItem> -->
+          <FormItem label="" prop="equipmentStatus">
+            <Select v-model="tableParams.equipmentStatus" placeholder="接入仪表数量">
+                <Option v-for="item in associatedEquipData" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            </Select>
+          </FormItem>
+          <FormItem label="" prop="keywords">
+            <Input placeholder="输入关键字查询" clearable search v-model="tableParams.keywords" />
+          </FormItem>
+          <FormItem label="" >
+            <Button type="primary" class="common-btn-search" @click="searchClick">
+              <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
+            </Button> 
+            <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
+              <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
+            </Button>   
+          </FormItem>
+        </Form>
+      </div>
+    </div>
+     <div class="btn-container">
+      <Button icon="ios-add" class="common-add-btn" @click="addClick">新增仪表类型</Button>
+    </div>
+    <div class="manage-main-center">
+      <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
+        <template slot="loading">
+            <Loading-animation></Loading-animation>
+        </template>
+         <template slot-scope="{ row }" slot="action">
+           <Tooltip content="详情" placement="top">
+              <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px" @click="detailClick(row)"></i>
+           </Tooltip>
+           <Tooltip content="编辑" placement="top">
+              <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
+           </Tooltip>
+           <Tooltip content="删除" placement="top">
+              <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px" @click="delClick(row)"></i>
+           </Tooltip>
+        </template>
+      </Table>
+    </div>
+    <div class="common-page">
+      <div class="common-page-total">
+        共<span>{{tablePage}}</span>页 / <span>{{tableTotal}}</span>条数据
+      </div>
+      <Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator />
     </div>
      <Modal
       v-model="showModal"
@@ -45,11 +69,16 @@
       :mask-closable="false"
       @on-visible-change="modalChange"
       class-name="common-modal">
-      <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120">
-				<FormItem label="类型名称:" prop="name">
+      <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="130">
+        <FormItem label="能耗类型名称:" prop="energyConsumptionId">
+            <Select v-model="formOption.energyConsumptionId" placeholder="能耗类型">
+              <Option v-for="item in energyTypeModalData" :value="item.id" :key="item.id">{{ item.name }}</Option>
+            </Select>
+          </FormItem>
+				<FormItem label="仪表类型名称:" prop="name">
           <Input v-model.trim="formOption.name" maxlength="20" show-word-limit />  
 				</FormItem>
-				<FormItem label="说明:" prop="remark">
+				<FormItem label="备注:" prop="remark">
            <Input v-model="formOption.remark" type="textarea" :rows="6" maxlength="200" show-word-limit /> 
         </FormItem>
 			</Form>
@@ -74,44 +103,10 @@
           <Button type="primary" @click="commonOk">确定</Button>
         </div>
     </Modal>
-    <Modal
-      v-model="detailStatus"
-      title="设备类型信息"
-      width="45"
-      ref="modalGrag"
-      draggable
-      reset-drag-position
-      footer-hide
-      :mask-closable="false"
-      @on-visible-change="modalDetailChange"
-      class-name="common-modal common-modal-detail">
-       <Tabs :value="currentModalTabs" @on-click="tabsClick" class="common-tabs">
-        <TabPane v-for="tab in tabsModalData" :key="tab.label" :label="tab.label" :name="tab.label"></TabPane>
-      </Tabs>
-       <div v-for="(item,index) in detailLabel" :key="index" v-show="currentModalTabs =='设备类型信息'">
-          <div class="common-modal-top" :class="{'common-modal-top-especial': index==1}">
-          <span class="common-modal-top-text">{{item.name}}</span>
-          </div>
-          <div class="common-modal-content" v-if="index==0">
-            <div class="modal-content-item" v-for="(val,i) in item.value" :key="i" :class="{'item-especial': val.name == '说明' }">
-                <div class="modal-content-item-name">{{val.name}}</div>
-                <div class="modal-content-item-value">
-                  <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || (typeof(val.value)=='number' && val.value==0)">
-                  <span>{{val.value}}</span>
-                  <div slot="content">
-                    <span>{{val.value}}</span>
-                  </div>
-                </Tooltip>
-                </div>
-            </div>
-          </div>
-      </div>
-      <rolling-detail-table :columns1="columnsModal" :apiUrl="apiUrl" ref="detailTable" class="rolling-detail-table"></rolling-detail-table>
-    </Modal>
 </div>
 </template>
 <script>
-const defaultFrom = {name: '',remark: ''}
+const defaultFrom = {energyConsumptionId:'',name: '',remark: ''}
 import _ from 'lodash'
 export default {
   name: "InstruTypeManage",
@@ -122,9 +117,10 @@ export default {
       tableTotal: 0,
       tablePage: 0,
       tableParams: {
-        equipmentTypeId: '',
         applicationId: '',
-        name: '',
+        energyConsumptionId: '',
+        instrumentType: '',
+        keywords: '',
         pageNum: 1,
         pageSize: 10
       },
@@ -132,26 +128,32 @@ export default {
       tableData: [],
       columns: [
           {
-            title: '设备类型名称',
+            title: '仪表类型名称(唯一)',
             key: 'name',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
-            title: '关联应用数量',
-            key: 'appCount',
-            align: 'center'
+            title: '能耗类型',
+            key: 'energyConsumptionName',
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
           },
           {
-            title: '接入设备数量',
+            title: '关联应用数量',
             key: 'equipmentCount',
-            align: 'center'
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
           },
           {
-            title: '监测指标',
+            title: '接入仪表数量',
             key: 'targetCount',
-            align: 'center'
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
           },
           {
             title: '操作',
@@ -161,108 +163,48 @@ export default {
           }
       ],
       rowObj: {},
-      formOption: {name: '',remark:''},
+      formOption: {energyConsumptionId:'',name: '',remark: ''},
       ruleValidate: {
-        name: [{
+        energyConsumptionId: [{
           required: true,
-          message: '请输入应用名称',
+          type: 'number',
+          message: '请选择能耗类型名称',
           trigger: 'change'
         }],
+        name: [{
+          required: true,
+          message: '请输入仪表类型名称',
+          trigger: 'blur'
+        }],
       }, 
-    equipTypeData: [],
-    showModal: false,
-    detailStatus: false, 
-    modalStatus: false,
-    title: '新增设备',
-    commonTitle: "确认删除",
-    activeColor: '#E92E2E',
-    activeClass: '',
-    modalTitle: '',
-    currentModalTabs:'设备类型信息',
-    tabsModalData: [{label:'设备类型信息'},{label:'关联设备'}],
-    detailLabel: [],
-    columnsModal: [],
-    columnsEquipType: [
+      energyTypeData: [],
+      energyTypeModalData: [],
+      associatedEquipData:[
         {
-          title: '序号',
-          type: 'index',
-          align: 'center'
+          value: '-1',
+          label: '接入仪表数量'
         },
         {
-          title: '应用名称',
-          key: 'appName',
-          align: 'center',
-          ellipsis: true,
-          tooltip: true
+          label: '0',
+          value: '0'
         },
         {
-          title: '设备数量',
-          key: 'equipmentNum',
-          align: 'center'
+          label: '其他',
+          value: '其他'
         }
       ],
-      columnsRelatedEquip: [
-          {
-            title: '序号',
-            type: 'index',
-            align: 'center'
-          },
-          {
-            title: '设备ID',
-            key: 'equipmentId',
-            align: 'center'
-         },
-         {
-            title: '设备名称',
-            key: 'equipmentName',
-            align: 'center',
-            ellipsis: true,
-            tooltip: true
-         },
-         {
-            title: '归属线路',
-            key: 'lineName',
-            align: 'center',
-            ellipsis: true,
-            tooltip: true
-            // render:(h,params)=>{
-            //   return h('div', [ h('span',!params.row.lineName ? '/' : params.row.lineName) ])
-            // }
-         },
-         {
-            title: '归属站点',
-            key: 'stationName',
-            align: 'center',
-            ellipsis: true,
-            tooltip: true
-         },
-         {
-            title: '状态',
-            key: 'equipmentStatusValue',
-            align: 'center'
-         },
-      ],
-      // equipTypeModal: [],
-      // equipTypeCount: 0,
-      detailParams: {
-					equipmentTypeId: null,
-					pageNum: 1,
-					pageSize: 10
-			},
-      apiUrl: '',
-      appNameObj: {
-        level: '',
-        lineId: '',
-        stationId: '',
-        equipmentCheck: '',
-        instrumentCheck: '',
-        pageNum: 1,
-        pageSize: 9999
-      },
-      appNameList: []
+    showModal: false,
+    modalStatus: false,
+    title: '新增仪表类型',
+    commonTitle: "确认删除",
+    activeColor: '#E92E2E',
+    activeClass: '',
+    modalTitle: '',
     };
   },
-  mounted() {
+  created() {
+    this.getType()
+    this.getTableData()
   },
   methods: {
     rowClassName(row, index) {
@@ -284,7 +226,7 @@ export default {
     },
     getTableData () {
       this.loading = true
-      this.$get('metroapi/equipment/queryEquipmentTypePage', this.tableParams).then(res=>{
+      this.$get('metroapi/instrumentType/queryInstrumentTypePage', this.tableParams).then(res=>{
         this.loading = false
           if ( res.httpCode == 1 ){
             this.tableData = res.data.data
@@ -304,53 +246,38 @@ export default {
           }
         })
     },
+    searchClick () {
+      this.tableParams.pageNum = 1
+      this.getTableData()
+      // this.$router.push({ path: '/MainPage/ApplicationManage',  query: {deptName: "2"}})
+    },
+    resetClick (name) {
+     this.$refs[name].resetFields()
+     this.tableParams.pageNum = 1
+     this.getTableData()
+    }, 
     getType  () {
-      // 获取设备类型
-      this.$get('metroapi/equipment/queryEquipmentType', {name:''}).then(res=>{
+      // 获取能耗类型
+      this.$get('metroapi/energyConsumption/queryEnergyConsumption').then(res=>{
         if (res.httpCode == 1 ){
-          this.equipTypeData = res.data
+          this.energyTypeModalData = JSON.parse(JSON.stringify(res.data))
+          this.energyTypeData = res.data
+          this.energyTypeData.unshift({ id: '-1', name: '能耗类型' })
         } else {
-          this.equipTypeData = []
+          this.energyTypeData = []
+          this.energyTypeModalData = []
         }
       })
-      // 获取应用名称
-      this.$get('metroapi/application/info/list', this.appNameObj).then(res=>{
-          if (res.httpCode == 1 ){
-            this.appNameList = res.data.data
-          } else {
-            this.appNameList = []
-          }
-        })
     },
     addClick () {
-      this.title = '新增设备类型'
+      this.title = '新增仪表类型'
       this.formOption = JSON.parse(JSON.stringify(defaultFrom))
       this.showModal = true
     },
-    detailClick (row) {
-      this.detailParams.equipmentTypeId = Number(row.id)
-      this.rowObj = row
-      this.detailStatus = true
-      this.currentModalTabs = '设备类型信息'
-      this.$nextTick(() => {
-        this.apiUrl = 'metroapi/equipment/equipmentTypeDetail'
-        this.columnsModal = this.columnsEquipType
-        document.querySelector(".rolling-detail-table .ivu-table-body").scrollTo(0, 0) 
-        this.$refs.detailTable.getChartsDetail(this.detailParams,this.apiUrl)
-      });
-      this.$get('metroapi/equipment/equipmentTypeDetail', this.detailParams).then(res=>{
-        if ( res.httpCode == 1 ){
-            this.detailLabel = res.data
-          } else {
-            this.$Message.info(res.msg)
-          }
-        })
-        // document.querySelector(".rolling-detail-table .ivu-table-body").scrollTo(0, 0)
-    },
     editClick (row) {
       this.rowObj = row
       this.formOption = JSON.parse(JSON.stringify(row))
-      this.title = '编辑设备类型'
+      this.title = '编辑仪表类型'
       this.showModal = true
     },
     delClick (row) {
@@ -358,7 +285,7 @@ export default {
       this.commonTitle = '确认删除'
       this.activeColor = '#E92E2E'
       this.activeClass = ''
-      this.modalTitle = '删除的同时将解绑所有运营数据,且数据不可恢复,请慎重操作。'
+      this.modalTitle = '删除不影响已产生的操作和记录。'
       this.modalStatus = true
     },
     modalChange (modalStatus) {
@@ -366,18 +293,12 @@ export default {
       this.$refs.formOption.resetFields();
      }
     },
-    modalDetailChange (val) {
-     	if (!val) {
-        this.detailParams.pageNum = 1
-        document.querySelector(".rolling-detail-table .ivu-table-body").scrollTo(0, 0)
-      }
-    },
     modalOk (formName) {
-       if (this.title == '新增设备类型') {
+       if (this.title == '新增仪表类型') {
         this.$refs[formName].validate((valid) => {
           if (valid) {
-            this.$post('metroapi/equipment/addEquipmentType', this.formOption).then(res=>{
-              if ( res.httpCode == 1 ){
+            this.$post('metroapi/instrumentType/addInstrumentType', this.formOption).then(res=>{
+              if (res.httpCode == 1 ){
                 this.showModal = false
                 this.$emit('changeTree')
                 this.$Message.info(res.msg)
@@ -393,7 +314,7 @@ export default {
       } else {
         this.$refs[formName].validate((valid) => {
           if (valid) {
-            this.$post('metroapi/equipment/editEquipmentType', this.formOption).then(res=>{
+            this.$post('metroapi/instrumentType/editInstrumentType', this.formOption).then(res=>{
               if (res.httpCode == 1 ){
                 this.showModal = false
                 this.$emit('changeTree')
@@ -414,7 +335,7 @@ export default {
     },
     commonOk () {
       let params = {
-        id: this.rowObj.id
+        instrumentTypeId: this.rowObj.id
       }
       this.delData(params)
     },
@@ -423,7 +344,7 @@ export default {
     },
     // 删除接口
     delData (params) {
-      this.$get('metroapi/equipment/delEquipmentType',params).then(res=>{
+      this.$get('metroapi/instrumentType/delInstrumentType',params).then(res=>{
         if (res.httpCode == 1 ){
           this.modalStatus = false
           this.$Message.info(res.msg)
@@ -433,106 +354,76 @@ export default {
         }
       })
     },
-    tabsClick (name) {
-      this.currentModalTabs = name
-      if (this.currentModalTabs == '设备类型信息') {
-        this.detailParams.pageNum = 1
-        this.apiUrl = 'metroapi/equipment/equipmentTypeDetail'
-        this.columnsModal = this.columnsEquipType
-      } else if (this.currentModalTabs == '关联设备') {
-        this.detailParams.pageNum = 1
-        this.apiUrl = 'metroapi/equipment/queryEquipmentByTypePage'
-        this.columnsModal = this.columnsRelatedEquip
-      }
-      this.$nextTick(() => {    
-        document.querySelector(".rolling-detail-table .ivu-table-body").scrollTo(0, 0) 
-        this.$refs.detailTable.getChartsDetail(this.detailParams,this.apiUrl)
-      });
-    }
   }
 };
 </script>
 <style scoped lang="stylus">
-.content-main {
-  width: 100%;
+.content-main-manage {
+  position: relative;
   height: calc(100% - 50px);
-  overflow: hidden;
-}
-.common-search {
-  width: 100%;
 }
->>> .common-search .ivu-input {
-  background-color: #06214D;
-  border: 1px solid #2355A6;
-  border-radius: 15px;
-  color: #fff;
-  height: 32px;
-}
->>> .common-search .ivu-input:focus {
-    border-color: #0185ea;
-}
-.content-body {
-  width: 100%;
-  height: 100%;
-  background: #06214D;
-}
-.station-tree {
-  height: 100%;
-  padding: 10px;
-}
-.station-tree-body {
-  border: 1px solid #204384;
-  height: 100%;
-  padding: 10px;
-}
-.station-tree-center {
-  height: calc(100% - 32px);
-  padding-top: 10px;
-  // display: flex;
-}
-.station-tree-left {
-  height: 100%;
-  overflow: auto;
+.search-list {
+  display: flex;
+  padding: 10px 0 0;
 }
-.station-tree-left-notree {
-  height: 100%;
+.search-left {
   display: flex;
   align-items: center;
-  justify-content: center;
-  color: #fff;
-  fon-size: 14px;
-}
-.right-main {
-  height: 100%;
-  padding: 10px 0;
-  position: relative;
-  // padding: 16px;
+   .ivu-select {
+     width: 150px;
+     height: 32px;
+   }
+   .ivu-select-single .ivu-select-selection {
+     height: 100%;
+   }
+   >>> .ivu-input {
+     width: 165px;
+     height: 32px;
+   }
+   >>> .ivu-date-picker-editor .ivu-input {
+     width: 210px;
+   }
+   >>> .ivu-input-prefix, >>> .ivu-input-suffix {
+     height: 32px;
+     line-height: 32px;
+   }
+   >>> .ivu-input-icon {
+     height: 32px;
+     line-height: 32px;
+   }
+   >>> .date-picker-main .ivu-date-picker-header {
+    border-bottom: 0.0052083333rem solid #204384;
+ }
 }
-.manage-main-top {
-  padding: 12px 0;
+.btn-container {
   display: flex;
   justify-content: flex-end;
+  padding-bottom: 10px;
+}
+>>> .common-form-list .ivu-form-item {
+  margin-bottom: 10px;
 }
 .manage-main-center {
   width: 100%;
-  height: calc(100% - 100px);
+  height: calc(100% - 150px);
 }
 .common-table {
   max-height: 100%;
 }
 >>> .common-table .ivu-table th {
-  height: 54px;
+  height: 51px;
  }
  >>> .common-table .ivu-table td {
-  height: 54px;
+  height: 51px;
  }
->>> .common-table .ivu-spin-fix {
-  top: 54px;
-  height: calc(100vh - 350px);
-}
->>> .common-table .ivu-table-tip {
+  >>> .common-table .ivu-spin-fix {
+   top: 51px;
+ }
+  >>> .app-table .ivu-spin-fix {
+   height: calc(100vh - 375px);
+ }
+ >>> .ivu-table-tip {
   background: url('../../../assets/images/noData.png') no-repeat center;
-  height: calc(100vh - 350px);
 }
 >>> .common-table .ivu-table-tip table {
  display: none;
@@ -554,83 +445,4 @@ export default {
     color #409EFF;
   }
 }
->>> .common-modal-top-text {
-  font-size: 14px;
-  font-weight: bold;
-  color: #29A0FF;
-  line-height: 42px;
-  border-left: 3px solid #1590F1;
-  padding-left: 12px;
-}
->>> .common-modal-top-especial {
-  margin-bottom: -10px;
-}
->>> .common-modal-content {
-  display: flex;
-  width: 100%;
-  justify-content: space-between;
-  flex-wrap: wrap;
-  margin-bottom: 15px;
-  border-right: 1px solid #21437B;
-}
->>> .modal-content-item {
-  width: 100%;
-  display: flex;
-}
->>> .item-especial {
-  width: 100%;
-}
->>> .modal-content-item-name {
-  width: 25%;
-  height: 45px;
-  line-height: 45px;
-  background: #13305F;
-  border-top: 1px solid #21437B;
-  border-left: 1px solid #21437B;
-  font-size: 14px;
-  color: #F5F5F5;
-  padding-left: 20px;
-}
->>> .modal-content-item-value {
-  width: 75%;
-  height: 45px;
-  line-height: 45px;
-  background: #06214D;
-  border-top: 1px solid #21437B;
-  border-left: 1px solid #21437B;
-  font-size: 14px;
-  color: #F5F5F5;
-  padding-left: 20px;
-}
-// >>> .item-especial .modal-content-item-name{
-//   width: 25%;
-//   height: auto;
-//   min-height: 45px;
-//   border-bottom: 1px solid #21437B;
-//   display: flex;
-//   align-items: center;
-// }
-// >>> .item-especial .modal-content-item-value{
-//   width: 75%;
-//   height: auto;
-//   min-height: 45px;
-//   border-bottom: 1px solid #21437B;
-//   display: flex;
-//   align-items: center;
-//   line-height: 22px;
-// }
->>> .item-especial .modal-content-item-name {
-  border-bottom: 1px solid #21437B;
-}
->>> .item-especial .modal-content-item-value {
-  border-bottom: 1px solid #21437B;
-}
->>> .modal-content-item-value .ivu-tooltip {
-  width: 100%;
-}
->>> .modal-content-item-value .ivu-tooltip-rel {
-  overflow: hidden;
-  text-overflow:ellipsis; 
-  white-space: nowrap;
-}
 </style>

+ 1 - 1
vue.config.js

@@ -7,7 +7,7 @@ module.exports = {
       open: false,//配置自动启动浏览器 
       proxy: { // 设置代理
       '/metroapi': {
-        target: 'http://192.168.20.58:8088',// http://192.168.20.58:8086 http://192.168.20.188:8088
+        target: 'http://192.168.20.58:8088',// http://192.168.20.58:8086 http://192.168.20.22:8088
         changeOrigin: true, //允许跨域
         pathRewrite: {
             '^/metroapi': ''