123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- <!--
- * @Author: your name
- * @Date: 2021-10-14 17:17:53
- * @LastEditTime: 2022-01-12 11:09:08
- * @LastEditors: Please set LastEditors
- * @Description: In User Settings Edit
- * @FilePath: \Foshan4A\src\views\dashboard\index.vue
- -->
- <template>
- <div class="dashboard">
- <!--分类信息-->
- <div class="flex-wrap tu-fl">
- <router-link v-for="(item,index) in flList" :key="index" class="flex fl-list" :to="item.appUrl ? item.appUrl:'/'">
- <div class="fl-list-img">
- <img :src="item.logo">
- </div>
- <div class="fl-list-title flex1">{{item.appName}}</div>
- </router-link>
- </div>
- <!--切换和搜索-->
- <div class="dashboard-tab flex">
- <div class="tab">
- <el-radio-group v-model="radio">
- <el-radio label="1">数据分析</el-radio>
- <el-radio label="2">个人日志</el-radio>
- </el-radio-group>
- </div>
- <div class="search flex-wrap">
- <div class="search-input flex-wrap r24">
- <el-select :style="inputFlag ? 'width:150px;':'width:200px;'" @change="handleChange" v-model="select" placeholder="功能菜单">
- <el-option v-for="(item,index) in selectArr" :key="index" :label="item.name" :value="item.value"></el-option>
- </el-select>
- <el-input v-show="inputFlag" :style="inputFlag ? 'width:330px;':'width:280px;'" placeholder="如需搜索,请输入" v-model="input" class="input-with-select">
- </el-input>
- <!-- <el-select v-model="select" slot="prepend" placeholder="功能菜单">
- <el-option v-for="(item,index) in selectArr" :key="index" :label="item.name" :value="item.value"></el-option>
- </el-select> -->
- </div>
- <div class="search-btn">
- <el-button @click="searchByLink" class="btn" type="primary">进入</el-button>
- </div>
- </div>
- </div>
- <!--数据分析-->
- <Analysis :roleFlag="roleFlag" v-show="radio == 1" />
- <!--个人日志-->
- <Journal v-show="radio == 2" />
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import Analysis from './components/analysis.vue'
- import Journal from './components/journal.vue'
- import { GetOthSystem } from '@/api/apiHome'
- export default {
- name: 'Dashboard',
- components: { Analysis, Journal },
- data () {
- return {
- roleFlag: true,
- inputFlag: false,
- //搜索信息
- selectArr: [
- {
- id: 1,
- name: "账号管理",
- value: 1,
- },
- {
- id: 2,
- name: "账号组管理",
- value: 2,
- },
- {
- id: 3,
- name: "权限项管理",
- value: 3,
- },
- {
- id: 4,
- name: "角色管理",
- value: 4,
- },
- {
- id: 5,
- name: "组织管理",
- value: 5,
- },
- {
- id: 6,
- name: "岗位管理",
- value: 6,
- },
- {
- id: 7,
- name: "职员管理",
- value: 7,
- },
- {
- id: 8,
- name: "登录策略",
- value: 8,
- },
- {
- id: 10,
- name: "系统设置",
- value: 10,
- },
- ],
- //分类信息
- flList: [],
- //切换
- radio: '1',
- flIndex: 0,
- input: '',
- select: ''
- }
- },
- computed: {
- ...mapGetters(['systemSet', 'UserType', 'UserId'])
- },
- created () {
- this.isPower()
- this.getOthSystem()
- },
- methods: {
- //搜索-跳转
- searchByLink () {
- const num = this.select
- switch (num) {
- case 1:
- this.$router.push({ path: '/account', query: { keyWords: this.input } });
- break;
- case 2:
- this.$router.push({ path: '/accountGroup', query: { keyWords: this.input } });
- break;
- case 3:
- this.$router.push({ path: '/authority', query: { keyWords: this.input } });
- break;
- case 4:
- this.$router.push({ path: '/role', query: { keyWords: this.input } });
- break;
- case 5:
- this.$router.push({ path: '/organization', query: { keyWords: this.input } });
- break;
- case 6:
- this.$router.push({ path: '/jobs', query: { keyWords: this.input } });
- break;
- case 7:
- this.$router.push({ path: '/staff', query: { keyWords: this.input } });
- break;
- case 8:
- this.$router.push({ path: '/LoginPolicy', query: { keyWords: this.input } });
- break;
- case 9:
- this.$router.push('/audit');
- break;
- case 10:
- this.$router.push('/systemManagement');
- break;
- default:
- this.$message.warning('请选择');
- break;
- }
- },
- //获取接入系统信息
- async getOthSystem () {
- try {
- const result = await GetOthSystem({
- userId: Number(this.UserId),
- userType: this.UserType
- })
- if (result.code === 0 && result.returnData.length) {
- this.flList = result.returnData
- } else {
- this.$message.error(result.message)
- }
- } catch (error) {
- console.log('网络错误:', error)
- }
- },
- //判断页面展示权限
- isPower () {
- const obj = typeof (this.systemSet) === 'string' ? JSON.parse(this.systemSet) : this.systemSet
- const { OpenGroup, OpenRole } = obj
- if (!OpenGroup) {
- this.selectArr.forEach((item, index) => {
- if (item.id === 2) {
- this.selectArr.splice(index, 1)
- }
- })
- }
- if (!OpenRole) {
- this.selectArr.forEach((item, index) => {
- if (item.id === 4) {
- this.roleFlag = false
- this.selectArr.splice(index, 1)
- }
- })
- }
- },
- handleChange (val) {
- if (val !== 10) {
- this.inputFlag = true
- } else {
- this.inputFlag = false
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .dashboard {
- position: relative;
- width: 100%;
- height: 100%;
- padding: 0 64px;
- padding-top: 32px;
- .tu-fl {
- .fl-list {
- padding: 24px;
- min-width: 240px;
- height: 88px;
- background: #fff;
- cursor: pointer;
- margin-right: 24px;
- box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
- border-radius: 16px;
- margin-bottom: 24px;
- .fl-list-img {
- width: 40px;
- height: 40px;
- overflow: hidden;
- img {
- max-width: 100%;
- }
- }
- .fl-list-title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #303133;
- line-height: 40px;
- margin-left: 16px;
- }
- &:last-child {
- margin-right: 0;
- }
- }
- .active {
- background: linear-gradient(0deg, #777dba, #6983be);
- .fl-list-title {
- color: #fff;
- }
- }
- }
- .dashboard-tab {
- margin: 24px 0 32px 0;
- line-height: 48px;
- ::v-deep .tab {
- .el-radio__label {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #303133;
- }
- }
- ::v-deep .search {
- .search-input {
- height: 48px;
- background: #ffffff;
- box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
- border-radius: 6px;
- line-height: 48px;
- max-width: 480px;
- .el-input-group__prepend {
- border: none;
- background-color: #fff;
- width: 120px;
- }
- .el-input__inner {
- border: 1px solid #fff;
- font-size: 16px;
- }
- }
- .search-btn {
- .btn {
- height: 48px;
- background: linear-gradient(0deg, #6983be, #777dba);
- box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.18);
- border-radius: 6px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #ffffff;
- min-width: 96px;
- }
- }
- }
- }
- }
- </style>
|