王旭
2022-10-10 083b17d07939af29bcb04a27e564664c7280595a
src/components/navMenu.vue
@@ -16,54 +16,124 @@
          @close="handleClose"
          @select="handleselect"
        >
          <el-submenu index="3" class="faSub">
            <template slot="title">
              <span>{{ $t("synthesis.synthesis") }}</span>
            </template>
            <el-menu-item index="Synthesis">{{
              $t("synthesis.synthesis")
            }}</el-menu-item>
            <el-menu-item index="Thematic">{{
              $t("synthesis.themaic")
            }}</el-menu-item>
            <el-menu-item index="Archive">{{
              $t("synthesis.archive")
            }}</el-menu-item>
          </el-submenu>
          <el-submenu index="1" class="faSub">
            <template slot="title">
              <span>{{ $t("common.confirm") }}</span>
              <span>{{ $t("dataManage.dataManage") }}</span>
            </template>
            <el-menu-item index="catalogueManage">目录管理</el-menu-item>
            <el-menu-item index="dataUpdata">数据上传</el-menu-item>
            <el-menu-item index="metadataManage">元数据管理</el-menu-item>
            <el-menu-item index="dataLoading">数据入库</el-menu-item>
            <el-menu-item index="SpatialData">空间数据管理</el-menu-item>
            <el-menu-item index="versionManage">版本管理</el-menu-item>
            <el-menu-item index="dictionaryManage">字典管理</el-menu-item>
            <el-menu-item index="styleManage">样式管理</el-menu-item>
            <el-menu-item index="catalogueManage">{{
              $t("dataManage.catalogueManage")
            }}</el-menu-item>
            <el-menu-item index="dataUpdata">{{
              $t("dataManage.dataUpdata")
            }}</el-menu-item>
            <el-menu-item index="metadataManage">{{
              $t("dataManage.metadataManage")
            }}</el-menu-item>
            <el-menu-item index="dataLoading">{{
              $t("dataManage.dataLoading")
            }}</el-menu-item>
            <el-menu-item index="SpatialData">{{
              $t("dataManage.SpatialData")
            }}</el-menu-item>
            <el-menu-item index="versionManage">{{
              $t("dataManage.versionManage")
            }}</el-menu-item>
            <el-menu-item index="dictionaryManage">{{
              $t("dataManage.dictionaryManage")
            }}</el-menu-item>
            <el-menu-item index="styleManage">{{
              $t("dataManage.styleManage")
            }}</el-menu-item>
          </el-submenu>
          <el-submenu index="2" class="faSub">
            <template slot="title">
              <span>运维管理</span>
              <span>{{ $t("operatManage.operatManage") }}</span>
            </template>
            <el-menu-item index="userManagement">用户管理</el-menu-item>
            <el-submenu index="2-2">
              <template slot="title">系统配置</template>
              <el-menu-item index="menuSettings">菜单设置</el-menu-item>
              <el-menu-item index="parameterConfiguration"
                >参数配置</el-menu-item
              >
              <el-menu-item index="rests">其他</el-menu-item>
              <template slot="title">{{
                $t("operatManage.systemLayout")
              }}</template>
              <el-menu-item index="menuSettings">{{
                $t("operatManage.menuSettings")
              }}</el-menu-item>
              <el-menu-item index="parameterConfiguration">{{
                $t("operatManage.parameterConfiguration")
              }}</el-menu-item>
              <el-menu-item index="rests">{{
                $t("operatManage.rests")
              }}</el-menu-item>
            </el-submenu>
            <el-menu-item index="authorityManagement">权限管理</el-menu-item>
            <el-menu-item index="safetyManagement">安全管理</el-menu-item>
            <el-menu-item index="authorityManagement">{{
              $t("operatManage.authorityManagement")
            }}</el-menu-item>
            <el-menu-item index="safetyManagement">{{
              $t("operatManage.safetyManagement")
            }}</el-menu-item>
            <el-submenu index="2-5">
              <template slot="title">运行监控</template>
              <el-menu-item index="systemMonitoring">系统监控</el-menu-item>
              <el-menu-item index="logLog">登录日志</el-menu-item>
              <el-menu-item index="operationLog">操作日志</el-menu-item>
              <!-- <el-menu-item index="databaseMonitoring">数据库监控</el-menu-item> -->
              <template slot="title">{{
                $t("operatManage.operationMonitoring")
              }}</template>
              <el-menu-item index="eventlogManage">{{
                $t("operatManage.ResourceLog")
              }}</el-menu-item>
              <el-menu-item index="logLog">{{
                $t("operatManage.logLog")
              }}</el-menu-item>
              <el-menu-item index="operationLog">{{
                $t("operatManage.operationLog")
              }}</el-menu-item>
              <el-menu-item index="databaseMonitoring">{{
                $t("operatManage.databaseMonitoring")
              }}</el-menu-item>
              <el-menu-item index="systemMonitoring">{{
                $t("operatManage.systemMonitoring")
              }}</el-menu-item>
              <el-menu-item index="blackwhiteList"
                >{{ $t("operatManage.blackwhiteList") }}
              </el-menu-item>
              <el-menu-item index="tokentool">{{
                $t("operatManage.tokentool")
              }}</el-menu-item>
            </el-submenu>
          </el-submenu>
          <el-submenu index="3" class="faSub">
          <el-submenu index="4" class="faSub">
            <template slot="title">
              <span>综合展示</span>
              <span>{{ $t("userManage.userManage") }}</span>
            </template>
            <el-menu-item index="Synthesis">综合展示</el-menu-item>
            <el-menu-item index="Thematic">专题地图</el-menu-item>
            <el-menu-item index="Archive">资料馆</el-menu-item>
            <el-menu-item index="userInfoManage">{{
              $t("userManage.userInfoManage")
            }}</el-menu-item>
            <el-menu-item index="orgManage">{{
              $t("userManage.orgManage")
            }}</el-menu-item>
            <el-menu-item index="userAuditing">{{
              $t("userManage.userAuditing")
            }}</el-menu-item>
            <el-menu-item index="roleManage">{{
              $t("userManage.roleManage")
            }}</el-menu-item>
            <el-menu-item index="groupManage">{{
              $t("userManage.groupManage")
            }}</el-menu-item>
            <el-menu-item index="authorityManage">{{
              $t("userManage.authorityManage")
            }}</el-menu-item>
          </el-submenu>
          <!-- <el-submenu index="4" class="faSub">
            <template slot="title">数据质检</template>
            <el-menu-item index="4-1">数据质检</el-menu-item>
          </el-submenu> -->
          <!-- <el-submenu index="5" class="faSub">
            <template slot="title">数据交换</template>
            <el-menu-item index="5-1">数据分发</el-menu-item>
@@ -79,7 +149,7 @@
      <div class="userInfo">
        <img src="../assets/img/user.png" alt="" />
        <span>admin</span>
        <span>注销</span>
        <span @click="logOut">注销</span>
        &nbsp;
        <span @click="switchLang"> 切换语言</span>
      </div>
@@ -92,6 +162,8 @@
</template>
<script>
import { logout } from "@/api/api";
import { removeToken,getToken } from "@/utils/auth";
export default {
  name: "navMenu",
  //import引入的组件需要注入到对象中才能使用
@@ -101,6 +173,32 @@
    };
  },
  methods: {
    logOut() {
      this.$confirm("确认是否退出登录?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(async () => {
          const data = await logout({token:getToken()});
          console.log(data);
          if (data.code != 200) {
            return this.$message.error("退出登录失败");
          }
          removeToken();
          this.$router.push("/login");
          this.$message({
            message: "退出登录成功",
            type: "success",
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消",
          });
        });
    },
    handleOpen(key, keyPath) {
      if (
        keyPath[1] != "dataLoading" &&