2
3
jichengcheng vor 6 Jahren
Ursprung
Commit
86b90b9489

+ 0 - 131
src/dashoo.cn/frontend_web/src/pages/login.vue

@@ -12,56 +12,6 @@
           <el-form class="login-form" auto-complete="off" :model="model" :rules="rules" ref="user" label-position="top">
             <h2 class="heading">登录</h2>
             <el-form-item label="用户名" prop="username">
-          <el-main style="height:650px; padding:5px 20px 0 15px; background-color: #D3DCE6;">
-            <div>
-              <div style="height:250px; background-color: white;">
-                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/tongzhigonggao.jpg" alt="通知公告" style="height: 40px; width: 100px;"></div>
-                <div>
-                  <template>
-                    <el-table :data="noticeList" style="width: 100%" max-height="200" >
-                      <el-table-column prop="Name" label="通知标题" width="450">
-                        <template slot-scope="scope">
-                          <i class="el-icon-caret-right"></i>
-                          <span style="margin-left: 5px">{{ scope.row.Name }}</span>
-                        </template>
-                      </el-table-column>
-                      <el-table-column prop="CreateOn" label="时间" width="141">
-                        <template slot-scope="scope">
-                          {{ jstimehandle(scope.row.CreateOn+'') }}
-                        </template>
-                      </el-table-column>
-                    </el-table>
-                  </template>
-                </div>
-              </div>
-              <div style="height:250px; background-color: white; margin: 20px 0 0 0;">
-                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/ziliaoxiazai.jpg" alt="资料下载" style="height: 40px; width: 100px;"></div>
-                <div>
-                  <!-- <ul type="circle">
-                    <li v-for="item in fileList" :key="item">
-                      {{ item.Name }} <a style="font-weight: 400; font-size: 10px;">({{ jstimehandle(item.CreateOn) }})</a>
-                    </li>
-                  </ul> -->
-                  <template>
-                    <el-table :data="fileList" style="width: 100%" max-height="200" @row-click="DownloadFile">
-                      <el-table-column prop="Name" label="文件名" width="450">
-                        <template slot-scope="scope">
-                          <i class="el-icon-caret-right"></i>
-                          <a style="margin-left: 5px">{{ scope.row.Name }}</a>
-                        </template>
-                      </el-table-column>
-                      <el-table-column prop="CreateOn" label="时间" width="141">
-                        <template slot-scope="scope">
-                          {{ jstimehandle(scope.row.CreateOn+'') }}
-                        </template>
-                      </el-table-column>
-                    </el-table>
-                  </template>
-                </div>
-              </div>
-            </div>
-          </el-main>
-          <el-aside style="height:650px; width:300px;">
               <el-input type="text" v-model="model.username" placeholder="请输入用户名">
                 <el-select v-model="loginMode" slot="append" placeholder="登录类型" style="width: 110px;">
                   <el-option label="普通账户" :value="1"></el-option>
@@ -83,30 +33,6 @@
         ©大港油田信息中心 版权所有
       </footer>
     </div>
-            <div style="padding: 5px 10px 0 0;">
-              <el-form auto-complete="off" :model="model" :rules="rules" ref="user" label-position="top">
-                <p style="font-size: 20px; margin: 15px 0 5px 0; font-weight: 500;">登录</p>
-                <el-form-item label="用户名" prop="username" style="text-align:left;">
-                  <el-input type="text" v-model="model.username" placeholder="请输入用户名">
-                    <el-select v-model="loginMode" slot="append" placeholder="登录类型" style="width: 110px;">
-                      <el-option label="普通账户" :value="1"></el-option>
-                      <el-option label="PTR认证" :value="2"></el-option>
-                    </el-select>
-                  </el-input>
-                </el-form-item>
-                <el-form-item label="密码" prop="password" style="text-align:left;">
-                  <el-input type="password" v-model="model.password" placeholder="请输入密码" @keyup.enter.native="login()" />
-                </el-form-item>
-                <el-button type="primary" :loading="loading" @click="login()" style="width:100px">{{ loading ? '登录中...' : '登录' }}</el-button>
-              </el-form>
-            </div>
-          </el-aside>
-        </el-container>
-      </el-main>
-      <el-footer style="height:30px; font-size:10px; padding: 7px;">
-        <div>©大港油田信息中心 版权所有</div>
-      </el-footer>
-    </el-container>
   </div>
 </template>
 
@@ -135,69 +61,12 @@
       }
 
       return {
-        noticeList: [], //通知列表
-        fileList: [], //文档列表
         loginMode: 1,
         model: model,
         rules: rules,
         error: null,
         loading: false
       }
-    },
-    created() {
-      this.initNoticeListData()
-      this.initFileListData()
-    },
-    methods: {
-      //获取通知列表
-      initNoticeListData() {
-        let _this = this
-        //传递列名
-        const params = {
-          colName: "NoticeTab"
-        }
-        _this.$axios.get("/document/getdocumentnameandtime", {params})
-          .then(function (response) {
-            _this.noticeList = response.data
-          })
-          .catch(function (error) {
-            console.log(error);
-          });
-      },
-      //获取文件列表
-      initFileListData() {
-        let _this = this
-        //传递列名
-        const params = {
-          colName: "DocTab"
-        }
-        _this.$axios.get("/document/getdocumentnameandtime", {params})
-          .then(function (response) {
-            _this.fileList = response.data
-          })
-          .catch(function (error) {
-            console.log(error);
-          });
-      },
-      //下载文件
-      DownloadFile(row){
-        let val = row.FileURL
-        let urlArr = val.split('|')
-        location.href = "http://" + urlArr[0]
-      },
-      //格式化时间
-      jstimehandle(val) {
-        if (val === '') {
-          return '----'
-        } else if (val === '0001-01-01T08:00:00+08:00') {
-          return '----'
-        } else if (val === '5000-01-01T23:59:59+08:00') {
-          return '永久'
-        } else {
-          val = val.replace('T', ' ')
-          return val.substring(0, 10)
-        }
-      }
     }
   })
   export default class Login extends Vue {

+ 247 - 0
src/dashoo.cn/frontend_web/src/pages/login3.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="login-body">
+    <el-container>
+      <el-header style="height:100px">
+        <div style="top: 18px; position: relative;">
+          <img src="../assets/img/title_gongfang.png">
+        </div>
+      </el-header>
+      <el-main style="height:700px;">
+        <el-container>
+          <el-main style="height:650px; padding:5px 20px 0 15px; background-color: #D3DCE6;">
+            <div>
+              <div style="height:250px; background-color: white;">
+                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/tongzhigonggao.jpg" alt="通知公告" style="height: 40px; width: 100px;"></div>
+                <div>
+                  <template>
+                    <el-table :data="noticeList" style="width: 100%" max-height="200" >
+                      <el-table-column prop="Name" label="通知标题" width="450">
+                        <template slot-scope="scope">
+                          <i class="el-icon-caret-right"></i>
+                          <span style="margin-left: 5px">{{ scope.row.Name }}</span>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="CreateOn" label="时间" width="141">
+                        <template slot-scope="scope">
+                          {{ jstimehandle(scope.row.CreateOn+'') }}
+                        </template>
+                      </el-table-column>
+                    </el-table>
+                  </template>
+                </div>
+              </div>
+              <div style="height:250px; background-color: white; margin: 20px 0 0 0;">
+                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/ziliaoxiazai.jpg" alt="资料下载" style="height: 40px; width: 100px;"></div>
+                <div>
+                  <!-- <ul type="circle">
+                    <li v-for="item in fileList" :key="item">
+                      {{ item.Name }} <a style="font-weight: 400; font-size: 10px;">({{ jstimehandle(item.CreateOn) }})</a>
+                    </li>
+                  </ul> -->
+                  <template>
+                    <el-table :data="fileList" style="width: 100%" max-height="200" @row-click="DownloadFile">
+                      <el-table-column prop="Name" label="文件名" width="450">
+                        <template slot-scope="scope">
+                          <i class="el-icon-caret-right"></i>
+                          <a style="margin-left: 5px">{{ scope.row.Name }}</a>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="CreateOn" label="时间" width="141">
+                        <template slot-scope="scope">
+                          {{ jstimehandle(scope.row.CreateOn+'') }}
+                        </template>
+                      </el-table-column>
+                    </el-table>
+                  </template>
+                </div>
+              </div>
+            </div>
+          </el-main>
+          <el-aside style="height:650px; width:300px;">
+            <div style="padding: 5px 10px 0 0;">
+              <el-form auto-complete="off" :model="model" :rules="rules" ref="user" label-position="top">
+                <p style="font-size: 20px; margin: 15px 0 5px 0; font-weight: 500;">登录</p>
+                <el-form-item label="用户名" prop="username" style="text-align:left;">
+                  <el-input type="text" v-model="model.username" placeholder="请输入用户名">
+                    <el-select v-model="loginMode" slot="append" placeholder="登录类型" style="width: 110px;">
+                      <el-option label="普通账户" :value="1"></el-option>
+                      <el-option label="PTR认证" :value="2"></el-option>
+                    </el-select>
+                  </el-input>
+                </el-form-item>
+                <el-form-item label="密码" prop="password" style="text-align:left;">
+                  <el-input type="password" v-model="model.password" placeholder="请输入密码" @keyup.enter.native="login()" />
+                </el-form-item>
+                <el-button type="primary" :loading="loading" @click="login()" style="width:100px">{{ loading ? '登录中...' : '登录' }}</el-button>
+              </el-form>
+            </div>
+          </el-aside>
+        </el-container>
+      </el-main>
+      <el-footer style="height:30px; font-size:10px; padding: 7px;">
+        <div>©大港油田信息中心 版权所有</div>
+      </el-footer>
+    </el-container>
+  </div>
+</template>
+
+<script>
+  import Vue from 'vue'
+  import Component from 'class-component'
+  @Component({
+    data() {
+      const model = {
+        username: '',
+        password: ''
+      }
+      const rules = {
+        username: [{
+          required: true,
+          message: '请输入用户名'
+        }],
+        password: [{
+          required: true,
+          message: '请输入密码'
+        }]
+      }
+
+      return {
+        noticeList: [], //通知列表
+        fileList: [], //文档列表
+        loginMode: 1,
+        model: model,
+        rules: rules,
+        error: null,
+        loading: false
+      }
+    },
+    created() {
+      this.initNoticeListData()
+      this.initFileListData()
+    },
+    methods: {
+      //获取通知列表
+      initNoticeListData() {
+        let _this = this
+        //传递列名
+        const params = {
+          colName: "NoticeTab"
+        }
+        _this.$axios.get("/document/getdocumentnameandtime", {params})
+          .then(function (response) {
+            _this.noticeList = response.data
+          })
+          .catch(function (error) {
+            console.log(error);
+          });
+      },
+      //获取文件列表
+      initFileListData() {
+        let _this = this
+        //传递列名
+        const params = {
+          colName: "DocTab"
+        }
+        _this.$axios.get("/document/getdocumentnameandtime", {params})
+          .then(function (response) {
+            _this.fileList = response.data
+          })
+          .catch(function (error) {
+            console.log(error);
+          });
+      },
+      //下载文件
+      DownloadFile(row){
+        let val = row.FileURL
+        let urlArr = val.split('|')
+        location.href = "http://" + urlArr[0]
+      },
+      //格式化时间
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T08:00:00+08:00') {
+          return '----'
+        } else if (val === '5000-01-01T23:59:59+08:00') {
+          return '永久'
+        } else {
+          val = val.replace('T', ' ')
+          return val.substring(0, 10)
+        }
+      }
+    }
+  })
+  export default class Login extends Vue {
+    layout() {
+      return 'empty'
+    }
+    login() {
+      this.logging = true
+      this.$refs.user.validate(async (valid) => {
+        try {
+          if (valid) {
+            await this.$store.dispatch('auth/login', {
+              fields: {
+                username: this.model.username.replace(/(^\s*)|(\s*$)/g, ""),
+                password: this.model.password.replace(/(^\s*)|(\s*$)/g, "")
+              }
+            })
+            if (process.env.appclient == 'gfgl') {
+              this.$router.push(this.$route.query.page || '/')
+            } else if (process.env.appclient == 'cellbank') {
+              this.$router.push(this.$route.query.page || '/indexdqm')
+            } else {
+              this.$router.push(this.$route.query.page || '/')
+            }
+          }
+        } catch (e) {
+          this.$message.warning('账号或密码错误')
+        } finally {
+          this.logging = false
+        }
+      })
+    }
+    logout() {
+      this.$store.dispatch('logout')
+    }
+  }
+
+</script>
+
+<style lang="scss">
+  .el-header {
+    background-color: white;
+    text-align: center;
+    opacity:0.8;
+  }
+  
+  .el-main {
+    background-color: #E9EEF3;
+    color: #333;
+     opacity:0.9;
+  }
+
+  .el-aside {
+    background-color: #D3DCE6;
+    color: #333;
+    text-align: center;
+  }
+
+  .el-footer {
+    background-color: #B3C0D1;
+    color: #333;
+    text-align: center;
+  }
+
+  .login-body {
+     background: url("../assets/img/tian.png") no-repeat left 50%;
+    font-family: 'Open Sans', sans-serif;
+    background-color: #2469E8;
+    background-size: cover;
+
+    margin: auto;
+    width: 1000px;
+    height: 1300px;
+  }
+
+</style>