mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 20:06:47 +08:00
-- bug
This commit is contained in:
90
src/App.vue
90
src/App.vue
@@ -1,33 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="container" v-if="!isLogin">
|
<div id="container" v-if="!isLogin">
|
||||||
<nav-top />
|
<nav-top/>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<nav-left />
|
<nav-left/>
|
||||||
<div style="flex: 1; display: flex; flex-direction: column; width: 0">
|
<div style="flex: 1; display: flex; flex-direction: column; width: 0">
|
||||||
<open-pages />
|
<open-pages/>
|
||||||
<bread-crumb />
|
<bread-crumb/>
|
||||||
<main>
|
<main>
|
||||||
<a-config-provider :locale="zhCN">
|
<a-config-provider :locale="zhCN">
|
||||||
<router-view />
|
<router-view/>
|
||||||
</a-config-provider>
|
</a-config-provider>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="container" v-if="isLogin">
|
<div id="container" v-if="isLogin">
|
||||||
<router-view />
|
<router-view/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { computed, defineComponent, ref, watch } from "vue";
|
import {computed, defineComponent, ref, watch} from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import {useRouter, useRoute} from "vue-router";
|
||||||
import { useStore } from "vuex";
|
import {useStore} from "vuex";
|
||||||
import NavLeft from "@/components/NavLeft";
|
import NavLeft from "@/components/NavLeft";
|
||||||
import NavTop from "@/components/NavTop";
|
import NavTop from "@/components/NavTop";
|
||||||
import OpenPages from "@/components/OpenPages";
|
import OpenPages from "@/components/OpenPages";
|
||||||
import BreadCrumb from "@/components/BreadCrumb";
|
import BreadCrumb from "@/components/BreadCrumb";
|
||||||
import zhCN from "ant-design-vue/es/locale/zh_CN";
|
import zhCN from "ant-design-vue/es/locale/zh_CN";
|
||||||
import * as api from "./api/index1";
|
import * as api from "./api/index1";
|
||||||
|
import * as api1 from "@/api/index1";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
NavLeft,
|
NavLeft,
|
||||||
@@ -47,37 +49,70 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.path,
|
() => route.path,
|
||||||
() => {
|
() => {
|
||||||
route.path === "/login" && (isLogin.value = true);
|
route.path === "/login" && (isLogin.value = true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentRouteName = computed(() => route.name);
|
const currentRouteName = computed(() => route.name);
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
console.log(store)
|
||||||
|
initDict('faceclassPic')
|
||||||
|
initDict('faceclassClass')
|
||||||
|
initDict('faceclassScene')
|
||||||
|
initDict('projectLevel')
|
||||||
|
initDict('projectSys')
|
||||||
|
getOrgTree()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function initDict(key) {
|
||||||
|
let list = localStorage.getItem(key)
|
||||||
|
if (list) {
|
||||||
|
store.commit('SET_DICT', {key, data:JSON.parse(list)});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
list = await getDictList(key)
|
||||||
|
localStorage.setItem(key, JSON.stringify(list));
|
||||||
|
store.commit('SET_DICT', {key, data:list});
|
||||||
|
}
|
||||||
|
|
||||||
|
const getDictList = (param) => api1.getDict({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
setCode: param
|
||||||
|
}).then((res) => res.data.data.rows)
|
||||||
|
|
||||||
//获取组织树
|
//获取组织树
|
||||||
const getOrgTree = () => {
|
const getOrgTree = () => {
|
||||||
|
const orgtreeList = localStorage.getItem("orgtreeList")
|
||||||
|
if (orgtreeList) {
|
||||||
|
store.commit("getOrgtreeList", JSON.parse(orgtreeList));
|
||||||
|
return;
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
keyWord: "",
|
keyWord: "",
|
||||||
id: -1,
|
id: -1,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
};
|
};
|
||||||
api
|
api.getOrgInfo(obj)
|
||||||
.getOrgInfo(obj)
|
.then((res) => {
|
||||||
.then((res) => {
|
console.log("组织树获取成功", res);
|
||||||
console.log("组织树获取成功", res);
|
if (res.data.code === 200) {
|
||||||
if (res.data.code === 200) {
|
// state.treeData = res.data.data;
|
||||||
// state.treeData = res.data.data;
|
localStorage.setItem("orgtreeList", JSON.stringify(res.data.data));
|
||||||
store.commit("getOrgtreeList", res.data.data);
|
store.commit("getOrgtreeList", res.data.data);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log("组织树获取失败", err);
|
console.log("组织树获取失败", err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
getOrgTree();
|
init();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLogin,
|
isLogin,
|
||||||
@@ -93,7 +128,7 @@ export default defineComponent({
|
|||||||
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
|
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
|
||||||
// sans-serif;
|
// sans-serif;
|
||||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
|
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
|
||||||
Microsoft YaHei, Arial, sans-serif;
|
Microsoft YaHei, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
@@ -125,6 +160,7 @@ export default defineComponent({
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.07);
|
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.07);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @media screen and (max-width: 1366px) {
|
// @media screen and (max-width: 1366px) {
|
||||||
// .cmMain {
|
// .cmMain {
|
||||||
// width: 750px;
|
// width: 750px;
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ export default {
|
|||||||
noticeFlag: null, //未改
|
noticeFlag: null, //未改
|
||||||
templateId: null, //未改
|
templateId: null, //未改
|
||||||
attach: null,
|
attach: null,
|
||||||
|
calssifyList:[],
|
||||||
|
faceclassScene:[]
|
||||||
});
|
});
|
||||||
|
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
@@ -291,7 +293,8 @@ export default {
|
|||||||
setCode: param
|
setCode: param
|
||||||
}).then((res) => res.data.data.rows)
|
}).then((res) => res.data.data.rows)
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
state.calssifyList = (await getDictList("faceclassClass")).map(e => ({ label: e.dictName, value: e.dictCode }))
|
state.calssifyList = (await getDictList("faceclassClass")).map(e => ({ label: e.dictName, value: e.dictCode })) //内容
|
||||||
|
state.faceclassScene = (await getDictList("faceclassScene")).map(e => ({ label: e.dictName, value: e.dictCode })) //场景
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ export default createStore({
|
|||||||
routerId: null,
|
routerId: null,
|
||||||
projectTemplateId: null,
|
projectTemplateId: null,
|
||||||
orgtreeList: [],
|
orgtreeList: [],
|
||||||
|
faceclassPic: null,
|
||||||
|
faceclassClass: [],
|
||||||
|
faceclassScene: [],
|
||||||
|
projectLevel: [],//项目级别
|
||||||
|
projectSys: [],//培训分类
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
mutations: {
|
mutations: {
|
||||||
@@ -45,6 +50,9 @@ export default createStore({
|
|||||||
getOrgtreeList(state, data) {
|
getOrgtreeList(state, data) {
|
||||||
state.orgtreeList = data
|
state.orgtreeList = data
|
||||||
},
|
},
|
||||||
|
SET_DICT(state,{key,data}){
|
||||||
|
state[key] = data
|
||||||
|
},
|
||||||
SET_projectTemplateId(state, projectTemplateId) {
|
SET_projectTemplateId(state, projectTemplateId) {
|
||||||
state.projectTemplateId = projectTemplateId;
|
state.projectTemplateId = projectTemplateId;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user