Bladeren bron

页面更新

sr 4 jaren geleden
bovenliggende
commit
9e0b4af6d7

+ 2 - 0
ruoyi-ui/src/components/HistoricalProcess/index.vue

@@ -43,6 +43,7 @@ import {
     addGenhistorihistory,
     addGenhistorilisr
   } from "@/api/activiti/definition";
+  import store from "@/store";
 export default {
   name: "HistoricalProcess",
   components: { FormItemComponent, StandardTabletwo, FlowChartShow },
@@ -143,6 +144,7 @@ export default {
         pageSize: 10,
         searchType: "0,1",
         excuStatus: 2,
+        userId: store.getters.userId,
         updateTime: []
       },
 

+ 4 - 3
ruoyi-ui/src/components/todoProcess/index.vue

@@ -64,6 +64,7 @@ import mutipleSelectPop from "../MutipleSelectPop/index.vue";
 import FlowChartShow from "../FlowChartShow";
 // import { mapState } from "vuex";
 // import { mapMutations } from "vuex";
+import store from "@/store";
 import {
     addGendefini,
     addGendefiniqur,
@@ -183,7 +184,7 @@ export default {
         pageSize: 10,
         searchType: "0,1",
         excuStatus: 0,
-        userId: null,
+        userId: store.getters.userId,
         createTime: []
       },
       //表格数据
@@ -376,7 +377,6 @@ export default {
       delete obj.createTime;
       var that = this
       addGendefiniqur(obj).then(res => {
-        console.log(res.resultCode)
         // that.data = res.data.records
         if (res.resultCode === 0) {
           console.log(1)
@@ -427,7 +427,8 @@ export default {
         // this.$Message.warning("请选择转派人员");
         return
       }
-      // sendData.userId = this.userInfo.userId;
+      // console.log(store.getters.userId)
+      // sendData.userId = store.getters.userId;
       addGendefinideal(sendData).then(res => {
         let data = res;
         if (data.resultCode === 0) {

+ 181 - 0
ruoyi-ui/src/router/index.js

@@ -0,0 +1,181 @@
+import Vue from 'vue'
+import Router from 'vue-router'
+
+Vue.use(Router)
+
+/* Layout */
+import Layout from '@/layout'
+import ParentView from '@/components/ParentView';
+
+import approval from '../views/workbench/approval';
+import handled from '../views/workbench/handled';
+import process from '../views/workbench/process';
+console.log(approval,handled,process,12)
+
+/**
+ * Note: 路由配置项
+ *
+ * hidden: true                   // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
+ * alwaysShow: true               // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
+ *                                // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
+ *                                // 若你想不管路由下面的 children 声明的个数都显示你的根路由
+ *                                // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
+ * redirect: noRedirect           // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
+ * name:'router-name'             // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
+ * meta : {
+    noCache: true                // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
+    title: 'title'               // 设置该路由在侧边栏和面包屑中展示的名字
+    icon: 'svg-name'             // 设置该路由的图标,对应路径src/assets/icons/svg
+    breadcrumb: false            // 如果设置为false,则不会在breadcrumb面包屑中显示
+  }
+ */
+
+// 公共路由
+export const constantRoutes = [
+  {
+    path: '/redirect',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: '/redirect/:path(.*)',
+        component: (resolve) => require(['@/views/redirect'], resolve)
+      }
+    ]
+  },
+  {
+    path: '/login',
+    component: (resolve) => require(['@/views/login'], resolve),
+    hidden: true
+  },
+  {
+    path: '/404',
+    component: (resolve) => require(['@/views/error/404'], resolve),
+    hidden: true
+  },
+  {
+    path: '/401',
+    component: (resolve) => require(['@/views/error/401'], resolve),
+    hidden: true
+  },
+  {
+    path: '',
+    component: Layout,
+    redirect: 'index',
+    meta: { title: '首页', icon: '', noCache: true, affix: true },
+    children: [
+      {
+        path: 'index',
+        component: (resolve) => require(['@/views/index'], resolve),
+        name: '首页',
+        meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
+      },
+      {
+        path: 'index/approval',
+        hidden: false,
+        component: approval,
+        name: '待我审批',
+        meta: { title: '待我审批', icon: '', noCache: false},
+      },
+      {
+        path: 'index/handled',
+        hidden: false,
+        component: handled,
+        name: '已办理',
+        meta: { title: '已办理', icon: '', noCache: false},
+      },
+      // {
+      //   path: 'index/process',
+      //   hidden: false,
+      //   component: process,
+      //   name: '我的流程',
+      //   meta: { title: '我的流程', icon: '', noCache: false},
+      // },
+      // {
+      //   path: '',
+      //   name: '流程工作台',
+      //   hidden: false,
+      //   alwaysShow: true,
+      //   meta: { title: '流程工作台', icon: 'spot', noCache: true },
+      //   children: [{
+      //     path: 'index/approval',
+      //     hidden: false,
+      //     component: approval,
+      //     name: '待我审批',
+      //     meta: { title: '待我审批', icon: '', noCache: false},
+      //   },{
+      //     path: 'index/handled',
+      //     hidden: false,
+      //     component: handled,
+      //     name: '已办理',
+      //     meta: { title: '已办理', icon: '', noCache: false},
+      //   }, {
+      //     path: 'index/process',
+      //     hidden: false,
+      //     component: process,
+      //     name: '我的流程',
+      //     meta: { title: '我的流程', icon: '', noCache: false},
+      //   }]
+      // }
+    ]
+  },
+  {
+    path: '/user',
+    component: Layout,
+    hidden: true,
+    redirect: 'noredirect',
+    children: [
+      {
+        path: 'profile',
+        component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
+        name: 'Profile',
+        meta: { title: '个人中心', icon: 'user' }
+      }
+    ]
+  },
+  {
+    path: '/dict',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'type/data/:dictId(\\d+)',
+        component: (resolve) => require(['@/views/system/dict/data'], resolve),
+        name: 'Data',
+        meta: { title: '字典数据', icon: '' }
+      }
+    ]
+  },
+  {
+    path: '/job',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'log',
+        component: (resolve) => require(['@/views/monitor/job/log'], resolve),
+        name: 'JobLog',
+        meta: { title: '调度日志' }
+      }
+    ]
+  },
+  {
+    path: '/gen',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'edit/:tableId(\\d+)',
+        component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
+        name: 'GenEdit',
+        meta: { title: '修改生成配置' }
+      }
+    ]
+  }
+]
+
+export default new Router({
+  mode: 'history', // 去掉url中的#
+  scrollBehavior: () => ({ y: 0 }),
+  routes: constantRoutes
+})

+ 1 - 0
ruoyi-ui/src/store/getters.js

@@ -7,6 +7,7 @@ const getters = {
   token: state => state.user.token,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
+  userId: state => state.user.userId,
   introduction: state => state.user.introduction,
   roles: state => state.user.roles,
   permissions: state => state.user.permissions,

+ 6 - 1
ruoyi-ui/src/store/modules/user.js

@@ -4,7 +4,8 @@ import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
 const user = {
   state: {
     token: getToken(),
-    name: '',
+    name: '',
+    userId: '',
     avatar: '',
     roles: [],
     permissions: [],
@@ -19,6 +20,9 @@ const user = {
     },
     SET_NAME: (state, name) => {
       state.name = name
+    },
+    SET_USERID: (state, id) => {
+      state.userId = id
     },
     SET_AVATAR: (state, avatar) => {
       state.avatar = avatar
@@ -65,6 +69,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_NAME', user.userName)
+          commit('SET_USERID', user.id)
           commit('SET_AVATAR', avatar)
           resolve(res)
         }).catch(error => {

+ 3 - 0
ruoyi-ui/src/views/index.vue

@@ -998,6 +998,9 @@ export default {
           text-align: left;
           flex: 1;
           padding: 0 18px;
+          overflow:hidden;
+          	text-overflow:ellipsis;
+          	white-space:nowrap
         }
         span{
           font-size: 14px;

+ 85 - 0
ruoyi-ui/src/views/workbench/approval/index.vue

@@ -0,0 +1,85 @@
+<template>
+    <div class="InstanceManagementList">
+      <!-- <Breadcrumb separator=">">
+        <BreadcrumbItem  v-if="tabalive==='待办流程'"  @click.native="routeClick(1)">待办流程</BreadcrumbItem>
+        <BreadcrumbItem  v-if="tabalive==='历史流程'"  @click.native="routeClick(2)">历史流程</BreadcrumbItem>
+    </Breadcrumb> -->
+    <!-- <Tabs :value="tabalive" @on-click="onClick"> -->
+        <TabPane label="待办流程" name="待办流程"><todoProcess v-if="tabalive === '待办流程'" :tabalive="tabalive"></todoProcess></TabPane>
+        <!-- <TabPane label="历史流程" name="历史流程"><HistoricalProcess v-if="tabalive === '历史流程'" :tabalive="tabalive"></HistoricalProcess></TabPane> -->
+    <!-- </Tabs> -->
+    </div>
+</template>
+<script>
+import todoProcess from '@/components/todoProcess/index';
+import HistoricalProcess from '@/components/HistoricalProcess';
+// import router from '../config/router.config'
+export default {
+    name:'approval',
+    // todoProcess,
+    components:{todoProcess,HistoricalProcess},
+    data(){
+        return{
+            tabalive:"待办流程",//tab切换默认值
+            tabConfig:[{
+                label:'待办流程',
+                name:'待办流程'
+            },{
+                label:'历史流程',
+                name:'历史流程'
+            }]
+        }
+    },
+    methods:{
+        routeClick(val){
+            if(val === 1){
+                this.tabalive = '待办流程';
+            } else if (val === 2) {
+                this.tabalive = '历史流程';
+            }
+        },
+        //tab切换点击事件
+        onClick(val){
+            this.tabalive=val;
+            if(val==='历史流程'){
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=2");
+            }else{
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=1");
+            }
+
+        },
+    },
+    created(){
+       this.routeClick(1);
+    }
+
+}
+</script>
+<style lang="scss" >
+.InstanceManagementList{
+     background: white;
+     padding: 20px;
+     display: flex;
+     flex-direction: column;
+    .burgeon-breadcrumb{
+        font-size:18px;
+        margin-bottom: 12px;
+    }
+    .burgeon-tabs{
+        flex:1;
+        display: flex;
+       -webkit-box-direction: column;
+        flex-direction: column;
+        .burgeon-tabs-bar{
+            // height: 27px;
+        }
+        .burgeon-tabs-content-animated{
+        flex:1;
+        .burgeon-tabs-tabpane{
+            display: flex;
+        }
+    }
+    }
+
+}
+</style>

+ 85 - 0
ruoyi-ui/src/views/workbench/handled/index.vue

@@ -0,0 +1,85 @@
+<template>
+    <div class="InstanceManagementList">
+      <!-- <Breadcrumb separator=">">
+        <BreadcrumbItem  v-if="tabalive==='待办流程'"  @click.native="routeClick(1)">待办流程</BreadcrumbItem>
+        <BreadcrumbItem  v-if="tabalive==='历史流程'"  @click.native="routeClick(2)">历史流程</BreadcrumbItem>
+    </Breadcrumb> -->
+    <!-- <Tabs :value="tabalive" @on-click="onClick"> -->
+        <!-- <TabPane label="待办流程" name="待办流程"><todoProcess v-if="tabalive === '待办流程'" :tabalive="tabalive"></todoProcess></TabPane> -->
+        <TabPane label="历史流程" name="历史流程"><HistoricalProcess v-if="tabalive === '历史流程'" :tabalive="tabalive"></HistoricalProcess></TabPane>
+    <!-- </Tabs> -->
+    </div>
+</template>
+<script>
+import todoProcess from '@/components/todoProcess/index';
+import HistoricalProcess from '@/components/HistoricalProcess';
+// import router from '../config/router.config'
+export default {
+    name:'handled',
+    // todoProcess,
+    components:{todoProcess,HistoricalProcess},
+    data(){
+        return{
+            tabalive:"历史流程",//tab切换默认值
+            tabConfig:[{
+                label:'待办流程',
+                name:'待办流程'
+            },{
+                label:'历史流程',
+                name:'历史流程'
+            }]
+        }
+    },
+    methods:{
+        routeClick(val){
+            if(val === 1){
+                this.tabalive = '待办流程';
+            } else if (val === 2) {
+                this.tabalive = '历史流程';
+            }
+        },
+        //tab切换点击事件
+        onClick(val){
+            this.tabalive=val;
+            if(val==='历史流程'){
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=2");
+            }else{
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=1");
+            }
+
+        },
+    },
+    created(){
+       this.routeClick(2);
+    }
+
+}
+</script>
+<style lang="scss" >
+.InstanceManagementList{
+     background: white;
+     padding: 20px;
+     display: flex;
+     flex-direction: column;
+    .burgeon-breadcrumb{
+        font-size:18px;
+        margin-bottom: 12px;
+    }
+    .burgeon-tabs{
+        flex:1;
+        display: flex;
+       -webkit-box-direction: column;
+        flex-direction: column;
+        .burgeon-tabs-bar{
+            // height: 27px;
+        }
+        .burgeon-tabs-content-animated{
+        flex:1;
+        .burgeon-tabs-tabpane{
+            display: flex;
+        }
+    }
+    }
+
+}
+</style>

+ 87 - 0
ruoyi-ui/src/views/workbench/process/index.vue

@@ -0,0 +1,87 @@
+<template>
+    <div class="InstanceManagementList">
+      <!-- <Breadcrumb separator=">">
+        <BreadcrumbItem  v-if="tabalive==='待办流程'"  @click.native="routeClick(1)">待办流程</BreadcrumbItem>
+        <BreadcrumbItem  v-if="tabalive==='历史流程'"  @click.native="routeClick(2)">历史流程</BreadcrumbItem>
+    </Breadcrumb> -->
+    <!-- <Tabs :value="tabalive" @on-click="onClick"> -->
+        <!-- <TabPane label="待办流程" name="待办流程"><todoProcess v-if="tabalive === '待办流程'" :tabalive="tabalive"></todoProcess></TabPane> -->
+        <TabPane label="历史流程" name="历史流程"><HistoricalProcess v-if="tabalive === '历史流程'" :tabalive="tabalive"></HistoricalProcess></TabPane>
+    <!-- </Tabs> -->
+    </div>
+</template>
+<script>
+import todoProcess from '@/components/todoProcess/index';
+import HistoricalProcess from '@/components/HistoricalProcess';
+// import router from '../config/router.config'
+export default {
+    name:'process',
+    // todoProcess,
+    components:{todoProcess,HistoricalProcess},
+    data(){
+        return{
+            tabalive:"历史流程",//tab切换默认值
+            tabConfig:[{
+                label:'待办流程',
+                name:'待办流程'
+            },{
+                label:'历史流程',
+                name:'历史流程'
+            }]
+        }
+    },
+    methods:{
+        routeClick(val){
+            if(val === 1){
+                this.tabalive = '待办流程';
+            } else if (val === 2) {
+                this.tabalive = '历史流程';
+            }
+        },
+        //tab切换点击事件
+        onClick(val){
+            this.tabalive=val;
+            if(val==='历史流程'){
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=2");
+            }else{
+             window.history.replaceState({}, '', "/#/InstanceManagementList?type=1");
+            }
+
+        },
+    },
+    created(){
+       this.routeClick(2);
+
+
+    }
+
+}
+</script>
+<style lang="scss" >
+.InstanceManagementList{
+     background: white;
+     padding: 20px;
+     display: flex;
+     flex-direction: column;
+    .burgeon-breadcrumb{
+        font-size:18px;
+        margin-bottom: 12px;
+    }
+    .burgeon-tabs{
+        flex:1;
+        display: flex;
+       -webkit-box-direction: column;
+        flex-direction: column;
+        .burgeon-tabs-bar{
+            // height: 27px;
+        }
+        .burgeon-tabs-content-animated{
+        flex:1;
+        .burgeon-tabs-tabpane{
+            display: flex;
+        }
+    }
+    }
+
+}
+</style>