chenying hace 4 años
padre
commit
ef201dc09a

+ 1 - 1
config/dev.env.js

@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  OPEN_PROXY: false // 是否开启代理, 重置后需重启vue-cli
+  OPEN_PROXY: true // 是否开启代理, 重置后需重启vue-cli
 })

+ 2 - 2
config/index.js

@@ -14,10 +14,10 @@ module.exports = {
     // 代理列表, 是否开启代理通过[./dev.env.js]配置
     proxyTable: devEnv.OPEN_PROXY === false ? {} : {
       '/proxyApi': {
-        target: 'http://demo.renren.io/renren-fast/',
+        target: 'http://112.74.164.79/api',
         changeOrigin: true,
         pathRewrite: {
-          '^/proxyApi': '/'
+          '^/proxyApi': ''
         }
       }
     },

+ 3 - 3
index.html

@@ -12,11 +12,11 @@
   <% }else { %>
     <!-- 开发环境 -->
     <script src="./static/config/index.js"></script>
-    <script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
-    <script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script>
+    <!-- <script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script> -->
+    <!-- <script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script>
     <script src="./static/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
     <script src="./static/plugins/ueditor-1.4.3.3/ueditor.all.min.js"></script>
-    <script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>
+    <script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script> -->
   <% } %>
 </head>
 <body>

+ 16 - 0
src/assets/scss/_base.scss

@@ -362,3 +362,19 @@ img {
   vertical-align: middle;
   margin-right: 5px;
 }
+
+.el-tabl{
+  &__row{
+    &--level-2{
+      .el-table__indent {
+        padding-left: 48px !important;
+      }
+    }
+  }
+}
+
+>>> .el-table__row--level-2{
+  .el-table__indent {
+    padding-left: 48px !important;
+  }
+}

+ 3 - 3
src/main.js

@@ -15,9 +15,9 @@ Vue.use(VueCookie)
 Vue.config.productionTip = false
 
 // 非生产环境, 适配mockjs模拟数据                 // api: https://github.com/nuysoft/Mock
-if (process.env.NODE_ENV !== 'production') {
-  require('@/mock')
-}
+// if (process.env.NODE_ENV !== 'production') {
+//   require('@/mock')
+// }
 
 // 挂载全局
 Vue.prototype.$http = httpRequest // ajax请求方法

+ 8 - 8
src/router/index.js

@@ -34,9 +34,9 @@ const mainRoutes = {
     // 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否
     // 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
     { path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
-    { path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
-    { path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
-    { path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } }
+    { path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } }
+    // { path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
+    // { path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } }
   ],
   beforeEnter (to, from, next) {
     let token = Vue.cookie.get('token')
@@ -63,15 +63,15 @@ router.beforeEach((to, from, next) => {
     next()
   } else {
     http({
-      url: http.adornUrl('/sys/menu/nav'),
+      url: http.adornUrl('/user-service/menu/nav'),
       method: 'get',
       params: http.adornParams()
     }).then(({data}) => {
-      if (data && data.code === 0) {
-        fnAddDynamicMenuRoutes(data.menuList)
+      if (data && data.code === '200') {
+        fnAddDynamicMenuRoutes(data.data)
         router.options.isAddDynamicMenuRoutes = true
-        sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]'))
-        sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]'))
+        sessionStorage.setItem('menuList', JSON.stringify(data.data.menuList || '[]'))
+        sessionStorage.setItem('permissions', JSON.stringify(data.data.permissions || '[]'))
         next({ ...to, replace: true })
       } else {
         sessionStorage.setItem('menuList', '[]')

+ 1 - 1
src/utils/httpRequest.js

@@ -44,7 +44,7 @@ http.interceptors.response.use(response => {
  */
 http.adornUrl = (actionName) => {
   // 非生产环境 && 开启代理, 接口前缀统一使用[/proxyApi/]前缀做代理拦截!
-  return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl) + actionName
+  return (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi' : window.SITE_CONFIG.baseUrl) + actionName
 }
 
 /**

+ 42 - 35
src/views/common/login.vue

@@ -1,39 +1,43 @@
 <template>
-  <div class="site-wrapper site-page--login">
-    <div class="site-content__wrapper">
-      <div class="site-content">
-        <div class="brand-info">
-          <h2 class="brand-info__text">智慧机场平台</h2>
-          <p class="brand-info__intro">服务于各大机场,进行智慧管理</p>
-        </div>
-        <div class="login-main">
-          <h3 class="login-title">管理员登录</h3>
-          <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
-            <el-form-item prop="userName">
-              <el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
-            </el-form-item>
-            <el-form-item prop="password">
-              <el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
-            </el-form-item>
-            <!-- <el-form-item prop="captcha">
-              <el-row :gutter="20">
-                <el-col :span="14">
-                  <el-input v-model="dataForm.captcha" placeholder="验证码">
-                  </el-input>
-                </el-col>
-                <el-col :span="10" class="login-captcha">
-                  <img :src="captchaPath" @click="getCaptcha()" alt="">
-                </el-col>
-              </el-row>
-            </el-form-item> -->
-            <el-form-item>
-              <el-button class="login-btn-submit" type="primary" @click="dataFormSubmit()">登录</el-button>
-            </el-form-item>
-          </el-form>
+    <div class="site-wrapper site-page--login">
+      <div class="site-content__wrapper">
+        <div class="site-content">
+          <div class="brand-info">
+            <h2 class="brand-info__text">智慧机场平台</h2>
+            <p class="brand-info__intro">服务于各大机场,进行智慧管理</p>
+          </div>
+          <div class="login-main">
+            <h3 class="login-title">管理员登录</h3>
+            <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
+              <el-form-item prop="userName">
+                <el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
+              </el-form-item>
+              <el-form-item prop="password">
+                <el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
+              </el-form-item>
+              <!-- <el-form-item prop="captcha">
+                <el-row :gutter="20">
+                  <el-col :span="14">
+                    <el-input v-model="dataForm.captcha" placeholder="验证码">
+                    </el-input>
+                  </el-col>
+                  <el-col :span="10" class="login-captcha">
+                    <img :src="captchaPath" @click="getCaptcha()" alt="">
+                  </el-col>
+                </el-row>
+              </el-form-item> -->
+              <el-form-item>
+                <el-button class="login-btn-submit" type="primary" @click="dataFormSubmit()">登录</el-button>
+              </el-form-item>
+            </el-form>
+          </div>
         </div>
       </div>
+      <div class="site-wrapper site-sidebar--fold"
+        v-loading.fullscreen.lock="loading"
+        element-loading-text="拼命加载中">
+      </div>
     </div>
-  </div>
 </template>
 
 <script>
@@ -58,15 +62,17 @@
             { required: true, message: '验证码不能为空', trigger: 'blur' }
           ]
         },
-        captchaPath: ''
+        captchaPath: '',
+        loading: false
       }
     },
     created () {
-      this.getCaptcha()
+      // this.getCaptcha()
     },
     methods: {
       // 提交表单
       dataFormSubmit () {
+        this.loading = true
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
             this.$http({
@@ -82,7 +88,8 @@
                 this.$cookie.set('token', data.data.access_token)
                 this.$router.replace({ name: 'home' })
               } else {
-                this.getCaptcha()
+                this.loading = false
+                // this.getCaptcha()
                 this.$message.error(data.msg)
               }
             })

+ 12 - 10
src/views/main-navbar.vue

@@ -85,16 +85,18 @@
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          this.$http({
-            url: this.$http.adornUrl('/sys/logout'),
-            method: 'post',
-            data: this.$http.adornData()
-          }).then(({data}) => {
-            if (data && data.code === 0) {
-              clearLoginInfo()
-              this.$router.push({ name: 'login' })
-            }
-          })
+          clearLoginInfo()
+          this.$router.push({ name: 'login' })
+          // this.$http({
+          //   url: this.$http.adornUrl('/sys/logout'),
+          //   method: 'post',
+          //   data: this.$http.adornData()
+          // }).then(({data}) => {
+          //   if (data && data.code === 0) {
+          //     clearLoginInfo()
+          //     this.$router.push({ name: 'login' })
+          //   }
+          // })
         }).catch(() => {})
       }
     }

+ 2 - 2
src/views/main-sidebar.vue

@@ -10,7 +10,7 @@
           <icon-svg name="shouye" class="site-sidebar__menu-icon"></icon-svg>
           <span slot="title">首页</span>
         </el-menu-item>
-        <el-submenu index="demo">
+        <!-- <el-submenu index="demo">
           <template slot="title">
             <icon-svg name="shoucang" class="site-sidebar__menu-icon"></icon-svg>
             <span>demo</span>
@@ -23,7 +23,7 @@
             <icon-svg name="editor" class="site-sidebar__menu-icon"></icon-svg>
             <span slot="title">ueditor</span>
           </el-menu-item>
-        </el-submenu>
+        </el-submenu> -->
         <sub-menu
           v-for="menu in menuList"
           :key="menu.menuId"

+ 1 - 0
src/views/modules/org/org.vue

@@ -10,6 +10,7 @@
       :data="dataList"
       row-key="orgId"
       border
+      :indent='20'
       style="width: 100%; ">
       <!-- <el-table-column type="selection" width="40">
     	  <template slot-scope="scope">

+ 1 - 1
src/views/modules/sys/config-add-or-update.vue

@@ -69,7 +69,7 @@
           if (valid) {
             this.$http({
               url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
-              method: 'post',
+              method: this.dataForm.id ? 'put' : 'post',
               data: this.$http.adornData({
                 'id': this.dataForm.id || undefined,
                 'paramKey': this.dataForm.paramKey,

+ 7 - 3
src/views/modules/sys/menu-add-or-update.vue

@@ -12,7 +12,7 @@
       <el-form-item :label="dataForm.typeList[dataForm.type] + '名称'" prop="name">
         <el-input v-model="dataForm.name" :placeholder="dataForm.typeList[dataForm.type] + '名称'"></el-input>
       </el-form-item>
-      <el-form-item label="上级菜单" prop="parentName">
+      <el-form-item v-if="dataForm.type !== 0" label="上级菜单" prop="parentName">
         <el-popover
           ref="menuListPopover"
           placement="bottom-start"
@@ -178,7 +178,11 @@
       // 菜单树设置当前选中节点
       menuListTreeSetCurrentNode () {
         this.$refs.menuListTree.setCurrentKey(this.dataForm.parentId)
-        this.dataForm.parentName = (this.$refs.menuListTree.getCurrentNode() || {})['name']
+        if (this.dataForm.parentId === '0') {
+          this.dataForm.parentName = ''
+        } else {
+          this.dataForm.parentName = (this.$refs.menuListTree.getCurrentNode() || {})['name']
+        }
       },
       // 图标选中
       iconActiveHandle (iconName) {
@@ -190,7 +194,7 @@
           if (valid) {
             this.$http({
               url: this.$http.adornUrl(`/user-service/menu/${!this.dataForm.id ? 'save' : 'update'}`),
-              method: 'post',
+              method: this.dataForm.id ? 'put' : 'post',
               data: this.$http.adornData({
                 'menuId': this.dataForm.id || undefined,
                 'appCode': 'ERP-SYSTEM',

+ 1 - 0
src/views/modules/sys/menu.vue

@@ -10,6 +10,7 @@
       :data="dataList"
       row-key="menuId"
       border
+      :indent='20'
       style="width: 100%; ">
       <el-table-column
         prop="name"

+ 4 - 4
src/views/modules/sys/role-add-or-update.vue

@@ -7,12 +7,12 @@
       <el-form-item label="角色名称" prop="roleName">
         <el-input v-model="dataForm.roleName" placeholder="角色名称"></el-input>
       </el-form-item>
-      <el-form-item label="通用角色" size="mini" prop="isCommon">
+      <!-- <el-form-item label="通用角色" size="mini" prop="isCommon">
         <el-radio-group v-model="dataForm.isCommon">
           <el-radio :label="false">否</el-radio>
           <el-radio :label="true">是</el-radio>
         </el-radio-group>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item label="备注" prop="remark">
         <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
       </el-form-item>
@@ -123,7 +123,7 @@
               if (data && data.code === '200') {
                 this.dataForm.roleName = data.data.roleName
                 this.dataForm.remark = data.data.remark
-                this.dataForm.isCommon = data.data.isCommon
+                // this.dataForm.isCommon = data.data.isCommon
                 this.dataForm.orgId = data.data.orgId
                 var idx = data.data.menuIdList.indexOf(this.tempKey)
                 if (idx !== -1) {
@@ -145,7 +145,7 @@
           if (valid) {
             this.$http({
               url: this.$http.adornUrl(`/user-service/role/${!this.dataForm.id ? 'save' : 'update'}`),
-              method: 'post',
+              method: this.dataForm.id ? 'put' : 'post',
               data: this.$http.adornData({
                 'roleId': this.dataForm.id || undefined,
                 'roleName': this.dataForm.roleName,

+ 8 - 4
src/views/modules/sys/user-add-or-update.vue

@@ -115,7 +115,11 @@
           method: 'get',
           params: this.$http.adornParams()
         }).then(({data}) => {
-          this.roleList = data && data.code === 0 ? data.data : []
+          if (data.code === '200') {
+            this.roleList = data && data.code === '200' ? data.data : []
+          } else {
+            this.$message.error(data.msg)
+          }
         }).then(() => {
           this.visible = true
           this.$nextTick(() => {
@@ -128,13 +132,13 @@
               method: 'get',
               params: this.$http.adornParams()
             }).then(({data}) => {
-              if (data && data.code === 0) {
+              if (data && data.code === '200') {
                 this.dataForm.userName = data.data.username
                 this.dataForm.salt = data.data.salt
                 this.dataForm.email = data.data.email
                 this.dataForm.mobile = data.data.mobile
                 this.dataForm.roleIdList = data.data.roleIdList
-                this.dataForm.status = data.data.status
+                this.dataForm.status = Number(data.data.status)
               }
             })
           }
@@ -146,7 +150,7 @@
           if (valid) {
             this.$http({
               url: this.$http.adornUrl(`/user-service/user/${!this.dataForm.id ? 'save' : 'update'}`),
-              method: 'post',
+              method: !this.dataForm.id ? 'post' : 'put',
               data: this.$http.adornData({
                 'userId': this.dataForm.id || undefined,
                 'username': this.dataForm.userName,

+ 1 - 1
static/config/index-prod.js

@@ -5,7 +5,7 @@
   window.SITE_CONFIG = {};
 
   // api接口请求地址
-  window.SITE_CONFIG['baseUrl'] = 'http://demo.open.renren.io/renren-fast-server';
+  window.SITE_CONFIG['baseUrl'] = 'http://112.74.164.79/api';
 
   // cdn地址 = 域名 + 版本号
   window.SITE_CONFIG['domain']  = './'; // 域名

+ 4 - 4
static/config/init.js

@@ -10,11 +10,11 @@
     js: [
       // 插件, 放置业务之前加载, 以免业务需求依赖插件时, 还未加载出错
       // 插件 - echarts
-      window.SITE_CONFIG.cdnUrl + '/static/plugins/echarts-3.8.5/echarts.common.min.js',
+      // window.SITE_CONFIG.cdnUrl + '/static/plugins/echarts-3.8.5/echarts.common.min.js',
       // 插件 - ueditor
-      window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.config.js',
-      window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.all.min.js',
-      window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js',
+      // window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.config.js',
+      // window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/ueditor.all.min.js',
+      // window.SITE_CONFIG.cdnUrl + '/static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js',
       // 业务
       window.SITE_CONFIG.cdnUrl + '/static/js/manifest.js',
       window.SITE_CONFIG.cdnUrl + '/static/js/vendor.js',