|
@@ -2,13 +2,13 @@
|
|
|
<div id="main" class="header-bar" @click="isChildMenu = false">
|
|
|
<header>
|
|
|
<ul class="nav">
|
|
|
- <!-- <div class="logo">尔泓时代</div> -->
|
|
|
+ <!-- <div class="logo">SANFAN MES制造执行系统</div> -->
|
|
|
<div class="logo" style="display: flex; align-items: center; justify-content: center">
|
|
|
- <img v-if="!logoUrl" :src="'/img/logo2.png'" />
|
|
|
+ <img v-if="!logoUrl" :src="'/img/logo2.png'" style="width:120px;height:30px;vertical-align:middle;object-fit:contain" />
|
|
|
<el-image v-else style="width: 120px; height: 30px" :src="logoUrl" fit="scale-down" />
|
|
|
</div>
|
|
|
<li class="header-bar-hover-warp nav-li" :class="isChildMenu ? 'active' : ''">
|
|
|
- <div @click.stop="isChildMenu = !isChildMenu" class="menu-modal">
|
|
|
+ <div @click.stop="openMenuBox" class="menu-modal">
|
|
|
<i class="iconfont icon-icomx_gongndh" style="margin: 0 5px 0 0"></i>
|
|
|
{{ $t("header.functionGuide") }}
|
|
|
<i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i>
|
|
@@ -32,17 +32,13 @@
|
|
|
<div class="header-bar-warp" v-if="isChildMenu" @click.stop="isChildMenu = false">
|
|
|
<div class="header-bar-hover" @click.stop>
|
|
|
<div class="header-bar-hover-content">
|
|
|
+ <!-- 左边 -->
|
|
|
<div class="left-banner">
|
|
|
- <!-- :style="leftBanerType == 2 ? 'color:#0084ff' : ''" -->
|
|
|
- <div class="first-order" @click="leftBanerType = 2">
|
|
|
- <i class="iconfont icon-iconm_changycd" style="position: relative; top: -1px"></i>
|
|
|
- {{ $t("header.commonFunctions") }}
|
|
|
- </div>
|
|
|
<div class="first-order">
|
|
|
<i class="iconfont icon-iconm_gongncd" style="position: relative; top: -1px"></i>
|
|
|
{{ $t("header.functionMenu") }}
|
|
|
</div>
|
|
|
- <ul>
|
|
|
+ <ul style="height:calc(100% - 50px)">
|
|
|
<li :class="menuName == i.menuName ? 'active' : ''" @click="openLeftBaner(i, index)" v-for="(i, index) in sidebarRoutersCopy"
|
|
|
:key="i.name" v-show="i.type == 1 && i.status == '0'">
|
|
|
<!-- <i
|
|
@@ -52,116 +48,84 @@
|
|
|
{{ i.menuName }}
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <!-- <div class="first-order">
|
|
|
- <el-icon size="16" color="#0084FF">
|
|
|
- <edit />
|
|
|
- </el-icon>
|
|
|
- 推荐服务
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- <div class="menu-warp" v-show="leftBanerType == 1">
|
|
|
- <div class="first-order-title">{{ menuName }}</div>
|
|
|
- <!-- <ul class="second-level" v-for="i in activeLeftData.children" :key="i.menuId">
|
|
|
- <li class="menu-title">
|
|
|
-
|
|
|
- {{ i.menuName }}
|
|
|
- </li>
|
|
|
- <div v-for="(j, index) in i.children" :key="index">
|
|
|
- <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
|
|
|
-
|
|
|
- <li class="menu-ul" @click="routerPush(i,j)" style="cursor: pointer">
|
|
|
- {{ j.menuName }}
|
|
|
- </li>
|
|
|
- </div>
|
|
|
- </ul> -->
|
|
|
- <ul class="second-level">
|
|
|
- <div v-for="(i, index) in activeLeftData" :key="index">
|
|
|
- <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
|
|
|
- <li class="menu-title" v-else-if="i.isTitle">
|
|
|
- <a v-if="i.icon && i.icon !== '#'" :class="'iconfont icon-' + i.icon"
|
|
|
- style="margin-right: 4px"></a><span>{{ i.menuName }}</span>
|
|
|
- </li>
|
|
|
- <li v-else class="menu-ul" @click="commonsBannerToRouter(i)" style="cursor: pointer; display: flex">
|
|
|
- <a :class="'iconfont icon-' + i.icon" style="
|
|
|
- margin-right: 4px;
|
|
|
- width: 20px;
|
|
|
- min-height: 20px;
|
|
|
- display: block;
|
|
|
- "></a>
|
|
|
- <span>{{ i.menuName }}</span>
|
|
|
- </li>
|
|
|
- </div>
|
|
|
- </ul>
|
|
|
+
|
|
|
</div>
|
|
|
- <div class="menu-warp" v-show="leftBanerType == 2">
|
|
|
+ <!-- 中间 -->
|
|
|
+ <div class="menu-warp">
|
|
|
<div class="first-order-title">
|
|
|
- {{ $t("header.commonFunctions") }}
|
|
|
+ <TitleInfo :content="menuName" :size="16"></TitleInfo>
|
|
|
</div>
|
|
|
- <div class="commons-warp">
|
|
|
- <div>
|
|
|
- <div class="header-button-box cp" v-for="(i, index) in commonsRouterList" :key="i.name" @click="commonsBannerToRouter(i)">
|
|
|
- <span>{{ i.menuName }}</span>
|
|
|
- <div class="right-icon" @click.stop="deleteCommonsRouter(i, index)">
|
|
|
- <!-- <el-icon color="#46A6FF"><CirclePlus /></el-icon> -->
|
|
|
- <el-icon color="#BBBBBB" v-show="isEidtType">
|
|
|
- <Close />
|
|
|
- </el-icon>
|
|
|
+ <!-- style="height:450px;overflow: auto;" -->
|
|
|
+ <div>
|
|
|
+ <div class="aaa">
|
|
|
+ <ul class="second-level bbb" v-for="i in activeLeftData.children" :key="i.menuId">
|
|
|
+ <li class="menu-title">
|
|
|
+ {{ i.menuName }}
|
|
|
+ </li>
|
|
|
+ <div v-for="(j, index) in i.children" :key="index">
|
|
|
+ <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
|
|
|
+ <li class="menu-ul">
|
|
|
+ <i style="cursor: pointer;position:relative;top:0px" @click.stop="editMenu(j)">
|
|
|
+ <svg-icon :icon-class="isHaveCollect(j) ? 'shoucang1' :'shoucang'" />
|
|
|
+ </i>
|
|
|
+ <span style="margin-left:6px;cursor: pointer" @click="commonsBannerToRouter(j)">{{ j.menuName }}</span>
|
|
|
+ </li>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="header-add-button-box" v-if="!isEidtType" @click="isEidtType = true">
|
|
|
- <el-icon color="#46A6FF">
|
|
|
- <CirclePlus />
|
|
|
- </el-icon>
|
|
|
- {{ $t("header.edit") }}
|
|
|
- </div>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="first-order-title" v-if="isEidtType">
|
|
|
- {{ $t("header.toAdd") }}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-banner">
|
|
|
+ <div class="first-order-title">
|
|
|
+ <TitleInfo :content="'常用功能'" :size="16"></TitleInfo>
|
|
|
</div>
|
|
|
- <div class="all-menu-warp" v-if="isEidtType">
|
|
|
- <div v-for="(i, index) in sidebarRoutersCopy" :key="i.name" v-show="i.type === 1">
|
|
|
- <div class="all-menu-title" v-for="(j, jindex) in i.children" :key="j.name">
|
|
|
- <div class="title">
|
|
|
- {{ j.menuName }}
|
|
|
- </div>
|
|
|
- <div class="all-menu-lists">
|
|
|
- <div class="header-button-box" v-for="(n, nindex) in j.children" v-show="n.visible == '0'" :key="n.name">
|
|
|
- <span>{{ n.menuName }}</span>
|
|
|
-
|
|
|
- <div class="right-icon" @click="addCommonsRouter(index, jindex, nindex, n)">
|
|
|
- <el-icon color="#46A6FF">
|
|
|
- <CirclePlus />
|
|
|
- </el-icon>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <div class="collect" id="collect">
|
|
|
+ <div v-for="(menu, index) in commonsRouterList" :key="menu.menuId" class="item">
|
|
|
+ <span>{{menu.menuName}}</span>
|
|
|
+ <span style="cursor:pointer;position:relative;top:2px;" @click="editMenu(menu)">
|
|
|
+ <el-icon color="#46A6FF" :size="16">
|
|
|
+ <CircleClose />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="btn-warp" v-if="isEidtType">
|
|
|
- <el-button type="" @click="isEidtType = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="userMenuEdit">保存</el-button>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</ul>
|
|
|
<div class="fr">
|
|
|
+ <div style="float:right;height: 50px;line-height: 50px;padding-right:20px;color:#fff;font-size:14px;cursor: pointer;" @click="plugDowload">
|
|
|
+ 插件下载
|
|
|
+ </div>
|
|
|
<div style="float:right;height: 50px;padding-right:20px">
|
|
|
- <el-badge :value="jobData.sumCount" :max="99" style="cursor: pointer;margin-top:15px;" @click="handleOpenDrawer">
|
|
|
+ <el-badge :value="jobData.sumCount" :max="99" style="cursor: pointer;margin-top:15px;" v-if="jobData.sumCount" @click="handleOpenDrawer">
|
|
|
<el-icon :size="20" color="#fff">
|
|
|
<Opportunity />
|
|
|
</el-icon>
|
|
|
</el-badge>
|
|
|
+ <div style="margin:15px 0 15px 0;cursor: pointer;" v-else @click="handleOpenDrawer">
|
|
|
+ <el-icon :size="20" color="#fff">
|
|
|
+ <Opportunity />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<!-- :value="12" -->
|
|
|
- <el-badge :value="badgeNum" style="cursor: pointer" class="badge" @click="noticeTableModal = true">
|
|
|
- <el-icon :size="20" color="#fff">
|
|
|
- <BellFilled />
|
|
|
- </el-icon>
|
|
|
- </el-badge>
|
|
|
+ <div>
|
|
|
+ <el-badge :value="badgeNum" style="cursor: pointer" class="badge" v-if="badgeNum" @click="noticeTableModal = true">
|
|
|
+ <el-icon :size="20" color="#fff">
|
|
|
+ <BellFilled />
|
|
|
+ </el-icon>
|
|
|
+ </el-badge>
|
|
|
+ <div style="margin:15px 24px 15px 0" v-else @click="noticeTableModal = true">
|
|
|
+ <el-icon :size="20" color="#fff">
|
|
|
+ <BellFilled />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<notice v-model="noticeTableModal" @changeNum="(e) => (badgeNum = e)" @openNotice="noticeTableModal = true"></notice>
|
|
|
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
|
|
|
<div class="dropdown-box" style="color:#fff">
|
|
@@ -185,6 +149,7 @@
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
</header>
|
|
|
+
|
|
|
<el-drawer v-model="openDrawer" direction="rtl" :show-close="false" custom-class="drawerClass" modal-class="modelClass">
|
|
|
<!-- <template #header>
|
|
|
<h4>set title by slot</h4>
|
|
@@ -193,7 +158,7 @@
|
|
|
|
|
|
<div class="job-box">
|
|
|
<div style="margin-bottom:20px">
|
|
|
- <TitleInfo :content="'工作事项'"></TitleInfo>
|
|
|
+ <TitleInfoOne :content="'工作事项'"></TitleInfoOne>
|
|
|
</div>
|
|
|
<div class="job-list">
|
|
|
<div class="job-item" style="margin-right:5px" @click="handlePushRouter(1)">
|
|
@@ -307,7 +272,7 @@
|
|
|
|
|
|
</div>
|
|
|
<div style="margin:20px 0">
|
|
|
- <TitleInfo :content="'通知提醒'"></TitleInfo>
|
|
|
+ <TitleInfoOne :content="'通知提醒'"></TitleInfoOne>
|
|
|
</div>
|
|
|
<div class="notice">
|
|
|
<div class="item" v-for="(item,index) in noticeData" :key="item.id">
|
|
@@ -332,7 +297,9 @@ import { ElMessageBox, ElNotification, ElMessage } from "element-plus";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import "@/components/headerBar/header.scss";
|
|
|
import notice from "@/components/notice/index";
|
|
|
-import TitleInfo from "@/components/TitleInfo/indexOne.vue";
|
|
|
+import TitleInfo from "@/components/TitleInfo/index.vue";
|
|
|
+import TitleInfoOne from "@/components/TitleInfo/indexOne.vue";
|
|
|
+import Sortable from "sortablejs";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const userStore = useUserStore();
|
|
@@ -343,16 +310,16 @@ const sidebarRoutersCopy = ref([]);
|
|
|
const isChildMenu = ref(false);
|
|
|
const autoListChidrenNum = ref(0);
|
|
|
const isEidtType = ref(false);
|
|
|
-const leftBanerType = ref(2);
|
|
|
+const leftBanerType = ref(1);
|
|
|
const noticeTableModal = ref(false);
|
|
|
const userData = ref(Cookies.get("nickName") || "");
|
|
|
const commonsRouterList = ref([]);
|
|
|
const activeLeftData = ref({});
|
|
|
const openLeftBaner = (i, index) => {
|
|
|
- leftBanerType.value = 1;
|
|
|
+ // leftBanerType.value = 1;
|
|
|
activeLeftData.value = i;
|
|
|
menuName.value = i.menuName;
|
|
|
- routerInit(i);
|
|
|
+ // routerInit(i);
|
|
|
};
|
|
|
|
|
|
const badgeNum = ref(0);
|
|
@@ -366,6 +333,40 @@ const getLogo = () => {
|
|
|
});
|
|
|
};
|
|
|
getLogo();
|
|
|
+
|
|
|
+const openMenuBox = () => {
|
|
|
+ isChildMenu.value = !isChildMenu.value;
|
|
|
+ nextTick(() => {
|
|
|
+ initSort();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getCollectData = () => {
|
|
|
+ proxy.post("/sysUserMenu/list", { type: 1 }).then((res) => {
|
|
|
+ commonsRouterList.value = res;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const initSort = () => {
|
|
|
+ const el = document.getElementById("collect");
|
|
|
+ Sortable.create(el, {
|
|
|
+ onEnd({ newIndex, oldIndex }) {
|
|
|
+ if (newIndex == oldIndex) return;
|
|
|
+ commonsRouterList.value.splice(
|
|
|
+ newIndex,
|
|
|
+ 0,
|
|
|
+ commonsRouterList.value.splice(oldIndex, 1)[0]
|
|
|
+ );
|
|
|
+ let newArray = commonsRouterList.value.slice(0);
|
|
|
+ commonsRouterList.value = [];
|
|
|
+ nextTick(() => {
|
|
|
+ commonsRouterList.value = newArray;
|
|
|
+ userMenuEdit();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const userMenuEdit = () => {
|
|
|
proxy
|
|
|
.post("/sysUserMenu/edit", {
|
|
@@ -373,14 +374,34 @@ const userMenuEdit = () => {
|
|
|
menuIdList: commonsRouterList.value.map((item) => item.menuId),
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- isEidtType.value = false;
|
|
|
+ getCollectData();
|
|
|
+ // ElMessage({
|
|
|
+ // message: "操作成功",
|
|
|
+ // type: "success",
|
|
|
+ // });
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const editMenu = (menu) => {
|
|
|
+ let menuIndex = -1;
|
|
|
+ const flag = commonsRouterList.value.some((item, index) => {
|
|
|
+ if (item.menuId == menu.menuId) {
|
|
|
+ menuIndex = index;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (flag) {
|
|
|
+ commonsRouterList.value.splice(menuIndex, 1);
|
|
|
+ } else {
|
|
|
+ commonsRouterList.value.push(menu);
|
|
|
+ }
|
|
|
+ userMenuEdit();
|
|
|
+};
|
|
|
+
|
|
|
+const isHaveCollect = (menu) => {
|
|
|
+ return commonsRouterList.value.some((item) => item.menuId == menu.menuId);
|
|
|
+};
|
|
|
+
|
|
|
const deleteCommonsRouter = (i, index) => {
|
|
|
commonsRouterList.value.splice(index, 1);
|
|
|
};
|
|
@@ -526,6 +547,10 @@ onMounted(() => {
|
|
|
};
|
|
|
});
|
|
|
sidebarRoutersCopy.value = proxy.handleTree(res.data, "menuId");
|
|
|
+ if (sidebarRoutersCopy.value && sidebarRoutersCopy.value.length > 0) {
|
|
|
+ openLeftBaner(sidebarRoutersCopy.value[0], 0);
|
|
|
+ }
|
|
|
+
|
|
|
//循环删除 i.status != 0 || i.visible != 0 的元素
|
|
|
sidebarRoutersCopy.value.map((item) => {
|
|
|
if (item.children) {
|
|
@@ -541,9 +566,7 @@ onMounted(() => {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- proxy.post("/sysUserMenu/list", { type: 1 }).then((res) => {
|
|
|
- commonsRouterList.value = res;
|
|
|
- });
|
|
|
+ getCollectData();
|
|
|
proxy.get("/statistics/workStatistics").then((res) => {
|
|
|
for (const key in res.data) {
|
|
|
res.data[key] = Number(res.data[key]);
|
|
@@ -586,7 +609,6 @@ const getNoticeData = () => {
|
|
|
}
|
|
|
});
|
|
|
proxy.get("/statistics/getRecentPurchaseArrivalList").then((res) => {
|
|
|
- console.log(res, "ss");
|
|
|
if (res && res.data && res.data.length > 0) {
|
|
|
noticeData.value = [
|
|
|
...noticeData.value,
|
|
@@ -621,6 +643,23 @@ const openDetails = (row) => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+const plugDowload = () => {
|
|
|
+ proxy.msgTip("请稍后", 2);
|
|
|
+ // 静态资源下载
|
|
|
+ fetch("/static/printer.zip")
|
|
|
+ .then((res) => res.blob())
|
|
|
+ .then((res) => {
|
|
|
+ const url = window.URL.createObjectURL(res);
|
|
|
+ let filename = "printer.zip";
|
|
|
+ const link = document.createElement("a");
|
|
|
+ link.style.display = "none";
|
|
|
+ link.href = url;
|
|
|
+ link.setAttribute("download", filename);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|