fix: BUG修改

This commit is contained in:
kun 2023-08-02 19:29:39 +08:00
parent 13ed4cff19
commit 8174db0433
13 changed files with 50 additions and 25 deletions

View File

@ -1,13 +1,13 @@
<!-- 经典布局 -->
<template>
<el-container class="layout">
<el-container class="classic-main">
<!-- <el-container class="classic-main">
<Main />
</el-container>
<!-- <el-header>
</el-container> -->
<el-header>
<div class="header-lf">
<div @click="goHome" class="logo flx-center">
<img src="@/assets/images/login/china.png" style="margin: 0 15px" alt="logo" />
<!-- <img src="@/assets/images/login/china.png" style="margin: 0 15px" alt="logo" /> -->
<span>数字化政务监管平台</span>
<span v-if="moduleTitle" style="margin: 0 20px">|</span>
<span class="title">{{ moduleTitle }}</span>
@ -15,10 +15,10 @@
<ToolBarLeft />
</div>
<ToolBarRight />
</el-header> -->
<!-- <el-container class="classic-content">
</el-header>
<el-container class="classic-content">
<el-aside>
<div class="menu" :style="{ width: isCollapse ? '65px' : '210px' }"> 根据屏幕自动收缩
<!-- <div class="menu" :style="{ width: isCollapse ? '65px' : '210px' }"> 根据屏幕自动收缩 -->
<div class="menu">
<el-scrollbar>
<el-menu
@ -39,7 +39,7 @@
<el-container class="classic-main">
<Main />
</el-container>
</el-container> -->
</el-container>
</el-container>
</template>

View File

@ -44,12 +44,13 @@ const baseImgURl = import.meta.env.VITE_BASE_IMAGE_URL;
// const imgUrl = "@/assets/images/leftTab/";
const handleClickMenu = async (subItem: Menu.MenuOptions) => {
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, "_blank");
if (globalStore.accountType != 1) {
const res = await getButtonAuth({ menuId: subItem.name });
if (res && res.result) {
authStore.authButtonList = res.result;
}
}
// if (globalStore.accountType != 1) {
// globalStore.menuName = subItem.name
// const res = await getButtonAuth({ menuId: subItem.name });
// if (res && res.result) {
// authStore.authButtonList = res.result;
// }
// }
router.push(subItem.path);
};
</script>

View File

@ -6,6 +6,7 @@ import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
import { staticRouter, errorRouter } from "@/routers/modules/staticRouter";
import NProgress from "@/config/nprogress";
import { HOME_URL } from "@/enums/Home";
import { getButtonAuth } from "@/api/modules/auth";
// import path from "path";
/**
@ -35,6 +36,7 @@ const router = createRouter({
* @description beforeEach
* */
router.beforeEach(async (to, from, next) => {
console.log(to);
const globalStore = GlobalStore();
// 1.NProgress 开始
@ -62,6 +64,11 @@ router.beforeEach(async (to, from, next) => {
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
const authStore = AuthStore();
authStore.setRouteName(to.name as string);
const res = await getButtonAuth({ menuId: to.name });
if (res && res.result) {
authStore.authButtonList = res.result;
}
if (!authStore.authMenuListGet.length) {
await initDynamicRouter();
if (globalStore.accountType && globalStore.accountType !== 1 && to.fullPath === HOME_URL[0]) {

View File

@ -16,6 +16,7 @@ export const GlobalStore = defineStore({
userInfo: "",
account: "",
moduleId: "", //模块id
menuName: "", // 菜单id
accountType: undefined, //登录账号类型
moduleName: "", //登录账号类型
// 都是控制退出或者修改密码的时候遮挡视频的问题

View File

@ -5,6 +5,7 @@ export interface GlobalState {
userInfo: any | null;
accountType: number | undefined;
moduleId: string | null;
menuName: string | null;
account: string | null;
assemblySize: AssemblySizeType | "";
language: string | null;

View File

@ -123,9 +123,11 @@
<script setup lang="tsx" name="ProjectSupervisionRecord">
import { computed, reactive, ref, onMounted, onBeforeMount, watch } from "vue";
import { useRoute } from "vue-router";
import { bigItemGovermentAll } from "@/api/modules/huizhou";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverment";
const route = useRoute();
const headerList = reactive([
{ label: "未开始", color: "#D0A530" },
{ label: "推进中", color: "#35e5fd" },
@ -335,7 +337,6 @@ const getEngPage = async () => {
});
pages.value.total = +result.total;
};
onBeforeMount(() => {});
onMounted(async () => {
await getEngPage();
onSearch(records.value[0]);

View File

@ -286,7 +286,7 @@
</template>
<script lang="ts" setup name="divisionsAndISubItems">
import { ref, reactive, onMounted, watch } from "vue";
import { ref, reactive, onMounted, onBeforeMount, watch } from "vue";
import type { FormRules, FormInstance } from "element-plus";
import { Delete, CirclePlus } from "@element-plus/icons-vue";
import { getDustprojectPage } from "@/api/modules/goverment";
@ -305,6 +305,8 @@ import {
} from "@/api/modules/huizhou";
import { jxj_User } from "@/api/types";
import { useHandleData } from "@/hooks/useHandleData";
import { useRoute } from "vue-router";
const route = useRoute();
const rules = reactive<FormRules>({
name: {
required: true,

View File

@ -36,8 +36,9 @@
background
:isShowSearch="false"
>
<template #formButton="scope" v-auth="'quantity_import'">
<template #formButton="scope">
<el-upload
v-auth="'quantity_import'"
accept=".xlsx"
:headers="headers"
:action="`${baseUrl}` + '/gov/projectQuantity/importExcel'"
@ -65,7 +66,7 @@
</template>
<script lang="tsx" setup name="engineerInventory">
import { ref, onMounted, watch } from "vue";
import { ref, onMounted, onBeforeMount, watch } from "vue";
import { useRoute } from "vue-router";
import { GlobalStore } from "@/stores";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";

View File

@ -69,7 +69,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from "vue";
import { ref, reactive, onMounted, onBeforeMount, watch } from "vue";
import { useRoute } from "vue-router";
import transformInfo1 from "./components/transformInfo1.vue";
import { ElMessage } from "element-plus";

View File

@ -70,7 +70,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from "vue";
import { ref, reactive, onMounted, onBeforeMount, watch } from "vue";
import { GlobalStore } from "@/stores";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government/AIwaring";
@ -86,6 +86,8 @@ import {
} from "@/api/modules/huizhou";
import { getDicList } from "@/api/modules/jxjview";
import { ElMessage } from "element-plus";
import { useRoute } from "vue-router";
const route = useRoute();
const pages = ref({
pageNo: 1,
pageSize: 7,

View File

@ -75,7 +75,7 @@
</template>
<script setup lang="tsx" name="ProjectSupervisionRecord">
import { ref, onMounted, reactive, watch } from "vue";
import { ref, onMounted, onBeforeMount, reactive, watch } from "vue";
import { ElMessage } from "element-plus";
import { ColumnProps } from "@/components/ProTable/interface";
import ProTable from "@/components/ProTable/index.vue";
@ -84,6 +84,8 @@ import { GlobalStore } from "@/stores";
import DialogForm from "@/components/DialogForm/index.vue";
import transformInfo1 from "./components/transformInfo1.vue";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { useRoute } from "vue-router";
const route = useRoute();
const relativeId = ref("");
const detailsDialog = ref(false);
const globalStore = GlobalStore();
@ -148,7 +150,7 @@ const formConfig = {
message: "请选择",
trigger: "change"
}
],
]
}
};
const formData = ref({

View File

@ -76,7 +76,7 @@
</template>
<script setup lang="tsx" name="ProjectSupervisionRecord">
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, onBeforeMount } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { ColumnProps } from "@/components/ProTable/interface";
import { Delete } from "@element-plus/icons-vue";
@ -94,6 +94,8 @@ import DialogForm from "@/components/DialogForm/index.vue";
import AMap from "@/components/AMap/AMap.vue";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment";
import { useRoute } from "vue-router";
const route = useRoute();
const pages = ref({
pageNo: 1,
pageSize: 7,

View File

@ -78,7 +78,7 @@
</template>
<script setup lang="tsx" name="ProjectSupervisionRecord">
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, onBeforeMount } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { ColumnProps } from "@/components/ProTable/interface";
import { Delete } from "@element-plus/icons-vue";
@ -91,6 +91,8 @@ import DialogForm from "@/components/DialogForm/index.vue";
import AMap from "@/components/AMap/AMap.vue";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment";
import { useRoute } from "vue-router";
const route = useRoute();
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -324,12 +326,15 @@ const getEngPage = async () => {
});
pages.value.total = +result.total;
};
onMounted(async () => {
onBeforeMount(async () => {
await getEngPage();
searchSn.value = records.value[0].projectSn;
searchName.value = records.value[0].projectName;
onSearch(records.value[0]);
});
// onMounted(async () => {
// });
</script>
<style scoped lang="scss">