likang 1 年之前
父節點
當前提交
e51a97ea18

+ 6 - 0
build/webpack.dev.conf.js

@@ -9,6 +9,8 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
 const HtmlWebpackPlugin = require('html-webpack-plugin')
 const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
 const portfinder = require('portfinder')
+var https = require('https');
+var fs = require('fs');
 
 
 
@@ -43,6 +45,10 @@ const devWebpackConfig = merge(baseWebpackConfig, {
     publicPath: config.dev.assetsPublicPath,
     proxy: config.dev.proxyTable,
     quiet: true, // necessary for FriendlyErrorsPlugin
+    // https: {
+    //   key: fs.readFileSync(path.join(__dirname, './cert/privatekey.pem')),
+    //   cert: fs.readFileSync(path.join(__dirname, './cert/certificate.pem'))
+    // },
 
 
 

+ 11 - 7
index.html

@@ -1,22 +1,26 @@
 <!DOCTYPE html>
 <html>
-  <head>
+
+<head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0">
+   
     <title>工具演示</title>
     <!-- <title>一见可得</title> -->
     <script src="//unpkg.com/vue-ydui/dist/ydui.flexible.js"></script>
-    <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=1918aa020d272557f3c3e0537a824326"></script> 
+    <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=1918aa020d272557f3c3e0537a824326"></script>
     <script src="https://webapi.amap.com/ui/1.1/main.js"></script>
     <script src="https://unpkg.com/vconsole/dist/vconsole.min.js"></script>
-    
+
     <link rel="icon" href="https://g.csdnimg.cn/static/logo/favicon32.ico">
     <style>
 
     </style>
-  </head>
-  <body data-weui-theme="light" style="height: auto;">
+</head>
+
+<body data-weui-theme="light" style="height: auto;">
     <div id="app"></div>
     <!-- built files will be auto injected -->
-  </body>
-</html>
+</body>
+
+</html>

+ 2 - 2
src/global.js

@@ -1,8 +1,8 @@
 
 // const BASE_URL = 'https://wxt.rltest.cn/?s=smart_wx_api';
 // const BASE_URL = '//api.card.jskedejiaoyu.com/?s=smart_wx_api';
-const BASE_URL = 'http://127.0.0.1:80/wx';
-
+//const BASE_URL = 'http://47.114.185.186:8118/wx';
+const BASE_URL = 'http:///192.168.1.105:80/wx';
  export default{
     BASE_URL
  }

+ 9 - 10
src/main.js

@@ -54,13 +54,13 @@ router.beforeEach((to,from,next)=>{
   // console.log('to.....',to);
 
   
-  //车牌扫码校验临时
-  if(to.name == 'vehicle' || to.name == 'vehicledecode'){
-    console.log('ddddddddddddddddd')
+  // //车牌扫码校验临时
+  // if(to.name == 'vehicle' || to.name == 'vehicledecode'){
+  //   console.log('ddddddddddddddddd')
     
-    next()
-    return
-  }
+  //   next()
+  //   return
+  // }
 
 
 
@@ -71,7 +71,6 @@ router.beforeEach((to,from,next)=>{
   }
   
   let openid = localStorage.getItem("openid");
-   openid = '12222111';
   let loginFlag = false; // 登录标记
   
   // 运营商,本地保存 yys_userid
@@ -79,7 +78,7 @@ router.beforeEach((to,from,next)=>{
     let yysUserid = localStorage.getItem('yysUserid');
     loginFlag = (openid && yysUserid);
 
-    if (to.name === 'yys_login') {
+    if (to.name === 'yys_login'||to.name === 'yys_reset_pwd') {
       next();
     } else {
       if (loginFlag) {
@@ -102,12 +101,12 @@ router.beforeEach((to,from,next)=>{
       if (userType) {
         next();
       } else {
-        next('/');
+        next('/yys');
       }
 
     } else {
       if (!loginFlag) {
-        next('/first');
+        next('/yys');
       } else {
 
         // Vue.prototype.$http.get("/checkSingleLogin&openid=" + openid + '&userid=' + userid).then(res => {

+ 91 - 21
src/pages/kede/yys/alarms/add.vue

@@ -1,15 +1,16 @@
 <template>
     <div class="app-container">
-        <van-nav-bar title="新增计划" left-text="返回" left-arrow @click-left="$router.go(-1)" />
+        <van-nav-bar title="新增任务" left-text="返回" left-arrow @click-left="$router.go(-1)" />
 
         <van-form @submit="onSubmit">
             <van-field 
                 v-model="formData.plan_number"
                 name="plan_number"
-                label="计划编号"
-                placeholder="请输入计划编号"
+                label="任务编号"
+                placeholder="请输入任务编号"
                 clearable
                 required
+                :rules="rules.plan_number"
                 disabled
             />
               <van-field
@@ -20,15 +21,19 @@
                 clearable
                 required
                 disabled
+                :rules="rules.wind_name"
+                
             />
 
             <van-field
                 v-model="formData.plan_name"
                 name="plan_name"
-                label="计划名称"
-                placeholder="请输入计划名称"
+                label="任务名称"
+                placeholder="请输入任务名称"
                 clearable
+                maxlength="10"
                 required
+                :rules="rules.plan_name"
             />
              <van-field
                 v-model="formData.fan_model"
@@ -37,7 +42,10 @@
                 placeholder="请选择部件类型"
                 clearable
                 required
+                :rules="rules.fan_model"
                 @click="showFanModel = true"
+                readonly
+               
             />
             <van-popup v-model="showFanModel" position="bottom">
                 <van-picker
@@ -57,9 +65,12 @@
                 name="parts_sign"
                 label="部件类型"
                 placeholder="请选择部件类型"
+                 :rules="rules.parts_sign"
                 clearable
                 required
                 @click="showPart = true"
+                readonly
+               
             />
              <van-popup v-model="showPart" position="bottom">
                 <van-picker
@@ -73,17 +84,17 @@
             </van-popup>
 
 
-
-
-
              <van-field
                 v-model="formData.work_sign"
                 name="work_sign"
                 label="工作位置"
                 placeholder="请选择工作位置"
+                :rules="rules.work_sign"
                 clearable
                 required
                 @click="showWorkPage"
+                readonly
+               
             />
              <van-popup v-model="showWork" position="bottom">
                 <van-picker
@@ -101,9 +112,12 @@
                 name="boit_type_sign"
                 label="螺栓型号"
                 placeholder="请输入螺栓型号"
+                :rules="rules.boit_type_sign"
                 required
                 clearable
                 @click="showType= true"
+                readonly
+              
             />
             <van-popup v-model="showType" position="bottom">
                 <van-picker
@@ -113,6 +127,7 @@
                     :columns="Type"
                     @confirm="onTypeConfirm"
                     @cancel="showType= false"
+                    
                 />
             </van-popup>
 
@@ -122,8 +137,11 @@
                 label="紧固模式"
                 placeholder="请选择紧固模式"
                 clearable
+                :rules="rules.boit_type_sign"
                 required
                 @click="showTightenMode= true"
+                readonly
+               
             />
             <van-popup v-model="showTightenMode" position="bottom">
                 <van-picker
@@ -144,6 +162,7 @@
                 placeholder="请输入螺栓总数"
                 clearable
                 required
+                 :rules="rules.bolt_num"
                 type="digit"
             />
            
@@ -155,6 +174,7 @@
                 placeholder="请输入偏移紧固数值"
                 clearable
                 required
+                :rules="rules.bias"
                 type="number"
             />
             <van-field
@@ -165,11 +185,12 @@
                 clearable
                 required
                 type="number"
+                 :rules="rules.torque"
             />
           
             <van-field name="status" label="启用状态">
                 <template #input>
-                    <van-switch v-model="formData.status" size="20" active-value=1 inactive-value=-1 inactive-color="#dcdee0" />
+                    <van-switch v-model="formData.status" size="20" active-value='1' inactive-value='-1' inactive-color="#dcdee0" />
                 </template>
             </van-field>
             <van-field
@@ -178,6 +199,7 @@
                 label="备注"
                 placeholder="请输入备注"
                 clearable
+                maxlength="20"
             />
 
         
@@ -222,7 +244,7 @@ export default {
                 bias: '',
                 tighten_mode: '',
                 torque: '',
-                status: 1,
+                status: '1',
                 info:'',
             },
             imei: '',
@@ -230,7 +252,9 @@ export default {
             user_no: '',
             userType: '',
             deviceType: '',
-
+            //是否选中
+            is_status: true,
+            
             fanModel: [],
             showFanModel: false,
             fanModelObj: '',
@@ -250,10 +274,55 @@ export default {
 
             TightenMode:[],
             showTightenMode:false,
-            TightenModeObj:'',
+            TightenModeObj: '',
+            
+            wind_id: '',
+            rules: {
+                plan_number: [
+                    { required: true, message: '任务编号不能为空' }
+                ],
+                wind_name: [
+                    { required: true, message: '风场名称不能为空' }
+                ],
+
+                plan_name: [
+                    { required: true, message: '任务名称不能为空' },
+                   
+                ],
+                fan_model: [
+                    { required: true, message: '风机型号不能为空' }
+                ],
+                parts_sign: [
+                    { required: true, message: '部件不能为空' }
+                ],
+
+                work_sign: [
+                    { required: true, message: '工作位置不能为空' },
+
+                ],
+                boit_type_sign: [
+                    { required: true, message: '螺栓型号不能为空' }
+                ],
+                bolt_num: [
+                    { required: true, message: '螺栓总数不能为空' }
+                ],
+
+                bias: [
+                    { required: true, message: '偏移紧固数值不能为空' },
+
+                ],
+                tighten_mode:
+                    [
+                        { required: true, message: '紧固模式不能为空' },
+
+                    ],
+                torque: [
+                    { required: true, message: '扭矩不能为空' },
+
+                ],
 
-          
-            wind_id:'',
+              
+            },
            
         }
     },
@@ -275,9 +344,9 @@ export default {
                 plan_name:this.formData.plan_name,
                 wind_id:this.$route.query.wind_id,
                 fan_model:this.fanModelObj.id,
-                parts_sign:this.PartObj.id,
-                work_sign:this.WorkObj.id,
-                boit_type_sign:this.TypeObj.id,
+                parts_sign:this.PartObj.value,
+                work_sign:this.WorkObj.value,
+                boit_type_sign:this.TypeObj.value,
                 bolt_num:this.formData.bolt_num,
                 bias: this.formData.bias,
                 tighten_mode:this.TightenModeObj.id,
@@ -287,15 +356,17 @@ export default {
             }
             this.$http.post('savePlan?userid=' + this.userid + '&openid=' + this.openid, JSON.stringify(postData))
                 .then(resp => {
+
                     if (resp.data.code!=10000) {
                         this.$notify(resp.data.message || '保存失败');
                         return;
                     }
                     this.$notify({
                         type: 'success',
-                        message: resp.data.message || '保存成功',
+                        message: '保存成功',
                     })
-                    刷新列表
+                   
+                    //刷新列表
                    this.$router.replace('yys_alarms');
                 })
         },
@@ -358,7 +429,7 @@ export default {
         getWork() {
            
             let query =
-                { type: 2,fan_model:this.fanModelObj.id,part:this.PartObj.id };
+                { type: 2,fan_model:this.fanModelObj.id,part:this.PartObj.value };
 
             this.$http.post("getParts?openid=" + this.openid, JSON.stringify(query)).then((resp) => {
                 if (resp.data.code != 10000) {
@@ -421,7 +492,6 @@ export default {
             this.formData.work_sign = value.name;
             this.showWork = false;
            
-
         },
         showWorkPage()
         {

+ 68 - 12
src/pages/kede/yys/alarms/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <van-nav-bar title="计划列表" />
+    <van-nav-bar title="任务列表" />
     <van-field
           v-model="fieldValue.name"
           is-link
@@ -15,7 +15,7 @@
       <van-search
         v-model="keywords"
         show-action
-        placeholder="请输入工作计划关键词搜索"
+        placeholder="请输入工作任务关键词搜索"
         @search="onSearch"
       >
         <template #action>
@@ -46,7 +46,14 @@
             is-link>
             <template #title>
               <span class="custom-title">{{item.plan_name}}</span>
+              <van-tag v-if="item.status > 0" type="success">启用中</van-tag>
+              <van-tag v-else type="danger">未启用</van-tag>
             </template>
+             <template #default>
+              <van-button  type="danger" size="small" @click.stop="delPlan(item.id)">删除</van-button>
+            </template>
+
+          
           </van-cell>
         </van-list>
       </template>
@@ -74,7 +81,7 @@
 
         <van-picker
           show-toolbar
-          title="请选择所在地区"
+          title="请选择所在风场"
           value-key="name"
           :columns="columns"
           @cancel="show = false"
@@ -89,7 +96,7 @@
 
 <script type="text/babel">
 import Vue from 'vue';
-import { ActionSheet, Field, Popup, Picker, Notify, NavBar, PullRefresh, Tag, Icon, Dialog, Empty, List, CellGroup, Cell, Search, Sticky } from 'vant';
+import { Button, ActionSheet, Field, Popup, Picker, Notify, NavBar, PullRefresh, Tag, Icon, Dialog, Empty, List, CellGroup, Cell, Search, Sticky } from 'vant';
 
 Vue.use(ActionSheet);
 Vue.use(NavBar);
@@ -107,6 +114,7 @@ Vue.use(Sticky);
 Vue.use(Picker);
 Vue.use(Popup);
 Vue.use(Field);
+Vue.use(Button);
 
 export default {
   data() {
@@ -131,6 +139,7 @@ export default {
       show: false,
       fieldValue: '',
       cascaderValue: '',
+      location:'',
       //风场列表
       windKeyWord:'',
       columns: [],
@@ -149,14 +158,55 @@ export default {
     this.userid = localStorage.getItem("yysUserid");
     this.openid = localStorage.getItem("openid");
     let res = localStorage.getItem("wind");
+    let local = localStorage.getItem("position");
+    
     console.log(res);
-    if(res)
+    if (res != 'undefined' && res!=null)
     { 
       this.fieldValue =  JSON.parse(res);
     }
-    this.onRefresh();
+    if (local != 'undefined' && local != null) {
+      this.location = JSON.parse(local);
+    }
+    
+  },
+  mounted()
+  {
+    let that = this;
+    that.onRefresh();
   },
   methods: {
+
+    //删除风场
+    delPlan(id)
+    {
+
+      Dialog.confirm({
+        message: '是否删除该任务',
+      })
+        .then(() => {
+          let query =
+            { id: id };
+
+          this.$http.post("deletePlan?openid=" + this.openid, JSON.stringify(query)).then((resp) => {
+            if (resp.data.code != 10000) {
+              this.$notify(resp.data.message)
+              return;
+            }
+            this.$notify({
+              type: 'success',
+              message: '删除成功',
+            })
+            this.onRefresh();
+          });
+          // on confirm
+        })
+        .catch(() => {
+          // on cancel
+        });
+      
+   
+    },
     /**
      * 获取设备列表
      */
@@ -167,6 +217,12 @@ export default {
         page: this.page,
         limit: this.limit,
         imei: this.keywords,
+        wind_id: this.fieldValue.id
+      }
+      if (this.location)
+      {
+        params.lat = this.location.lat;
+        params.lng = this.location.lng;
       }
      
       this.$http.post("getPlanList?userid=" + this.userid + '&openid=' + this.openid, JSON.stringify(params)).then(resp => {
@@ -200,8 +256,8 @@ export default {
     onConfirm(value) {
 
       this.fieldValue = value;
-
-      localStorage.setItem("wind",JSON.stringify(value));
+      localStorage.setItem("wind", JSON.stringify(value));
+      this.onRefresh();
       this.show = false;
     },
     //获取风场列表
@@ -226,22 +282,22 @@ export default {
     },
     
     /**
-     * 显示详情
+     * 更新
      */
     showDetail(id) {
 
       let query = {
         id: id,
-        windInfo: this.fieldValue
       }
-      this.$router.push({ path: "/yys_alarm_detail", query: query });
+      this.$router.push({ path: "/yys_update_plan", query: query });
     },
     /**
      * 跳转绑定设备页面
      */
     goPage(name){
       if (!this.fieldValue) {
-        this.$notify({ type: "danger", message: "请选择风场" });
+       
+        this.show = true;
         return;
       }
       let query = { wind_id: this.fieldValue.id,wind_name: this.fieldValue.name };

+ 641 - 0
src/pages/kede/yys/alarms/update.vue

@@ -0,0 +1,641 @@
+<template>
+    <div class="app-container">
+        <van-nav-bar title="更新任务" left-text="返回" left-arrow @click-left="$router.go(-1)" />
+
+        <van-form @submit="onSubmit">
+            <van-field 
+                v-model="formData.plan_number"
+                name="plan_number"
+                label="任务编号"
+                placeholder="请输入任务编号"
+                clearable
+                required
+                :rules="rules.plan_number"
+                disabled
+            />
+              <van-field
+                v-model="formData.wind_name"
+                name="wind_name"
+                label="风场名称"
+                placeholder="请输入风场名称"
+                clearable
+                required
+                disabled
+                :rules="rules.wind_name"
+                
+            />
+
+            <van-field
+                v-model="formData.plan_name"
+                name="plan_name"
+                label="任务名称"
+                placeholder="请输入任务名称"
+                clearable
+                maxlength="10"
+                required
+                :rules="rules.plan_name"
+            />
+             <van-field
+                v-model="formData.fan_model"
+                name="fan_model"
+                label="风机型号"
+                placeholder="请选择部件类型"
+                clearable
+                required
+                :rules="rules.fan_model"
+                @click="showFanModel = true"
+                 readonly
+            />
+            <van-popup v-model="showFanModel" position="bottom">
+                <van-picker
+                   
+                    value-key="name"
+                    show-toolbar
+                    :columns="fanModel"
+                    @confirm="onFanModelConfirm"
+                    @cancel="showFanModel = false"
+                />
+            </van-popup>
+           
+           
+     
+            <van-field
+                v-model="formData.parts_sign"
+                name="parts_sign"
+                label="部件类型"
+                placeholder="请选择部件类型"
+                 :rules="rules.parts_sign"
+                clearable
+                required
+                @click="showPart = true"
+                 readonly
+            />
+             <van-popup v-model="showPart" position="bottom">
+                <van-picker
+                    value-key="name"
+                    name="parts_sign"
+                    show-toolbar
+                    :columns="Part"
+                    @confirm="onPartConfirm"
+                    @cancel="showPart = false"
+                />
+            </van-popup>
+
+
+
+
+
+             <van-field
+                v-model="formData.work_sign"
+                name="work_sign"
+                label="工作位置"
+                placeholder="请选择工作位置"
+                :rules="rules.work_sign"
+                clearable
+                required
+                @click="showWorkPage"
+                 readonly
+            />
+             <van-popup v-model="showWork" position="bottom">
+                <van-picker
+                    value-key="name"
+                    name="work_sign"
+                    show-toolbar
+                    :columns="Work"
+                    @confirm="onWorkConfirm"
+                    @cancel="showWork = false"
+                />
+            </van-popup>
+
+            <van-field
+                v-model="formData.boit_type_sign"
+                name="boit_type_sign"
+                label="螺栓型号"
+                placeholder="请输入螺栓型号"
+                :rules="rules.boit_type_sign"
+                required
+                clearable
+                @click="showType= true"
+                 readonly
+            />
+            <van-popup v-model="showType" position="bottom">
+                <van-picker
+                    value-key="name"
+                    name="work_sign"
+                    show-toolbar
+                    :columns="Type"
+                    @confirm="onTypeConfirm"
+                    @cancel="showType= false"
+                />
+            </van-popup>
+
+            <van-field
+                v-model="formData.tighten_mode"
+                name="tighten_mode"
+                label="紧固模式"
+                placeholder="请选择紧固模式"
+                clearable
+                :rules="rules.boit_type_sign"
+                required
+                @click="showTightenMode= true"
+                 readonly
+            />
+            <van-popup v-model="showTightenMode" position="bottom">
+                <van-picker
+                    value-key="name"
+                    name="work_sign"
+                    show-toolbar
+                    :columns="TightenMode"
+                    @confirm="onTightenModeConfirm"
+                    @cancel="showTightenMode= false"
+                />
+            </van-popup>
+
+
+            <van-field
+                v-model="formData.bolt_num"
+                name="bolt_num"
+                label="螺栓总数"
+                placeholder="请输入螺栓总数"
+                clearable
+                required
+                 :rules="rules.bolt_num"
+                type="digit"
+            />
+           
+            
+            <van-field
+                v-model="formData.bias"
+                name="bias"
+                label="偏移紧固数值"
+                placeholder="请输入偏移紧固数值"
+                clearable
+                required
+                :rules="rules.bias"
+                type="number"
+            />
+            <van-field
+                v-model="formData.torque"
+                name="torque"
+                label="扭矩"
+                placeholder="请输入扭矩"
+                clearable
+                required
+                type="number"
+                 :rules="rules.torque"
+            />
+          
+            <van-field name="status" label="启用状态">
+                <template #input>
+                    <van-switch v-model="formData.status" size="20" active-value='1' inactive-value='-1' inactive-color="#dcdee0" />
+                </template>
+            </van-field>
+            <van-field
+                v-model="formData.info"
+                name="info"
+                label="备注"
+                placeholder="请输入备注"
+                clearable
+                maxlength="20"
+            />
+        
+            <div style="margin: 6px;">
+                <van-button round block type="info" size="small" native-type="submit">修改</van-button>
+            </div>
+
+        </van-form>
+    </div>
+</template>
+
+<script>
+import Vue from 'vue';
+import wx from 'weixin-js-sdk'
+import { Form, Field, Icon, NavBar, Dialog, Button, Popup, Picker, Switch } from 'vant';
+
+Vue.use(Form);
+Vue.use(Field);
+Vue.use(Icon);
+Vue.use(NavBar);
+Vue.use(Dialog);
+Vue.use(Button);
+Vue.use(Popup);
+Vue.use(Picker);
+Vue.use(Switch);
+
+export default {
+    data() {
+        return {
+            userid: '',
+            openid: '',
+            
+
+            formData: {
+                id:"",
+                plan_number: '',
+                plan_name: '',
+                wind_name: '',
+                fan_model: '',
+                parts_sign: '',
+                work_sign: '',
+                boit_type_sign: '',
+                bolt_num: '',
+                bias: '',
+                tighten_mode: '',
+                torque: '',
+                status: 1,
+                info: '',
+            },
+            imei: '',
+            username: '',
+            user_no: '',
+            userType: '',
+            deviceType: '',
+
+            fanModel: [],
+            showFanModel: false,
+            fanModelObj: '',
+            //部件
+            Part: [],
+            showPart: false,
+            PartObj: '',
+            //工作位置
+            Work: [],
+            showWork: false,
+            WorkObj: '',
+
+            //获取型号
+            Type: [],
+            showType: false,
+            TypeObj: '',
+
+
+            TightenMode: [],
+            showTightenMode: false,
+            TightenModeObj: '',
+            rules: {
+                plan_number: [
+                    { required: true, message: '任务编号不能为空' }
+                ],
+                wind_name: [
+                    { required: true, message: '风场名称不能为空' }
+                ],
+
+                plan_name: [
+                    { required: true, message: '任务名称不能为空' },
+
+                ],
+                fan_model: [
+                    { required: true, message: '风机型号不能为空' }
+                ],
+                parts_sign: [
+                    { required: true, message: '部件不能为空' }
+                ],
+
+                work_sign: [
+                    { required: true, message: '工作位置不能为空' },
+
+                ],
+                boit_type_sign: [
+                    { required: true, message: '螺栓型号不能为空' }
+                ],
+                bolt_num: [
+                    { required: true, message: '螺栓总数不能为空' }
+                ],
+
+                bias: [
+                    { required: true, message: '偏移紧固数值不能为空' },
+
+                ],
+                tighten_mode:
+                    [
+                        { required: true, message: '紧固模式不能为空' },
+
+                    ],
+                torque: [
+                    { required: true, message: '扭矩不能为空' },
+
+                ],
+
+
+            },
+
+
+            wind_id: '',
+
+        }
+    },
+    created() {
+        this.userType = localStorage.getItem('userType');
+        this.deviceType = localStorage.getItem('deviceType');
+        this.userid = localStorage.getItem('userid');
+        this.openid = localStorage.getItem('openid');
+        this.initdata();
+
+    },
+    methods: {
+        //获取任务详情
+        getplan()
+        {
+            let params = { id: this.$route.query.id };
+            this.$http.post("getPlanById?openid=" + this.openid, JSON.stringify(params)).then((resp) => {
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                let obj = resp.data.data;
+                this.formData = obj;
+                let statusObj = { id: 0, name: '顺序紧固' };
+                let status = [
+                    { id: 0, name: '顺序紧固' },
+                    { id: 1, name: '对角紧固' },
+                    { id: 2, name: '偏移紧固 ' }
+                ];
+                status.forEach(function (element) {
+                    if (obj.tighten_mode == element.id)
+                        statusObj = element;
+                });
+                    
+                this.formData = {
+                    id: obj.id,
+                    plan_number: obj.plan_number,
+                    plan_name: obj.plan_name,
+                    wind_name: obj.wind_name,
+                    fan_model: obj.fan_model.name,
+                    parts_sign: obj.parts_sign.name,
+                    work_sign: obj.work_sign.name,
+                    boit_type_sign: obj.boit_type_sign.name,
+                    bolt_num: obj.bolt_num,
+                    bias: obj.bias,
+                    tighten_mode: statusObj.name,
+                    torque: obj.torque,
+                    status: obj.status.toString(),
+                    info: obj.info,
+                };
+                this.TypeObj = obj.boit_type_sign;
+                this.fanModelObj = obj.fan_model;
+                this.PartObj = obj.parts_sign;
+                this.WorkObj = obj.work_sign;
+
+                this.wind_id = obj.wind_id;
+                this.getWindModel();
+                this.getPart();
+                this.getType();
+                this.getTightenMode();
+                this.getWork();
+            });
+
+
+        },
+        /**
+         * 提交
+         */
+        onSubmit(values) {
+            let postData = {
+                id: this.formData.id,
+                plan_number: this.formData.plan_number,
+                plan_name: this.formData.plan_name,
+                wind_id: this.$route.query.wind_id,
+                fan_model: this.fanModelObj.id,
+                parts_sign: this.PartObj.value,
+                work_sign: this.WorkObj.value,
+                boit_type_sign: this.TypeObj.value,
+                bolt_num: this.formData.bolt_num,
+                bias: this.formData.bias,
+                tighten_mode: this.TightenModeObj.id,
+                torque: this.formData.torque,
+                status: this.formData.status,
+                info: this.formData.info,
+            }
+            this.$http.post('updatePlan?userid=' + this.userid + '&openid=' + this.openid, JSON.stringify(postData))
+                .then(resp => {
+
+                    if (resp.data.code != 10000) {
+                        this.$notify(resp.data.message || '保存失败');
+                        return;
+                    }
+                    this.$notify({
+                        type: 'success',
+                        message: '保存成功',
+                    })
+
+                    //刷新列表
+                   // this.$router.back();
+                   this.$router.replace('yys_alarms');
+                })
+        },
+
+        getSingleNumber() {
+
+            this.$http.get("createPlanId?userid=" + this.userid + '&openid=' + this.openid).then((resp) => {
+
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                this.formData.plan_number = resp.data.data;
+            });
+
+        },
+        //获取风机型号
+        getWindModel() {
+            this.$http.get("getFanModelbyWindId?wind_id=" + this.wind_id + '&openid=' + this.openid).then((resp) => {
+
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                this.fanModel = resp.data.data;
+
+            });
+
+
+        },
+        //提交风场型号
+        onPartConfirm(value) {
+            this.PartObj = value;
+            this.formData.parts_sign = value.name;
+            this.getWork();
+            this.showPart = false;
+
+        },
+
+
+
+        //提交上传部件
+        getPart() {
+            let query =
+                { type: 1 };
+
+            this.$http.post("getParts?openid=" + this.openid, JSON.stringify(query)).then((resp) => {
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                this.Part = resp.data.data;
+
+            });
+
+        },
+        //获取工作
+        getWork() {
+
+            let query =
+                { type: 2, fan_model: this.fanModelObj.id, part: this.PartObj.value };
+
+            this.$http.post("getParts?openid=" + this.openid, JSON.stringify(query)).then((resp) => {
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                this.Work = resp.data.data;
+
+            });
+
+        },
+        //获取螺栓型号
+        getType() {
+            let query = { type: 4 };
+            this.$http.post("getParts?openid=" + this.openid, JSON.stringify(query)).then((resp) => {
+                if (resp.data.code != 10000) {
+                    this.$notify(resp.data.message)
+                    return;
+                }
+                this.Type = resp.data.data;
+
+            });
+
+        },
+        getTightenMode() {
+            let data = [
+                { id: 0, name: '顺序紧固' },
+                { id: 1, name: '对角紧固' },
+                { id: 2, name: '偏移紧固 ' }
+
+            ];
+
+            this.TightenMode = data;
+
+        },
+
+        //提交
+        onTightenModeConfirm(value) {
+            this.TightenModeObj = value;
+            this.formData.tighten_mode = value.name;
+            this.showTightenMode = false;
+
+        },
+        //确认螺栓型号
+        onTypeConfirm(value) {
+            this.TypeObj = value;
+            this.formData.boit_type_sign = value.name;
+            this.showType = false;
+
+
+        },
+        //确认工作位置
+        onWorkConfirm(value) {
+            this.WorkObj = value;
+            this.formData.work_sign = value.name;
+            this.showWork = false;
+
+
+        },
+        showWorkPage() {
+            this.showWork = true
+        },
+
+        //提交风场型号
+        onFanModelConfirm(value) {
+            this.formData.fan_model = value.name;
+            this.fanModelObj = value;
+            this.showFanModel = false;
+            this.getWork();
+        },
+
+
+
+        //初始化数据
+        initdata() {
+            this.getplan();
+           // this.getSingleNumber();
+          //  this.formData.wind_name = this.$route.query.wind_name;
+        //this.wind_id = this.$route.query.wind_id;
+        },
+        
+
+
+
+
+        /**
+         * 扫码
+         */
+        scanCode() {
+            let that = this;
+            let url = encodeURIComponent(location.href.split('#')[0]);
+            // ios 设备只认从公众号菜单首次进入页面的URL
+            if (localStorage.getItem('userAgent') == 'ios') {
+                let mainUrl = localStorage.getItem('mainUrl');
+                url = encodeURIComponent(mainUrl);
+            }
+
+            this.$http.get("/getSignaturEtc", { params: { url: url } })
+                .then(res => {
+                    if (!res.data.success) {
+                        this.$notify(res.data.message);
+                        return;
+                    }
+
+                    let data = res.data.data;
+                    // console.log('resp data',data)
+                    wx.config({
+                        // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                        debug: false,
+                        // 必填,公众号的唯一标识
+                        appId: data.appId,
+                        // 必填,生成签名的时间戳
+                        timestamp: data.timeStamp,
+                        // 必填,生成签名的随机串
+                        nonceStr: data.nonceStr,
+                        // 必填,签名
+                        signature: data.signature,
+                        // 必填,需要使用的JS接口列表,所有JS接口列表
+                        jsApiList: ['scanQRCode']
+                    });
+
+                    wx.error(function (res) {
+                        console.log("出错了:" + res.errMsg);//这个地方的好处就是wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
+                    });
+
+                })
+                .catch(res => {
+                    console.log(res);
+                });
+
+
+            // 成功时
+            wx.ready(function () {
+
+                wx.scanQRCode({
+                    needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+                    scanType: ["qrCode"], // 可以指定扫二维码还是一维码,默认二者都有
+                    success: function (res) {
+                        var result = res.resultStr; // 当needResult 为 1 时,扫码返回的结果
+                        console.log("扫描结果:" + result);
+                        // window.location.href = result;//因为我这边是扫描后有个链接,然后跳转到该页面
+
+                        that.imei = result;
+                    },
+                    fail: function (e) {
+                        console.log('scan fail', e)
+                    }
+                });
+
+            });
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 68 - 11
src/pages/kede/yys/location.vue

@@ -2,27 +2,27 @@
     <div>
         <div id="route-map">
 
-            <span class="icon-base fence-showoff" :class="{buttonActive: showFence}" @click="toggleShowFence">
+            <!-- <span class="icon-base fence-showoff" :class="{buttonActive: showFence}" @click="toggleShowFence">
                 <yd-icon name="dianziweilan" size=".4rem"  custom></yd-icon>
-            </span>
+            </span> -->
 
             <span class="refresh-button" @click="refreshPosAndRoute">
                 <yd-icon  name="refresh" size="14px"></yd-icon>
             </span>
             
-            <div class="setting-button">
+            <!-- <div class="setting-button">
                 
                 <van-popover v-model="showSettings" trigger="click" placement="left">
                     <div style="padding: 6px;">
                         <van-checkbox v-model="isOnlyFenceDevice" @change="changeSetting('isOnlyFenceDevice',$event)" shape="square" icon-size="14">只显示选中围栏内设备</van-checkbox>
-                        <!-- <van-checkbox v-model="isClusterMarker" @change="changeSetting('isClusterMarker',$event)" shape="square" icon-size="14">聚合图标</van-checkbox> -->
+                       
                     </div>
 
                     <template #reference>
                         <van-icon size="18" name="setting" />
                     </template>
                 </van-popover>
-            </div>
+            </div> -->
         </div>
 
         <van-popup v-model="panelShow" round :overlay="false" position="bottom" 
@@ -30,13 +30,14 @@
          <div class="info-panel">
             <div class="panel-first-row">
                 <div style="font-size:14px;font-weight:550;color:gray">{{selectDevice.date_time}}({{selectDevice.awayTime}}前)</div>
-                <van-tag plain :type="selectDevice.alarm_state == 0 ? 'primary' : 'danger'">{{selectDevice.alarm_state == 0 ? '安全' : '告警'}}</van-tag>
+                <van-button plain type="primary" v-if="selectDevice.wrench_id!=0" size="small" @click="lookWrench" >最近使用扳手</van-button>
+                 <van-button plain type="warning" v-else size="small" >暂无使用扳手</van-button>
             </div>
 
             <div class="panel-second-row">
                 <div class="second-row-left">
                     <div class="row-left-layout">
-                        <span style="font-size: 10px;font-weight: 600;">{{selectDevice.loc_mode}}</span>
+                        <span style="font-size: 10px;font-weight: 600; word-break: break-all;">{{selectDevice.loc_mode}}</span>
                         <span style="color:darkgray">设备型号</span>
                     </div>
                     <div class="row-left-layout">
@@ -307,7 +308,7 @@ export default {
                        let geolocation = new AMap.Geolocation({
                             enableHighAccuracy: true,
                             // 设置定位超时时间,默认:无穷大
-                            timeout: 5000,
+                             timeout: 10000,
                             // 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
                             buttonOffset: new AMap.Pixel(10, 20),
                             //  定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
@@ -324,18 +325,24 @@ export default {
                         AMap.Event.addListener(geolocation, 'error', onError);
                         function onComplete(data) {
                             // data是具体的定位信息
-                            
+                            console.log("定位成功");
+                          
                             if (data.position) {
+                        
                                 that.saveLocationInfo(data.position);
                             } else {
+                               
                                 that.$notify({
                                     type: 'warning',
                                     message: '获取定位失败',
                                 });
+                                that.testLocationInfo();
                             }
                         }
                         function onError(data) {
-                          
+                            console.log("定位失败");
+                            console.log(data);
+                            that.testLocationInfo()
                             // 定位出错
                             that.$notify({
                                 type: 'warning',
@@ -377,7 +384,57 @@ export default {
         //保存个人定位信息
         saveLocationInfo(data)
         {
-            localStorage.setItem('position',data);
+            let da = {
+                lat:data.lat,
+                lng:data.lng
+            }
+            this.getNearWind(da);
+
+        },
+       testLocationInfo() {
+            let da = {
+                lat: 30.185909,
+                lng: 120.19397
+            }
+           this.getNearWind(da);
+            
+
+        },
+        /**
+         * @Descripttion: 获取附近风场
+         * @name: likang
+         * @return {*}
+         */        
+        getNearWind(da)
+        {
+
+            this.$http.post("getNearbyWind?userid=" + this.userid + '&openid=' + this.openid, JSON.stringify(da)).then((res) => {
+                if (res.data.code != 10000) {
+                    that.$toast(res.data.message || '获取附近风场位置失败');
+                    return;
+                }
+                console.log(res.data.data);
+                if (res.data.data)
+                {
+                    localStorage.setItem("wind", JSON.stringify(es.data.data));
+
+                }
+                
+            });
+
+
+        },
+
+
+        //查看最近使用的扳手
+        lookWrench()
+        {
+            console.log(this.selectDevice);
+            let query = {
+                id: this.selectDevice.wrench_id
+            }
+            this.$router.push({ path: "/yys_device_detail", query: query });
+
 
         },
         /**

+ 20 - 15
src/pages/kede/yys/login.vue

@@ -29,6 +29,12 @@
             <div style="margin: 26px;">
                 <van-button round block type="info" size="small" native-type="submit">登录</van-button>
             </div>
+            <div style="text-align:center;padding-top:15px;">
+                忘记密码?
+                <router-link to="/yys_reset_pwd">
+                    <span style="color:#2196f3;margin-left:5px">前往重置</span>
+                </router-link>
+            </div>
             
         </van-form>
     </div>
@@ -70,15 +76,15 @@ export default {
             let yysUserid = localStorage.getItem('yysUserid');
            
             let openid = this.getOpenid();
-            
-            if (!openid) {
-                Dialog.confirm({
-                    title: '提醒',
-                    message: '未授权,请关闭当前页面,重新进入并授权。',
-                    showCancelButton: false,
-                })
-                return;
-            }
+    
+            // if (!openid) {
+            //     Dialog.confirm({
+            //         title: '提醒',
+            //         message: '未授权,请关闭当前页面,重新进入并授权。',
+            //         showCancelButton: false,
+            //     })
+            //     return;
+            // }
 
             let postData = {
                 username: values.username,
@@ -120,11 +126,12 @@ export default {
                     if (!data.id) {
                         this.$notify('获取用户信息失败');
                         return;
-                    }
-
+                } 
+                    //使用手机号充当openid  
+                    localStorage.setItem('openid', data.phone);
                     localStorage.setItem('yysUserid', data.id);
                     localStorage.setItem('yysUserinfo', JSON.stringify(data));
-                    
+                   
                     this.$notify({ 
                         type: 'success',
                         message: resp.data.message || '登录成功',
@@ -146,9 +153,7 @@ export default {
             if (openid) {
                 return openid;
             }
-            
-           // openid = this.$route.query.openid || '';
-            openid = '2222222';
+             openid = this.$route.query.openid || '';
             if (openid) {
                 localStorage.setItem('openid', openid); 
             }

+ 3 - 2
src/pages/kede/yys/more.vue

@@ -119,8 +119,9 @@ export default {
          * 清除缓存
          */
         clearLocalStorage() {
-            localStorage.removeItem('yysUserid');
-            localStorage.removeItem('yysUserinfo');
+            localStorage.clear();
+            // localStorage.removeItem('yysUserid');
+            // localStorage.removeItem('yysUserinfo');
         },
         /**
          * 修改信息

+ 5 - 4
src/pages/kede/yys/profile.vue

@@ -18,11 +18,12 @@
           v-model="phone"
           name="phone"
           label="手机号码"
-          placeholder="请输入昵称"
+          placeholder="请输入手机号"
           maxlength="11"
           clearable
           required
           :rules="rules.phone"
+          disabled
       />
       <van-field
           v-model="oldPwd"
@@ -127,7 +128,7 @@ export default {
 
     let userinfo = JSON.parse(localStorage.getItem('yysUserinfo'));
     if (userinfo) {
-      this.nickName = userinfo.realname || '';
+      this.nickName = userinfo.username || '';
       this.phone = userinfo.phone || '';
     }
   },
@@ -136,9 +137,9 @@ export default {
      * 提交
      */
     onSubmit(values) {
-      this.$http.post('editYysProfile&userid=' + this.userid + '&openid=' + this.openid, JSON.stringify(values))
+      this.$http.post('editYysProfile?userid=' + this.userid + '&openid=' + this.openid, JSON.stringify(values))
           .then(resp => {
-            if (!resp.data.success) {
+            if (resp.data.code!=10000) {
               this.$notify(resp.data.message || '修改失败');
               return ;
             }

+ 326 - 0
src/pages/kede/yys/reset.vue

@@ -0,0 +1,326 @@
+<template>
+    <div class="app-container">
+        <div style="padding-top: 100px;"></div>
+        
+        <p id="loginTitle"> 重置密码 </p>
+
+        <van-form @submit="onSubmit"  @failed="onFailed">
+            <van-field
+                v-model="phone"
+                type="digit"
+                name="phone"
+                label="手机号"
+                placeholder="请输入手机号码"
+                maxlength="11"
+                :rules="rules.phone"
+                clearable
+                required
+            />
+            <van-field
+                v-model="email"
+                name="email"
+                label="邮箱"
+                placeholder="请输入邮箱"
+                :rules="rules.email"
+                clearable
+                required
+            />
+
+            
+            <van-field
+                v-model="smsCode"
+                type="digit"
+                name="smsCode"
+                label="验证码"
+                maxlength="8"
+                placeholder="请输入短信验证码"
+                center
+                clearable
+                required
+            >
+                <template #button>
+                    <van-button size="small" type="info" native-type="button" @click="beforeSendSms" :disabled="disableClick">
+                        <span style="display:inline-block;width: 76px;">{{smsText}}</span>
+                    </van-button>
+                </template>
+            </van-field>
+            
+            <van-field
+                v-model="password"
+                :type="showPwd ? 'text' : 'password'"
+                name="password"
+                label="新密码"
+                placeholder="请输入新密码"
+                :rules="rules.password"
+                clearable
+                required
+            >
+                <template #right-icon>
+                    <van-icon :name="showPwd ? 'eye-o' : 'closed-eye'" @click="showHidePwd" />
+                </template>
+            </van-field>
+
+            <van-field
+                v-model="confirmPassword"
+                :type="showConfirmPwd ? 'text' : 'password'"
+                name="confirmPassword"
+                label="确认密码"
+                placeholder="请再次输入新密码"
+                :rules="rules.confirmPassword"
+                clearable
+                required
+            >
+                <template #right-icon>
+                    <van-icon :name="showConfirmPwd ? 'eye-o' : 'closed-eye'" @click="showHideConfirmPwd" />
+                </template>
+            </van-field>
+
+            <!-- 图形验证码 -->
+            <!-- <div v-show="showCaptcha" ref="captcha" id="captcha"></div> -->
+
+            <div style="margin: 26px;">
+                <van-button round block type="info" size="small" native-type="submit">确认重置</van-button>
+            </div>
+            
+            <div style="text-align:center;">
+                <router-link to="yys">
+                    <span style="color:#2196f3;margin-left:5px">前往登录</span>
+                </router-link>
+            </div>
+        </van-form>
+    </div>
+</template>
+
+<script>
+
+import "../captcha/index.js";
+import Vue from 'vue';
+import { Icon,Form,Field,Dialog,Button } from 'vant';
+
+Vue.use(Icon);
+Vue.use(Form);
+Vue.use(Field);
+Vue.use(Dialog);
+Vue.use(Button);
+
+export default {
+    data() {
+        return {
+            show: false,
+            phone: '',
+            email:'',
+            password: '',
+            confirmPassword: '',            
+            rules: {
+                phone: [
+                    { required: true, message: "请输入手机号码" },
+                    { trigger: 'onBlur', pattern: /^1[3456789]\d{9}$/, message: "手机号码格式错误" },
+                ],
+                // email: [
+                //     { required: true, message: "请输入邮箱" },
+                //     { trigger: 'onBlur', pattern: "/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/" , message: "邮箱格式错误" },
+                // ],
+                password: [
+                    { required: true, message: '请输入新密码' },
+                    { trigger: 'onBlur', pattern: /^[-_a-zA-Z0-9]{6,16}$/, message: '密码应为6-16位,可输入字母、数字、下划线' },
+                ],
+                confirmPassword: [
+                    { required: true, message: '请再次输入新密码' },
+                    { trigger: 'onBlur', validator: val => {
+                        return this.password === this.confirmPassword;
+                    } , message: '两次密码不一致' },
+                ]
+            },
+            smsCode: '',
+            smsText: '发送验证码', // 每次发送成功后,倒计时 60s 才能点击
+            disableClick: false, // 禁止点击
+            intervalIndex: null,
+            interval: 60,
+            isFirstSend: true, // 第一次发送短信
+            // showCaptcha: false, // 显示图片验证
+            captchaSuccess: false, // 图片验证成功
+            showPwd: false, // 显示密码
+            showConfirmPwd: false, // 显示确认密码
+            isReset: 1, // 是否重置密码
+        }
+    },
+    mounted() {
+        // this.getCaptcha();
+    },
+    methods: {
+        /**
+         *  显示隐藏密码 
+         */
+        showHidePwd() {
+            this.showPwd = !this.showPwd;
+        },
+        /**
+         *  显示隐藏确认密码 
+         */
+        showHideConfirmPwd() {
+            this.showConfirmPwd = !this.showConfirmPwd;
+        },
+        /**
+         * 验证码
+         */
+       /*  getCaptcha() {
+            jigsaw.init({
+                el: this.$refs.captcha,
+                onSuccess: this.onSuccess,
+            });
+        }, */
+        /* onSuccess() {
+            // 后台登录认证
+            // this.showCaptcha = false;
+            // 发送验证码
+            this.sendSms();
+        }, */
+        /**
+         * 手机号码验证
+         */
+        phoneValidator() {
+            return /^1[3456789]\d{9}$/.test(this.phone);
+        },
+        /**
+         * 发送短信前
+         */
+        beforeSendSms() {
+            // 检测号码格式
+            let result = this.phoneValidator();
+            if (!result) {
+                this.$notify('请先输入正确的手机号码');
+                return false;
+            }
+
+            // 暂时每次都提醒,有图形验证码之后可以只在第一次提醒
+            this.isFirstSend = true;
+            // 第一次弹窗提醒
+            if (this.isFirstSend) {
+                // this.isFirstSend = false;
+                
+                Dialog.confirm({
+                    title: '确认这个邮箱',
+                    message: '我们将发送验证码到这个邮箱:'+ this.email,
+                })
+                .then((resp) => {
+                    if (resp === 'confirm') {
+                        // this.showCaptcha = true;
+                        this.sendSms();
+                    }
+                })
+                .catch((resp) => {
+                    console.log('cancel', resp);
+                });
+            } else {
+                // this.showCaptcha = true;
+                this.sendSms();
+            }
+
+        },
+        /**
+         * 发送验证码
+         */
+        sendSms() {
+            
+          
+            let postData = {
+                phone: this.phone,
+                email:this.email,
+            }
+            this.$http.post('sendSmsCode', JSON.stringify(postData)).then(resp => {
+               
+                this.$notify({
+                    type: resp.data.code==10000 ? 'success' : 'danger',
+                    message: resp.data.code==10000 ? '发送成功' : '发送失败',
+                })
+                resp.data.code==10000 && this.setWaitInfo();
+            }).catch(err=>{
+                this.$notify('出错了');
+            })
+            
+        },
+        /**
+         * 倒计时
+         */
+        setWaitInfo() {
+            if (this.intervalIndex) {
+                this.interval = 60;
+                clearInterval(this.intervalIndex);
+            }
+
+            // 倒计时
+            this.disableClick = true;
+            
+            this.intervalIndex = setInterval(() => {
+                this.interval--;
+                this.smsText = '重发(' + this.interval + ' s)';
+                if (this.interval <= 0) {
+                    clearInterval(this.intervalIndex);
+                    this.interval = 60;
+                    this.disableClick = false;
+                    this.smsText = '重发';
+                }
+            }, 1000);
+        },
+        /**
+         * 重置
+         */
+        onSubmit(values) {
+            
+            let postData = {
+                phone: values.phone,
+                password: values.password,
+                email:values.email,
+                confirmPassword: values.confirmPassword,
+                smsCode: values.smsCode,
+        
+            }
+
+            this.$http.post('resetPassword', JSON.stringify(postData))
+                .then(resp => {
+
+                    if (resp.data.code!=10000) {
+                        this.$notify(resp.data.message);
+                        return;
+                    }
+                    this.$notify({
+                        type: 'success',
+                        message: '发送成功',
+                    })
+
+                    // 跳转登录
+                    Dialog.confirm({
+                        title: '提示',
+                        message: '重置密码成功,前往登录',
+                    })
+                    .then((resp) => {
+                        this.$router.replace('/yys_login');
+                    })
+                    .catch(() => {
+                        // on cancel
+                        console.log('cancel');
+                    });
+                }).catch(err => {
+                    this.$notify('重置密码失败,请稍后再试');
+                })
+
+        },
+        /**
+         * onFailed
+         */
+        onFailed(errorInfo) {
+            console.log('failed', errorInfo);
+            // this.$notify(errorInfo.errors[0].message);
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+
+#loginTitle {
+    font-size: 20px;
+    text-align: center;
+    padding: 20px 0;
+}
+</style>

+ 8 - 5
src/pages/kede/yys/routes/play.vue

@@ -165,16 +165,18 @@ export default {
 
           this.$http.get("getDeviceHistory?startTime=" + startTime + "&endTime=" + endTime + "&factoryNumber=" + factoryNumber + "&openid=" + this.openid).then(res => {
 
+            
                     if(res.data.code!=10000 || res.data.data.length == 0){
                         that.routeList = [];
-                      that.pathList = [];
+                         that.pathList = [];
                      
                         return;
                     }
             
-                  
+         
                     let resList=  res.data.data;
                     let pathList = [];
+
                     resList.forEach( (item, index) => {
                       pathList.push(
                         {
@@ -210,13 +212,13 @@ export default {
             }
 
           this.$http.get("getDeviceHistory?startTime=" + startTime + "&endTime=" + endTime + "&factoryNumber=" + factoryNumber + "&openid=" +this.openid).then(res => {
-
+                  
                     if(res.data.code!=10000 || res.data.data.length == 0){
                         that.routeList = [];
                         that.pathList = [];
                         return;
                     }
-           
+          
                     let resList=  res.data.data;
                     let pathList = [];
                     resList.forEach( (item, index) => {
@@ -227,11 +229,12 @@ export default {
                         }
                       );
                     });
+           
                     that.pathList = pathList;
                     that.routeList = resList;
 
                     that.currentPt = resList[0];
-
+           
                     this.initRoute();
 
                 })

+ 27 - 7
src/router/index.js

@@ -62,11 +62,7 @@ export default new Router({
       name: 'register',
       component: () => import("@/pages/kede/login/register"),
     },
-    {
-      path: '/reset_pwd',
-      name: 'reset_pwd',
-      component: () => import("@/pages/kede/login/reset_pwd"),
-    },
+  
     {
       path: '/edit_profile',
       name: 'profile',
@@ -208,13 +204,16 @@ export default new Router({
       "meta": {
         role: 'yys',
       },
-      children:[
+      children: [
+      
         {
           path: "/yys_location",
           name:"yys_location",
           component: () => import("@/pages/kede/yys/location"),   
           meta: {
             role: 'yys',
+            keepAlive: true,
+
           },
         },
         {
@@ -258,7 +257,7 @@ export default new Router({
           component: () => import("@/pages/kede/yys/alarms"),   
           meta: {
             role: 'yys',
-            keepAlive: true
+            // keepAlive: true
           },
         },
         {
@@ -279,6 +278,8 @@ export default new Router({
       },
       component: () => import("@/pages/kede/yys/login"),
     },
+    
+   
     {
       path: '/yys_profile',
       name: 'yys_profile',
@@ -294,6 +295,16 @@ export default new Router({
         role: 'yys',
       },
       component: () => import("@/pages/kede/yys/alarms/add.vue"),
+
+    },
+    {
+       //更新计划
+      path: '/yys_update_plan',
+      name: 'yys_update_plan',
+      meta: {
+        role: 'yys',
+      },
+      component: () => import("@/pages/kede/yys/alarms/update.vue"),
     },
     {
       path: '/yys_alarm_detail',
@@ -343,6 +354,15 @@ export default new Router({
         role: 'yys',
       },
     },
+    {
+      path: '/yys_reset_pwd',
+      name: 'yys_reset_pwd',
+       meta: {
+        role: 'yys',
+      },
+      component: () => import("@/pages/kede/yys/reset"),
+    },
+
 
   ]
 })