Commit bc45c9a8 by 姜雷

Merge branch 'test' into 'master'

Test See merge request !81
parents 23790cf0 ab67dc8c
......@@ -34,7 +34,7 @@
"nprogress": "^0.2.0",
"popmotion": "^8.1.22",
"qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.55",
"rym-element-ui": "^0.1.56",
"vue-qr": "^1.2.8",
"vuedraggable": "^2.16.0",
"wangeditor": "^3.1.1"
......
......@@ -63,6 +63,8 @@ import UserBox from './containers/layout/components/UserBox';
import IconMenus from './containers/layout/IconMenu/IconMenu';
import CollectMenu from './containers/layout/Collect/Collect';
import { mapGetters } from 'vuex';
import { getStorageData, setStorageData } from '@/utils/auth';
import { STSTEM_STATE_KEY } from '@/config';
export default {
name: 'App',
......@@ -78,15 +80,14 @@ export default {
},
},
data() {
console.log(this.$route);
const { selectedRoute, showFastLink, showSelected } = this.loadRouteState();
return {
title: '',
selectedRoute: [],
selectedRoute: selectedRoute,
routerDone: false,
isInnerPage: false,
showFastLink: false,
showSelected: false,
showFastLink: showFastLink,
showSelected: showSelected,
};
},
computed: {
......@@ -136,11 +137,37 @@ export default {
this.showFastLink = entity;
this.showSelected = false;
}
this.saveRouteState();
},
selectRouteMenu(routes) {
this.selectedRoute = routes;
this.showSelected = true;
this.showFastLink = false;
this.saveRouteState();
},
saveRouteState() {
const { selectedRoute, showFastLink, showSelected } = this;
setStorageData(
STSTEM_STATE_KEY,
JSON.stringify({
selectedRoute,
showFastLink,
showSelected,
})
);
},
loadRouteState() {
let dataStr = getStorageData(STSTEM_STATE_KEY);
if (dataStr) {
let data = JSON.parse(dataStr);
return data;
} else {
return {
selectedRoute: [],
showFastLink: false,
showSelected: false,
};
}
},
},
};
......
......@@ -56,6 +56,7 @@ service.interceptors.response.use(response => {
if (res.code !== SUCCESS_CODE) {
if (
response.headers &&
response.headers['content-type'] &&
/application\/octet-stream/.test(
response.headers['content-type'].toLowerCase()
)
......
......@@ -127,7 +127,7 @@ export default {
border-radius: 0 8px 8px 0;
box-shadow: 0 0 10px #666;
position: absolute;
width: 70px;
width: 80px;
height: 18px;
line-height: 18px;
text-indent: 5px;
......
......@@ -7,6 +7,7 @@
:customerPhone="customerPhone"
:showMoney="showMoney"
:visible="visible"
ref="UserInfo"
/>
<div class="right-part">
<div class="el-dialog__header">
......@@ -45,6 +46,11 @@ export default {
default: false,
},
},
methods: {
refreshBeanData() {
this.$refs.UserInfo.getAllData();
},
},
};
</script>
......
export const TOKEN_KEY = 'dcrym';
export const STSTEM_STATE_KEY = 'dcrym-state';
export const SUCCESS_CODE = 1000;
export const LOGOUT_CODE = -2;
......
......@@ -46,6 +46,9 @@ export default {
.color('serviceName', ['#4e82fb', '#fb774e', '#ffc934', '#41bf52'])
.label('payableMoney', {
offset: 10,
formatter: val => {
return this.$formatPrice(Number(val));
},
});
this.chart.render();
......@@ -64,7 +67,7 @@ export default {
if (this.totalDom && this.countDom) {
let money =
this.consumeCount && this.consumeCount.payableMoney
? this.consumeCount.payableMoney
? this.$formatPrice(this.consumeCount.payableMoney)
: '0.00';
let menCount =
this.consumeCount && this.consumeCount.payMen
......
......@@ -9,7 +9,7 @@
class="CustomerRecharge-tooltip"
style="background-color:#4e82fb;"
></span> 总充值:
<span style="color:#f00;">{{ rechargeCount && rechargeCount.rechargeMoney ? (rechargeCount.rechargeMoney).toFixed(2) : '0.00' }}</span>
<span style="color:#f00;">{{ rechargeCount && rechargeCount.rechargeMoney ? $formatPrice(rechargeCount.rechargeMoney) : '0.00' }}</span>
<span
class="CustomerRecharge-tooltip"
style="background-color:#26c9a8;"
......
......@@ -93,7 +93,7 @@
>
<img
slot="icon"
src="@/assets/images/layout/icon_quanyetai@2x.png"
src="@/assets/images/layout/wechat.png"
/>
</MenuItem>
<!-- <div @click="() => toggleFastLink(false)">
......@@ -139,7 +139,7 @@
<script>
import MenuItem from './components/MenuItem';
import { mapGetters } from 'vuex';
import { formatRouteLink, getFilterMenu } from '@/utils/route';
import { formatRouteLink, getFilterMenu, getCollectMenu } from '@/utils/route';
export default {
name: 'IconMenus',
......@@ -226,12 +226,13 @@ export default {
},
methods: {
getCollectList(val) {
let routers = formatRouteLink(this.routers);
let list = val.map(item => {
let id = item.menuId;
return getFilterMenu(this.routers, id);
let name = item.menuId.toString();
return getCollectMenu(routers, name);
});
list = list.filter(item => !!item);
this.collectRouteList = list && list.length ? formatRouteLink(list) : [];
this.collectRouteList = list && list.length ? list : [];
},
clickHandle() {
if (this.dashboardVisiable) {
......
......@@ -57,6 +57,7 @@ const createBaseFetch = config => {
if (res.code !== SUCCESS_CODE) {
if (
response.headers &&
response.headers['content-type'] &&
/application\/octet-stream/.test(
response.headers['content-type'].toLowerCase()
)
......
import { TOKEN_KEY } from '@/config/index';
import { TOKEN_KEY, STSTEM_STATE_KEY } from '@/config/index';
const TokenKey = TOKEN_KEY;
export function getToken() {
return sessionStorage.getItem(TokenKey);
return getStorageData(TokenKey);
}
export function setToken(token, expires) {
return sessionStorage.setItem(TokenKey, token);
return setStorageData(TokenKey, token);
}
export function removeToken() {
return sessionStorage.removeItem(TOKEN_KEY);
removeStorageData(TOKEN_KEY);
removeStorageData(STSTEM_STATE_KEY);
return;
}
export function getStorageData(key) {
return sessionStorage.getItem(key);
}
export function setStorageData(key, data) {
return sessionStorage.setItem(key, data);
}
export function removeStorageData(key) {
return sessionStorage.removeItem(key);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment