TOOL
This commit is contained in:
parent
5297af0122
commit
3dc2a742f9
@ -28,7 +28,7 @@
|
||||
created() {
|
||||
|
||||
//设置主题颜色
|
||||
const app_color = this.$CONFIG.COLOR || this.$TOOL.data.get('APP_COLOR')
|
||||
const app_color = this.$CONFIG.COLOR || this.$tool.data.get('APP_COLOR')
|
||||
if(app_color){
|
||||
document.documentElement.style.setProperty('--el-color-primary', app_color);
|
||||
for (let i = 1; i <= 9; i++) {
|
||||
|
@ -51,7 +51,7 @@
|
||||
},
|
||||
computed: {
|
||||
cmtValue(){
|
||||
return this.groupSeparator ? this.$TOOL.groupSeparator(this.value) : this.value
|
||||
return this.groupSeparator ? this.$tool.groupSeparator(this.value) : this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,9 +29,9 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var searchHistory = this.$TOOL.data.get("SEARCH_HISTORY") || []
|
||||
var searchHistory = this.$tool.data.get("SEARCH_HISTORY") || []
|
||||
this.history = searchHistory
|
||||
var menuTree = this.$TOOL.data.get("MENU")
|
||||
var menuTree = this.$tool.data.get("MENU")
|
||||
this.filterMenu(menuTree)
|
||||
this.$refs.input.focus()
|
||||
},
|
||||
@ -94,7 +94,7 @@
|
||||
to(item){
|
||||
if(!this.history.includes(this.input)){
|
||||
this.history.push(this.input)
|
||||
this.$TOOL.data.set("SEARCH_HISTORY", this.history)
|
||||
this.$tool.data.set("SEARCH_HISTORY", this.history)
|
||||
}
|
||||
if(item.type=="link"){
|
||||
setTimeout(()=>{
|
||||
@ -118,9 +118,9 @@
|
||||
historyClose(index){
|
||||
this.history.splice(index, 1);
|
||||
if(this.history.length <= 0){
|
||||
this.$TOOL.data.remove("SEARCH_HISTORY")
|
||||
this.$tool.data.remove("SEARCH_HISTORY")
|
||||
}else{
|
||||
this.$TOOL.data.set("SEARCH_HISTORY", this.history)
|
||||
this.$tool.data.set("SEARCH_HISTORY", this.history)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,10 +41,10 @@
|
||||
layout: this.$store.state.global.layout,
|
||||
menuIsCollapse: this.$store.state.global.menuIsCollapse,
|
||||
layoutTags: this.$store.state.global.layoutTags,
|
||||
lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$TOOL.data.get('APP_DARK') || false,
|
||||
lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$tool.data.get('APP_DARK') || false,
|
||||
colorList: ['#409EFF', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'],
|
||||
colorPrimary: this.$TOOL.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF'
|
||||
colorPrimary: this.$tool.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -60,15 +60,15 @@
|
||||
dark(val){
|
||||
if(val){
|
||||
document.documentElement.classList.add("dark")
|
||||
this.$TOOL.data.set("APP_DARK", val)
|
||||
this.$tool.data.set("APP_DARK", val)
|
||||
}else{
|
||||
document.documentElement.classList.remove("dark")
|
||||
this.$TOOL.data.remove("APP_DARK")
|
||||
this.$tool.data.remove("APP_DARK")
|
||||
}
|
||||
},
|
||||
lang(val){
|
||||
this.$i18n.locale = val
|
||||
this.$TOOL.data.set("APP_LANG", val);
|
||||
this.$tool.data.set("APP_LANG", val);
|
||||
},
|
||||
colorPrimary(val){
|
||||
if(!val){
|
||||
@ -82,7 +82,7 @@
|
||||
for (let i = 1; i <= 9; i++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, colorTool.darken(val,i/10));
|
||||
}
|
||||
this.$TOOL.data.set("APP_COLOR", val);
|
||||
this.$tool.data.set("APP_COLOR", val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var userInfo = this.$TOOL.data.get("USER_INFO");
|
||||
var userInfo = this.$tool.data.get("USER_INFO");
|
||||
this.userName = userInfo.userName;
|
||||
this.avatar = userInfo.avatar;
|
||||
},
|
||||
@ -137,7 +137,7 @@
|
||||
type: 'info',
|
||||
}).then(() => {
|
||||
const loading = this.$loading()
|
||||
this.$TOOL.data.clear()
|
||||
this.$tool.data.clear()
|
||||
this.$router.replace({path: '/login'})
|
||||
setTimeout(()=>{
|
||||
loading.close()
|
||||
@ -162,7 +162,7 @@
|
||||
//全屏
|
||||
screen(){
|
||||
var element = document.documentElement;
|
||||
this.$TOOL.screen(element)
|
||||
this.$tool.screen(element)
|
||||
},
|
||||
//显示短消息
|
||||
showMsg(){
|
||||
|
@ -4,7 +4,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
logoutCount: this.$TOOL.data.get('AUTO_EXIT')
|
||||
logoutCount: this.$tool.data.get('AUTO_EXIT')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -38,7 +38,7 @@ export default {
|
||||
install(app) {
|
||||
//挂载全局对象
|
||||
app.config.globalProperties.$CONFIG = config;
|
||||
app.config.globalProperties.$TOOL = tool;
|
||||
app.config.globalProperties.$tool = tool;
|
||||
app.config.globalProperties.$http = http;
|
||||
app.config.globalProperties.$api = api;
|
||||
app.config.globalProperties.$AUTH = permission;
|
||||
|
@ -31,7 +31,7 @@
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.dashboard = this.$TOOL.data.get("USER_INFO").dashboard || '0';
|
||||
this.dashboard = this.$tool.data.get("USER_INFO").dashboard || '0';
|
||||
},
|
||||
mounted(){
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
},
|
||||
methods: {
|
||||
showTime(){
|
||||
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
|
||||
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
|
||||
this.time = this.$tool.dateFormat(new Date(), 'hh:mm:ss')
|
||||
this.day = this.$tool.dateFormat(new Date(), 'yyyy年MM月dd日')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.grid = this.$TOOL.data.get("grid") || JSON.parse(JSON.stringify(this.defaultGrid))
|
||||
this.grid = this.$tool.data.get("grid") || JSON.parse(JSON.stringify(this.defaultGrid))
|
||||
},
|
||||
mounted() {
|
||||
this.$emit('on-mounted')
|
||||
@ -133,7 +133,7 @@
|
||||
return allCompsList
|
||||
},
|
||||
myCompsList(){
|
||||
var myGrid = this.$TOOL.data.get("DASHBOARDGRID")
|
||||
var myGrid = this.$tool.data.get("DASHBOARDGRID")
|
||||
return this.allCompsList.filter(item => !item.disabled && myGrid.includes(item.key))
|
||||
},
|
||||
nowCompsList(){
|
||||
@ -176,14 +176,14 @@
|
||||
save(){
|
||||
this.customizing = false
|
||||
this.$refs.widgets.style.removeProperty('transform')
|
||||
this.$TOOL.data.set("grid", this.grid)
|
||||
this.$tool.data.set("grid", this.grid)
|
||||
},
|
||||
//恢复默认
|
||||
backDefaul(){
|
||||
this.customizing = false
|
||||
this.$refs.widgets.style.removeProperty('transform')
|
||||
this.grid = JSON.parse(JSON.stringify(this.defaultGrid))
|
||||
this.$TOOL.data.remove("grid")
|
||||
this.$tool.data.remove("grid")
|
||||
},
|
||||
//关闭
|
||||
close(){
|
||||
|
@ -74,8 +74,8 @@
|
||||
},
|
||||
getMods(){
|
||||
//这里可用改为读取远程数据
|
||||
this.myModsName = this.$TOOL.data.get("my-mods") || []
|
||||
var menuTree = this.$TOOL.data.get("MENU")
|
||||
this.myModsName = this.$tool.data.get("my-mods") || []
|
||||
var menuTree = this.$tool.data.get("MENU")
|
||||
this.filterMenu(menuTree)
|
||||
this.myMods = this.mods.filter(item => {
|
||||
return this.myModsName.includes(item.name)
|
||||
@ -101,7 +101,7 @@
|
||||
},
|
||||
saveMods(){
|
||||
const myModsName = this.myMods.map(v => v.name)
|
||||
this.$TOOL.data.set("my-mods", myModsName)
|
||||
this.$tool.data.set("my-mods", myModsName)
|
||||
this.$message.success("设置常用成功")
|
||||
this.modsDrawer = false
|
||||
}
|
||||
|
@ -68,12 +68,12 @@
|
||||
this.islogin = true
|
||||
var data = {
|
||||
username: this.form.user,
|
||||
password: this.$TOOL.crypto.MD5(this.form.password)
|
||||
password: this.$tool.crypto.MD5(this.form.password)
|
||||
}
|
||||
//获取token
|
||||
var user = await this.$api.auth.token.post(data)
|
||||
if(user.code == 200){
|
||||
this.$TOOL.cookie.set("TOKEN", user.data.token, {
|
||||
this.$tool.cookie.set("TOKEN", user.data.token, {
|
||||
expires: 86400*360
|
||||
})
|
||||
}else{
|
||||
@ -95,10 +95,10 @@
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.$TOOL.data.set("MENU", menu.data.menu)
|
||||
this.$TOOL.data.set("USER_INFO", menu.data.user)
|
||||
this.$TOOL.data.set("PERMISSIONS", menu.data.permissions)
|
||||
this.$TOOL.data.set("DASHBOARDGRID", menu.data.dashboardGrid)
|
||||
this.$tool.data.set("MENU", menu.data.menu)
|
||||
this.$tool.data.set("USER_INFO", menu.data.user)
|
||||
this.$tool.data.set("PERMISSIONS", menu.data.permissions)
|
||||
this.$tool.data.set("DASHBOARDGRID", menu.data.dashboardGrid)
|
||||
}else{
|
||||
this.islogin = false
|
||||
this.$message.warning(menu.message)
|
||||
|
@ -72,8 +72,8 @@
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$TOOL.data.get('APP_DARK') || false
|
||||
lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$tool.data.get('APP_DARK') || false
|
||||
},
|
||||
lang: [
|
||||
{
|
||||
@ -94,24 +94,24 @@
|
||||
'config.dark'(val){
|
||||
if(val){
|
||||
document.documentElement.classList.add("dark")
|
||||
this.$TOOL.data.set("APP_DARK", val)
|
||||
this.$tool.data.set("APP_DARK", val)
|
||||
}else{
|
||||
document.documentElement.classList.remove("dark")
|
||||
this.$TOOL.data.remove("APP_DARK")
|
||||
this.$tool.data.remove("APP_DARK")
|
||||
}
|
||||
},
|
||||
'config.lang'(val){
|
||||
this.$i18n.locale = val
|
||||
this.$TOOL.data.set("APP_LANG", val)
|
||||
this.$tool.data.set("APP_LANG", val)
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
this.$TOOL.cookie.remove("TOKEN")
|
||||
this.$TOOL.data.remove("USER_INFO")
|
||||
this.$TOOL.data.remove("MENU")
|
||||
this.$TOOL.data.remove("PERMISSIONS")
|
||||
this.$TOOL.data.remove("DASHBOARDGRID")
|
||||
this.$TOOL.data.remove("grid")
|
||||
this.$tool.cookie.remove("TOKEN")
|
||||
this.$tool.data.remove("USER_INFO")
|
||||
this.$tool.data.remove("MENU")
|
||||
this.$tool.data.remove("PERMISSIONS")
|
||||
this.$tool.data.remove("DASHBOARDGRID")
|
||||
this.$tool.data.remove("grid")
|
||||
this.$store.commit("clearViewTags")
|
||||
this.$store.commit("clearKeepLive")
|
||||
this.$store.commit("clearIframeList")
|
||||
|
@ -50,10 +50,10 @@
|
||||
return {
|
||||
colorList: ['#409EFF', '#009688', '#536dfe', '#ff5c93', '#c62f2f', '#fd726d'],
|
||||
config: {
|
||||
lang: this.$TOOL.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$TOOL.data.get('APP_DARK') || false,
|
||||
colorPrimary: this.$TOOL.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF',
|
||||
autoExit: this.$TOOL.data.get('AUTO_EXIT') || 0,
|
||||
lang: this.$tool.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$tool.data.get('APP_DARK') || false,
|
||||
colorPrimary: this.$tool.data.get('APP_COLOR') || this.$CONFIG.COLOR || '#409EFF',
|
||||
autoExit: this.$tool.data.get('AUTO_EXIT') || 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -61,15 +61,15 @@
|
||||
'config.dark'(val){
|
||||
if(val){
|
||||
document.documentElement.classList.add("dark")
|
||||
this.$TOOL.data.set("APP_DARK", val)
|
||||
this.$tool.data.set("APP_DARK", val)
|
||||
}else{
|
||||
document.documentElement.classList.remove("dark")
|
||||
this.$TOOL.data.remove("APP_DARK")
|
||||
this.$tool.data.remove("APP_DARK")
|
||||
}
|
||||
},
|
||||
'config.lang'(val){
|
||||
this.$i18n.locale = val
|
||||
this.$TOOL.data.set("APP_LANG", val);
|
||||
this.$tool.data.set("APP_LANG", val);
|
||||
},
|
||||
'config.colorPrimary'(val){
|
||||
if(!val){
|
||||
@ -83,13 +83,13 @@
|
||||
for (let i = 1; i <= 9; i++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, colorTool.darken(val,i/10));
|
||||
}
|
||||
this.$TOOL.data.set("APP_COLOR", val);
|
||||
this.$tool.data.set("APP_COLOR", val);
|
||||
},
|
||||
'config.autoExit'(val){
|
||||
if(val == 0){
|
||||
this.$TOOL.data.remove("AUTO_EXIT")
|
||||
this.$tool.data.remove("AUTO_EXIT")
|
||||
}else{
|
||||
this.$TOOL.data.set("AUTO_EXIT", val)
|
||||
this.$tool.data.set("AUTO_EXIT", val)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user