123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <div id="kjpdLogin">
- <el-row>
- <el-col :span="24">
- <el-col :span="5" class="info"> </el-col>
- <el-col :span="13" class="login">
- <el-col :span="24" class="title">
- 管理登录
- </el-col>
- <el-col :span="24" class="form">
- <el-form ref="form" :model="form" :rules="rules" label-width="140px">
- <el-form-item label="房间号" prop="room_id">
- <el-input v-model="form.room_id" placeholder="房间号"></el-input>
- </el-form-item>
- <el-form-item label="登录密码" prop="passwd">
- <el-input v-model="form.passwd" placeholder="请输入登录密码" show-password></el-input>
- </el-form-item>
- <el-col :span="24" class="btn">
- <el-button type="primary" @click="onSubmit">登录</el-button>
- </el-col>
- </el-form>
- </el-col>
- </el-col>
- <el-col :span="5" class="info"> </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex';
- const { mapActions: channel } = createNamespacedHelpers('channel');
- export default {
- name: 'kjpdLogin',
- props: {},
- components: {},
- data: function() {
- return {
- form: {},
- rules: {
- room_id: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
- passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
- },
- };
- },
- created() {},
- methods: {
- ...channel({ toLogin: 'login' }),
- async onSubmit() {
- let data = this.form;
- const res = await this.toLogin({ user: data });
- if (res.uid) {
- console.log(res);
- // this.$router.push({ path: '/kjpdCenter/index', query: { num: '1' } });
- }
- },
- },
- computed: {
- ...mapState(['user']),
- pageTitle() {
- return `${this.$route.meta.title}`;
- },
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- };
- </script>
- <style lang="less" scoped>
- .info {
- height: 800px;
- }
- .login {
- padding: 15px 0;
- .title {
- text-align: center;
- font-size: 40px;
- padding: 40px 0;
- }
- .form {
- .btn {
- text-align: center;
- }
- }
- }
- </style>
|