Browse Source

登录进入校验子系统

李顺 2 years ago
parent
commit
3650dd99a6

+ 7 - 6
src/layout/components/Header/index.vue

@@ -42,7 +42,7 @@
       </div>
       <div class="right-menu">
         <div class="btn_box">
-          <i class="el-icon-bell bell-info" title="消息提示" @click="notificationDialog = true">
+          <!-- <i class="el-icon-bell bell-info" title="消息提示" @click="notificationDialog = true">
             <span v-show="notificationNum !== 0" class="bell-dot">{{
               notificationNum > 100 ? '99+' : notificationNum
             }}</span>
@@ -50,11 +50,8 @@
               <notification @close-notification="handleCloseNotification" @reget-noti="handleMarked" />
             </el-dialog>
             <video ref="videoMsg" src="../../../assets/images/home/msg.mp3" style="display: none" />
-            <!-- <audio autoplay="autoplay">
-              <source src="/i/song.ogg" type="audio/ogg" />
-              <source src="/i/song.mp3" type="audio/mpeg" />
-            </audio> -->
-          </i>
+            
+          </i> -->
           <i v-if="showDashboard" class="el-icon-s-home" title="首页" @click="home" />
           <i v-if="showSystemSetting" class="el-icon-setting" title="系统管理" @click="handleSys('sysSetting')" />
           <!-- <span class="home" title="首页" @click="home" />
@@ -290,6 +287,10 @@ export default class Header extends Vue {
         this.getNotificationNum()
       }, 0)
     }, notificationInterval)
+    //直接进入数据校验子系统,角色必须绑定
+    if(this.menus.navList.some(item=> item.path==='/projectmanage/list')){
+      this.handleSys({name:'xmgl',path:'/projectmanage/list',title:'数据校验'})
+    }
   }
   destroyed() {
     window.clearInterval(this.timer)

+ 0 - 10
src/store/modules/routeSetting.ts

@@ -9,14 +9,6 @@ const state = {
   menus: [],
   dynamicRoutes: {}
 }
-const prjSelectionRoutes = {
-  path: '/prjSelection',
-  component: () => import('@/views/prjSelection/index.vue'),
-  meta: { title: '项目选择' },
-  type: 'sys',
-  label: '项目选择',
-  icon: 'el-icon-star-on'
-}
 const dashboardRoute = {
   path: '/',
   component: () => import('@/layout/index.vue'),
@@ -131,14 +123,12 @@ const actions = {
                 path: autoLink(item.type, item)
               }
             })
-            menus.some((item, i) => { if (item.name === 'prjSelection') menus.splice(i, 1) })
             commit('SET_NAVMENUS', menus)
             let routes = data.map((item) => item.childrens)
             routes = routes.flat()
 
             const addRouter = packageRouter(routes)
             commit('SET_ROUTES', addRouter)
-            if (data.some((item) => item.type === 'prjSelection')) addRouter.unshift(prjSelectionRoutes)
             if (data.some((item) => item.type === 'map' || gisNames.includes(item.type))) addRouter.unshift(mapRoute)
             if (data.some((item) => item.type === 'dashboard')) addRouter.unshift(dashboardRoute)
             else if (!data.some((item) => item.type === 'dashboard') && data.some((item) => item.type === 'map')) {

+ 1 - 16
src/views/login/index.vue

@@ -189,8 +189,7 @@ export default class Login extends Vue {
                 } else {
                   this.loading = false
                   setTimeout(() => {
-                    this.$router.push({ path: '/dashboard' })
-                    //this.handleSys()
+                    this.$router.push({ path: '/' })
                   }, 0)
                 }
               })
@@ -287,20 +286,6 @@ export default class Login extends Vue {
       })
     }
   }
-  handleSys() {
-    const menuArr = this.$store.state.routeSetting.menus as object[]
-    const event=menuArr.find((item:any,index)=>{
-      return item.name==="xmgl"
-    }) as any
-    if (event.path !== undefined && event.path !== '') this.$router.push({ path: event.path })
-
-    const sideBarShow = this.$store.state.app.sidebar.show
-    if (!sideBarShow) this.$store.dispatch('app/toggleSideBarShow', true)
-    this.$store.dispatch('routeSetting/changeSys', event.name || event)
-    this.$store.commit('map/RESET_ALL')
-    //
-    //this.$store.state.app.activeHeaderItem = event.name
-  }
 }
 </script>
 

BIN
src/views/prjSelection/images/bg.jpg


+ 0 - 135
src/views/prjSelection/index.vue

@@ -1,135 +0,0 @@
-<template>
-  <div class="project">
-    <div class="project-container">
-      <div class="search">
-        <el-row class="title" align="center" type="flex">
-          <el-col :span="18">项目应用</el-col>
-          <el-col :span="6">
-            <el-input autofocus placeholder="请输入筛选关键字" v-model="keyword" />
-            <!-- <el-button type="primary" @click="onAddMenu">加菜单</el-button> -->
-          </el-col>
-        </el-row>
-      </div>
-      <tf-table :columns="columns" :data="computedTableData" border style="padding-top: 0; max-height: 80vh">
-        <template v-slot:name="{ row }">
-          <el-button type="text" @click="() => onProjectSelect(row)">{{ row.name }}</el-button>
-        </template>
-      </tf-table>
-    </div>
-  </div>
-</template>
-
-<script lang="ts">
-  import { Vue, Component } from 'vue-property-decorator'
-  import { ElTableColumn } from 'element-ui/types/table-column'
-  import { elTableAlignLeft } from '@/utils/constant'
-  import { fetchProjects, IOrgProjectCombine, setProjectKey, addMenu } from '@/api/common'
-  import { setParams } from 'staticPub/config'
-  import { setSessionStorage } from '@/utils/auth'
-
-  @Component({ name: 'ProjectList', components: {} })
-  export default class ProjectList extends Vue {
-    columns: (Partial<ElTableColumn> & { _slot?: boolean })[] = [
-      { type: 'index', label: '序号', width: '60px' },
-      { prop: 'orgName', label: '区域总部', minWidth: '120px', ...elTableAlignLeft() },
-      { prop: 'gcfw', label: '省市', width: '100px' },
-      { prop: 'unit', label: '项目公司', minWidth: '120px', ...elTableAlignLeft() },
-      { prop: 'code', label: '项目编号', width: '100px' },
-      { prop: 'name', label: '项目名称', minWidth: '150px', ...elTableAlignLeft(), _slot: true }
-    ]
-    keyword: string = ''
-    tableData: Partial<IOrgProjectCombine>[] = []
-
-    get computedTableData() {
-      if (!this.keyword) return this.tableData
-      const searchKeys = ['orgName', 'gcfw', 'unit', 'code', 'name']
-      return this.tableData.filter((item) =>
-        searchKeys.some((key) => String(item[key]).toUpperCase().includes(this.keyword.toUpperCase()))
-      )
-    }
-
-    async fetchProject() {
-      const { result } = await fetchProjects()
-      this.tableData = result
-        .map(({ id: orgId, prjList, ...org }) => {
-          return (prjList || []).map((item) => ({ ...item, ...org, orgId }))
-        })
-        .flat()
-    }
-
-    async onProjectSelect(row: IOrgProjectCombine) {
-      // 这里设置当前项目
-      setParams(row.gcfw)
-      const { id } = row || {}
-      this.$store.commit('project/UPDATE', row)
-      setSessionStorage('initPosition', row.geo_info) //项目初始位置
-      setSessionStorage('currentPrj', row.id) //项目ID
-      if (id) {
-        const { result } = await setProjectKey(id)
-        if (result) {
-          this.$router.push('/dashboard')
-        }
-      }
-    }
-
-    // async onAddMenu() {
-    //   const data = [
-    //     { key: 'query', name: '数据查询' },
-    //     { key: 'statistics', name: '数据统计' },
-    //     { key: 'connectivity', name: '管网连通性分析' },
-    //     { key: 'relevance', name: '数据关联分析' },
-    //     { key: 'flaw', name: '缺陷特征库' }
-    //   ].map(({ key, name }, index) => {
-    //     const path = `/spectrum/reform/${key}`.replace(/\/$/, '')
-    //     return {
-    //       sort: 1 + index,
-    //       name: path,
-    //       path: path,
-    //       parentId: 4402,
-    //       type: 'gis',
-    //       statusFlag: '1',
-    //       sysId: 52,
-    //       meta: JSON.stringify({ title: name }),
-    //       component: path,
-    //       label: name,
-    //       widgetid: 'FullPanel',
-    //       pathId: path,
-    //       parentPathid: '/spectrum'
-    //     }
-    //   })
-    //   for await (let item of data) {
-    //     await addMenu(item)
-    //   }
-    // }
-
-    created() {
-      this.$store.commit('project/RESET')
-      this.fetchProject()
-    }
-  }
-</script>
-
-<style lang="scss" scoped>
-  .project {
-    width: 100%;
-    height: 100%;
-    background-image: url(./images/bg.jpg);
-    background-repeat: no-repeat;
-    background-size: cover;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    .search {
-      padding: 15px;
-    }
-    &-container {
-      width: 80vw;
-      height: 90vh;
-      background-color: #fff;
-      .title {
-        font-size: 24px;
-        color: $--color-text-primary;
-      }
-    }
-  }
-</style>