shilin 3 роки тому
батько
коміт
81bdd03d33

+ 4 - 4
src/router/index.js

@@ -815,10 +815,10 @@ const router = createRouter({
 	history: createWebHashHistory(),
 	base: '/zhfx/',
 	routes
-})
+});
 
 router.beforeEach((to, from, next) => {
-	next()
-})
+	next();
+});
 
-export default router
+export default router;

+ 0 - 8
src/views/HealthControl/HealthMonth.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 7 - 0
src/views/HealthControl/HealthTab3.vue

@@ -104,20 +104,24 @@ export default {
           { 
             name: "场站",
             field: "wfname",
+			width:'150px',
             is_light: false
           },
           { 
             name: "风机编号",
             field: "wtid",
+			width:'150px',
             is_light: false
           },
           { 
             name: "任务开始时间",
+			width:'200px',
             field: "operationdate",
             is_light: false
           },
           { 
             name: "任务接受时间",
+			width:'200px',
             field: "departuretime",
             is_light: false
           },
@@ -128,16 +132,19 @@ export default {
           },
           { 
             name: "受否下单",
+			width:'100px',
             field: "ismain",
             is_light: false
           },
           { 
             name: "任务状态",
+			width:'150px',
             field: "status",
             is_light: false
           },
           {
             name: "操作",
+			width:'100px',
             field: "",
             is_num: false,
             is_light: false,

+ 28 - 5
src/views/HealthControl/HealthTab4.vue

@@ -84,23 +84,35 @@
         custom-class="modal"
         :close-on-click-modal="false"
       >
-        <info-history :formdata="trackDate" />
+        <info-history :formdata="trackDate"/>
       </el-dialog>
     </div>
+	<el-dialog
+	  title="消缺历史"
+	  v-model="history"
+	  width="1400px"
+	  height="800px"
+	  custom-class="modal"
+	  :close-on-click-modal="false"
+	>
+	<History :formdata="trackDate"/>
+	</el-dialog>
   </div>
 </template>
 
 <script>
 import InfoHistory from "./infotrack2.vue";
+import History from "./healthTab4History.vue";
 import ComTable from "@com/coms/table/table.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import { warn } from "@vue/runtime-core";
 
 export default {
-  components: { InfoHistory, ComTable, SvgIcon },
+  components: { InfoHistory, ComTable, SvgIcon ,History},
   data() {
     const that = this;
     return {
+	  history:false,
       stations: [], // 场站
       windturbines: [], // 风机
       station: "",
@@ -111,21 +123,25 @@ export default {
         column: [
           {
             name: "场站",
+			width:'120px',
             field: "wfname",
             is_light: false,
           },
           {
             name: "风机编号",
+			width:'100px',
             field: "wtid",
             is_light: false,
           },
           {
             name: "任务开始时间",
+			width:'150px',
             field: "operationdate",
             is_light: false,
           },
           {
             name: "任务接受时间",
+			width:'150px',
             field: "departuretime",
             is_light: false,
           },
@@ -141,14 +157,21 @@ export default {
           },
           {
             name: "操作",
+			width:'170px',
             field: "",
             is_num: false,
             is_light: false,
             template() {
-              return "<el-button type='text' style='cursor: pointer;'>消缺跟踪</el-button>";
+              return "<el-button type='text' style='cursor: pointer;' value='gz'>消缺跟踪</el-button>&nbsp;&nbsp;<el-button type='text' style='cursor: pointer;' value='ls'>消缺历史</el-button>";
             },
             click(e, row) {
-              that.onClickTrack(row);
+				if('gz' == event.target.getAttribute("value")){
+					that.onClickTrack(row);
+				}
+				if('ls' == event.target.getAttribute("value")){
+					that.requestTrack(row);
+					that.history = true;
+				}
             },
           },
         ],
@@ -170,6 +193,7 @@ export default {
     },
     // 消缺跟踪
     onClickTrack(row) {
+	  this.dialogVisible = true;
       this.requestTrack(row);
     },
     // 历史查询
@@ -255,7 +279,6 @@ export default {
         success(res) {
           if (res.code == 200) {
             that.trackDate = res.data;
-            that.dialogVisible = true;
           }
         },
       });

+ 0 - 8
src/views/HealthControl/HealthYear.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 130 - 0
src/views/HealthControl/healthTab4History.vue

@@ -0,0 +1,130 @@
+<template>
+	<div>
+		<div class="diamain">
+			<div class="left">
+				<el-tree :data="data" :props="defaultProps" node-key="id" :default-expand-all="true"
+					custom-class="modal" @node-click="handleNodeClick"></el-tree>
+			</div>
+			<div class="right">
+				<div class="table-box">
+					<ComTable :data="tableData" height="700px"></ComTable>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import ComTable from "@com/coms/table/table.vue";
+	export default {
+		components: {
+			ComTable
+		},
+		props: {
+			gridDatas: {},
+			chartDatas: {},
+			formdata: Object,
+		},
+		data() {
+			return {
+				form: {
+					wtId: "",
+					wpId: ""
+				},
+				tableData: {
+					column: [{
+							name: "消缺描述",
+							field: "xqms",
+							width:'400px',
+							is_light: false,
+						},
+						{
+							name: "消缺人员",
+							field: "xqry",
+							is_light: false,
+						},
+						{
+							name: "消缺时间",
+							field: "xqsj",
+							is_light: false,
+						},
+						{
+							name: "更换部件",
+							field: "ghbj",
+							is_light: false,
+						},
+						{
+							name: "更换原因",
+							field: "ghyy",
+							is_light: false,
+						},
+						{
+							name: "更换数量",
+							field: "ghsl",
+							is_light: false,
+						},
+					],
+					data: [],
+				},
+				data: [],
+				defaultProps: {
+					children: "children",
+					label: "label",
+				},
+			};
+		},
+		methods: {
+			async searchH() {
+				var that = this;
+				const {
+					data
+				} = await that.API.requestData({
+					method: "POST",
+					subUrl: "/recommen/findLocationTreeByWtId",
+					data: {
+						wtId: that.form.wtId,
+					},
+				});
+				that.dialogVisible = true;
+				that.data = data.data;
+				that.location = data.data[0].id;
+				that.searchTab();
+			},
+			async searchTab() {
+				var that = this;
+				const {
+					data
+				} = await that.API.requestData({
+					method: "POST",
+					subUrl: "/recommen/findWobugeqByLocation",
+					data: {
+						tablepar: {
+							pageNum: 1,
+							pageSize: 10,
+						},
+						location: that.location,
+					},
+				});
+				if(data.data && data.data[0] && data.data[0].xqsj){
+					data.data[0].xqsj = new Date(data.data[0].xqsj).formatDate("yyyy-MM-dd hh:mm:ss");
+				}
+				that.tableData.data = data.data;
+			},
+			handleNodeClick(data) {
+				this.location = data.id;
+			},
+		},
+		watch: {
+			formdata(res) {
+				if (res) {
+					this.form = this.formdata;
+					this.searchH();
+				}
+			}
+		}
+	};
+</script>
+
+<style lang="less">
+
+</style>

+ 25 - 171
src/views/HealthControl/infotrack2.vue

@@ -319,34 +319,6 @@
       :show="false"
       :formdata="formdata"
     ></defect-elimination-tracking>
-    <div class="dialog-box">
-      <el-dialog
-        title="消缺历史"
-        v-model="dialogVisible"
-        width="1200px"
-        height="800px"
-        custom-class="modal"
-        :close-on-click-modal="false"
-      >
-        <div class="diamain">
-          <div class="left">
-            <el-tree
-              :data="data"
-              :props="defaultProps"
-              node-key="id"
-              :default-expand-all="true"
-              custom-class="modal"
-              @node-click="handleNodeClick"
-            ></el-tree>
-          </div>
-          <div class="right">
-            <div class="table-box">
-              <ComTable :data="tableData" height="700px"></ComTable>
-            </div>
-          </div>
-        </div>
-      </el-dialog>
-    </div>
     <el-dialog
       title="查看监控视频"
       v-model="videoBoxShow"
@@ -400,103 +372,6 @@ export default {
       gisBoxShow: false,
       videoBoxShow: false,
       location: "",
-      tableData: {
-        column: [
-          {
-            name: "消缺描述",
-            field: "xqms",
-            is_light: false,
-          },
-          {
-            name: "消缺人员",
-            field: "xqry",
-            is_light: false,
-          },
-          {
-            name: "消缺时间",
-            field: "xqsj",
-            is_light: false,
-          },
-          {
-            name: "更换部件",
-            field: "ghbj",
-            is_light: false,
-          },
-          {
-            name: "更换原因",
-            field: "ghyy",
-            is_light: false,
-          },
-          {
-            name: "更换数量",
-            field: "ghsl",
-            is_light: false,
-          },
-        ],
-        data: [],
-      },
-      data: [
-        {
-          label: "一级 1",
-          children: [
-            {
-              label: "二级 1-1",
-              children: [
-                {
-                  label: "三级 1-1-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          label: "一级 2",
-          children: [
-            {
-              label: "二级 2-1",
-              children: [
-                {
-                  label: "三级 2-1-1",
-                },
-              ],
-            },
-            {
-              label: "二级 2-2",
-              children: [
-                {
-                  label: "三级 2-2-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          label: "一级 3",
-          children: [
-            {
-              label: "二级 3-1",
-              children: [
-                {
-                  label: "三级 3-1-1",
-                },
-              ],
-            },
-            {
-              label: "二级 3-2",
-              children: [
-                {
-                  label: "三级 3-2-1",
-                },
-              ],
-            },
-          ],
-        },
-      ],
-      defaultProps: {
-        children: "children",
-        label: "label",
-      },
-      dialogVisible: false,
       tabs: [
         {
           icon: "svg-gis",
@@ -510,10 +385,6 @@ export default {
           icon: "svg-jk",
           text: "监控视频",
         },
-        {
-          icon: "svg-jk",
-          text: "消缺历史",
-        },
       ],
       activeTab: 0,
       svgarr: [
@@ -575,14 +446,6 @@ export default {
       videoPlayer: null, // 视频播放实例
     };
   },
-  created() {
-    this.setData();
-  },
-
-  updated() {
-    this.setData();
-  },
-
   onmounted() {
     this.cancelPlay();
   },
@@ -610,10 +473,6 @@ export default {
         ? new Date(this.form.checktime).formatDate("yyyy-MM-dd hh:mm:ss")
         : null;
     },
-    handleNodeClick(data) {
-      this.location = data.id;
-      this.searchTab(data.id);
-    },
     DateformatDate(val) {
       return new Date(val).formatDate("yyyy-MM-dd hh:mm:ss");
     },
@@ -646,33 +505,6 @@ export default {
         return "流程未启动";
       }
     },
-    async searchH() {
-      const { data } = await this.API.requestData({
-        method: "POST",
-        subUrl: "/recommen/findLocationTreeByWtId",
-        data: {
-          wtId: this.form.wtId,
-        },
-      });
-      this.dialogVisible = true;
-      this.data = data.data;
-      this.location = data.data[0].id;
-      this.searchTab();
-    },
-    async searchTab() {
-      const { data } = await this.API.requestData({
-        method: "POST",
-        subUrl: "/recommen/findWobugeqByLocation",
-        data: {
-          tablepar: {
-            pageNum: 1,
-            pageSize: 10,
-          },
-          location: this.location,
-        },
-      });
-      this.tableData.data = data.data;
-    },
 
     showVideoBox() {
       this.videoBoxShow = true;
@@ -687,11 +519,33 @@ export default {
       } else if (index === 2) {
         this.showVideoBox();
       }
-      if (tab.text == "消缺历史") {
-        this.searchH();
-      }
     },
   },
+  watch: {
+  	formdata(res) {
+  		if (res) {
+  			this.form = this.formdata;
+  			this.form.tjss = this.form.tjss
+  			  ? new Date(this.form.tjss).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  			this.form.prodtdepttime = this.form.prodtdepttime
+  			  ? new Date(this.form.prodtdepttime).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  			this.form.departuretime = this.form.departuretime
+  			  ? new Date(this.form.departuretime).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  			this.form.arrivaltime = this.form.arrivaltime
+  			  ? new Date(this.form.arrivaltime).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  			this.form.repairedtime = this.form.repairedtime
+  			  ? new Date(this.form.repairedtime).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  			this.form.checktime = this.form.checktime
+  			  ? new Date(this.form.checktime).formatDate("yyyy-MM-dd hh:mm:ss")
+  			  : null;
+  		}
+  	}
+  }
 };
 </script>
 

+ 276 - 0
src/views/NewPages/components/group-table.vue

@@ -0,0 +1,276 @@
+<template>
+  <el-table class="custom-table" :class="customClass" stripe :data="data.data" :height="height" style="width: 100%;cursor: pointer;" @cell-click="onClick" @header-click="onHeaderClick">
+    <template v-for="col in data.column" :key="col">
+      <el-table-column v-if="col.child && col.child.length > 0" :label="col.name" :key="col">
+        <el-table-column
+          v-for="sub in col.child"
+          :key="sub"
+          :label="sub.name"
+          :prop="sub.field"
+          :width="sub.width"
+          :sortable="sub.sortable"
+          :show-overflow-tooltip="!sub.slot"
+          :fixed="sub.fixed"
+          :align="sub.align ? sub.align : 'center'"
+          :resizable="sub.resizable"
+          :header-align="'center'"
+        >
+          <template v-if="sub.slot == true" #default="item">
+            <slot :name="sub.field" :column="sub" :row="item.row" :all="item" :data="item.row[item.field]"></slot>
+          </template>
+        </el-table-column>
+      </el-table-column>
+      <el-table-column
+        v-if="!col.child"
+        :label="col.name"
+        :prop="col.field"
+        :width="col.width"
+        :sortable="col.sortable"
+        :show-overflow-tooltip="!col.slot"
+        :fixed="col.fixed"
+        :align="col.align ? col.align : 'center'"
+        :resizable="col.resizable"
+        :header-align="'center'"
+      >
+        <template v-if="col.slot == true" #default="item">
+          <slot :name="col.field" :column="col" :row="item.row" :all="item" :data="item.row[col.field]"></slot>
+        </template>
+      </el-table-column>
+    </template>
+  </el-table>
+  <el-pagination class="mg-t-8" v-if="pageable" @current-change="handleCurrentChange" :current-page="currentPage" :page-size="pageSize" :total="data.total" v-bind="elPaggingProps"> </el-pagination>
+</template>
+
+<script>
+export default {
+  // 名称
+  name: "ComTable",
+  // 使用组件
+  components: {},
+  // 传入参数
+  props: {
+    /**
+             * {
+                    column: [{
+                        name: "风机名称",
+                        child:[{
+                            field: "name",
+                            width:'', // 宽度
+                            click:function(){} // 点击事件
+                            sortable:fasle,
+                            slot:false,
+                            fixed:false,
+                            align:'center',
+                            resizable :false,
+                        }]
+                    }],
+                    total:200
+                }
+             */
+    data: Object,
+    height: {
+      type: String,
+      default: "",
+    },
+    pageSize: {
+      type: Number,
+      default: 0,
+    },
+    customClass: {
+      type: String,
+      default: "",
+    },
+    elPaggingProps: {
+      type: Object,
+      default: () => {
+        return {
+          layout: "total, sizes, prev, pager, next, jumper",
+          // "page-sizes": [100, 200, 300, 400],
+        };
+      },
+    },
+  },
+  emits: {
+    onPagging: null,
+    headerClick: null,
+  },
+  // 数据
+  data() {
+    return {
+      currentPage: 1,
+    };
+  },
+  computed: {
+    tableData() {
+      let that = this;
+      if (this.sortCol == "") {
+        return this.data.data;
+      } else {
+        let data = this.data.data;
+
+        data.sort((a, b) => {
+          let rev = 1;
+          if (that.sortType == "ASC") rev = 1;
+          else if (that.sortType == "DESC") rev = -1;
+
+          if (a[that.sortCol] > b[that.sortCol]) return rev * 1;
+          if (a[that.sortCol] < b[that.sortCol]) return rev * -1;
+          return 0;
+        });
+        return data;
+      }
+    },
+    pageable() {
+      return this.pageSize != 0;
+    },
+    pages() {
+      if (this.pageable) return parseInt(this.data.total / this.pageSize) + 1;
+      else return 0;
+    },
+    startRow() {
+      if (this.pageable) return (this.currentPage - 1) * this.pageSize;
+      else return 0;
+    },
+    endRow() {
+      if (this.pageable) return this.currentPage * this.pageSize;
+      else return this.data.data.length;
+    },
+  },
+  // 函数
+  methods: {
+    onClick(row, column, cell, event) {
+      if (column.rawColumnKey.click) column.rawColumnKey.click(event, row);
+    },
+    onHeaderClick(column, event) {
+      this.$emit("headerClick", { event: event, col: column.rawColumnKey, data: this.data.data });
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.$emit("onPagging", {
+        pageIndex: this.currentPage,
+        pageSize: this.pageSize,
+        start: this.startRow,
+        end: this.endRow,
+      });
+    },
+  },
+  // 生命周期钩子
+  beforeCreate() {
+    // 创建前
+  },
+  created() {
+    // 创建后
+  },
+  beforeMount() {
+    // 渲染前
+  },
+  mounted() {
+    // 渲染后
+  },
+  beforeUpdate() {},
+  updated() {},
+};
+</script>
+
+<style lang="less">
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.com-table {
+  width: 100%;
+  border-collapse: collapse;
+
+  thead {
+    tr { 
+      display: table;
+      table-layout: fixed;
+      width: 100%;
+
+      th {
+        background-color: fade(@darkBack, 20%);
+        height: 30px;
+        line-height: 30px;
+        color: @titleGray;
+        font-weight: 400;
+        font-size: @fontsize-s;
+        position: sticky;
+        top: 0;
+        cursor: pointer;
+
+        &.light,
+        &.always-light {
+          color: @green;
+        }
+      }
+    }
+  }
+
+  tbody {
+    display: block;
+
+    tr {
+      display: table;
+      table-layout: fixed;
+      width: 100%;
+
+      &:nth-child(2n) {
+        background-color: fade(@rowGray, 20%);
+      }
+
+      td {
+        padding: 0.556vh 0;
+        color: @rowGray;
+        text-align: center;
+        font-size: @fontsize-s;
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+
+        &.light,
+        &.always-light {
+          color: @green !important;
+        }
+
+        &.num {
+          font-family: "Bicubik";
+          font-weight: 400;
+        }
+      }
+    }
+  }
+
+  .el-pagination {
+    color: @gray;
+    .el-pagination__total {
+      color: @gray;
+    }
+
+    button {
+      &.btn-next,
+      &.btn-prev {
+        background: center center no-repeat fade(@gray, 20);
+        color: @gray-l;
+      }
+      &:disabled {
+        color: @gray-l;
+        background-color: fade(@gray, 20);
+        cursor: not-allowed;
+      }
+    }
+
+    .el-pager li {
+      color: @gray-l;
+      background: fade(@gray, 20);
+      &.active {
+        color: @green;
+      }
+    }
+
+    .el-input__inner {
+      color: @gray-l;
+      background: fade(@gray, 20);
+      border: 1px solid fade(@gray, 20);
+    }
+  }
+}
+</style>

Різницю між файлами не показано, бо вона завелика
+ 418 - 385
src/views/NewPages/power-benchmarking.vue


+ 2 - 1
src/views/WindSite/pages/Map.vue

@@ -17,7 +17,7 @@
         <div class="sub-title-item">
           <img src="../../../assets/map/fan/black.png" />
           <span class="sub-title gray">接入台数</span>
-          <span class="sub-count font-num white">{{ wpnumMap.jrts }}</span>
+          <span class="sub-count font-num gray">{{ wpnumMap.djts + wpnumMap.yxts + wpnumMap.xdts +wpnumMap.gzts +wpnumMap.whts + wpnumMap.lxts}}</span>
         </div>
         <div class="sub-title-item">
           <img src="../../../assets/map/fan/green.png" />
@@ -285,6 +285,7 @@ export default {
         success(res) {
           if (res.code == 200) {
             that.wpnumMap = res.data.fczbmap.jczbmap;
+			  console.log(that.wpnumMap)
             that.wpInfoMap = res.data.wxssmap;
             that.fjmap = res.data.fjmap[0];
           }

+ 105 - 60
src/views/allLifeManage/tab1.vue

@@ -5,36 +5,66 @@
         <div class="query-item">
           <div class="lable">供应商:</div>
           <div class="search-input">
-            <el-select v-model="vendor" clearable placeholder="请选择" popper-class="select">
-              <el-option v-for="item in vendorArray" :key="item.company" :value="item.company" :label="item.company" />
+            <el-select
+              v-model="vendor"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in vendorArray"
+                :key="item.company"
+                :value="item.company"
+                :label="item.company"
+              />
             </el-select>
           </div>
         </div>
         <div class="query-item">
           <div class="lable">采购单号:</div>
           <div class="search-input">
-            <el-input placeholder="请输入描述" size="middle" v-model="ponum" clearable></el-input>
+            <el-input
+              placeholder="请输入描述"
+              size="middle"
+              v-model="ponum"
+              clearable
+            ></el-input>
           </div>
         </div>
         <div class="query-item">
           <div class="lable">仓库:</div>
           <div class="search-input">
-            <el-select v-model="warehouse" clearable placeholder="请选择" popper-class="select">
-              <el-option v-for="item in warehouseArray" :key="item.warehouse" :value="item.warehouse" :label="item.warehouse" />
+            <el-select
+              v-model="warehouse"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in warehouseArray"
+                :key="item.warehouse"
+                :value="item.warehouse"
+                :label="item.warehouse"
+              />
             </el-select>
           </div>
         </div>
         <div class="query-item">
           <div class="lable">日期:</div>
           <div class="search-input">
-            <el-date-picker size="medium" v-model="dateArea" type="datetimerange"
-              :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"
-              >
+            <el-date-picker
+              size="medium"
+              v-model="dateArea"
+              type="datetimerange"
+              :picker-options="pickerOptions"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              align="right"
+            >
             </el-date-picker>
           </div>
         </div>
-        
-        
       </div>
       <div class="query-actions" style="margin-right: 1500px">
         <button class="btn green" @click="onClickSearch">查询</button>
@@ -54,9 +84,13 @@ export default {
   data() {
     return {
       dateArea: [
-          this.fmtDate(new Date(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 30))),
-          this.fmtDate(new Date())
-        ],
+        this.fmtDate(
+          new Date(
+            new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 30)
+          )
+        ),
+        this.fmtDate(new Date()),
+      ],
       pageSize: 100,
       pageNum: 1,
       ponum: "",
@@ -176,57 +210,56 @@ export default {
   created() {
     // this.requestSafeList();
     this.value1 = this.getTime(1);
-		this.value2 = this.getTime(2);
+    this.value2 = this.getTime(2);
     this.getVendor();
-    this.getWarehouse();
-    this.requestSafeList();
   },
   methods: {
-    getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
-				var date = new Date();
-				var year = date.getFullYear(),
-					month = date.getMonth() + 1,
-					day = date.getDate();
-				month >= 1 && month <= 9 ? (month = '0' + month) : '';
-				day >= 0 && day <= 9 ? (day = '0' + day) : '';
-				var begin = year + '-' + month + '-01';
-				var end = year + '-' + month + '-' + day;
-				if (val == 1) {
-					return begin;
-				} else if (val == 2) {
-					return end;
-				}
-			},
-    
-// 获取厂家
-    getVendor () {
+    getTime(val) {
+      //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
+      var date = new Date();
+      var year = date.getFullYear(),
+        month = date.getMonth() + 1,
+        day = date.getDate();
+      month >= 1 && month <= 9 ? (month = "0" + month) : "";
+      day >= 0 && day <= 9 ? (day = "0" + day) : "";
+      var begin = year + "-" + month + "-01";
+      var end = year + "-" + month + "-" + day;
+      if (val == 1) {
+        return begin;
+      } else if (val == 2) {
+        return end;
+      }
+    },
+
+    // 获取厂家
+    getVendor() {
       let that = this;
       that.API.requestData({
         baseURL: "http://192.168.1.18:9988",
-          subUrl: "companies/list",
-        success (res) {
-          console.log(res.data)
+        subUrl: "companies/list",
+        success(res) {
           that.vendorArray = res.data;
           that.vendor = res.data[0].company;
-        }
+          that.getWarehouse();
+        },
       });
     },
     // 获取仓库
-    getWarehouse () {
+    getWarehouse() {
       let that = this;
       that.API.requestData({
         baseURL: "http://192.168.1.18:9988",
-          subUrl: "warehouse/list",
-        success (res) {
-          console.log(res.data)
+        subUrl: "warehouse/list",
+        success(res) {
           that.warehouseArray = res.data;
           that.warehouse = res.data[0].warehouse;
-        }
+          that.requestSafeList();
+        },
       });
     },
 
     // 格式化日期
-    fmtDate (date) {
+    fmtDate(date) {
       let curDate = date || new Date();
       let year = curDate.getFullYear();
       let mouth = curDate.getUTCMonth() + 1;
@@ -234,7 +267,19 @@ export default {
       let hour = curDate.getHours();
       let minutes = curDate.getMinutes();
       let seconds = curDate.getSeconds();
-      return year + '-' + (mouth < 10 ? '0' + mouth : mouth) + '-' + (day < 10 ? '0' + day : day) + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
+      return (
+        year +
+        "-" +
+        (mouth < 10 ? "0" + mouth : mouth) +
+        "-" +
+        (day < 10 ? "0" + day : day) +
+        " " +
+        (hour < 10 ? "0" + hour : hour) +
+        ":" +
+        (minutes < 10 ? "0" + minutes : minutes) +
+        ":" +
+        (seconds < 10 ? "0" + seconds : seconds)
+      );
     },
     BeginChange(vl) {
       this.value1 = vl;
@@ -254,11 +299,15 @@ export default {
       let that = this;
       if (!that.dateArea || !that.dateArea.length) {
         that.BASE.showMsg({
-          msg:"请先选择要查询的日期区间后再试"
+          msg: "请先选择要查询的日期区间后再试",
         });
       } else {
-        let starttime = (this.dateArea.length ? new Date(this.dateArea[0]).formatDate("yyyy-MM-dd hh:mm:ss") : '');
-        let endtime = (this.dateArea.length ? new Date(this.dateArea[1]).formatDate("yyyy-MM-dd hh:mm:ss") : '');
+        let starttime = this.dateArea.length
+          ? new Date(this.dateArea[0]).formatDate("yyyy-MM-dd hh:mm:ss")
+          : "";
+        let endtime = this.dateArea.length
+          ? new Date(this.dateArea[1]).formatDate("yyyy-MM-dd hh:mm:ss")
+          : "";
 
         // let data = {
         //   category1:'SYZ',
@@ -273,8 +322,8 @@ export default {
         that.API.requestData({
           // baseURL:"http://192.168.1.14:8075/",
           baseURL: "http://192.168.1.18:9988",
-          subUrl:"poline/list",
-          method:"GET",
+          subUrl: "poline/list",
+          method: "GET",
           data: {
             vendor: that.vendor,
             ponum: that.ponum,
@@ -284,11 +333,10 @@ export default {
             pagenum: that.pageNum,
             pagesize: that.pageSize,
           },
-          success(res){
-            console.log(res.data.records);
+          success(res) {
             if (res.data.records.length) {
-              res.data.records.forEach((ele,index) => {
-                ele.index = (index+1);
+              res.data.records.forEach((ele, index) => {
+                ele.index = index + 1;
                 ele.timeDate = that.fmtDate(new Date(ele.time));
                 if (ele.value > 0) {
                   ele.value = parseFloat(ele.value).toFixed(4);
@@ -297,17 +345,14 @@ export default {
               that.tableData.data = res.data.records || [];
             } else {
               that.BASE.showMsg({
-                type:"warning",
-                msg:"所选日期区间之内暂无数据,请重试"
+                type: "warning",
+                msg: "所选日期区间之内暂无数据,请重试",
               });
             }
             that.showDialog = true;
-          }
+          },
         });
       }
-      
-      
-
     },
   },
 };

+ 1 - 38
src/views/layout/Menu.vue

@@ -254,7 +254,7 @@ export default {
                   path: "/new/zfwjsl",
                 },
                 {
-                  text: "状态转换率",
+                  text: "状态分析",
                   icon: "svg-wind-site",
                   path: "/new/zztzhl",
                 },
@@ -500,43 +500,6 @@ export default {
           id: "personnel",
           text: "安全管控",
           data: [
-            // ,
-            // {
-            //   text: "五项损失率",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision2",
-            // },
-            // {
-            //   text: "场内对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision2Cndb",
-            // },
-            // {
-            //   text: "场际对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision2Cjdb",
-            // },
-            // {
-            //   text: "项目对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision2Xmdb",
-            // },
-            // {
-            //   text: "线路对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision2Xldb",
-            // },
-            // {
-            //   text: "性能对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision3",
-            // },
-            // {
-            //   text: "值际对标",
-            //   icon: "svg-matrix",
-            //   path: "/decision/decision4",
-            // }
-
             {
               text: "安全管控",
               icon: "svg-matrix",