Browse Source

推荐风机提交添加确认弹窗;
登录页面;

chenminghua 3 years ago
parent
commit
0b08d478cf

+ 19 - 5
src/views/HealthControl/HealthTab1.vue

@@ -46,7 +46,7 @@
             <div class="info">
               <p>推荐理由:{{ item.reason }}</p>
               <p>推荐检修时间:{{new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
-              <p>推荐时间对应风速:{{ item.speed }}</p>
+              <p>推荐时间对应风速:{{ item.speed }} m/s</p>
               <p>判断时间:{{new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
               <div class="actions mg-t-16">
                 <button class="btn success" @click="onClickCofirm(item)">
@@ -138,19 +138,28 @@ export default {
     },
     // 健康推荐提交
     onClickCofirm(item) {
-      // this.requestOption("recommen/confirpush", item.rid);
+      let that = this;
+      that.$confirm('确认提交?').then(_=> {
+        that.requestOption("recommen/confirpush", item.rid);
+      }).catch(_=>{})
     },
     // 健康推荐取消
     onClickIgnore(item) {
-      // this.requestOption("recommen/ignorepush", item.rid);
+      this.requestOption("recommen/ignorepush", item.rid);
     },
     // 健康推荐提交全部
     onClickCofirmAll() {
-      // this.requestOptionAll("recommen/confirpushAll");
+      let that = this;
+      that.$confirm('确认全部提交?').then(_=> {
+        that.requestOptionAll("recommen/confirpushAll");
+      }).catch(_=>{})
     },
     // 健康推荐取消全部
     onClickIgnoreAll() {
-      // this.requestOptionAll("recommen/ignorepushAll");
+      let that = this;
+      that.$confirm('确认全部取消?').then(_=> {
+        that.requestOptionAll("recommen/ignorepushAll");
+      }).catch(_=>{})
     },
     // 健康报告推荐
     requestRecommen(url) {
@@ -379,6 +388,11 @@ export default {
           p {
             margin: 0;
             line-height: 2;
+            overflow:hidden; 
+            text-overflow:ellipsis;
+            display:-webkit-box; 
+            -webkit-box-orient:vertical;
+            -webkit-line-clamp:2; 
           }
 
           .actions {

+ 6 - 1
src/views/HealthControl/HealthTab2.vue

@@ -34,7 +34,7 @@
             <div class="info">
               <p>推荐理由:{{ item.reason }}</p>
               <p>推荐检修时间:{{ new Date(item.recodedate).formatDate("yyyy-MM-dd hh:mm:ss") }}</p>
-              <p>推荐时间对应风速:{{ item.speed }}</p>
+              <p>推荐时间对应风速:{{ item.speed }} m/s</p>
               <p>判断时间:{{ new Date(item.createdate).formatDate("yyyy-MM-dd hh:mm:ss")}}</p>
             </div>
           </div>
@@ -254,6 +254,11 @@ export default {
           p {
             margin: 0;
             line-height: 2;
+            overflow:hidden; 
+            text-overflow:ellipsis;
+            display:-webkit-box; 
+            -webkit-box-orient:vertical;
+            -webkit-line-clamp:2; 
           }
 
           .actions {

+ 2 - 2
src/views/HealthControl/healthLineChart2.vue

@@ -52,8 +52,8 @@ export default {
       tableData: {
         column: [
           { name: "部件名称",field: "name" },
-          { name: "MTBF",field: "v1", is_num: true },
-          { name: "MTTR",field: "v2", is_num: true },
+          { name: "MTBF(h)",field: "v1", is_num: true },
+          { name: "MTTR(h)",field: "v2", is_num: true },
           { name: "损失电量(kw/h)",field: "v3",is_num: true },
           { name: "当前状态",field: "v4",
             template: function(data) {

+ 103 - 0
src/views/Login/Login.vue

@@ -0,0 +1,103 @@
+<template>
+  <div class="login-container">
+    <div class="login-box">
+      <!-- 登录表单区域 -->
+      <div class="login-form">
+        <!-- 用户名 -->
+        <div class="login-item">
+          <el-input v-model="username" placeholder="用户名"></el-input>
+        </div>
+        <!-- 密码 -->
+        <div class="login-item">
+          <el-input
+            v-model="password"
+            placeholder="密码"
+            show-password
+          ></el-input>
+        </div>
+        <!-- 登录按钮 -->
+        <div class="login-item">
+          <el-button class="mt" type="primary" @click="onClickLogin"
+            >登录</el-button
+          >
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import tool from '@tools/basicTool.js';
+
+export default {
+  data() {
+    return {
+      username: "admin",
+      password: "admin",
+    };
+  },
+
+  created() {},
+
+  methods: {
+    //登录按钮
+    onClickLogin() {
+      this.requestLogin();
+    },
+    requestLogin() {
+      let that = this;
+      that.API.requestData({
+        method: "POST", // 请求方式,默认为 GET ,可缺省
+        subUrl: "admin/loginvue", // 请求接口地址,必传项
+        data: {
+          username: that.username,
+          password: that.password,
+        },
+        success(res) {
+          if (res.code == 200) {
+            localStorage.setItem("authToken", res.data.authToken);
+            localStorage.setItem("username", res.data.user.laborName);
+            that.BASE.showMsg({
+              msg: "登录成功",
+              type: "success",
+            });
+            that.$store.commit('setToken', res.data.authToken)
+            that.$router.replace("/"); // 跳转到首页
+            tool.requestFullscreen()
+          } else {
+            that.BASE.showMsg({
+              msg: "用户名或密码错误",
+              type: "success",
+            });
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+<style scoped>
+.login-container {
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.login-box {
+  width: 300px;
+  height: 350px;
+  background-color: #122c1dea;
+  border-radius: 5px;
+}
+.login-form {
+  padding: 50px 40px;
+}
+.login-item {
+  margin-top: 20px;
+}
+.el-button {
+  width: 100%;
+}
+.mt {
+  margin-top: 40px;
+}
+</style>