ソースを参照

Merge branch 'master' of http://139.196.39.194:9021/chenc/cd-work-flow-web

yuansh 2 年 前
コミット
f21d7f3760

+ 1 - 0
public/index.html

@@ -271,6 +271,7 @@
     window._CONFIG['domianURL'] = 'http://127.0.0.1:8090/jeecg-boot'; // 本地测试
     // window._CONFIG['domianURL'] = 'http://106.15.206.14:8087/jeecg-boot';// 测试服务器
     // window._CONFIG['domianURL'] = 'http://220.191.168.86:18087/jeecg-boot';// 森语外网
+    // window._CONFIG['domianURL'] = 'http://172.18.91.36:8081/jeecg-boot';// 博物馆oa
     window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
     window._CONFIG['onlinePreviewDomainURL'] = 'http://fileview.jeecg.com/onlinePreview'
     window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static';

+ 3 - 1
src/components/tools/UserMenu.vue

@@ -168,8 +168,10 @@
           content: '真的要注销登录吗 ?',
           onOk() {
             return that.Logout({}).then(() => {
-                window.location.href="/";
+              window.location.href="/";
               //window.location.reload()
+                //博物馆单点登录注销
+                // window.location.href="http://172.18.91.12:8888/sso";
             }).catch(err => {
               that.$message.error({
                 title: '错误',

+ 15 - 0
src/config/router.config.js

@@ -298,6 +298,8 @@ export const constantRouterMap = [
     path: '/user',
     component: UserLayout,
     redirect: '/user/login',
+    // 博物馆单点登录
+    // component: () => import('@/views/Index'),
     hidden: true,
     children: [
       {
@@ -347,6 +349,19 @@ export const constantRouterMap = [
   //   ]
   // },
 
+  {
+    path: '/redirect/login',
+    name: 'redirectLogin',
+    hidden: true,
+    component: () => import('@/views/Redirect')
+  },
+  {
+    path: '/index',
+    name: 'index',
+    hidden: true,
+    component: () => import('@/views/Index')
+  },
+
   {
     path: '/test',
     component: BlankLayout,

+ 1 - 1
src/permission.js

@@ -9,7 +9,7 @@ import { generateIndexRouter } from "@/utils/util"
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/user/login', '/user/register', '/user/register-result','/user/alteration','/activiti/commencementSchedule','/automaticLogin'] // no redirect whitelist
+const whiteList = ['/user/login', '/user/register', '/user/register-result','/user/alteration','/activiti/commencementSchedule','/automaticLogin','/redirect/login','/redirect/login/try','/index'] // no redirect whitelist
 
 router.beforeEach((to, from, next) => {
   NProgress.start() // start progress bar

+ 26 - 1
src/store/modules/user.js

@@ -3,7 +3,7 @@ import { automaticLogin,login, logout, phoneLogin } from "@/api/login"
 import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
 import { welcome } from "@/utils/util"
 import { queryPermissionsByUser } from '@/api/api'
-import { getAction } from '@/api/manage'
+import { getAction,postAction } from '@/api/manage'
 
 const user = {
   state: {
@@ -61,6 +61,31 @@ const user = {
         })
       })
     },
+    //单点登录重定向
+    redirectLogin({ commit }, param) {
+      return new Promise((resolve, reject) => {
+        postAction("/sys/redirect/login",param).then(response => {
+          if(response.success){
+            const result = response.result
+            const userInfo = result.userInfo
+            console.log(result)
+            console.log(userInfo)
+            Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
+            Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
+            Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
+            commit('SET_TOKEN', result.token)
+            commit('SET_INFO', userInfo)
+            commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() })
+            commit('SET_AVATAR', userInfo.avatar)
+            resolve(response)
+          }else{
+            resolve(response)
+          }
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
     // 登录
     Login({ commit }, userInfo) {
       return new Promise((resolve, reject) => {

+ 43 - 0
src/views/Index.vue

@@ -0,0 +1,43 @@
+<template>
+  <div class="home">
+  </div>
+</template>
+
+<script>
+  // @ is an alias to /src
+
+  import Trend from '@/components/Trend'
+import { WindowsFill } from '@ant-design/icons/lib/dist';
+
+
+  export default {
+    name: 'Index',
+    components: {
+      Trend,
+    },
+    data () {
+      return {
+        targetTime: new Date().getTime() + 3900000
+      }
+    },
+    created(){
+      window.location.href = 'http://172.18.91.12:8888/sso/oauth/authorize?client_id=OAManager&response_type=code&redirect_url=http://172.18.91.36:8083/#/redirect/login'
+    },
+    methods: {
+      
+    }
+  }
+</script>
+
+<style scoped>
+  .home {
+    width: 900px;
+    margin: 0 auto;
+    padding: 25px 0;
+  }
+  .home > .banner {
+    text-align: center;
+    padding: 25px 0;
+    margin: 25px 0;
+  }
+</style>

+ 130 - 0
src/views/Redirect.vue

@@ -0,0 +1,130 @@
+<template>
+  <div class="home">
+  </div>
+</template>
+
+<script>
+  // @ is an alias to /src
+
+  import Trend from '@/components/Trend'
+  import { axios } from '@/utils/request'
+  // import axios from 'axios'
+  import { postAction } from '@/api/manage'
+
+  import { mapActions } from 'vuex'
+  import Vue from 'vue'
+  import { ACCESS_TOKEN, ENCRYPTED_STRING, USER_INFO } from '@/store/mutation-types'
+  import store from '@/store/'
+  import { timeFix } from '@/utils/util'
+
+  export default {
+    name: 'Redirect',
+    components: {
+      Trend,
+    },
+    data () {
+      return {
+        code: ''
+      }
+    },
+    created(){
+      this.getCode();
+    },
+    methods: {
+        ...mapActions(['redirectLogin']),
+      getCode() {
+        
+        var url = window.location.href ;             //获取当前url
+        
+        var dz_url = url.split('#')[0];                //获取#/之前的字符串
+
+        var cs = dz_url.split('?')[1];                //获取?之后的参数字符串
+
+        var cs_arr = cs.split('&');                    //参数字符串分割为数组
+
+        var cs={};
+
+        for(var i=0;i<cs_arr.length;i++){         //遍历数组,拿到json对象
+
+          cs[cs_arr[i].split('=')[0]] = cs_arr[i].split('=')[1]
+
+        }
+
+        this.code = cs.code;
+        this.redirectLogin({'code':this.code}).then(res=>{
+
+          this.departConfirm(res)
+        }).catch(err=>{
+          this.requestFailed(err)
+        })
+        // var params = {
+        //   "client_id":"OAManager",
+        //   "client_secret":"Password123",
+        //   "grant_type":"authorization_code",
+        //   "code":this.code,
+        //   "redirect_uri":"http://localhost:8083/"
+        // }
+        // axios.post("/sso/oauth/token", params)
+      },
+      requestFailed (err) {
+          this.$notification['error']({
+              message: '登录失败',
+              description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
+              duration: 4
+          })
+          this.loginBtn = false
+      },
+      departConfirm (res) {
+          if (res.success) {
+              console.log('用户信息', res)
+              let multi_depart = res.result.multi_depart
+              // 0:无部门 1:一个部门 2:多个部门
+              if (multi_depart == 0) {
+                  this.loginSuccess()
+                  this.$notification.warn({
+                      message: '提示',
+                      // description: `您尚未归属部门,请确认账号信息`,
+                      description: `您尚未归属公司,请确认账号信息`,
+                      duration: 3
+                  })
+              } else {
+                  console.log('登录')
+                  const userInfo = res.result.userInfo
+                  Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
+                  store.commit('SET_INFO', userInfo)
+                  this.loginSuccess()
+              }
+          } else {
+              this.requestFailed(res)
+              setTimeout(()=>{
+                window.location.href="http://172.18.91.12:8888/sso"
+              },3000)
+          }
+      },
+      loginSuccess () {
+          this.$router.push({ name: 'dashboard' })
+          this.$notification.success({
+              message: '欢迎',
+              description: `${timeFix()},欢迎回来`
+          })
+          // this.$store.dispatch('delVisitedViews',this.$route)
+          // this.$router.go(-1)
+          // this.$store.state.tagsView.visitedViews.splice(this.$store.state.tagsView.visitedViews.findIndex(item => item.path === this.$route.path), 1)
+          // this.$router.push(this.$store.state.tagsView.visitedViews[this.$store.state.tagsView.visitedViews.length-1].path)
+      },
+    }
+  }
+</script>
+
+<style scoped>
+  .home {
+    width: 900px;
+    margin: 0 auto;
+    padding: 25px 0;
+  }
+  .home > .banner {
+    text-align: center;
+    padding: 25px 0;
+    margin: 25px 0;
+  }
+</style>

+ 20 - 53
src/views/oa/InventoryRecordsList.vue

@@ -5,33 +5,30 @@
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
 
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="资产类别">
+              <j-dict-select-tag placeholder="请选择资产类别" v-model="queryParam.assetsCategory" dictCode="assets_category"/>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="资产状态">
+              <j-dict-select-tag placeholder="请选择资产状态" v-model="queryParam.assetState" dictCode="assets_status"/>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a-button type="primary" icon="download" @click="handleExportXls('盘点表')" style="margin-left: 8px">导出</a-button>
+            </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>
     <!-- 查询区域-END -->
-    
-    <!-- 操作按钮区域 -->
-    <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('盘点表')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
-        <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
-      </a-dropdown>
-    </div>
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
-        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
-
       <a-table
         ref="table"
         size="middle"
@@ -41,7 +38,6 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{fixed:true,selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         
         @change="handleTableChange">
 
@@ -65,22 +61,6 @@
           </a-button>
         </template>
 
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
       </a-table>
     </div>
 
@@ -92,11 +72,14 @@
 
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
   import InventoryRecordsModal from './modules/InventoryRecordsModal'
+  import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
 
   export default {
     name: "InventoryRecordsList",
     mixins:[JeecgListMixin],
     components: {
+      JDictSelectTag,
       InventoryRecordsModal
     },
     data () {
@@ -114,11 +97,6 @@
               return parseInt(index)+1;
             }
           },
-          {
-            title:'盘点日期',
-            align:"center",
-            dataIndex: 'checkDate'
-          },
           {
             title:'资产编码',
             align:"center",
@@ -154,11 +132,6 @@
             align:"center",
             dataIndex: 'durableYears'
           },
-          {
-            title:'存放地点',
-            align:"center",
-            dataIndex: 'storageLocation'
-          },
           {
             title:'使用人',
             align:"center",
@@ -173,12 +146,6 @@
             title:'资产状态',
             align:"center",
             dataIndex: 'assetState'
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' }
           }
         ],
         url: {

+ 2 - 0
src/views/system/modules/SysAnnouncementModal.vue

@@ -246,6 +246,8 @@ export default {
                     if (this.userType) {
                         formData.userIds = this.userIds
                     }
+                    formData.endTime = formData.endTime+' '+'00:00:00'
+                    formData.startTime = formData.startTime+' '+'00:00:00'
                     console.log(formData)
                     httpAction(httpurl, formData, method).then((res) => {
                         if (res.success) {

+ 1 - 0
url.config.js

@@ -3,6 +3,7 @@ export function getEditorJumpUrl () {
     //let url ="http://106.15.206.14:8089";//测试服务器
     // let url ="http://192.168.1.158:8089";//森宇服务器
     let url = "http://220.191.168.86:18089"; // 森语外网
+    // let url = 'http://172.18.91.36:8082' // 博物馆OA
     return url
   }