智慧农业大数据平台
guanqb
2022-08-03 b1fe84e686e94db9c37c7dd8de91ca984929afac
地块下拉框
3 files modified
78 ■■■■ changed files
src/views/equipment/index.vue 39 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 2 ●●●●● patch | view | raw | blame | history
src/views/login/index.vue 37 ●●●● patch | view | raw | blame | history
src/views/equipment/index.vue
@@ -18,7 +18,7 @@
                    <el-option
                        v-for="(item, index) in plotList"
                        :key="index"
                        :label="item.name"
                        :label="item.landName"
                        :value="item.id"
                    ></el-option>
                </el-select>
@@ -107,32 +107,25 @@
<script>
import {
    getLandList
} from '@/api/land/land'
export default {
    data () {
        return {
            plotName: '非凡渔业专业合作社',
            plotList: [{
                name: '1号',
                id: 1
            }, {
                name: '2号',
                id: 2
            }, {
                name: '3号',
                id: 3
            }, {
                name: '4号',
                id: 4
            }],
            plotNameObj: {},
            plotName: "",
            plotList: [],
            currentDetails: {},
            echartsBosShow: false
        }
    },
    created () {
        this.getParams()
        this.getLandList()
    },
    mounted () {
        // this.getLandList()
    },
    methods: {
        prev () {
@@ -266,6 +259,18 @@
            this.initLine('EchartsBox', '单位:℃', ['03-14 16:00', '03-15 16:00', '03-16 16:00', '03-17 16:00', '03-18 16:00', '03-19 16:00'], [20, 24, 23, 25, 30, 18])
            this.echartsBosShow = true
        },
        getLandList () {
            // var params = {
            //     userid: this.$store.state.user
            // }
            // var dept_id = this.$store.state.user.user.dept_id
            getLandList(this.$store.state.user.user.dept_id).then((res) => {
                console.log(res.data.data)
                this.plotList = res.data.data
                this.plotNameObj = this.plotList[0]
                this.plotName = this.plotNameObj.id
            })
        }
    }
}
src/views/home/index.vue
@@ -1272,12 +1272,10 @@
        // 获取在线设备数量
        getStationAndVideoCount () {
            var that = this
            console.log(21313)
            getStationAndVideoCount().then((res) => {
                if (JSON.stringify(res.data) != "{}" && res.data.data) {
                    that.mTotalObj = res.data.data
                }
                console.log('2311111111112131321231113', res)
                that.initRightPie('EquipmentEcharts')
            })
src/views/login/index.vue
@@ -28,9 +28,7 @@
          </el-form-item>
          <!-- 登录按钮 -->
          <el-form-item>
            <el-button type="primary" @click.enter="onLogin(user)"
              >登&nbsp;录</el-button
            >
                        <el-button type="primary" @click.enter="onLogin(user)">登&nbsp;录</el-button>
          </el-form-item>
        </el-form>
      </div>
@@ -39,9 +37,10 @@
</template>
<script>
import nprogress from "nprogress";
import md5 from "js-md5";
import axios from "axios";
import nprogress from "nprogress"
import md5 from "js-md5"
import axios from "axios"
import { EventBus } from "../../eventBus/event-bus"
export default {
  name: "AppRegister",
@@ -73,10 +72,10 @@
      },
      errors: null,
      newAxios: null,
    };
        }
  },
  created() {
    var that = this;
        var that = this
    this.newAxios = axios.create({
      baseURL: "http://182.106.212.58:8013/api",
@@ -85,20 +84,20 @@
        Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
        "Tenant-Id": "000000",
      },
    });
        })
    document.onkeydown = (e) => {
      const _key = window.event.keyCode;
            const _key = window.event.keyCode
      if (_key === 13) {
        that.onLogin(that.user);
                that.onLogin(that.user)
      }
    };
        }
  },
  methods: {
    onLogin({ username, password }) {
      this.$refs.formName.validate((valid) => {
        if (valid) {
          nprogress.start();
                    nprogress.start()
          this.newAxios({
            method: "POST",
@@ -110,18 +109,18 @@
            },
          }).then((res) => {
            if (res.data.access_token) {
              this.$store.commit("setUser", res.data);
              this.$router.push({ path: "/" });
                            this.$store.commit("setUser", res.data)
                            this.$router.push({ path: "/" })
            } else {
              this.$message({
                type: "warning",
                message: "用户名或密码不正确,请重新输入",
              });
                            })
            }
            nprogress.done();
          });
                        nprogress.done()
                    })
        }
      });
            })
    },
  },
};