Commit 96a286c1 by cwq0219

合并

2 parents 0fa854df 1ccf618b
...@@ -7,7 +7,7 @@ VUE_APP_TITLE=tFIMS ...@@ -7,7 +7,7 @@ VUE_APP_TITLE=tFIMS
VUE_APP_API=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS VUE_APP_API=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
# 仓库地址 # 仓库地址
VUE_APP_REPO=https://github.com/d2-projects/d2-admin-start-kit VUE_APP_REPO=
# 国际化配置 # 国际化配置
VUE_APP_I18N_LOCALE=zh-chs VUE_APP_I18N_LOCALE=zh-chs
......
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
<title><%= VUE_APP_TITLE %></title> <title><%= VUE_APP_TITLE %></title>
<style> <style>
html, body, #app { height: 100%; margin: 0px; padding: 0px; width: 100%; } html, body, #app { height: 100%; margin: 0px; padding: 0px; width: 100%; }
.d2-home { background-color: #303133; height: 100%; display: flex; flex-direction: column; } .d2-home { background-color:#000; height: 100%; display: flex; flex-direction: column; }
.d2-home__main { user-select: none; width: 100%; flex-grow: 1; display: flex; justify-content: center; align-items: center; flex-direction: column; } .d2-home__main { user-select: none; width: 100%; flex-grow: 1; display: flex; justify-content: center; align-items: center; flex-direction: column; }
.d2-home__footer { width: 100%; flex-grow: 0; text-align: center; padding: 1em 0; } .d2-home__footer { width: 100%; flex-grow: 0; text-align: center; padding: 1em 0; }
.d2-home__footer > a { font-size: 12px; color: #ABABAB; text-decoration: none; } .d2-home__footer > a { font-size: 12px; color: #fff; text-decoration: none; }
.d2-home__loading { height: 32px; width: 32px; margin-bottom: 20px; } .d2-home__loading { height: 32px; width: 32px; margin-bottom: 20px; }
.d2-home__title { color: #FFF; font-size: 14px; margin-bottom: 10px; } .d2-home__title { color: #FFF; font-size: 20px; margin-bottom: 10px; }
.d2-home__sub-title { color: #ABABAB; font-size: 12px; } .d2-home__sub-title { color: #fff; font-size: 14px; }
</style> </style>
<script> <!-- <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
var hmid = "1dfa88d0c8571eef2d383070cb3e5ca1"; var hmid = "1dfa88d0c8571eef2d383070cb3e5ca1";
(function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?" + hmid; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})(); (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?" + hmid; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();
</script> </script> -->
</head> </head>
<body> <body>
<noscript> <noscript>
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
:size="size" :size="size"
:type="type" :type="type"
:loading="loading" :loading="loading"
v-roles="['3']" v-if="isInRole"
@click="handleClick" @click="handleClick"
>{{label}}</el-button> >{{label}}</el-button>
</template> </template>
<script> <script>
import {mapGetters} from 'vuex'
export default { export default {
name: 'AuthButton', name: 'AuthButton',
props: { props: {
...@@ -32,16 +33,23 @@ export default { ...@@ -32,16 +33,23 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
perms: { id: {
type: String, type: String,
default: null default: null
} }
}, },
computed: {
...mapGetters('d2admin/auth', ['curBtns'])
},
data () { data () {
return {} return {
isInRole:false
}
}, },
beforeCreate () { created () {
this.$vrm.setRoles(['1', '2', '3']) // this.$vrm.setRoles(this.btnIdAll)
const {action,operation} = this.curBtns
this.isInRole = [...action,...operation].find(obj=>obj.id===this.id||obj.label===this.label)
}, },
methods: { methods: {
handleClick: function () { handleClick: function () {
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
<!-- 顶栏右侧 --> <!-- 顶栏右侧 -->
<div class="d2-header-right" flex-box="0"> <div class="d2-header-right" flex-box="0">
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" --> <!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
<!-- <d2-header-search @click="handleSearchClick" v-if="$env === 'development'"/> --> <d2-header-search @click="handleSearchClick"/>
<!-- <d2-header-log v-if="$env === 'development'"/> --> <d2-header-log />
<d2-header-size/> <!-- <d2-header-size /> -->
<d2-header-fullscreen/> <d2-header-fullscreen/>
<!-- <d2-header-locales v-if="$env === 'development'"/> --> <d2-header-locales />
<d2-header-theme/> <d2-header-theme/>
<d2-header-color/> <d2-header-color/>
<d2-header-user/> <d2-header-user/>
......
...@@ -76,42 +76,34 @@ util.deepFind = function (menus, id) { ...@@ -76,42 +76,34 @@ util.deepFind = function (menus, id) {
return null return null
} }
util.packRoutes = function (resources, idsInPermision) { /**
if (!resources || !idsInPermision || !idsInPermision.length) { * 16进制颜色值 转换为 rgb
throw new Error('参数错误') * @param {*} sColor 16进制颜色值
* @param {*} alpha 透明度
*/
util.colorToRgb = (sColor, alpha) => {
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
sColor = sColor.toLowerCase()
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = '#'
for (var i = 1; i < 4; i += 1) {
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
} }
let __aRouteInPermision = [] sColor = sColorNew
idsInPermision.forEach(obj => {
__aRouteInPermision.push(resources[obj.id])
})
return __aRouteInPermision
}
util.packAsideMenus = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误')
} }
let __aMenusInPermision = [] // 处理六位的颜色值
let __aSub = [] var sColorChange = []
idsInPermision.forEach(obj => { for (let i = 1; i < 7; i += 2) {
const { icon, path, meta } = resources[obj.id] sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
const { title, id, pid } = meta }
if (obj.pid === '0') { if (alpha || alpha === 0 || alpha === '0') {
__aMenusInPermision.push({ title, icon, path, id, pid }) return `rgba(${sColorChange.join(',')} ,${alpha})`
} else {
__aSub.push({ title, icon, path, id, pid })
} }
}) return `rgb(${sColorChange.join(',')})`
let __parent = null
__aSub.forEach(obj => {
__parent = __aMenusInPermision.find(menu => menu.id === obj.pid)
if (__parent.children) {
__parent.children.push(obj)
} else { } else {
__parent.children = [obj] return sColor
} }
})
return __aMenusInPermision
} }
export default util export default util
...@@ -2,35 +2,65 @@ ...@@ -2,35 +2,65 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 19:16:26 * @Date: 2019-08-27 19:16:26
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-28 12:15:51 * @Last Modified time: 2019-08-28 23:05:36
*/ */
const permision = { const permision = {}
} /**
permision.packRoutes = function (resources, idsInPermision) { * 打包如有与按钮
* resources 所有资源集合
* idsInPermision 返回的权限id集合
*/
permision.packRoutesBtns = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) { if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误') throw new Error('参数错误')
} }
let __aRouteInPermision = [] let __aRouteInPermision = [],
__oBtnInPermision = {},
// __aBtnIdAll=[],
__objResource = null
idsInPermision.forEach(obj => { idsInPermision.forEach(obj => {
__aRouteInPermision.push(resources[obj.id]) __objResource = resources[obj.id]
if(__objResource){//直接能取到的为路由 (也可以在routes 中定标识变量)
__aRouteInPermision.push(resources[obj.id])//push 进 路由数组
}else{ //如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.pid]
if(__objResource && __objResource.auth && !__oBtnInPermision[obj.pid]){
__oBtnInPermision[obj.pid]=__objResource.auth
// __aBtnIdAll = __aBtnIdAll.concat([...__objResource.auth.action.map(o=>o.id),...__objResource.auth.operation.map(o=>o.id)])
}
}
}) })
return __aRouteInPermision return {'route':__aRouteInPermision,'btn':__oBtnInPermision}
} }
/**
* 打包菜单
* resources 所有资源集合
* idsInPermision 返回的权限id集合
*/
permision.packAsideMenus = function (resources, idsInPermision) { permision.packAsideMenus = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) { if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误') throw new Error('参数错误')
} }
let __aMenusInPermision = [] let __aMenusInPermision = []
let __aSub = [] let __aSub = []
/**
* 第一次循环 分出一级菜单与所有子菜单
*/
idsInPermision.forEach(obj => { idsInPermision.forEach(obj => {
const __oMenu = permision.format2Menu(resources[obj.id]) const __oMenu = permision.format2Menu(resources[obj.id])
if (obj.pid === '0') { if(!__oMenu){ //不存在 可能是 按钮 直接继续循环
return true
}
if (obj.pid === '0') {//取出1级菜单
__aMenusInPermision.push(__oMenu) __aMenusInPermision.push(__oMenu)
} else { } else {//取出子菜单
__aSub.push(__oMenu) __aSub.push(__oMenu)
} }
}) })
/**
* 第二次循环所有子菜单 ,然后挂载到对应的一级菜单
*/
let __parent = null let __parent = null
__aSub.forEach(obj => { __aSub.forEach(obj => {
__parent = __aMenusInPermision.find(menu => menu.id === obj.pid) __parent = __aMenusInPermision.find(menu => menu.id === obj.pid)
...@@ -47,6 +77,7 @@ permision.packAsideMenus = function (resources, idsInPermision) { ...@@ -47,6 +77,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
* 格式化菜单 封装成系统所需格式 * 格式化菜单 封装成系统所需格式
*/ */
permision.format2Menu = function (oMenu) { permision.format2Menu = function (oMenu) {
if(!oMenu) return null
const { icon, path, meta } = oMenu const { icon, path, meta } = oMenu
const { title, id, pid } = meta const { title, id, pid } = meta
return { title, icon, path, id, pid } return { title, icon, path, id, pid }
......
...@@ -71,7 +71,8 @@ router.afterEach(to => { ...@@ -71,7 +71,8 @@ router.afterEach(to => {
store.dispatch('d2admin/page/open', to) store.dispatch('d2admin/page/open', to)
// 更改标题 // 更改标题
util.title(to.meta.title) util.title(to.meta.title)
// store.dispatch('d2admin/auth/set', to.meta.title) // 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
}) })
export default router export default router
...@@ -28,6 +28,32 @@ export const home = { ...@@ -28,6 +28,32 @@ export const home = {
}, },
component: _import('systemMonitor') component: _import('systemMonitor')
} }
export const sys =[
// 系统 前端日志
{
path: 'log',
name: 'log',
meta: {
title: '前端日志',
auth: true
},
component: _import('system/log')
},
// 刷新页面 必须保留
{
path: 'refresh',
name: 'refresh',
hidden: true,
component: _import('system/function/refresh')
},
// 页面重定向 必须保留
{
path: 'redirect/:route*',
name: 'redirect',
hidden: true,
component: _import('system/function/redirect')
}
]
/** /**
* 所有需动态过滤的资源点 * 所有需动态过滤的资源点
...@@ -67,11 +93,13 @@ export const resources = { ...@@ -67,11 +93,13 @@ export const resources = {
component: _import('demo/page2'), component: _import('demo/page2'),
auth: { auth: {
'operation': [{ // 列表操作 'operation': [{ // 列表操作
id: '1020101', id: '1020201',
name: '查看' pid:'10202',
label: '查看'
}, { // }, { //
id: '1020102', id: '1020202',
name: '编辑' pid:'10202',
label: '编辑'
}], }],
'action': [] // 按钮操作 'action': [] // 按钮操作
} }
...@@ -85,6 +113,18 @@ export const resources = { ...@@ -85,6 +113,18 @@ export const resources = {
id: '10203', id: '10203',
pid: '102' pid: '102'
}, },
auth: {
'operation': [{ // 列表操作
id: '1020301',
pid:'10203',
label: '查看'
}, { //
id: '1020302',
pid:'10203',
label: '编辑'
}],
'action': [] // 按钮操作
},
component: _import('demo/page3') component: _import('demo/page3')
}, },
// '102': { // '102': {
...@@ -132,7 +172,7 @@ export const resources = { ...@@ -132,7 +172,7 @@ export const resources = {
title: '单据管理', title: '单据管理',
id: '105', id: '105',
pid: '0' pid: '0'
}, }
}, },
'10501': { '10501': {
path: '/cc', path: '/cc',
...@@ -159,7 +199,7 @@ export const resources = { ...@@ -159,7 +199,7 @@ export const resources = {
component: _import('trafficManagement') component: _import('trafficManagement')
}, },
'107': { '107': {
path: 'page', path: 'user',
icon: 'folder-o', icon: 'folder-o',
name: '用户管理', name: '用户管理',
meta: { meta: {
...@@ -202,6 +242,18 @@ export const resources = { ...@@ -202,6 +242,18 @@ export const resources = {
}, },
component: _import('userManage/loginLogs') component: _import('userManage/loginLogs')
}, },
'108': {
path: 'page',
icon: 'folder-o',
name: '上报日志',
meta: {
auth: true,
title: '上报日志',
id: '108',
pid: '0'
},
component: _import('reportingLogs')
}
} }
/** /**
......
...@@ -2,15 +2,18 @@ ...@@ -2,15 +2,18 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-27 17:25:12 * @Date: 2019-08-27 17:25:12
* @Last Modified by: limin * @Last Modified by: limin
* @Last Modified time: 2019-08-28 14:25:41 * @Last Modified time: 2019-08-29 00:53:59
*/ */
import util from '@/libs/util.js' import util from '@/libs/util.js'
import router from '@/router' import router from '@/router'
import { resources as sources, home, frameInRoutes, errorPage } from '@/router/routes' import { resources as sources, home, frameInRoutes,sys } from '@/router/routes'
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
source: '' source:null,
meta:{},
btns:{},
btnIdAll:[]
}, },
getters: { getters: {
/** /**
...@@ -19,6 +22,34 @@ export default { ...@@ -19,6 +22,34 @@ export default {
*/ */
source (state, dispatch) { source (state, dispatch) {
return state.source return state.source
},
/**
* @description 返回当前页面meta
* @param {Object} state state
*/
meta (state, dispatch) {
return state.meta
},
/**
* @description 当前角色拥有的所有按钮
* @param {Object} state state
*/
btns (state, dispatch) {
return state.btns
},
/**
* 返回当前页面的btn
* @param {*} state
*/
curBtns(state){
return state.btns[state.meta.id]
},
/**
* 返回当前页面的btn
* @param {*} state
*/
btnIdAll(state){
return state.btnIdAll
} }
}, },
actions: { actions: {
...@@ -50,6 +81,17 @@ export default { ...@@ -50,6 +81,17 @@ export default {
}) })
}, },
/** /**
* @description 保存当前角色权限资源
* @param {obj} source 需要保存的权限资源
*/
setCurrentPageMeta ({ state, commit, dispatch }, meta) {
return new Promise(async resolve => {
state.meta = meta
// end
resolve()
})
},
/**
* @description 从持久化数据加载资源数据 * @description 从持久化数据加载资源数据
* @param {Object} context * @param {Object} context
*/ */
...@@ -61,13 +103,6 @@ export default { ...@@ -61,13 +103,6 @@ export default {
path: 'source', path: 'source',
user: true user: true
}, { root: true }) }, { root: true })
// console.log(document.querySelector('html').getAttribute('login')==='1');
// if( document.querySelector('html').getAttribute('login')==='1'){
// await dispatch('init')
// router.replace(router.currentRoute.path || '/')
// }
// 用户登录后从持久化数据加载一系列的设置
// await dispatch('d2admin/account/load', { root: true })
} }
// end // end
resolve(state.source) resolve(state.source)
...@@ -79,33 +114,26 @@ export default { ...@@ -79,33 +114,26 @@ export default {
*/ */
init ({ state, commit, dispatch }) { init ({ state, commit, dispatch }) {
return new Promise(async resolve => { return new Promise(async resolve => {
try {
// 获取权限资源点 // 获取权限资源点
const __source = await dispatch('load') const __source = await dispatch('load')
// 过滤资源点 并动态添加到路由 // 过滤资源点 并动态添加到路由
const __aRoutesInPermisions = util.permision.packRoutes(sources, __source) const { route,btn } = util.permision.packRoutesBtns(sources, __source)
frameInRoutes[0].children = [home, ...__aRoutesInPermisions] frameInRoutes[0].children = [home, ...route,...sys]
router.addRoutes(frameInRoutes) router.addRoutes(frameInRoutes)
// router.addRoutes(errorPage) state.btns = btn
await commit('d2admin/page/init', frameInRoutes, { root: true }) await commit('d2admin/page/init', frameInRoutes, { root: true })
const __aMenus = [util.permision.format2Menu(home), ...util.permision.packAsideMenus(sources, __source)]
// 过滤左侧菜单栏 // 过滤左侧菜单栏
const __aMenusInPermisions = util.permision.packAsideMenus(sources, __source) await commit('d2admin/menu/asideSet', __aMenus, { root: true })
const __oHome = util.permision.format2Menu(home) // 初始化页面搜索
await commit('d2admin/menu/asideSet', [__oHome, ...__aMenusInPermisions], { root: true }) await commit('d2admin/search/init', __aMenus, { root: true })
} catch (error) {
// DB -> store 加载用户名 if (error.message === '参数错误' && !await dispatch('load')) {
// await dispatch('d2admin/user/load', null, { root: true }) router.replace('/login')
// // DB -> store 加载主题 return false
// await dispatch('d2admin/theme/load', null, { root: true }) }
// // DB -> store 加载页面过渡效果设置 }
// await dispatch('d2admin/transition/load', null, { root: true })
// // DB -> store 持久化数据加载上次退出时的多页列表
// await dispatch('d2admin/page/openedLoad', null, { root: true })
// // DB -> store 持久化数据加载侧边栏折叠状态
// await dispatch('d2admin/menu/asideCollapseLoad', null, { root: true })
// // DB -> store 持久化数据加载全局尺寸
// await dispatch('d2admin/size/load', null, { root: true })
// 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true })
// end // end
resolve(state.source) resolve(state.source)
}) })
......
...@@ -7,6 +7,15 @@ export default { ...@@ -7,6 +7,15 @@ export default {
// 颜色 // 颜色
value: process.env.VUE_APP_ELEMENT_COLOR value: process.env.VUE_APP_ELEMENT_COLOR
}, },
getters: {
/**
* @description 返回当前颜色值
* @param {Object} state state
*/
color (state, dispatch) {
return state.value
}
},
actions: { actions: {
/** /**
* @description 设置颜色 * @description 设置颜色
......
import { get } from 'lodash' import { get } from 'lodash'
import router from '@/router' import router from '@/router'
import setting from '@/setting.js' // import setting from '@/setting.js'
import home from '@/router/routes'
// 判定是否需要缓存 // 判定是否需要缓存
const isKeepAlive = data => get(data, 'meta.cache', false) const isKeepAlive = data => get(data, 'meta.cache', false)
...@@ -11,7 +12,7 @@ export default { ...@@ -11,7 +12,7 @@ export default {
// 可以在多页 tab 模式下显示的页面 // 可以在多页 tab 模式下显示的页面
pool: [], pool: [],
// 当前显示的多页面列表 // 当前显示的多页面列表
opened: setting.page.opened, opened: [home],
// 已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201 // 已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
openedLoaded: false, openedLoaded: false,
// 当前页面 // 当前页面
...@@ -45,7 +46,7 @@ export default { ...@@ -45,7 +46,7 @@ export default {
const value = await dispatch('d2admin/db/get', { const value = await dispatch('d2admin/db/get', {
dbName: 'sys', dbName: 'sys',
path: 'page.opened', path: 'page.opened',
defaultValue: setting.page.opened, defaultValue: [home],
user: true user: true
}, { root: true }) }, { root: true })
// 在处理函数中进行数据优化 过滤掉现在已经失效的页签或者已经改变了信息的页签 // 在处理函数中进行数据优化 过滤掉现在已经失效的页签或者已经改变了信息的页签
......
...@@ -40,33 +40,26 @@ ...@@ -40,33 +40,26 @@
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button> <auth-button label="查看" @e-auth-click="handleClick(scope.row)"/>
<el-button type="text" size="small">编辑</el-button> <auth-button label="编辑" @e-auth-click="handleClick(scope.row)"/>
<auth-button label="测试" @e-auth-click="test(scope.row)"/> <auth-button label="看不见我" @e-auth-click="handleClick(scope.row)"/>
<auth-button label="测试11" @e-auth-click="test(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</d2-container> </d2-container>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
handleClick (row) { handleClick (row) {
console.log(row) alert(JSON.stringify(row))
},
test (row) {
console.log(row)
} }
}, },
components: { components: {
}, },
mounted () { mounted () {
this.$event.$on('e-auth-click', function () {
alert(1)
})
}, },
data () { data () {
return { return {
......
import Bg from './src/main'
/* istanbul ignore next */
// Bg.install = function(Vue) {
// Vue.component(Bg.name, Bg)
// }
export default Bg
import axios from '@/plugin/axios'
// 默认配置
const defaults = {
format: 'js',
idx: 0,
n: 1,
token: 'wqdjkwl1e21FQlk1j2',
wallpaper_path: ''
}
/**
* 返回数组
*/
export const getBingImages = options => {
// const xhr = new XMLHttpRequest()
// const data = null
return new Promise((resolve, reject) => {
let config = null
if (typeof options === 'undefined') {
config = defaults
} else {
config = {}
Object.assign(config, defaults, options)
}
axios({ url: config.wallpaper_path }).then(res => {
// request({ url: 'http://localhost:3000/api/wallpaper' }).then(res => {
// console.log(JSON.parse(res.data).base64)
// if (res.status === 'success') {
resolve(res)
// } else {
// reject('ERROR.')
// }
})
})
}
<template>
<div :style="oBgStyle" :class="withAnimation?'img imgA':'img'"></div>
</template>
<script>
import { getBingImages } from './get_bing_image.js'
export default {
name: 'Bg',
props: {
opacity: [String],
refresh: Boolean,
withAnimation: Boolean
},
data() {
return {
oBgStyle: {
backgroundImage: '',
opacity: this.opacity || '.1'
}
}
},
beforeMount() {
// const oBg = this.$get_session('oBg')
// if (oBg && !this.refresh) {
// this.oBgStyle.backgroundImage = oBg.bgi
// this.$emit('update:oBg', oBg)
// return
// }
getBingImages({ 'wallpaper_path': 'http://oss-config.test.glsx.com.cn:7060/api/wallpaper' }).then(data => {
const { path, copyright, copyrightlink } = data
this.oBgStyle.backgroundImage = `url(${path})`
const oBg = { bgi: this.oBgStyle.backgroundImage, copyright, copyrightlink }
// this.$set_session('oBg', JSON.stringify(oBg))
this.$emit('update:oBg', oBg)
}).catch(err=>{
console.log(err);
})
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@keyframes img-action {
from{
transform: scale(1.1)
}
to{
transform: scale(1)
}
}
.img {
width: 100%;
height: 100%;
position: absolute;
}
.imgA {
animation: img-action 18s
}
</style>
<template> <template>
<div class="page-login"> <div class="page-login">
<!-- <bg opacity="1" :oBg.sync="bing" :refresh="true" :withAnimation="true"></bg> -->
<div class="page-login--layer page-login--layer-area"> <div class="page-login--layer page-login--layer-area">
<ul class="circles"> <ul class="circles">
<li v-for="n in 10" :key="n"></li> <li v-for="n in 10" :key="n"></li>
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
</div> </div>
</div> </div>
<div class="page-login--content-footer"> <div class="page-login--content-footer">
<p class="page-login--content-footer-locales"> <!-- <p class="page-login--content-footer-locales">
<a <a
v-for="language in $languages" v-for="language in $languages"
:key="language.value" :key="language.value"
...@@ -89,7 +90,7 @@ ...@@ -89,7 +90,7 @@
@click="$i18n.locale = language.value"> @click="$i18n.locale = language.value">
{{ language.label }} {{ language.label }}
</a> </a>
</p> </!-->
<p class="page-login--content-footer-copyright"> <p class="page-login--content-footer-copyright">
Copyright Copyright
<d2-icon name="copyright"/> <d2-icon name="copyright"/>
...@@ -98,11 +99,11 @@ ...@@ -98,11 +99,11 @@
@FairyEver @FairyEver
</a> </a>
</p> </p>
<p class="page-login--content-footer-options"> <!-- <p class="page-login--content-footer-options">
<a href="#">帮助</a> <a href="#">帮助</a>
<a href="#">隐私</a> <a href="#">隐私</a>
<a href="#">条款</a> <a href="#">条款</a>
</p> </p> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -126,8 +127,15 @@ ...@@ -126,8 +127,15 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
export default { export default {
components: {
'Bg': () => import('./Bg')
},
data () { data () {
return { return {
bing: {
copyright: '',
copyrightlink: ''
},
timeInterval: null, timeInterval: null,
time: dayjs().format('HH:mm:ss'), time: dayjs().format('HH:mm:ss'),
// 快速选择用户 // 快速选择用户
......
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
}, },
watch: { watch: {
isVisible(val) { isVisible (val) {
this.disabled = this.editForm.trafficCode ? true : false this.disabled = !!this.editForm.trafficCode
this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1' this.editForm.openType = this.editForm.trafficCode ? this.editForm.openType : '1'
this.$refs.editRuleForm.resetFields() this.$refs.editRuleForm.resetFields()
} }
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
label: '接口开放', label: '接口开放',
prop: 'openType', prop: 'openType',
formatter: (cellValue) => { formatter: (cellValue) => {
if(cellValue.openType) { if (cellValue.openType) {
return { return {
1: '是', 1: '是',
2: '否' 2: '否'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!