瀏覽代碼

小修改

dongjh 4 月之前
父節點
當前提交
a04425cbbf

+ 1 - 0
src/components/tools/HeaderNotice.vue

@@ -190,6 +190,7 @@
       },
       toMyAnnouncement(){
         this.$router.push({
+          name: 'userAnnouncement',
           path: '/isps/userAnnouncement'
         });
       },

+ 2 - 2
src/components/tools/UserMenu.vue

@@ -39,7 +39,7 @@
         <span v-if="isDesktop()">欢迎您,{{ nickname() }}</span>
       </span>
       <a-menu slot="overlay" class="user-dropdown-menu-wrapper">
-        <a-menu-item key="0">
+        <!-- <a-menu-item key="0">
           <router-link :to="{ name: 'account-center' }">
             <a-icon type="user"/>
             <span>个人中心</span>
@@ -50,7 +50,7 @@
             <a-icon type="setting"/>
             <span>账户设置</span>
           </router-link>
-        </a-menu-item>
+        </a-menu-item> -->
         <a-menu-item key="3"  @click="systemSetting">
            <a-icon type="tool"/>
            <span>系统设置</span>

+ 12 - 0
src/config/router.config.js

@@ -388,6 +388,18 @@ export const constantRouterMap = [
     ]
   },
   {
+    path: '/isps',
+    component: TabLayout,
+    redirect: '/isps/userAnnouncement',
+    children: [
+      {
+        path: 'userAnnouncement',
+        name: 'userAnnouncement',
+        component: () => import('@/views/system/UserAnnouncementList')
+      }
+    ]
+  },
+  {
     path: '/404',
     component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
   },

+ 32 - 64
src/views/module_cmms/inspect/modules/InspectForm.vue

@@ -37,11 +37,11 @@
               bordered
               rowKey="id"
               :columns="columns"
-              :dataSource="model.itemList"
+              :dataSource="model.allItemList"
               :pagination="false"
               class="j-table-force-nowrap">
               <template slot="iresult" slot-scope="text, record,index">
-                <a-form-model-item :prop="'itemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
+                <a-form-model-item :prop="'allItemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
                   <a-radio-group name="radioGroup" v-model="record.iresult">
                     <a-radio value="0">
                       正常
@@ -53,7 +53,7 @@
                 </a-form-model-item>
               </template>
               <template slot="iremark" slot-scope="text, record,index">
-                <a-form-model-item :prop="'itemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
+                <a-form-model-item :prop="'allItemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
                   <a-input v-model="record.iremark" placeholder="请输入点检备注"></a-input>
                 </a-form-model-item>
               </template>
@@ -67,56 +67,6 @@
 
 <script>
 
-const treeData1 = [
-  {
-    title: '测试123456',
-    key: '1111111111111',
-    type: '巡检路线',
-    completionStatus: '0',
-    slots: { icon: 'parent', },
-    // ⚠️重点这这里⚠️每一条数据上都添加scopedSlots属性
-    scopedSlots:{ title:"handle" },
-    children: [
-      {
-        title: '测试巡检点的修改NO1',
-        key: '12223333333',
-        type: '巡检点',
-        slots: { icon: 'child', },
-        // ⚠️重点这这里⚠️每一条数据上都添加scopedSlots属性
-        scopedSlots:{ title:"handle" },
-        children: [
-          {
-            title: '半自动立钻Z5180C',
-            key: '55555555555',
-            type: '巡检内容',
-            scopedSlots:{ title:"handle" },
-            ItemList: [
-              // 巡检标准相关信息
-            ]
-          },
-        ],
-      },
-    ],
-  },
-  {
-    title: '测试巡检点的修改NO2',
-    key: '456293324552',
-    type: '巡检点',
-    completionStatus: '1',
-    scopedSlots:{ title:"handle" },
-    children: [
-      {
-        title: '半自动立钻Z5180D',
-        key: '1335633666666',
-        type: '巡检内容',
-        ItemList: [
-          // 巡检标准相关信息
-        ]
-      },
-    ],
-  },
-];
-
   import { httpAction, getAction, putAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
 
@@ -135,7 +85,8 @@ const treeData1 = [
     data () {
       return {
         model: {
-          itemList: []
+          itemList: [],
+          allItemList: []
         },
         labelCol: {
           xs: { span: 24 },
@@ -158,6 +109,7 @@ const treeData1 = [
           queryTreeById: "/cmmsInspect/cmmsInspect/queryTreeById",
           queryItemByCountId: "/cmmsInspect/cmmsInspect/queryItemByCountId",
           feedback: "/cmmsInspect/cmmsInspect/feedback",
+          list: "/cmmsInspect/cmmsInspect/list",
         },
         treeData: [],
         selectedKeys: [], // (受控)设置选中的树节点
@@ -233,6 +185,7 @@ const treeData1 = [
     created () {
        //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
+      var _this = this
     },
     methods: {
       edit (record) {
@@ -240,9 +193,7 @@ const treeData1 = [
         this.visible = true;
         this.confirmLoading = true
         // getAction(this.url.queryById, {id: record.id}).then((res) => {
-        //   console.log(res)
         //   this.model = res.result
-        //   // console.log(res.result.planList)
         //   var planList = res.result.planList
         //   var orderData = []
         //   if(planList.length>0){
@@ -258,7 +209,6 @@ const treeData1 = [
         //           if(spotItem.inspectContentList){
         //             for (let i = 0; i < spotItem.inspectContentList.length; i++) {
         //               const contentItem = spotItem.inspectContentList[i];
-        //               console.log(spotItem, contentItem)
         //               // 巡检内容数据
         //               if(contentItem){
         //                 var contentNode = {
@@ -297,7 +247,6 @@ const treeData1 = [
         //       }
         //     }
         //   }
-        //   console.log(orderData)
         //   this.treeData = orderData
         //   // if(planList.length>0){
         //   //   planList.map(item => {
@@ -328,13 +277,14 @@ const treeData1 = [
         //   this.confirmLoading = false
         // })
         getAction(this.url.queryTreeById, {id: record.id}).then((res) => {
-          console.log(res)
           if(this.selectedKeys.length === 0){
             this.model = res.result
           }
           // this.model.itemList = []
           this.treeData = this.setIcon(res.result.children)
           this.confirmLoading = false
+          this.getAllItem();
+          console.log("allItemList", this.model.allItemList);
         })
       },
       // 设置树结构图标
@@ -356,8 +306,6 @@ const treeData1 = [
         //  二次点击树节点时selectedKeys为空,直接return中断执行
         if (selectedKeys.length === 0) return
         this.selectedKeys = selectedKeys
-        // console.log('selected', selectedKeys, info);
-        console.log(info.selectedNodes[0].data.props)
         var props = info.selectedNodes[0].data.props
         if(props.type === '巡检内容'){
           // this.model.itemList = props.inspectTcontentItemList
@@ -371,16 +319,36 @@ const treeData1 = [
           // this.getItemList(props.id)
         }
       },
+      getAllItem() {
+        var _this = this
+        _this.model.allItemList = [];
+        this.treeData.forEach(option =>{
+          if (option.type == "巡检点") {
+            option.children.forEach(address => {
+              address.inspectTcontentItemList.forEach(item => {
+                item.equipmentname = props.equipmentname
+                _this.model.allItemList.push(item)
+              });
+            });
+          }
+          else if (option.type == "巡检路线") {
+            option.children.forEach(line => {
+              line.children.forEach(address => {
+                address.inspectTcontentItemList.forEach(item => {
+                  _this.model.allItemList.push(item)
+                });
+              });
+            });
+          }
+        })
+      },
       getItemList(id){
         getAction(this.url.queryItemByCountId, {countId: id, inspectId: this.model.id}).then((res) => {
-          console.log(res)
           this.model.itemList = res.result
-          console.log(this.model)
           this.$forceUpdate()
         })
       },
       handleFeedback(){
-        console.log(this.model.itemList)
         this.confirmLoading = true
         putAction(this.url.feedback, this.model.itemList).then((res) => {
           if(res.success){

+ 5 - 2
src/views/module_cmms/inspectAbnormalItems/InspectAbnormalItemsList.vue

@@ -120,13 +120,16 @@
           <a-popconfirm v-if="record.unusualstatus === '0'" title="是否执行异常项目确认操作?" @confirm="() => handleConfirm(record)">
             <a>确认</a>
           </a-popconfirm>
-          <a-popconfirm v-else title="是否执行异常项目确认操作?" disabled>
+          <a-popconfirm v-else disabled>
             <a style="color:#cdcdcd">确认</a>
           </a-popconfirm>
           <a-divider type="vertical" />
-          <a-popconfirm title="是否执行异常项目转报修操作?" @confirm="() => handleTransrepair(record)">
+          <a-popconfirm v-if="record.unusualstatus === '1' && record.tcontequiptid !== null && record.tcontequiptid !== ''" title="是否执行异常项目转报修操作?" @confirm="() => handleTransrepair(record)">
             <a>转报修</a>
           </a-popconfirm>
+          <a-popconfirm v-else disabled title="请先确认再转报修!">
+            <a style="color:#cdcdcd">转报修</a>
+          </a-popconfirm>
 
           <!-- <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>

+ 173 - 138
src/views/module_tpm/healthForecast/index.vue

@@ -1,30 +1,34 @@
 
 <template>
   <div>
-  <a-card :bordered="false" style="padding: 0px 10px 0px 10px;">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" :model="queryParams" ref="queryForm">
-        <a-row :gutter="24">
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="设备名称">
-              <j-search-select-tag v-model="queryParams.equipmentid" dict="tpm_equipment,equipmentname,id"  style="width: 100%"/>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="4" :lg="7" :md="8" :sm="24">
+    <a-card :bordered="false" style="padding: 0px 10px 0px 10px">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline" :model="queryParams" ref="queryForm">
+          <a-row :gutter="24">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="设备名称">
+                <j-search-select-tag
+                  v-model="queryParams.equipmentid"
+                  dict="tpm_equipment,equipmentname,id"
+                  style="width: 100%"
+                />
+              </a-form-item>
+            </a-col>
+            <!-- <a-col :xl="4" :lg="7" :md="8" :sm="24">
             <a-form-item label="参数类型">
               <j-dict-select-tag v-model="queryParams.tagtype"  placeholder="请输入优先级" dictCode="tpm_tag_type"/>
             </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="loadData" icon="search">查询</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <div class="trend-charts" ref="trendCharts" :style="{ height: echartsHeight + 'px', }"></div>
-  </a-card>
+          </a-col> -->
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                <a-button type="primary" @click="loadData" icon="search">查询</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="trend-charts" ref="trendCharts" :style="{ height: echartsHeight + 'px' }"></div>
+    </a-card>
   </div>
 </template>
 
@@ -34,6 +38,8 @@ import * as echarts from 'echarts'
 import { httpAction, getAction, postAction } from '@/api/manage'
 import { emsdata } from '../../module_ems/energyAnalyse/emsdata'
 import { pvdata } from '../../module_ems/photovoltaic/pvdata'
+import axios from 'axios'
+import signMd5Utils from '@/utils/encryption/signMd5Utils'
 
 export default {
   name: 'Index',
@@ -53,7 +59,7 @@ export default {
         pageSize: 10,
         equipmentid: '1780110297413861377',
         day: null,
-        tagtype: "5",
+        tagtype: '5',
       },
       url: {
         list: '/homepate/statistics/firstload',
@@ -69,21 +75,36 @@ export default {
   },
   created() {},
   mounted() {
-    this.getTest();
+    this.getTest()
   },
   methods: {
     /** 查询设备运行状态时间段列表 */
     loadData(arg) {
-      setTimeout(() => {
-        this.getTest()
-      }, 2000)
+      var starttime = '2024-04-23 07:32:00'
+      var endtime = '2024-04-23 12:32:00'
+      var equipmentcode = 'RS7611000000081'
+      let url = 'http://192.168.2.128:8000/phmpre/healthpre/'
+
+      var header = {headers: {"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"}, changeOrigin: true};
+      // axios.defaults.changeOrigin = true;
+      // axios.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8";
+      var parameter = {
+        starttime: starttime,
+        endtime: endtime,
+        equipmentcode: equipmentcode,
+      }
+      axios
+        .post(url, parameter, header)
+        .then((res) => {
+          console.log(res.data)
+        })
     },
-    
+
     // 后端好了需要删掉
     getTest() {
       var _this = this
-      _this.gd02us = [];
-      _this.times = [];
+      _this.gd02us = []
+      _this.times = []
       pvdata.mdForecastdata.forEach((item) => {
         item.data.forEach((i) => {
           if (item.meterName === 'GD02R') {
@@ -100,14 +121,10 @@ export default {
       var _this = this
       var chartDom = this.$refs.trendCharts
       _this.myChart = echarts.init(chartDom)
+      _this.echartsHeight = 4 * 300;
+      var leftValue = '5%';
       
       var option = {
-        tooltip: {
-          trigger: 'axis',
-          // position: function (pt) {
-          //   return [pt[0], '5%']
-          // },
-        },
         title: {
           left: 'left',
           text: '设备运行数据趋势预测',
@@ -115,76 +132,59 @@ export default {
         legend: {
           data: ['实际值', '预测值'],
         },
-        xAxis: {
-          type: 'category',
-          boundaryGap: false,
-          data: _this.times,
-        },
-        yAxis: {
-          type: 'value',
-          boundaryGap: [0, '100%'],
-        },
-        // dataZoom: [
-        //   {
-        //     type: 'inside',
-        //     start: 0,
-        //     end: 100,
-        //     xAxisIndex: 0,
-        //   },
-        //   {
-        //     start: 0,
-        //     end: 10,
-        //   },
-        //   {
-        //     show: true,
-        //     yAxisIndex: 0,
-        //     filterMode: 'empty',
-        //     width: 30,
-        //     height: '80%',
-        //     right: '7%',
-        //   },
-        // ],
+        grid: [
+          { left: leftValue, top: "5%", bottom: "78%" },
+          { left: leftValue, top: "26%", bottom: "54%" },
+          { left: leftValue, top: "54%", bottom: "26%" },
+          { left: leftValue, top: "78%", bottom: "5%" }
+        ],
+        xAxis: [
+          {
+            type: 'category',
+            gridIndex: 0,
+            boundaryGap: false,
+            name: '电流',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 1,
+            boundaryGap: false,
+            name: '电压',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 2,
+            boundaryGap: false,
+            name: '温度',
+            data: _this.times,
+          },
+          {
+            type: 'category',
+            gridIndex: 3,
+            boundaryGap: false,
+            name: '湿度',
+            data: _this.times,
+          },
+        ],
+        yAxis: [
+          { type: 'value', gridIndex: 0 },
+          { type: 'value', gridIndex: 1 },
+          { type: 'value', gridIndex: 2 },
+          { type: 'value', gridIndex: 3 }
+        ],
         series: [
           {
             name: '实际值',
             type: 'line',
             symbol: 'none',
             sampling: 'lttb',
+            xAxisIndex: 0,
+            yAxisIndex: 0,
             itemStyle: {
               color: '#91CC75',
             },
-            // markArea: {
-            //   // 覆盖面积
-            //   itemStyle: {
-            //     color: 'rgba(255, 173, 177, 0.4)',
-            //   },
-            //   data: [
-            //     // [
-            //     //   {
-            //     //     // name: 'Morning Peak',
-            //     //     xAxis: '07:02',
-            //     //   },
-            //     //   {
-            //     //     xAxis: '07:15',
-            //     //   },
-            //     // ],
-            //     [
-            //       {
-            //         // name: 'Evening Peak',
-            //         xAxis: '11:14',
-            //       },
-            //       {
-            //         xAxis: '11:28',
-            //       },
-            //     ],
-            //   ],
-            // },
-            // markPoint: { // 记录最大值和最小值
-            //   data: [
-            //     { type: 'max', name: 'Max' },
-            //     { type: 'min', name: 'Min' },
-            //   ],
-            // },
             data: _this.gd02us,
           },
           {
@@ -192,53 +192,88 @@ export default {
             type: 'line',
             symbol: 'none',
             sampling: 'lttb',
+            xAxisIndex: 0,
+            yAxisIndex: 0,
             itemStyle: {
               color: '#EE6666',
             },
-            // markPoint: {
-            //   data: [
-            //     { type: 'max', name: 'Max' },
-            //     { type: 'min', name: 'Min' },
-            //   ],
-            // },
             data: _this.gd03us,
           },
-          // {
-          //   name: 'GD05 U',
-          //   type: 'line',
-          //   symbol: 'none',
-          //   sampling: 'lttb',
-          //   itemStyle: {
-          //     color: '#FAAD14',
-          //   },
-          //   markPoint: {
-          //     data: [
-          //       { type: 'max', name: 'Max' },
-          //       { type: 'min', name: 'Min' },
-          //     ],
-          //   },
-          //   data: _this.gd05us,
-          // },
-          // {
-          //   name: 'GD06 U',
-          //   type: 'line',
-          //   symbol: 'none',
-          //   sampling: 'lttb',
-          //   itemStyle: {
-          //     color: '#5470C6',
-          //   },
-          //   markPoint: {
-          //     data: [
-          //       { type: 'max', name: 'Max' },
-          //       { type: 'min', name: 'Min' },
-          //     ],
-          //   },
-          //   data: _this.gd06us,
-          // },
-        ],
-      }
-
-
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 1,
+            yAxisIndex: 1,
+            itemStyle: {
+              color: '#91CC75',
+            },
+            data: _this.gd02us,
+          },
+          {
+            name: '预测值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 1,
+            yAxisIndex: 1,
+            itemStyle: {
+              color: '#EE6666',
+            },
+            data: _this.gd03us,
+          },
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 2,
+            yAxisIndex: 2,
+            itemStyle: {
+              color: '#91CC75',
+            },
+            data: _this.gd02us,
+          },
+          {
+            name: '预测值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 2,
+            yAxisIndex: 2,
+            itemStyle: {
+              color: '#EE6666',
+            },
+            data: _this.gd03us,
+          },
+          {
+            name: '实际值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 3,
+            yAxisIndex: 3,
+            itemStyle: {
+              color: '#91CC75',
+            },
+            data: _this.gd02us,
+          },
+          {
+            name: '预测值',
+            type: 'line',
+            symbol: 'none',
+            sampling: 'lttb',
+            xAxisIndex: 3,
+            yAxisIndex: 3,
+            itemStyle: {
+              color: '#EE6666',
+            },
+            data: _this.gd03us,
+          },
+        ]
+      };
+      
       option && _this.myChart.setOption(option)
       setTimeout(() => {
         _this.myChart.resize()

+ 1 - 1
vue.config.js

@@ -109,7 +109,7 @@ module.exports = {
           issues/3462 很多人此处做了配置,导致刷新前端404问题,请一定注意*/
       [process.env.VUE_APP_API_BASE_URL]: {
         target: 'http://localhost:8867',
-        ws: false,
+        // ws: false,
         changeOrigin: true,
         angeOrigin: true,
         pathRewrite: {