|
|
@@ -1,19 +1,22 @@
|
|
|
<template>
|
|
|
<div class="header sticky">
|
|
|
- <a-menu style="flex:1 0 auto" :inlineIndent="10" v-model:selectedKeys="current" mode="horizontal" active-text-color="#000" @click="itemClick">
|
|
|
+ <a-menu style="flex:1 0 auto" :inlineIndent="10" v-model:selectedKeys="current" mode="horizontal"
|
|
|
+ active-text-color="#000" @click="itemClick">
|
|
|
<template v-for="item in mods" :key="item.systemmoduleid">
|
|
|
<a-sub-menu v-if="item.apps.length > 1" @click="modClick(item)" :key="item.systemmoduleid">
|
|
|
<template #title>
|
|
|
<div>
|
|
|
<img width="15" height="15" style="margin-top:-2px;margin-right:10px" :src="item.iconurl" alt="">
|
|
|
- <span class="almm">{{item.systemmodulename}}</span>
|
|
|
- </div>
|
|
|
+ <span class="almm">{{ item.systemmodulename }}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- <a-menu-item :style="isShow(app)?'':{display:'none'}" v-for="app in item.apps" :key="app.systemappid" @click="routeChange(app)"><span class="almm">{{app.meta.title}}</span></a-menu-item>
|
|
|
+ <a-menu-item :style="isShow(app) ? '' : { display: 'none' }" v-for="app in item.apps" :key="app.systemappid"
|
|
|
+ @click="routeChange(app)"><span class="almm">{{ app.meta.title }}</span></a-menu-item>
|
|
|
</a-sub-menu>
|
|
|
- <a-menu-item v-if="item.apps.length == 1 && item.apps[0].showplace !== '2'" :key="item.systemmoduleid" @click="modClick(item,routeChange(item.apps[0]))">
|
|
|
+ <a-menu-item v-if="item.apps.length == 1 && item.apps[0].showplace !== '2'" :key="item.systemmoduleid"
|
|
|
+ @click="modClick(item, routeChange(item.apps[0]))">
|
|
|
<img width="15" height="15" style="margin-top:-2px;margin-right:10px" :src="item.iconurl" alt="">
|
|
|
- <span class="almm">{{item.apps[0].meta.title}}</span>
|
|
|
+ <span class="almm">{{ item.apps[0].meta.title }}</span>
|
|
|
</a-menu-item>
|
|
|
</template>
|
|
|
</a-menu>
|
|
|
@@ -25,8 +28,8 @@
|
|
|
<template #title>缩放</template>
|
|
|
<a-button type="text" @click="base.changeLayout">
|
|
|
<template #icon>
|
|
|
- <vertical-align-middle-outlined v-if="themeAlgorithm == 'defaultAlgorithm'"/>
|
|
|
- <column-height-outlined v-else/>
|
|
|
+ <vertical-align-middle-outlined v-if="themeAlgorithm == 'defaultAlgorithm'" />
|
|
|
+ <column-height-outlined v-else />
|
|
|
</template>
|
|
|
</a-button>
|
|
|
</a-tooltip>
|
|
|
@@ -38,11 +41,11 @@
|
|
|
</template>
|
|
|
</a-button>
|
|
|
</a-tooltip> -->
|
|
|
- <a-badge v-if="store.hasAppData('shopCart')" :count="num" :offset="[-10,5]">
|
|
|
+ <a-badge v-if="store.hasAppData('shopCart')" :count="num" :offset="[-10, 5]">
|
|
|
<a-button type="text" @click="router.push('/shopCart')">
|
|
|
购物车
|
|
|
<template #icon>
|
|
|
- <ShoppingCartOutlined/>
|
|
|
+ <ShoppingCartOutlined />
|
|
|
</template>
|
|
|
</a-button>
|
|
|
</a-badge>
|
|
|
@@ -50,11 +53,11 @@
|
|
|
<template #overlay>
|
|
|
<a-menu>
|
|
|
<a-menu-item v-for="item in accountList" :key="item.index">
|
|
|
- <a @click="accountItemClick(item,false)">{{item.sitename + '-' + item.name}}</a>
|
|
|
+ <a @click="accountItemClick(item, false)">{{ item.sitename + '-' + item.name }}</a>
|
|
|
</a-menu-item>
|
|
|
<a-menu-divider />
|
|
|
<a-menu-item>
|
|
|
- <changePass btnType="text"></changePass>
|
|
|
+ <!-- <changePass btnType="text"></changePass> -->
|
|
|
</a-menu-item>
|
|
|
<a-menu-divider />
|
|
|
<a-menu-item>
|
|
|
@@ -64,7 +67,7 @@
|
|
|
</a-menu>
|
|
|
</template>
|
|
|
<a-button type="text">
|
|
|
- {{nowAccount.sitename}}
|
|
|
+ {{ nowAccount.sitename }}
|
|
|
<DownOutlined />
|
|
|
</a-button>
|
|
|
</a-dropdown>
|
|
|
@@ -74,15 +77,15 @@
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import Api from '@/api/api'
|
|
|
-import { ref,onBeforeMount,watch,createVNode,onMounted,nextTick} from 'vue';
|
|
|
+import { ref, onBeforeMount, watch, createVNode, onMounted, nextTick } from 'vue';
|
|
|
import domtoimage from 'dom-to-image';
|
|
|
import { useAuthStore } from '@/stores/modules/auth'
|
|
|
import { useBaseStore } from '@/stores/modules/base'
|
|
|
import { useRouteTabsStore } from '@/stores/modules/routeTabs'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { useRouter } from "vue-router"
|
|
|
-import {LogoutOutlined, MenuFoldOutlined,ShoppingCartOutlined,ExclamationCircleOutlined,PieChartOutlined,DownOutlined,VerticalAlignMiddleOutlined,ColumnHeightOutlined,CameraOutlined,StarOutlined} from '@ant-design/icons-vue'
|
|
|
-import {ConfigProvider, Modal } from 'ant-design-vue';
|
|
|
+import { LogoutOutlined, MenuFoldOutlined, ShoppingCartOutlined, ExclamationCircleOutlined, PieChartOutlined, DownOutlined, VerticalAlignMiddleOutlined, ColumnHeightOutlined, CameraOutlined, StarOutlined } from '@ant-design/icons-vue'
|
|
|
+import { ConfigProvider, Modal } from 'ant-design-vue';
|
|
|
import changePass from "@/views/setEnterpriseInfo/modules/changePasd.vue";
|
|
|
|
|
|
const router = useRouter()
|
|
|
@@ -91,58 +94,63 @@ const rotTabs = useRouteTabsStore()
|
|
|
let { historyRoutes } = storeToRefs(rotTabs)
|
|
|
|
|
|
const store = useAuthStore()
|
|
|
-let { mods,actMod,nowAccount,accountList,current,app } = storeToRefs(store)
|
|
|
+let { mods, actMod, nowAccount, accountList, current, app } = storeToRefs(store)
|
|
|
|
|
|
const base = useBaseStore()
|
|
|
-let { themeAlgorithm,num,connection } = storeToRefs(base)
|
|
|
-const itemClick = (item, key, keyPath)=>{
|
|
|
+let { themeAlgorithm, num, connection } = storeToRefs(base)
|
|
|
+const itemClick = (item, key, keyPath) => {
|
|
|
current.value = item.keyPath
|
|
|
}
|
|
|
-const modClick = (item)=>{
|
|
|
+const modClick = (item) => {
|
|
|
actMod.value = item
|
|
|
}
|
|
|
-const accountItemClick = (account,bool)=>{
|
|
|
+const accountItemClick = (account, bool) => {
|
|
|
if (router.currentRoute.value.meta.isDetail) {
|
|
|
router.go(-1)
|
|
|
}
|
|
|
- store.defaultAccount(account,()=>{
|
|
|
+ store.defaultAccount(account, () => {
|
|
|
store.reloadPage()
|
|
|
historyRoutes.value = []
|
|
|
})
|
|
|
}
|
|
|
-const routeChange = (app)=>{
|
|
|
+const routeChange = (app) => {
|
|
|
console.log(app)
|
|
|
- router.replace({path:app.path,meta:{keepAlive:false}})
|
|
|
+ router.replace({ path: app.path, meta: { keepAlive: false } })
|
|
|
}
|
|
|
-const loginOut = ()=>{
|
|
|
+const loginOut = () => {
|
|
|
Modal.confirm({
|
|
|
title: '注意',
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
|
content: '确定登出当前账号吗?',
|
|
|
okText: '确认',
|
|
|
cancelText: '取消',
|
|
|
- onOk () {
|
|
|
- if (sessionStorage.getItem('sourceUrl')) {
|
|
|
- window.location.href = sessionStorage.getItem('sourceUrl') + '/dmsClient/#/'
|
|
|
- sessionStorage.removeItem('sourceUrl')
|
|
|
+ onOk() {
|
|
|
+ let sourceUrl = sessionStorage.getItem('sourceUrl');
|
|
|
+ if (sourceUrl) {
|
|
|
+ if (sourceUrl.includes('crm.meida.com:16691')) {
|
|
|
+ window.location.href = sessionStorage.getItem('sourceUrl') + '/yosweb/index.html#/'
|
|
|
} else {
|
|
|
- router.push({path:'/'})
|
|
|
+ window.location.href = sessionStorage.getItem('sourceUrl') + '/dmsClient/#/'
|
|
|
}
|
|
|
- sessionStorage.removeItem('batchShipLastResult')
|
|
|
- sessionStorage.removeItem('auth')
|
|
|
- historyRoutes.value = []
|
|
|
+ sessionStorage.removeItem('sourceUrl')
|
|
|
+ } else {
|
|
|
+ router.push({ path: '/' })
|
|
|
+ }
|
|
|
+ sessionStorage.removeItem('batchShipLastResult')
|
|
|
+ sessionStorage.removeItem('auth')
|
|
|
+ historyRoutes.value = []
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-const takeHtmlPhoto = ()=>{
|
|
|
+const takeHtmlPhoto = () => {
|
|
|
let node = document.querySelector('#panel'); // 获取需要转换的元素
|
|
|
domtoimage.toPng(node)
|
|
|
- .then(dataUrl => {
|
|
|
- saveBase64AsImage(dataUrl,'file.png')
|
|
|
- });
|
|
|
-
|
|
|
+ .then(dataUrl => {
|
|
|
+ saveBase64AsImage(dataUrl, 'file.png')
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
-const saveBase64AsImage = (base64, filename)=> {
|
|
|
+const saveBase64AsImage = (base64, filename) => {
|
|
|
// 将base64编码转换为Blob对象
|
|
|
let blob = base64ToBlob(base64);
|
|
|
|
|
|
@@ -160,33 +168,33 @@ const saveBase64AsImage = (base64, filename)=> {
|
|
|
// 释放内存
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
}
|
|
|
-const base64ToBlob = (base64)=> {
|
|
|
+const base64ToBlob = (base64) => {
|
|
|
let arr = base64.split(','), mime = arr[0].split(':')[1],
|
|
|
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
|
|
|
- while(n--){u8arr[n] = bstr.charCodeAt(n);};
|
|
|
- return new Blob([u8arr], {type:mime});
|
|
|
+ while (n--) { u8arr[n] = bstr.charCodeAt(n); };
|
|
|
+ return new Blob([u8arr], { type: mime });
|
|
|
}
|
|
|
-const isShow = (app)=>{
|
|
|
- if (app.showplace !=='2') {
|
|
|
+const isShow = (app) => {
|
|
|
+ if (app.showplace !== '2') {
|
|
|
return true
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
-watch(() => router.currentRoute.value,(to, from) => {
|
|
|
- nextTick(()=>{
|
|
|
- current.value = [app.value.systemmoduleid,app.value.systemappid]
|
|
|
+watch(() => router.currentRoute.value, (to, from) => {
|
|
|
+ nextTick(() => {
|
|
|
+ current.value = [app.value.systemmoduleid, app.value.systemappid]
|
|
|
})
|
|
|
})
|
|
|
-onMounted(()=>{
|
|
|
+onMounted(() => {
|
|
|
base.shopCartNum()
|
|
|
})
|
|
|
-onBeforeMount(()=>{
|
|
|
+onBeforeMount(() => {
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.header{
|
|
|
+.header {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-bottom: 10px;
|
|
|
@@ -195,39 +203,54 @@ onBeforeMount(()=>{
|
|
|
background: #fff;
|
|
|
z-index: 9999;
|
|
|
}
|
|
|
-.dropdown-link{
|
|
|
+
|
|
|
+.dropdown-link {
|
|
|
margin-top: -1px;
|
|
|
}
|
|
|
-.color-red{
|
|
|
- color:red
|
|
|
+
|
|
|
+.color-red {
|
|
|
+ color: red
|
|
|
}
|
|
|
-.flex{
|
|
|
+
|
|
|
+.flex {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
-.sticky{
|
|
|
+
|
|
|
+.sticky {
|
|
|
position: sticky;
|
|
|
- top:0;
|
|
|
+ top: 0;
|
|
|
z-index: 9;
|
|
|
}
|
|
|
-.menu-icon{
|
|
|
+
|
|
|
+.menu-icon {
|
|
|
font-size: .75rem;
|
|
|
padding: 2px 3px;
|
|
|
- color:#fff;
|
|
|
- border-radius:4px;
|
|
|
- background: #1677ff ;
|
|
|
-}
|
|
|
-@keyframes breathe {
|
|
|
- 0% {opacity: 1;}
|
|
|
- 50% {opacity: 0.3;}
|
|
|
- 100% {opacity: 1;}
|
|
|
-}
|
|
|
-
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #1677ff;
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes breathe {
|
|
|
+ 0% {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ 50% {
|
|
|
+ opacity: 0.3;
|
|
|
+ }
|
|
|
+
|
|
|
+ 100% {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.breathe {
|
|
|
- animation: breathe 2s infinite;
|
|
|
+ animation: breathe 2s infinite;
|
|
|
}
|
|
|
-.hide{
|
|
|
- display:none
|
|
|
+
|
|
|
+.hide {
|
|
|
+ display: none
|
|
|
}
|
|
|
</style>
|