Bladeren bron

排班;首页去加载;

cyy 1 jaar geleden
bovenliggende
commit
25a65ae081

+ 3 - 2
src/api/oauth2/user.js

@@ -89,13 +89,14 @@ export function getValidCode(params) {
  *  根据用户名, 获取用户上下文信息
  *  根据用户名, 获取用户上下文信息
  * @param {*} token
  * @param {*} token
  */
  */
-export function getUserInfo(username) {
+export function getUserInfo(username, load = true) {
   return request({
   return request({
     url: OAUTH2_URL() + '/user/context',
     url: OAUTH2_URL() + '/user/context',
     method: 'post',
     method: 'post',
     params: {
     params: {
       username
       username
-    }
+    },
+    isLoading: load
   })
   })
 }
 }
 
 

+ 6 - 4
src/api/platform/auth/appres.js

@@ -6,18 +6,20 @@ import { AUTH_URL, BPMN_URL } from '@/api/baseUrl'
  * 获取菜单数据
  * 获取菜单数据
  * @param {*} params
  * @param {*} params
  */
  */
-export function getMenuData(params) {
+export function getMenuData(params, load = true) {
   return request({
   return request({
     url: AUTH_URL() + '/auth/appres/getMenuData',
     url: AUTH_URL() + '/auth/appres/getMenuData',
     method: 'get',
     method: 'get',
-    params: params
+    params: params,
+    isLoading: load
   })
   })
 }
 }
 
 
-export function getInfoCount(params) {
+export function getInfoCount(params, load = true) {
   return request({
   return request({
     url: BPMN_URL() + '/bpm/initiated/find/dashboard/mobile',
     url: BPMN_URL() + '/bpm/initiated/find/dashboard/mobile',
     method: 'get',
     method: 'get',
-    params: params
+    params: params,
+    isLoading: load
   })
   })
 }
 }

+ 15 - 0
src/api/platform/system/desktop.js

@@ -0,0 +1,15 @@
+import request from '@/utils/request'
+import { SYSTEM_URL } from '@/api/baseUrl'
+
+/**
+ * 获取数据
+ * @param {*} params
+ */
+export function findAllByCurrUserId(params, load = true) {
+  return request({
+    url: SYSTEM_URL() + '/desktop/facade/calendar/findAllByCurrUserId',
+    method: 'get',
+    params,
+    isLoading: load
+  })
+}

+ 23 - 22
src/api/platform/system/news.js

@@ -1,15 +1,16 @@
-import request from "@/utils/request";
-import { SYSTEM_URL, FORM_URL } from "@/api/baseUrl";
+import request from '@/utils/request'
+import { SYSTEM_URL, FORM_URL } from '@/api/baseUrl'
 /**
 /**
  * 查询列表数据
  * 查询列表数据
  * @param {*} params
  * @param {*} params
  */
  */
-export function queryPageList(params) {
+export function queryPageList(params, load = true) {
   return request({
   return request({
-    url: SYSTEM_URL() + "/system/news/query",
-    method: "post",
-    data: params
-  });
+    url: SYSTEM_URL() + '/system/news/query',
+    method: 'post',
+    data: params,
+    isLoading: load
+  })
 }
 }
 /**
 /**
  * 删除数据
  * 删除数据
@@ -17,11 +18,11 @@ export function queryPageList(params) {
  */
  */
 export function remove(params) {
 export function remove(params) {
   return request({
   return request({
-    url: SYSTEM_URL() + "/system/news/remove",
-    method: "post",
+    url: SYSTEM_URL() + '/system/news/remove',
+    method: 'post',
     isLoading: true,
     isLoading: true,
     params: params
     params: params
-  });
+  })
 }
 }
 /**
 /**
  * 保存数据
  * 保存数据
@@ -29,11 +30,11 @@ export function remove(params) {
  */
  */
 export function save(params) {
 export function save(params) {
   return request({
   return request({
-    url: SYSTEM_URL() + "/system/news/save",
-    method: "post",
+    url: SYSTEM_URL() + '/system/news/save',
+    method: 'post',
     isLoading: true,
     isLoading: true,
     data: params
     data: params
-  });
+  })
 }
 }
 
 
 /**
 /**
@@ -42,10 +43,10 @@ export function save(params) {
  */
  */
 export function get(params) {
 export function get(params) {
   return request({
   return request({
-    url: SYSTEM_URL() + "/system/news/get",
-    method: "get",
+    url: SYSTEM_URL() + '/system/news/get',
+    method: 'get',
     params
     params
-  });
+  })
 }
 }
 
 
 /**
 /**
@@ -54,10 +55,10 @@ export function get(params) {
  */
  */
 export function manage(params) {
 export function manage(params) {
   return request({
   return request({
-    url: FORM_URL() + "/audit/notice/manage",
-    method: "post",
+    url: FORM_URL() + '/audit/notice/manage',
+    method: 'post',
     data: params
     data: params
-  });
+  })
 }
 }
 /**
 /**
  * 推送内审实施计划通知
  * 推送内审实施计划通知
@@ -65,8 +66,8 @@ export function manage(params) {
  */
  */
 export function internal(params) {
 export function internal(params) {
   return request({
   return request({
-    url: FORM_URL() + "/audit/notice/internal",
-    method: "post",
+    url: FORM_URL() + '/audit/notice/internal',
+    method: 'post',
     data: params
     data: params
-  });
+  })
 }
 }

+ 18 - 16
src/business/platform/data/data-template/template.vue

@@ -73,7 +73,7 @@
                       style="display:flex"
                       style="display:flex"
                     >
                     >
                       <span>{{ item.label }}</span>
                       <span>{{ item.label }}</span>
-                      <span>:</span>
+                      <span v-if="item.label!=''">:</span>
                       <field-formatter
                       <field-formatter
                         :label-key="item.bt"
                         :label-key="item.bt"
                         :data="data"
                         :data="data"
@@ -82,20 +82,6 @@
                         :field-type="item.fieldType"
                         :field-type="item.fieldType"
                         :tem ="tem"
                         :tem ="tem"
                       />
                       />
-                      <!-- <span
-                        v-if="
-                          item && item.fieldType !== 'selector' && i !== 'id_'
-                        "
-                        >{{ item.val }}</span
-                      >
-                      <span
-v-else-if="i !== 'id_'"
-                        ><van-tag>{{
-                          selectorArr.find(i => i.id_ === item.val)
-                            ? selectorArr.find(i => i.id_ === item.val).name_
-                            : ''
-                        }}</van-tag></span
-                      > -->
                     </div>
                     </div>
                   </div>
                   </div>
                 </van-checkbox>
                 </van-checkbox>
@@ -436,7 +422,7 @@ export default {
             dl.map(d => {
             dl.map(d => {
               this.cacheData[d[this.valueKey]] = d
               this.cacheData[d[this.valueKey]] = d
               // const objName = Object.keys(d)
               // const objName = Object.keys(d)
-              const fb = d
+              const fb = {...d}
               fb.showlabel = {}
               fb.showlabel = {}
               if (typeof this.tem.display_columns !== 'undefined') {
               if (typeof this.tem.display_columns !== 'undefined') {
                 const keyName = this.dataList.findIndex(t => t.id_ == d.id_)
                 const keyName = this.dataList.findIndex(t => t.id_ == d.id_)
@@ -457,6 +443,22 @@ export default {
                   this.dataList.push(fb)
                   this.dataList.push(fb)
                 } else {
                 } else {
                 }
                 }
+              }else{
+                let b = {}
+                let key = ''
+                for (const k in d) {
+                  b = {
+                    label: '',
+                    bt: k,
+                    val: {},
+                    fieldType: 'text',
+                    fieldOptions: {}
+                  }
+                  key = k
+                }
+                b.val = d[key]
+                fb.showlabel = [b]
+                this.dataList.push(fb)
               }
               }
             })
             })
           }
           }

+ 21 - 18
src/business/platform/data/templaterender/linkdata/index.vue

@@ -66,6 +66,7 @@
       <input v-else :placeholder="placeholder" class="van-field__control" readonly>
       <input v-else :placeholder="placeholder" class="van-field__control" readonly>
       <!-- 数据模版对话框-->
       <!-- 数据模版对话框-->
       <data-template-popup
       <data-template-popup
+        :tem="tem"
         :visible="showPopup"
         :visible="showPopup"
         :template-key="templateKey"
         :template-key="templateKey"
         :params="params"
         :params="params"
@@ -168,7 +169,8 @@ export default {
       templateFields: {}, // 模版字段
       templateFields: {}, // 模版字段
       showPopup: false, // 弹窗
       showPopup: false, // 弹窗
       selectedData: [], // 选中的数据,这个值是用于展示的
       selectedData: [], // 选中的数据,这个值是用于展示的
-      selectedValue: [] // 选中的值 是valueKey的值
+      selectedValue: [], // 选中的值 是valueKey的值
+      tem: {}
     }
     }
   },
   },
   computed: {
   computed: {
@@ -201,7 +203,7 @@ export default {
       const params = {}
       const params = {}
       loadDataTemplateByKey(key, params).then((data) => {
       loadDataTemplateByKey(key, params).then((data) => {
         const template = getDataTemplateListTemplate(data)
         const template = getDataTemplateListTemplate(data)
-
+        this.tem ={...template}
         this.templateFields = buildDataTemplateFields(data.fields)
         this.templateFields = buildDataTemplateFields(data.fields)
         this.buildKey(data, template)
         this.buildKey(data, template)
       }).catch((e) => {
       }).catch((e) => {
@@ -212,23 +214,24 @@ export default {
       this.idKey = dataTemplate['unique']
       this.idKey = dataTemplate['unique']
       this.queryKey = this.getQueryKey(template['query_columns'])
       this.queryKey = this.getQueryKey(template['query_columns'])
       const resultColumns = template['result_columns']
       const resultColumns = template['result_columns']
+      console.log(resultColumns,'resultColumnsresultColumns')
       if (this.$utils.isEmpty(resultColumns)) { return }
       if (this.$utils.isEmpty(resultColumns)) { return }
-      // this.labelKey = resultColumns[0]['name']
-      // if (dataTemplate.showType === 'tree') { // 树形
-      //   this.isTree = true
-      //   const displayColumns = template['display_columns']
-      //   if (this.$utils.isNotEmpty(displayColumns)) {
-      //     this.labelKey = displayColumns['name_key']
-      //     this.idKey = displayColumns['id_key']
-      //     this.parentIdKey = displayColumns['pid_key']
-      //   }
-      // } else if (dataTemplate.showType === 'list') {
-      // this.isTree = false
-      // const displayColumns = template['display_columns']
-      // if (this.$utils.isNotEmpty(displayColumns)) {
-      //   this.labelKey = (displayColumns[0] ? displayColumns[0]['name'] : '') || ''
-      // }
-      // }
+      this.labelKey = resultColumns[0]['name']
+      if (dataTemplate.showType === 'tree') { // 树形
+        this.isTree = true
+        const displayColumns = template['display_columns']
+        if (this.$utils.isNotEmpty(displayColumns)) {
+          this.labelKey = displayColumns['name_key']
+          this.idKey = displayColumns['id_key']
+          this.parentIdKey = displayColumns['pid_key']
+        }
+      } else if (dataTemplate.showType === 'list') {
+      this.isTree = false
+      const displayColumns = template['display_columns']
+      if (this.$utils.isNotEmpty(displayColumns)) {
+        this.labelKey = (displayColumns[0] ? displayColumns[0]['name'] : '') || ''
+      }
+      }
     },
     },
     initSelectedData() {
     initSelectedData() {
       this.selectedValue = this.getArrayValue(this.value)
       this.selectedValue = this.getArrayValue(this.value)

+ 419 - 414
src/router/routes.js

@@ -1,446 +1,451 @@
 /* Layout */
 /* Layout */
-import Layout from '@/views/layout/layout'
-import LayoutInfo from '@/views/layout/layout-info'
-import LayoutDefault from '@/views/layout/layout-default'
+import Layout from "@/views/layout/layout";
+import LayoutInfo from "@/views/layout/layout-info";
+import LayoutDefault from "@/views/layout/layout-default";
 // import Main from '@/views/layout/app-main'
 // import Main from '@/views/layout/app-main'
 
 
 // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
 // 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
-const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
+const _import = require("@/utils/util.import." + process.env.NODE_ENV);
 
 
 /**
 /**
  * 在主框架内显示
  * 在主框架内显示
  */
  */
 const frameIn = [
 const frameIn = [
-    {
-        path: '/',
-        redirect: { name: 'dashboard' },
-        component: Layout,
-        children: [
-            // 首页
-            {
-                path: 'dashboard',
-                name: 'dashboard',
-                meta: {
-                    title: '首页',
-                    auth: true
-                },
-                component: _import('/system/dashboard')
-            },
-            // 刷新页面 必须保留
-            {
-                path: 'refresh',
-                name: 'refresh',
-                hidden: true,
-                component: _import('/system/function/refresh')
-            },
-            // 页面重定向 必须保留
-            {
-                path: 'redirect/:route*',
-                name: 'redirect',
-                hidden: true,
-                component: _import('/system/function/redirect')
-            }
-        ]
-    }
-]
+  {
+    path: "/",
+    redirect: { name: "dashboard" },
+    component: Layout,
+    children: [
+      // 首页
+      {
+        path: "dashboard",
+        name: "dashboard",
+        meta: {
+          title: "首页",
+          auth: true
+        },
+        component: _import("/system/dashboard")
+      },
+      // 刷新页面 必须保留
+      {
+        path: "refresh",
+        name: "refresh",
+        hidden: true,
+        component: _import("/system/function/refresh")
+      },
+      // 页面重定向 必须保留
+      {
+        path: "redirect/:route*",
+        name: "redirect",
+        hidden: true,
+        component: _import("/system/function/redirect")
+      }
+    ]
+  }
+];
 
 
 /**
 /**
  * 在主框架之外显示
  * 在主框架之外显示
  */
  */
 const frameOut = [
 const frameOut = [
-    // 登录
-    {
-        path: '/login',
-        name: 'login',
-        meta: {
-            title: '登录'
-        },
-        component: _import('/system/login')
+  // 登录
+  {
+    path: "/login",
+    name: "login",
+    meta: {
+      title: "登录"
     },
     },
-    {
-        path: '/fileView',
-        name: 'fileView',
-        meta: {
-            title: '文件预览页'
-        },
-        component: _import('/viewFile')
+    component: _import("/system/login")
+  },
+  {
+    path: "/fileView",
+    name: "fileView",
+    meta: {
+      title: "文件预览页"
     },
     },
-    {
-        path: '/iframe',
-        name: 'iframe',
-        meta: {
-            title: 'iframe'
-        },
-        component: _import('/system/iframe')
-    }
-]
+    component: _import("/viewFile")
+  },
+  {
+    path: "/iframe",
+    name: "iframe",
+    meta: {
+      title: "iframe"
+    },
+    component: _import("/system/iframe")
+  }
+];
 
 
 /**
 /**
  * 错误页面
  * 错误页面
  */
  */
 const errorPage = [
 const errorPage = [
-    {
-        path: '/404',
-        name: 'error404',
+  {
+    path: "/404",
+    name: "error404",
+    meta: {
+      title: "404-页面不存在"
+    },
+    hidden: true,
+    component: _import("/system/error/404")
+  },
+  {
+    path: "/401",
+    name: "error401",
+    meta: {
+      title: "401- 未授权"
+    },
+    hidden: true,
+    component: _import("/system/error/401")
+  },
+  {
+    path: "/403",
+    name: "error403",
+    meta: {
+      title: "403-权限不足"
+    },
+    hidden: true,
+    component: _import("/system/error/403")
+  }
+  // {
+  //   path: '/nomenu',
+  //   name: 'nomenu',
+  //   meta: {
+  //     title: '没有菜单资源'
+  //   },
+  //   hidden: true,
+  //   component: _import('/system/error/nomenu')
+  // }
+];
+
+// 自定义
+const frameCustom = [
+  {
+    path: "/next-menu",
+    redirect: "index",
+    component: LayoutInfo,
+    children: [
+      {
+        path: "index",
+        name: "next-menu",
+        meta: { title: "更多", icon: "dashboard" },
+        component: _import("/system/dashboard/next-menu")
+      }
+    ]
+  },
+  // {
+  //   path: '/message',
+  //   component: Layout,
+  //   redirect: 'index',
+  //   children: [
+  //     {
+  //       path: 'index',
+  //       name: 'message',
+  //       meta: { title: '消息', icon: 'message' },
+  //       component:_import('/message/index')
+  //     }, {
+  //       path: 'chat',
+  //       name: 'chat',
+  //       meta: { title: '聊天', icon: 'message' },
+  //       component:_import('/message/index')
+  //     }
+  //   ]
+  // },
+  {
+    path: "/notice",
+    component: Layout,
+    redirect: "index",
+    children: [
+      {
+        path: "index",
+        name: "notice",
+        meta: { title: "公告", icon: "notice" },
+        component: _import("/platform/notice/index")
+      }
+    ]
+  },
+  {
+    path: "/contacts",
+    component: Layout,
+    redirect: "index",
+    children: [
+      {
+        path: "index",
+        name: "contacts",
+        meta: { title: "通讯录", icon: "contacts" },
+        component: _import("/platform/contacts/index")
+      }
+    ]
+  },
+  {
+    path: "/message/inner/receive",
+    component: Layout,
+    redirect: "index",
+    children: [
+      {
+        path: "index",
+        name: "news",
+        meta: { title: "我的消息", icon: "news" },
+        component: _import("/platform/message/inner/receive")
+      }
+    ]
+  },
+  {
+    path: "/my",
+    component: Layout,
+    redirect: "index",
+    children: [
+      {
+        path: "index",
+        name: "my",
+        meta: { title: "我的", icon: "my" },
+        component: _import("/platform/my/index")
+      },
+      {
+        path: "userInfo",
+        name: "userInfo",
         meta: {
         meta: {
-            title: '404-页面不存在'
+          title: "个人信息",
+          icon: "my",
+          isLeftBar: true,
+          isShowBar: false
         },
         },
-        hidden: true,
-        component: _import('/system/error/404')
-    },
-    {
-        path: '/401',
-        name: 'error401',
+        component: _import("/platform/my/user-info")
+      },
+      {
+        path: "changePassword",
+        name: "changePassword",
         meta: {
         meta: {
-            title: '401- 未授权'
+          title: "修改密码",
+          icon: "my",
+          isLeftBar: true,
+          isShowBar: false
         },
         },
-        hidden: true,
-        component: _import('/system/error/401')
-    },
-    {
-        path: '/403',
-        name: 'error403',
+        component: _import("/platform/my/change-password")
+      },
+      // {
+      //   path: 'setting',
+      //   name: 'setting',
+      //   meta: { title: '设置', icon: 'my', isLeftBar: true, isShowBar: false },
+      //   component:_import('/platform/my/setting')
+      // },
+      {
+        path: "help",
+        name: "help",
         meta: {
         meta: {
-            title: '403-权限不足'
+          title: "帮助",
+          icon: "help",
+          isLeftBar: true,
+          isShowBar: false
         },
         },
-        hidden: true,
-        component: _import('/system/error/403')
-    }
-    // {
-    //   path: '/nomenu',
-    //   name: 'nomenu',
-    //   meta: {
-    //     title: '没有菜单资源'
-    //   },
-    //   hidden: true,
-    //   component: _import('/system/error/nomenu')
-    // }
-]
-
-// 自定义
-const frameCustom = [
-    {
-        path: '/next-menu',
-        redirect: 'index',
-        component: LayoutInfo,
-        children: [
-            {
-                path: 'index',
-                name: 'next-menu',
-                meta: { title: '更多', icon: 'dashboard' },
-                component: _import('/system/dashboard/next-menu')
-            }
-        ]
-    },
-    // {
-    //   path: '/message',
-    //   component: Layout,
-    //   redirect: 'index',
-    //   children: [
-    //     {
-    //       path: 'index',
-    //       name: 'message',
-    //       meta: { title: '消息', icon: 'message' },
-    //       component:_import('/message/index')
-    //     }, {
-    //       path: 'chat',
-    //       name: 'chat',
-    //       meta: { title: '聊天', icon: 'message' },
-    //       component:_import('/message/index')
-    //     }
-    //   ]
-    // },
-    {
-        path: '/notice',
-        component: Layout,
-        redirect: 'index',
-        children: [
-            {
-                path: 'index',
-                name: 'notice',
-                meta: { title: '公告', icon: 'notice' },
-                component: _import('/platform/notice/index')
-            }
-        ]
-    },
-    {
-        path: '/contacts',
-        component: Layout,
-        redirect: 'index',
-        children: [
-            {
-                path: 'index',
-                name: 'contacts',
-                meta: { title: '通讯录', icon: 'contacts' },
-                component: _import('/platform/contacts/index')
-            }
-        ]
-    },
-    {
-        path: '/message/inner/receive',
-        component: Layout,
-        redirect: 'index',
-        children: [
-            {
-                path: 'index',
-                name: 'news',
-                meta: { title: '我的消息', icon: 'news' },
-                component: _import('/platform/message/inner/receive')
-            }
-        ]
-    },
-    {
-        path: '/my',
-        component: Layout,
-        redirect: 'index',
-        children: [
-            {
-                path: 'index',
-                name: 'my',
-                meta: { title: '我的', icon: 'my' },
-                component: _import('/platform/my/index')
-            },
-            {
-                path: 'userInfo',
-                name: 'userInfo',
-                meta: {
-                    title: '个人信息',
-                    icon: 'my',
-                    isLeftBar: true,
-                    isShowBar: false
-                },
-                component: _import('/platform/my/user-info')
-            },
-            {
-                path: 'changePassword',
-                name: 'changePassword',
-                meta: {
-                    title: '修改密码',
-                    icon: 'my',
-                    isLeftBar: true,
-                    isShowBar: false
-                },
-                component: _import('/platform/my/change-password')
-            },
-            // {
-            //   path: 'setting',
-            //   name: 'setting',
-            //   meta: { title: '设置', icon: 'my', isLeftBar: true, isShowBar: false },
-            //   component:_import('/platform/my/setting')
-            // },
-            {
-                path: 'help',
-                name: 'help',
-                meta: {
-                    title: '帮助',
-                    icon: 'help',
-                    isLeftBar: true,
-                    isShowBar: false
-                },
-                component: _import('/platform/my/help')
-            },
-            {
-                path: 'aboutUs',
-                name: 'aboutUs',
-                meta: {
-                    title: '关于我们',
-                    icon: 'my',
-                    isLeftBar: true,
-                    isShowBar: false
-                },
-                component: _import('/platform/my/about-us')
-            }
-        ]
-    },
-    {
-        path: '/bpmn',
-        redirect: 'pending',
-        component: LayoutDefault,
-        children: [
-            {
-                path: 'pending/index',
-                name: 'pending',
-                meta: { title: '待办事宜' },
-                component: _import('/platform/bpmn/pending/index')
-            },
-            {
-                path: 'pending-matter/index',
-                name: 'pendingMatter',
-                meta: { title: '待办事宜' },
-                component: _import('/platform/bpmn/pending-matter/index')
-            },
-
-            {
-                path: 'completed/index',
-                name: 'completed',
-                meta: { title: '办结事宜' },
-                component: _import('/platform/bpmn/completed/index')
-            },
-            {
-                path: 'handled/index',
-                name: 'handled',
-                meta: { title: '已办事宜' },
-                component: _import('/platform/bpmn/handled/index')
-            },
-            {
-                path: 'myRequest/index',
-                name: 'myRequest',
-                meta: { title: '我的请求' },
-                component: _import('/platform/bpmn/my-request/index')
-            },
-            {
-                path: 'newProcess/index',
-                name: 'newProcess',
-                meta: { title: '新建流程' },
-                component: _import('/platform/bpmn/new-process/index')
-            },
-            {
-                path: 'myDraft/index',
-                name: 'myDraft',
-                meta: { title: '我的草稿' },
-                component: _import('/platform/bpmn/my-draft/index')
-            },
-            {
-                path: 'myRevoke/index',
-                name: 'myRevoke',
-                meta: { title: '可撤销事务' },
-                component: _import('/platform/bpmn/my-revoke/index')
-            },
-            {
-                path: 'uploadAttachment/index',
-                name: 'uploadAttachment',
-                meta: { title: '上传附件' },
-                component: _import('/platform/bpmn/upload-attachment/index')
-            },
-            {
-                path: 'myCompleted/index',
-                name: 'myCompleted',
-                meta: { title: '我结束的流程' },
-                component: _import('/platform/bpmn/my-completed/index')
-            },
+        component: _import("/platform/my/help")
+      },
+      {
+        path: "aboutUs",
+        name: "aboutUs",
+        meta: {
+          title: "关于我们",
+          icon: "my",
+          isLeftBar: true,
+          isShowBar: false
+        },
+        component: _import("/platform/my/about-us")
+      }
+    ]
+  },
+  {
+    path: "/bpmn",
+    redirect: "pending",
+    component: LayoutDefault,
+    children: [
+      {
+        path: "pending/index",
+        name: "pending",
+        meta: { title: "待办事宜" },
+        component: _import("/platform/bpmn/pending/index")
+      },
+      {
+        path: "pending-matter/index",
+        name: "pendingMatter",
+        meta: { title: "待办事宜" },
+        component: _import("/platform/bpmn/pending-matter/index")
+      },
 
 
-            {
-                path: 'taskChange/index',
-                name: 'taskChange',
-                meta: { title: '我的转办代理' },
-                component: _import('/platform/bpmn/task-change/index')
-            },
-            {
-                path: 'taskChangeDetail',
-                name: 'taskChangeDetail',
-                meta: { title: '详细信息' },
-                component: _import('/platform/bpmn/task-change/detail')
-            },
-            {
-                path: 'reminders/index',
-                name: 'reminders',
-                meta: { title: '催办事宜' },
-                component: _import('/platform/bpmn/reminders/index')
-            },
-            {
-                path: 'documents/documents',
-                name: 'documents',
-                meta: { title: '查阅文件' },
-                component: _import('/platform/bpmn/documents/documents')
-            },
-            {
-                path: 'documents/test',
-                name: 'test',
-                meta: { title: '查阅文件' },
-                component: _import('/platform/bpmn/documents/test')
-            },
-            {
-                path: 'myTest/index',
-                name: 'myTest',
-                meta: { title: '我的考试' },
-                component: _import('/platform/bpmn/my-test/index')
-            },
-            {
-                path: 'siginin/index',
-                name: 'siginin',
-                meta: { title: '签到' },
-                component: _import('/platform/bpmn/siginin/index')
-            },
-            {
-                path: 'report/oralReport',
-                name: 'oralReport',
-                meta: { title: '口头报告查询' },
-                component: _import('/platform/bpmn/report/oralReport')
-            },
-            {
-                path: 'report/delayReport',
-                name: 'delayReport',
-                meta: { title: '延迟报告查询' },
-                component: _import('/platform/bpmn/report/delayReport')
-            },
-            {
-                path: 'addiInspect/index',
-                name: 'addiInspect',
-                meta: { title: '附加检验申请' },
-                component: _import('/platform/bpmn/addiInspect/index')
-            },
-            {
-                path: 'communication/communicationList',
-                name: 'communicationList',
-                meta: { title: '信息沟通' },
-                component: _import('/platform/bpmn/communication/communicationList')
-            },
-            {
-                path: 'complaint/complaintList',
-                name: 'complaintList',
-                meta: { title: '投诉列表' },
-                component: _import('/platform/bpmn/complaint/complaintList')
-            },
-            {
-                path: 'satisfaction/satisfaction',
-                name: 'satisfaction',
-                meta: { title: '满意度评价' },
-                component: _import('/platform/bpmn/satisfaction/satisfaction')
-            }
-        ]
-    },
-    {
-        path: '/message/inner/receive',
-        component: _import('/platform/message/inner/receive'),
-        name: 'messageInnerReceive',
-        meta: { title: '我的消息' }
-    },
-    {
-        path: '/d/list/:id(\\w+)',
-        component: _import('/platform/data/template-list'),
-        name: 'dataTemplateList',
-        meta: { title: '模版' }
-    },
-    // {
-    //   path: '/d/form',
-    //   component:_import('/platform/data/template-form'),
-    //   name: 'dataTemplateform',
-    //   meta: { title: '表单明细' }
-    // },
-    {
-        path: '/demo',
-        component: LayoutInfo,
-        redirect: 'form',
-        children: [
-            {
-                path: 'form',
-                name: 'demoForm',
-                meta: { title: '表单Demo', icon: 'table' },
-                component: _import('/demo/form')
-            }
-            //     {
-            //       path: 'toolbar',
-            //       name: 'demoToolbar',
-            //       meta: { title: '工具栏', icon: 'toolbar' },
-            //       component:_import('/demo/toolbar')
-            //     }
-        ]
-    },
-    { path: '*', redirect: '/404', hidden: true }
-]
+      {
+        path: "completed/index",
+        name: "completed",
+        meta: { title: "办结事宜" },
+        component: _import("/platform/bpmn/completed/index")
+      },
+      {
+        path: "handled/index",
+        name: "handled",
+        meta: { title: "已办事宜" },
+        component: _import("/platform/bpmn/handled/index")
+      },
+      {
+        path: "myRequest/index",
+        name: "myRequest",
+        meta: { title: "我的请求" },
+        component: _import("/platform/bpmn/my-request/index")
+      },
+      {
+        path: "newProcess/index",
+        name: "newProcess",
+        meta: { title: "新建流程" },
+        component: _import("/platform/bpmn/new-process/index")
+      },
+      {
+        path: "myDraft/index",
+        name: "myDraft",
+        meta: { title: "我的草稿" },
+        component: _import("/platform/bpmn/my-draft/index")
+      },
+      {
+        path: "myRevoke/index",
+        name: "myRevoke",
+        meta: { title: "可撤销事务" },
+        component: _import("/platform/bpmn/my-revoke/index")
+      },
+      {
+        path: "uploadAttachment/index",
+        name: "uploadAttachment",
+        meta: { title: "上传附件" },
+        component: _import("/platform/bpmn/upload-attachment/index")
+      },
+      {
+        path: "myCompleted/index",
+        name: "myCompleted",
+        meta: { title: "我结束的流程" },
+        component: _import("/platform/bpmn/my-completed/index")
+      },
+      {
+        path: "taskChange/index",
+        name: "taskChange",
+        meta: { title: "我的转办代理" },
+        component: _import("/platform/bpmn/task-change/index")
+      },
+      {
+        path: "taskChangeDetail",
+        name: "taskChangeDetail",
+        meta: { title: "详细信息" },
+        component: _import("/platform/bpmn/task-change/detail")
+      },
+      {
+        path: "reminders/index",
+        name: "reminders",
+        meta: { title: "催办事宜" },
+        component: _import("/platform/bpmn/reminders/index")
+      },
+      {
+        path: "documents/documents",
+        name: "documents",
+        meta: { title: "查阅文件" },
+        component: _import("/platform/bpmn/documents/documents")
+      },
+      {
+        path: "documents/test",
+        name: "test",
+        meta: { title: "查阅文件" },
+        component: _import("/platform/bpmn/documents/test")
+      },
+      {
+        path: "myTest/index",
+        name: "myTest",
+        meta: { title: "我的考试" },
+        component: _import("/platform/bpmn/my-test/index")
+      },
+      {
+        path: "siginin/index",
+        name: "siginin",
+        meta: { title: "签到" },
+        component: _import("/platform/bpmn/siginin/index")
+      },
+      {
+        path: "report/oralReport",
+        name: "oralReport",
+        meta: { title: "口头报告查询" },
+        component: _import("/platform/bpmn/report/oralReport")
+      },
+      {
+        path: "report/delayReport",
+        name: "delayReport",
+        meta: { title: "延迟报告查询" },
+        component: _import("/platform/bpmn/report/delayReport")
+      },
+      {
+        path: "addiInspect/index",
+        name: "addiInspect",
+        meta: { title: "附加检验申请" },
+        component: _import("/platform/bpmn/addiInspect/index")
+      },
+      {
+        path: "communication/communicationList",
+        name: "communicationList",
+        meta: { title: "信息沟通" },
+        component: _import("/platform/bpmn/communication/communicationList")
+      },
+      {
+        path: "complaint/complaintList",
+        name: "complaintList",
+        meta: { title: "投诉列表" },
+        component: _import("/platform/bpmn/complaint/complaintList")
+      },
+      {
+        path: "satisfaction/satisfaction",
+        name: "satisfaction",
+        meta: { title: "满意度评价" },
+        component: _import("/platform/bpmn/satisfaction/satisfaction")
+      },
+      {
+        path: "mySchedule/index",
+        name: "mySchedule",
+        meta: { title: "我的排班" },
+        component: _import("/platform/bpmn/my-schedule/index")
+      }
+    ]
+  },
+  {
+    path: "/message/inner/receive",
+    component: _import("/platform/message/inner/receive"),
+    name: "messageInnerReceive",
+    meta: { title: "我的消息" }
+  },
+  {
+    path: "/d/list/:id(\\w+)",
+    component: _import("/platform/data/template-list"),
+    name: "dataTemplateList",
+    meta: { title: "模版" }
+  },
+  // {
+  //   path: '/d/form',
+  //   component:_import('/platform/data/template-form'),
+  //   name: 'dataTemplateform',
+  //   meta: { title: '表单明细' }
+  // },
+  {
+    path: "/demo",
+    component: LayoutInfo,
+    redirect: "form",
+    children: [
+      {
+        path: "form",
+        name: "demoForm",
+        meta: { title: "表单Demo", icon: "table" },
+        component: _import("/demo/form")
+      }
+      //     {
+      //       path: 'toolbar',
+      //       name: 'demoToolbar',
+      //       meta: { title: '工具栏', icon: 'toolbar' },
+      //       component:_import('/demo/toolbar')
+      //     }
+    ]
+  },
+  { path: "*", redirect: "/404", hidden: true }
+];
 
 
 // 导出需要显示菜单的
 // 导出需要显示菜单的
-export const frameInRoutes = frameIn
+export const frameInRoutes = frameIn;
 
 
 // 重新组织后导出
 // 重新组织后导出
-export default [...frameIn, ...frameOut, ...errorPage, ...frameCustom]
+export default [...frameIn, ...frameOut, ...errorPage, ...frameCustom];

+ 97 - 97
src/store/modules/ibps/modules/user.js

@@ -1,5 +1,5 @@
-import { getUserInfo } from "@/api/oauth2/user";
-import common from "@/utils/common";
+import { getUserInfo } from '@/api/oauth2/user'
+import common from '@/utils/common'
 
 
 export default {
 export default {
   namespaced: true,
   namespaced: true,
@@ -7,9 +7,9 @@ export default {
     // 用户信息
     // 用户信息
     info: {},
     info: {},
     // 帐号
     // 帐号
-    account: "",
+    account: '',
     // 切换的账号
     // 切换的账号
-    switchAccount: "",
+    switchAccount: '',
     // 是否开启注册
     // 是否开启注册
     regOpen: false
     regOpen: false
   },
   },
@@ -22,21 +22,21 @@ export default {
     set({ state, dispatch }, info) {
     set({ state, dispatch }, info) {
       return new Promise(async resolve => {
       return new Promise(async resolve => {
         // store 赋值
         // store 赋值
-        state.info = info;
+        state.info = info
         // 持久化
         // 持久化
         await dispatch(
         await dispatch(
-          "ibps/db/set",
+          'ibps/db/set',
           {
           {
-            dbName: "sys",
-            path: "user.info",
+            dbName: 'sys',
+            path: 'user.info',
             value: info,
             value: info,
             user: true
             user: true
           },
           },
           { root: true }
           { root: true }
-        );
+        )
         // end
         // end
-        resolve();
-      });
+        resolve()
+      })
     },
     },
     /**
     /**
      * @description 从数据库取用户数据
      * @description 从数据库取用户数据
@@ -46,74 +46,74 @@ export default {
       return new Promise(async resolve => {
       return new Promise(async resolve => {
         // store 赋值
         // store 赋值
         state.info = await dispatch(
         state.info = await dispatch(
-          "ibps/db/get",
+          'ibps/db/get',
           {
           {
-            dbName: "sys",
-            path: "user.info",
+            dbName: 'sys',
+            path: 'user.info',
             defaultValue: {},
             defaultValue: {},
             user: true
             user: true
           },
           },
           { root: true }
           { root: true }
-        );
+        )
         // end
         // end
-        resolve();
-      });
+        resolve()
+      })
     },
     },
     /**
     /**
      * @description 从数据库取用户数据
      * @description 从数据库取用户数据
      * @param {Object} context
      * @param {Object} context
      */
      */
     load({ state, dispatch }) {
     load({ state, dispatch }) {
-      return new Promise(async (resolve, reject) => {
-        await dispatch("getAccount");
-        getUserInfo(state.account)
+      return new Promise(async(resolve, reject) => {
+        await dispatch('getAccount')
+        getUserInfo(state.account, false)
           .then(async response => {
           .then(async response => {
             if (!response) {
             if (!response) {
-              reject(response);
+              reject(response)
             }
             }
-            const info = response.data;
+            const info = response.data
             // 设置当前
             // 设置当前
-            await dispatch("set", info);
-            let level = {};
+            await dispatch('set', info)
+            let level = {}
             if (info.positions && info.positions.length) {
             if (info.positions && info.positions.length) {
               // 当存在第二级为空时,说明具备最高级权限
               // 当存在第二级为空时,说明具备最高级权限
               const hasFirst = info.positions.some(
               const hasFirst = info.positions.some(
-                obj => obj.path.split(".")[1] === ""
-              );
+                obj => obj.path.split('.')[1] === ''
+              )
               level = {
               level = {
                 first: [
                 first: [
-                  ...new Set(info.positions.map(obj => obj.path.split(".")[0]))
-                ].join(","),
+                  ...new Set(info.positions.map(obj => obj.path.split('.')[0]))
+                ].join(','),
                 second: hasFirst
                 second: hasFirst
-                  ? ""
+                  ? ''
                   : [
                   : [
-                      ...new Set(
-                        info.positions.map(obj => obj.path.split(".")[1])
-                      )
-                    ].join(",")
-              };
-              await dispatch("ibps/param/setLevel", level, {
+                    ...new Set(
+                      info.positions.map(obj => obj.path.split('.')[1])
+                    )
+                  ].join(',')
+              }
+              await dispatch('ibps/param/setLevel', level, {
                 root: true
                 root: true
-              });
+              })
             }
             }
             // 获取所有用户信息
             // 获取所有用户信息
-            await dispatch("getRoleList", level);
+            await dispatch('getRoleList', level)
             // 获取所有用户信息
             // 获取所有用户信息
-            await dispatch("getUserList", level);
+            await dispatch('getUserList', level)
             // 获取所有部门信息
             // 获取所有部门信息
-            await dispatch("getDeptList", level);
+            await dispatch('getDeptList', level)
             // 获取所有流程信息
             // 获取所有流程信息
-            await dispatch("getFlowList", level);
+            await dispatch('getFlowList', level)
             // // 获取当前子系统
             // // 获取当前子系统
             // await dispatch('ibps/system/loadSystem', null, {
             // await dispatch('ibps/system/loadSystem', null, {
             //   root: true
             //   root: true
             // })
             // })
-            resolve(info);
+            resolve(info)
           })
           })
           .catch(error => {
           .catch(error => {
-            reject(error);
-          });
-      });
+            reject(error)
+          })
+      })
     },
     },
     /**
     /**
      * 获取用户名
      * 获取用户名
@@ -123,37 +123,37 @@ export default {
       return new Promise(async resolve => {
       return new Promise(async resolve => {
         // store 赋值
         // store 赋值
         state.account = await dispatch(
         state.account = await dispatch(
-          "ibps/db/get",
+          'ibps/db/get',
           {
           {
-            dbName: "sys",
-            path: "account",
-            defaultValue: "",
+            dbName: 'sys',
+            path: 'account',
+            defaultValue: '',
             user: true
             user: true
           },
           },
           { root: true }
           { root: true }
-        );
+        )
         // end
         // end
-        resolve();
-      });
+        resolve()
+      })
     },
     },
     setAccount({ state, dispatch }, account) {
     setAccount({ state, dispatch }, account) {
       return new Promise(async resolve => {
       return new Promise(async resolve => {
         // store 赋值
         // store 赋值
-        state.account = account;
+        state.account = account
         // 持久化
         // 持久化
         await dispatch(
         await dispatch(
-          "ibps/db/set",
+          'ibps/db/set',
           {
           {
-            dbName: "sys",
-            path: "account",
+            dbName: 'sys',
+            path: 'account',
             value: account,
             value: account,
             user: true
             user: true
           },
           },
           { root: true }
           { root: true }
-        );
+        )
         // end
         // end
-        resolve();
-      });
+        resolve()
+      })
     },
     },
     /**
     /**
      * 获取所有角色
      * 获取所有角色
@@ -162,21 +162,21 @@ export default {
       const params = second
       const params = second
         ? `'%${second}%' or entity.id_ = '${first}'`
         ? `'%${second}%' or entity.id_ = '${first}'`
         : first
         : first
-        ? `'%${first}%'`
-        : "%%";
-      const sql = `select * from ibps_party_role`;
+          ? `'%${first}%'`
+          : '%%'
+      const sql = `select * from ibps_party_role`
       common
       common
-        .request("sql", sql)
+        .request('sql', sql)
         .then(res => {
         .then(res => {
-          const { data = [] } = res.variables || {};
-          dispatch("ibps/param/setRoleList", data, {
+          const { data = [] } = res.variables || {}
+          dispatch('ibps/param/setRoleList', data, {
             root: true
             root: true
-          });
+          })
         })
         })
         .catch(error => {
         .catch(error => {
-          console.log(error);
-          alert("获取所有角色信息失败!");
-        });
+          console.log(error)
+          alert('获取所有角色信息失败!')
+        })
     },
     },
     /**
     /**
      * 获取所有系统用户账号
      * 获取所有系统用户账号
@@ -185,21 +185,21 @@ export default {
       const params = second
       const params = second
         ? `'%${second}%' or entity.id_ = '${first}'`
         ? `'%${second}%' or entity.id_ = '${first}'`
         : first
         : first
-        ? `'%${first}%'`
-        : "%%";
-      const sql = `select users.id_ as userId, users.name_ as userName, ifnull(users.mobile_, '') as phone, ifnull(group_concat(distinct positions.id_ order by positions.id_ separator ','), '') as positionId, ifnull(group_concat(distinct positions.name_ order by positions.id_ separator ','), '') as positions, ifnull(group_concat(distinct roles.id_ order by roles.role_note_ asc separator ','), '') as roleId, ifnull(group_concat(distinct roles.name_ order by roles.role_note_ asc separator ','), '') as roles, (select ifnull(people.qian_zi_tu_wen_, '') from t_ryjbqk as people where people.parent_id_ = users.id_) as signatureId, (select ifnull(files.file_name_, '') from ibps_file_attachment as files where files.id_ = signatureId) as signatureName from ibps_party_employee as users left join (select ur.user_id_, r.role_note_, group_concat(distinct r.id_ order by r.id_ separator ',') as id_, group_concat(distinct r.name_ order by r.id_ separator ',') as name_ from ibps_party_user_role as ur join ibps_party_role as r on ur.role_id_ = r.id_ group by ur.user_id_) as roles on users.id_ = roles.user_id_ left join ibps_party_entity as positions on find_in_set(positions.id_, users.positions_) where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params})) group by users.id_`;
+          ? `'%${first}%'`
+          : '%%'
+      const sql = `select users.id_ as userId, users.name_ as userName, ifnull(users.mobile_, '') as phone, ifnull(group_concat(distinct positions.id_ order by positions.id_ separator ','), '') as positionId, ifnull(group_concat(distinct positions.name_ order by positions.id_ separator ','), '') as positions, ifnull(group_concat(distinct roles.id_ order by roles.role_note_ asc separator ','), '') as roleId, ifnull(group_concat(distinct roles.name_ order by roles.role_note_ asc separator ','), '') as roles, (select ifnull(people.qian_zi_tu_wen_, '') from t_ryjbqk as people where people.parent_id_ = users.id_) as signatureId, (select ifnull(files.file_name_, '') from ibps_file_attachment as files where files.id_ = signatureId) as signatureName from ibps_party_employee as users left join (select ur.user_id_, r.role_note_, group_concat(distinct r.id_ order by r.id_ separator ',') as id_, group_concat(distinct r.name_ order by r.id_ separator ',') as name_ from ibps_party_user_role as ur join ibps_party_role as r on ur.role_id_ = r.id_ group by ur.user_id_) as roles on users.id_ = roles.user_id_ left join ibps_party_entity as positions on find_in_set(positions.id_, users.positions_) where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params})) group by users.id_`
       common
       common
-        .request("sql", sql)
+        .request('sql', sql)
         .then(res => {
         .then(res => {
-          const { data = [] } = res.variables || {};
-          dispatch("ibps/param/setUserList", data, {
+          const { data = [] } = res.variables || {}
+          dispatch('ibps/param/setUserList', data, {
             root: true
             root: true
-          });
+          })
         })
         })
         .catch(error => {
         .catch(error => {
-          console.log(error);
-          alert("获取所有用户信息失败!");
-        });
+          console.log(error)
+          alert('获取所有用户信息失败!')
+        })
     },
     },
     /**
     /**
      * 获取所有系统部门信息
      * 获取所有系统部门信息
@@ -208,40 +208,40 @@ export default {
       const params = second
       const params = second
         ? ` and (pe.path_ like '%${second}%' or pe.id_ = '${first}')`
         ? ` and (pe.path_ like '%${second}%' or pe.id_ = '${first}')`
         : first
         : first
-        ? ` and pe.path_ like '%${first}%'`
-        : "";
+          ? ` and pe.path_ like '%${first}%'`
+          : ''
       // const sql = `select id_ as positionId, name_ as positionName, path_ as path, depth_ as depth, sn_ as sn from ibps_party_entity where party_type_ = 'position'${params} order by depth_ asc, sn_ asc`
       // const sql = `select id_ as positionId, name_ as positionName, path_ as path, depth_ as depth, sn_ as sn from ibps_party_entity where party_type_ = 'position'${params} order by depth_ asc, sn_ asc`
-      const sql = `select pe.id_ as positionId, pe.name_ as positionName, pe.path_ as path, pe.depth_ as depth, pe.sn_ as sn, ifnull(r.name_, '') as manager, ifnull(r.id_, '') as managerId from ibps_party_entity as pe left join (select em.id_, em.positions_, em.name_ from ibps_party_employee as em left join ibps_party_user_role as ur on em.id_ = ur.user_id_ left join ibps_party_role as pr on pr.id_ = ur.role_id_ where role_alias_ in ('zhsfzr', 'syszr', 'zhglzzc')) as r on find_in_set(pe.id_, r.positions_) > 0 where pe.party_type_ = 'position'${params} group by pe.id_ order by pe.depth_ asc, pe.sn_ asc,pe.id_ asc`;
+      const sql = `select pe.id_ as positionId, pe.name_ as positionName, pe.path_ as path, pe.depth_ as depth, pe.sn_ as sn, ifnull(r.name_, '') as manager, ifnull(r.id_, '') as managerId from ibps_party_entity as pe left join (select em.id_, em.positions_, em.name_ from ibps_party_employee as em left join ibps_party_user_role as ur on em.id_ = ur.user_id_ left join ibps_party_role as pr on pr.id_ = ur.role_id_ where role_alias_ in ('zhsfzr', 'syszr', 'zhglzzc')) as r on find_in_set(pe.id_, r.positions_) > 0 where pe.party_type_ = 'position'${params} group by pe.id_ order by pe.depth_ asc, pe.sn_ asc,pe.id_ asc`
       common
       common
-        .request("sql", sql)
+        .request('sql', sql)
         .then(res => {
         .then(res => {
-          const { data = [] } = res.variables || {};
-          dispatch("ibps/param/setDeptList", data, {
+          const { data = [] } = res.variables || {}
+          dispatch('ibps/param/setDeptList', data, {
             root: true
             root: true
-          });
+          })
         })
         })
         .catch(error => {
         .catch(error => {
-          console.log(error);
-          alert("获取所有部门信息失败!");
-        });
+          console.log(error)
+          alert('获取所有部门信息失败!')
+        })
     },
     },
     /**
     /**
      * 获取所有可展示流程信息
      * 获取所有可展示流程信息
      */
      */
     getFlowList({ state, dispatch }, { first, second }) {
     getFlowList({ state, dispatch }, { first, second }) {
-      const sql = `select * from t_applcgl`;
+      const sql = `select * from t_applcgl`
       common
       common
-        .request("sql", sql)
+        .request('sql', sql)
         .then(res => {
         .then(res => {
-          const { data = [] } = res.variables || {};
-          dispatch("ibps/param/setflowList", data, {
+          const { data = [] } = res.variables || {}
+          dispatch('ibps/param/setflowList', data, {
             root: true
             root: true
-          });
+          })
         })
         })
         .catch(error => {
         .catch(error => {
-          console.log(error);
-          alert("获取所有流程信息失败!");
-        });
+          console.log(error)
+          alert('获取所有流程信息失败!')
+        })
     }
     }
   }
   }
-};
+}

+ 97 - 97
src/utils/common.js

@@ -1,52 +1,52 @@
 // 通用工具类,定义通用函数及常用接口
 // 通用工具类,定义通用函数及常用接口
-import { mapValues } from "lodash";
-import { encryptByAes } from "@/utils/encrypt";
+import { mapValues } from 'lodash'
+import { encryptByAes } from '@/utils/encrypt'
 // import { preview } from '@/business/platform/form/utils/custom/preview'
 // import { preview } from '@/business/platform/form/utils/custom/preview'
-import request from "./joinCURD";
-import getRequest from "./general";
-import pinyin4js from "pinyin4js";
-import { snapshoot } from "@/api/platform/file/attachment";
-import { getNextIdByAlias } from "@/api/platform/system/identity";
-import { save as sendMsg } from "@/api/platform/message/innerMessage";
-import { save as saveNews, manage, internal } from "@/api/platform/system/news";
-import { bpmTaskSave } from "@/api/platform/bpmn/bpmTask";
+import request from './joinCURD'
+import getRequest from './general'
+import pinyin4js from 'pinyin4js'
+import { snapshoot } from '@/api/platform/file/attachment'
+import { getNextIdByAlias } from '@/api/platform/system/identity'
+import { save as sendMsg } from '@/api/platform/message/innerMessage'
+import { save as saveNews, manage, internal } from '@/api/platform/system/news'
+import { bpmTaskSave } from '@/api/platform/bpmn/bpmTask'
 // import { onlyOfficeToPdf } from '@/api/platform/form/seal'
 // import { onlyOfficeToPdf } from '@/api/platform/form/seal'
-import { downloadFile as download } from "@/business/platform/file/utils";
+import { downloadFile as download } from '@/business/platform/file/utils'
 // import { removeFormData } from '@/api/platform/data/dataTemplate'
 // import { removeFormData } from '@/api/platform/data/dataTemplate'
 // 引入工具类
 // 引入工具类
-import Utils from "@/utils/util";
-import ActionUtils from "@/utils/action";
+import Utils from '@/utils/util'
+import ActionUtils from '@/utils/action'
 
 
 // base64解码
 // base64解码
 const decode = str =>
 const decode = str =>
   decodeURIComponent(
   decodeURIComponent(
     window
     window
       .atob(str)
       .atob(str)
-      .split("")
+      .split('')
       .map(c => `%${`00${c.charCodeAt(0).toString(16)}`.slice(-2)}`)
       .map(c => `%${`00${c.charCodeAt(0).toString(16)}`.slice(-2)}`)
-      .join("")
-  );
+      .join('')
+  )
 
 
 // 下载
 // 下载
 export const downloadByBlob = (o, name) => {
 export const downloadByBlob = (o, name) => {
   if (!(o instanceof Blob)) {
   if (!(o instanceof Blob)) {
-    return;
+    return
   }
   }
 
 
   if (window.navigator.msSaveBlob) {
   if (window.navigator.msSaveBlob) {
-    window.navigator.msSaveBlob(o, name);
+    window.navigator.msSaveBlob(o, name)
   } else {
   } else {
-    const URL = window.URL || window.webkitURL || window;
-    const e = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
-    e.href = URL.createObjectURL(o);
-    e.download = name;
+    const URL = window.URL || window.webkitURL || window
+    const e = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
+    e.href = URL.createObjectURL(o)
+    e.download = name
 
 
     if (document.all) {
     if (document.all) {
-      e.click();
+      e.click()
     } else {
     } else {
-      const ev = document.createEvent("MouseEvents");
+      const ev = document.createEvent('MouseEvents')
       ev.initMouseEvent(
       ev.initMouseEvent(
-        "click",
+        'click',
         true,
         true,
         false,
         false,
         window,
         window,
@@ -60,54 +60,54 @@ export const downloadByBlob = (o, name) => {
         false,
         false,
         0,
         0,
         null
         null
-      );
-      e.dispatchEvent(ev);
+      )
+      e.dispatchEvent(ev)
     }
     }
   }
   }
-};
+}
 
 
 // 获取当前时间
 // 获取当前时间
 export const getDateNow = (length = 10, formatType) => {
 export const getDateNow = (length = 10, formatType) => {
-  if (formatType === "string") {
+  if (formatType === 'string') {
     return new Date(new Date().getTime() + 28800000)
     return new Date(new Date().getTime() + 28800000)
       .toJSON()
       .toJSON()
       .slice(0, length)
       .slice(0, length)
-      .replace(/[-:T]/g, "");
+      .replace(/[-:T]/g, '')
   }
   }
   return new Date(new Date().getTime() + 28800000)
   return new Date(new Date().getTime() + 28800000)
     .toJSON()
     .toJSON()
     .slice(0, length)
     .slice(0, length)
-    .replace("T", " ");
-};
+    .replace('T', ' ')
+}
 
 
 // 获取指定值后的日期
 // 获取指定值后的日期
 export const getDate = (type, value, date) => {
 export const getDate = (type, value, date) => {
-  const d = date || getDateNow(19);
+  const d = date || getDateNow(19)
   if (
   if (
-    typeof type !== "string" ||
+    typeof type !== 'string' ||
     !Number.isInteger(value) ||
     !Number.isInteger(value) ||
-    typeof d !== "string"
+    typeof d !== 'string'
   ) {
   ) {
-    console.log("参数类型错误");
-    return null;
+    console.log('参数类型错误')
+    return null
   }
   }
-  const now = new Date(d);
+  const now = new Date(d)
   const D = {
   const D = {
     day: value * 24 * 60 * 60 * 1000,
     day: value * 24 * 60 * 60 * 1000,
     hour: value * 60 * 60 * 1000,
     hour: value * 60 * 60 * 1000,
     minute: value * 60 * 1000,
     minute: value * 60 * 1000,
     second: value * 1000
     second: value * 1000
-  };
-  const year = now.getFullYear();
-  const month = now.getMonth();
-  const day = now.getDate();
-  const hour = now.getHours();
-  const minute = now.getMinutes();
-  const second = now.getSeconds();
+  }
+  const year = now.getFullYear()
+  const month = now.getMonth()
+  const day = now.getDate()
+  const hour = now.getHours()
+  const minute = now.getMinutes()
+  const second = now.getSeconds()
 
 
   switch (type) {
   switch (type) {
-    case "year": {
-      const isLeapYear = new Date(year + value, 1, 29).getDate() === 29;
+    case 'year': {
+      const isLeapYear = new Date(year + value, 1, 29).getDate() === 29
       return new Date(
       return new Date(
         year + value,
         year + value,
         isLeapYear && month === 1 && day === 29 ? 1 : month,
         isLeapYear && month === 1 && day === 29 ? 1 : month,
@@ -115,19 +115,19 @@ export const getDate = (type, value, date) => {
         hour,
         hour,
         minute,
         minute,
         second
         second
-      );
+      )
     }
     }
-    case "month": {
-      let newYear = year;
-      let newMonth = month + value;
+    case 'month': {
+      let newYear = year
+      let newMonth = month + value
       if (newMonth < 0) {
       if (newMonth < 0) {
-        newYear -= Math.ceil(Math.abs(newMonth) / 12);
-        newMonth = 12 - (Math.abs(newMonth) % 12);
+        newYear -= Math.ceil(Math.abs(newMonth) / 12)
+        newMonth = 12 - (Math.abs(newMonth) % 12)
       } else if (newMonth > 11) {
       } else if (newMonth > 11) {
-        newYear += Math.floor(newMonth / 12);
-        newMonth = newMonth % 12;
+        newYear += Math.floor(newMonth / 12)
+        newMonth = newMonth % 12
       }
       }
-      const isLeapMonth = new Date(newYear, newMonth + 1, 0).getDate() === 29;
+      const isLeapMonth = new Date(newYear, newMonth + 1, 0).getDate() === 29
       return new Date(
       return new Date(
         newYear,
         newYear,
         isLeapMonth && month === 1 && day === 29 ? 1 : newMonth,
         isLeapMonth && month === 1 && day === 29 ? 1 : newMonth,
@@ -135,62 +135,62 @@ export const getDate = (type, value, date) => {
         hour,
         hour,
         minute,
         minute,
         second
         second
-      );
+      )
     }
     }
-    case "day":
-    case "hour":
-    case "minute":
-    case "second":
-      return new Date(now.getTime() + D[type]);
+    case 'day':
+    case 'hour':
+    case 'minute':
+    case 'second':
+      return new Date(now.getTime() + D[type])
     default:
     default:
-      console.log("无效的日期类型");
-      return null;
+      console.log('无效的日期类型')
+      return null
   }
   }
-};
+}
 
 
 // 时间格式化
 // 时间格式化
 export const getFormatDate = (type, length, date = new Date()) => {
 export const getFormatDate = (type, length, date = new Date()) => {
-  const now = new Date(new Date(date).getTime());
+  const now = new Date(new Date(date).getTime())
   // eslint-disable-next-line
   // eslint-disable-next-line
   if (now == "Invalid Date") {
   if (now == "Invalid Date") {
-    console.log("非法日期,无法格式化");
-    return date;
+    console.log('非法日期,无法格式化')
+    return date
   }
   }
-  const year = now.getFullYear();
-  const month = now.getMonth() + 1;
-  const day = now.getDate();
-  const hours = now.getHours();
-  const minutes = now.getMinutes();
-  const seconds = now.getSeconds();
+  const year = now.getFullYear()
+  const month = now.getMonth() + 1
+  const day = now.getDate()
+  const hours = now.getHours()
+  const minutes = now.getMinutes()
+  const seconds = now.getSeconds()
   // 补零
   // 补零
   const padZero = num => {
   const padZero = num => {
-    return num.toString().padStart(2, "0");
-  };
+    return num.toString().padStart(2, '0')
+  }
   // 默认返回String类型
   // 默认返回String类型
   let result = `${year}-${padZero(month)}-${padZero(day)} ${padZero(
   let result = `${year}-${padZero(month)}-${padZero(day)} ${padZero(
     hours
     hours
-  )}:${padZero(minutes)}:${padZero(seconds)}`;
+  )}:${padZero(minutes)}:${padZero(seconds)}`
   switch (type) {
   switch (type) {
-    case "string":
+    case 'string':
       result = `${year}-${padZero(month)}-${padZero(day)} ${padZero(
       result = `${year}-${padZero(month)}-${padZero(day)} ${padZero(
         hours
         hours
-      )}:${padZero(minutes)}:${padZero(seconds)}`;
-      break;
-    case "cn":
+      )}:${padZero(minutes)}:${padZero(seconds)}`
+      break
+    case 'cn':
       result = `${year}年${padZero(month)}月${padZero(day)}日 ${padZero(
       result = `${year}年${padZero(month)}月${padZero(day)}日 ${padZero(
         hours
         hours
-      )}时${padZero(minutes)}分${padZero(seconds)}秒`;
-      break;
-    case "number":
+      )}时${padZero(minutes)}分${padZero(seconds)}秒`
+      break
+    case 'number':
       result = `${year}${padZero(month)}${padZero(day)}${padZero(
       result = `${year}${padZero(month)}${padZero(day)}${padZero(
         hours
         hours
-      )}${padZero(minutes)}${padZero(seconds)}`;
-      break;
+      )}${padZero(minutes)}${padZero(seconds)}`
+      break
     default:
     default:
-      break;
+      break
   }
   }
-  return result.slice(0, length || result.length);
-};
+  return result.slice(0, length || result.length)
+}
 
 
 /**
 /**
  * 替换对象中的null为空字符串
  * 替换对象中的null为空字符串
@@ -199,19 +199,19 @@ export const getFormatDate = (type, length, date = new Date()) => {
 export const replaceNullWithEmpty = obj => {
 export const replaceNullWithEmpty = obj => {
   function replaceValue(value) {
   function replaceValue(value) {
     if (value === null) {
     if (value === null) {
-      return "";
-    } else if (typeof value === "object") {
+      return ''
+    } else if (typeof value === 'object') {
       if (Array.isArray(value)) {
       if (Array.isArray(value)) {
-        return value.map(item => replaceValue(item));
+        return value.map(item => replaceValue(item))
       } else {
       } else {
-        return mapValues(value, v => replaceValue(v));
+        return mapValues(value, v => replaceValue(v))
       }
       }
     } else {
     } else {
-      return value;
+      return value
     }
     }
   }
   }
-  return replaceValue(obj);
-};
+  return replaceValue(obj)
+}
 
 
 export default {
 export default {
   // preview,
   // preview,
@@ -238,4 +238,4 @@ export default {
   Utils,
   Utils,
   ActionUtils,
   ActionUtils,
   getRequest
   getRequest
-};
+}

+ 121 - 116
src/utils/validate.js

@@ -7,8 +7,8 @@
  * 版权:广州流辰信息技术有限公司
  * 版权:广州流辰信息技术有限公司
  * </pre>
  * </pre>
  */
  */
-import i18n from '@/utils/i18n'
-import utils from '@/utils/util'
+import i18n from "@/utils/i18n";
+import utils from "@/utils/util";
 
 
 /**
 /**
  * 字段验证
  * 字段验证
@@ -17,13 +17,13 @@ import utils from '@/utils/util'
  * @param {*} callback
  * @param {*} callback
  */
  */
 export function testField(rule, value, callback) {
 export function testField(rule, value, callback) {
-  const res = /^[A-Za-z]{1}([a-zA-Z0-9_]{1,17})$/
+  const res = /^[A-Za-z]{1}([a-zA-Z0-9_]{1,17})$/;
   if (!res.test(value) && value.length < 19) {
   if (!res.test(value) && value.length < 19) {
-    callback(new Error('首字符为字母,其它只允许为字母、数字或下划线!'))
+    callback(new Error("首字符为字母,其它只允许为字母、数字或下划线!"));
   } else if ((!res.test(value) || res.test(value)) && value.length > 19) {
   } else if ((!res.test(value) || res.test(value)) && value.length > 19) {
-    callback(new Error('长度不超过18字符'))
+    callback(new Error("长度不超过18字符"));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
 }
 }
 
 
@@ -34,15 +34,15 @@ export function testField(rule, value, callback) {
  * @param {*} callback
  * @param {*} callback
  */
  */
 export function validateEmpty(rule, value, callback) {
 export function validateEmpty(rule, value, callback) {
-  const pattern = /\s/
+  const pattern = /\s/;
   if (rule.required) {
   if (rule.required) {
-    callback(new Error(rule.message || i18n.t('validate.required')))
+    callback(new Error(rule.message || i18n.t("validate.required")));
   } else {
   } else {
     if (pattern.test(value)) {
     if (pattern.test(value)) {
-      callback(new Error('字符请勿携带空格'))
-      return
+      callback(new Error("字符请勿携带空格"));
+      return;
     }
     }
-    callback()
+    callback();
   }
   }
 }
 }
 
 
@@ -54,10 +54,10 @@ export function validateEmpty(rule, value, callback) {
  */
  */
 export function validateRequired(rule, value, callback) {
 export function validateRequired(rule, value, callback) {
   if (utils.isEmpty(utils.trim(value))) {
   if (utils.isEmpty(utils.trim(value))) {
-    callback(new Error(rule.message || i18n.t('validate.required')))
-    return
+    callback(new Error(rule.message || i18n.t("validate.required")));
+    return;
   }
   }
-  callback()
+  callback();
 }
 }
 
 
 /**
 /**
@@ -66,9 +66,9 @@ export function validateRequired(rule, value, callback) {
  */
  */
 export function isNumber(value) {
 export function isNumber(value) {
   if (isNaN(value)) {
   if (isNaN(value)) {
-    return false
+    return false;
   }
   }
-  return typeof value === 'number'
+  return typeof value === "number";
 }
 }
 /**
 /**
  * 验证整数
  * 验证整数
@@ -78,27 +78,27 @@ export function isNumber(value) {
  */
  */
 export const validateInteger = (rule, value, callback) => {
 export const validateInteger = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
-  value = Number(value)
+  value = Number(value);
   if (isNumber(value) && parseInt(value, 10) === value && value <= 2147483647) {
   if (isNumber(value) && parseInt(value, 10) === value && value <= 2147483647) {
-    callback()
+    callback();
   } else {
   } else {
-    callback(new Error(rule.message || i18n.t('validate.integer')))
+    callback(new Error(rule.message || i18n.t("validate.integer")));
   }
   }
-}
+};
 
 
 export const validateFloat = (rule, value, callback) => {
 export const validateFloat = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
-  const re = /^-?\d*\.\d+$/
+  const re = /^-?\d*\.\d+$/;
   if (!re.test(value) || !isNumber(Number(value))) {
   if (!re.test(value) || !isNumber(Number(value))) {
-    callback(new Error('填写只能为浮点型'))
+    callback(new Error("填写只能为浮点型"));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /**
 /**
  * 验证key或者变量
  * 验证key或者变量
@@ -106,8 +106,8 @@ export const validateFloat = (rule, value, callback) => {
  * @param {*} str
  * @param {*} str
  */
  */
 export function testKey(str) {
 export function testKey(str) {
-  const reg = /^[a-zA-Z][a-zA-Z0-9_]*$/
-  return reg.test(str)
+  const reg = /^[a-zA-Z][a-zA-Z0-9_]*$/;
+  return reg.test(str);
 }
 }
 
 
 /**
 /**
@@ -116,8 +116,8 @@ export function testKey(str) {
  * @param {*} str
  * @param {*} str
  */
  */
 export function testBizKey(str) {
 export function testBizKey(str) {
-  const reg = /^[a-zA-Z][a-zA-Z0-9_-]*$/
-  return reg.test(str)
+  const reg = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
+  return reg.test(str);
 }
 }
 
 
 /**
 /**
@@ -126,8 +126,8 @@ export function testBizKey(str) {
  * @param {*} str
  * @param {*} str
  */
  */
 export function testUpperCaseKey(str) {
 export function testUpperCaseKey(str) {
-  const reg = /^[A-Z][a-zA-Z0-9]*$/
-  return reg.test(str)
+  const reg = /^[A-Z][a-zA-Z0-9]*$/;
+  return reg.test(str);
 }
 }
 /**
 /**
  * 验证类名key
  * 验证类名key
@@ -137,14 +137,14 @@ export function testUpperCaseKey(str) {
  */
  */
 export const validateUpperCaseKey = (rule, value, callback) => {
 export const validateUpperCaseKey = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testUpperCaseKey(value)) {
   if (!testUpperCaseKey(value)) {
-    callback(new Error('规则不合法,只能以大写字母开头,允许字母、数字!'))
+    callback(new Error("规则不合法,只能以大写字母开头,允许字母、数字!"));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /**
 /**
  * 验证key
  * 验证key
@@ -154,19 +154,19 @@ export const validateUpperCaseKey = (rule, value, callback) => {
  */
  */
 export const validateKey = (rule, value, callback) => {
 export const validateKey = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testKey(value)) {
   if (!testKey(value)) {
-    callback(new Error(rule.message || i18n.t('validate.key')))
+    callback(new Error(rule.message || i18n.t("validate.key")));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /* 合法url */
 /* 合法url */
 export function testURL(textval) {
 export function testURL(textval) {
-  const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
-  return urlregex.test(textval)
+  const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
+  return urlregex.test(textval);
 }
 }
 /**
 /**
  * 验证url
  * 验证url
@@ -176,19 +176,19 @@ export function testURL(textval) {
  */
  */
 export const validateURL = (rule, value, callback) => {
 export const validateURL = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testURL(value)) {
   if (!testURL(value)) {
-    callback(new Error(rule.message || i18n.t('validate.url')))
+    callback(new Error(rule.message || i18n.t("validate.url")));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /* 小写字母 */
 /* 小写字母 */
 export function testLowerCase(str) {
 export function testLowerCase(str) {
-  const reg = /^[a-z]+$/
-  return reg.test(str)
+  const reg = /^[a-z]+$/;
+  return reg.test(str);
 }
 }
 
 
 /**
 /**
@@ -199,19 +199,19 @@ export function testLowerCase(str) {
  */
  */
 export const validateLowerCase = (rule, value, callback) => {
 export const validateLowerCase = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testLowerCase(value)) {
   if (!testLowerCase(value)) {
-    callback(new Error(rule.message || i18n.t('validate.lowerCase')))
+    callback(new Error(rule.message || i18n.t("validate.lowerCase")));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /* 大写字母 */
 /* 大写字母 */
 export function testUpperCase(str) {
 export function testUpperCase(str) {
-  const reg = /^[A-Z]+$/
-  return reg.test(str)
+  const reg = /^[A-Z]+$/;
+  return reg.test(str);
 }
 }
 /**
 /**
  * 验证大写字母
  * 验证大写字母
@@ -221,19 +221,19 @@ export function testUpperCase(str) {
  */
  */
 export const validateUpperCase = (rule, value, callback) => {
 export const validateUpperCase = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testUpperCase(value)) {
   if (!testUpperCase(value)) {
-    callback(new Error(rule.message || i18n.t('validate.upperCase')))
+    callback(new Error(rule.message || i18n.t("validate.upperCase")));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /* 大小写字母 */
 /* 大小写字母 */
 export function testAlphabets(str) {
 export function testAlphabets(str) {
-  const reg = /^[A-Za-z]+$/
-  return reg.test(str)
+  const reg = /^[A-Za-z]+$/;
+  return reg.test(str);
 }
 }
 
 
 /**
 /**
@@ -244,14 +244,14 @@ export function testAlphabets(str) {
  */
  */
 export const validatAlphabets = (rule, value, callback) => {
 export const validatAlphabets = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
   if (!testAlphabets(value)) {
   if (!testAlphabets(value)) {
-    callback(new Error(rule.message || i18n.t('validate.alphabets')))
+    callback(new Error(rule.message || i18n.t("validate.alphabets")));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 /**
 /**
  * 多少选项
  * 多少选项
  * @param {*} rule
  * @param {*} rule
@@ -260,28 +260,28 @@ export const validatAlphabets = (rule, value, callback) => {
  */
  */
 export const validateOptions = (rule, value, callback) => {
 export const validateOptions = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
 
 
-  let arrayValue = []
+  let arrayValue = [];
   if (utils.isArray(value)) {
   if (utils.isArray(value)) {
-    arrayValue = value
+    arrayValue = value;
   } else {
   } else {
-    arrayValue = value.split(',') || []
+    arrayValue = value.split(",") || [];
   }
   }
-  const item = arrayValue.length
-  const min = rule.min
-  const max = rule.max
+  const item = arrayValue.length;
+  const min = rule.min;
+  const max = rule.max;
   if (min && !max && item < min) {
   if (min && !max && item < min) {
-    callback(new Error(rule.message || `至少选择 ${min}项`))
+    callback(new Error(rule.message || `至少选择 ${min}项`));
   } else if (max && !min && item > max) {
   } else if (max && !min && item > max) {
-    callback(new Error(rule.message || `最多选择 ${max}项`))
+    callback(new Error(rule.message || `最多选择 ${max}项`));
   } else if (min && max && (item < min || item > max)) {
   } else if (min && max && (item < min || item > max)) {
-    callback(new Error(rule.message || `选择的选项在${min}至${max}项`))
+    callback(new Error(rule.message || `选择的选项在${min}至${max}项`));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /**
 /**
  * 验证长度
  * 验证长度
@@ -290,58 +290,64 @@ export const validateOptions = (rule, value, callback) => {
  * @param {*} callback
  * @param {*} callback
  */
  */
 export const validateLengthRange = (rule, value, callback) => {
 export const validateLengthRange = (rule, value, callback) => {
-  const min = typeof rule.min === 'number'
-  const max = typeof rule.max === 'number'
+  const min = typeof rule.min === "number";
+  const max = typeof rule.max === "number";
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    callback()
-    return
+    callback();
+    return;
   }
   }
-  let val = value
+  let val = value;
   if (rule.format) {
   if (rule.format) {
-    val = rule.format(val)
+    val = rule.format(val);
   }
   }
-  const length = val.length
+  const length = val.length;
   if (min && !max && length < rule.min) {
   if (min && !max && length < rule.min) {
-    callback(new Error(rule.message || `最少填写${rule.min}个字符`))
+    callback(new Error(rule.message || `最少填写${rule.min}个字符`));
   } else if (max && !min && length > rule.max) {
   } else if (max && !min && length > rule.max) {
-    callback(new Error(rule.message || `最多填写${rule.max}个字符`))
+    callback(new Error(rule.message || `最多填写${rule.max}个字符`));
   } else if (min && max && (length < rule.min || length > rule.max)) {
   } else if (min && max && (length < rule.min || length > rule.max)) {
     if (rule.min === rule.max) {
     if (rule.min === rule.max) {
-      callback(new Error(rule.message || `必须填写${rule.min}个字符`))
+      callback(new Error(rule.message || `必须填写${rule.min}个字符`));
     } else {
     } else {
-      callback(new Error(rule.message || `填写字符个数在 ${rule.min} - ${rule.max}之间`))
+      callback(
+        new Error(
+          rule.message || `填写字符个数在 ${rule.min} - ${rule.max}之间`
+        )
+      );
     }
     }
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 export const validateNumberRange = (rule, value, callback) => {
 export const validateNumberRange = (rule, value, callback) => {
-  const min = typeof rule.min === 'number'
-  const max = typeof rule.max === 'number'
+  const min = typeof rule.min === "number";
+  const max = typeof rule.max === "number";
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    callback()
-    return
+    callback();
+    return;
   }
   }
   if (utils.isNumber(value)) {
   if (utils.isNumber(value)) {
-    callback(new Error('无效数字'))
-    return
+    callback(new Error("无效数字"));
+    return;
   }
   }
-  const val = Number(value)
+  const val = Number(value);
   if (min && !max && val < rule.min) {
   if (min && !max && val < rule.min) {
-    callback(new Error(rule.message || `必须大于或等于${rule.min}`))
+    callback(new Error(rule.message || `必须大于或等于${rule.min}`));
   } else if (max && !min && val > rule.max) {
   } else if (max && !min && val > rule.max) {
-    callback(new Error(rule.message || `必须小于或等于${rule.max}`))
+    callback(new Error(rule.message || `必须小于或等于${rule.max}`));
   } else if (min && max && (val < rule.min || val > rule.max)) {
   } else if (min && max && (val < rule.min || val > rule.max)) {
     if (rule.min === rule.max) {
     if (rule.min === rule.max) {
-      callback(new Error(rule.message || `必须填写为${rule.min}`))
+      callback(new Error(rule.message || `必须填写为${rule.min}`));
     } else {
     } else {
-      callback(new Error(rule.message || `必须在 ${rule.min} 到 ${rule.max}之间`))
+      callback(
+        new Error(rule.message || `必须在 ${rule.min} 到 ${rule.max}之间`)
+      );
     }
     }
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 /**
 /**
  * 验证小数位
  * 验证小数位
@@ -351,32 +357,31 @@ export const validateNumberRange = (rule, value, callback) => {
  */
  */
 export const validateDecimal = (rule, value, callback) => {
 export const validateDecimal = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
-  const len = (value + '').replace(/^[^.]*[.]*/, '').length
+  const len = (value + "").replace(/^[^.]*[.]*/, "").length;
   if (len > rule.decimal) {
   if (len > rule.decimal) {
-    callback(new Error(rule.message || `小数位不能超过${rule.decimal}位`))
+    callback(new Error(rule.message || `小数位不能超过${rule.decimal}位`));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
+};
 
 
 export const validateDateBetween = (rule, value, callback) => {
 export const validateDateBetween = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
 
 
-  callback()
-}
+  callback();
+};
 
 
 export const validatePattern = (rule, value, callback) => {
 export const validatePattern = (rule, value, callback) => {
   if (utils.isEmpty(value)) {
   if (utils.isEmpty(value)) {
-    return validateEmpty(rule, value, callback)
+    return validateEmpty(rule, value, callback);
   }
   }
-  if (rule.dataFormat && !rule.dataFormat.test(value)) {
-    callback(new Error(rule.message || `请按正确格式输入`))
+  if (rule.dataFormat && !new RegExp(rule.dataFormat).test(value)) {
+    callback(new Error(rule.message || `请按正确格式输入`));
   } else {
   } else {
-    callback()
+    callback();
   }
   }
-}
-
+};

+ 448 - 0
src/views/platform/bpmn/my-schedule/index.vue

@@ -0,0 +1,448 @@
+<template>
+  <div ref="mySchedule" class="mySchedule20240907">
+    <div>
+      <van-nav-bar
+        :title="'我的排班'"
+        :left-text="$t('common.button.back')"
+        left-arrow
+        @click-left="$router.push({ name: 'dashboard' })"
+      />
+    </div>
+    <van-tabs
+      v-model="active"
+      color="#3396FB"
+      line-width="40"
+      @click="onClickTab"
+    >
+      <van-tab v-for="(item, i) in activeArr" :key="i" :name="item" :title="item">
+        <!-- <template #title>
+            <div class="badge">
+              {{data.title}}
+              <div class="icon">{{ data.val*1>100?'99+':data.val }}</div>
+            </div>
+        </template> -->
+      </van-tab>
+    </van-tabs>
+    <van-calendar
+      :key="showChange"
+      :show-subtitle="false"
+      :poppable="false"
+      :show-confirm="false"
+      :default-date="null"
+      :style="{ height: '50%',width: '96%', margin: '2% auto', borderRadius: '10px'}"
+      :min-date="minDate"
+      :max-date="maxDate"
+      :formatter="formatter"
+      color="#1989fa"
+      row-height="65"
+      @select="optFor"
+    >
+      <template #title>
+        <div class="customTitle">
+          <van-icon name="arrow-left" color="#1989fa" @click="changeMonthIndex(-1)" />
+          <div class="hTitle">{{ yearMonth.year +'年'+yearMonth.month+'月' }}</div>
+          <van-icon name="arrow" color="#1989fa" @click="changeMonthIndex(1)"  />
+        </div>
+      </template>
+    </van-calendar>
+    <div v-show="showInfo&&infoDataArr.length>0" class="infoMessage">
+      <van-collapse v-model="collapseSelect">
+        <van-collapse-item v-for="(item, i) in infoDataArr" :key="item.id" :name="i">
+          <template #title>
+            <div class="collapseTitle">{{item.title}}</div>
+            <div class="collapseTime">
+              <div class="flexState"><span :class="'stateBG'+item.emergencyState">{{stateObj[item.emergencyState]}}</span></div>
+              <span>{{item.startTime}}</span>
+              <span v-if="item.startTime!=item.endTime" class="solstice">至</span>
+              <span v-if="item.startTime!=item.endTime">{{item.endTime}}</span>
+            </div>
+            <div class="collapseContent">内容:{{item.content}}</div>
+          </template>
+          <div class="contentArea">
+            <div class="caLeft">标题:</div>
+            <div class="caRight">{{item.title}}</div>
+          </div>
+          <div class="contentArea">
+            <div class="caLeft">内容:</div>
+            <div class="caRight">{{item.content}}</div>
+          </div>
+        </van-collapse-item>
+      </van-collapse>
+    </div>
+  </div>
+</template>
+<script>
+import { findAllByCurrUserId } from '@/api/platform/system/desktop'
+export default {
+  data() {
+    const { userId } = this.$store.getters
+    return {
+      userId,
+      active: '排班',
+      activeArr: ['排班', '日程'],
+      minDate: null,
+      maxDate: null,
+      dateArr: [],
+      configArr: [],
+      showDateArr: {},
+      infoDataArr: [],
+      stateObj: {
+        1: '急',
+        2: '重',
+        3: '轻',
+        4: '缓'
+      },
+      yearMonth: {},
+      monthIndex: 0,
+      showChange: 0,
+      showInfo: false,
+      collapseSelect: []
+    }
+  },
+  watch: {
+    monthIndex: {
+      handler(newVal) {
+        this.yearMonth = this.getYearMonth(newVal)
+        const mid = this.getMonthStartEnd(this.yearMonth.year, this.yearMonth.month)
+        this.minDate = mid.start
+        this.maxDate = mid.end
+        this.dateArr = this.generationDate(this.minDate, this.maxDate, 'date')
+        this.onClickTab(this.active)
+      },
+      deep: true,
+      immediate: true
+    }
+  },
+  created() {
+  },
+  mounted() {
+    this.$refs.mySchedule.style.height = document.documentElement.clientHeight + 'px'
+  },
+  methods: {
+    // 初始化和tab切换函数
+    onClickTab(val) {
+      this.showInfo = false
+      if (val === '日程') {
+        const time = this.$common.getFormatDate('string', 7, this.yearMonth.year + '-' + this.yearMonth.month)
+        this.calendar().then(res => {
+          if (res.length > 0) {
+            const objArr = {}
+            const mid = []
+            const maxt = new Date(this.$common.getFormatDate('string', 10, this.maxDate) + ' 24:00:00').getTime()
+            const mint = new Date(this.$common.getFormatDate('string', 19, this.minDate)).getTime()
+            res.forEach((item, i) => {
+              const st = new Date(item.startTime + ' 00:00:00').getTime()
+              const et = new Date(item.endTime + ' 24:00:00').getTime()
+              if (item.startTime.indexOf(time) !== -1 || item.endTime.indexOf(time) !== -1 || ((st <= mint) && (et >= maxt))) {
+                mid.push(item)
+              }
+            })
+            mid.forEach((item, i) => {
+              const dArr = this.generationDate(item.startTime, item.endTime)
+              dArr.forEach((t, n) => {
+                if (objArr.hasOwnProperty(t)) {
+                  objArr[t].dataArr.push(item)
+                  objArr[t].num += 1
+                } else {
+                  objArr[t] = { dataArr: [item], num: 1 }
+                }
+              })
+            })
+            this.homologousDate(this.dateArr, objArr)
+          }
+        })
+      } else {
+        this.schedule().then(res => {
+          if (res.length > 0) {
+            const objArr = {}
+            res.forEach((item, i) => {
+              const dArr = this.generationDate(item.start_date_, item.end_date_)
+              // let config = JSON.parse(item.config_)
+              dArr.forEach((t, n) => {
+                if (objArr.hasOwnProperty(t)) {
+                  // const strArr = objArr[t].name.split(',')
+                  // if (strArr.findIndex(e => e === (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')) === -1) {
+                  objArr[t].name = objArr[t].name + ',' + (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
+                  // }
+
+                  // console.log(1, objArr[t].name, item['d' + (n + 1) + '_'], objArr[t].name + ',' + item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
+
+                  // let configMsg = config.scheduleStaff.find(d=>{})
+                } else {
+                  objArr[t] = { name: item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '' }
+                }
+              })
+            })
+            this.homologousDate(this.dateArr, objArr)
+          }
+        })
+      }
+    },
+    //
+    optFor(val) {
+      const selectDate = this.$common.getFormatDate('string', 10, val)
+      if (this.active === '日程' && this.showDateArr[selectDate] !== '') {
+        this.infoDataArr = this.showDateArr[selectDate].dataArr
+        this.showInfo = true
+      } else {
+        this.showInfo = false
+      }
+    },
+    // 排班数据请求
+    async schedule() {
+      const min = this.$common.getFormatDate('string', 10, this.minDate)
+      const max = this.$common.getFormatDate('string', 10, this.maxDate)
+      const sql = `select a.id_ as fid, a.start_date_, a.end_date_, a.config_, a.overview_, b.* from t_schedule_detail b join t_schedule a on a.id_ = b.parent_id_ where b.user_id_ = '${this.userId}' and (CAST(a.start_date_ AS DATE) between '${min}' and '${max}'  or  CAST(a.end_date_ AS DATE) between '${min}' and '${max}' or (CAST(a.start_date_ AS DATE) < '${min}' and CAST(a.end_date_ AS DATE)>'${max}') )`
+      return new Promise((resolve, reject) => {
+        this.$common.request('sql', sql).then(res => {
+          const data = res.variables.data || []
+          this.showChange += 1
+          resolve(data)
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
+
+    // 日历数据请求
+    async calendar() {
+      return new Promise((resolve, reject) => {
+        findAllByCurrUserId().then(res => {
+          const data = res.data || []
+          this.showChange += 1
+          resolve(data)
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
+
+    // 日历备注赋值
+    formatter(day) {
+      const formatterDate = this.$common.getFormatDate('string', 10, day.date)
+      const year = day.date.getFullYear()
+      const month = day.date.getMonth() + 1
+      const date = day.date.getDate()
+      if (year === this.yearMonth.nowYear && month === this.yearMonth.nowMonth && date === this.yearMonth.nowDay) {
+        day.className = 'circle'
+        day.topInfo = ' '
+      }
+      if (this.active === '排班') {
+        day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].name ? this.showDateArr[formatterDate].name : '' : ''
+      } else {
+        day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].num ? this.showDateArr[formatterDate].num + '项' : '' : ''
+      }
+
+      return day
+    },
+
+    // 部分日期数据对应塞入对应整月日期
+    homologousDate(all, party) {
+      Object.assign(this.showDateArr, {})
+      const data = {}
+      all.forEach((item, i) => {
+        if (party.hasOwnProperty(item)) {
+          data[item] = party[item]
+        } else {
+          data[item] = ''
+        }
+      })
+      this.showDateArr = data
+    },
+
+    // 月份更改
+    changeMonthIndex(val) {
+      this.monthIndex = this.monthIndex + val
+    },
+
+    // 获取月份起止日期
+    getMonthStartEnd(year, month) {
+      const start = new Date(year, month - 1, 1)
+      const end = new Date(year, month, 0)
+      const sqlend = new Date(year, month, 0)
+      return { start: start, end: end, sqlend: sqlend }
+    },
+
+    // 获取年月
+    getYearMonth(val) {
+      const date = new Date()
+      const nowYear = date.getFullYear()
+      const nowMonth = date.getMonth() + 1
+      const nowDay = date.getDate()
+      date.setMonth(date.getMonth() + val)
+      return { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate(), nowYear: nowYear, nowMonth: nowMonth, nowDay: nowDay }
+    },
+
+    // 根据起止日期输出范围内所有日期
+    generationDate(start, end, type = 'string') {
+      const dateArr = []
+      const startArr = type === 'date' ? this.$common.getFormatDate('string', 10, start).split('-') : start.split('-')
+      const endArr = type === 'date' ? this.$common.getFormatDate('string', 10, end).split('-') : end.split('-')
+      const db = new Date()
+      db.setUTCFullYear(startArr[0], startArr[1] - 1, startArr[2])
+      const de = new Date()
+      de.setUTCFullYear(endArr[0], endArr[1] - 1, endArr[2])
+      const unixDb = db.getTime()
+      const unixDe = de.getTime()
+      let stamp
+      const oneDay = 24 * 60 * 60 * 1000
+      for (stamp = unixDb; stamp <= unixDe;) {
+        dateArr.push(this.$common.getFormatDate('string', 10, new Date(parseInt(stamp))))
+        stamp = stamp + oneDay
+      }
+      return dateArr
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.mySchedule20240907 {
+  width: 100%;
+  background-color: #f3f5f9;
+  .omit{
+    width: 100%;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+  .customTitle{
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    height: 100%;
+    .hTitle{
+      margin: 0 15%;
+    }
+  }
+  .infoMessage {
+    // background-color: #ecf5ff;
+    // color: #1989fa;
+    // border: 1px solid #b3d8ff;
+    height:30%;
+    width: 96%;
+    margin: 0 auto;
+    border-radius: 6px;
+    overflow-y: scroll;
+    .contentArea{
+      display: flex;
+      font-size: 90%;
+      .caLeft{
+        width: 12%;
+      }
+      .caRight{
+        width: 88%;
+      }
+    }
+    ::v-deep .van-cell__title{
+      width: 95%;
+      .collapseTitle{
+        @extend .omit;
+        font-size: 100%;
+        font-weight: bold;
+      }
+      .collapseTime{
+        display: flex;
+        align-items: center;
+        color: #1989fa;
+        .flexState{
+          width: 13%;
+          .stateBG{
+            // display: inline-block;
+            border-radius: 20px;
+            padding: 7% 28%;
+            color: #fff;
+            font-size: 68%;
+          }
+          .stateBG1{
+            @extend .stateBG;
+            background-color: #e7505a;
+          }
+          .stateBG2{
+            @extend .stateBG;
+            background-color: #f3c200;
+          }
+          .stateBG3{
+            @extend .stateBG;
+            background-color: #578ebe;
+          }
+          .stateBG4{
+            @extend .stateBG;
+            background-color: #1BBC9B;
+          }
+        }
+        .solstice{
+          color: #000;
+          margin: 0 2%
+        }
+      }
+      .collapseContent{
+        @extend .omit;
+        color: #969799;
+        font-size: 90%;
+      }
+
+    }
+
+  }
+  .infoMessage::-webkit-scrollbar{
+    width: 0;
+  }
+  ::v-deep .van-nav-bar{
+    background-color: transparent;
+  }
+  ::v-deep .van-tabs__nav{
+    background-color: transparent;
+  }
+  ::v-deep .van-calendar__month-title{
+    display: none;
+  }
+  ::v-deep .van-calendar__header{
+    height: 15%;
+    box-shadow: none;
+  }
+  ::v-deep .van-calendar__header-title {
+    height: 65%;
+  }
+
+  ::v-deep .van-calendar__day .van-calendar__bottom-info{
+    @extend .omit;
+    background-color: #ecf5ff;
+    color: #1989fa;
+    border-radius: 6px;
+    position: absolute;
+    left: 50%;
+    bottom: 3%;
+    transform: translateX(-50%);
+    width: 85%;
+    padding: 4% 0;
+    border: 1px solid #b3d8ff;
+  }
+  ::v-deep .van-calendar__day .van-calendar__selected-day{
+    height: inherit;
+  }
+  ::v-deep .van-calendar__day .van-calendar__selected-day .van-calendar__bottom-info{
+    @extend .omit;
+    background-color: #1989fa;
+    color: #fff;
+    border-radius: 6px;
+    position: absolute;
+    left: 50%;
+    bottom: 3%;
+    transform: translateX(-50%);
+    // width: inherit;
+    padding: 4% 0;
+    border: none;
+  }
+  ::v-deep .colorY .van-calendar__bottom-info{
+    // color: yellow;
+  }
+  ::v-deep .circle .van-calendar__top-info{
+    width: 4px;
+    height: 4px;
+    margin: 20% auto;
+    background-color: #1989fa;
+    border-radius: 6px;
+  }
+}
+
+</style>

+ 95 - 17
src/views/system/dashboard/index.vue

@@ -88,21 +88,21 @@
             </h2>
             </h2>
           </template>
           </template>
           <van-grid :column-num="4" :border="false" class="avatar-grid">
           <van-grid :column-num="4" :border="false" class="avatar-grid">
-            <!-- <van-grid-item
+            <van-grid-item
               v-for="menu in dashboard[childrenKey]"
               v-for="menu in dashboard[childrenKey]"
               :key="menu[aliasKey]"
               :key="menu[aliasKey]"
               :badge="getBadge(menu)"
               :badge="getBadge(menu)"
               :text="getText(menu)"
               :text="getText(menu)"
               @click.native="onClick(menu)"
               @click.native="onClick(menu)"
-            > -->
+            >
 
 
             <!-- 过滤原因暂时隐藏总数 -->
             <!-- 过滤原因暂时隐藏总数 -->
-            <van-grid-item
+            <!-- <van-grid-item
               v-for="menu in dashboard[childrenKey]"
               v-for="menu in dashboard[childrenKey]"
               :key="menu[aliasKey]"
               :key="menu[aliasKey]"
               :text="getText(menu)"
               :text="getText(menu)"
               @click.native="onClick(menu)"
               @click.native="onClick(menu)"
-            >
+            > -->
               <template #icon>
               <template #icon>
                 <ibps-avatar
                 <ibps-avatar
                   :icon="menu.icon"
                   :icon="menu.icon"
@@ -167,7 +167,9 @@ import TreeUtils from '@/utils/tree'
 import i18n from '@/utils/i18n' // Internationalization 国际化
 import i18n from '@/utils/i18n' // Internationalization 国际化
 import IbpsAvatar from '@/components/ibps-avatar'
 import IbpsAvatar from '@/components/ibps-avatar'
 import NoticeDialog from '@/views/platform/notice/edit'
 import NoticeDialog from '@/views/platform/notice/edit'
-import menu from './menu.json'
+// import menu from './menu.json'
+import { findAllByCurrUserId } from '@/api/platform/system/desktop'
+
 // 透明图片
 // 透明图片
 const BLANK =
 const BLANK =
   'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
   'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
@@ -200,8 +202,7 @@ export default {
       emptyNoticeData: false,
       emptyNoticeData: false,
       activeDashboards: [],
       activeDashboards: [],
       noticeVisible: false,
       noticeVisible: false,
-      noticeId: '',
-      outList: menu
+      noticeId: ''
     }
     }
   },
   },
   created() {
   created() {
@@ -227,7 +228,8 @@ export default {
       return i18n.generateTitle(menu[this.aliasKey], menu[this.labelKey])
       return i18n.generateTitle(menu[this.aliasKey], menu[this.labelKey])
     },
     },
     getBadge(menu) {
     getBadge(menu) {
-      const info = this.countInfo[menu[this.aliasKey]]
+      const info = menu.alias === 'mySchedule' ? this.countInfo[menu[this.aliasKey]] : '0'
+
       if (this.$utils.isNotEmpty(info)) {
       if (this.$utils.isNotEmpty(info)) {
         return info > 99 ? '99+' : info === '0' ? '' : info
         return info > 99 ? '99+' : info === '0' ? '' : info
       }
       }
@@ -258,13 +260,13 @@ export default {
         }
         }
         this.emptyData = !(this.dashboards.length > 0)
         this.emptyData = !(this.dashboards.length > 0)
       } else {
       } else {
-        getMenuData()
+        getMenuData({}, false)
           .then(response => {
           .then(response => {
             const data = response.data
             const data = response.data
             const listData = data.filter(d => {
             const listData = data.filter(d => {
               return d.id !== '0'
               return d.id !== '0'
             })
             })
-            listData.sort((a, b) => a.id*1 - b.id*1);
+            listData.sort((a, b) => a.id * 1 - b.id * 1)
             this.dashboards = TreeUtils.transformToTreeFormat(listData, {
             this.dashboards = TreeUtils.transformToTreeFormat(listData, {
               idKey: this.idKey,
               idKey: this.idKey,
               parentIdKey: this.parentIdKey,
               parentIdKey: this.parentIdKey,
@@ -287,14 +289,18 @@ export default {
       }
       }
     },
     },
     loadCountInfo() {
     loadCountInfo() {
-      getInfoCount()
+      getInfoCount({}, false)
         .then(response => {
         .then(response => {
-          const data = response.data
-          const countInfo = {}
-          data.forEach(d => {
-            countInfo[d.alias] = d.dataText
+          this.scheduleNum().then(r => {
+            const data = response.data
+            const countInfo = {}
+            data.forEach(d => {
+              countInfo[d.alias] = d.dataText
+            })
+            countInfo['mySchedule'] = r + ''
+
+            this.countInfo = countInfo
           })
           })
-          this.countInfo = countInfo
         })
         })
         .catch(e => {})
         .catch(e => {})
     },
     },
@@ -305,7 +311,7 @@ export default {
         { status: 'publish' },
         { status: 'publish' },
         { page: 1, limit: 5 }
         { page: 1, limit: 5 }
       )
       )
-      queryPageList(params)
+      queryPageList(params, false)
         .then(response => {
         .then(response => {
           this.noticeList = response.data.dataResult
           this.noticeList = response.data.dataResult
           this.emptyNoticeData = !(this.noticeList.length > 0)
           this.emptyNoticeData = !(this.noticeList.length > 0)
@@ -352,6 +358,78 @@ export default {
       //     id: item.id
       //     id: item.id
       //   }
       //   }
       // })
       // })
+    },
+    async scheduleNum() {
+      const time = this.$common.getFormatDate('string', 10, new Date())
+      const timeTime = new Date().getTime()
+      const that = this
+      let mid = []
+      let objArr1 = {}
+      return new Promise((resolve, reject) => {
+        findAllByCurrUserId({}, false).then(res => {
+          const data = res.data || []
+          if (data.length > 0) {
+            mid = []
+            const maxt = new Date(this.$common.getFormatDate('string', 10, timeTime) + ' 24:00:00').getTime()
+            const mint = new Date(this.$common.getFormatDate('string', 19, timeTime)).getTime()
+            data.forEach((item, i) => {
+              const st = new Date(item.startTime + ' 00:00:00').getTime()
+              const et = new Date(item.endTime + ' 24:00:00').getTime()
+              if (item.startTime.indexOf(time) !== -1 || item.endTime.indexOf(time) !== -1 || ((st <= mint) && (et >= maxt))) {
+                mid.push(item)
+              }
+            })
+          }
+
+          const sql = `select a.id_ as fid, a.start_date_, a.end_date_, a.config_, a.overview_, b.* from t_schedule_detail b join t_schedule a on a.id_ = b.parent_id_ where b.user_id_ = '${that.userInfo.user.id}' and (CAST(a.start_date_ AS DATE) like '%${time}%' or  CAST(a.end_date_ AS DATE) like '%${time}%' or (CAST(a.start_date_ AS DATE) < '${time}' and CAST(a.end_date_ AS DATE)>'${time}') )`
+          this.$common.request('sql', sql).then(resp => {
+            const vdata = resp.variables.data || []
+            if (vdata.length > 0) {
+              objArr1 = {}
+              vdata.forEach((item, i) => {
+                const dArr = this.generationDate(item.start_date_, item.end_date_)
+                dArr.forEach((t, n) => {
+                  if (objArr1.hasOwnProperty(t)) {
+                    // const strArr = objArr1[t].name.split(',')
+                    // if (strArr.findIndex(e => e === (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')) === -1) {
+                    objArr1[t].name = objArr1[t].name + ',' + (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
+                    objArr1[t].num = objArr1[t].name === '' ? 0 : objArr1[t].name.split(',').length
+                    // }
+                  } else {
+                    const name = item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : ''
+                    const num = name === '' ? 0 : name.split(',').length
+                    objArr1[t] = { name: name, num: num }
+                  }
+                })
+              })
+            }
+            resolve(mid.length + objArr1[time].num)
+          }).catch(e => {
+          })
+        // resolve(data)
+        }).catch(e => {
+        // this.emptyNoticeData = true
+        })
+      })
+    },
+    // 根据起止日期输出范围内所有日期
+    generationDate(start, end, type = 'string') {
+      const dateArr = []
+      const startArr = type === 'date' ? this.$common.getFormatDate('string', 10, start).split('-') : start.split('-')
+      const endArr = type === 'date' ? this.$common.getFormatDate('string', 10, end).split('-') : end.split('-')
+      const db = new Date()
+      db.setUTCFullYear(startArr[0], startArr[1] - 1, startArr[2])
+      const de = new Date()
+      de.setUTCFullYear(endArr[0], endArr[1] - 1, endArr[2])
+      const unixDb = db.getTime()
+      const unixDe = de.getTime()
+      let stamp
+      const oneDay = 24 * 60 * 60 * 1000
+      for (stamp = unixDb; stamp <= unixDe;) {
+        dateArr.push(this.$common.getFormatDate('string', 10, new Date(parseInt(stamp))))
+        stamp = stamp + oneDay
+      }
+      return dateArr
     }
     }
   }
   }
 }
 }