新版前端UI,预发布2.6.4版本。 (#1735)
* fix: 修改 layout 中相关 emit 和 重复声明的 theme ,采用最新的vue api * fix:修改 eslintrc 的配置文件,删除大多数无用配置 * fix: 修复 layout 切换手机样式模糊层的 bug * feature: 重构 layout , 添加暗黑模式 , 删除侧边栏颜色 * fix:细节调整,activeColor摘除。 * feature:右侧滚动模式调整 * feature:无用代码剔除 * fix: 修复暗黑模式相关细节 * fix: custome config layout * feature:样式细节调整 * fix: 增加前端样式配置文件 * feature:调整基础配置,增加表格边框 * feature:buttomInfo取消底色,a标签更改为活跃色 * feature:调整阴影颜色和配置同步 * feature:版本调整2.6.3==>2.6.4 --------- Co-authored-by: bypanghu <bypanghu@163.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
export function addEventListen(
|
||||
target,
|
||||
event,
|
||||
handler,
|
||||
capture = false
|
||||
) {
|
||||
if (
|
||||
target.addEventListener &&
|
||||
typeof target.addEventListener === 'function'
|
||||
) {
|
||||
target.addEventListener(event, handler, capture);
|
||||
}
|
||||
}
|
||||
|
||||
export function removeEventListen(
|
||||
target,
|
||||
event,
|
||||
handler,
|
||||
capture = false
|
||||
) {
|
||||
if (
|
||||
target.removeEventListener &&
|
||||
typeof target.removeEventListener === 'function'
|
||||
) {
|
||||
target.removeEventListener(event, handler, capture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,3 +56,34 @@ export const ReturnArrImg = (arr) => {
|
||||
export const onDownloadFile = (url) => {
|
||||
window.open(path + url)
|
||||
}
|
||||
const colorToHex = u=>{
|
||||
let e = u.replace("#", "").match(/../g);
|
||||
for (let t = 0; t < 3; t++)
|
||||
e[t] = parseInt(e[t], 16);
|
||||
return e
|
||||
}
|
||||
|
||||
const hexToColor = (u,e,t)=>{
|
||||
let a = [u.toString(16), e.toString(16), t.toString(16)];
|
||||
for (let n = 0; n < 3; n++)
|
||||
a[n].length === 1 && (a[n] = `0${a[n]}`);
|
||||
return `#${a.join("")}`
|
||||
}
|
||||
const generateAllColors = (u,e)=> {
|
||||
let t = colorToHex(u);
|
||||
for (let a = 0; a < 3; a++)
|
||||
t[a] = Math.floor((255 - t[a]) * e + t[a]);
|
||||
return hexToColor(t[0], t[1], t[2])
|
||||
}
|
||||
|
||||
|
||||
export const setBodyPrimaryColor = ( primaryColor ) =>{
|
||||
document.documentElement.style.setProperty('--el-color-primary', primaryColor)
|
||||
for (let times = 1; times <= 2; times++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-dark-${times}`, generateAllColors(primaryColor, times / 10))
|
||||
}
|
||||
for (let times = 1; times <= 10; times++) {
|
||||
document.documentElement.style.setProperty(`--el-color-primary-light-${times}`, generateAllColors(primaryColor, times / 10))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user