linwei
2024-01-22 f8b20c360116f022ada37db0b826b53fd7cdb0d4
Merge remote-tracking branch 'origin/master'
19 files modified
3895 ■■■■ changed files
src/cache.js 51 ●●●● patch | view | raw | blame | history
src/components/error-page/404.vue 27 ●●●● patch | view | raw | blame | history
src/config/website.js 43 ●●●● patch | view | raw | blame | history
src/mock/menu.js 63 ●●●●● patch | view | raw | blame | history
src/page/index/sidebar/index.vue 72 ●●●● patch | view | raw | blame | history
src/page/index/sidebar/sidebarItem.vue 238 ●●●● patch | view | raw | blame | history
src/page/index/tags.vue 312 ●●●● patch | view | raw | blame | history
src/page/index/top/index.vue 5 ●●●●● patch | view | raw | blame | history
src/page/login/userlogin.vue 34 ●●●●● patch | view | raw | blame | history
src/permission.js 75 ●●●●● patch | view | raw | blame | history
src/router/page/index.js 9 ●●●● patch | view | raw | blame | history
src/router/router.js 34 ●●●● patch | view | raw | blame | history
src/router/views/index.js 330 ●●●●● patch | view | raw | blame | history
src/store/getters.js 4 ●●● patch | view | raw | blame | history
src/store/modules/common.js 3 ●●●● patch | view | raw | blame | history
src/store/modules/tags.js 75 ●●●● patch | view | raw | blame | history
src/store/modules/user.js 443 ●●●●● patch | view | raw | blame | history
src/views/system/user.vue 1858 ●●●● patch | view | raw | blame | history
src/views/wel/index.vue 219 ●●●●● patch | view | raw | blame | history
src/cache.js
@@ -1,30 +1,51 @@
import Vue from 'vue'
import store from './store';
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-22 13:23:37
 * @FilePath: \jczz_web\src\cache.js
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
 */
import Vue from "vue";
import store from "./store";
Vue.mixin({
  beforeRouteEnter: function (to, from, next) {
    next(() => {
      let avueView = document.getElementById('avue-view');
      let avueView = document.getElementById("avue-view");
      if (avueView && to.meta.savedPosition) {
        avueView.scrollTop = to.meta.savedPosition
        avueView.scrollTop = to.meta.savedPosition;
      }
    })
    });
  },
  beforeRouteLeave: function (to, from, next) {
    let avueView = document.getElementById('avue-view');
    let avueView = document.getElementById("avue-view");
    if (from && from.meta.keepAlive) {
      if (avueView) {
        from.meta.savedPosition = avueView.scrollTop
        from.meta.savedPosition = avueView.scrollTop;
      }
      const result = this.$route.meta.keepAlive === true && store.state.tags.tagList.some(ele => {
        return ele.value === this.$route.fullPath;
      });
      console.log(store.state.tags.tagList, this.$route.fullPath, 909999);
      const result =
        this.$route.meta.keepAlive === true &&
        store.state.tags.tagList.some((ele) => {
          return ele.value === this.$route.fullPath;
        });
      if (this.$vnode && !result) {
        from.meta.savedPosition = 0
        if (this.$vnode.parent && this.$vnode.parent.componentInstance && this.$vnode.parent.componentInstance.cache) {
        from.meta.savedPosition = 0;
        if (
          this.$vnode.parent &&
          this.$vnode.parent.componentInstance &&
          this.$vnode.parent.componentInstance.cache
        ) {
          if (this.$vnode.componentOptions) {
            let key = this.$vnode.key == null
              ? this.$vnode.componentOptions.Ctor.cid + (this.$vnode.componentOptions.tag ? `::${this.$vnode.componentOptions.tag}` : '')
              : this.$vnode.key;
            let key =
              this.$vnode.key == null
                ? this.$vnode.componentOptions.Ctor.cid +
                  (this.$vnode.componentOptions.tag
                    ? `::${this.$vnode.componentOptions.tag}`
                    : "")
                : this.$vnode.key;
            let cache = this.$vnode.parent.componentInstance.cache;
            let keys = this.$vnode.parent.componentInstance.keys;
            if (cache[key]) {
src/components/error-page/404.vue
@@ -1,23 +1,22 @@
<template>
  <div class="error-page">
    <div class="img"
         style=" background-image: url('/img/bg/404.svg');"></div>
    <div class="content">
      <h1>404</h1>
      <div class="desc">抱歉,你访问的页面不存在</div>
      <div class="actions">
        <router-link :to="{path:'/'}">
          <el-button type="primary">返回首页</el-button>
        </router-link>
      </div>
    <div class="error-page">
        <div class="img" style=" background-image: url('/img/bg/404.svg');"></div>
        <div class="content">
            <h1>404</h1>
            <div class="desc">抱歉,你访问的页面不存在</div>
            <div class="actions">
                <router-link :to="{ path: '/' }">
                    <el-button type="primary">返回首页</el-button>
                </router-link>
            </div>
        </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "error-404"
};
    name: "error-404"
}
</script>
<style lang="scss" scoped>
@import "./style.scss";
src/config/website.js
@@ -4,52 +4,55 @@
export default {
  title: "saber",
  logo: "S",
  key: 'saber', //配置主键,目前用于存储
  indexTitle: '基层智治综合协同平台',
  clientId: 'saber', // 客户端id
  clientSecret: 'saber_secret', // 客户端密钥
  key: "saber", //配置主键,目前用于存储
  indexTitle: "基层智治综合协同平台",
  clientId: "saber", // 客户端id
  clientSecret: "saber_secret", // 客户端密钥
  tenantMode: true, // 是否开启租户模式
  tenantId: "000000", // 管理组租户编号
  captchaMode: true, // 是否开启验证码模式
  switchMode: false, // 是否开启部门切换模式
  lockPage: '/lock',
  lockPage: "/lock",
  tokenTime: 3000,
  tokenHeader: 'Blade-Auth',
  tokenHeader: "Blade-Auth",
  //http的status默认放行列表
  statusWhiteList: [],
  //配置首页不可关闭
  isFirstPage: false,
  fistPage: {
    label: "首页",
    value: "/wel/index",
    params: {},
    query: {},
    meta: {
      i18n: 'dashboard'
      i18n: "dashboard",
    },
    group: [],
    close: false
    close: false,
  },
  //配置菜单的属性
  menu: {
    iconDefault: 'iconfont icon-caidan',
    iconDefault: "iconfont icon-caidan",
    props: {
      label: 'name',
      path: 'path',
      icon: 'source',
      children: 'children'
    }
      label: "name",
      path: "path",
      icon: "source",
      children: "children",
    },
  },
  // 第三方系统授权地址
  authUrl: 'http://localhost/blade-auth/oauth/render',
  authUrl: "http://localhost/blade-auth/oauth/render",
  // 报表设计器地址(cloud端口为8108,boot端口为80)
  reportUrl: 'https://srgdjczzxtpt.com:2080/jczz-ureport/ureport',
  reportUrl: "https://srgdjczzxtpt.com:2080/jczz-ureport/ureport",
  // reportUrl: 'http://localhost:9528/ureport',
  // 单点登录系统认证(blade-auth服务的地)
  ssoUrl: 'http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=',
  ssoUrl:
    "http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=",
  // 单点登录回调地址(Saber服务的地址)
  redirectUri: 'http://localhost:1888',
  redirectUri: "http://localhost:1888",
  // redirectUri:'http://192.168.0.102:9528',
  // minio 基础路径
  minioUrl: 'https://srgdjczzxtpt.com:2080/gminio/jczz/'
}
  minioUrl: "https://srgdjczzxtpt.com:2080/gminio/jczz/",
};
src/mock/menu.js
@@ -1,47 +1,58 @@
import Mock from 'mockjs'
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-22 10:20:25
 * @FilePath: \jczz_web\src\mock\menu.js
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
 */
import Mock from "mockjs";
const top = [{
  label: "首页",
  path: "/wel/index",
  icon: 'el-icon-menu',
  meta: {
    i18n: 'dashboard',
const top = [
  {
    label: "首页",
    path: "/wel/index",
    icon: "el-icon-menu",
    meta: {
      i18n: "dashboard",
    },
    parentId: 0,
  },
  parentId: 0
},
  {
    label: "bladex官网",
    icon: 'el-icon-document',
    icon: "el-icon-document",
    meta: {
      i18n: 'website',
      i18n: "website",
    },
    path: "https://bladex.cn/#/",
    parentId: 1
    parentId: 1,
  },
  {
    label: "avuex官网",
    icon: 'el-icon-document',
    icon: "el-icon-document",
    meta: {
      i18n: 'avuexwebsite',
      i18n: "avuexwebsite",
    },
    path: "https://avuex.avue.top",
    parentId: 2
    parentId: 2,
  },
  {
    label: "测试",
    icon: 'el-icon-document',
    icon: "el-icon-document",
    path: "/test/index",
    meta: {
      i18n: 'test',
      i18n: "test",
    },
    parentId: 3
  }]
export default ({mock}) => {
    parentId: 3,
  },
];
export default ({ mock }) => {
  if (!mock) return;
  Mock.mock('/user/getTopMenu', 'get', () => {
  Mock.mock("/user/getTopMenu", "get", () => {
    return {
      data: top
    }
  })
}
      data: top,
    };
  });
};
src/page/index/sidebar/index.vue
@@ -1,49 +1,51 @@
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-22 11:32:56
 * @FilePath: \jczz_web\src\page\index\sidebar\index.vue
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
-->
<template>
  <div class="avue-sidebar">
    <logo></logo>
    <el-scrollbar style="height:100%">
      <div v-if="validatenull(menu)"
           class="avue-sidebar--tip">{{$t('menuTip')}}
      </div>
      <el-menu unique-opened
               :default-active="nowTagValue"
               mode="vertical"
               :show-timeout="200"
               :collapse="keyCollapse">
        <sidebar-item :menu="menu"
                      :screen="screen"
                      first
                      :props="website.menu.props"
                      :collapse="keyCollapse"></sidebar-item>
      </el-menu>
    </el-scrollbar>
  </div>
    <div class="avue-sidebar">
        <logo></logo>
        <el-scrollbar style="height:100%">
            <div v-if="validatenull(menu)" class="avue-sidebar--tip">{{ $t('menuTip') }}
            </div>
            <el-menu unique-opened :default-active="nowTagValue" mode="vertical" :show-timeout="200"
                :collapse="keyCollapse">
                <sidebar-item :menu="menu" :screen="screen" first :props="website.menu.props"
                    :collapse="keyCollapse"></sidebar-item>
            </el-menu>
        </el-scrollbar>
    </div>
</template>
<script>
  import {mapGetters} from "vuex";
  import logo from "../logo";
  import sidebarItem from "./sidebarItem";
import { mapGetters } from "vuex"
import logo from "../logo"
import sidebarItem from "./sidebarItem"
  export default {
export default {
    name: "sidebar",
    components: {sidebarItem, logo},
    components: { sidebarItem, logo },
    inject: ["index"],
    data() {
      return {};
    data () {
        return {}
    },
    created() {
      this.index.openMenu();
    created () {
        // this.index.openMenu()
    },
    computed: {
      ...mapGetters(["website", "menu", "tag", "keyCollapse", "screen", "menuId"]),
      nowTagValue: function () {
        return this.$router.$avueRouter.getValue(this.$route);
      }
        ...mapGetters(["website", "menu", "tag", "keyCollapse", "screen", "menuId"]),
        nowTagValue: function () {
            return this.$router.$avueRouter.getValue(this.$route)
        }
    },
    methods: {}
  };
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
src/page/index/sidebar/sidebarItem.vue
@@ -1,146 +1,134 @@
<template>
  <div class="menu-wrapper">
    <template v-for="item in menu">
      <el-menu-item v-if="validatenull(item[childrenKey]) && vaildRoles(item)"
                    :index="item[pathKey]"
                    @click="open(item)"
                    :key="item[labelKey]"
                    :class="{'is-active':vaildActive(item)}">
        <i :class="item[iconKey]"></i>
        <span slot="title"
              :alt="item[pathKey]">{{generateTitle(item)}}</span>
      </el-menu-item>
      <el-submenu v-else-if="!validatenull(item[childrenKey])&&vaildRoles(item)"
                  :index="item[pathKey]"
                  :key="item[labelKey]">
        <template slot="title">
          <i :class="item[iconKey]"></i>
          <span slot="title"
                :class="{'el-menu--display':collapse && first}">{{generateTitle(item)}}</span>
        </template>
        <template v-for="(child,cindex) in item[childrenKey]">
          <el-menu-item :index="child[pathKey],cindex"
                        @click="open(child)"
                        :class="{'is-active':vaildActive(child)}"
                        v-if="validatenull(child[childrenKey])"
    <div class="menu-wrapper">
        <template v-for="item in menu">
            <el-menu-item v-if="validatenull(item[childrenKey]) && vaildRoles(item)" :index="item[pathKey]"
                @click="open(item)" :key="item[labelKey]" :class="{ 'is-active': vaildActive(item) }">
                <i :class="item[iconKey]"></i>
                <span slot="title" :alt="item[pathKey]">{{ generateTitle(item) }}</span>
            </el-menu-item>
            <el-submenu v-else-if="!validatenull(item[childrenKey]) && vaildRoles(item)" :index="item[pathKey]"
                :key="item[labelKey]">
                <template slot="title">
                    <i :class="item[iconKey]"></i>
                    <span slot="title" :class="{ 'el-menu--display': collapse && first }">{{ generateTitle(item) }}</span>
                </template>
                <template v-for="(child, cindex) in item[childrenKey]">
                    <el-menu-item :index="child[pathKey], cindex" @click="open(child)"
                        :class="{ 'is-active': vaildActive(child) }" v-if="validatenull(child[childrenKey])"
                        :key="child[labelKey]">
            <i :class="child[iconKey]"></i>
            <span slot="title">{{generateTitle(child)}}</span>
          </el-menu-item>
          <sidebar-item v-else
                        :menu="[child]"
                        :key="cindex"
                        :props="props"
                        :screen="screen"
                        <i :class="child[iconKey]"></i>
                        <span slot="title">{{ generateTitle(child) }}</span>
                    </el-menu-item>
                    <sidebar-item v-else :menu="[child]" :key="cindex" :props="props" :screen="screen"
                        :collapse="collapse"></sidebar-item>
                </template>
            </el-submenu>
        </template>
      </el-submenu>
    </template>
  </div>
    </div>
</template>
<script>
  import {mapGetters} from "vuex";
  import {isURL, validatenull} from "@/util/validate";
  import config from "./config.js";
import { mapGetters } from "vuex"
import { isURL, validatenull } from "@/util/validate"
import config from "./config.js"
  export default {
export default {
    name: "sidebarItem",
    data() {
      return {
        config: config
      };
    data () {
        return {
            config: config
        }
    },
    props: {
      menu: {
        type: Array
      },
      screen: {
        type: Number
      },
      first: {
        type: Boolean,
        default: false
      },
      props: {
        type: Object,
        default: () => {
          return {};
        menu: {
            type: Array
        },
        screen: {
            type: Number
        },
        first: {
            type: Boolean,
            default: false
        },
        props: {
            type: Object,
            default: () => {
                return {}
            }
        },
        collapse: {
            type: Boolean
        }
      },
      collapse: {
        type: Boolean
      }
    },
    created() {
    created () {
    },
    mounted() {
    mounted () {
    },
    computed: {
      ...mapGetters(["roles"]),
      labelKey() {
        return this.props.label || this.config.propsDefault.label;
      },
      pathKey() {
        return this.props.path || this.config.propsDefault.path;
      },
      iconKey() {
        return this.props.icon || this.config.propsDefault.icon;
      },
      childrenKey() {
        return this.props.children || this.config.propsDefault.children;
      },
      isOpenKey() {
        return this.props.isOpen || this.config.propsDefault.isOpen;
      },
      nowTagValue() {
        return this.$router.$avueRouter.getValue(this.$route);
      }
        ...mapGetters(["roles"]),
        labelKey () {
            return this.props.label || this.config.propsDefault.label
        },
        pathKey () {
            return this.props.path || this.config.propsDefault.path
        },
        iconKey () {
            return this.props.icon || this.config.propsDefault.icon
        },
        childrenKey () {
            return this.props.children || this.config.propsDefault.children
        },
        isOpenKey () {
            return this.props.isOpen || this.config.propsDefault.isOpen
        },
        nowTagValue () {
            return this.$router.$avueRouter.getValue(this.$route)
        }
    },
    methods: {
      generateTitle(item) {
        return this.$router.$avueRouter.generateTitle(
          item[this.labelKey],
          (item.meta || {}).i18n
        );
      },
      vaildActive(item) {
        if (this.validIsOpen(item)) {
          return false;
        generateTitle (item) {
            return this.$router.$avueRouter.generateTitle(
                item[this.labelKey],
                (item.meta || {}).i18n
            )
        },
        vaildActive (item) {
            if (this.validIsOpen(item)) {
                return false
            }
            const groupFlag = (item["group"] || []).some(ele =>
                this.$route.path.includes(ele)
            )
            return this.nowTagValue === item[this.pathKey] || groupFlag
        },
        vaildRoles (item) {
            item.meta = item.meta || {}
            return item.meta.roles ? item.meta.roles.includes(this.roles) : true
        },
        validatenull (val) {
            return validatenull(val)
        },
        validIsOpen (item) {
            if (item[this.isOpenKey] === 2 && isURL(item[this.pathKey])) {
                return true
            }
        },
        open (item) {
            if (this.screen <= 1) this.$store.commit("SET_COLLAPSE")
            if (this.validIsOpen(item)) {
                window.open(item[this.pathKey])
            } else {
                this.$router.$avueRouter.group = item.group
                this.$router.$avueRouter.meta = item.meta
                this.$router.push({
                    path: this.$router.$avueRouter.getPath({
                        name: item[this.labelKey],
                        src: item[this.pathKey]
                    }, item.meta),
                    query: item.query
                })
            }
        }
        const groupFlag = (item["group"] || []).some(ele =>
          this.$route.path.includes(ele)
        );
        return this.nowTagValue === item[this.pathKey] || groupFlag;
      },
      vaildRoles(item) {
        item.meta = item.meta || {};
        return item.meta.roles ? item.meta.roles.includes(this.roles) : true;
      },
      validatenull(val) {
        return validatenull(val);
      },
      validIsOpen(item) {
        if (item[this.isOpenKey] === 2 && isURL(item[this.pathKey])) {
          return true;
        }
      },
      open(item) {
        if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
        if (this.validIsOpen(item)) {
          window.open(item[this.pathKey]);
        } else {
          this.$router.$avueRouter.group = item.group;
          this.$router.$avueRouter.meta = item.meta;
          this.$router.push({
            path: this.$router.$avueRouter.getPath({
              name: item[this.labelKey],
              src: item[this.pathKey]
            }, item.meta),
            query: item.query
          });
        }
      }
    }
  };
}
</script>
src/page/index/tags.vue
@@ -1,186 +1,166 @@
<template>
  <div class="avue-tags"
       v-if="showTag">
    <!-- tag盒子 -->
    <div v-if="contextmenuFlag"
         class="avue-tags__contentmenu"
         :style="{left:contentmenuX+'px',top:contentmenuY+'px'}">
      <div class="item"
           @click="clearCacheTags">{{$t('tagsView.clearCache')}}
      </div>
      <div class="item"
           @click="closeOthersTags">{{$t('tagsView.closeOthers')}}
      </div>
      <div class="item"
           @click="closeAllTags">{{$t('tagsView.closeAll')}}
      </div>
    </div>
    <div class="avue-tags__box"
         :class="{'avue-tags__box--close':!website.isFirstPage}">
      <el-tabs v-model="active"
               type="card"
               @contextmenu.native="handleContextmenu"
               :closable="tagLen!==1"
               @tab-click="openTag"
               @edit="menuTag">
        <el-tab-pane :key="item.value"
                     v-for="item in tagList"
                     :label="generateTitle(item)"
                     :name="item.value">
        </el-tab-pane>
    <div class="avue-tags" v-if="showTag">
        <!-- tag盒子 -->
        <div v-if="contextmenuFlag" class="avue-tags__contentmenu"
            :style="{ left: contentmenuX + 'px', top: contentmenuY + 'px' }">
            <div class="item" @click="clearCacheTags">{{ $t('tagsView.clearCache') }}
            </div>
            <div class="item" @click="closeOthersTags">{{ $t('tagsView.closeOthers') }}
            </div>
            <div class="item" @click="closeAllTags">{{ $t('tagsView.closeAll') }}
            </div>
        </div>
        <div class="avue-tags__box" :class="{ 'avue-tags__box--close': !website.isFirstPage }">
            <el-tabs v-model="active" type="card" @contextmenu.native="handleContextmenu" :closable="tagLen !== 1"
                @tab-click="openTag" @edit="menuTag">
                <el-tab-pane :key="item.value" v-for="item in tagList" :label="generateTitle(item)" :name="item.value">
                </el-tab-pane>
      </el-tabs>
      <el-dropdown class="avue-tags__menu">
        <el-button type="primary"
                   size="mini">
          {{$t('tagsView.menu')}}
          <i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item @click.native="$parent.isSearch=true">{{$t('tagsView.search')}}</el-dropdown-item>
          <el-dropdown-item @click.native="closeOthersTags">{{$t('tagsView.closeOthers')}}</el-dropdown-item>
          <el-dropdown-item @click.native="closeAllTags">{{$t('tagsView.closeAll')}}</el-dropdown-item>
          <el-dropdown-item @click.native="clearCacheTags">{{$t('tagsView.clearCache')}}</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
            </el-tabs>
            <el-dropdown class="avue-tags__menu">
                <el-button type="primary" size="mini">
                    {{ $t('tagsView.menu') }}
                    <i class="el-icon-arrow-down el-icon--right"></i>
                </el-button>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item @click.native="$parent.isSearch = true">{{ $t('tagsView.search') }}</el-dropdown-item>
                    <el-dropdown-item @click.native="closeOthersTags">{{ $t('tagsView.closeOthers') }}</el-dropdown-item>
                    <el-dropdown-item @click.native="closeAllTags">{{ $t('tagsView.closeAll') }}</el-dropdown-item>
                    <el-dropdown-item @click.native="clearCacheTags">{{ $t('tagsView.clearCache') }}</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
    </div>
  </div>
</template>
<script>
  import {mapGetters, mapState} from "vuex";
  import {clearCache} from "@/api/user";
import { mapGetters, mapState } from "vuex"
import { clearCache } from "@/api/user"
  export default {
export default {
    name: "tags",
    data() {
      return {
        active: "",
        contentmenuX: "",
        contentmenuY: "",
        contextmenuFlag: false
      };
    data () {
        return {
            active: "",
            contentmenuX: "",
            contentmenuY: "",
            contextmenuFlag: false
        }
    },
    created() {
    created () {
    },
    mounted() {
      this.setActive();
    mounted () {
        this.setActive()
    },
    watch: {
      tag() {
        this.setActive();
      },
      contextmenuFlag() {
        window.addEventListener("mousedown", this.watchContextmenu);
      }
        tag () {
            this.setActive()
        },
        contextmenuFlag () {
            window.addEventListener("mousedown", this.watchContextmenu)
        }
    },
    computed: {
      ...mapGetters(["tagWel", "tagList", "tag", "website"]),
      ...mapState({
        showTag: state => state.common.showTag
      }),
      tagLen() {
        return this.tagList.length || 0;
      }
        ...mapGetters(["tagWel", "tagList", "tag", "website", "homeFirstPage"]),
        ...mapState({
            showTag: state => state.common.showTag
        }),
        tagLen () {
            return this.tagList.length || 0
        }
    },
    methods: {
      generateTitle(item) {
        return this.$router.$avueRouter.generateTitle(
          item.label,
          (item.meta || {}).i18n
        );
      },
      watchContextmenu(event) {
        if (!this.$el.contains(event.target) || event.button !== 0) {
          this.contextmenuFlag = false;
        generateTitle (item) {
            return this.$router.$avueRouter.generateTitle(
                item.label,
                (item.meta || {}).i18n
            )
        },
        watchContextmenu (event) {
            if (!this.$el.contains(event.target) || event.button !== 0) {
                this.contextmenuFlag = false
            }
            window.removeEventListener("mousedown", this.watchContextmenu)
        },
        handleContextmenu (event) {
            let target = event.target
            // 解决 https://github.com/d2-projects/d2-admin/issues/54
            let flag = false
            if (target.className.indexOf("el-tabs__item") > -1) flag = true
            else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
                target = target.parentNode
                flag = true
            }
            if (flag) {
                event.preventDefault()
                event.stopPropagation()
                this.contentmenuX = event.clientX
                this.contentmenuY = event.clientY
                this.tagName = target.getAttribute("aria-controls").slice(5)
                this.contextmenuFlag = true
            }
        },
        //激活当前选项
        setActive () {
            this.active = this.tag.value
        },
        menuTag (value, action) {
            if (action === "remove") {
                let { tag, key } = this.findTag(value)
                this.$store.commit("DEL_TAG", tag)
                if (tag.value === this.tag.value) {
                    tag = this.tagList[key === 0 ? key : key - 1] //如果关闭本标签让前推一个
                    this.openTag(tag)
                }
            }
        },
        openTag (item) {
            let tag
            if (item.name) {
                tag = this.findTag(item.name).tag
            } else {
                tag = item
            }
            this.$router.push({
                path: this.$router.$avueRouter.getPath({
                    name: tag.label,
                    src: tag.value
                }, tag.meta),
                query: tag.query
            })
        },
        closeOthersTags () {
            this.contextmenuFlag = false
            this.$store.commit("DEL_TAG_OTHER")
        },
        findTag (value) {
            let tag, key
            this.tagList.map((item, index) => {
                if (item.value === value) {
                    tag = item
                    key = index
                }
            })
            return { tag: tag, key: key }
        },
        closeAllTags () {
            this.contextmenuFlag = false
            this.$store.commit("DEL_ALL_TAG")
            this.$router.push({ path: this.homeFirstPage })
        },
        clearCacheTags () {
            this.$confirm("是否需要清除缓存?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            }).then(() => {
                clearCache().then(() => {
                    this.contextmenuFlag = false
                    this.$message.success('清除完毕')
                })
            })
        }
        window.removeEventListener("mousedown", this.watchContextmenu);
      },
      handleContextmenu(event) {
        let target = event.target;
        // 解决 https://github.com/d2-projects/d2-admin/issues/54
        let flag = false;
        if (target.className.indexOf("el-tabs__item") > -1) flag = true;
        else if (target.parentNode.className.indexOf("el-tabs__item") > -1) {
          target = target.parentNode;
          flag = true;
        }
        if (flag) {
          event.preventDefault();
          event.stopPropagation();
          this.contentmenuX = event.clientX;
          this.contentmenuY = event.clientY;
          this.tagName = target.getAttribute("aria-controls").slice(5);
          this.contextmenuFlag = true;
        }
      },
      //激活当前选项
      setActive() {
        this.active = this.tag.value;
      },
      menuTag(value, action) {
        if (action === "remove") {
          let {tag, key} = this.findTag(value);
          this.$store.commit("DEL_TAG", tag);
          if (tag.value === this.tag.value) {
            tag = this.tagList[key === 0 ? key : key - 1]; //如果关闭本标签让前推一个
            this.openTag(tag);
          }
        }
      },
      openTag(item) {
        let tag;
        if (item.name) {
          tag = this.findTag(item.name).tag;
        } else {
          tag = item;
        }
        this.$router.push({
          path: this.$router.$avueRouter.getPath({
            name: tag.label,
            src: tag.value
          }, tag.meta),
          query: tag.query
        });
      },
      closeOthersTags() {
        this.contextmenuFlag = false;
        this.$store.commit("DEL_TAG_OTHER");
      },
      findTag(value) {
        let tag, key;
        this.tagList.map((item, index) => {
          if (item.value === value) {
            tag = item;
            key = index;
          }
        });
        return {tag: tag, key: key};
      },
      closeAllTags() {
        this.contextmenuFlag = false;
        this.$store.commit("DEL_ALL_TAG");
        this.$router.push({
          path: this.$router.$avueRouter.getPath({
            src: this.tagWel.value
          }),
          query: this.tagWel.query
        });
      },
      clearCacheTags() {
        this.$confirm("是否需要清除缓存?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          clearCache().then(() => {
            this.contextmenuFlag = false;
            this.$message.success('清除完毕');
          })
        });
      }
    }
  };
}
</script>
src/page/index/top/index.vue
@@ -170,7 +170,9 @@
                        }],
                    },
                ]
            }
            },
            showMenu: getStore({ name: "showMenu" }),
            globalUserInfo: getStore({ name: "userInfo" }),
        }
    },
    filters: {},
@@ -188,7 +190,6 @@
            showFullScren: state => state.common.showFullScren,
            showCollapse: state => state.common.showCollapse,
            showSearch: state => state.common.showSearch,
            showMenu: state => state.common.showMenu,
            showColor: state => state.common.showColor
        }),
        ...mapGetters([
src/page/login/userlogin.vue
@@ -53,6 +53,7 @@
</template>
<script>
import Layout from "@/page/index/"
import { mapGetters } from "vuex"
import { info } from "@/api/system/tenant"
// import {getCaptcha} from "@/api/user";
@@ -176,15 +177,15 @@
    },
    props: [],
    methods: {
        refreshCode () {
            if (this.website.captchaMode) {
                getCaptcha().then(res => {
                    const data = res.data
                    this.loginForm.key = data.key
                    this.loginForm.image = data.image
                })
            }
        },
        // refreshCode () {
        //     if (this.website.captchaMode) {
        //         getCaptcha().then(res => {
        //             const data = res.data
        //             this.loginForm.key = data.key
        //             this.loginForm.image = data.image
        //         })
        //     }
        // },
        showPassword () {
            this.passwordType === ""
                ? (this.passwordType = "password")
@@ -208,7 +209,7 @@
                        text: '登录中,请稍后。。。',
                        spinner: "el-icon-loading"
                    })
                    this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
                    this.$store.dispatch("LoginByUsername", this.loginForm).then((res) => {
                        if (this.website.switchMode) {
                            const deptId = this.userInfo.dept_id
                            const roleId = this.userInfo.role_id
@@ -222,15 +223,24 @@
                                return false
                            }
                        }
                        this.$router.push({ path: this.tagWel.value })
                        if (JSON.stringify(res) == '{}') {
                            this.$router.push({ path: this.tagWel.value })
                        } else {
                            this.$router.$avueRouter.formatRoutes(res.menuData, true)
                            this.$router.push({ path: res.fistMenu.path })
                        }
                        loading.close()
                    }).catch(() => {
                        loading.close()
                        this.refreshCode()
                        // this.refreshCode()
                    })
                }
            })
        },
        getTenant () {
            let domain = getTopUrl()
            // 临时指定域名,方便测试
src/permission.js
@@ -1,66 +1,89 @@
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-22 13:30:53
 * @FilePath: \jczz_web\src\permission.js
 * @Description:
 *
 * Copyright (c) 2024 by shuishen, All Rights Reserved.
 */
/**
 * 全站权限配置
 *
 */
import router from './router/router'
import store from './store'
import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
NProgress.configure({showSpinner: false});
import router from "./router/router";
import store from "./store";
import { validatenull } from "@/util/validate";
import { getToken } from "@/util/auth";
import NProgress from "nprogress"; // progress bar
import "nprogress/nprogress.css"; // progress bar style
import { getStore } from "@/util/store";
NProgress.configure({ showSpinner: false });
const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => {
  const meta = to.meta || {};
  const isMenu = meta.menu === undefined ? to.query.menu : meta.menu;
  store.commit('SET_IS_MENU', isMenu === undefined);
  store.commit("SET_IS_MENU", isMenu === undefined);
  if (getToken()) {
    if (store.getters.isLock && to.path !== lockPage) { //如果系统激活锁屏,全部跳转到锁屏页
      next({path: lockPage})
    } else if (to.path === '/login') { //如果登录成功访问登录页跳转到主页
      next({path: '/'})
    if (store.getters.isLock && to.path !== lockPage) {
      //如果系统激活锁屏,全部跳转到锁屏页
      next({ path: lockPage });
    } else if (to.path === "/login") {
      //如果登录成功访问登录页跳转到主页
      next({ path: "/" });
    } else {
      //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
      if (store.getters.token.length === 0) {
        store.dispatch('FedLogOut').then(() => {
          next({path: '/login'})
        })
        store.dispatch("FedLogOut").then(() => {
          next({ path: "/login" });
        });
      } else {
        const value = to.query.src || to.fullPath;
        const label = to.query.name || to.name;
        const meta = to.meta || router.$avueRouter.meta || {};
        const i18n = to.query.i18n;
        if (to.query.target) {
          window.open(value)
        } else if (meta.isTab !== false && !validatenull(value) && !validatenull(label)) {
          store.commit('ADD_TAG', {
          window.open(value);
        } else if (
          meta.isTab !== false &&
          !validatenull(value) &&
          !validatenull(label)
        ) {
          store.commit("ADD_TAG", {
            label: label,
            value: value,
            params: to.params,
            query: to.query,
            meta: (() => {
              if (!i18n) {
                return meta
                return meta;
              }
              return {
                i18n: i18n
              }
                i18n: i18n,
              };
            })(),
            group: router.$avueRouter.group || []
            group: router.$avueRouter.group || [],
          });
        }
        next()
        if (to.path === "/welindex") {
          next(store.getters.homeFirstPage);
          return;
        }
        next();
      }
    }
  } else {
    //判断是否需要认证,没有登录访问去登录页
    if (meta.isAuth === false) {
      next()
      next();
    } else {
      next('/login')
      next("/login");
    }
  }
})
});
router.afterEach(() => {
  NProgress.done();
src/router/page/index.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-19 11:40:51
 * @LastEditTime: 2024-01-22 12:40:01
 * @FilePath: \jczz_web\src\router\page\index.js
 * @Description:
 *
@@ -79,8 +79,13 @@
  {
    path: "/",
    name: "主页",
    redirect: "/wel",
    redirect: "/welindex",
  },
  {
    path: "/welindex",
  },
  {
    path: "/myiframe",
    component: Layout,
src/router/router.js
@@ -6,19 +6,20 @@
 * isTab是否加入到tag导航
 * isAuth是否需要授权
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
import PageRouter from './page/' // 页面路由
import ViewsRouter from './views/' // 页面路由
import AvueRouter from './avue-router'; //封装的路由控制方法
import i18n from '@/lang' // Internationalization 国际化 多语言
import Store from '../store/'; // vuex
Vue.use(VueRouter)
import Vue from "vue";
import VueRouter from "vue-router";
import PageRouter from "./page/"; // 页面路由
import ViewsRouter from "./views/"; // 页面路由
import AvueRouter from "./avue-router"; //封装的路由控制方法
import i18n from "@/lang"; // Internationalization 国际化 多语言
import Store from "../store/"; // vuex
Vue.use(VueRouter);
//创建路由
export const createRouter = () => new VueRouter({
  routes: [...PageRouter, ...ViewsRouter]
})
const Router = createRouter() // 获得 route 实例
export const createRouter = () =>
  new VueRouter({
    routes: [...PageRouter, ...ViewsRouter],
  });
const Router = createRouter(); // 获得 route 实例
// 初始化和注册 AvueRouter
AvueRouter.install(Vue, {
  router: Router,
@@ -28,9 +29,10 @@
});
Router.$avueRouter.formatRoutes(Store.state.user.menuAll, true); // 动态路由核心方法
Router.addRoutes([...PageRouter, ...ViewsRouter]);
export function resetRouter () {  // 重置路由 比如用于身份验证失败,需要重新登录时 先清空当前的路有权限
  const newRouter = createRouter()
  Router.matcher = newRouter.matcher // reset router
export function resetRouter() {
  // 重置路由 比如用于身份验证失败,需要重新登录时 先清空当前的路有权限
  const newRouter = createRouter();
  Router.matcher = newRouter.matcher; // reset router
  AvueRouter.install(Vue, {
    router: Router,
    store: Store,
@@ -38,4 +40,4 @@
    keepAlive: false,
  });
}
export default Router
export default Router;
src/router/views/index.js
@@ -1,143 +1,189 @@
import Layout from '@/page/index/'
import Layout from "@/page/index/";
export default [{
  path: '/wel',
  component: Layout,
  redirect: '/wel/index',
  children: [{
    path: 'index',
    name: '首页',
    meta: {
      i18n: 'dashboard'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/wel/index')
  }, {
    path: 'dashboard',
    name: '控制台',
    meta: {
      i18n: 'dashboard',
      menu: false,
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
  }]
}, {
  path: '/test',
  component: Layout,
  redirect: '/test/index',
  children: [{
    path: 'index',
    name: '测试页',
    meta: {
      i18n: 'test'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/util/test')
  }]
}, {
  path: '/dict-horizontal',
  component: Layout,
  redirect: '/dict-horizontal/index',
  children: [{
    path: 'index',
    name: '字典管理',
    meta: {
      i18n: 'dict'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
  }]
}, {
  path: '/dict-vertical',
  component: Layout,
  redirect: '/dict-vertical/index',
  children: [{
    path: 'index',
    name: '字典管理',
    meta: {
      i18n: 'dict'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
  }]
}, {
  path: '/info',
  component: Layout,
  redirect: '/info/index',
  children: [{
    path: 'index',
    name: '个人信息',
    meta: {
      i18n: 'info'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/system/userinfo')
  }]
}, {
  path: '/work/process/leave',
  component: Layout,
  redirect: '/work/process/leave/form',
  children: [{
    path: 'form/:processDefinitionId',
    name: '请假流程',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/leave/form')
  }, {
    path: 'handle/:taskId/:processInstanceId/:businessId',
    name: '处理请假流程',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/leave/handle')
  }, {
    path: 'detail/:processInstanceId/:businessId',
    name: '请假流程详情',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/leave/detail')
  }]
}, {
  path: '/work/process/maintenanceFundApply',
  component: Layout,
  redirect: '/work/process/maintenanceFundApply/form',
  children: [{
    path: 'form/:processDefinitionId',
    name: '维修基金申请',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/maintenanceFundApply/form')
  }, {
    path: 'handle/:taskId/:processInstanceId/:businessId',
    name: '处理维修基金申请',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/maintenanceFundApply/handle')
  }, {
    path: 'detail/:processInstanceId/:businessId',
    name: '维修基金申请详情',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/maintenanceFundApply/detail')
  }, {
    path: 'edit/:taskId/:processInstanceId/:businessId',
    name: '调整维修基金申请',
    meta: {
      i18n: 'work'
    },
    component: () =>
      import( /* webpackChunkName: "views" */ '@/views/work/process/maintenanceFundApply/edit')
  }]
}]
export default [
  {
    path: "/wel",
    component: Layout,
    redirect: "/wel/index",
    children: [
      {
        path: "index",
        name: "首页",
        meta: {
          i18n: "dashboard",
        },
        component: () =>
          import(/* webpackChunkName: "views" */ "@/views/wel/index"),
      },
      {
        path: "dashboard",
        name: "控制台",
        meta: {
          i18n: "dashboard",
          menu: false,
        },
        component: () =>
          import(/* webpackChunkName: "views" */ "@/views/wel/dashboard"),
      },
    ],
  },
  {
    path: "/test",
    component: Layout,
    redirect: "/test/index",
    children: [
      {
        path: "index",
        name: "测试页",
        meta: {
          i18n: "test",
        },
        component: () =>
          import(/* webpackChunkName: "views" */ "@/views/util/test"),
      },
    ],
  },
  {
    path: "/dict-horizontal",
    component: Layout,
    redirect: "/dict-horizontal/index",
    children: [
      {
        path: "index",
        name: "字典管理",
        meta: {
          i18n: "dict",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/util/demo/dict-horizontal"
          ),
      },
    ],
  },
  {
    path: "/dict-vertical",
    component: Layout,
    redirect: "/dict-vertical/index",
    children: [
      {
        path: "index",
        name: "字典管理",
        meta: {
          i18n: "dict",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/util/demo/dict-vertical"
          ),
      },
    ],
  },
  {
    path: "/info",
    component: Layout,
    redirect: "/info/index",
    children: [
      {
        path: "index",
        name: "个人信息",
        meta: {
          i18n: "info",
        },
        component: () =>
          import(/* webpackChunkName: "views" */ "@/views/system/userinfo"),
      },
    ],
  },
  {
    path: "/work/process/leave",
    component: Layout,
    redirect: "/work/process/leave/form",
    children: [
      {
        path: "form/:processDefinitionId",
        name: "请假流程",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/leave/form"
          ),
      },
      {
        path: "handle/:taskId/:processInstanceId/:businessId",
        name: "处理请假流程",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/leave/handle"
          ),
      },
      {
        path: "detail/:processInstanceId/:businessId",
        name: "请假流程详情",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/leave/detail"
          ),
      },
    ],
  },
  {
    path: "/work/process/maintenanceFundApply",
    component: Layout,
    redirect: "/work/process/maintenanceFundApply/form",
    children: [
      {
        path: "form/:processDefinitionId",
        name: "维修基金申请",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/maintenanceFundApply/form"
          ),
      },
      {
        path: "handle/:taskId/:processInstanceId/:businessId",
        name: "处理维修基金申请",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/maintenanceFundApply/handle"
          ),
      },
      {
        path: "detail/:processInstanceId/:businessId",
        name: "维修基金申请详情",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/maintenanceFundApply/detail"
          ),
      },
      {
        path: "edit/:taskId/:processInstanceId/:businessId",
        name: "调整维修基金申请",
        meta: {
          i18n: "work",
        },
        component: () =>
          import(
            /* webpackChunkName: "views" */ "@/views/work/process/maintenanceFundApply/edit"
          ),
      },
    ],
  },
];
src/store/getters.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-19 15:58:57
 * @LastEditTime: 2024-01-22 13:12:40
 * @FilePath: \jczz_web\src\store\getters.js
 * @Description:
 *
@@ -28,6 +28,8 @@
  tagWel: (state) => state.tags.tagWel,
  token: (state) => state.user.token,
  roles: (state) => state.user.roles,
  homeFirstPage: (state) => state.user.homeFirstPage,
  permission: (state) => state.user.permission,
  menu: (state) => state.user.menu,
  menuId: (state) => state.user.menuId,
src/store/modules/common.js
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-12-14 17:10:00
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-01-19 16:43:29
 * @LastEditTime: 2024-01-22 11:00:49
 * @FilePath: \jczz_web\src\store\modules\common.js
 * @Description:
 *
@@ -27,7 +27,6 @@
    showLock: true,
    showFullScren: true,
    showTheme: true,
    showMenu: true,
    showColor: true,
    colorName: getStore({ name: "colorName" }) || "#409EFF",
    themeName: "theme-white",
src/store/modules/tags.js
@@ -1,76 +1,81 @@
import {setStore, getStore} from '@/util/store'
import {diff} from '@/util/util'
import website from '@/config/website'
import { setStore, getStore } from "@/util/store";
import { diff } from "@/util/util";
import website from "@/config/website";
import { Alert } from "element-ui";
import user from "./user";
const isFirstPage = website.isFirstPage;
const tagWel = website.fistPage;
const tagObj = {
  label: '', //标题名称
  value: '', //标题的路径
  params: '', //标题的路径参数
  query: '', //标题的参数
  meta: {},//额外参数
  label: "", //标题名称
  value: "", //标题的路径
  params: "", //标题的路径参数
  query: "", //标题的参数
  meta: {}, //额外参数
  group: [], //分组
}
};
//处理首个标签
function setFistTag(list) {
  if (list.length === 1) {
    list[0].close = false;
  } else {
    list.forEach(ele => {
    list.forEach((ele) => {
      if (ele.value === tagWel.value && isFirstPage === false) {
        ele.close = false
        ele.close = false;
      } else {
        ele.close = true
        ele.close = true;
      }
    })
    });
  }
}
const navs = {
  state: {
    tagList: getStore({name: 'tagList'}) || [],
    tag: getStore({name: 'tag'}) || tagObj,
    tagWel: tagWel
    tagList: getStore({ name: "tagList" }) || [],
    tag: getStore({ name: "tag" }) || tagObj,
    tagWel: tagWel,
  },
  actions: {},
  mutations: {
    ADD_TAG: (state, action) => {
      state.tag = action;
      setStore({name: 'tag', content: state.tag})
      if (state.tagList.some(ele => diff(ele, action))) return
      state.tagList.push(action)
      setStore({ name: "tag", content: state.tag });
      if (state.tagList.some((ele) => diff(ele, action))) return;
      state.tagList.push(action);
      setFistTag(state.tagList);
      setStore({name: 'tagList', content: state.tagList})
      setStore({ name: "tagList", content: state.tagList });
    },
    DEL_TAG: (state, action) => {
      state.tagList = state.tagList.filter(item => {
      state.tagList = state.tagList.filter((item) => {
        return !diff(item, action);
      })
      });
      setFistTag(state.tagList);
      setStore({name: 'tagList', content: state.tagList})
      setStore({ name: "tagList", content: state.tagList });
    },
    DEL_ALL_TAG: (state) => {
      state.tagList = [state.tagWel];
      setStore({name: 'tagList', content: state.tagList})
      state.tagList = [user.state.homeFirstTagPage];
      setStore({ name: "tagList", content: state.tagList });
    },
    DEL_TAG_OTHER: (state) => {
      state.tagList = state.tagList.filter(item => {
      state.tagList = state.tagList.filter((item) => {
        if (item.value === state.tag.value) {
          return true;
        } else if (!website.isFirstPage && item.value === website.fistPage.value) {
        } else if (
          !website.isFirstPage &&
          item.value === user.state.homeFirstTagPage.value
        ) {
          return true;
        }
      })
      });
      setFistTag(state.tagList);
      setStore({name: 'tagList', content: state.tagList})
      setStore({ name: "tagList", content: state.tagList });
    },
    SET_TAG_LIST(state, tagList) {
      state.tagList = tagList;
      setStore({name: 'tagList', content: state.tagList})
    }
  }
}
export default navs
      setStore({ name: "tagList", content: state.tagList });
    },
  },
};
export default navs;
src/store/modules/user.js
@@ -1,272 +1,376 @@
import {setToken, setRefreshToken, removeToken, removeRefreshToken} from '@/util/auth'
import {Message} from 'element-ui'
import {setStore, getStore} from '@/util/store'
import {isURL, validatenull} from '@/util/validate'
import {deepClone} from '@/util/util'
import website from '@/config/website'
import {loginByUsername, loginBySocial, loginBySso, getUserInfo, logout, refreshToken, getButtons} from '@/api/user'
import {getTopMenu, getRoutes} from '@/api/system/menu'
import md5 from 'js-md5'
import {
  setToken,
  setRefreshToken,
  removeToken,
  removeRefreshToken,
} from "@/util/auth";
import { Alert, Message } from "element-ui";
import { setStore, getStore } from "@/util/store";
import { isURL, validatenull } from "@/util/validate";
import { deepClone } from "@/util/util";
import website from "@/config/website";
import {
  loginByUsername,
  loginBySocial,
  loginBySso,
  getUserInfo,
  logout,
  refreshToken,
  getButtons,
} from "@/api/user";
import { getTopMenu, getRoutes } from "@/api/system/menu";
import md5 from "js-md5";
function findChildrenUrl(data) {
  if ("children" in data[0] && data[0].children.length > 0) {
    return findChildrenUrl(data[0].children);
  } else {
    return data[0];
  }
}
function addPath(ele, first) {
  const menu = website.menu;
  const propsConfig = menu.props;
  const propsDefault = {
    label: propsConfig.label || 'name',
    path: propsConfig.path || 'path',
    icon: propsConfig.icon || 'icon',
    children: propsConfig.children || 'children'
  }
    label: propsConfig.label || "name",
    path: propsConfig.path || "path",
    icon: propsConfig.icon || "icon",
    children: propsConfig.children || "children",
  };
  const icon = ele[propsDefault.icon];
  ele[propsDefault.icon] = validatenull(icon) ? menu.iconDefault : icon;
  const isChild = ele[propsDefault.children] && ele[propsDefault.children].length !== 0;
  const isChild =
    ele[propsDefault.children] && ele[propsDefault.children].length !== 0;
  if (!isChild) ele[propsDefault.children] = [];
  if (!isChild && first && !isURL(ele[propsDefault.path])) {
    ele[propsDefault.path] = ele[propsDefault.path] + '/index'
    ele[propsDefault.path] = ele[propsDefault.path] + "/index";
  } else {
    ele[propsDefault.children].forEach(child => {
    ele[propsDefault.children].forEach((child) => {
      addPath(child);
    })
    });
  }
}
const user = {
  state: {
    tenantId: getStore({name: 'tenantId'}) || '',
    userInfo: getStore({name: 'userInfo'}) || [],
    permission: getStore({name: 'permission'}) || {},
    tenantId: getStore({ name: "tenantId" }) || "",
    userInfo: getStore({ name: "userInfo" }) || [],
    permission: getStore({ name: "permission" }) || {},
    roles: [],
    menuId: {},
    menu: getStore({name: 'menu'}) || [],
    menuAll: getStore({name: 'menuAll'}) || [],
    token: getStore({name: 'token'}) || '',
    refreshToken: getStore({name: 'refreshToken'}) || '',
    menu: getStore({ name: "menu" }) || [],
    menuAll: getStore({ name: "menuAll" }) || [],
    token: getStore({ name: "token" }) || "",
    refreshToken: getStore({ name: "refreshToken" }) || "",
    homeFirstPage: getStore({ name: "firstPage" }) || "",
    homeFirstTagPage: getStore({ name: "firstTagPage" }) || {},
  },
  actions: {
    //根据用户名登录
    LoginByUsername({commit}, userInfo) {
    LoginByUsername({ dispatch, commit }, userInfo) {
      return new Promise((resolve, reject) => {
        loginByUsername(userInfo.tenantId, userInfo.deptId, userInfo.roleId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
          const data = res.data;
          if (data.error_description) {
            Message({
              message: data.error_description,
              type: 'error'
            })
          } else {
            commit('SET_TOKEN', data.access_token);
            commit('SET_REFRESH_TOKEN', data.refresh_token);
            commit('SET_TENANT_ID', data.tenant_id);
            commit('SET_USER_INFO', data);
            commit('DEL_ALL_TAG');
            commit('CLEAR_LOCK');
          }
          resolve();
        }).catch(error => {
          reject(error);
        })
      })
        loginByUsername(
          userInfo.tenantId,
          userInfo.deptId,
          userInfo.roleId,
          userInfo.username,
          md5(userInfo.password),
          userInfo.type,
          userInfo.key,
          userInfo.code
        )
          .then((res) => {
            const data = res.data;
            if (data.error_description) {
              Message({
                message: data.error_description,
                type: "error",
              });
            } else {
              commit("SET_TOKEN", data.access_token);
              commit("SET_REFRESH_TOKEN", data.refresh_token);
              commit("SET_TENANT_ID", data.tenant_id);
              commit("SET_USER_INFO", data);
              commit("CLEAR_LOCK");
              commit("CLEAR_LOCK");
              dispatch("GetMenu").then((menuData) => {
                let fistMenu = findChildrenUrl(menuData);
                if (data.role_name == "jdgly" || data.role_name == "sqgly") {
                  setStore({ name: "showMenu", content: true });
                  commit("SET_HOMEFIRSTTAGPAGE", {
                    label: "首页",
                    value: "/wel/index",
                    params: {},
                    query: {},
                    meta: {
                      i18n: "dashboard",
                    },
                    group: [],
                    close: false,
                  });
                  commit("SET_HOMEFIRSTPAGE", "/wel");
                  resolve({});
                } else {
                  setStore({ name: "showMenu", content: false });
                  commit("SET_HOMEFIRSTTAGPAGE", {
                    label: fistMenu.name,
                    value: fistMenu.path,
                    params: {},
                    query: {},
                    meta: {
                      i18n: "dashboard",
                    },
                    group: [],
                    close: false,
                  });
                  commit("SET_HOMEFIRSTPAGE", fistMenu.path);
                  resolve({ fistMenu, menuData });
                }
                commit("DEL_ALL_TAG");
              });
            }
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    //根据手机号登录
    LoginByPhone({commit}, userInfo) {
    LoginByPhone({ commit }, userInfo) {
      return new Promise((resolve) => {
        loginByUsername(userInfo.phone, userInfo.code).then(res => {
        loginByUsername(userInfo.phone, userInfo.code).then((res) => {
          const data = res.data.data;
          commit('SET_TOKEN', data);
          commit('DEL_ALL_TAG');
          commit('CLEAR_LOCK');
          commit("SET_TOKEN", data);
          commit("DEL_ALL_TAG");
          commit("CLEAR_LOCK");
          resolve();
        })
      })
        });
      });
    },
    //根据第三方信息登录
    LoginBySocial({commit}, userInfo) {
    LoginBySocial({ commit }, userInfo) {
      return new Promise((resolve) => {
        loginBySocial(userInfo.tenantId, userInfo.source, userInfo.code, userInfo.state).then(res => {
        loginBySocial(
          userInfo.tenantId,
          userInfo.source,
          userInfo.code,
          userInfo.state
        ).then((res) => {
          const data = res.data;
          if (data.error_description) {
            Message({
              message: data.error_description,
              type: 'error'
            })
              type: "error",
            });
          } else {
            commit('SET_TOKEN', data.access_token);
            commit('SET_REFRESH_TOKEN', data.refresh_token);
            commit('SET_USER_INFO', data);
            commit('SET_TENANT_ID', data.tenant_id);
            commit('DEL_ALL_TAG');
            commit('CLEAR_LOCK');
            commit("SET_TOKEN", data.access_token);
            commit("SET_REFRESH_TOKEN", data.refresh_token);
            commit("SET_USER_INFO", data);
            commit("SET_TENANT_ID", data.tenant_id);
            commit("DEL_ALL_TAG");
            commit("CLEAR_LOCK");
          }
          resolve();
        })
      })
        });
      });
    },
    //根据单点信息登录
    LoginBySso({commit}, userInfo) {
    LoginBySso({ commit }, userInfo) {
      return new Promise((resolve) => {
        loginBySso(userInfo.state, userInfo.code).then(res => {
        loginBySso(userInfo.state, userInfo.code).then((res) => {
          const data = res.data;
          if (data.error_description) {
            Message({
              message: data.error_description,
              type: 'error'
            })
              type: "error",
            });
          } else {
            commit('SET_TOKEN', data.access_token);
            commit('SET_REFRESH_TOKEN', data.refresh_token);
            commit('SET_USER_INFO', data);
            commit('SET_TENANT_ID', data.tenant_id);
            commit('DEL_ALL_TAG');
            commit('CLEAR_LOCK');
            commit("SET_TOKEN", data.access_token);
            commit("SET_REFRESH_TOKEN", data.refresh_token);
            commit("SET_USER_INFO", data);
            commit("SET_TENANT_ID", data.tenant_id);
            commit("DEL_ALL_TAG");
            commit("CLEAR_LOCK");
          }
          resolve();
        })
      })
        });
      });
    },
    //获取用户信息
    GetUserInfo({commit}) {
    GetUserInfo({ commit }) {
      return new Promise((resolve, reject) => {
        getUserInfo().then((res) => {
          const data = res.data.data;
          commit('SET_ROLES', data.roles);
          resolve(data);
        }).catch(err => {
          reject(err);
        })
      })
        getUserInfo()
          .then((res) => {
            const data = res.data.data;
            commit("SET_ROLES", data.roles);
            resolve(data);
          })
          .catch((err) => {
            reject(err);
          });
      });
    },
    //刷新token
    refreshToken({state, commit}, userInfo) {
      window.console.log('handle refresh token');
    refreshToken({ state, commit }, userInfo) {
      return new Promise((resolve, reject) => {
        refreshToken(state.refreshToken, state.tenantId,
        refreshToken(
          state.refreshToken,
          state.tenantId,
          !validatenull(userInfo) ? userInfo.deptId : state.userInfo.dept_id,
          !validatenull(userInfo) ? userInfo.roleId : state.userInfo.role_id
        ).then(res => {
          const data = res.data;
          commit('SET_TOKEN', data.access_token);
          commit('SET_REFRESH_TOKEN', data.refresh_token);
          commit('SET_USER_INFO', data);
          resolve();
        }).catch(error => {
          reject(error)
        })
      })
        )
          .then((res) => {
            const data = res.data;
            commit("SET_TOKEN", data.access_token);
            commit("SET_REFRESH_TOKEN", data.refresh_token);
            commit("SET_USER_INFO", data);
            resolve();
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    // 登出
    LogOut({commit}) {
    LogOut({ commit }) {
      return new Promise((resolve, reject) => {
        logout().then(() => {
          commit('SET_TOKEN', '');
          commit('SET_MENU', []);
          commit('SET_MENU_ALL_NULL', []);
          commit('SET_ROLES', []);
          commit('SET_TAG_LIST', []);
          commit('DEL_ALL_TAG');
          commit('CLEAR_LOCK');
          removeToken();
          removeRefreshToken();
          resolve();
        }).catch(error => {
          reject(error)
        })
      })
        logout()
          .then(() => {
            commit("SET_TOKEN", "");
            commit("SET_MENU", []);
            commit("SET_MENU_ALL_NULL", []);
            commit("SET_ROLES", []);
            commit("SET_TAG_LIST", []);
            commit("DEL_ALL_TAG");
            commit("CLEAR_LOCK");
            removeToken();
            removeRefreshToken();
            resolve();
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    //注销session
    FedLogOut({commit}) {
      return new Promise(resolve => {
        commit('SET_TOKEN', '');
        commit('SET_MENU_ALL_NULL', []);
        commit('SET_MENU', []);
        commit('SET_ROLES', []);
        commit('SET_TAG_LIST', []);
        commit('DEL_ALL_TAG');
        commit('CLEAR_LOCK');
    FedLogOut({ commit }) {
      return new Promise((resolve) => {
        commit("SET_TOKEN", "");
        commit("SET_MENU_ALL_NULL", []);
        commit("SET_MENU", []);
        commit("SET_ROLES", []);
        commit("SET_TAG_LIST", []);
        commit("DEL_ALL_TAG");
        commit("CLEAR_LOCK");
        removeToken();
        removeRefreshToken();
        resolve();
      })
      });
    },
    //获取顶部菜单
    GetTopMenu() {
      return new Promise(resolve => {
      return new Promise((resolve) => {
        getTopMenu().then((res) => {
          const data = res.data.data || [];
          resolve(data)
        })
      })
          resolve(data);
        });
      });
    },
    //获取系统菜单
    GetMenu({commit, dispatch}, topMenuId) {
      return new Promise(resolve => {
    GetMenu({ commit, dispatch }, topMenuId) {
      return new Promise((resolve) => {
        getRoutes(topMenuId).then((res) => {
          const data = res.data.data
          const data = res.data.data;
          let menu = deepClone(data);
          menu.forEach(ele => {
          menu.forEach((ele) => {
            addPath(ele, true);
          });
          commit('SET_MENU_ALL', menu)
          commit('SET_MENU', menu)
          dispatch('GetButtons');
          resolve(menu)
        })
      })
          commit("SET_MENU_ALL", menu);
          commit("SET_MENU", menu);
          dispatch("GetButtons");
          resolve(menu);
        });
      });
    },
    //获取系统按钮
    GetButtons({commit}) {
    GetButtons({ commit }) {
      return new Promise((resolve) => {
        getButtons().then(res => {
        getButtons().then((res) => {
          const data = res.data.data;
          commit('SET_PERMISSION', data);
          commit("SET_PERMISSION", data);
          resolve();
        })
      })
        });
      });
    },
  },
  mutations: {
    SET_HOMEFIRSTPAGE: (state, homeFirstPage) => {
      setStore({ name: "firstPage", content: homeFirstPage });
      state.homeFirstPage = homeFirstPage;
    },
    SET_HOMEFIRSTTAGPAGE: (state, homeFirstTagPage) => {
      setStore({
        name: "firstTagPage",
        content: homeFirstTagPage,
      });
      state.homeFirstTagPage = homeFirstTagPage;
    },
    SET_TOKEN: (state, token) => {
      setToken(token);
      state.token = token;
      setStore({name: 'token', content: state.token})
      setStore({ name: "token", content: state.token });
    },
    SET_MENU_ID(state, menuId) {
      state.menuId = menuId;
    },
    SET_MENU_ALL: (state, menuAll) => {
      let menu = state.menuAll;
      menuAll.forEach(ele => {
        if (!menu.find(item => item.label === ele.label && item.path === ele.path)) {
      menuAll.forEach((ele) => {
        if (
          !menu.find(
            (item) => item.label === ele.label && item.path === ele.path
          )
        ) {
          menu.push(ele);
        }
      })
      state.menuAll = menu
      setStore({ name: 'menuAll', content: state.menuAll })
      });
      state.menuAll = menu;
      setStore({ name: "menuAll", content: state.menuAll });
    },
    SET_MENU_ALL_NULL: (state) => {
      state.menuAll = []
      setStore({ name: 'menuAll', content: state.menuAll })
      state.menuAll = [];
      setStore({ name: "menuAll", content: state.menuAll });
    },
    SET_MENU: (state, menu) => {
      state.menu = menu
      setStore({ name: 'menu', content: state.menu })
      state.menu = menu;
      setStore({ name: "menu", content: state.menu });
    },
    SET_REFRESH_TOKEN: (state, refreshToken) => {
      setRefreshToken(refreshToken)
      setRefreshToken(refreshToken);
      state.refreshToken = refreshToken;
      setStore({name: 'refreshToken', content: state.refreshToken})
      setStore({ name: "refreshToken", content: state.refreshToken });
    },
    SET_TENANT_ID: (state, tenantId) => {
      state.tenantId = tenantId;
      setStore({name: 'tenantId', content: state.tenantId})
      setStore({ name: "tenantId", content: state.tenantId });
    },
    SET_USER_INFO: (state, userInfo) => {
      if (validatenull(userInfo.avatar)) {
        userInfo.avatar = "/img/bg/img-logo.png";
      }
      state.userInfo = userInfo;
      setStore({name: 'userInfo', content: state.userInfo})
      setStore({ name: "userInfo", content: state.userInfo });
    },
    SET_ROLES: (state, roles) => {
      state.roles = roles;
@@ -275,27 +379,26 @@
      let result = [];
      function getCode(list) {
        list.forEach(ele => {
          if (typeof (ele) === 'object') {
        list.forEach((ele) => {
          if (typeof ele === "object") {
            const chiildren = ele.children;
            const code = ele.code;
            if (chiildren) {
              getCode(chiildren)
              getCode(chiildren);
            } else {
              result.push(code);
            }
          }
        })
        });
      }
      getCode(permission);
      state.permission = {};
      result.forEach(ele => {
      result.forEach((ele) => {
        state.permission[ele] = true;
      });
      setStore({name: 'permission', content: state.permission})
    }
  }
}
export default user
      setStore({ name: "permission", content: state.permission });
    },
  },
};
export default user;
src/views/system/user.vue
@@ -1,117 +1,117 @@
<template>
  <el-row>
    <el-col :span="5">
      <div class="box">
        <el-scrollbar>
          <basic-container>
            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
          </basic-container>
        </el-scrollbar>
      </div>
    </el-col>
    <el-col :span="19">
      <basic-container>
        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
          v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
          :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
          @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
          @refresh-change="refreshChange" @on-load="onLoad">
          <template slot="menuLeft">
            <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
              @click="handleDelete">删 除
            </el-button>
            <el-button type="info" size="small" plain v-if="permission.user_role" icon="el-icon-user"
              @click="handleGrant">角色配置
            </el-button>
            <el-button type="info" size="small" plain v-if="permission.user_reset" icon="el-icon-refresh"
              @click="handleReset">密码重置
            </el-button>
            <!-- <el-button type="info"
                       size="small"
                       plain
                       v-if="userInfo.role_name.includes('admin')"
                       icon="el-icon-setting"
                       @click="handlePlatform">平台配置
            </el-button> -->
            <el-button type="info" size="small" plain v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-coordinate" @click="handleLock">账号解封
            </el-button>
            <el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-upload2" @click="handleImport">导入
            </el-button>
            <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')"
              icon="el-icon-download" @click="handleExport">导出
            </el-button>
          </template>
          <template slot-scope="{row}" slot="tenantName">
            <el-tag>{{ row.tenantName }}</el-tag>
          </template>
          <template slot-scope="{row}" slot="roleName">
            <el-tag>{{ row.roleName }}</el-tag>
          </template>
          <template slot-scope="{row}" slot="deptName">
            <el-tag>{{ row.deptName }}</el-tag>
          </template>
          <template slot-scope="{row}" slot="userTypeName">
            <el-tag>{{ row.userTypeName }}</el-tag>
          </template>
        </avue-crud>
        <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
    <el-row>
        <el-col :span="5">
            <div class="box">
                <el-scrollbar>
                    <basic-container>
                        <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
                    </basic-container>
                </el-scrollbar>
            </div>
        </el-col>
        <el-col :span="19">
            <basic-container>
                <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud"
                    v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate"
                    @row-save="rowSave" :before-open="beforeOpen" :page.sync="page" @search-change="searchChange"
                    @search-reset="searchReset" @selection-change="selectionChange" @current-change="currentChange"
                    @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
                    <template slot="menuLeft">
                        <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.user_delete"
                            @click="handleDelete">删 除
                        </el-button>
                        <el-button type="info" size="small" plain v-if="permission.user_role" icon="el-icon-user"
                            @click="handleGrant">角色配置
                        </el-button>
                        <el-button type="info" size="small" plain v-if="permission.user_reset" icon="el-icon-refresh"
                            @click="handleReset">密码重置
                        </el-button>
                        <!-- <el-button type="info"
                         size="small"
                         plain
                         v-if="userInfo.role_name.includes('admin')"
                         icon="el-icon-setting"
                         @click="handlePlatform">平台配置
              </el-button> -->
                        <el-button type="info" size="small" plain v-if="userInfo.role_name.includes('admin')"
                            icon="el-icon-coordinate" @click="handleLock">账号解封
                        </el-button>
                        <el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin')"
                            icon="el-icon-upload2" @click="handleImport">导入
                        </el-button>
                        <el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin')"
                            icon="el-icon-download" @click="handleExport">导出
                        </el-button>
                    </template>
                    <template slot-scope="{row}" slot="tenantName">
                        <el-tag>{{ row.tenantName }}</el-tag>
                    </template>
                    <template slot-scope="{row}" slot="roleName">
                        <el-tag>{{ row.roleName }}</el-tag>
                    </template>
                    <template slot-scope="{row}" slot="deptName">
                        <el-tag>{{ row.deptName }}</el-tag>
                    </template>
                    <template slot-scope="{row}" slot="userTypeName">
                        <el-tag>{{ row.userTypeName }}</el-tag>
                    </template>
                </avue-crud>
                <el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px">
          <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole"
            :default-checked-keys="roleTreeObj" :props="props">
          </el-tree>
                    <el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id"
                        ref="treeRole" :default-checked-keys="roleTreeObj" :props="props">
                    </el-tree>
          <span slot="footer" class="dialog-footer">
            <el-button @click="roleBox = false">取 消</el-button>
            <el-button type="primary" @click="submitRole">确 定</el-button>
          </span>
        </el-dialog>
        <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
          <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
            <template slot="excelTemplate">
              <el-button type="primary" @click="handleTemplate">
                点击下载<i class="el-icon-download el-icon--right"></i>
              </el-button>
            </template>
          </avue-form>
        </el-dialog>
        <!-- <el-dialog title="用户平台配置"
                   append-to-body
                   :visible.sync="platformBox">
          <avue-crud :option="platformOption"
                     :table-loading="platformLoading"
                     :data="platformData"
                     ref="platformCrud"
                     v-model="platformForm"
                     :before-open="platformBeforeOpen"
                     :page.sync="platformPage"
                     :permission="platformPermissionList"
                     @row-update="platformRowUpdate"
                     @search-change="platformSearchChange"
                     @search-reset="platformSearchReset"
                     @selection-change="platformSelectionChange"
                     @current-change="platformCurrentChange"
                     @size-change="platformSizeChange"
                     @refresh-change="platformRefreshChange"
                     @on-load="platformOnLoad">
            <template slot-scope="{row}"
                      slot="tenantName">
              <el-tag>{{row.tenantName}}</el-tag>
            </template>
            <template slot-scope="{row}"
                      slot="userTypeName">
              <el-tag>{{row.userTypeName}}</el-tag>
            </template>
          </avue-crud>
        </el-dialog> -->
      </basic-container>
    </el-col>
  </el-row>
                    <span slot="footer" class="dialog-footer">
                        <el-button @click="roleBox = false">取 消</el-button>
                        <el-button type="primary" @click="submitRole">确 定</el-button>
                    </span>
                </el-dialog>
                <el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px">
                    <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
                        <template slot="excelTemplate">
                            <el-button type="primary" @click="handleTemplate">
                                点击下载<i class="el-icon-download el-icon--right"></i>
                            </el-button>
                        </template>
                    </avue-form>
                </el-dialog>
                <!-- <el-dialog title="用户平台配置"
                     append-to-body
                     :visible.sync="platformBox">
            <avue-crud :option="platformOption"
                       :table-loading="platformLoading"
                       :data="platformData"
                       ref="platformCrud"
                       v-model="platformForm"
                       :before-open="platformBeforeOpen"
                       :page.sync="platformPage"
                       :permission="platformPermissionList"
                       @row-update="platformRowUpdate"
                       @search-change="platformSearchChange"
                       @search-reset="platformSearchReset"
                       @selection-change="platformSelectionChange"
                       @current-change="platformCurrentChange"
                       @size-change="platformSizeChange"
                       @refresh-change="platformRefreshChange"
                       @on-load="platformOnLoad">
              <template slot-scope="{row}"
                        slot="tenantName">
                <el-tag>{{row.tenantName}}</el-tag>
              </template>
              <template slot-scope="{row}"
                        slot="userTypeName">
                <el-tag>{{row.userTypeName}}</el-tag>
              </template>
            </avue-crud>
          </el-dialog> -->
            </basic-container>
        </el-col>
    </el-row>
</template>
<script>
  import {
import {
    getList,
    getUser,
    getUserPlatform,
@@ -122,887 +122,887 @@
    grant,
    resetPassword,
    unlock
  } from "@/api/system/user"
  import {
} from "@/api/system/user"
import {
    exportBlob
  } from "@/api/common"
  import {
} from "@/api/common"
import {
    getDeptTree,
    getDeptLazyTree
  } from "@/api/system/dept"
  import {
} from "@/api/system/dept"
import {
    getRoleTree
  } from "@/api/system/role"
  import {
} from "@/api/system/role"
import {
    getPostList
  } from "@/api/system/post"
  import {
} from "@/api/system/post"
import {
    mapGetters
  } from "vuex"
  import website from '@/config/website'
  import {
} from "vuex"
import website from '@/config/website'
import {
    getToken
  } from '@/util/auth'
  import {
} from '@/util/auth'
import {
    downloadXls
  } from "@/util/util"
  import {
} from "@/util/util"
import {
    dateNow
  } from "@/util/date"
  import NProgress from 'nprogress'
  import 'nprogress/nprogress.css'
  import func from "@/util/func"
} from "@/util/date"
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import func from "@/util/func"
  export default {
    data() {
      const validatePass = (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请输入密码'))
        } else {
          callback()
export default {
    data () {
        const validatePass = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请输入密码'))
            } else {
                callback()
            }
        }
      }
      const validatePass2 = (rule, value, callback) => {
        if (value === '') {
          callback(new Error('请再次输入密码'))
        } else if (value !== this.form.password) {
          callback(new Error('两次输入密码不一致!'))
        } else {
          callback()
        const validatePass2 = (rule, value, callback) => {
            if (value === '') {
                callback(new Error('请再次输入密码'))
            } else if (value !== this.form.password) {
                callback(new Error('两次输入密码不一致!'))
            } else {
                callback()
            }
        }
      }
      return {
        form: {},
        search: {},
        roleBox: false,
        excelBox: false,
        platformBox: false,
        initFlag: true,
        selectionList: [],
        query: {},
        loading: true,
        platformLoading: false,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        platformPage: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        init: {
          roleTree: [],
          deptTree: [],
        },
        props: {
          label: "title",
          value: "key"
        },
        roleGrantList: [],
        roleTreeObj: [],
        treeDeptId: '',
        treeData: [],
        treeOption: {
          nodeKey: 'id',
          lazy: true,
          treeLoad: function(node, resolve) {
            const parentId = (node.level === 0) ? 0 : node.data.id
            getDeptLazyTree(parentId).then(res => {
              resolve(res.data.data.map(item => {
                return {
                  ...item,
                  leaf: !item.hasChildren
        return {
            form: {},
            search: {},
            roleBox: false,
            excelBox: false,
            platformBox: false,
            initFlag: true,
            selectionList: [],
            query: {},
            loading: true,
            platformLoading: false,
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            platformPage: {
                pageSize: 10,
                currentPage: 1,
                total: 0
            },
            init: {
                roleTree: [],
                deptTree: [],
            },
            props: {
                label: "title",
                value: "key"
            },
            roleGrantList: [],
            roleTreeObj: [],
            treeDeptId: '',
            treeData: [],
            treeOption: {
                nodeKey: 'id',
                lazy: true,
                treeLoad: function (node, resolve) {
                    const parentId = (node.level === 0) ? 0 : node.data.id
                    getDeptLazyTree(parentId).then(res => {
                        resolve(res.data.data.map(item => {
                            return {
                                ...item,
                                leaf: !item.hasChildren
                            }
                        }))
                    })
                },
                addBtn: false,
                menu: false,
                size: 'small',
                props: {
                    labelText: '标题',
                    label: 'title',
                    value: 'value',
                    children: 'children'
                }
              }))
            })
          },
          addBtn: false,
          menu: false,
          size: 'small',
          props: {
            labelText: '标题',
            label: 'title',
            value: 'value',
            children: 'children'
          }
        },
        option: {
          height: 'auto',
          calcHeight: 80,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          selection: true,
          viewBtn: true,
          dialogType: 'drawer',
          dialogClickModal: false,
          column: [{
              label: "登录账号",
              prop: "account",
              search: true,
              display: false
            },
            // {
            //   label: "所属租户",
            //   prop: "tenantName",
            //   slot: true,
            //   display: false
            // },
            {
              label: "用户姓名",
              prop: "realName",
              search: true,
              display: false
            },
            {
              label: "所属角色",
              prop: "roleName",
              slot: true,
              display: false
            },
            {
              label: "所属部门",
              prop: "deptName",
              slot: true,
              display: false
            },
            // {
            //   label: "用户平台",
            //   prop: "userTypeName",
            //   slot: true,
            //   display: false
            // },
            // {
            //   label: "用户平台",
            //   type: "select",
            //   dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
            //   props: {
            //     label: "dictValue",
            //     value: "dictKey"
            //   },
            //   dataType: "number",
            //   search: true,
            //   hide: true,
            //   display: false,
            //   prop: "userType",
            //   rules: [{
            //     required: true,
            //     message: "请选择用户平台",
            //     trigger: "blur"
            //   }]
            // },
          ],
          group: [{
              label: '基础信息',
              prop: 'baseInfo',
              icon: 'el-icon-user-solid',
              column: [
            option: {
                height: 'auto',
                calcHeight: 80,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                selection: true,
                viewBtn: true,
                dialogType: 'drawer',
                dialogClickModal: false,
                column: [{
                    label: "登录账号",
                    prop: "account",
                    search: true,
                    display: false
                },
                // {
                //   label: "所属租户",
                //   prop: "tenantId",
                //   type: "tree",
                //   dicUrl: "/api/blade-system/tenant/select",
                //   props: {
                //     label: "tenantName",
                //     value: "tenantId"
                //   },
                //   hide: !website.tenantMode,
                //   addDisplay: website.tenantMode,
                //   editDisplay: website.tenantMode,
                //   viewDisplay: website.tenantMode,
                //   rules: [{
                //     required: true,
                //     message: "请输入所属租户",
                //     trigger: "click"
                //   }],
                //   span: 24,
                // },
                {
                  label: "登录账号",
                  prop: "account",
                  rules: [{
                    required: true,
                    message: "请输入登录账号",
                    trigger: "blur"
                  }],
                },
                // {
                //   label: "用户平台",
                //   type: "select",
                //   dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                //   props: {
                //     label: "dictValue",
                //     value: "dictKey"
                //   },
                //   dataType: "number",
                //   prop: "tenantName",
                //   slot: true,
                //   prop: "userType",
                //   rules: [{
                //     required: true,
                //     message: "请选择用户平台",
                //     trigger: "blur"
                //   }]
                //   display: false
                // },
                {
                  label: '密码',
                  prop: 'password',
                  hide: true,
                  editDisplay: false,
                  viewDisplay: false,
                  rules: [{
                    required: true,
                    validator: validatePass,
                    trigger: 'blur'
                  }]
                    label: "用户姓名",
                    prop: "realName",
                    search: true,
                    display: false
                },
                {
                  label: '确认密码',
                  prop: 'password2',
                  hide: true,
                  editDisplay: false,
                  viewDisplay: false,
                  rules: [{
                    required: true,
                    validator: validatePass2,
                    trigger: 'blur'
                  }]
                },
              ]
            },
            {
              label: '详细信息',
              prop: 'detailInfo',
              icon: 'el-icon-s-order',
              column: [{
                  label: "用户昵称",
                  prop: "name",
                  hide: true,
                  rules: [{
                    required: true,
                    message: "请输入用户昵称",
                    trigger: "blur"
                  }]
                    label: "所属角色",
                    prop: "roleName",
                    slot: true,
                    display: false
                },
                {
                  label: "用户姓名",
                  prop: "realName",
                  rules: [{
                    required: true,
                    message: "请输入用户姓名",
                    trigger: "blur"
                  }, {
                    min: 2,
                    max: 5,
                    message: '姓名长度在2到5个字符'
                  }]
                    label: "所属部门",
                    prop: "deptName",
                    slot: true,
                    display: false
                },
                    // {
                    //   label: "用户平台",
                    //   prop: "userTypeName",
                    //   slot: true,
                    //   display: false
                    // },
                    // {
                    //   label: "用户平台",
                    //   type: "select",
                    //   dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                    //   props: {
                    //     label: "dictValue",
                    //     value: "dictKey"
                    //   },
                    //   dataType: "number",
                    //   search: true,
                    //   hide: true,
                    //   display: false,
                    //   prop: "userType",
                    //   rules: [{
                    //     required: true,
                    //     message: "请选择用户平台",
                    //     trigger: "blur"
                    //   }]
                    // },
                ],
                group: [{
                    label: '基础信息',
                    prop: 'baseInfo',
                    icon: 'el-icon-user-solid',
                    column: [
                        // {
                        //   label: "所属租户",
                        //   prop: "tenantId",
                        //   type: "tree",
                        //   dicUrl: "/api/blade-system/tenant/select",
                        //   props: {
                        //     label: "tenantName",
                        //     value: "tenantId"
                        //   },
                        //   hide: !website.tenantMode,
                        //   addDisplay: website.tenantMode,
                        //   editDisplay: website.tenantMode,
                        //   viewDisplay: website.tenantMode,
                        //   rules: [{
                        //     required: true,
                        //     message: "请输入所属租户",
                        //     trigger: "click"
                        //   }],
                        //   span: 24,
                        // },
                        {
                            label: "登录账号",
                            prop: "account",
                            rules: [{
                                required: true,
                                message: "请输入登录账号",
                                trigger: "blur"
                            }],
                        },
                        // {
                        //   label: "用户平台",
                        //   type: "select",
                        //   dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                        //   props: {
                        //     label: "dictValue",
                        //     value: "dictKey"
                        //   },
                        //   dataType: "number",
                        //   slot: true,
                        //   prop: "userType",
                        //   rules: [{
                        //     required: true,
                        //     message: "请选择用户平台",
                        //     trigger: "blur"
                        //   }]
                        // },
                        {
                            label: '密码',
                            prop: 'password',
                            hide: true,
                            editDisplay: false,
                            viewDisplay: false,
                            rules: [{
                                required: true,
                                validator: validatePass,
                                trigger: 'blur'
                            }]
                        },
                        {
                            label: '确认密码',
                            prop: 'password2',
                            hide: true,
                            editDisplay: false,
                            viewDisplay: false,
                            rules: [{
                                required: true,
                                validator: validatePass2,
                                trigger: 'blur'
                            }]
                        },
                    ]
                },
                {
                  label: "手机号码",
                  prop: "phone",
                  overHidden: true
                },
                {
                  label: "电子邮箱",
                  prop: "email",
                  hide: true,
                  overHidden: true
                },
                {
                  label: "用户性别",
                  prop: "sex",
                  type: "select",
                  dicData: [{
                      label: "男",
                      value: 1
                    label: '详细信息',
                    prop: 'detailInfo',
                    icon: 'el-icon-s-order',
                    column: [{
                        label: "用户昵称",
                        prop: "name",
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入用户昵称",
                            trigger: "blur"
                        }]
                    },
                    {
                      label: "女",
                      value: 2
                        label: "用户姓名",
                        prop: "realName",
                        rules: [{
                            required: true,
                            message: "请输入用户姓名",
                            trigger: "blur"
                        }, {
                            min: 2,
                            max: 5,
                            message: '姓名长度在2到5个字符'
                        }]
                    },
                    {
                      label: "未知",
                      value: 3
                        label: "手机号码",
                        prop: "phone",
                        overHidden: true
                    },
                    {
                        label: "电子邮箱",
                        prop: "email",
                        hide: true,
                        overHidden: true
                    },
                    {
                        label: "用户性别",
                        prop: "sex",
                        type: "select",
                        dicData: [{
                            label: "男",
                            value: 1
                        },
                        {
                            label: "女",
                            value: 2
                        },
                        {
                            label: "未知",
                            value: 3
                        }
                        ],
                        hide: true
                    },
                    {
                        label: "用户生日",
                        type: "date",
                        prop: "birthday",
                        format: "yyyy-MM-dd hh:mm:ss",
                        valueFormat: "yyyy-MM-dd hh:mm:ss",
                        hide: true
                    },
                    {
                        label: "账号状态",
                        prop: "statusName",
                        hide: true,
                        display: false
                    }
                  ],
                  hide: true
                    ]
                },
                {
                  label: "用户生日",
                  type: "date",
                  prop: "birthday",
                  format: "yyyy-MM-dd hh:mm:ss",
                  valueFormat: "yyyy-MM-dd hh:mm:ss",
                  hide: true
                    label: '职责信息',
                    prop: 'dutyInfo',
                    icon: 'el-icon-s-custom',
                    column: [
                        // {
                        //   label: "用户编号",
                        //   prop: "code",
                        // },
                        {
                            label: "所属角色",
                            prop: "roleId",
                            type: "tree",
                            multiple: true,
                            checkStrictly: true,
                            leafOnly: false,
                            dicData: [],
                            props: {
                                label: "title"
                            },
                            rules: [{
                                required: true,
                                message: "请选择所属角色",
                                trigger: "click"
                            }]
                        },
                        {
                            label: "所属部门",
                            prop: "deptId",
                            type: "tree",
                            // multiple: true,
                            dicData: [],
                            dataType: "string",
                            props: {
                                label: "title"
                            },
                            // checkStrictly: true,
                            slot: true,
                            span: 12,
                            rules: [{
                                required: true,
                                message: "请选择所属部门",
                                trigger: "click"
                            }]
                        },
                        // {
                        //   label: "所属岗位",
                        //   prop: "postId",
                        //   type: "tree",
                        //   multiple: true,
                        //   dicData: [],
                        //   props: {
                        //     label: "postName",
                        //     value: "id"
                        //   },
                        //   rules: [{
                        //     required: true,
                        //     message: "请选择所属岗位",
                        //     trigger: "click"
                        //   }],
                        // },
                    ]
                },
                ]
            },
            data: [],
            platformQuery: {},
            platformSelectionList: [],
            platformData: [],
            platformForm: {},
            platformOption: {
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                border: true,
                index: true,
                selection: true,
                viewBtn: true,
                dialogClickModal: false,
                menuWidth: 120,
                editBtnText: '配置',
                column: [{
                    label: "登录账号",
                    prop: "account",
                    search: true,
                    display: false
                },
                {
                  label: "账号状态",
                  prop: "statusName",
                  hide: true,
                  display: false
                    label: "所属租户",
                    prop: "tenantName",
                    slot: true,
                    display: false
                },
                {
                    label: "用户姓名",
                    prop: "realName",
                    search: true,
                    display: false
                },
                {
                    label: "用户平台",
                    prop: "userTypeName",
                    slot: true,
                    display: false
                },
                {
                    label: "用户平台",
                    type: "select",
                    dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
                    props: {
                        label: "dictValue",
                        value: "dictKey"
                    },
                    dataType: "number",
                    search: true,
                    hide: true,
                    display: false,
                    prop: "userType",
                    rules: [{
                        required: true,
                        message: "请选择用户平台",
                        trigger: "blur"
                    }]
                },
                {
                    label: "用户拓展",
                    prop: "userExt",
                    type: "textarea",
                    minRows: 8,
                    span: 24,
                    overHidden: true,
                    row: true,
                    hide: true,
                },
                ],
            },
            excelForm: {},
            excelOption: {
                submitBtn: false,
                emptyBtn: false,
                column: [{
                    label: '模板上传',
                    prop: 'excelFile',
                    type: 'upload',
                    drag: true,
                    loadText: '模板上传中,请稍等',
                    span: 24,
                    propsHttp: {
                        res: 'data'
                    },
                    tip: '请上传 .xls,.xlsx 标准格式文件',
                    action: "/api/blade-system/user/import-user"
                },
                {
                    label: "数据覆盖",
                    prop: "isCovered",
                    type: "switch",
                    align: "center",
                    width: 80,
                    dicData: [{
                        label: "否",
                        value: 0
                    },
                    {
                        label: "是",
                        value: 1
                    }
                    ],
                    value: 0,
                    slot: true,
                    rules: [{
                        required: true,
                        message: "请选择是否覆盖",
                        trigger: "blur"
                    }]
                },
                {
                    label: '模板下载',
                    prop: 'excelTemplate',
                    formslot: true,
                    span: 24,
                }
              ]
            },
            {
              label: '职责信息',
              prop: 'dutyInfo',
              icon: 'el-icon-s-custom',
              column: [
                // {
                //   label: "用户编号",
                //   prop: "code",
                // },
                {
                  label: "所属角色",
                  prop: "roleId",
                  multiple: true,
                  type: "tree",
                  dicData: [],
                  props: {
                    label: "title"
                  },
                  checkStrictly: true,
                  slot: true,
                  rules: [{
                    required: true,
                    message: "请选择所属角色",
                    trigger: "click"
                  }]
                },
                {
                  label: "所属部门",
                  prop: "deptId",
                  type: "tree",
                  // multiple: true,
                  dicData: [],
                  dataType: "string",
                  props: {
                    label: "title"
                  },
                  // checkStrictly: true,
                  slot: true,
                  span: 12,
                  rules: [{
                    required: true,
                    message: "请选择所属部门",
                    trigger: "click"
                  }]
                },
                // {
                //   label: "所属岗位",
                //   prop: "postId",
                //   type: "tree",
                //   multiple: true,
                //   dicData: [],
                //   props: {
                //     label: "postName",
                //     value: "id"
                //   },
                //   rules: [{
                //     required: true,
                //     message: "请选择所属岗位",
                //     trigger: "click"
                //   }],
                // },
              ]
            },
          ]
        },
        data: [],
        platformQuery: {},
        platformSelectionList: [],
        platformData: [],
        platformForm: {},
        platformOption: {
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          selection: true,
          viewBtn: true,
          dialogClickModal: false,
          menuWidth: 120,
          editBtnText: '配置',
          column: [{
              label: "登录账号",
              prop: "account",
              search: true,
              display: false
            },
            {
              label: "所属租户",
              prop: "tenantName",
              slot: true,
              display: false
            },
            {
              label: "用户姓名",
              prop: "realName",
              search: true,
              display: false
            },
            {
              label: "用户平台",
              prop: "userTypeName",
              slot: true,
              display: false
            },
            {
              label: "用户平台",
              type: "select",
              dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              dataType: "number",
              search: true,
              hide: true,
              display: false,
              prop: "userType",
              rules: [{
                required: true,
                message: "请选择用户平台",
                trigger: "blur"
              }]
            },
            {
              label: "用户拓展",
              prop: "userExt",
              type: "textarea",
              minRows: 8,
              span: 24,
              overHidden: true,
              row: true,
              hide: true,
            },
          ],
        },
        excelForm: {},
        excelOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [{
              label: '模板上传',
              prop: 'excelFile',
              type: 'upload',
              drag: true,
              loadText: '模板上传中,请稍等',
              span: 24,
              propsHttp: {
                res: 'data'
              },
              tip: '请上传 .xls,.xlsx 标准格式文件',
              action: "/api/blade-system/user/import-user"
            },
            {
              label: "数据覆盖",
              prop: "isCovered",
              type: "switch",
              align: "center",
              width: 80,
              dicData: [{
                  label: "否",
                  value: 0
                },
                {
                  label: "是",
                  value: 1
                }
              ],
              value: 0,
              slot: true,
              rules: [{
                required: true,
                message: "请选择是否覆盖",
                trigger: "blur"
              }]
            },
            {
              label: '模板下载',
              prop: 'excelTemplate',
              formslot: true,
              span: 24,
                ]
            }
          ]
        }
      }
    },
    watch: {
      'form.tenantId'() {
        if (this.form.tenantId !== '' && this.initFlag) {
          this.initData(this.form.tenantId)
        'form.tenantId' () {
            if (this.form.tenantId !== '' && this.initFlag) {
                this.initData(this.form.tenantId)
            }
        },
        'excelForm.isCovered' () {
            if (this.excelForm.isCovered !== '') {
                const column = this.findObject(this.excelOption.column, "excelFile")
                column.action = `/api/blade-system/user/import-user?isCovered=${this.excelForm.isCovered}`
            }
        }
      },
      'excelForm.isCovered'() {
        if (this.excelForm.isCovered !== '') {
          const column = this.findObject(this.excelOption.column, "excelFile")
          column.action = `/api/blade-system/user/import-user?isCovered=${this.excelForm.isCovered}`
        }
      }
    },
    computed: {
      ...mapGetters(["userInfo", "permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.user_add, false),
          viewBtn: this.vaildData(this.permission.user_view, false),
          delBtn: this.vaildData(this.permission.user_delete, false),
          editBtn: this.vaildData(this.permission.user_edit, false)
        }
      },
      platformPermissionList() {
        return {
          addBtn: false,
          viewBtn: false,
          delBtn: false,
          editBtn: this.vaildData(this.permission.user_edit, false)
        }
      },
      ids() {
        let ids = []
        this.selectionList.forEach(ele => {
          ids.push(ele.id)
        })
        return ids.join(",")
      },
        ...mapGetters(["userInfo", "permission"]),
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.user_add, false),
                viewBtn: this.vaildData(this.permission.user_view, false),
                delBtn: this.vaildData(this.permission.user_delete, false),
                editBtn: this.vaildData(this.permission.user_edit, false)
            }
        },
        platformPermissionList () {
            return {
                addBtn: false,
                viewBtn: false,
                delBtn: false,
                editBtn: this.vaildData(this.permission.user_edit, false)
            }
        },
        ids () {
            let ids = []
            this.selectionList.forEach(ele => {
                ids.push(ele.id)
            })
            return ids.join(",")
        },
    },
    mounted() {
      // 非租户模式默认加载管理组数据
      if (!website.tenantMode) {
    mounted () {
        // 非租户模式默认加载管理组数据
        if (!website.tenantMode) {
            this.initData(website.tenantId)
        }
    },
    created () {
        this.initData(website.tenantId)
      }
    },
    created() {
      this.initData(website.tenantId)
    },
    methods: {
      nodeClick(data) {
        this.treeDeptId = data.id
        this.page.currentPage = 1
        this.onLoad(this.page)
      },
      initData(tenantId) {
        getRoleTree(tenantId).then(res => {
          const column = this.findObject(this.option.group, "roleId")
          column.dicData = res.data.data
        })
        getDeptTree(tenantId).then(res => {
          const column = this.findObject(this.option.group, "deptId")
          column.dicData = res.data.data
        })
        // getPostList(tenantId).then(res => {
        //   const column = this.findObject(this.option.group, "postId");
        //   column.dicData = res.data.data;
        // });
      },
      submitRole() {
        const roleList = this.$refs.treeRole.getCheckedKeys().join(",")
        grant(this.ids, roleList).then(() => {
          this.roleBox = false
          this.$message({
            type: "success",
            message: "操作成功!"
          })
          this.onLoad(this.page)
        })
      },
      rowSave(row, done, loading) {
        row['tenantId'] = "000000"
        row['userType'] = 1
        row.deptId = func.join(row.deptId)
        row.roleId = func.join(row.roleId)
        row.postId = func.join(row.postId);
        add(row).then(() => {
          this.initFlag = false
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          })
          done()
        }, error => {
          window.console.log(error)
          loading()
        })
      },
      rowUpdate(row, index, done, loading) {
        row['tenantId'] = "000000"
        row['userType'] = 1
        row.deptId = func.join(row.deptId)
        row.roleId = func.join(row.roleId)
        row.postId = func.join(row.postId);
        update(row).then(() => {
          this.initFlag = false
          this.onLoad(this.page)
          this.$message({
            type: "success",
            message: "操作成功!"
          })
          done()
        }, error => {
          window.console.log(error)
          loading()
        })
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(row.id)
          })
          .then(() => {
        nodeClick (data) {
            this.treeDeptId = data.id
            this.page.currentPage = 1
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
        },
        initData (tenantId) {
            getRoleTree(tenantId).then(res => {
                const column = this.findObject(this.option.group, "roleId")
                column.dicData = res.data.data
            })
          })
      },
      searchReset() {
        this.query = {}
        this.treeDeptId = ''
        this.onLoad(this.page)
      },
      searchChange(params, done) {
        this.query = params
        this.page.currentPage = 1
        this.onLoad(this.page, params)
        done()
      },
      selectionChange(list) {
        this.selectionList = list
      },
      selectionClear() {
        this.selectionList = []
        this.$refs.crud.toggleSelection()
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择数据删除?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return remove(this.ids)
          })
          .then(() => {
            getDeptTree(tenantId).then(res => {
                const column = this.findObject(this.option.group, "deptId")
                column.dicData = res.data.data
            })
            // getPostList(tenantId).then(res => {
            //   const column = this.findObject(this.option.group, "postId");
            //   column.dicData = res.data.data;
            // });
        },
        submitRole () {
            const roleList = this.$refs.treeRole.getCheckedKeys().join(",")
            grant(this.ids, roleList).then(() => {
                this.roleBox = false
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                this.onLoad(this.page)
            })
        },
        rowSave (row, done, loading) {
            row['tenantId'] = "000000"
            row['userType'] = 1
            row.deptId = func.join(row.deptId)
            row.roleId = func.join(row.roleId)
            row.postId = func.join(row.postId)
            add(row).then(() => {
                this.initFlag = false
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowUpdate (row, index, done, loading) {
            row['tenantId'] = "000000"
            row['userType'] = 1
            row.deptId = func.join(row.deptId)
            row.roleId = func.join(row.roleId)
            row.postId = func.join(row.postId)
            update(row).then(() => {
                this.initFlag = false
                this.onLoad(this.page)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return remove(row.id)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        searchReset () {
            this.query = {}
            this.treeDeptId = ''
            this.onLoad(this.page)
            this.$message({
              type: "success",
              message: "操作成功!"
            })
        },
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
          })
      },
      handleReset() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择账号密码重置为123456?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return resetPassword(this.ids)
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
        },
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
            this.$refs.crud.toggleSelection()
          })
      },
      handleGrant() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.roleTreeObj = []
        if (this.selectionList.length === 1) {
          this.roleTreeObj = this.selectionList[0].roleId.split(",")
        }
        getRoleTree().then(res => {
          this.roleGrantList = res.data.data
          this.roleBox = true
        })
      },
      handlePlatform() {
        this.platformBox = true
      },
      handleLock() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据")
          return
        }
        this.$confirm("确定将选择账号解封?", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            return unlock(this.ids)
          })
          .then(() => {
            this.$message({
              type: "success",
              message: "操作成功!"
                .then(() => {
                    return remove(this.ids)
                })
                .then(() => {
                    this.onLoad(this.page)
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        handleReset () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            this.$confirm("确定将选择账号密码重置为123456?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
          })
      },
      handleImport() {
        this.excelBox = true
      },
      uploadAfter(res, done, loading, column) {
        window.console.log(column)
        this.excelBox = false
        this.refreshChange()
        done()
      },
      handleExport() {
        const account = func.toStr(this.search.account)
        const realName = func.toStr(this.search.realName)
        this.$confirm("是否导出用户数据?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          NProgress.start()
          exportBlob(
            `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}`
            ).then(res => {
            downloadXls(res.data, `用户数据表${dateNow()}.xlsx`)
            NProgress.done()
          })
        })
      },
      handleTemplate() {
        exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
          downloadXls(res.data, "用户数据模板.xlsx")
        })
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getUser(this.form.id).then(res => {
            this.form = res.data.data
            if (this.form.hasOwnProperty("deptId")) {
              this.form.deptId = this.form.deptId.split(",")
                .then(() => {
                    return resetPassword(this.ids)
                })
                .then(() => {
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                    this.$refs.crud.toggleSelection()
                })
        },
        handleGrant () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
            if (this.form.hasOwnProperty("roleId")) {
              this.form.roleId = this.form.roleId.split(",")
            this.roleTreeObj = []
            if (this.selectionList.length === 1) {
                this.roleTreeObj = this.selectionList[0].roleId.split(",")
            }
            if (this.form.hasOwnProperty("postId")) {
              this.form.postId = this.form.postId.split(",")
            getRoleTree().then(res => {
                this.roleGrantList = res.data.data
                this.roleBox = true
            })
        },
        handlePlatform () {
            this.platformBox = true
        },
        handleLock () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
            }
          })
            this.$confirm("确定将选择账号解封?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            })
                .then(() => {
                    return unlock(this.ids)
                })
                .then(() => {
                    this.$message({
                        type: "success",
                        message: "操作成功!"
                    })
                })
        },
        handleImport () {
            this.excelBox = true
        },
        uploadAfter (res, done, loading, column) {
            window.console.log(column)
            this.excelBox = false
            this.refreshChange()
            done()
        },
        handleExport () {
            const account = func.toStr(this.search.account)
            const realName = func.toStr(this.search.realName)
            this.$confirm("是否导出用户数据?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            }).then(() => {
                NProgress.start()
                exportBlob(
                    `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}`
                ).then(res => {
                    downloadXls(res.data, `用户数据表${dateNow()}.xlsx`)
                    NProgress.done()
                })
            })
        },
        handleTemplate () {
            exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
                downloadXls(res.data, "用户数据模板.xlsx")
            })
        },
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getUser(this.form.id).then(res => {
                    this.form = res.data.data
                    if (this.form.hasOwnProperty("deptId")) {
                        this.form.deptId = this.form.deptId.split(",")
                    }
                    if (this.form.hasOwnProperty("roleId")) {
                        this.form.roleId = this.form.roleId.split(",")
                    }
                    if (this.form.hasOwnProperty("postId")) {
                        this.form.postId = this.form.postId.split(",")
                    }
                })
            }
            this.initFlag = true
            done()
        },
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
                const data = res.data.data
                this.page.total = data.total
                this.data = data.records
                this.loading = false
                this.selectionClear()
            })
        },
        platformRowUpdate (row, index, done, loading) {
            updatePlatform(row.id, row.userType, row.userExt).then(() => {
                this.platformOnLoad(this.platformPage)
                this.$message({
                    type: "success",
                    message: "操作成功!"
                })
                done()
            }, error => {
                window.console.log(error)
                loading()
            })
        },
        platformBeforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getUserPlatform(this.platformForm.id).then(res => {
                    this.platformForm = res.data.data
                })
            }
            done()
        },
        platformSearchReset () {
            this.platformQuery = {}
            this.platformOnLoad(this.platformPage)
        },
        platformSearchChange (params, done) {
            this.platformQuery = params
            this.platformPage.currentPage = 1
            this.platformOnLoad(this.platformPage, params)
            done()
        },
        platformSelectionChange (list) {
            this.platformSelectionList = list
        },
        platformSelectionClear () {
            this.platformSelectionList = []
            this.$refs.platformCrud.toggleSelection()
        },
        platformCurrentChange (currentPage) {
            this.platformPage.currentPage = currentPage
        },
        platformSizeChange (pageSize) {
            this.platformPage.pageSize = pageSize
        },
        platformRefreshChange () {
            this.platformOnLoad(this.platformPage, this.platformQuery)
        },
        platformOnLoad (page, params = {}) {
            this.platformLoading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
                const data = res.data.data
                this.platformPage.total = data.total
                this.platformData = data.records
                this.platformLoading = false
                this.selectionClear()
            })
        }
        this.initFlag = true
        done()
      },
      currentChange(currentPage) {
        this.page.currentPage = currentPage
      },
      sizeChange(pageSize) {
        this.page.pageSize = pageSize
      },
      refreshChange() {
        this.onLoad(this.page, this.query)
      },
      onLoad(page, params = {}) {
        this.loading = true
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
          const data = res.data.data
          this.page.total = data.total
          this.data = data.records
          this.loading = false
          this.selectionClear()
        })
      },
      platformRowUpdate(row, index, done, loading) {
        updatePlatform(row.id, row.userType, row.userExt).then(() => {
          this.platformOnLoad(this.platformPage)
          this.$message({
            type: "success",
            message: "操作成功!"
          })
          done()
        }, error => {
          window.console.log(error)
          loading()
        })
      },
      platformBeforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getUserPlatform(this.platformForm.id).then(res => {
            this.platformForm = res.data.data
          })
        }
        done()
      },
      platformSearchReset() {
        this.platformQuery = {}
        this.platformOnLoad(this.platformPage)
      },
      platformSearchChange(params, done) {
        this.platformQuery = params
        this.platformPage.currentPage = 1
        this.platformOnLoad(this.platformPage, params)
        done()
      },
      platformSelectionChange(list) {
        this.platformSelectionList = list
      },
      platformSelectionClear() {
        this.platformSelectionList = []
        this.$refs.platformCrud.toggleSelection()
      },
      platformCurrentChange(currentPage) {
        this.platformPage.currentPage = currentPage
      },
      platformSizeChange(pageSize) {
        this.platformPage.pageSize = pageSize
      },
      platformRefreshChange() {
        this.platformOnLoad(this.platformPage, this.platformQuery)
      },
      platformOnLoad(page, params = {}) {
        this.platformLoading = true
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
          const data = res.data.data
          this.platformPage.total = data.total
          this.platformData = data.records
          this.platformLoading = false
          this.selectionClear()
        })
      }
    }
  }
}
</script>
<style>
  .box {
.box {
    height: 800px;
  }
}
  .el-scrollbar {
.el-scrollbar {
    height: 100%;
  }
}
  .box .el-scrollbar__wrap {
.box .el-scrollbar__wrap {
    overflow: scroll;
  }
</style>
}
</style>
src/views/wel/index.vue
@@ -4,25 +4,10 @@
            <span class="h1">{{ webTitle }}</span>
            <span class="h2"></span>
        </div>
        <div class="homeL-bar">
            <div class="outS" @click="down1">
                <div class="down1"><span>住户管理</span></div>
            </div>
            <div class="outS" @click="down2">
                <div class="down2"><span>房屋管理</span></div>
            </div>
            <div class="outS" @click="down3">
                <div class="down3"><span>E呼即办</span></div>
            </div>
            <div class="outS" @click="down4">
                <div class="down4"><span>报事报修</span></div>
            </div>
            <div class="outS" @click="down5">
                <div class="down5"><span>走访日志</span></div>
            </div>
            <div class="outS" @click="down6"
                v-show="globalUserInfo.role_name == 'administrator' || globalUserInfo.role_name.split(',').find(item => item == 'admin')">
                <div class="down6"><span>驾驶舱</span></div>
        <div class="homeL-bar" v-if="homeMenuData.length">
            <div class="outS" v-for="(item, index) in homeMenuData" :key="index" @click="openMenu(item, item.newOpen)">
                <div :style="{ backgroundImage: `url(${publicPath + item.imageUrl})` }"><span>{{ item.title }}</span>
                </div>
            </div>
        </div>
    </div>
@@ -39,29 +24,106 @@
            webType: getStore({ name: "webType" }),
            a: 1,
            globalUserInfo: getStore({ name: "userInfo" }),
            publicPath: process.env.BASE_URL,
            homeMenuData: []
        }
    },
    created () {
        if (this.webType == 'secend') {
            // 住建局
            // if (this.globalUserInfo.role_name == 'zjj') {
            //     this.homeMenuData = [
            //         {
            //             imageUrl: 'img/yijianbaoj.png',
            //             url: '/propertySupervision/residentSupervision',
            //             title: '居民监管',
            //             newOpen: false,
            //         },
            //         {
            //             imageUrl: 'img/yijianbaoj.png',
            //             url: '/propertySupervision/houseHoldSupervision',
            //             title: '住房监管',
            //             newOpen: false,
            //         },
            //         {
            //             imageUrl: 'img/yijianbaoj.png',
            //             url: '/propertySupervision/ownersCommittee',
            //             title: '业主大会',
            //             newOpen: false,
            //         },
            //         {
            //             imageUrl: 'img/yijianbaoj.png',
            //             url: '/propertySupervision/propertyCapitalManage',
            //             title: '维修基金管理',
            //             newOpen: false,
            //         },
            //     ]
            // } else {
            //     // 物业
            //     this.homeMenuData = [
            //         {
            //             imageUrl: 'img/yijianbaoj.png',
            //             url: '/userHouse/houseHoldList',
            //             title: '住户管理',
            //             newOpen: false,
            //         },
            //     ]
            // }
        } else {
            this.homeMenuData = [
                {
                    imageUrl: 'img/yijianbaoj.png',
                    url: '/userHouse/houseHoldList',
                    title: '住户管理',
                    newOpen: false,
                },
                {
                    imageUrl: 'img/fangyi.png',
                    url: '/userHouse/houseList',
                    title: '房屋管理',
                    newOpen: false,
                },
                {
                    imageUrl: 'img/anjian.png',
                    url: '/cGovernance/taskECall',
                    title: 'E呼即办',
                    newOpen: false,
                },
                {
                    imageUrl: 'img/tiwen.png',
                    url: '/task/reportForRepairs',
                    title: '报事报修',
                    newOpen: false,
                },
                {
                    imageUrl: 'img/tongji.png',
                    url: '/cGovernance/gridWorkLog',
                    title: '走访日志',
                    newOpen: false,
                }
            ]
            if (this.globalUserInfo.role_name == 'administrator' || this.globalUserInfo.role_name.split(',').find(item => item == 'admin')) {
                this.homeMenuData.push({
                    imageUrl: 'img/jsc.png',
                    url: `http://srgdjczzxtpt.com:2181/uniform-auth/login?app=app_smart_aoi&Blade-Auth=bearer ${getToken()}`,
                    title: '驾驶舱',
                    newOpen: true,
                })
            }
        }
    },
    methods: {
        down1 () {
            this.$router.push({ path: "/userHouse/houseHoldList" })
        },
        down2 () {
            this.$router.push({ path: "/userHouse/houseList" })
        },
        down3 () {
            this.$router.push({ path: "/cGovernance/taskECall" })
        },
        down4 () {
            this.$router.push({ path: "/task/reportForRepairs" })
        },
        down5 () {
            this.$router.push({ path: "/cGovernance/gridWorkLog" })
        },
        down6 () {
            let token = 'bearer ' + getToken()
            window.open(`http://srgdjczzxtpt.com:2181/uniform-auth/login?app=app_smart_aoi&Blade-Auth=${token}`)
        },
        openMenu (data, flag = false) {
            if (flag) {
                window.open(data.url)
            } else {
                this.$router.push({ path: data.url })
            }
        }
    },
    mouted () { },
}
@@ -118,64 +180,35 @@
            height: 94.6%;
            display: flex;
            justify-content: center;
        }
        .down1,
        .down2,
        .down3,
        .down4,
        .down5,
        .down6 {
            width: 96%;
            height: 100%;
            background-repeat: no-repeat;
            background-size: 100% 100%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 5px;
            &>div {
                width: 96%;
                height: 100%;
                background-repeat: no-repeat;
                background-size: 100% 100%;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 5px;
            &:hover {
                width: 99%;
                height: 99%;
                transition: all 0.3s ease;
                &:hover {
                    width: 99%;
                    height: 99%;
                    transition: all 0.3s ease;
                }
                span {
                    position: relative;
                    top: -30px;
                    left: -50px;
                    font-weight: 600;
                    font-size: 30px;
                    color: #fff;
                    display: inline-block;
                    // border: 1px solid rgb(180, 22, 75);
                }
            }
            span {
                position: relative;
                top: -30px;
                left: -50px;
                font-weight: 600;
                font-size: 30px;
                color: #fff;
                display: inline-block;
                // border: 1px solid rgb(180, 22, 75);
            }
        }
        .down1 {
            background-image: url("../../../public/img/yijianbaoj.png");
        }
        .down2 {
            background-image: url("../../../public/img/fangyi.png");
        }
        .down3 {
            background-image: url("../../../public/img/anjian.png");
        }
        .down4 {
            background-image: url("../../../public/img/tiwen.png");
        }
        .down5 {
            background-image: url("../../../public/img/tongji.png");
        }
        .down6 {
            background-image: url("../../../public/img/jsc.png");
        }
    }
}