zhangkunling hace 2 años
padre
commit
162ef7aaf3

+ 0 - 21
src/components/TabsList.vue

@@ -13,9 +13,6 @@
             <div :style="{flex:(index==arr.length-1 ? 1:'1 1 0%')}" :class="{'item': index<arr.length-1}"></div>
         </div>
     </div>
-    <!-- <div class="tabs-content">
-      <slot name="content"></slot> 
-    </div> -->
   </div>
 </template>
 <script>
@@ -32,21 +29,8 @@ export default {
   data() {
     return {
       arr:['基础信息','选择数据源','配置规则','完成'],
-      // currentStep:1,
     };
   },
-  watch: {
-    currentStep: {
-     handler(newValue) {
-        // this.disabledLevel = newValue
-        // if (this.disabledLevel>=5) {
-        // this.childDisabled = true
-        // } else {
-        //   this.childDisabled = false
-        // }
-      }
-   },
-  },
   mounted() {
   },
   methods: {
@@ -79,8 +63,6 @@ export default {
 }
 .item{
     flex:1;
-    // background: yellow;
-    // height: 1px;
 }
 .active {
  color: #67C272;
@@ -93,7 +75,4 @@ export default {
   border-radius: 50%;
   margin-right: 6PX;
 }
-// .tabs-content {
-//   margin-top: 20px;
-// }
 </style>

+ 5 - 4
src/components/common/CalendarSetting.vue

@@ -4,16 +4,16 @@
         <div class="calendar-left">
             <!--菜单标题栏-->
             <div class="calendar-title">
-                <span>{{initCurrentMonth}}</span>
-                <!-- <Button class="ivu-btn-blue btn-back-today mr10" @click="onBackToday">返回今天</Button> -->
-                <!-- <Select v-model="currentYear" @on-change="onChangeYear" class="sel-calendar">
+                <!-- <span>{{initCurrentMonth}}</span> -->
+                <Button class="ivu-btn-blue btn-back-today mr10" @click="onBackToday">返回今天</Button>
+                <Select v-model="currentYear" @on-change="onChangeYear" class="sel-calendar">
                     <Option v-for="item in years" :value="item.value" :key="item.value">{{ item.label }}</Option>
                 </Select>
                 <Icon type="ios-arrow-back" class="ml10 mr5 cursor-pointer" color="#008080" @click.native="onPreMonth" />
                 <Select v-model="currentMonth" @on-change="onChangeMonth"  class="sel-calendar">
                     <Option v-for="item in months" :value="item.value" :key="item.value">{{ item.label }}</Option>
                 </Select>
-                <Icon type="ios-arrow-forward" class="ml5 cursor-pointer" color="#008080" @click.native="onNextMonth" /> -->
+                <Icon type="ios-arrow-forward" class="ml5 cursor-pointer" color="#008080" @click.native="onNextMonth" />
             </div>
             <!--日历表格-->
             <div class="left-body">
@@ -182,6 +182,7 @@
              * @param val 后台日历数据
              */
             onCalendarInit(cuyear) {
+                console.log(this.currentMonth)
                 // if (cuyear) {
                 //     this.currentYear = cuyear 
                 // }

+ 5 - 0
src/components/common/TreeFilter.vue

@@ -94,6 +94,11 @@ export default {
     this.treeData = this.defaultData;
   },
   methods: {
+    //清空输入框值,回到初始化状态
+    clearInputVal () {
+      this.saveId = null
+      this.currentStation = ''
+    },
     // 当选中根节点时
      getTree(arr) {
       return arr.map((v,index) => {

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

@@ -5,7 +5,7 @@
         <i-col span="5" style="height:100%">
           <div class="station-tree">
             <div class="station-tree-body">
-              <tree-filter :defaultData="stationData" :clickAllNode="true" secondCalssName="icon-shebei1" thirdCalssName="icon-shebei" v-if="stationData && stationData.length>0" @treeChange="treeChange"></tree-filter>
+              <tree-filter ref="tree" :defaultData="stationData" :clickAllNode="true" secondCalssName="icon-shebei1" thirdCalssName="icon-shebei" v-if="stationData && stationData.length>0" @treeChange="treeChange"></tree-filter>
             </div>
           </div>
         </i-col>
@@ -139,6 +139,7 @@ export default {
       sessionStorage.setItem("currentTabs",name)
       this.currentTabs = name
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
+      this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
       if (this.currentTabs == '设备管理') {
          this.$nextTick(()=> {
           //  this.getMetroLevel()

+ 2 - 1
src/views/homecomponents/BasicInfomation/InstruManage.vue

@@ -5,7 +5,7 @@
         <i-col span="5" style="height:100%">
           <div class="station-tree">
             <div class="station-tree-body">
-              <tree-filter :defaultData="stationData" :clickAllNode="true" secondCalssName="icon-shebei1" thirdCalssName="icon-shebei" v-if="stationData && stationData.length>0" @treeChange="treeChange"></tree-filter>
+              <tree-filter ref="tree" :defaultData="stationData" :clickAllNode="true" secondCalssName="icon-shebei1" thirdCalssName="icon-shebei" v-if="stationData && stationData.length>0" @treeChange="treeChange"></tree-filter>
             </div>
           </div>
         </i-col>
@@ -104,6 +104,7 @@ export default {
       sessionStorage.setItem("currentTabs",name)
       this.currentTabs = name
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
+      this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
     },
     changeTree () {
      this.getMetroLevel()

+ 32 - 62
src/views/homecomponents/BasicInfomation/InstruManageIndex.vue

@@ -8,13 +8,8 @@
               <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="关联用途类项">
+          <!-- <FormItem label="" prop="relationUsage">
+            <Select v-model="tableParams.relationUsage" placeholder="关联用途类项">
                 <Option v-for="item in associatedUseData" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
           </FormItem>
@@ -27,7 +22,7 @@
             <Select v-model="tableParams.equipmentStatus" placeholder="关联设备">
                 <Option v-for="item in associatedEquipData" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
-          </FormItem>
+          </FormItem> -->
           <FormItem label="" prop="keywords">
             <Input placeholder="输入关键字查询" clearable search v-model="tableParams.keywords" />
           </FormItem>
@@ -146,17 +141,15 @@
         <span class="common-modal-top-text">{{item.name}}</span>
         </div>
         <div class="common-modal-content">
-          <div class="modal-content-item" v-for="(val,i) in item.value" :key="i" :class="{'item-especial': val.name == '说明'||  val.name == '最后通讯时间' && item.value.length%2!=0,'item-especial-bot':(i==item.value.length-1 || i==item.value.length-2) && item.value.length%2==0}">
+          <div class="modal-content-item" v-for="(val,i) in item.value" :key="i" :class="{'item-especial-app': val.name == '归属应用','item-especial': val.name == '说明'||  val.name == '监测能耗分户' && item.value.length%2!=0,'item-especial-bot':(i==item.value.length-1) && item.value.length%2==0}">
             <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.name == '归属线路' || val.name == '归属站点' || val.value || val.value===0">
-                <span v-if="val.name == '归属线路' || val.name == '归属站点'">{{!val.value ? '/' : val.value}}</span>
-                <span v-else>{{val.value}}</span>
+              <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
+                <span>{{val.value}}</span>
                 <div slot="content">
-                  <span v-if="val.name == '归属线路' || val.name == '归属站点'">{{!val.value ? '/' : val.value}}</span>
-                  <span v-else>{{val.value}}</span>
+                  <span>{{val.value}}</span>
                 </div>
               </Tooltip>
               <span v-else>{{val.value}}</span>
@@ -189,18 +182,11 @@ export default {
         pageNum: 1,
         pageSize: 9999
       },
-      // appParams: {
-      //   applicationId: '',
-      //   equipmentTypeId: '',
-      //   keywords: '',
-      //   pageNum: 1,
-      //   pageSize: 9999
-      // },
       loading: true,
       tableParams: {
         applicationId: '',
-        energyConsumptionId: '',
         instrumentType: '',
+        energyConsumptionId: '',
         keywords: '',
         pageNum: 1,
         pageSize: 10
@@ -213,7 +199,6 @@ export default {
       energyTypeModalData: [],
       instrumentTypeData: [],
       instrumentTypeModalData: [],
-      stationTypeData: [],
       associatedUseData: [
         {
           value: '-1',
@@ -256,16 +241,7 @@ export default {
           value: '0'
         }
       ],
-      equipStateModalData: [],
-      equipTypeData: [],
-      equipTypeModalData: [],
-      equipAppModalData: [],
       columns: [
-        //  {
-        //     type: 'selection',
-        //     width: 60,
-        //     align: 'center'
-        //   },
           {
             title: '仪表号',
             key: 'code',
@@ -329,6 +305,7 @@ export default {
           width: 120,
         }
       ],
+      equipAppModalData: [],
       showModal: false,
       detailStatus: false, 
       modalStatus: false,
@@ -365,31 +342,16 @@ export default {
       detailLabel: [],
     };
   },
-  // watch: {
-  //   currentAppId: {
-  //    handler(newValue) {
-  //     console.log(newValue)
-  //       this.tableParams.applicationId = newValue
-  //       this.getTableData()
-  //     }
-  //  },
-  //  currentEquTypeId: {
-  //    handler(newValue) {
-  //       this.tableParams.equipmentType = newValue
-  //       this.getTableData()
-  //     }
-  //  },
-  // },
   created() {
     this.getType()
     this.getTableData()
   },
   methods: {
-    go (){
-      // this.$router.push({path:'//ApplicationManage'})
-      // this.$router.push({path:'/MainPage/ApplicationManage/2'})
-      this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
-    },
+    // go (){
+    //   // this.$router.push({path:'//ApplicationManage'})
+    //   // this.$router.push({path:'/MainPage/ApplicationManage/2'})
+    //   this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
+    // },
     rowClassName(row, index) {
       if (index % 2 == 0) {
         return "ivu-table-stripe-even";
@@ -449,8 +411,9 @@ export default {
     },
     // 获取表格数据
     getTableData () {
-      let params = JSON.parse(JSON.stringify(this.tableParams))
-      // params.lineId = params.lineId == '-1' ? '':params.lineId
+      let { ...params } = this.tableParams //扩展运算符 复制对象(用扩展运算符对数组或者对象进行拷贝时,只能扩展和深拷贝第一层的值,对于第二层极其以后的值,扩展运算符将不能对其进行打散扩展,也不能对其进行深拷贝,即拷贝后和拷贝前第二层中的对象或者数组仍然引用的是同一个地址,其中一方改变,另一方也跟着改变)
+      // let params = JSON.parse(JSON.stringify(this.tableParams)) //使用JSON.Stringify 转换的数据中,如果包含 function,undefined,Symbol,这几种类型,不可枚举属性, JSON.Stringify序列化后,这个键值对会消失
+      params.energyConsumptionId = params.energyConsumptionId == '-1' ? '':params.energyConsumptionId
       // params.stationId = params.stationId == '-1'?'':params.stationId
       // params.equipmentStatus = params.equipmentStatus == '-1' ?'':params.equipmentStatus
       this.loading = true
@@ -477,7 +440,6 @@ export default {
     searchClick () {
       this.tableParams.pageNum = 1
       this.getTableData()
-      // this.$router.push({ path: '/MainPage/ApplicationManage',  query: {deptName: "2"}})
     },
     resetClick (name) {
      this.$refs[name].resetFields()
@@ -492,7 +454,7 @@ export default {
     detailClick (row) {
       this.rowObj = row
       this.detailStatus = true
-      this.$get('metroapi/equipment/equipmentDetail', {equipmentId:row.id}).then(res=>{
+      this.$get('metroapi/instrument/viewInstrument', {instrumentId:row.id}).then(res=>{
         if (res.httpCode == 1 ){
           this.detailLabel = res.data
         } else {
@@ -502,12 +464,7 @@ 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 = JSON.parse(JSON.stringify(row))
       this.title = '编辑仪表'
       this.showModal = true
     },
@@ -754,6 +711,19 @@ export default {
   line-height: 45px;
   border-bottom: 1px solid #21437B;
 }
+>>> .item-especial-app {
+  width: 100%;
+}
+>>> .item-especial-app .modal-content-item-name{
+  width: 25%;
+  height: 45px;
+  line-height: 45px;
+}
+>>> .item-especial-app .modal-content-item-value{
+  width: 75%;
+  height: 45px;
+  line-height: 45px;
+}
 >>> .item-especial-bot .modal-content-item-name {
   border-bottom: 1px solid #21437B;
 }

+ 14 - 15
src/views/homecomponents/BasicInfomation/InstruTypeManage.vue

@@ -8,13 +8,8 @@
               <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="接入仪表数量">
+          <FormItem label="" prop="instrumentCount">
+            <Select v-model="tableParams.instrumentCount" placeholder="接入仪表数量">
                 <Option v-for="item in associatedEquipData" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
           </FormItem>
@@ -41,9 +36,6 @@
             <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>
@@ -118,8 +110,9 @@ export default {
       tablePage: 0,
       tableParams: {
         applicationId: '',
-        energyConsumptionId: '',
         instrumentType: '',
+        energyConsumptionId: '',
+        instrumentCount: '',
         keywords: '',
         pageNum: 1,
         pageSize: 10
@@ -143,14 +136,14 @@ export default {
           },
           {
             title: '关联应用数量',
-            key: 'equipmentCount',
+            key: 'appRelationCount',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '接入仪表数量',
-            key: 'targetCount',
+            key: 'instrumentCount',
             align: 'center',
             ellipsis: true,
             tooltip: true
@@ -190,7 +183,7 @@ export default {
         },
         {
           label: '其他',
-          value: '其他'
+          value: '1'
         }
       ],
     showModal: false,
@@ -225,8 +218,11 @@ export default {
       this.getTableData()
     },
     getTableData () {
+      let { ...params } = this.tableParams
+      params.energyConsumptionId = params.energyConsumptionId == '-1' ? '':params.energyConsumptionId
+      params.instrumentCount = params.instrumentCount == '-1' ? '':params.instrumentCount
       this.loading = true
-      this.$get('metroapi/instrumentType/queryInstrumentTypePage', this.tableParams).then(res=>{
+      this.$get('metroapi/instrumentType/queryInstrumentTypePage', params).then(res=>{
         this.loading = false
           if ( res.httpCode == 1 ){
             this.tableData = res.data.data
@@ -425,6 +421,9 @@ export default {
  >>> .ivu-table-tip {
   background: url('../../../assets/images/noData.png') no-repeat center;
 }
+>>> .app-table .ivu-table-tip {
+  height: calc(100vh - 375px);
+ }
 >>> .common-table .ivu-table-tip table {
  display: none;
 }

+ 1 - 0
src/views/homecomponents/BasicInfomation/LineStationManage.vue

@@ -154,6 +154,7 @@ export default {
            this.$refs.lineManage.getTableData()
         })
       } else {
+        this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
         this.$nextTick(()=> {
           this.$refs.stationManage.tableParams.lineId = ''
           this.$refs.stationManage.tableParams.stationId = ''

+ 12 - 10
src/views/homecomponents/DataManagement/DataMonitor.vue

@@ -380,22 +380,24 @@ export default {
     };
   },
   created () {
+    // console.log(moment().daysInMonth()) //查询当月天数
+    // console.log(moment("2022-03", "YYYY-MM").daysInMonth())
    this.getType()
   },
   mounted() {
     this.getEcharts()
   },
   methods: {
-    showCalendar () {
-      this.showTable = false
-    },
-    changeClick() {
-      this.year = 2023
-      let arr = this.$refs.calendar
-      arr.forEach((item)=> {
-        item.onCalendarInit(this.year)
-      })
-    },
+    // showCalendar () {
+    //   this.showTable = false
+    // },
+    // changeClick() {
+    //   this.year = 2023
+    //   let arr = this.$refs.calendar
+    //   arr.forEach((item)=> {
+    //     item.onCalendarInit(this.year)
+    //   })
+    // },
      getType  () {
       this.$get('metroapi/application/info/list', this.applicationParams).then(res=>{
         if (res.httpCode == 1 ){

+ 1 - 0
src/views/homecomponents/EquipmentAnalysis/AlarmHandling.vue

@@ -84,6 +84,7 @@ export default {
 		},
     tabsClick (name) {
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
+      this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
       sessionStorage.setItem("currentTabs",name)
       this.getCurrentTab (name)
       if (document.querySelector(".station-tree-left")) {

+ 3 - 0
src/views/homecomponents/EquipmentAnalysis/AlarmMonitor.vue

@@ -241,6 +241,9 @@ export default {
     },
     tabsClick (name) {
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
+      if (this.$refs.tree && name!='今日告警') {
+        this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
+      }
       sessionStorage.setItem("currentTabs",name)
       this.getCurrentTab (name)
       this.getTreeList()

+ 3 - 0
src/views/homecomponents/EquipmentAnalysis/PolicyConfigManage.vue

@@ -89,6 +89,9 @@ export default {
 		},
     tabsClick (name) {
       this.stationData = this.getTree(this.stationData) // 切换tab页时,清除tree选中情况
+      if (this.$refs.tree && name!='告警等级配置') {
+        this.$refs.tree.clearInputVal() //清空treeFilter组件里输入框的值
+      }
       sessionStorage.setItem("currentTabs",name)
       this.getCurrentTab (name)
       if (document.querySelector(".station-tree-left")) {

+ 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.22:8088
+        target: 'http://192.168.20.22:8088',// http://192.168.20.58:8086 http://192.168.20.22:8088
         changeOrigin: true, //允许跨域
         pathRewrite: {
             '^/metroapi': ''