liangyan0105 3 gadi atpakaļ
vecāks
revīzija
bc976c09f8

+ 31 - 31
src/components/layouts/PageView.vue

@@ -9,55 +9,55 @@
 </template>
 
 <script>
-  import PageLayout from '../page/PageLayout'
-  import RouteView from './RouteView'
+import PageLayout from '../page/PageLayout'
+import RouteView from './RouteView'
 
-  export default {
-    name: "PageContent",
+export default {
+    name: 'PageContent',
     components: {
-      RouteView,
-      PageLayout
+        RouteView,
+        PageLayout
     },
     data () {
-      return {
-        title: '',
-        description: '',
-        linkList: [],
-        extraImage: '',
-        search: false,
-        tabs: {}
-      }
+        return {
+            title: '',
+            description: '',
+            linkList: [],
+            extraImage: '',
+            search: false,
+            tabs: {}
+        }
     },
     mounted () {
-      this.getPageHeaderInfo()
+        this.getPageHeaderInfo()
     },
     updated () {
-      this.getPageHeaderInfo()
+        this.getPageHeaderInfo()
     },
     computed: {
 
-      getTitle () {
-        return this.$route.meta.title
-      }
+        getTitle () {
+            return this.$route.meta.title
+        }
 
     },
     methods: {
-      getPageHeaderInfo () {
+        getPageHeaderInfo () {
         // eslint-disable-next-line
         this.title = this.$route.meta.title
-        // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
-        const content = this.$refs.content && this.$refs.content.$children[0]
+            // 因为套用了一层 route-view 所以要取 ref 对象下的子节点的第一个对象
+            const content = this.$refs.content && this.$refs.content.$children[0]
 
-        if (content) {
-          this.description = content.description
-          this.linkList = content.linkList
-          this.extraImage = content.extraImage
-          this.search = content.search == true ? true : false
-          this.tabs = content.tabs
+            if (content) {
+                this.description = content.description
+                this.linkList = content.linkList
+                this.extraImage = content.extraImage
+                this.search = content.search == true
+                this.tabs = content.tabs
+            }
         }
-      }
     }
-  }
+}
 </script>
 
 <style lang="less" scoped>
@@ -82,4 +82,4 @@
       }
     }
   }
-</style>
+</style>

+ 14 - 8
src/components/layouts/TabLayout.vue

@@ -21,6 +21,8 @@
         <span slot="tab" :pagekey="page.fullPath">{{ page.meta.title }}</span>
       </a-tab-pane>
     </a-tabs>
+
+    <!-- 页面主体部分 -->
     <div style="margin: 12px 12px 0;">
       <transition name="page-toggle">
         <keep-alive v-if="multipage">
@@ -84,13 +86,14 @@ export default {
     created () {
         if (this.$route.path != indexKey) {
             this.addIndexToFirst()
+            console.log('不要回显路径')
         }
         // update-begin-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
-        // let storeKey = 'route:title:' + this.$route.fullPath
-        // let routeTitle = this.$ls.get(storeKey)
-        // if (routeTitle) {
-        //     this.$route.meta.title = routeTitle
-        // }
+        let storeKey = 'route:title:' + this.$route.fullPath
+        let routeTitle = this.$ls.get(storeKey)
+        if (routeTitle) {
+            this.$route.meta.title = routeTitle
+        }
         // update-end-author:sunjianlei date:20191223 for: 修复刷新后菜单Tab名字显示异常
         this.pageList.push(this.$route)
         this.linkList.push(this.$route.fullPath)
@@ -98,19 +101,24 @@ export default {
     },
     watch: {
         $route: function (newRoute) {
-            // console.log("新的路由",newRoute)
+            // console.log('新的路由', newRoute)
             this.activePage = newRoute.fullPath
+            console.log('this.activePage 点击的路径:', this.activePage)
             if (!this.multipage) {
                 this.linkList = [newRoute.fullPath]
+                console.log('1111', this.linkList)
                 this.pageList = [Object.assign({}, newRoute)]
+                console.log('2222', this.pageList)
                 // update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
             } else if (indexKey == newRoute.fullPath) {
                 // 首页时 判断是否缓存 没有缓存 刷新之
                 if (newRoute.meta.keepAlive === false) {
+                    console.log('33', newRoute.meta.keepAlive)
                     this.routeReload()
                 }
                 // update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
             } else if (this.linkList.indexOf(newRoute.fullPath) < 0) {
+                console.log('444')
                 this.linkList.push(newRoute.fullPath)
                 this.pageList.push(Object.assign({}, newRoute))
                 // update-begin-author:sunjianlei date:20200103 for: 如果新增的页面配置了缓存路由,那么就强制刷新一遍
@@ -292,7 +300,6 @@ export default {
                 }
             }
         },
-        // update-end-author:taoyan date:20190430 for:动态路由title显示配置的菜单title而不是其对应路由的title
 
         // update-begin-author:taoyan date:20191008 for:路由刷新
         routeReload () {
@@ -304,7 +311,6 @@ export default {
                 this.reloadFlag = true
             })
         }
-    // update-end-author:taoyan date:20191008 for:路由刷新
     }
 }
 </script>

+ 151 - 160
src/components/page/GlobalHeader.vue

@@ -2,221 +2,212 @@
   <!-- , width: fixedHeader ? `calc(100% - ${sidebarOpened ? 256 : 80}px)` : '100%'  -->
   <a-layout-header
     v-if="!headerBarFixed"
-    :class="[fixedHeader && 'ant-header-fixedHeader', sidebarOpened ? 'ant-header-side-opened' : 'ant-header-side-closed', ]"
-    :style="{ padding: '0' }">
-
+    :class="[
+      fixedHeader && 'ant-header-fixedHeader',
+      sidebarOpened ? 'ant-header-side-opened' : 'ant-header-side-closed'
+    ]"
+    :style="{ padding: '0' }"
+  >
     <div v-if="mode === 'sidemenu'" class="header" :class="theme">
       <a-icon
-        v-if="device==='mobile'"
+        v-if="device === 'mobile'"
         class="trigger"
         :type="collapsed ? 'menu-fold' : 'menu-unfold'"
-        @click="toggle"></a-icon>
-      <a-icon
-        v-else
-        class="trigger"
-        :type="collapsed ? 'menu-unfold' : 'menu-fold'"
-        @click="toggle"/>
+        @click="toggle"
+      ></a-icon>
+      <a-icon v-else class="trigger" :type="collapsed ? 'menu-unfold' : 'menu-fold'" @click="toggle" />
 
       <span v-if="device === 'desktop'">
         <!-- 欢迎进入 Jeecg-Boot 企业级快速开发平台 -->
-        </span>
+      </span>
       <span v-else>
         <!-- Jeecg-Boot -->
-        </span>
+      </span>
 
-      <user-menu :theme="theme"/>
+      <user-menu :theme="theme" />
     </div>
     <!-- 顶部导航栏模式 -->
     <div v-else :class="['top-nav-header-index', theme]">
       <div class="header-index-wide">
         <div class="header-index-left" :style="topMenuStyle.headerIndexLeft">
-          <logo class="top-nav-header" :show-title="device !== 'mobile'" :style="topMenuStyle.topNavHeader"/>
+          <logo class="top-nav-header" :show-title="device !== 'mobile'" :style="topMenuStyle.topNavHeader" />
           <div v-if="device !== 'mobile'" :style="topMenuStyle.topSmenuStyle">
-            <s-menu
-              mode="horizontal"
-              :menu="menus"
-              :theme="theme"></s-menu>
+            <!-- mode="horizontal -->
+            <s-menu mode="vertical" :menu="menus" :theme="theme"></s-menu>
           </div>
-          <a-icon
-            v-else
-            class="trigger"
-            :type="collapsed ? 'menu-fold' : 'menu-unfold'"
-            @click="toggle"></a-icon>
+          <a-icon v-else class="trigger" :type="collapsed ? 'menu-fold' : 'menu-unfold'" @click="toggle"></a-icon>
         </div>
-        <user-menu class="header-index-right" :theme="theme" :style="topMenuStyle.headerIndexRight"/>
+        <user-menu class="header-index-right" :theme="theme" :style="topMenuStyle.headerIndexRight" />
       </div>
     </div>
-
   </a-layout-header>
 </template>
 
 <script>
-  import UserMenu from '../tools/UserMenu'
-  import SMenu from '../menu/'
-  import Logo from '../tools/Logo'
+import UserMenu from '../tools/UserMenu'
+import SMenu from '../menu/'
+import Logo from '../tools/Logo'
 
-  import { mixin } from '@/utils/mixin.js'
+import { mixin } from '@/utils/mixin.js'
 
-  export default {
+export default {
     name: 'GlobalHeader',
     components: {
-      UserMenu,
-      SMenu,
-      Logo
+        UserMenu,
+        SMenu,
+        Logo
     },
     mixins: [mixin],
     props: {
-      mode: {
-        type: String,
-        // sidemenu, topmenu
-        default: 'sidemenu'
-      },
-      menus: {
-        type: Array,
-        required: true
-      },
-      theme: {
-        type: String,
-        required: false,
-        default: 'dark'
-      },
-      collapsed: {
-        type: Boolean,
-        required: false,
-        default: false
-      },
-      device: {
-        type: String,
-        required: false,
-        default: 'desktop'
-      }
+        mode: {
+            type: String,
+            // sidemenu, topmenu
+            default: 'sidemenu'
+        },
+        menus: {
+            type: Array,
+            required: true
+        },
+        theme: {
+            type: String,
+            required: false,
+            default: 'dark'
+        },
+        collapsed: {
+            type: Boolean,
+            required: false,
+            default: false
+        },
+        device: {
+            type: String,
+            required: false,
+            default: 'desktop'
+        }
     },
-    data() {
-      return {
-        headerBarFixed: false,
-        //update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
-        topMenuStyle: {
-          headerIndexLeft: {},
-          topNavHeader: {},
-          headerIndexRight: {},
-          topSmenuStyle: {}
+    data () {
+        return {
+            headerBarFixed: false,
+            // update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+            topMenuStyle: {
+                headerIndexLeft: {},
+                topNavHeader: {},
+                headerIndexRight: {},
+                topSmenuStyle: {}
+            }
         }
-      }
     },
     watch: {
-      /** 监听设备变化 */
-      device() {
-        if (this.mode === 'topmenu') {
-          this.buildTopMenuStyle()
+    /** 监听设备变化 */
+        device () {
+            if (this.mode === 'topmenu') {
+                this.buildTopMenuStyle()
+            }
+        },
+        /** 监听导航栏模式变化 */
+        mode (newVal) {
+            if (newVal === 'topmenu') {
+                this.buildTopMenuStyle()
+            }
         }
-      },
-      /** 监听导航栏模式变化 */
-      mode(newVal) {
-        if (newVal === 'topmenu') {
-          this.buildTopMenuStyle()
-        }
-      }
     },
-    //update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
-    mounted() {
-      window.addEventListener('scroll', this.handleScroll)
-      //update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
-      if (this.mode === 'topmenu') {
-        this.buildTopMenuStyle()
-      }
-      //update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+    // update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+    mounted () {
+        window.addEventListener('scroll', this.handleScroll)
+        // update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+        if (this.mode === 'topmenu') {
+            this.buildTopMenuStyle()
+        }
+    // update-end--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
     },
     methods: {
-      handleScroll() {
-        if (this.autoHideHeader) {
-          let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
-          if (scrollTop > 100) {
-            this.headerBarFixed = true
-          } else {
-            this.headerBarFixed = false
-          }
-        } else {
-          this.headerBarFixed = false
-        }
-      },
-      toggle() {
-        this.$emit('toggle')
-      },
-      //update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
-      buildTopMenuStyle() {
-        if (this.mode === 'topmenu') {
-          if (this.device === 'mobile') {
-            // 手机端需要清空样式,否则显示会错乱
-            this.topMenuStyle.topNavHeader = {}
-            this.topMenuStyle.topSmenuStyle = {}
-            this.topMenuStyle.headerIndexRight = {}
-            this.topMenuStyle.headerIndexLeft = {}
-          } else {
-            let rightWidth = '360px'
-            this.topMenuStyle.topNavHeader = { 'min-width': '165px' }
-            this.topMenuStyle.topSmenuStyle = { 'width': 'calc(100% - 165px)' }
-            this.topMenuStyle.headerIndexRight = { 'min-width': rightWidth }
-            this.topMenuStyle.headerIndexLeft = { 'width': `calc(100% - ${rightWidth})` }
-          }
+        handleScroll () {
+            if (this.autoHideHeader) {
+                let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
+                if (scrollTop > 100) {
+                    this.headerBarFixed = true
+                } else {
+                    this.headerBarFixed = false
+                }
+            } else {
+                this.headerBarFixed = false
+            }
+        },
+        toggle () {
+            this.$emit('toggle')
+        },
+        // update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+        buildTopMenuStyle () {
+            if (this.mode === 'topmenu') {
+                if (this.device === 'mobile') {
+                    // 手机端需要清空样式,否则显示会错乱
+                    this.topMenuStyle.topNavHeader = {}
+                    this.topMenuStyle.topSmenuStyle = {}
+                    this.topMenuStyle.headerIndexRight = {}
+                    this.topMenuStyle.headerIndexLeft = {}
+                } else {
+                    let rightWidth = '360px'
+                    this.topMenuStyle.topNavHeader = { 'min-width': '165px' }
+                    this.topMenuStyle.topSmenuStyle = { width: 'calc(100% - 165px)' }
+                    this.topMenuStyle.headerIndexRight = { 'min-width': rightWidth }
+                    this.topMenuStyle.headerIndexLeft = { width: `calc(100% - ${rightWidth})` }
+                }
+            }
         }
-      }
-      //update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
+    // update-begin--author:sunjianlei---date:20190508------for: 顶部导航栏过长时显示更多按钮-----
     }
-  }
+}
 </script>
 
 <style lang="less" scoped>
-  /* update_begin author:scott date:20190220 for: 缩小首页布局顶部的高度*/
-
-  @height: 59px;
+/* update_begin author:scott date:20190220 for: 缩小首页布局顶部的高度*/
 
-  .layout {
+@height: 59px;
 
-    .top-nav-header-index {
+.layout {
+  .top-nav-header-index {
+    .header-index-wide {
+      margin-left: 10px;
 
-      .header-index-wide {
-        margin-left: 10px;
-
-        .ant-menu.ant-menu-horizontal {
-          height: @height;
-          line-height: @height;
-        }
-      }
-      .trigger {
-        line-height: 64px;
-        &:hover {
-          background: rgba(0, 0, 0, 0.05);
-        }
+      .ant-menu.ant-menu-horizontal {
+        height: @height;
+        line-height: @height;
       }
     }
-
-    .header {
-      z-index: 2;
-      color: white;
-      height: @height;
-      background-color: @primary-color;
-      transition: background 300ms;
-
-      /* dark 样式 */
-      &.dark {
-        color: #000000;
-        box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
-        background-color: white !important;
-      }
-    }
-
-    .header, .top-nav-header-index {
-      &.dark .trigger:hover {
+    .trigger {
+      line-height: 14px;
+      &:hover {
         background: rgba(0, 0, 0, 0.05);
       }
     }
   }
 
-  .ant-layout-header {
+  .header {
+    z-index: 2;
+    color: white;
     height: @height;
-    line-height: @height;
+    background-color: @primary-color;
+    transition: background 300ms;
+
+    /* dark 样式 */
+    &.dark {
+      color: #000000;
+      box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
+      background-color: white !important;
+    }
+  }
+
+  .header,
+  .top-nav-header-index {
+    &.dark .trigger:hover {
+      background: rgba(0, 0, 0, 0.05);
+    }
   }
+}
 
-  /* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/
+.ant-layout-header {
+  height: @height;
+  line-height: @height;
+}
 
-</style>
+/* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/
+</style>

+ 2 - 2
src/components/page/GlobalLayout.vue

@@ -136,10 +136,10 @@ export default {
     // this.menus = this.mainRouters.find((item) => item.path === '/').children;
         this.menus = this.permissionMenuList
         // 根据后台配置菜单,重新排序加载路由信息
-        console.log('----加载菜单逻辑----')
+        // console.log('----加载菜单逻辑----')
         console.log(this.mainRouters)
         console.log(this.permissionMenuList)
-        console.log('----navTheme------' + this.navTheme)
+        // console.log('----navTheme------' + this.navTheme)
     // --update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
     },
     methods: {

+ 45 - 47
src/components/page/PageHeader.vue

@@ -41,63 +41,61 @@
 </template>
 
 <script>
-  import Breadcrumb from '@/components/tools/Breadcrumb'
+import Breadcrumb from '@/components/tools/Breadcrumb'
 
-  export default {
-    name: "PageHeader",
+export default {
+    name: 'PageHeader',
     components: {
-      "s-breadcrumb": Breadcrumb
+        's-breadcrumb': Breadcrumb
     },
     props: {
-      title: {
-        type: String,
-        default: '',
-        required: false
-      },
-      breadcrumb: {
-        type: Array,
-        default: null,
-        required: false
-      },
-      logo: {
-        type: String,
-        default: '',
-        required: false
-      },
-      avatar: {
-        type: String,
-        default: '',
-        required: false
-      }
+        title: {
+            type: String,
+            default: '',
+            required: false
+        },
+        breadcrumb: {
+            type: Array,
+            default: null,
+            required: false
+        },
+        logo: {
+            type: String,
+            default: '',
+            required: false
+        },
+        avatar: {
+            type: String,
+            default: '',
+            required: false
+        }
     },
-    data() {
-      return {
-        name: '',
-        breadList: [],
-      }
+    data () {
+        return {
+            name: '',
+            breadList: []
+        }
     },
-    created() {
-      this.getBreadcrumb()
+    created () {
+        this.getBreadcrumb()
     },
     methods: {
-      getBreadcrumb() {
-
-        this.breadList = []
-        // this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}})
-
-        this.name = this.$route.name
-        this.$route.matched.forEach((item) => {
-          // item.name !== 'index' && this.breadList.push(item)
-          this.breadList.push(item)
-        })
-      }
+        getBreadcrumb () {
+            this.breadList = []
+            // this.breadList.push({name: 'index', path: '/dashboard/', meta: {title: '首页'}})
+            this.name = this.$route.name
+            this.$route.matched.forEach((item) => {
+                // item.name !== 'index' && this.breadList.push(item)
+                this.breadList.push(item)
+            })
+        }
     },
     watch: {
-      $route() {
-        this.getBreadcrumb()
-      }
+        $route () {
+            this.getBreadcrumb()
+        }
     }
-  }
+}
 </script>
 
 <style lang="less" scoped>
@@ -235,4 +233,4 @@
       }
     }
   }
-</style>
+</style>

+ 78 - 73
src/components/page/PageLayout.vue

@@ -6,10 +6,11 @@
       <slot slot="content" name="headerContent"></slot>
       <div slot="content" v-if="!this.$slots.headerContent && desc">
         <p style="font-size: 14px;color: rgba(0,0,0,.65)">{{ desc }}</p>
+
         <div class="link">
           <template v-for="(link, index) in linkList">
             <a :key="index" :href="link.href">
-              <a-icon :type="link.icon"/>
+              <a-icon :type="link.icon" />
               <span>{{ link.title }}</span>
             </a>
           </template>
@@ -18,11 +19,16 @@
       <slot slot="extra" name="extra"></slot>
       <div slot="pageMenu">
         <div class="page-menu-search" v-if="search">
-          <a-input-search style="width: 80%; max-width: 522px;" placeholder="请输入..." size="large" enterButton="搜索" />
+          <a-input-search
+            style="width: 80%; max-width: 522px;"
+            placeholder="请输入..."
+            size="large"
+            enterButton="搜索"
+          />
         </div>
         <div class="page-menu-tabs" v-if="tabs && tabs.items">
           <!-- @change="callback" :activeKey="activeKey" -->
-          <a-tabs :tabBarStyle="{margin: 0}" @change="tabs.callback" :activeKey="tabs.active()">
+          <a-tabs :tabBarStyle="{ margin: 0 }" @change="tabs.callback" :activeKey="tabs.active()">
             <a-tab-pane v-for="item in tabs.items" :tab="item.title" :key="item.key"></a-tab-pane>
           </a-tabs>
         </div>
@@ -37,91 +43,90 @@
 </template>
 
 <script>
-  import PageHeader from './PageHeader'
+import PageHeader from './PageHeader'
 
-  export default {
-    name: "LayoutContent",
+export default {
+    name: 'LayoutContent',
     components: {
-      PageHeader
+        PageHeader
     },
     // ['desc', 'logo', 'title', 'avatar', 'linkList', 'extraImage']
     props: {
-      desc: {
-        type: String,
-        default: null
-      },
-      logo: {
-        type: String,
-        default: null
-      },
-      title: {
-        type: String,
-        default: null
-      },
-      avatar: {
-        type: String,
-        default: null
-      },
-      linkList: {
-        type: Array,
-        default: null
-      },
-      extraImage: {
-        type: String,
-        default: null
-      },
-      search: {
-        type: Boolean,
-        default: false
-      },
-      tabs: {
-        type: Object,
-        default: () => {}
-      }
+        desc: {
+            type: String,
+            default: null
+        },
+        logo: {
+            type: String,
+            default: null
+        },
+        title: {
+            type: String,
+            default: null
+        },
+        avatar: {
+            type: String,
+            default: null
+        },
+        linkList: {
+            type: Array,
+            default: null
+        },
+        extraImage: {
+            type: String,
+            default: null
+        },
+        search: {
+            type: Boolean,
+            default: false
+        },
+        tabs: {
+            type: Object,
+            default: () => {}
+        }
     },
-    methods: {
-    }
-  }
+    methods: {}
+}
 </script>
 
 <style lang="less" scoped>
-  .content {
-    margin: 24px 24px 0;
+.content {
+  margin: 24px 24px 0;
+
+  .link {
+    margin-top: 16px;
 
-    .link {
-      margin-top: 16px;
+    &:not(:empty) {
+      margin-bottom: 16px;
+    }
+    a {
+      margin-right: 32px;
+      height: 24px;
+      line-height: 24px;
+      display: inline-block;
 
-      &:not(:empty) {
-        margin-bottom: 16px;
+      i {
+        font-size: 24px;
+        margin-right: 8px;
+        vertical-align: middle;
       }
-      a {
-        margin-right: 32px;
+      span {
         height: 24px;
         line-height: 24px;
         display: inline-block;
-
-        i {
-          font-size: 24px;
-          margin-right: 8px;
-          vertical-align: middle;
-        }
-        span {
-          height: 24px;
-          line-height: 24px;
-          display: inline-block;
-          vertical-align: middle;
-        }
+        vertical-align: middle;
       }
     }
   }
-  .page-menu-search {
-    text-align: center;
-    margin-bottom: 16px;
-  }
-  .page-menu-tabs {
-    margin-top: 48px;
-  }
-  .page-header[data-v-6740ec88] {
-    margin: 0px 24px 0;
-  }
-</style>
+}
+.page-menu-search {
+  text-align: center;
+  margin-bottom: 16px;
+}
+.page-menu-tabs {
+  margin-top: 48px;
+}
+.page-header[data-v-6740ec88] {
+  margin: 0px 24px 0;
+}
+</style>

+ 260 - 241
src/components/tools/HeaderNotice.vue

@@ -6,7 +6,8 @@
     :arrowPointAtCenter="true"
     overlayClassName="header-notice-wrapper"
     @visibleChange="handleHoverChange"
-    :overlayStyle="{ width: '300px', top: '50px' }">
+    :overlayStyle="{ width: '300px', top: '50px' }"
+  >
     <template slot="content">
       <a-spin :spinning="loadding">
         <a-tabs>
@@ -31,12 +32,19 @@
             <a-list>
               <a-list-item :key="index" v-for="(record, index) in announcement1">
                 <div style="margin-left: 5%;width: 80%">
-                  <p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p>
+                  <p>
+                    <a @click="showAnnouncement(record)">{{ record.titile }}</a>
+                  </p>
                   <p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p>
                 </div>
                 <div style="text-align: right">
                   <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
-                  <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>
+                  <a-tag
+                    @click="showAnnouncement(record)"
+                    v-if="record.priority === 'M'"
+                    color="orange"
+                  >重要消息</a-tag
+                  >
                   <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>
                 </div>
               </a-list-item>
@@ -49,12 +57,19 @@
             <a-list>
               <a-list-item :key="index" v-for="(record, index) in announcement2">
                 <div style="margin-left: 5%;width: 80%">
-                  <p><a @click="showAnnouncement(record)">{{ record.titile }}</a></p>
+                  <p>
+                    <a @click="showAnnouncement(record)">{{ record.titile }}</a>
+                  </p>
                   <p style="color: rgba(0,0,0,.45);margin-bottom: 0px">{{ record.createTime }} 发布</p>
                 </div>
                 <div style="text-align: right">
                   <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'L'" color="blue">一般消息</a-tag>
-                  <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'M'" color="orange">重要消息</a-tag>
+                  <a-tag
+                    @click="showAnnouncement(record)"
+                    v-if="record.priority === 'M'"
+                    color="orange"
+                  >重要消息</a-tag
+                  >
                   <a-tag @click="showAnnouncement(record)" v-if="record.priority === 'H'" color="red">紧急消息</a-tag>
                 </div>
               </a-list-item>
@@ -72,266 +87,270 @@
       </a-badge>
     </span>
     <show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement>
-    <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData"/>
+    <dynamic-notice ref="showDynamNotice" :path="openPath" :formData="formData" />
   </a-popover>
 </template>
 
 <script>
-  import { getAction,putAction } from '@/api/manage'
-  import ShowAnnouncement from './ShowAnnouncement'
-  import store from '@/store/'
-  import DynamicNotice from './DynamicNotice'
+import { getAction, putAction } from '@/api/manage'
+import ShowAnnouncement from './ShowAnnouncement'
+import store from '@/store/'
+import DynamicNotice from './DynamicNotice'
 
-
-  export default {
-    name: "HeaderNotice",
+export default {
+    name: 'HeaderNotice',
     components: {
-      DynamicNotice,
-      ShowAnnouncement,
+        DynamicNotice,
+        ShowAnnouncement
     },
     data () {
-      return {
-        loadding: false,
-        url:{
-          listCementByUser:"/sys/annountCement/listByUser",
-          editCementSend:"/sys/sysAnnouncementSend/editByAnntIdAndUserId",
-          queryById:"/sys/annountCement/queryById",
-        },
-        hovered: false,
-        announcement1:[],
-        announcement2:[],
-        msg1Count:"0",
-        msg2Count:"0",
-        msg1Title:"通知(0)",
-        msg2Title:"",
-        stopTimer:false,
-        websock: null,
-        lockReconnect:false,
-        heartCheck:null,
-        formData:{},
-        openPath:''
-      }
+        return {
+            loadding: false,
+            url: {
+                listCementByUser: '/sys/annountCement/listByUser',
+                editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId',
+                queryById: '/sys/annountCement/queryById'
+            },
+            hovered: false,
+            announcement1: [],
+            announcement2: [],
+            msg1Count: '0',
+            msg2Count: '0',
+            msg1Title: '通知(0)',
+            msg2Title: '',
+            stopTimer: false,
+            websock: null,
+            lockReconnect: false,
+            heartCheck: null,
+            formData: {},
+            openPath: ''
+        }
     },
-    computed:{
-      msgTotal () {
-        return parseInt(this.msg1Count)+parseInt(this.msg2Count);
-      }
+    computed: {
+        msgTotal () {
+            return parseInt(this.msg1Count) + parseInt(this.msg2Count)
+        }
     },
-    mounted() {
-      this.loadData();
-      //this.timerFun();
-      this.initWebSocket();
-      this.heartCheckFun();
+    mounted () {
+        this.loadData()
+        // this.timerFun();
+        this.initWebSocket()
+        this.heartCheckFun()
     },
-    destroyed: function () { // 离开页面生命周期函数
-      this.websocketclose();
+    destroyed: function () {
+    // 离开页面生命周期函数
+        this.websocketclose()
     },
     methods: {
-      timerFun() {
-        this.stopTimer = false;
-        let myTimer = setInterval(()=>{
-          // 停止定时器
-          if (this.stopTimer == true) {
-            clearInterval(myTimer);
-            return;
-          }
-          this.loadData()
-        },6000)
-      },
-      loadData (){
-        try {
-          // 获取系统消息
-          getAction(this.url.listCementByUser).then((res) => {
-            if (res.success) {
-              this.announcement1 = res.result.anntMsgList;
-              this.msg1Count = res.result.anntMsgTotal;
-              this.msg1Title = "通知(" + res.result.anntMsgTotal + ")";
-              this.announcement2 = res.result.sysMsgList;
-              this.msg2Count = res.result.sysMsgTotal;
-              this.msg2Title = "系统消息(" + res.result.sysMsgTotal + ")";
+        timerFun () {
+            this.stopTimer = false
+            let myTimer = setInterval(() => {
+                // 停止定时器
+                if (this.stopTimer == true) {
+                    clearInterval(myTimer)
+                    return
+                }
+                this.loadData()
+            }, 6000)
+        },
+        loadData () {
+            try {
+                // 获取系统消息
+                getAction(this.url.listCementByUser)
+                    .then(res => {
+                        if (res.success) {
+                            this.announcement1 = res.result.anntMsgList
+                            this.msg1Count = res.result.anntMsgTotal
+                            this.msg1Title = '通知(' + res.result.anntMsgTotal + ')'
+                            this.announcement2 = res.result.sysMsgList
+                            this.msg2Count = res.result.sysMsgTotal
+                            this.msg2Title = '系统消息(' + res.result.sysMsgTotal + ')'
+                        }
+                    })
+                    .catch(error => {
+                        console.log('系统消息通知异常', error) // 这行打印permissionName is undefined
+                        this.stopTimer = true
+                        console.log('清理timer')
+                    })
+            } catch (err) {
+                this.stopTimer = true
+                console.log('通知异常', err)
             }
-          }).catch(error => {
-            console.log("系统消息通知异常",error);//这行打印permissionName is undefined
-            this.stopTimer = true;
-            console.log("清理timer");
-          });
-        } catch (err) {
-          this.stopTimer = true;
-          console.log("通知异常",err);
-        }
-      },
-      fetchNotice () {
-        if (this.loadding) {
-          this.loadding = false
-          return
-        }
-        this.loadding = true
-        setTimeout(() => {
-          this.loadding = false
-        }, 200)
-      },
-      showAnnouncement(record){
-        putAction(this.url.editCementSend,{anntId:record.id}).then((res)=>{
-          if(res.success){
-            this.loadData();
-          }
-        });
-        this.hovered = false;
-        if(record.openType==='component'){
-          this.openPath = record.openPage;
-          this.formData = {id:record.busId};
-          this.$refs.showDynamNotice.detail(record.openPage);
-        }else{
-          record.readFlag='0'//未阅读(用于以未阅读状态跳转到我的消息弹框)
-          this.$refs.ShowAnnouncement.detail(record);
-        }
-      },
-      toMyAnnouncement(){
+        },
+        fetchNotice () {
+            if (this.loadding) {
+                this.loadding = false
+                return
+            }
+            this.loadding = true
+            setTimeout(() => {
+                this.loadding = false
+            }, 200)
+        },
+        showAnnouncement (record) {
+            putAction(this.url.editCementSend, { anntId: record.id }).then(res => {
+                if (res.success) {
+                    this.loadData()
+                }
+            })
+            this.hovered = false
+            if (record.openType === 'component') {
+                this.openPath = record.openPage
+                this.formData = { id: record.busId }
+                this.$refs.showDynamNotice.detail(record.openPage)
+            } else {
+                record.readFlag = '0' // 未阅读(用于以未阅读状态跳转到我的消息弹框)
+                this.$refs.ShowAnnouncement.detail(record)
+            }
+        },
+        toMyAnnouncement () {
+            this.$router.push({
+                path: '/isps/userAnnouncement',
+                name: 'isps-userAnnouncement'
+            })
+        },
+        modalFormOk () {},
+        handleHoverChange (visible) {
+            this.hovered = visible
+        },
 
-        this.$router.push({
-          path: '/isps/userAnnouncement',
-          name: 'isps-userAnnouncement'
-        });
-      },
-      modalFormOk(){
-      },
-      handleHoverChange (visible) {
-        this.hovered = visible;
-      },
+        initWebSocket: function () {
+            // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
+            var userId = store.getters.userInfo.id
+            var url =
+        window._CONFIG['domianURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
+            console.log(url)
+            // this.websock = new WebSocket(url);
+            // this.websock.onopen = this.websocketOnopen;
+            // this.websock.onerror = this.websocketOnerror;
+            // this.websock.onmessage = this.websocketOnmessage;
+            // this.websock.onclose = this.websocketOnclose;
+        },
+        websocketOnopen: function () {
+            console.log('WebSocket连接成功')
+            // 心跳检测重置
+            this.heartCheck.reset().start()
+        },
+        websocketOnerror: function (e) {
+            console.log('WebSocket连接发生错误')
+            this.reconnect()
+        },
+        websocketOnmessage: function (e) {
+            console.log('-----接收消息-------', e.data)
+            var data = eval('(' + e.data + ')') // 解析对象
+            if (data.cmd == 'topic') {
+                // 系统通知
+                this.loadData()
+            } else if (data.cmd == 'user') {
+                // 用户消息
+                this.loadData()
+            }
+            // 心跳检测重置
+            this.heartCheck.reset().start()
+        },
+        websocketOnclose: function (e) {
+            console.log('connection closed (' + e.code + ')')
+            this.reconnect()
+        },
+        websocketSend (text) {
+            // 数据发送
+            try {
+                this.websock.send(text)
+            } catch (err) {
+                console.log('send failed (' + err.code + ')')
+            }
+        },
 
-      initWebSocket: function () {
-        // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
-        var userId = store.getters.userInfo.id;
-        var url = window._CONFIG['domianURL'].replace("https://","wss://").replace("http://","ws://")+"/websocket/"+userId;
-        console.log(url);
-        // this.websock = new WebSocket(url);
-        // this.websock.onopen = this.websocketOnopen;
-        // this.websock.onerror = this.websocketOnerror;
-        // this.websock.onmessage = this.websocketOnmessage;
-        // this.websock.onclose = this.websocketOnclose;
-      },
-      websocketOnopen: function () {
-        console.log("WebSocket连接成功");
-        //心跳检测重置
-        this.heartCheck.reset().start();
-      },
-      websocketOnerror: function (e) {
-        console.log("WebSocket连接发生错误");
-        this.reconnect();
-      },
-      websocketOnmessage: function (e) {
-        console.log("-----接收消息-------",e.data);
-        var data = eval("(" + e.data + ")"); //解析对象
-        if(data.cmd == "topic"){
-            //系统通知
-          this.loadData();
-        }else if(data.cmd == "user"){
-            //用户消息
-          this.loadData();
-        }
-        //心跳检测重置
-        this.heartCheck.reset().start();
-      },
-      websocketOnclose: function (e) {
-        console.log("connection closed (" + e.code + ")");
-        this.reconnect();
-      },
-      websocketSend(text) { // 数据发送
-        try {
-          this.websock.send(text);
-        } catch (err) {
-          console.log("send failed (" + err.code + ")");
-        }
-      },
+        openNotification (data) {
+            var text = data.msgTxt
+            const key = `open${Date.now()}`
+            this.$notification.open({
+                message: '消息提醒',
+                placement: 'bottomRight',
+                description: text,
+                key,
+                btn: h => {
+                    return h(
+                        'a-button',
+                        {
+                            props: {
+                                type: 'primary',
+                                size: 'small'
+                            },
+                            on: {
+                                click: () => this.showDetail(key, data)
+                            }
+                        },
+                        '查看详情'
+                    )
+                }
+            })
+        },
 
-      openNotification (data) {
-        var text = data.msgTxt;
-        const key = `open${Date.now()}`;
-        this.$notification.open({
-          message: '消息提醒',
-          placement:'bottomRight',
-          description: text,
-          key,
-          btn: (h)=>{
-            return h('a-button', {
-              props: {
-                type: 'primary',
-                size: 'small',
-              },
-              on: {
-                click: () => this.showDetail(key,data)
-              }
-            }, '查看详情')
-          },
-        });
-      },
+        reconnect () {
+            var that = this
+            if (that.lockReconnect) return
+            that.lockReconnect = true
+            // 没连接上会一直重连,设置延迟避免请求过多
+            setTimeout(function () {
+                console.info('尝试重连...')
+                that.initWebSocket()
+                that.lockReconnect = false
+            }, 5000)
+        },
+        heartCheckFun () {
+            var that = this
+            // 心跳检测,每20s心跳一次
+            that.heartCheck = {
+                timeout: 20000,
+                timeoutObj: null,
+                serverTimeoutObj: null,
+                reset: function () {
+                    clearTimeout(this.timeoutObj)
+                    // clearTimeout(this.serverTimeoutObj);
+                    return this
+                },
+                start: function () {
+                    var self = this
+                    this.timeoutObj = setTimeout(function () {
+                        // 这里发送一个心跳,后端收到后,返回一个心跳消息,
+                        // onmessage拿到返回的心跳就说明连接正常
+                        that.websocketSend('HeartBeat')
+                        console.info('客户端发送心跳')
+                        // self.serverTimeoutObj = setTimeout(function(){//如果超过一定时间还没重置,说明后端主动断开了
+                        //  that.websock.close();//如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
+                        // }, self.timeout)
+                    }, this.timeout)
+                }
+            }
+        },
 
-      reconnect() {
-        var that = this;
-        if(that.lockReconnect) return;
-        that.lockReconnect = true;
-        //没连接上会一直重连,设置延迟避免请求过多
-        setTimeout(function () {
-          console.info("尝试重连...");
-          that.initWebSocket();
-          that.lockReconnect = false;
-        }, 5000);
-      },
-      heartCheckFun(){
-        var that = this;
-        //心跳检测,每20s心跳一次
-        that.heartCheck = {
-          timeout: 20000,
-          timeoutObj: null,
-          serverTimeoutObj: null,
-          reset: function(){
-            clearTimeout(this.timeoutObj);
-            //clearTimeout(this.serverTimeoutObj);
-            return this;
-          },
-          start: function(){
-            var self = this;
-            this.timeoutObj = setTimeout(function(){
-              //这里发送一个心跳,后端收到后,返回一个心跳消息,
-              //onmessage拿到返回的心跳就说明连接正常
-              that.websocketSend("HeartBeat");
-              console.info("客户端发送心跳");
-              //self.serverTimeoutObj = setTimeout(function(){//如果超过一定时间还没重置,说明后端主动断开了
-              //  that.websock.close();//如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
-              //}, self.timeout)
-            }, this.timeout)
-          }
+        showDetail (key, data) {
+            this.$notification.close(key)
+            var id = data.msgId
+            getAction(this.url.queryById, { id: id }).then(res => {
+                if (res.success) {
+                    var record = res.result
+                    this.showAnnouncement(record)
+                }
+            })
         }
-      },
-
-
-      showDetail(key,data){
-        this.$notification.close(key);
-        var id = data.msgId;
-        getAction(this.url.queryById,{id:id}).then((res) => {
-          if (res.success) {
-            var record = res.result;
-            this.showAnnouncement(record);
-          }
-        })
-
-      },
     }
-  }
+}
 </script>
 
 <style lang="css">
-  .header-notice-wrapper {
-    top: 50px !important;
-  }
+.header-notice-wrapper {
+  top: 50px !important;
+}
 </style>
 <style lang="less" scoped>
-  .header-notice{
-    display: inline-block;
-    transition: all 0.3s;
+.header-notice {
+  display: inline-block;
+  transition: all 0.3s;
 
-    span {
-      vertical-align: initial;
-    }
+  span {
+    vertical-align: initial;
   }
-</style>
+}
+</style>

+ 2 - 3
src/views/activiti/applyList.vue

@@ -116,7 +116,7 @@
               </template>
 
               <template v-if="r.status == 2">
-                <a-tag color="red">已结束</a-tag>
+                <a-tag color="purple">已结束</a-tag>
               </template>
 
               <template v-if="r.status == 3">
@@ -152,7 +152,7 @@
 
               <!-- 已驳回 -->
               <template v-if="r.result == 3">
-                <a-tag color="#b7b7a4">已驳回</a-tag>
+                <a-tag color="gray">已驳回</a-tag>
               </template>
             </template>
           </a-table-column>
@@ -450,7 +450,6 @@ export default {
         .finally(() => (this.addApplyLoading = false))
     },
     loadData(arg) {
-      console.log('loadData')
       if (!this.url.list) {
         this.$message.error('请设置url.list属性!')
         return

+ 3 - 3
src/views/dashboard/MyoaTabs.vue

@@ -107,10 +107,10 @@ export default {
                     this.applyList.map(item => {
                         var resultCode = ''
                         if (item.result == '0') {
-                            resultCode = '<span style="color:#37a2da;">未提交</span>'
+                            resultCode = '<span style="color:orange;">未提交</span>'
                         }
                         if (item.result == '1') {
-                            resultCode = '<span style="color:orange;">处理中</span>'
+                            resultCode = '<span style="color:#37a2da;">处理中</span>'
                         }
                         if (item.result == '2') {
                             resultCode = '<span style="color:green;">通过</span>'
@@ -147,7 +147,7 @@ export default {
                         if (item.deleteReason == '审批通过') {
                             reallyResult = '<span style="color:green">审批通过</span>'
                         } else {
-                            reallyResult = '<span style="color:orange">审批驳回</span>'
+                            reallyResult = '<span style="color:red">审批驳回</span>'
                         }
 
                         var list = [item.id, item.name, item.processName, item.applyer, reallyResult, item.createTime]

+ 137 - 136
src/views/modules/message/SysMessageTemplateList.vue

@@ -1,11 +1,9 @@
 <template>
   <a-card :bordered="false">
-
     <!-- 查询区域 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-
           <a-col :md="6" :sm="8">
             <a-form-item label="模板CODE">
               <a-input placeholder="请输入模板CODE" v-model="queryParam.templateCode"></a-input>
@@ -34,11 +32,10 @@
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
               <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
               </a>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -47,19 +44,26 @@
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('消息模板')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
-                @change="handleImportExcel">
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
+            <a-icon type="delete" />
             删除
           </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作
-          <a-icon type="down"/>
+        <a-button style="margin-left: 8px">
+          批量操作
+          <a-icon type="down" />
         </a-button>
       </a-dropdown>
     </div>
@@ -67,8 +71,8 @@
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-        selectedRowKeys.length }}</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -81,19 +85,18 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
-
+        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        @change="handleTableChange"
+      >
         <!-- 字符串超长截取省略号显示-->
         <span slot="templateContent" slot-scope="text">
           <j-ellipsis :value="text" :length="25" />
         </span>
 
-
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
-          <a-divider type="vertical"/>
+          <a-divider type="vertical" />
           <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
             <a-menu slot="overlay">
@@ -103,12 +106,11 @@
                 </a-popconfirm>
               </a-menu-item>
               <a-menu-item>
-                  <a @click="handleTest(record)">发送测试</a>
+                <a @click="handleTest(record)">发送测试</a>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
         </span>
-
       </a-table>
     </div>
     <!-- table区域-end -->
@@ -121,133 +123,132 @@
 </template>
 
 <script>
-  import SysMessageTemplateModal from './modules/SysMessageTemplateModal'
-  import SysMessageTestModal from './modules/SysMessageTestModal'
-  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-  import JEllipsis from "@/components/jeecg/JEllipsis";
+import SysMessageTemplateModal from './modules/SysMessageTemplateModal'
+import SysMessageTestModal from './modules/SysMessageTestModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import JEllipsis from '@/components/jeecg/JEllipsis'
 
-  export default {
-    name: "SysMessageTemplateList",
+export default {
+    name: 'SysMessageTemplateList',
     mixins: [JeecgListMixin],
     components: {
-      JEllipsis,
-      SysMessageTemplateModal,
-      SysMessageTestModal
+        JEllipsis,
+        SysMessageTemplateModal,
+        SysMessageTestModal
     },
-    data() {
-      return {
-        description: '消息模板管理页面',
-        // 表头
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key: 'rowIndex',
-            width: 60,
-            align: "center",
-            customRender: function (t, r, index) {
-              return parseInt(index) + 1;
+    data () {
+        return {
+            description: '消息模板管理页面',
+            // 表头
+            columns: [
+                {
+                    title: '#',
+                    dataIndex: '',
+                    key: 'rowIndex',
+                    width: 60,
+                    align: 'center',
+                    customRender: function (t, r, index) {
+                        return parseInt(index) + 1
+                    }
+                },
+                {
+                    title: '模板CODE',
+                    align: 'center',
+                    dataIndex: 'templateCode'
+                },
+                {
+                    title: '模板标题',
+                    align: 'center',
+                    dataIndex: 'templateName'
+                },
+                {
+                    title: '模板内容',
+                    align: 'center',
+                    dataIndex: 'templateContent',
+                    scopedSlots: { customRender: 'templateContent' }
+                },
+                {
+                    title: '模板类型',
+                    align: 'center',
+                    dataIndex: 'templateType',
+                    customRender: function (text) {
+                        if (text == '1') {
+                            return '短信'
+                        }
+                        if (text == '2') {
+                            return '邮件'
+                        }
+                        if (text == '3') {
+                            return '微信'
+                        }
+                        if (text == '4') {
+                            return '系统'
+                        }
+                    }
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    align: 'center',
+                    scopedSlots: { customRender: 'action' }
+                }
+            ],
+            url: {
+                list: '/message/sysMessageTemplate/list',
+                delete: '/message/sysMessageTemplate/delete',
+                deleteBatch: '/message/sysMessageTemplate/deleteBatch',
+                exportXlsUrl: 'message/sysMessageTemplate/exportXls',
+                importExcelUrl: 'message/sysMessageTemplate/importExcel'
             }
-          },
-          {
-            title: '模板CODE',
-            align: "center",
-            dataIndex: 'templateCode'
-          },
-          {
-            title: '模板标题',
-            align: "center",
-            dataIndex: 'templateName'
-          },
-          {
-            title: '模板内容',
-            align: "center",
-            dataIndex: 'templateContent',
-            scopedSlots: {customRender: 'templateContent'},
-          },
-          {
-            title: '模板类型',
-            align: "center",
-            dataIndex: 'templateType',
-            customRender: function (text) {
-              if(text=='1') {
-                return "短信";
-              }
-              if(text=='2') {
-                return "邮件";
-              }
-              if(text=='3') {
-                return "微信";
-              }
-              if(text=='4') {
-                return "系统";
-              }
-            }
-          },
-          {
-            title: '操作',
-            dataIndex: 'action',
-            align: "center",
-            scopedSlots: {customRender: 'action'},
-          }
-        ],
-        url: {
-          list: "/message/sysMessageTemplate/list",
-          delete: "/message/sysMessageTemplate/delete",
-          deleteBatch: "/message/sysMessageTemplate/deleteBatch",
-          exportXlsUrl: "message/sysMessageTemplate/exportXls",
-          importExcelUrl: "message/sysMessageTemplate/importExcel",
-        },
-      }
+        }
     },
     computed: {
-      importExcelUrl: function () {
-        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-      }
+        importExcelUrl: function () {
+            return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+        }
     },
     methods: {
-      handleTest(record){
-        this.$refs.testModal.open(record);
-        this.$refs.testModal.title = "发送测试";
-      }
-
+        handleTest (record) {
+            this.$refs.testModal.open(record)
+            this.$refs.testModal.title = '发送测试'
+        }
     }
-  }
+}
 </script>
 <style lang="less" scoped>
-  /** Button按钮间距 */
-  .ant-btn {
-    margin-left: 3px
-  }
-
-  .ant-card-body .table-operator {
-    margin-bottom: 18px;
-  }
-
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 15px;
-    padding-bottom: 15px;
-  }
-
-  .anty-row-operator button {
-    margin: 0 5px
-  }
-
-  .ant-btn-danger {
-    background-color: #ffffff
-  }
-
-  .ant-modal-cust-warp {
-    height: 100%
-  }
-
-  .ant-modal-cust-warp .ant-modal-body {
-    height: calc(100% - 110px) !important;
-    overflow-y: auto
-  }
-
-  .ant-modal-cust-warp .ant-modal-content {
-    height: 90% !important;
-    overflow-y: hidden
-  }
-</style>
+/** Button按钮间距 */
+.ant-btn {
+  margin-left: 3px;
+}
+
+.ant-card-body .table-operator {
+  margin-bottom: 18px;
+}
+
+.ant-table-tbody .ant-table-row td {
+  padding-top: 15px;
+  padding-bottom: 15px;
+}
+
+.anty-row-operator button {
+  margin: 0 5px;
+}
+
+.ant-btn-danger {
+  background-color: #ffffff;
+}
+
+.ant-modal-cust-warp {
+  height: 100%;
+}
+
+.ant-modal-cust-warp .ant-modal-body {
+  height: calc(100% - 110px) !important;
+  overflow-y: auto;
+}
+
+.ant-modal-cust-warp .ant-modal-content {
+  height: 90% !important;
+  overflow-y: hidden;
+}
+</style>

+ 11 - 7
src/views/oa/myLinks.vue

@@ -22,10 +22,8 @@
     <!-- 新增 批量删除 -->
     <div class="table-add">
       <a-button @click="addOpen" type="primary">新增</a-button>
-      <!-- 批量操作-----------------------------------
-        v-if="selectedRowKeys.length > 0"
-      ------------------------------------------------>
-      <a-dropdown>
+      <!-- 批量操作-->
+      <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
         </a-menu>
@@ -37,8 +35,8 @@
       <!-- 已选择 清空 -->
       <div class="ant-alert ant-alert-info" style="margin: 20px 0;background:#e6f7ff;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
-        <!-- {{ selectedRowKeys.length }} -->
-        <a style="font-weight: 600">4</a>项
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
@@ -50,7 +48,7 @@
           :loading="loading"
           :pagination="pagination"
           :row-key="record => record.id"
-          :rowSelection="rowSelection"
+          :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
           @change="handleTableChange"
         >
           <!-- 发布 -->
@@ -116,6 +114,7 @@ export default {
     },
     data () {
         return {
+            selectedRowKeys: [],
             id: '', // 唯一标识 双休绑定后自动生成,删除
             loading: false, // 表格加载
             pagination: {
@@ -167,6 +166,11 @@ export default {
         this.getLinksList()
     },
     methods: {
+    // 勾选
+        onSelectChange (keys, rows) {
+            this.selectedRowKeys = keys
+            this.selectedRows = rows
+        },
         getLinksList () {
             this.$nextTick(() => {
                 linksList(this.queryParam).then(res => {