Browse Source

tabs 切换数据基本完成

liangyan0105 3 years ago
parent
commit
6e76b99dfc

+ 97 - 97
src/api/manage.js

@@ -1,116 +1,116 @@
 import { axios } from '@/utils/request'
 
 const api = {
-  user: '/api/user',
-  role: '/api/role',
-  service: '/api/service',
-  permission: '/api/permission',
-  permissionNoPager: '/api/permission/no-pager'
+    user: '/api/user',
+    role: '/api/role',
+    service: '/api/service',
+    permission: '/api/permission',
+    permissionNoPager: '/api/permission/no-pager'
 }
 
 export default api
 
-//post
-export function postAction(url,parameter) {
-  return axios({
-    url: url,
-    method:'post' ,
-    data: parameter
-  })
+// post
+export function postAction (url, parameter) {
+    return axios({
+        url: url,
+        method: 'post',
+        data: parameter
+    })
 }
-//post
-export function postFormAction(url,parameter) {
-  return axios({
-    url: url,
-    method:'post' ,
-    params: parameter
-  })
+// post
+export function postFormAction (url, parameter) {
+    return axios({
+        url: url,
+        method: 'post',
+        params: parameter
+    })
 }
-//post:data
-export function postFormAction2(url,parameter) {
-  return axios({
-    url: url,
-    method:'post' ,
-    data: parameter
-  })
+// post:data
+export function postFormAction2 (url, parameter) {
+    return axios({
+        url: url,
+        method: 'post',
+        data: parameter
+    })
 }
 
-//post method= {post | put}
-export function httpAction(url,parameter,method) {
-  return axios({
-    url: url,
-    method:method ,
-    data: parameter
-  })
+// post method= {post | put}
+export function httpAction (url, parameter, method) {
+    return axios({
+        url: url,
+        method: method,
+        data: parameter
+    })
 }
 
-//put
-export function putAction(url,parameter) {
-  return axios({
-    url: url,
-    method:'put',
-    data: parameter
-  })
+// put
+export function putAction (url, parameter) {
+    return axios({
+        url: url,
+        method: 'put',
+        data: parameter
+    })
 }
 
-//get
-export function getAction(url,parameter) {
-  return axios({
-    url: url,
-    method: 'get',
-    params: parameter
-  })
+// get
+export function getAction (url, parameter) {
+    return axios({
+        url: url,
+        method: 'get',
+        params: parameter
+    })
 }
 
-//deleteAction
-export function deleteAction(url,parameter) {
-  return axios({
-    url: url,
-    method: 'delete',
-    params: parameter
-  })
+// deleteAction
+export function deleteAction (url, parameter) {
+    return axios({
+        url: url,
+        method: 'delete',
+        params: parameter
+    })
 }
 
-export function getUserList(parameter) {
-  return axios({
-    url: api.user,
-    method: 'get',
-    params: parameter
-  })
+export function getUserList (parameter) {
+    return axios({
+        url: api.user,
+        method: 'get',
+        params: parameter
+    })
 }
 
-export function getRoleList(parameter) {
-  return axios({
-    url: api.role,
-    method: 'get',
-    params: parameter
-  })
+export function getRoleList (parameter) {
+    return axios({
+        url: api.role,
+        method: 'get',
+        params: parameter
+    })
 }
 
-export function getServiceList(parameter) {
-  return axios({
-    url: api.service,
-    method: 'get',
-    params: parameter
-  })
+export function getServiceList (parameter) {
+    return axios({
+        url: api.service,
+        method: 'get',
+        params: parameter
+    })
 }
 
-export function getPermissions(parameter) {
-  return axios({
-    url: api.permissionNoPager,
-    method: 'get',
-    params: parameter
-  })
+export function getPermissions (parameter) {
+    return axios({
+        url: api.permissionNoPager,
+        method: 'get',
+        params: parameter
+    })
 }
 
 // id == 0 add     post
 // id != 0 update  put
-export function saveService(parameter) {
-  return axios({
-    url: api.service,
-    method: parameter.id == 0 ? 'post' : 'put',
-    data: parameter
-  })
+export function saveService (parameter) {
+    return axios({
+        url: api.service,
+        method: parameter.id == 0 ? 'post' : 'put',
+        data: parameter
+    })
 }
 
 /**
@@ -119,13 +119,13 @@ export function saveService(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function downFile(url,parameter){
-  return axios({
-    url: url,
-    params: parameter,
-    method:'get' ,
-    responseType: 'blob'
-  })
+export function downFile (url, parameter) {
+    return axios({
+        url: url,
+        params: parameter,
+        method: 'get',
+        responseType: 'blob'
+    })
 }
 
 /**
@@ -135,10 +135,10 @@ export function downFile(url,parameter){
  * @param str
  * @returns {*}
  */
-export function getFileAccessHttpUrl(avatar,imgerver,subStr) {
-  if(avatar && avatar.indexOf(subStr) != -1 ){
-    return avatar;
-  }else{
-    return imgerver + "/" + avatar;
-  }
+export function getFileAccessHttpUrl (avatar, imgerver, subStr) {
+    if (avatar && avatar.indexOf(subStr) != -1) {
+        return avatar
+    } else {
+        return imgerver + '/' + avatar
+    }
 }

+ 76 - 75
src/components/page/GlobalLayout.vue

@@ -29,6 +29,7 @@
         :collapsed="collapsed"
         :collapsible="true"></side-menu>
     </template>
+
     <!-- 下次优化这些代码 -->
     <template v-else>
       <a-drawer
@@ -81,96 +82,96 @@
 </template>
 
 <script>
-  import SideMenu from '@/components/menu/SideMenu'
-  import GlobalHeader from '@/components/page/GlobalHeader'
-  import GlobalFooter from '@/components/page/GlobalFooter'
-  // update-start---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
-  // import SettingDrawer from '@/components/setting/SettingDrawer'
-  // 注释这个因为在个人设置模块已经加载了SettingDrawer页面
-  // update-end ---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
-
-  import { triggerWindowResizeEvent } from '@/utils/util'
-  import { mapState, mapActions } from 'vuex'
-  import { mixin, mixinDevice } from '@/utils/mixin.js'
-
-  export default {
+import SideMenu from '@/components/menu/SideMenu'
+import GlobalHeader from '@/components/page/GlobalHeader'
+import GlobalFooter from '@/components/page/GlobalFooter'
+// update-start---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
+// import SettingDrawer from '@/components/setting/SettingDrawer'
+// 注释这个因为在个人设置模块已经加载了SettingDrawer页面
+// update-end ---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
+
+import { triggerWindowResizeEvent } from '@/utils/util'
+import { mapState, mapActions } from 'vuex'
+import { mixin, mixinDevice } from '@/utils/mixin.js'
+
+export default {
     name: 'GlobalLayout',
     components: {
-      SideMenu,
-      GlobalHeader,
-      GlobalFooter,
-      // update-start---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
-      // // SettingDrawer
-      // 注释这个因为在个人设置模块已经加载了SettingDrawer页面
-      // update-end ---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
+        SideMenu,
+        GlobalHeader,
+        GlobalFooter
+        // update-start---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
+        // // SettingDrawer
+        // 注释这个因为在个人设置模块已经加载了SettingDrawer页面
+        // update-end ---- author:os_chengtgen -- date:20190830 --  for:issues/463 -编译主题颜色已生效,但还一直转圈,显示主题 正在编译 ------
 
     },
     mixins: [mixin, mixinDevice],
-    data() {
-      return {
-        collapsed: false,
-        activeMenu:{},
-        menus: []
-      }
+    data () {
+        return {
+            collapsed: false,
+            activeMenu: {},
+            menus: []
+        }
     },
     computed: {
-      ...mapState({
+        ...mapState({
         // 主路由
-        mainRouters: state => state.permission.addRouters,
-        // 后台菜单
-        permissionMenuList: state => state.user.permissionList
-      })
+            mainRouters: state => state.permission.addRouters,
+            // 后台菜单
+            permissionMenuList: state => state.user.permissionList
+        })
     },
     watch: {
-      sidebarOpened(val) {
-        this.collapsed = !val
-      }
+        sidebarOpened (val) {
+            this.collapsed = !val
+        }
     },
-    created() {
-      //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-      //this.menus = this.mainRouters.find((item) => item.path === '/').children;
-      this.menus = this.permissionMenuList
-      // 根据后台配置菜单,重新排序加载路由信息
-      console.log('----加载菜单逻辑----')
-      console.log(this.mainRouters)
-      console.log(this.permissionMenuList)
-      console.log('----navTheme------'+this.navTheme)
-      //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+    created () {
+        // --update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+        // this.menus = this.mainRouters.find((item) => item.path === '/').children;
+        this.menus = this.permissionMenuList
+        // 根据后台配置菜单,重新排序加载路由信息
+        console.log('----加载菜单逻辑----')
+        console.log(this.mainRouters)
+        console.log(this.permissionMenuList)
+        console.log('----navTheme------' + this.navTheme)
+        // --update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
     },
     methods: {
-      ...mapActions(['setSidebar']),
-      toggle() {
-        this.collapsed = !this.collapsed
-        this.setSidebar(!this.collapsed)
-        triggerWindowResizeEvent()
-      },
-      menuSelect() {
-        if (!this.isDesktop()) {
-          this.collapsed = false
-        }
-      },
-      //update-begin-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
-      myMenuSelect(value){
-        //此处触发动态路由被点击事件
-        this.findMenuBykey(this.menus,value.key)
-        this.$emit("dynamicRouterShow",value.key,this.activeMenu.meta.title)
-        // update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
-        let storeKey = 'route:title:' + this.activeMenu.path
-        this.$ls.set(storeKey, this.activeMenu.meta.title)
+        ...mapActions(['setSidebar']),
+        toggle () {
+            this.collapsed = !this.collapsed
+            this.setSidebar(!this.collapsed)
+            triggerWindowResizeEvent()
+        },
+        menuSelect () {
+            if (!this.isDesktop()) {
+                this.collapsed = false
+            }
+        },
+        // update-begin-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
+        myMenuSelect (value) {
+        // 此处触发动态路由被点击事件
+            this.findMenuBykey(this.menus, value.key)
+            this.$emit('dynamicRouterShow', value.key, this.activeMenu.meta.title)
+            // update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
+            let storeKey = 'route:title:' + this.activeMenu.path
+            this.$ls.set(storeKey, this.activeMenu.meta.title)
         // update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
-      },
-      findMenuBykey(menus,key){
-        for(let i of menus){
-          if(i.path==key){
-            this.activeMenu = {...i}
-          }else if(i.children && i.children.length>0){
-            this.findMenuBykey(i.children,key)
-          }
+        },
+        findMenuBykey (menus, key) {
+            for (let i of menus) {
+                if (i.path == key) {
+                    this.activeMenu = { ...i }
+                } else if (i.children && i.children.length > 0) {
+                    this.findMenuBykey(i.children, key)
+                }
+            }
         }
-      }
-      //update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
+        // update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
     }
-  }
+}
 
 </script>
 
@@ -679,4 +680,4 @@
       }
     }
   }
-</style>
+</style>

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

@@ -144,7 +144,7 @@ const user = {
                                 }
                             })
                             console.log(' menu show json ', menuData)
-                            console.log('我在这')
+                            console.log('上面是显示菜单')
                             // update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
                             commit('SET_PERMISSIONLIST', menuData)
                         } else {

+ 87 - 87
src/utils/request.js

@@ -2,114 +2,114 @@ import Vue from 'vue'
 import axios from 'axios'
 import store from '@/store'
 import { VueAxios } from './axios'
-import {Modal, notification} from 'ant-design-vue'
-import { ACCESS_TOKEN } from "@/store/mutation-types"
+import { Modal, notification } from 'ant-design-vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
 
-//自动设置后台服务 baseURL (也可以手工指定写死项目名字)
-let baseDomain = window._CONFIG['domianURL'];
-let baseProject = baseDomain.substring(baseDomain.lastIndexOf("/"));
-console.log("baseDomain= ",baseDomain)
-console.log("baseProject= ",baseProject)
+// 自动设置后台服务 baseURL (也可以手工指定写死项目名字)
+let baseDomain = window._CONFIG['domianURL']
+let baseProject = baseDomain.substring(baseDomain.lastIndexOf('/'))
+console.log('baseDomain= ', baseDomain)
+console.log('baseProject= ', baseProject)
 
 // 创建 axios 实例
 const service = axios.create({
-  //baseURL: '/jeecg-boot',
-  baseURL: baseProject, // api base_url
-  timeout: 9000 // 请求超时时间
+    // baseURL: '/jeecg-boot',
+    baseURL: baseProject, // api base_url
+    timeout: 9000 // 请求超时时间
 })
 
 const err = (error) => {
-  if (error.response) {
-    let data = error.response.data
-    const token = Vue.ls.get(ACCESS_TOKEN)
-    console.log("------异常响应------",token)
-    console.log("------异常响应------",error.response.status)
-    switch (error.response.status) {
-      case 403:
-        notification.error({ message: '系统提示', description: '拒绝访问',duration: 4})
-        break
-      case 500:
-        //notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4})
-        if(token && data.message=="Token失效,请重新登录"){
-          // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
-          // store.dispatch('Logout').then(() => {
-          //     window.location.reload()
-          // })
-          Modal.error({
-            title: '登录已过期',
-            content: '很抱歉,登录已过期,请重新登录',
-            okText: '重新登录',
-            mask: false,
-            onOk: () => {
-              store.dispatch('Logout').then(() => {
-                Vue.ls.remove(ACCESS_TOKEN)
-                window.location.reload()
-              })
+    if (error.response) {
+        let data = error.response.data
+        const token = Vue.ls.get(ACCESS_TOKEN)
+        console.log('------异常响应------', token)
+        console.log('------异常响应------', error.response.status)
+        switch (error.response.status) {
+        case 403:
+            notification.error({ message: '系统提示', description: '拒绝访问', duration: 4 })
+            break
+        case 500:
+        // notification.error({ message: '系统提示', description:'Token失效,请重新登录!',duration: 4})
+            if (token && data.message == 'Token失效,请重新登录') {
+                // update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
+                // store.dispatch('Logout').then(() => {
+                //     window.location.reload()
+                // })
+                Modal.error({
+                    title: '登录已过期',
+                    content: '很抱歉,登录已过期,请重新登录',
+                    okText: '重新登录',
+                    mask: false,
+                    onOk: () => {
+                        store.dispatch('Logout').then(() => {
+                            Vue.ls.remove(ACCESS_TOKEN)
+                            window.location.reload()
+                        })
+                    }
+                })
+                // update-end- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
             }
-          })
-          // update-end- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式,不直接跳转----
-        }
-        break
-      case 404:
-          notification.error({ message: '系统提示', description:'很抱歉,资源未找到!',duration: 4})
-        break
-      case 504:
-        notification.error({ message: '系统提示', description: '网络超时'})
-        break
-      case 401:
-        notification.error({ message: '系统提示', description:'未授权,请重新登录',duration: 4})
-        if (token) {
-          store.dispatch('Logout').then(() => {
-            setTimeout(() => {
-              window.location.reload()
-            }, 1500)
-          })
+            break
+        case 404:
+            notification.error({ message: '系统提示', description: '很抱歉,资源未找到!', duration: 4 })
+            break
+        case 504:
+            notification.error({ message: '系统提示', description: '网络超时' })
+            break
+        case 401:
+            notification.error({ message: '系统提示', description: '未授权,请重新登录', duration: 4 })
+            if (token) {
+                store.dispatch('Logout').then(() => {
+                    setTimeout(() => {
+                        window.location.reload()
+                    }, 1500)
+                })
+            }
+            break
+        default:
+            notification.error({
+                message: '系统提示',
+                description: data.message,
+                duration: 4
+            })
+            break
         }
-        break
-      default:
-        notification.error({
-          message: '系统提示',
-          description: data.message,
-          duration: 4
-        })
-        break
     }
-  }
-  return Promise.reject(error)
-};
+    return Promise.reject(error)
+}
 
 // request interceptor
 service.interceptors.request.use(config => {
-  const token = Vue.ls.get(ACCESS_TOKEN)
-  if (token) {
-    config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
-  }
-  if(config.method=='get'){
-    if(config.url.indexOf("sys/dict/getDictItems")<0){
-      config.params = {
-        _t: Date.parse(new Date())/1000,
-        ...config.params
-      }
+    const token = Vue.ls.get(ACCESS_TOKEN)
+    if (token) {
+        config.headers[ 'X-Access-Token' ] = token // 让每个请求携带自定义 token 请根据实际情况自行修改
     }
-  }
-  return config
-},(error) => {
-  return Promise.reject(error)
+    if (config.method == 'get') {
+        if (config.url.indexOf('sys/dict/getDictItems') < 0) {
+            config.params = {
+                _t: Date.parse(new Date()) / 1000,
+                ...config.params
+            }
+        }
+    }
+    return config
+}, (error) => {
+    return Promise.reject(error)
 })
 
 // response interceptor
 service.interceptors.response.use((response) => {
     return response.data
-  }, err)
+}, err)
 
 const installer = {
-  vm: {},
-  install (Vue, router = {}) {
-    Vue.use(VueAxios, router, service)
-  }
+    vm: {},
+    install (Vue, router = {}) {
+        Vue.use(VueAxios, router, service)
+    }
 }
 
 export {
-  installer as VueAxios,
-  service as axios
-}
+    installer as VueAxios,
+    service as axios
+}

+ 251 - 235
src/views/activiti/ModelList.vue

@@ -26,13 +26,13 @@
 
           <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
             <a-col :md="6" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
-                <a-button type="primary"  @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
+              <a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
             </a-col>
           </span>
           <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
             <a-col :md="12" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="createObj.visible=true" icon="search">创建流程模型</a-button>
+              <a-button type="primary" style="left: 10px" @click="createObj.visible=true" icon="search">创建流程模型</a-button>
             </a-col>
           </span>
 
@@ -41,7 +41,9 @@
     </div>
 
     <!-- table区域-begin -->
-    <a-table :scroll="{x:1280,y:innerHeight/2}" bordered
+    <a-table
+      :scroll="{x:1280,y:innerHeight/2}"
+      bordered
       ref="table"
       size="middle"
       rowKey="id"
@@ -51,15 +53,15 @@
       :loading="loading"
       @change="handleTableChange">
       <span slot="revision" slot-scope="text, record">
-        v.{{text}}
+        v.{{ text }}
       </span>
       <span slot="metaInfo" slot-scope="text, record">
         <j-ellipsis :value="JSON.parse(text).description" :length="10"/>
       </span>
       <!-- 字符串超长截取省略号显示-->
       <span slot="logContent" slot-scope="text, record">
-          <j-ellipsis :value="text" :length="10"/>
-        </span>
+        <j-ellipsis :value="text" :length="10"/>
+      </span>
       <span slot="make" slot-scope="text, record">
         <a href="javascript:void(0);" @click="deployment(record)" >发布</a>
         <a-divider type="vertical" />
@@ -96,258 +98,272 @@
     <a-modal
       title="设计模型"
       :visible="updateObj.visible"
-      :footer="null" :maskClosable="false"
+      :footer="null"
+      :maskClosable="false"
       width="90%"
       @cancel="cancelUpdate"
       style="top: 20px;"
     >
-      <iframe  :src="iframUrl" frameborder="0" width="100%" height="800px" scrolling="auto" style="background-color: #fff;"></iframe>
+      <iframe
+        :src="iframUrl"
+        frameborder="0"
+        width="100%"
+        height="800px"
+        scrolling="auto"
+        style="background-color: #fff;"></iframe>
     </a-modal>
   </a-card>
 
 </template>
 
 <script>
-  import { filterObj } from '@/utils/util';
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import JEllipsis from '@/components/jeecg/JEllipsis'
-  import { deleteAction, getAction,downFile } from '@/api/manage'
+import { filterObj } from '@/utils/util'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import { deleteAction, getAction, downFile } from '@/api/manage'
 
-  export default {
-    name: "ModelList",
-    mixins:[JeecgListMixin],
+export default {
+    name: 'ModelList',
+    mixins: [JeecgListMixin],
     components: {
-      JEllipsis
+        JEllipsis
     },
     data () {
-      return {
-        /*流程设计器连接*/
-        iframUrl:"",
-        /*新增流程框参数*/
-        createObj:{
-          visible: false,
-          confirmLoading: false,
+        return {
+        /* 流程设计器连接 */
+            iframUrl: '',
+            /* 新增流程框参数 */
+            createObj: {
+                visible: false,
+                confirmLoading: false
+            },
+            /* 设计流程框参数 */
+            updateObj: {
+                visible: false,
+                confirmLoading: false
+            },
+
+            description: '这是流程模型列表页面',
+            // 查询条件
+            queryParam: {
+                createTimeRange: [],
+                keyWord: ''
+            },
+            tabKey: '1',
+            // 表头
+            columns: [
+                {
+                    title: '#',
+                    width: 50,
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    align: 'center',
+                    customRender: function (t, r, index) {
+                        return parseInt(index) + 1
+                    }
+                },
+                {
+                    title: '模型id',
+                    width: 150,
+                    align: 'center',
+                    dataIndex: 'id'
+                },
+                {
+                    title: '模型名称',
+                    width: 150,
+                    align: 'center',
+                    dataIndex: 'name',
+                    scopedSlots: { customRender: 'logContent' }
+                },
+                {
+                    title: '模型key',
+                    width: 150,
+                    dataIndex: 'key',
+                    align: 'center'
+                },
+                {
+                    title: '版本',
+                    width: 80,
+                    dataIndex: 'revision',
+                    align: 'center',
+                    scopedSlots: { customRender: 'revision' }
+                },
+                {
+                    title: '备注描述',
+                    width: 150,
+                    dataIndex: 'metaInfo',
+                    align: 'center',
+                    scopedSlots: { customRender: 'metaInfo' }
+                },
+                {
+                    title: '创建时间',
+                    width: 150,
+                    dataIndex: 'createTime',
+                    align: 'center'
+                    // sorter:true
+                },
+                {
+                    title: '最后更新时间',
+                    width: 150,
+                    dataIndex: 'lastUpdateTime',
+                    align: 'center'
+                },
+                {
+                    title: '操作',
+                    width: 250,
+                    dataIndex: '',
+                    scopedSlots: { customRender: 'make' },
+                    align: 'center'
+                }
+            ],
+            labelCol: {
+                xs: { span: 1 },
+                sm: { span: 2 }
+            },
+            wrapperCol: {
+                xs: { span: 10 },
+                sm: { span: 16 }
+            },
+            url: {
+                list: '/activiti/models/modelListData',
+                delete: '/activiti/models/delete/',
+                deployment: '/activiti/models/deployment/',
+                create: '/activiti/models/create',
+                update: '/activiti/modeler.html?modelId='
+            }
+        }
+    },
+    methods: {
+        /* 创建流程 */
+        createObjOk (e) {
+            this.createObj.confirmLoading = true
+            this.updateObj.visible = true
+            this.iframUrl = `${this.doMian}${this.url.create}?name=${this.createObj.name || ''}&key=${this.createObj.key || ''}&description=${this.createObj.description || ''}`
+            this.createObj.visible = false
+            this.createObj.confirmLoading = false
         },
-        /*设计流程框参数*/
-        updateObj:{
-          visible: false,
-          confirmLoading: false,
+        /* 修改流程 */
+        updatelc (id) {
+            var _this = this
+            this.$message
+                .loading('稍等。。。', 0.8)
+                .then(() => {
+                    _this.createObj.confirmLoading = true
+                    _this.iframUrl = `${_this.doMian}${_this.url.update}${id}`
+                    _this.updateObj.visible = true
+                    _this.createObj.confirmLoading = false
+                })
         },
-
-        description: '这是流程模型列表页面',
-        // 查询条件
-        queryParam: {
-          createTimeRange:[],
-          keyWord:'',
+        cancelUpdate () {
+            var _this = this
+            this.$confirm({
+                title: '关闭前请确认已保存修改?',
+                content: '关闭后未保存的修改将丢失!',
+                okText: '确认关闭',
+                okType: 'danger',
+                cancelText: '再看看',
+                onOk () {
+                    _this.updateObj.visible = false
+                    _this.loadData()
+                },
+                onCancel () {
+                    console.log('Cancel')
+                }
+            })
+        },
+        /* 发布流程 */
+        deployment (row) {
+            var _this = this
+            var id = row.id
+            var name = row.name
+            this.$confirm({
+                title: '确认部署流程?',
+                content: `确认部署流程:${name}`,
+                onOk () {
+                    getAction(_this.url.deployment + id).then((res) => {
+                        if (res.success) {
+                            _this.$message.success(res.message)
+                        } else {
+                            _this.$message.error(res.message)
+                        }
+                        this.loadData()
+                    })
+                },
+                onCancel () {}
+            })
+        },
+        /* 删除模型 */
+        deletelc (y, row) {
+            console.log(y, row)
+            if (y) {
+                getAction(this.url.delete + row.id).then((res) => {
+                    if (res.success) {
+                        this.$message.success(res.message)
+                    } else {
+                        this.$message.error(res.message)
+                    }
+                    this.loadData()
+                })
+            }
         },
-        tabKey: "1",
-        // 表头
-        columns: [
-          {
-            title: '#', width:50,
-            dataIndex: '',
-            key:'rowIndex',
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
+        handleTableChange (pagination, filters, sorter) {
+        // 分页、排序、筛选变化时触发
+        // TODO 筛选
+            if (Object.keys(sorter).length > 0) {
+                this.isorter.column = sorter.field
+                this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
             }
-          },
-          {
-            title: '模型id', width:150,
-            align:"center",
-            dataIndex: 'id',
-          },
-          {
-            title: '模型名称', width:150,
-            align:"center",
-            dataIndex: 'name',
-            scopedSlots: { customRender: 'logContent' },
-          },
-          {
-            title: '模型key', width:150,
-            dataIndex: 'key',
-            align:"center",
-          },
-          {
-            title: '版本', width:80,
-            dataIndex: 'revision',
-            align:"center",
-            scopedSlots: { customRender: 'revision' },
-          },
-          {
-            title: '备注描述', width:150,
-            dataIndex: 'metaInfo',
-            align:"center",
-            scopedSlots: { customRender: 'metaInfo' },
-          },
-          {
-            title: '创建时间', width:150,
-            dataIndex: 'createTime',
-            align:"center",
-            // sorter:true
-          },
-          {
-            title: '最后更新时间', width:150,
-            dataIndex: 'lastUpdateTime',
-            align:"center",
-          },
-          {
-            title: '操作',width:250,
-            dataIndex: '',
-            scopedSlots: { customRender: 'make' },
-            align:"center",
-          }
-        ],
-        labelCol: {
-          xs: { span: 1 },
-          sm: { span: 2 },
+            this.ipagination = pagination
+        // this.loadData();
         },
-        wrapperCol: {
-          xs: { span: 10 },
-          sm: { span: 16 },
+        loadData (arg) {
+            if (!this.url.list) {
+                this.$message.error('请设置url.list属性!')
+                return
+            }
+            // 加载数据 若传入参数1则加载第一页的内容
+            if (arg === 1) {
+                this.ipagination.current = 1
+            }
+            var params = this.getQueryParams()// 查询条件
+            this.loading = true
+            getAction(this.url.list, params).then((res) => {
+                if (res.success) {
+                    let records = res.result || []
+                    this.dataSource = records
+                    this.ipagination.total = records.length
+                }
+                if (res.code === 510) {
+                    this.$message.warning(res.message)
+                }
+                this.loading = false
+            })
         },
-        url: {
-          list: "/activiti/models/modelListData",
-          delete: "/activiti/models/delete/",
-          deployment: "/activiti/models/deployment/",
-          create: "/activiti/models/create",
-          update: "/activiti/modeler.html?modelId=",
+        getQueryParams () {
+            var param = Object.assign({}, this.queryParam, this.isorter)
+            delete param.createTimeRange // 时间参数不传递后台
+            return filterObj(param)
         },
-      }
-    },
-    methods: {
-      /*创建流程*/
-      createObjOk(e) {
-        this.createObj.confirmLoading = true;
-        this.updateObj.visible = true;
-        this.iframUrl = `${this.doMian}${this.url.create}?name=${this.createObj.name||""}&key=${this.createObj.key||""}&description=${this.createObj.description||""}`
-        this.createObj.visible = false;
-        this.createObj.confirmLoading = false;
-      },
-      /*修改流程*/
-      updatelc(id){
-        var _this = this;
-        this.$message
-          .loading('稍等。。。', 0.8)
-          .then(() => {
-            _this.createObj.confirmLoading = true;
-            _this.iframUrl = `${_this.doMian}${_this.url.update}${id}`;
-            _this.updateObj.visible = true;
-            _this.createObj.confirmLoading = false;
-          })
-      },
-      cancelUpdate(){
-        var _this = this;
-        this.$confirm({
-          title: '关闭前请确认已保存修改?',
-          content: '关闭后未保存的修改将丢失!',
-          okText: '确认关闭',
-          okType: 'danger',
-          cancelText: '再看看',
-          onOk() {
-            _this.updateObj.visible = false;
-            _this.loadData();
-          },
-          onCancel() {
-            console.log('Cancel');
-          },
-        });
 
-      },
-      /*发布流程*/
-      deployment(row){
-        var _this = this;
-        var id = row.id;
-        var name = row.name;
-        this.$confirm({
-          title: '确认部署流程?',
-          content: `确认部署流程:${name}`,
-          onOk() {
-            getAction(_this.url.deployment+id).then((res) => {
-              if (res.success){
-                _this.$message.success(res.message);
-              }else {
-                _this.$message.error(res.message);
-              }
-              this.loadData();
-            });
-          },
-          onCancel() {},
-        });
-
-      },
-      /*删除模型*/
-      deletelc(y,row) {
-        console.log(y,row);
-        if (y){
-          getAction(this.url.delete+row.id).then((res) => {
-            if (res.success){
-              this.$message.success(res.message);
-            }else {
-              this.$message.error(res.message);
-            }
-            this.loadData();
-          });
-        }
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        //TODO 筛选
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
-        }
-        this.ipagination = pagination;
-        // this.loadData();
-      },
-      loadData(arg) {
-        if(!this.url.list){
-          this.$message.error("请设置url.list属性!")
-          return
-        }
-        //加载数据 若传入参数1则加载第一页的内容
-        if (arg === 1) {
-          this.ipagination.current = 1;
+        // 重置
+        searchReset () {
+            var that = this
+            var logType = that.queryParam.logType
+            that.queryParam = {} // 清空查询区域参数
+            that.queryParam.logType = logType
+            that.loadData(this.ipagination.current)
+        },
+        onDateChange: function (value, dateString) {
+            console.log(dateString[0], dateString[1])
+            this.queryParam.createTime_begin = dateString[0]
+            this.queryParam.createTime_end = dateString[1]
+        },
+        onDateOk (value) {
+            console.log(value)
         }
-        var params = this.getQueryParams();//查询条件
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            let records = res.result||[];
-            this.dataSource = records;
-            this.ipagination.total = records.length;
-          }
-          if(res.code===510){
-            this.$message.warning(res.message)
-          }
-          this.loading = false;
-        })
-      },
-      getQueryParams(){
-        var param = Object.assign({}, this.queryParam,this.isorter);
-        delete param.createTimeRange; // 时间参数不传递后台
-        return filterObj(param);
-      },
-
-      // 重置
-      searchReset(){
-        var that = this;
-        var logType = that.queryParam.logType;
-        that.queryParam = {}; //清空查询区域参数
-        that.queryParam.logType = logType;
-        that.loadData(this.ipagination.current);
-      },
-      onDateChange: function (value, dateString) {
-        console.log(dateString[0],dateString[1]);
-        this.queryParam.createTime_begin=dateString[0];
-        this.queryParam.createTime_end=dateString[1];
-      },
-      onDateOk(value) {
-        console.log(value);
-      },
     }
-  }
+}
 </script>
 <style scoped>
   @import '~@assets/less/common.less';
-</style>
+</style>

+ 555 - 474
src/views/activiti/applyList.vue

@@ -11,7 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="8">
             <a-form-item label="状态">
-              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true" >
+              <a-select v-model="queryParam.status" placeholder="请选择" :allowClear="true">
                 <a-select-option value="0">草稿</a-select-option>
                 <a-select-option value="1">处理中</a-select-option>
                 <a-select-option value="2">已结束</a-select-option>
@@ -21,7 +21,7 @@
           </a-col>
           <a-col :md="6" :sm="8">
             <a-form-item label="结果">
-              <a-select v-model="queryParam.result" placeholder="请选择" :allowClear="true" >
+              <a-select v-model="queryParam.result" placeholder="请选择" :allowClear="true">
                 <a-select-option value="0">未提交</a-select-option>
                 <a-select-option value="1">处理中</a-select-option>
                 <a-select-option value="2">通过</a-select-option>
@@ -43,88 +43,108 @@
           </a-col>
 
           <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="6" :sm="12" >
-                <a-button type="primary"  style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
-                <a-button type="primary"  @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px">重置</a-button>
+            <a-col :md="6" :sm="12">
+              <a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px;left: 10px"
+                >重置</a-button
+              >
             </a-col>
           </span>
           <span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
-            <a-col :md="12" :sm="12" >
-                <a-button type="primary" @click="addApply" :loading="addApplyLoading" style="left: 10px"  icon="plus-circle">发起申请</a-button>
+            <a-col :md="12" :sm="12">
+              <a-button
+                type="primary"
+                @click="addApply"
+                :loading="addApplyLoading"
+                style="left: 10px"
+                icon="plus-circle"
+                >发起申请</a-button
+              >
             </a-col>
           </span>
-
         </a-row>
       </a-form>
     </div>
 
     <!-- table区域-begin -->
-    <a-table :scroll="scroll" bordered
+    <a-table
+      :scroll="scroll"
+      bordered
       ref="table"
       size="small"
       rowKey="id"
       :dataSource="dataSource"
       :pagination="ipagination"
       :loading="loading"
-      @change="handleTableChange">
-      <a-table-column title="#"  :width="50">
-        <template slot-scope="t,r,i" >
-          <span> {{i+1}} </span>
+      @change="handleTableChange"
+    >
+      <a-table-column title="#" :width="50">
+        <template slot-scope="t, r, i">
+          <span> {{ i + 1 }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="标题" dataIndex="title"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="标题" dataIndex="title" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="所属流程" dataIndex="processName"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="所属流程" dataIndex="processName" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="当前审批环节" dataIndex="currTaskName"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="当前审批环节" dataIndex="currTaskName" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="状态" dataIndex="status"  :width="150" align="center"
-        key="s" :sorter="(a,b)=>a.status - b.status"
+      <a-table-column
+        title="状态"
+        dataIndex="status"
+        :width="150"
+        align="center"
+        key="s"
+        :sorter="(a, b) => a.status - b.status"
       >
-        <template slot-scope="t,r,i">
-          <span :style="{color:getStatus(t).color}"> {{getStatus(t).text}} </span>
+        <template slot-scope="t, r, i">
+          <span :style="{ color: getStatus(t).color }"> {{ getStatus(t).text }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="结果" dataIndex="result"  :width="150" align="center"
-                      key="result" :sorter="(a,b)=>a.result - b.result"
+      <a-table-column
+        title="结果"
+        dataIndex="result"
+        :width="150"
+        align="center"
+        key="result"
+        :sorter="(a, b) => a.result - b.result"
       >
-        <template slot-scope="t,r,i">
-          <span :style="{color:getResult(t).color}"> {{getResult(t).text}} </span>
+        <template slot-scope="t, r, i">
+          <span :style="{ color: getResult(t).color }"> {{ getResult(t).text }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="创建时间" dataIndex="createTime"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="创建时间" dataIndex="createTime" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="提交申请时间" dataIndex="applyTime"  :width="150" align="center">
-        <template slot-scope="t,r,i">
-          <span> {{t}} </span>
+      <a-table-column title="提交申请时间" dataIndex="applyTime" :width="150" align="center">
+        <template slot-scope="t, r, i">
+          <span> {{ t }} </span>
         </template>
       </a-table-column>
-      <a-table-column title="操作" dataIndex=""  align="center" :width="200">
-        <template slot-scope="t,r,i">
+      <a-table-column title="操作" dataIndex="" align="center" :width="200">
+        <template slot-scope="t, r, i">
           <template v-if="r.status == 0">
-            <a href="javascript:void(0);" style="color: #00A0E9" @click="apply(r)" >提交申请</a>
+            <a href="javascript:void(0);" style="color: #00A0E9" @click="apply(r)">提交申请</a>
             <a-divider type="vertical" />
             <a href="javascript:void(0);" @click="edit(r)" style="color: #000000">编辑</a>
             <a-divider type="vertical" />
             <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
-              <a href="javascript:void(0);"  style="color: red">删除</a>
+              <a href="javascript:void(0);" style="color: red">删除</a>
             </a-popconfirm>
-
           </template>
           <template v-else-if="r.status == 1">
-            <a href="javascript:void(0);" @click="cancel(r)"  style="color:#8000ff;">撤回</a>
+            <a href="javascript:void(0);" @click="cancel(r)" style="color:#8000ff;">撤回</a>
             <a-divider type="vertical" />
             <a href="javascript:void(0);" @click="history(r)" style="color:blue;">查看进度</a>
             <a-divider type="vertical" />
@@ -140,7 +160,7 @@
             <a href="javascript:void(0);" @click="history(r)" style="color:blue;">审批历史</a>
             <a-divider type="vertical" />
             <a-popconfirm title="确定删除吗?" @confirm="() => remove(r)">
-              <a href="javascript:void(0);"  style="color: red">删除</a>
+              <a href="javascript:void(0);" style="color: red">删除</a>
             </a-popconfirm>
           </template>
           <template v-else>
@@ -148,40 +168,42 @@
             <a-divider type="vertical" />
             <a href="javascript:void(0);" @click="history(r)" style="color:blue;">审批历史</a>
           </template>
-
         </template>
       </a-table-column>
     </a-table>
     <!-- table区域-end -->
     <!--流程申请选择-->
     <a-drawer
-      title="选择流程" width="33%"
+      title="选择流程"
+      width="33%"
       placement="right"
       :closable="false"
       @close="processModalVisible = false"
       :visible="processModalVisible"
     >
-    <a-input-search style="margin-bottom: 10px;width: 200px"
-                        placeholder="输入流程名称" @search="onSearchProcess" />
-      <a-empty description="无流程可供选择" v-if="activeKeyAll.length==0" />
+      <a-input-search style="margin-bottom: 10px;width: 200px" placeholder="输入流程名称" @search="onSearchProcess" />
+      <a-empty description="无流程可供选择" v-if="activeKeyAll.length == 0" />
       <div v-else>
-        
         <a-collapse v-model="activeKey">
-          <a-collapse-panel v-for="(value, index)  in activeKeyAll" :header="filterDictText(dictOptions,value)||'未分类'" :key="value">
-            <a-list :grid="{ gutter: 10,column:1}" :dataSource="processDataMap[value]">
+          <a-collapse-panel
+            v-for="(value, index) in activeKeyAll"
+            :header="filterDictText(dictOptions, value) || '未分类'"
+            :key="value"
+          >
+            <a-list :grid="{ gutter: 10, column: 1 }" :dataSource="processDataMap[value]">
               <a-list-item slot="renderItem" slot-scope="item">
                 <a-card>
                   <div slot="title">
                     <a-row>
-                      <a-col span="12" :title="item.name">{{item.name}} </a-col>
+                      <a-col span="12" :title="item.name">{{ item.name }} </a-col>
                       <a-col span="12" style="text-align: right;">
                         <a href="javascript:void (0)" @click="chooseProcess(item)">发起申请</a>
                       </a-col>
                     </a-row>
                   </div>
-                  <b>版本:</b>v.{{item.version}}
-                  <br/>
-                  <b>说明:</b>{{item.description}}
+                  <b>版本:</b>v.{{ item.version }}
+                  <br />
+                  <b>说明:</b>{{ item.description }}
                 </a-card>
               </a-list-item>
             </a-list>
@@ -191,26 +213,41 @@
     </a-drawer>
     <!--流程表单-->
     <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="100%">
-      <component :disabled="lcModa.disabled" v-if="lcModa.visible" :is="lcModa.formComponent"
-                 :processData="lcModa.processData" :isNew = "lcModa.isNew"
-                 @afterSubmit="afterSub" @close="lcModa.visible=false,lcModa.disabled = false"></component>
+      <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @afterSubmit="afterSub"
+        @close=";(lcModa.visible = false), (lcModa.disabled = false)"
+      ></component>
     </a-modal>
     <!-- <onl-cgform-auto-modal ref="modal" code="b0bea65bfce141deb0ae3fcb18982d76" /> -->
     <!--提交申请表单-->
     <a-modal title="提交申请" v-model="modalVisible" :mask-closable="false" :width="500" :footer="null">
       <div v-if="modalVisible">
         <a-form-item label="选择审批人" v-show="showAssign">
-          <a-select style="width: 100%"
+          <a-select
+            style="width: 100%"
             v-model="form.assignees"
             placeholder="请选择"
             mode="multiple"
             :allowClear="true"
           >
-            <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}</a-select-option>
+            <a-select-option 
+              v-for="(item, i) in assigneeList" 
+              :key="i" 
+              :value="item.username">
+
+              {{item.realname}}
+            </a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item label="下一审批人" v-show="isGateway">
-          <a-alert  type="info" showIcon message="分支网关处不支持自定义选择下一审批人,将自动下发给所有可审批人。">,将发送给下一节点所有人</a-alert>
+          <a-alert type="info" showIcon message="分支网关处不支持自定义选择下一审批人,将自动下发给所有可审批人。"
+            >,将发送给下一节点所有人</a-alert
+          >
         </a-form-item>
         <a-form-item label="优先级" prop="priority">
           <a-select v-model="form.priority" placeholder="请选择" :allowClear="true" style="width: 100%">
@@ -225,7 +262,7 @@
           <a-checkbox v-model="form.sendEmail" disabled>邮件通知</a-checkbox> -->
         </a-form-item>
         <div slot="footer">
-          <a-button type="text" @click="modalVisible=false">取消</a-button>
+          <a-button type="text" @click="modalVisible = false">取消</a-button>
           <div style="display:inline-block;width: 20px;"></div>
           <a-button type="primary" :disabled="submitLoading" @click="applySubmit">提交</a-button>
         </div>
@@ -243,462 +280,506 @@
         </a-form-item>
       </a-form>
       <div slot="footer">
-        <a-button type="text" @click="modalCancelVisible=false">取消</a-button>
+        <a-button type="text" @click="modalCancelVisible = false">取消</a-button>
         <a-button type="primary" :disabled="submitLoading" @click="handelSubmitCancel">提交</a-button>
       </div>
     </a-modal>
   </a-card>
-
 </template>
 
 <script>
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-  import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
-  import { filterObj } from '@/utils/util';
-  import JEllipsis from '@/components/jeecg/JEllipsis'
-  import { deleteAction, getAction,downFile } from '@/api/manage'
-  import pick from "lodash.pick";
-  import JTreeSelect from '@/components/jeecg/JTreeSelect'
-  import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
-  import historicDetail from '@/views/activiti/historicDetail'
-  export default {
-    name: "applyList",
-    mixins:[activitiMixin,JeecgListMixin],
-    components: {
-      JEllipsis
-      ,JTreeSelect
-      ,historicDetail
-    },
-    data () {
-      return {
-        data : [
-  {
-    key: '1',
-    name: 'John Brown',
-    age: 32,
-    address: 'New York No. 1 Lake Park',
-    tags: ['nice', 'developer'],
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
+import { filterObj } from '@/utils/util'
+import JEllipsis from '@/components/jeecg/JEllipsis'
+import { deleteAction, getAction, downFile } from '@/api/manage'
+import pick from 'lodash.pick'
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
+import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
+import historicDetail from '@/views/activiti/historicDetail'
+export default {
+  name: 'applyList',
+  mixins: [activitiMixin, JeecgListMixin],
+  components: {
+    JEllipsis,
+    JTreeSelect,
+    historicDetail
   },
-  {
-    key: '2',
-    name: 'Jim Green',
-    age: 42,
-    address: 'London No. 1 Lake Park',
-    tags: ['loser'],
-  },
-  {
-    key: '3',
-    name: 'Joe Black',
-    age: 32,
-    address: 'Sidney No. 1 Lake Park',
-    tags: ['cool', 'teacher'],
-  },
-],
-        columns : [
-  {
-    dataIndex: 'name',
-    key: 'name',
-    slots: { title: 'customTitle' },
-    scopedSlots: { customRender: 'name' },
-  },
-  {
-    title: 'Age',
-    dataIndex: 'age',
-    key: 'age',
-  },
-  {
-    title: 'Address',
-    dataIndex: 'address',
-    key: 'address',
-  },
-  {
-    title: 'Tags',
-    key: 'tags',
-    dataIndex: 'tags',
-    scopedSlots: { customRender: 'tags' },
-  },
-  {
-    title: 'Action',
-    key: 'action',
-    scopedSlots: { customRender: 'action' },
-  },
-],
-        description: '我的申请',
-        dictOptions:[],
-        url: {
-          list: "/actBusiness/listData",
-          getProcessDataList: "/activiti_process/listData",
-          delByIds:'/actBusiness/delByIds',
-          getFirstNode:'/actProcessIns/getFirstNode',
-          applyBusiness:'/actBusiness/apply',
-          cancelApply:'/actBusiness/cancel',
+  data() {
+    return {
+      data: [
+        {
+          key: '1',
+          name: 'John Brown',
+          age: 32,
+          address: 'New York No. 1 Lake Park',
+          tags: ['nice', 'developer']
         },
-        // 查询条件
-        queryParam: {
-          createTimeRange:[],
-          keyWord:'',
+        {
+          key: '2',
+          name: 'Jim Green',
+          age: 42,
+          address: 'London No. 1 Lake Park',
+          tags: ['loser']
         },
-        // 表头
-        labelCol: {
-          xs: { span: 4 },
-          sm: { span: 4 },
+        {
+          key: '3',
+          name: 'Joe Black',
+          age: 32,
+          address: 'Sidney No. 1 Lake Park',
+          tags: ['cool', 'teacher']
+        }
+      ],
+
+
+      columns: [
+        {
+          dataIndex: 'name',
+          key: 'name',
+          slots: { title: 'customTitle' },
+          scopedSlots: { customRender: 'name' }
         },
-        wrapperCol: {
-          xs: { span: 20 },
-          sm: { span: 20 },
+        {
+          title: 'Age',
+          dataIndex: 'age',
+          key: 'age'
         },
-        processModalVisible: null,
-        activeKeyAll: [],
-        activeKey: [],
-        processDataMap: {},
-        searchProcessKey: null,
-        addApplyLoading: false,
-        lcModa: {
-          title:'',
-          disabled:false,
-          visible:false,
-          formComponent : null,
-          isNew : false
+        {
+          title: 'Address',
+          dataIndex: 'address',
+          key: 'address'
         },
-        form:{
-          priority:0,
-          assignees:[],
-          sendMessage:true
+        {
+          title: 'Tags',
+          key: 'tags',
+          dataIndex: 'tags',
+          scopedSlots: { customRender: 'tags' }
         },
-        modalVisible: false,
-        showAssign: false,
-        assigneeList: [],
-        isGateway: false,
-        dictPriority: [],
-        submitLoading: false,
-        error: "",
-        /*审批历史*/
-        modalLsVisible: false,
-        procInstId: '',
-        modalCancelVisible: false,
-        cancelForm: {}
-      }
-    },
-    computed:{
-    },
-    methods: {
+        {
+          title: 'Action',
+          key: 'action',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      description: '我的申请',
+      dictOptions: [],
 
-      initDictConfig() {
-        //初始化字典 - 流程分类
-        initDictOptions('bpm_process_type').then((res) => {
-          if (res.success) {
-            this.dictOptions = res.result;
-          }
-        });
+      // 
+      url: {
+        list: '/actBusiness/listData',
+        getProcessDataList: '/activiti_process/listData',
+        delByIds: '/actBusiness/delByIds',
+        getFirstNode: '/actProcessIns/getFirstNode',
+        applyBusiness: '/actBusiness/apply',
+        cancelApply: '/actBusiness/cancel'
       },
-      filterDictText(dictOptions, text) {
-        if (dictOptions instanceof Array) {
-          for (let dictItem of dictOptions) {
-            if (text === dictItem.value) {
-              return dictItem.text
-            }
+      // 查询条件
+      queryParam: {
+        createTimeRange: [],
+        keyWord: ''
+      },
+      // 表头
+      labelCol: {
+        xs: { span: 4 },
+        sm: { span: 4 }
+      },
+      wrapperCol: {
+        xs: { span: 20 },
+        sm: { span: 20 }
+      },
+      processModalVisible: null,
+      activeKeyAll: [],
+      activeKey: [],
+      processDataMap: {},
+      searchProcessKey: null,
+      addApplyLoading: false,
+      lcModa: {
+        title: '',
+        disabled: false,
+        visible: false,
+        formComponent: null,
+        isNew: false
+      },
+      form: {
+        priority: 0,
+        assignees: [],
+        sendMessage: true
+      },
+      modalVisible: false,
+      showAssign: false,
+      assigneeList: [],
+      isGateway: false,
+      dictPriority: [],
+      submitLoading: false,
+      error: '',
+      /*审批历史*/
+      modalLsVisible: false,
+      procInstId: '',
+      modalCancelVisible: false,
+      cancelForm: {}
+    }
+  },
+  computed: {},
+  methods: {
+    //初始化字典 - 流程分类
+    initDictConfig() {
+      initDictOptions('bpm_process_type').then(res => {
+        if (res.success) {
+          this.dictOptions = res.result
+        }
+      })
+    },
+
+    //字典
+    filterDictText(dictOptions, text) {
+      if (dictOptions instanceof Array) {
+        for (let dictItem of dictOptions) {
+          if (text === dictItem.value) {
+            return dictItem.text
           }
         }
-        return text||text=='null'?'':text
-      },
-      getProcessList() {
-        this.addApplyLoading = true;
-        this.postFormAction(this.url.getProcessDataList,{status:1,roles:true}).then(res => {
-          this.activeKeyAll = [];
+      }
+      return text || text == 'null' ? '' : text
+    },
+    //进度列表
+    getProcessList() {
+      this.addApplyLoading = true
+      this.postFormAction(this.url.getProcessDataList, { status: 1, roles: true })
+        .then(res => {
+          this.activeKeyAll = []
           if (res.success) {
-            var result = res.result||[];
-            if (result.length>0){
-              let searchProcessKey = this.searchProcessKey;
-              if (searchProcessKey){ //过滤条件
-                result = _.filter(result, function(o) { return o.name.indexOf(searchProcessKey)>-1; });
+            var result = res.result || []
+            if (result.length > 0) {
+              let searchProcessKey = this.searchProcessKey
+              if (searchProcessKey) {
+                //过滤条件
+                result = _.filter(result, function(o) {
+                  return o.name.indexOf(searchProcessKey) > -1
+                })
               }
-              this.processDataMap = _.groupBy(result,'categoryId');
+              this.processDataMap = _.groupBy(result, 'categoryId')
               for (const categoryId in this.processDataMap) {
                 this.activeKeyAll.push(categoryId)
               }
-              this.activeKey = this.activeKeyAll;
+              this.activeKey = this.activeKeyAll
             }
-            this.processModalVisible = true;
-          }else {
+            this.processModalVisible = true
+          } else {
             this.$message.warning(res.message)
           }
-        }).finally(()=>this.addApplyLoading = false);
-      },
-      loadData(arg) {
-        console.log("loadData")
-        if(!this.url.list){
-          this.$message.error("请设置url.list属性!")
-          return
-        }
-        //加载数据 若传入参数1则加载第一页的内容
-        if (arg === 1) {
-          this.ipagination.current = 1;
-        }
-        var params = this.getQueryParams();//查询条件
-        this.loading = true;
-        getAction(this.url.list, params).then((res) => {
-          if (res.success) {
-            let records = res.result||[];
-            this.dataSource = records;
-            this.ipagination.total = records.length;
-          }
-          if(res.code===510){
-            this.$message.warning(res.message)
-          }
-          this.loading = false;
         })
-      },
-      getQueryParams(){
-        var param = Object.assign({}, this.queryParam,this.isorter);
-        delete param.createTimeRange; // 时间参数不传递后台
-        return filterObj(param);
-      },
-
-      // 重置
-      searchReset(){
-        var that = this;
-        var logType = that.queryParam.logType;
-        that.queryParam = {}; //清空查询区域参数
-        that.queryParam.logType = logType;
-        that.loadData(this.ipagination.current);
-      },
-      onDateChange: function (value, dateString) {
-        console.log(dateString[0],dateString[1]);
-        this.queryParam.createTime_begin=dateString[0];
-        this.queryParam.createTime_end=dateString[1];
-      },
-      onDateOk(value) {
-        console.log(value);
-      },
+        .finally(() => (this.addApplyLoading = false))
+    },
 
-      getStatus(status) {
-        let text = "未知", color = "";
-        if (status == 0) {
-          text = "草稿";
-          color = "default";
-        } else if (status == 1) {
-          text = "处理中";
-          color = "orange";
-        } else if (status == 2) {
-          text = "已结束";
-          color = "blue";
-        } else if (status == 3) {
-          text = "已撤回";
-          color = "magenta";
+    //
+    loadData(arg) {
+      console.log('loadData')
+      if (!this.url.list) {
+        this.$message.error('请设置url.list属性!')
+        return
+      }
+      //加载数据 若传入参数1则加载第一页的内容
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      var params = this.getQueryParams() //查询条件
+      this.loading = true
+      
+      getAction(this.url.list, params).then(res => {
+        if (res.success) {
+          let records = res.result || []
+          this.dataSource = records
+          this.ipagination.total = records.length
         }
-        return {text:text,color:color}
-      },
-      getResult(result) {
-        let text = "未知",
-          color = "";
-        if (result == 0) {
-          text = "未提交";
-          color = "default";
-        } else if (result == 1) {
-          text = "处理中";
-          color = "orange";
-        } else if (result == 2) {
-          text = "已通过";
-          color = "green";
-        } else if (result == 3) {
-          text = "已驳回";
-          color = "red";
+        if (res.code === 510) {
+          this.$message.warning(res.message)
         }
-        return {text:text,color:color}
-      },
-      apply(v) {
-        if (!v.procDefId || v.procDefId == "null") {
-          this.$message.error("流程定义为空");
-          return;
+        this.loading = false
+      })
+    },
+
+    // 选择参数
+    getQueryParams() {
+      var param = Object.assign({}, this.queryParam, this.isorter)
+      delete param.createTimeRange // 时间参数不传递后台
+      return filterObj(param)
+    },
+
+    // 重置
+    searchReset() {
+      var that = this
+      var logType = that.queryParam.logType
+      that.queryParam = {} //清空查询区域参数
+      that.queryParam.logType = logType
+      that.loadData(this.ipagination.current)
+    },
+
+    //
+    onDateChange: function(value, dateString) {
+      console.log(dateString[0], dateString[1])
+      this.queryParam.createTime_begin = dateString[0]
+      this.queryParam.createTime_end = dateString[1]
+    },
+
+    onDateOk(value) {
+      console.log(value)
+    },
+
+    // 状态
+    getStatus(status) {
+      let text = '未知',
+        color = ''
+      if (status == 0) {
+        text = '草稿'
+        color = 'default'
+      } else if (status == 1) {
+        text = '处理中'
+        color = 'orange'
+      } else if (status == 2) {
+        text = '已结束'
+        color = 'blue'
+      } else if (status == 3) {
+        text = '已撤回'
+        color = 'magenta'
+      }
+      return { text: text, color: color }
+    },
+
+    // 结果
+    getResult(result) {
+      let text = '未知',
+        color = ''
+      if (result == 0) {
+        text = '未提交'
+        color = 'default'
+      } else if (result == 1) {
+        text = '处理中'
+        color = 'orange'
+      } else if (result == 2) {
+        text = '已通过'
+        color = 'green'
+      } else if (result == 3) {
+        text = '已驳回'
+        color = 'red'
+      }
+      return { text: text, color: color }
+    },
+
+    // 申请
+    apply(v) {
+      if (!v.procDefId || v.procDefId == 'null') {
+        this.$message.error('流程定义为空')
+        return
+      }
+      this.form.id = v.id
+      this.form.procDefId = v.procDefId
+      this.form.title = v.title
+      // 加载审批人
+      this.getAction(this.url.getFirstNode, { procDefId: v.procDefId }).then(res => {
+        if (res.success) {
+          if (res.result.type == 3 || res.result.type == 4) {
+            this.isGateway = true
+            this.modalVisible = true
+            this.form.firstGateway = true
+            this.showAssign = false
+            this.error = ''
+            return
+          }
+          this.form.firstGateway = false
+          this.isGateway = false
+          if (res.result.users && res.result.users.length > 0) {
+            this.error = ''
+            this.assigneeList = res.result.users
+            // 默认勾选
+            let ids = []
+            res.result.users.forEach(e => {
+              ids.push(e.username)
+            })
+            this.form.assignees = ids
+            this.showAssign = true
+          } else {
+            this.form.assignees = []
+            this.showAssign = true
+            this.error = '审批节点未分配候选审批人员,请联系管理员!'
+          }
+          if (this.error) {
+            this.$message.error(this.error)
+            return
+          }
+          this.modalVisible = true
+        } else {
+          this.$message.error(res.message)
         }
-        this.form.id = v.id;
-        this.form.procDefId = v.procDefId;
-        this.form.title = v.title;
-        // 加载审批人
-        this.getAction(this.url.getFirstNode,{procDefId:v.procDefId}).then(res => {
+      })
+    },
+
+    //申请提交
+    applySubmit() {
+      if (this.showAssign && this.form.assignees.length < 1) {
+        this.error = '请至少选择一个审批人'
+        this.$message.error(this.error)
+        return
+      } else {
+        this.error = ''
+      }
+      this.submitLoading = true
+      var params = Object.assign({}, this.form)
+      params.assignees = params.assignees.join(',')
+      this.postFormAction(this.url.applyBusiness, params)
+        .then(res => {
           if (res.success) {
-            if (res.result.type == 3 || res.result.type == 4) {
-              this.isGateway = true;
-              this.modalVisible = true;
-              this.form.firstGateway = true;
-              this.showAssign = false;
-              this.error = "";
-              return;
-            }
-            this.form.firstGateway = false;
-            this.isGateway = false;
-            if (res.result.users && res.result.users.length > 0) {
-              this.error = "";
-              this.assigneeList = res.result.users;
-              // 默认勾选
-              let ids = [];
-              res.result.users.forEach(e => {
-                ids.push(e.username);
-              });
-              this.form.assignees = ids;
-              this.showAssign = true;
-            } else {
-              this.form.assignees = [];
-              this.showAssign = true;
-              this.error = '审批节点未分配候选审批人员,请联系管理员!';
-            }
-            if (this.error){
-              this.$message.error(this.error)
-              return;
-            }
-            this.modalVisible = true;
-          }else {
+            this.$message.success('操作成功')
+            this.loadData()
+            this.modalVisible = false
+          } else {
             this.$message.error(res.message)
           }
-        });
+        })
+        .finally(() => (this.submitLoading = false))
+    },
 
-      },
-      applySubmit() {
-        if (this.showAssign && this.form.assignees.length < 1) {
-          this.error = "请至少选择一个审批人";
-          this.$message.error(this.error)
-          return;
+    // 编辑
+    edit(r, isView) {
+      if (!r.routeName) {
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
+      }
+      if (r.routeName.indexOf('外部表单') != -1) {
+        alert('调用其他项目页面')
+      } else if (r.routeName.indexOf('自定义') != -1) {
+        isView = isView || false
+        this.lcModa.disabled = isView
+        this.lcModa.title = '修改流程业务信息:' + r.title
+        if (isView) this.lcModa.title = '查看流程业务信息:' + r.title
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.isNew = false
+        this.lcModa.processData = r
+        this.lcModa.visible = true
+      } else {
+        isView = isView || false
+        this.lcModa.disabled = isView
+        this.lcModa.title = '修改流程业务信息:' + r.title
+        if (isView) this.lcModa.title = '查看流程业务信息:' + r.title
+        this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+        this.lcModa.processData = r
+        this.lcModa.isNew = false
+        this.lcModa.visible = true
+      }
+    },
+
+    //
+    remove(r) {
+      this.postFormAction(this.url.delByIds, { ids: r.id }).then(res => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.loadData()
         } else {
-          this.error = "";
+          this.$message.error(res.message)
         }
-        this.submitLoading = true;
-        var params = Object.assign({},this.form);
-        params.assignees = params.assignees.join(",")
-        this.postFormAction(this.url.applyBusiness,params).then(res => {
+      })
+    },
+
+    //
+    cancel(v) {
+      this.cancelForm.id = v.id
+      this.cancelForm.procInstId = v.procInstId
+      this.modalCancelVisible = true
+    },
+
+    //
+    handelSubmitCancel() {
+      this.submitLoading = true
+      this.postFormAction(this.url.cancelApply, this.cancelForm)
+        .then(res => {
           if (res.success) {
-            this.$message.success("操作成功");
-            this.loadData();
-            this.modalVisible = false;
-          }else {
-            this.$message.error(res.message)
-          }
-        }).finally(()=>this.submitLoading = false);
-      },
-      edit(r,isView) {
-        if (!r.routeName) {
-          this.$message.warning(
-            "该流程信息未配置表单,请联系开发人员!"
-          );
-          return;
-        }
-        if(r.routeName.indexOf("外部表单")!=-1){
-          alert("调用其他项目页面")
-        }else if(r.routeName.indexOf("自定义")!=-1){
-          isView = isView||false;
-          this.lcModa.disabled = isView;
-          this.lcModa.title = '修改流程业务信息:'+r.title;
-          if (isView) this.lcModa.title = '查看流程业务信息:'+r.title;
-          let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-          this.lcModa.formComponent = com.component;
-          this.lcModa.isNew = false;
-          this.lcModa.processData = r;
-          this.lcModa.visible = true;
-        }else{
-          isView = isView||false;
-          this.lcModa.disabled = isView;
-          this.lcModa.title = '修改流程业务信息:'+r.title;
-          if (isView) this.lcModa.title = '查看流程业务信息:'+r.title;
-          this.lcModa.formComponent = this.getFormComponent(r.routeName).component;
-          this.lcModa.processData = r;
-          this.lcModa.isNew = false;
-          this.lcModa.visible = true;
-        }
-      },
-      remove(r) {
-        this.postFormAction(this.url.delByIds,{ids:r.id}).then((res)=>{
-          if (res.success){
-            this.$message.success(res.message)
-            this.loadData();
-          }else {
+            this.$message.success('操作成功')
+            this.loadData()
+            this.modalCancelVisible = false
+          } else {
             this.$message.error(res.message)
           }
         })
-      },
-      cancel(v) {
-        this.cancelForm.id = v.id;
-        this.cancelForm.procInstId = v.procInstId;
-        this.modalCancelVisible = true;
-      },
-      handelSubmitCancel() {
-        this.submitLoading = true;
-        this.postFormAction(this.url.cancelApply,this.cancelForm).then(res => {
-          if (res.success) {
-            this.$message.success("操作成功");
-            this.loadData();
-            this.modalCancelVisible = false;
-          }else {
-            this.$message.error(res.message);
-          }
-        }).finally(()=>this.submitLoading = false);
-      },
-      history(v) {
-        if (!v.procInstId) {
-          this.$message.error("流程实例ID不存在");
-          return;
-        }
-        this.procInstId = v.procInstId;
-        this.modalLsVisible = true;
-      },
-      detail(v) {
-        // this.$refs.modal.detail("1","8a8080f079ea4ed50179ea4f6c470001")
-        this.edit(v,true);
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //分页、排序、筛选变化时触发
-        //TODO 筛选
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
-        }
-        this.ipagination = pagination;
-        // this.loadData();
-      },
-      addApply() {
-        this.getProcessList()
-      },
-      onSearchProcess(value) {
-        this.searchProcessKey = value;
-        this.getProcessList()
-      },
-      chooseProcess(v) {
-        console.log(v)
-        // this.$refs.modal.add("1")
-        if (!v.routeName) {
-          this.$message.warning(
-            "该流程信息未配置表单,请联系开发人员!"
-          );
-          return;
-        }
-        if(v.routeName.indexOf("外部表单")!=-1){
-          alert("调用其他项目页面")
-        }else if(v.routeName.indexOf("自定义")!=-1){
-          this.lcModa.disabled = false;
-          let com={component:() => import(`@/views/activiti/form/demoForm2`)}
-          this.lcModa.formComponent = com.component;
-          this.lcModa.title = '发起流程:'+v.name;
-          this.lcModa.isNew = true;
-          this.lcModa.processData = v;
-          this.lcModa.visible = true;
-        }else{
-          this.lcModa.disabled = false;
-          this.lcModa.formComponent = this.getFormComponent(v.routeName).component;
-          this.lcModa.title = '发起流程:'+v.name;
-          this.lcModa.isNew = true;
-          this.lcModa.processData = v;
-          this.lcModa.visible = true;
-        }
-        
+        .finally(() => (this.submitLoading = false))
+    },
 
-        console.log("发起",v)
-      },
-      afterSub(formData){
-          this.lcModa.visible = false;
-          this.loadData();
-      },
+    //
+    history(v) {
+      if (!v.procInstId) {
+        this.$message.error('流程实例ID不存在')
+        return
+      }
+      this.procInstId = v.procInstId
+      this.modalLsVisible = true
+    },
+
+    //
+    detail(v) {
+      // this.$refs.modal.detail("1","8a8080f079ea4ed50179ea4f6c470001")
+      this.edit(v, true)
+    },
+
+    //
+    handleTableChange(pagination, filters, sorter) {
+      //分页、排序、筛选变化时触发
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      // this.loadData();
+    },
+
+    //
+    addApply() {
+      this.getProcessList()
+    },
+
+    //
+    onSearchProcess(value) {
+      this.searchProcessKey = value
+      this.getProcessList()
+    },
+
+    //
+    chooseProcess(v) {
+      console.log(v)
+      // this.$refs.modal.add("1")
+      if (!v.routeName) {
+        this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+        return
+      }
+      if (v.routeName.indexOf('外部表单') != -1) {
+        alert('调用其他项目页面')
+      } else if (v.routeName.indexOf('自定义') != -1) {
+        this.lcModa.disabled = false
+        let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+        this.lcModa.formComponent = com.component
+        this.lcModa.title = '发起流程:' + v.name
+        this.lcModa.isNew = true
+        this.lcModa.processData = v
+        this.lcModa.visible = true
+      } else {
+        this.lcModa.disabled = false
+        this.lcModa.formComponent = this.getFormComponent(v.routeName).component
+        this.lcModa.title = '发起流程:' + v.name
+        this.lcModa.isNew = true
+        this.lcModa.processData = v
+        this.lcModa.visible = true
+      }
+
+      console.log('发起', v)
+    },
 
+    //
+    afterSub(formData) {
+      this.lcModa.visible = false
+      this.loadData()
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
-</style>
+@import '~@assets/less/common.less';
+</style>

+ 336 - 0
src/views/user/1111111111.vue

@@ -0,0 +1,336 @@
+<template>
+  <div class="orderAll">
+    <my-header>订单</my-header>
+    <!-- Tab 标签栏---------------------------------------
+          1. v-model="billStatus" 绑定一个值, 指定当前激活的tab栏的下标, 下标0开始
+          2. sticky 吸顶粘性布局
+          3. animated 切换动画
+          4. swipeable 滑动切换效果
+
+          下拉刷新
+          v-model 设置为 false,表示加载完成
+     ----------------------------------------------------------->
+    <div class="state-tabs">
+      <van-tabs
+        v-model="billStatus"
+        @click.native="handleClick"
+        sticky
+        animated
+        swipeable
+      >
+        <!-- 待完成 -->
+        <van-tab title="待完成" name="wait">
+          <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
+            <div
+              class="wait wait1"
+              v-for="item in orders"
+              :key="item.orderId"
+              @click="orderDetail(item.orderType, item.orderId)"
+            >
+              <div class="title">
+                <h4 v-if="item.orderType == 'caiOrder'">
+                  采血任务
+                </h4>
+                <h4 v-if="item.orderType == 'huiOrder'">
+                  回输任务
+                </h4>
+                <span class="waitState">{{ item.nodeName }}</span>
+              </div>
+
+              <!-- 详细内容 -------------------------->
+              <div class="details">
+                <!-- 订单号 -->
+                <div class="row clearfix">
+                  <span class="fl">订单号</span>
+                  <em class="num fr">{{ item.billNo }}</em>
+                </div>
+                <!-- 订单日期 -->
+                <div class="row clearfix">
+                  <span class="fl">订单日期</span>
+                  <em class="startTime fr">{{ item.billDate }}</em>
+                </div>
+                <!-- 采血提货时间 -->
+                <div class="row clearfix">
+                  <span class="fl">提货时间</span>
+                  <em class="scheduledTime fr ">{{ item.pickTime }}</em>
+                </div>
+                <!-- 提货点 -->
+                <div class="row clearfix">
+                  <span class="fl">提货点</span>
+                  <em class="place fr">{{ item.pickPoint }}</em>
+                </div>
+                <!-- 提货地址 -->
+                <div class="row clearfix">
+                  <span class="fl">提货地址</span>
+                  <em class="place fr">{{ item.pickAddr }}</em>
+                </div>
+                <!-- 送达点 -->
+                <div class="row clearfix">
+                  <span class="fl">送达点</span>
+                  <em class="place fr">{{ item.deliveryPoint }}</em>
+                </div>
+                <!-- 送达地址 -->
+                <div class="row clearfix">
+                  <span class="fl">送达地址</span>
+                  <em class="place fr">{{ item.deliveryAddr }}</em>
+                </div>
+
+                <!-- 联系人 -->
+                <div class="row clearfix person">
+                  <span>联系人</span>
+                  <em class="who ">{{ item.pickPsn }}</em>
+                  <div class="phoneNum fr">{{ item.pickTel }}</div>
+                </div>
+              </div>
+            </div>
+          </van-pull-refresh>
+        </van-tab>
+
+        <!-- 完成 -->
+        <van-tab title="完成" name="completed">
+          <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
+            <div
+              class="completed completed1"
+              v-for="item in orders"
+              :key="item.orderId"
+              @click="orderDetail(item.orderType, item.orderId)"
+            >
+
+              <!-- 标题 -->
+              <div class="title com">
+                <h4 v-if="item.orderType == 'caiOrder'">
+                  采血任务
+                </h4>
+                <h4 v-if="item.orderType == 'huiOrder'">
+                  回输任务
+                </h4>
+                <span class="completedState">{{ item.nodeName }}</span>
+              </div>
+
+              <!-- 细节 -->
+              <div class="details">
+                <!-- 订单号 -->
+                <div class="row clearfix">
+                  <span class="fl">订单号</span>
+                  <em class="num fr">{{ item.billNo }}</em>
+                </div>
+                <!-- 订单日期 -->
+                <div class="row clearfix">
+                  <span class="fl">订单日期</span>
+                  <em class="startTime fr">{{ item.billDate }}</em>
+                </div>
+                <!-- 采血提货时间 -->
+                <div class="row clearfix">
+                  <span class="fl">提货时间</span>
+                  <em class="scheduledTime fr ">{{ item.pickTime }}</em>
+                </div>
+                <!-- 提货点 -->
+                <div class="row clearfix">
+                  <span class="fl">提货点</span>
+                  <em class="place fr">{{ item.pickPoint }}</em>
+                </div>
+                <!-- 提货地址 -->
+                <div class="row clearfix">
+                  <span class="fl">提货地址</span>
+                  <em class="place fr">{{ item.pickAddr }}</em>
+                </div>
+                <!-- 送达点 -->
+                <div class="row clearfix">
+                  <span class="fl">送达点</span>
+                  <em class="place fr">{{ item.deliveryPoint }}</em>
+                </div>
+                <!-- 送达地址 -->
+                <div class="row clearfix">
+                  <span class="fl">送达地址</span>
+                  <em class="place fr">{{ item.deliveryAddr }}</em>
+                </div>
+
+                <!-- 联系人 -->
+                <div class="row clearfix person">
+                  <span>联系人</span>
+                  <em class="who ">{{ item.pickPsn }}</em>
+                  <div class="phoneNum fr">{{ item.pickTel }}</div>
+                </div>
+              </div>
+            </div>
+          </van-pull-refresh>
+        </van-tab>
+
+        <!-- 全部任务 -->
+        <van-tab title="全部" name="all">
+          <div class="all">
+            <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
+              <div
+                class="wait wait1"
+                v-for="item in orders"
+                :key="item.orderId"
+                @click="orderDetail(item.orderType, item.orderId)"
+              >
+                <!-- 通过判断附加class 属性 -->
+                <div
+                  class="title"
+                  :class="{ com: item.billStatus === ' 4' }"
+                >
+                  <h4 v-if="item.orderType == 'caiOrder'">
+                    采血任务
+                  </h4>
+                  <h4 v-if="item.orderType == 'huiOrder'">
+                    回输任务
+                  </h4>
+                  <span
+                    :class="{
+                      waitState: item.billStatus === '2',
+                      completedState: item.billStatus === ' 4'
+                    }"
+                  >{{ item.nodeName }}</span
+                  >
+                </div>
+
+                <div class="details">
+                  <!-- 订单号 -->
+                  <div class="row clearfix">
+                    <span class="fl">订单号</span>
+                    <em class="num fr">{{ item.billNo }}</em>
+                  </div>
+                  <!-- 订单日期 -->
+                  <div class="row clearfix">
+                    <span class="fl">订单日期</span>
+                    <em class="startTime fr">{{ item.billDate }}</em>
+                  </div>
+                  <!-- 提货时间 -->
+                  <div class="row clearfix">
+                    <span class="fl">提货时间</span>
+                    <em class="scheduledTime fr ">{{ item.pickTime }}</em>
+                  </div>
+                  <!-- 提货点 -->
+                  <div class="row clearfix">
+                    <span class="fl">提货点</span>
+                    <em class="place fr">{{ item.pickPoint }}</em>
+                  </div>
+                  <!-- 提货地址 -->
+                  <div class="row clearfix">
+                    <span class="fl">提货地址</span>
+                    <em class="place fr">{{ item.pickAddr }}</em>
+                  </div>
+                  <!-- 送达点 -->
+                  <div class="row clearfix">
+                    <span class="fl">送达点</span>
+                    <em class="place fr">{{ item.deliveryPoint }}</em>
+                  </div>
+                  <!-- 送达地址 -->
+                  <div class="row clearfix">
+                    <span class="fl">送达地址</span>
+                    <em class="place fr">{{ item.deliveryAddr }}</em>
+                  </div>
+
+                  <!-- 联系人 -->
+                  <div class="row clearfix person">
+                    <span>联系人</span>
+                    <em class="who ">{{ item.pickPsn }}</em>
+                    <div class="phoneNum fr">{{ item.pickTel }}</div>
+                  </div>
+                </div>
+              </div>
+            </van-pull-refresh>
+          </div>
+        </van-tab>
+      </van-tabs>
+    </div>
+
+    <!-- 底部 -->
+    <div class="footer">
+      <ul>
+        <li>
+          <div @click="$router.push('/')">
+            <i class="el-icon-s-home big"></i>
+            <p>首页</p>
+          </div>
+        </li>
+
+        <li>
+          <div>
+            <i class="el-icon-s-order current"></i>
+            <p class="current">订单</p>
+          </div>
+        </li>
+        <li>
+          <div @click="$router.push('/my')">
+            <i class="el-icon-s-custom"></i>
+            <p>我的</p>
+          </div>
+        </li>
+      </ul>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+    data () {
+        return {
+            orders: [], // 默认值给一个空对象
+            billStatus: 'all', // 默认全部页签
+            count: 0,
+            isLoading: false,
+            resultClass: { wait: 'waitState', completed: 'completedState' }
+        }
+    },
+    created () {
+    // 第一时间渲染列表
+        const { billStatus } = this.$route.params
+        this.billStatus = billStatus
+        if (billStatus) {
+            this.getOrders(this.billStatus)
+        }
+    },
+    methods: {
+    // tabs切换
+        handleClick () {
+            console.log(this.billStatus)
+            this.getOrders(this.billStatus)
+        },
+        async getOrders (billStatus) {
+            // 从本地获取用户 id 和 token
+            const deptId = localStorage.getItem('dept_id')
+            // 发送获取个人信息的请求时,需要携带上token令牌,需要放在请求头Authorization字段上
+            const res = await this.$axios.get(`/orders/${deptId}/${billStatus}`)
+            console.log(res)
+            const { statusCode, data } = res.data
+            if (statusCode === 200) {
+                this.orders = data
+            }
+        },
+        orderDetail (orderType, orderId) {
+            this.$router.push({
+                name: orderType,
+                params: {
+                    orderId: orderId
+                }
+            })
+        },
+        // 下拉刷新
+        onRefresh () {
+            setTimeout(() => {
+                this.$toast('刷新成功')
+                this.isLoading = false
+                this.getOrders(this.billStatus)
+            }, 1000)
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+.orderAll {
+  height: 100%;
+  // 单个订单
+  .wait1,
+  .completed1,
+  .completed2 {
+    border-radius: 7px;
+    padding: 10px;
+    box-shadow: 2px 2px 10px rgba(121, 118, 116, 0.4);
+    margin: 20px 20px;
+  }
+}
+</style>

+ 20 - 31
src/views/user/Login.vue

@@ -2,13 +2,12 @@
   <div class="main">
     <!-- 待办卡片    :loading="loading" -->
     <a-card title="我的待办" :bordered="false" style="width: 100%; border-radius:6px;margin-bottom: 24px;">
-      <a-badge class="numTips">{{ waitNum }}</a-badge>
+      <a-badge class="numTips">{{ data.length }}</a-badge>
       <!-- 卡片右上角的操作区域 -->
-      <a slot="extra" @click.stop.prevent="todo">全部</a>
-      <!-- <p>card content</p>-->
+      <a slot="extra" @click.stop.prevent="todo()">更多</a>
     </a-card>
 
-    <!-- oa工作台 -->
+    <!-- OA工作台-->
     <a-card title="OA工作台" :bordered="false" style="width: 100%; border-radius:6px;">
       <div class="oa">
         <a href="" class="oaItem">
@@ -37,13 +36,11 @@
 </template>
 
 <script>
-import api from '@/api'
-
-// 组件中风使用映射,所以需要导入
+// 组件中使用映射,所以需要导入
 import { mapActions } from 'vuex'
 import Vue from 'vue'
 import { ACCESS_TOKEN, ENCRYPTED_STRING, USER_INFO } from '@/store/mutation-types'
-
+import api from '@/api'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
 import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
@@ -53,18 +50,9 @@ export default {
     components: {},
     data () {
         return {
-            waitNum: '',
+            data: [],
             url: {
                 todoList: '/actTask/todoList'
-                // pass: '/actTask/pass',
-                // back: '/actTask/back',
-                // backToTask: '/actTask/backToTask',
-                // delegate: '/actTask/delegate',
-                // getNextNode: '/activiti_process/getNextNode',
-                // getNode: '/activiti_process/getNode/',
-                // getBackList: '/actTask/getBackList/',
-                // passAll: '/actTask/passAll/',
-                // backAll: '/actTask/backAll/'
             }
         }
     },
@@ -92,30 +80,28 @@ export default {
             await that
                 .Login(loginParams)
                 .then(res => {
-                    console.log('拿到token、真正登录上啦!!!!')
+                    console.log('Login页面拿到token、真正登录上啦!!!!')
                 })
                 .catch(err => {
                     console.log(err)
                 })
         },
 
-        // 点击全部
+        // 点击全部 跳转页面
         todo () {
-            // 应在此处发请求,获取待办事项对象
-            console.log('发请求,获取所有待办事项,并展示')
             this.$router.push({ path: '/user/todo' })
             console.log(this.$router)
         },
-        //
+
+        // 拿到
         getDataList () {
             this.postFormAction(this.url.todoList, {}).then(res => {
                 if (res.success) {
                     this.data = res.result || []
-                    this.total = this.data.leading
-                    console.log(this.data)
-                    console.log('待办总数字')
-                    console.log('this.total', this.total)
-                    // var waitNum = this.data.length
+                    // this.total = this.data.leading
+                    // console.log('this.total:', this.total)
+                    console.log('消息数量:', this.data.length)
+                    // console.log(this.data[0].createTime)
                 }
             })
         }
@@ -135,9 +121,12 @@ export default {
 // 待办 数量
 .numTips {
   position: absolute;
-  top: 10px;
-  left: 86px;
-  background-color: blue;
+  top: 6px;
+  left: 88px;
+  background-color: red;
+  padding: 4px 6px;
+  border-radius: 50%;
+  color: white;
 }
 
 // OA 工作台

+ 79 - 51
src/views/user/Todo.vue

@@ -13,57 +13,49 @@
       <a-tabs default-active-key="wait" @change="callback" style="text-align: center;" className="todoTabs">
         <!-- 我的申请 -->
         <a-tab-pane key="apply" tab="我的申请">
-          <a-card
-            title="***报销申请"
-            style="width: 100%;border-radius:20px;text-align:left;marginBottom:10px;;border:none;"
-          >
-            <p>标题:</p>
-            <p>状态:</p>
-            <p>结果:</p>
+          <div v-for="item in applyList" :key="item.id">
+            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
+              <p>所属流程:{{ item.processName }}</p>
+              <p>标题:{{ item.title }}</p>
+              <p>状态:{{ item.status }}</p>
+              <p>结果:{{ item.result }}</p>
 
-            <a-divider></a-divider>
-            <div class="dividerDown">
-              <i>2021-07-17</i> · <em>来自</em> <i>审批</i>
-              <span class="state">结果</span>
-            </div>
-          </a-card>
-          <!-- <div><myApply /></div> -->
+              <a-divider></a-divider>
+
+              <p>创建时间:{{ item.createTime }}</p>
+              <p>发起人:{{ item.createBy }}</p>
+            </a-card>
+          </div>
         </a-tab-pane>
 
-        <!-- 我的待办 1 -->
+        <!-- 我的待办 -->
         <a-tab-pane key="wait" tab="我的待办" force-render>
-          <a-card
-            title="***报销申请"
-            style="width: 100%;border-radius:20px;text-align:left;marginBottom:10px;border:none;"
-          >
-            <p>标题:</p>
-            <p>状态:</p>
+          <div v-for="item in todoList" :key="item.id">
+            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
+              <p>所属流程:{{ item.processName }}</p>
+              <p>任务名称:{{ item.name }}</p>
+              <p>优先级:{{ item.priority }}</p>
 
-            <a-divider></a-divider>
-            <div class="dividerDown">
-              <i>2021-07-17</i> · <em>来自</em> <i>审批</i>
-              <span class="state">撤销</span>
-            </div>
-          </a-card>
-          <!-- <div><myWait /></div> -->
+              <a-divider></a-divider>
+              <p>创建时间:{{ item.createTime }}</p>
+              <p>发起人:{{ item.applyer }}</p>
+            </a-card>
+          </div>
         </a-tab-pane>
-
         <!-- 我的已办 -->
         <a-tab-pane key="done" tab="我的已办">
-          <a-card
-            title="***报销申请"
-            style="width: 100%;border-radius:20px;text-align:left;marginBottom:10px;border:none;"
-          >
-            <p>标题:</p>
-            <p>状态:</p>
+          <div v-for="item in doneList" :key="item.id">
+            <a-card style="width: 100%;border-radius:20px;text-align:left;marginBottom:30px;border:none;">
+              <p>任务名称:{{ item.name }}</p>
+              <p>所属流程:{{ item.processName }}</p>
+              <p>创建时间:{{ item.createTime }}</p>
 
-            <a-divider></a-divider>
-            <div class="dividerDown">
-              <i>2021-07-17</i> · <em>来自</em> <i>审批</i>
-              <span class="state">已通过</span>
-            </div>
-          </a-card>
-          <!-- <div><myDone /></div> -->
+              <a-divider></a-divider>
+
+              <p>发起人:{{ item.applyer }}</p>
+              <p>审批操作:{{ item.deleteReason }}</p>
+            </a-card>
+          </div>
         </a-tab-pane>
       </a-tabs>
     </a-layout-content>
@@ -75,22 +67,58 @@
 </template>
 
 <script>
-// import myApply from './todoAll/myApply' // 我的申请
-// import myWait from './todoAll/myWait' // 我的申请
-// import myDone from './todoAll/myDone' // 我的申请
+import { deleteAction, getAction, downFile } from '@/api/manage'
 export default {
     name: 'Todo',
-    components: {
-    // myApply,
-    // myWait,
-    // myDone
-    },
+    components: {},
     data () {
-        return {}
+        return {
+            url: {
+                todoList: '/actTask/todoList', // 待办
+                list: '/actBusiness/listData', // 申请
+                doneList: '/actTask/doneList' // 已办
+            },
+            todoList: [], // 待办列表
+            applyList: [], // 我的申请列表
+            doneList: [] // 已办列表
+        }
+    },
+    computed: {},
+
+    created () {
+        this.getDataList()
     },
+
     methods: {
+    // 切换tabs值
         callback (key) {
             console.log(key)
+            if (key === 'apply') {
+                console.log('拿到我的申请列表')
+                getAction(this.url.list).then(res => {
+                    if (res.success) {
+                        this.applyList = res.result || []
+                        console.log('我的申请列表', this.applyList)
+                    }
+                })
+            }
+            if (key === 'done') {
+                console.log('拿到我的已办列表')
+                getAction(this.url.doneList).then(res => {
+                    if (res.success) {
+                        this.doneList = res.result || []
+                    }
+                })
+            }
+        },
+        // 拿到todoList
+        getDataList () {
+            this.postFormAction(this.url.todoList, {}).then(res => {
+                if (res.success) {
+                    this.todoList = res.result || []
+                    console.log('todo页面打印出data结果是:', this.todoList)
+                }
+            })
         }
     }
 }

+ 0 - 15
src/views/user/todoAll/myApply.vue

@@ -1,15 +0,0 @@
-<template>
-  <div id="myApply">
-
-  </div>
-</template>
-
-<script>
-export default {
-
-}
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 15
src/views/user/todoAll/myDone.vue

@@ -1,15 +0,0 @@
-<template>
-  <div id="myDone">
-
-  </div>
-</template>
-
-<script>
-export default {
-
-}
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 15
src/views/user/todoAll/myWait.vue

@@ -1,15 +0,0 @@
-<template>
-  <div id="myWait">
-
-  </div>
-</template>
-
-<script>
-export default {
-
-}
-</script>
-
-<style lang="less" scoped>
-
-</style>