mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 04:46:46 +08:00
feat:合并
This commit is contained in:
28
src/App.vue
28
src/App.vue
@@ -30,7 +30,6 @@ 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";
|
import * as api1 from "@/api/index1";
|
||||||
import * as api2 from "@/api/index";
|
import * as api2 from "@/api/index";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
NavLeft,
|
NavLeft,
|
||||||
@@ -48,16 +47,13 @@ export default defineComponent({
|
|||||||
const routes = computed(() => {
|
const routes = computed(() => {
|
||||||
return router.getRoutes().filter((e) => e.meta?.isLink);
|
return router.getRoutes().filter((e) => e.meta?.isLink);
|
||||||
});
|
});
|
||||||
|
|
||||||
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() {
|
function init() {
|
||||||
console.log(store);
|
console.log(store);
|
||||||
getUserInfo();
|
getUserInfo();
|
||||||
@@ -72,34 +68,22 @@ export default defineComponent({
|
|||||||
getMemberInfo();
|
getMemberInfo();
|
||||||
getOrgTree();
|
getOrgTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getMemberInfo() {
|
async function getMemberInfo() {
|
||||||
const list = localStorage.getItem("memberInitInfo");
|
const list = localStorage.getItem("memberInitInfo");
|
||||||
if (list) {
|
if (list) {
|
||||||
store.commit("SET_MEMBER_INFO", JSON.parse(list));
|
store.commit("SET_MEMBER_INFO", JSON.parse(list));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
const memberInitInfo = await api1
|
const memberInitInfo = await api1
|
||||||
.getMemberInfo({ keyWord: "", pageNo: 1, pageSize: 10 })
|
.getMemberInfo({ keyWord: "", pageNo: 1, pageSize: 10 })
|
||||||
.then((res) =>
|
.then((res) => res.data.data.rows);
|
||||||
res.data.data.rows.map((e) => ({
|
|
||||||
label: e.realName,
|
|
||||||
value: e.id,
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
=======
|
|
||||||
const memberInitInfo = await api1.getMemberInfo({keyWord: '', pageNo: 1, pageSize: 10}).then(res=>res.data.data.rows);
|
|
||||||
>>>>>>> 6d96a3e66a5b7f7051e7e4e195e9bd6a980d7c7e
|
|
||||||
store.commit("SET_MEMBER_INFO", memberInitInfo);
|
store.commit("SET_MEMBER_INFO", memberInitInfo);
|
||||||
localStorage.setItem("memberInitInfo", JSON.stringify(memberInitInfo));
|
localStorage.setItem("memberInitInfo", JSON.stringify(memberInitInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUserInfo() {
|
async function getUserInfo() {
|
||||||
const userInfo = await api2.userInfo();
|
const userInfo = await api2.userInfo();
|
||||||
store.commit("SET_USER", userInfo);
|
store.commit("SET_USER", userInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function initDict(key) {
|
async function initDict(key) {
|
||||||
let list = localStorage.getItem(key);
|
let list = localStorage.getItem(key);
|
||||||
if (list) {
|
if (list) {
|
||||||
@@ -110,7 +94,6 @@ export default defineComponent({
|
|||||||
localStorage.setItem(key, JSON.stringify(list));
|
localStorage.setItem(key, JSON.stringify(list));
|
||||||
store.commit("SET_DICT", { key, data: list });
|
store.commit("SET_DICT", { key, data: list });
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDictList = (param) =>
|
const getDictList = (param) =>
|
||||||
api1
|
api1
|
||||||
.getDict({
|
.getDict({
|
||||||
@@ -119,7 +102,6 @@ export default defineComponent({
|
|||||||
setCode: param,
|
setCode: param,
|
||||||
})
|
})
|
||||||
.then((res) => res.data.data.rows);
|
.then((res) => res.data.data.rows);
|
||||||
|
|
||||||
//获取组织树
|
//获取组织树
|
||||||
const getOrgTree = () => {
|
const getOrgTree = () => {
|
||||||
const orgtreeList = localStorage.getItem("orgtreeList");
|
const orgtreeList = localStorage.getItem("orgtreeList");
|
||||||
@@ -147,9 +129,7 @@ export default defineComponent({
|
|||||||
console.log("组织树获取失败", err);
|
console.log("组织树获取失败", err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLogin,
|
isLogin,
|
||||||
routes,
|
routes,
|
||||||
@@ -170,17 +150,14 @@ export default defineComponent({
|
|||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#container {
|
#container {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 1000px;
|
min-width: 1000px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
background-color: rgba(245, 247, 250, 1);
|
background-color: rgba(245, 247, 250, 1);
|
||||||
|
|
||||||
main {
|
main {
|
||||||
height: 0;
|
height: 0;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
@@ -196,7 +173,6 @@ 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;
|
||||||
@@ -218,4 +194,4 @@ export default defineComponent({
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user