mirror of
https://gitee.com/orangeform/orange-admin.git
synced 2026-01-17 18:46:36 +08:00
commit
This commit is contained in:
@@ -5,12 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from 'vuex';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
...mapMutations(['setUserRules'])
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler (newValue) {
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
<template>
|
||||
<div class="date-range">
|
||||
<!--<year-range-panel />-->
|
||||
<el-select v-model="dateType" :size="size" style="max-width: 100px; min-width: 100px; margin-right: 10px;" v-if="!hideTypeOnlyOne || validTypeList.length > 1">
|
||||
<el-select v-model="dateType" :size="size"
|
||||
style="max-width: 100px; min-width: 100px; margin-right: 10px;"
|
||||
v-if="!hideTypeOnlyOne || validTypeList.length > 1">
|
||||
<el-option v-for="type in validTypeList" :key="type.value" :value="type.value" :label="type.label" />
|
||||
</el-select>
|
||||
<el-date-picker style="flex-grow: 1;" v-model="currentDates" :size="size" :placeholder="placeholder" :type="innerDateType"
|
||||
<el-date-picker style="flex-grow: 1;" v-model="currentDates"
|
||||
:size="size" :placeholder="placeholder" :type="innerDateType"
|
||||
:disabled="disabled" :format="innerDateFormat" :readonly="readonly" :editable="editable"
|
||||
:clearable="clearable" :start-placeholder="startPlaceholder" :end-placeholder="endPlaceholder"
|
||||
:align="align" :range-separator="rangeSeparator" :value-format="valueFormat"
|
||||
:prefix-icon="prefixIcon" :clear-icon="clearIcon" @change="onValueChange"></el-date-picker>
|
||||
:prefix-icon="prefixIcon" :clear-icon="clearIcon" @change="onValueChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
this.rowJustify = 'space-between';
|
||||
let tempCount = residueCount === 0 ? 0 : (lineCount - residueCount);
|
||||
if (hasOperator) {
|
||||
let residueWidth = width - ((lineCount - residueCount) * this.itemWidth) - 20;
|
||||
let residueWidth = width - ((lineCount - residueCount) * this.itemWidth) - ((tempCount >= 1) ? 20 : 0);
|
||||
// 判断剩余的空间是否够放下操作按钮
|
||||
if (residueWidth >= this.minMenuWidth && residueCount === 0) {
|
||||
this.rowJustify = 'start';
|
||||
|
||||
@@ -137,7 +137,18 @@ const statsDateRangeMixin = {
|
||||
if (date == null) return [];
|
||||
|
||||
statsType = allowStatsType.indexOf(statsType) === -1 ? 'day' : statsType;
|
||||
let tempDate = new Date(date);
|
||||
date = date.substr(0, date.indexOf(' '));
|
||||
let tempList = date.split('-');
|
||||
let year = Number.parseInt(tempList[0]);
|
||||
let month = Number.parseInt(tempList[1]);
|
||||
let day = Number.parseInt(tempList[2]);
|
||||
if (isNaN(year) || isNaN(month) || isNaN(day)) {
|
||||
return [];
|
||||
}
|
||||
let tempDate = new Date(year, month - 1, day);
|
||||
// 判断是否正确的日期
|
||||
if (isNaN(tempDate.getTime())) return [];
|
||||
|
||||
tempDate.setHours(0, 0, 0, 0);
|
||||
let retDate;
|
||||
switch (statsType) {
|
||||
|
||||
@@ -120,11 +120,17 @@ export default {
|
||||
for (let i = 0; i < state.menuList.length; i++) {
|
||||
menuItem = findMenuItem(state.menuList[i], menuId, 'menuId');
|
||||
if (menuItem != null) {
|
||||
// 添加新的tag
|
||||
let tagItem = findItemFromList(state.tagList, menuId, 'menuId');
|
||||
if (tagItem == null) {
|
||||
state.tagList = [...state.tagList, menuItem];
|
||||
setObjectToSessionStorage('tagList', state.tagList);
|
||||
}
|
||||
// 添加新缓存
|
||||
if (Array.isArray(state.cachePages) && state.cachePages.indexOf(menuItem.formRouterName) === -1) {
|
||||
state.cachePages = [...state.cachePages, menuItem.formRouterName];
|
||||
setObjectToSessionStorage('cachePages', state.cachePages);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,12 @@ import { mapGetters, mapMutations } from 'vuex';
|
||||
import projectConfig from '@/core/config';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
multiTag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
isCollapse: false,
|
||||
@@ -60,9 +66,13 @@ export default {
|
||||
},
|
||||
selectMenu (index, path) {
|
||||
if (this.getCurrentMenuId === index) return;
|
||||
// <20><>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>tags<67><73>cachePage
|
||||
if (!this.multiTag) {
|
||||
this.clearAllTags();
|
||||
}
|
||||
this.setCurrentMenuId(index);
|
||||
},
|
||||
...mapMutations(['setCollapse', 'clearCachePage', 'setCurrentMenuId'])
|
||||
...mapMutations(['setCollapse', 'clearAllTags', 'setCurrentMenuId'])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-container :style="getMainStyle">
|
||||
<el-aside width='200px' class="sidebar">
|
||||
<side-bar style="overflow: hidden"></side-bar>
|
||||
<side-bar style="overflow: hidden" :multi-tag="false"></side-bar>
|
||||
</el-aside>
|
||||
<el-container style="background-color: rgb(235,235,235)">
|
||||
<el-header class="header">
|
||||
@@ -76,11 +76,12 @@ export default {
|
||||
}
|
||||
|
||||
SystemController.logout(this, {}, options).catch(e => {});
|
||||
this.clearAllTags();
|
||||
this.$router.replace({name: 'login'});
|
||||
}).catch(e => {});
|
||||
}
|
||||
},
|
||||
...mapMutations(['setClientHeight'])
|
||||
...mapMutations(['setClientHeight', 'clearAllTags'])
|
||||
},
|
||||
computed: {
|
||||
getMainStyle () {
|
||||
@@ -112,9 +113,11 @@ export default {
|
||||
getMenuItem: {
|
||||
handler (newValue) {
|
||||
if (newValue == null) {
|
||||
this.$router.replace({
|
||||
name: 'welcome'
|
||||
});
|
||||
if (this.$route.name !== 'welcome') {
|
||||
this.$router.replace({
|
||||
name: 'welcome'
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$router.replace({
|
||||
name: newValue.formRouterName
|
||||
|
||||
Reference in New Issue
Block a user