优化暗黑皮肤

This commit is contained in:
kuaifan 2022-01-21 11:44:13 +08:00
parent 18bc75242b
commit 164f3275f4
11 changed files with 285 additions and 335 deletions

View File

@ -596,6 +596,7 @@
twitterwidget, twitterwidget,
.sr-reader, .sr-reader,
.no-dark-mode, .no-dark-mode,
.no-dark-mode-before:before,
.sr-backdrop { .sr-backdrop {
${this.utils.reverseFilter} ${this.utils.reverseFilter}
} }

View File

@ -88,7 +88,7 @@ export default {
}, },
computed: { computed: {
...mapState(['userId', 'cacheTasks', 'taskCompleteTemps', 'wsOpenNum']), ...mapState(['userId', 'cacheTasks', 'taskCompleteTemps', 'wsOpenNum', 'themeIsDark']),
...mapGetters(['transforTasks']), ...mapGetters(['transforTasks']),
@ -134,7 +134,11 @@ export default {
_time: data._time, _time: data._time,
}; };
if (data.p_name) { if (data.p_name) {
task.priority = '<span class="priority" style="background-color:' + data.p_color + '">' + data.p_name + '</span>'; let priorityStyle = `background-color:${data.p_color}`;
if (this.themeIsDark) {
priorityStyle = `color:${data.p_color};border:1px solid ${data.p_color};padding:1px 3px;`;
}
task.priority = `<span class="priority" style="${priorityStyle}">${data.p_name}</span>`;
} }
if (data.sub_my && data.sub_my.length > 0) { if (data.sub_my && data.sub_my.length > 0) {
task.title = `[+${data.sub_my.length}] ${task.title}` task.title = `[+${data.sub_my.length}] ${task.title}`
@ -153,7 +157,7 @@ export default {
task.title = `[${this.$L('超期')}] ${task.title}` task.title = `[${this.$L('超期')}] ${task.title}`
task.color = "#f56c6c" task.color = "#f56c6c"
task.bgColor = data.color || "#fef0f0" task.bgColor = data.color || "#fef0f0"
task.priority+= '<span class="overdue">' + this.$L('超期未完成') + '</span>'; task.priority+= `<span class="overdue">${this.$L('超期未完成')}</span>`;
} }
if (!task.borderColor) { if (!task.borderColor) {
task.borderColor = task.bgColor; task.borderColor = task.bgColor;

View File

@ -65,18 +65,18 @@
<ul class="clearfix"> <ul class="clearfix">
<li <li
v-for="item in fileList" v-for="item in fileList"
:class="[item.type, item.id && shearId == item.id ? 'shear' : '', !!item._highlight ? 'highlight' : '']" :class="[item.id && shearId == item.id ? 'shear' : '', !!item._highlight ? 'highlight' : '']"
@contextmenu.prevent.stop="handleRightClick($event, item)" @contextmenu.prevent.stop="handleRightClick($event, item)"
@click="openFile(item)"> @click="openFile(item)">
<div class="file-menu" @click.stop="handleRightClick($event, item)"> <div class="file-menu" @click.stop="handleRightClick($event, item)">
<Icon type="ios-more" /> <Icon type="ios-more" />
</div> </div>
<div class="file-icon"> <div :class="`no-dark-mode-before file-icon ${item.type}`">
<template v-if="item.share"> <template v-if="item.share">
<UserAvatar v-if="item.userid != userId" :userid="item.userid" class="share-avatar" :size="20"> <UserAvatar v-if="item.userid != userId" :userid="item.userid" class="share-avatar" :size="20">
<p>{{$L('共享权限')}}: {{$L(item.permission == 1 ? '读/写' : '只读')}}</p> <p>{{$L('共享权限')}}: {{$L(item.permission == 1 ? '读/写' : '只读')}}</p>
</UserAvatar> </UserAvatar>
<div v-else class="share-icon"> <div v-else class="share-icon no-dark-mode">
<i class="taskfont">&#xe757;</i> <i class="taskfont">&#xe757;</i>
</div> </div>
</template> </template>
@ -119,7 +119,7 @@
:key="key" :key="key"
:divided="!!type.divided" :divided="!!type.divided"
@click.native="addFile(type.value)"> @click.native="addFile(type.value)">
<div :class="['file-item ' + type.value]">{{$L(type.label)}}</div> <div :class="`no-dark-mode-before file-item file-icon ${type.value}`">{{$L(type.label)}}</div>
</DropdownItem> </DropdownItem>
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
@ -142,7 +142,7 @@
:key="key" :key="key"
:divided="!!type.divided" :divided="!!type.divided"
@click.native="addFile(type.value)"> @click.native="addFile(type.value)">
<div :class="['file-item ' + type.value]">{{$L(type.label)}}</div> <div :class="`no-dark-mode-before file-item file-icon ${type.value}`">{{$L(type.label)}}</div>
</DropdownItem> </DropdownItem>
</template> </template>
</DropdownMenu> </DropdownMenu>
@ -577,7 +577,7 @@ export default {
class: 'file-nbox' class: 'file-nbox'
}, [ }, [
h('div', { h('div', {
class: 'file-name ' + row.type, class: `no-dark-mode-before file-name file-icon ${row.type}`,
}, array), }, array),
]); ]);
} else { } else {
@ -645,7 +645,7 @@ export default {
class: 'file-nbox' class: 'file-nbox'
}, [ }, [
h('div', { h('div', {
class: 'file-name ' + row.type, class: `no-dark-mode-before file-name file-icon ${row.type}`,
}, array), }, array),
iconArray iconArray
]); ]);

View File

@ -1,89 +1,85 @@
const state = {}; const stateData = {
// 浏览器宽度
windowWidth: window.innerWidth,
// 浏览器宽度 // 浏览器宽度≤768返回true
state.windowWidth = window.innerWidth; windowMax768: window.innerWidth <= 768,
// 浏览器宽度≤768返回true // 数据缓存
state.windowMax768 = window.innerWidth <= 768; cacheLoading: {},
// 数据缓存 // DrawerOverlay
state.cacheLoading = {}; cacheDrawerIndex: 0,
cacheDrawerOverlay: [],
// DrawerOverlay // User
state.cacheDrawerIndex = 0; cacheUserActive: {},
state.cacheDrawerOverlay = []; cacheUserWait: [],
cacheUserBasic: $A.getStorageArray("cacheUserBasic"),
// User // Dialog
state.cacheUserActive = {}; cacheDialogs: $A.getStorageArray("cacheDialogs"),
state.cacheUserWait = [];
state.cacheUserBasic = $A.getStorageArray("cacheUserBasic");
// Dialog // Project
state.cacheDialogs = $A.getStorageArray("cacheDialogs"); cacheProjects: $A.getStorageArray("cacheProjects"),
cacheColumns: $A.getStorageArray("cacheColumns"),
cacheTasks: $A.getStorageArray("cacheTasks"),
cacheProjectParameter: $A.getStorageArray("cacheProjectParameter"),
// Project // ServerUrl
state.cacheProjects = $A.getStorageArray("cacheProjects"); cacheServerUrl: $A.getStorageString("cacheServerUrl"),
state.cacheColumns = $A.getStorageArray("cacheColumns");
state.cacheTasks = $A.getStorageArray("cacheTasks");
state.cacheProjectParameter = $A.getStorageArray("cacheProjectParameter");
// ServerUrl // Ajax
state.cacheServerUrl = $A.getStorageString("cacheServerUrl") ajaxWsReady: false,
if (state.cacheServerUrl) { ajaxWsListener: [],
window.systemInfo.apiUrl = state.cacheServerUrl;
}
// Ajax // Websocket
state.ajaxWsReady = false; ws: null,
state.ajaxWsListener = []; wsMsg: {},
wsCall: {},
wsTimeout: null,
wsOpenNum: 0,
wsListener: {},
wsReadTimeout: null,
wsReadWaitList: [],
// Websocket // 会员信息
state.ws = null; userInfo: $A.getStorageJson("userInfo"),
state.wsMsg = {}; userId: state.userInfo.userid = $A.runNum(state.userInfo.userid),
state.wsCall = {}; userToken: state.userInfo.token,
state.wsTimeout = null; userIsAdmin: $A.inArray("admin", state.userInfo.identity),
state.wsOpenNum = 0; userOnline: {},
state.wsListener = {};
state.wsReadTimeout = null;
state.wsReadWaitList = [];
// 会员信息 // 会话聊天
state.userInfo = $A.getStorageJson("userInfo"); dialogMsgs: [],
state.userId = state.userInfo.userid = $A.runNum(state.userInfo.userid); dialogOpenId: 0,
state.userToken = state.userInfo.token;
state.userIsAdmin = $A.inArray("admin", state.userInfo.identity);
state.userOnline = {};
// 会话聊天 // 文件
state.dialogMsgs = []; files: [],
state.dialogOpenId = 0; fileContent: {},
// 文件 // 项目任务
state.files = []; projectId: 0,
state.fileContent = {}; projectTotal: 0,
projectLoad: 0,
taskId: 0,
taskCompleteTemps: [],
taskContents: [],
taskFiles: [],
taskLogs: [],
// 项目任务 // 任务等待状态
state.projectId = 0; taskLoading: [],
state.projectTotal = 0;
state.projectLoad = 0;
state.taskId = 0;
state.taskCompleteTemps = [];
state.taskContents = [];
state.taskFiles = [];
state.taskLogs = [];
// 任务等待状态 // 任务流程信息
state.taskLoading = []; taskFlows: [],
taskFlowItems: [],
// 任务流程信息 // 任务优先级
state.taskFlows = []; taskPriority: [],
state.taskFlowItems = [];
// 任务优先级 // 列表背景色
state.taskPriority = []; columnColorList: [
// 列表背景色
state.columnColorList = [
{name: '默认', color: ''}, {name: '默认', color: ''},
{name: '灰色', color: '#444444'}, {name: '灰色', color: '#444444'},
{name: '棕色', color: '#947364'}, {name: '棕色', color: '#947364'},
@ -94,10 +90,10 @@ state.columnColorList = [
{name: '紫色', color: '#b583e3'}, {name: '紫色', color: '#b583e3'},
{name: '粉色', color: '#ff819c'}, {name: '粉色', color: '#ff819c'},
{name: '红色', color: '#ff7070'}, {name: '红色', color: '#ff7070'},
]; ],
// 任务背景色 // 任务背景色
state.taskColorList = [ taskColorList: [
{name: '默认', color: ''}, {name: '默认', color: ''},
{name: '黄色', color: '#fffae6'}, {name: '黄色', color: '#fffae6'},
{name: '蓝色', color: '#e5f5ff'}, {name: '蓝色', color: '#e5f5ff'},
@ -105,16 +101,25 @@ state.taskColorList = [
{name: '粉色', color: '#ffeaee'}, {name: '粉色', color: '#ffeaee'},
{name: '紫色', color: '#f6ecff'}, {name: '紫色', color: '#f6ecff'},
{name: '灰色', color: '#f3f3f3'}, {name: '灰色', color: '#f3f3f3'},
]; ],
// 主题皮肤 // 主题皮肤
state.themeMode = $A.getStorageString("cacheThemeMode", "auto"); themeMode: $A.getStorageString("cacheThemeMode", "auto"),
state.themeList = [ themeList: [
{name: '跟随系统', value: 'auto'}, {name: '跟随系统', value: 'auto'},
{name: '明亮', value: 'light'}, {name: '明亮', value: 'light'},
{name: '暗黑', value: 'dark'}, {name: '暗黑', value: 'dark'},
]; ],
switch (state.themeMode) { themeIsDark: false,
};
// ServerUrl
if (stateData.cacheServerUrl) {
window.systemInfo.apiUrl = stateData.cacheServerUrl;
}
// 主题皮肤
switch (stateData.themeMode) {
case 'dark': case 'dark':
$A.dark.enableDarkMode() $A.dark.enableDarkMode()
break; break;
@ -125,6 +130,6 @@ switch (state.themeMode) {
$A.dark.autoDarkMode() $A.dark.autoDarkMode()
break; break;
} }
state.themeIsDark = $A.dark.isDarkEnabled(); stateData.themeIsDark = $A.dark.isDarkEnabled();
export default state export default stateData

View File

@ -1,4 +1,5 @@
@import "var"; @import "var";
@import "fileicon";
@import "element"; @import "element";
@import "fonts-ft"; @import "fonts-ft";
@import "taskfont"; @import "taskfont";

View File

@ -44,13 +44,19 @@
width: 40px; width: 40px;
height: 40px; height: 40px;
color: #dbdbde; color: #dbdbde;
&:hover {
color: #fff
}
.icon { .icon {
width: 24px; width: 24px;
height: 24px height: 24px
} }
> svg {
transition: all 0.3s;
}
&:hover {
color: #fff;
> svg {
transform: rotate(-90deg);
}
}
} }
} }

View File

@ -5,10 +5,6 @@ body.dark-mode-reverse {
color: #000; color: #000;
} }
.ivu-select-dropdown {
box-shadow: rgba(255, 255, 255, 0.2) 0 1px 6px;
}
.ivu-modal-mask { .ivu-modal-mask {
background-color: rgba(230, 230, 230, 0.6); background-color: rgba(230, 230, 230, 0.6);
} }
@ -22,6 +18,7 @@ body.dark-mode-reverse {
border: 1px solid #e3e8ed; border: 1px solid #e3e8ed;
} }
.ivu-select-dropdown,
.ivu-tooltip-inner, .ivu-tooltip-inner,
.ivu-poptip-inner { .ivu-poptip-inner {
border: 1px solid #e3e8ed; border: 1px solid #e3e8ed;
@ -41,11 +38,14 @@ body.dark-mode-reverse {
} }
.drawer-overlay { .drawer-overlay {
background: rgba(240, 240, 240, 0.76); background: rgba(230, 230, 230, 0.6);
.overlay-body { .overlay-body {
.overlay-close { .overlay-close {
> a { > a {
color: #323232; color: #323232;
&:hover {
color: #000;
}
} }
} }
} }
@ -156,6 +156,72 @@ body.dark-mode-reverse {
} }
} }
.file-icon {
&:before {
background-image: url("../images/file/dark/other.svg");
}
&.archive:before {
background-image: url("../images/file/dark/archive.svg");
}
&.cad:before {
background-image: url("../images/file/dark/cad.svg");
}
&.code:before {
background-image: url("../images/file/dark/code.svg");
}
&.document:before {
background-image: url("../images/file/dark/document.svg");
}
&.excel:before {
background-image: url("../images/file/dark/excel.svg");
}
&.flow:before {
background-image: url("../images/file/dark/flow.svg");
}
&.folder:before {
background-image: url("../images/file/dark/folder.svg");
}
&.media:before {
background-image: url("../images/file/dark/media.svg");
}
&.mind:before {
background-image: url("../images/file/dark/mind.svg");
}
&.ofd:before {
background-image: url("../images/file/dark/ofd.svg");
}
&.pdf:before {
background-image: url("../images/file/dark/pdf.svg");
}
&.picture:before {
background-image: url("../images/file/dark/picture.svg");
}
&.ppt:before {
background-image: url("../images/file/dark/ppt.svg");
}
&.sheet:before {
background-image: url("../images/file/dark/sheet.svg");
}
&.tif:before {
background-image: url("../images/file/dark/tif.svg");
}
&.txt:before {
background-image: url("../images/file/dark/txt.svg");
}
&.updir:before {
background-image: url("../images/file/dark/updir.svg");
}
&.upload:before {
background-image: url("../images/file/dark/upload.svg");
}
&.word:before {
background-image: url("../images/file/dark/word.svg");
}
&.wps:before {
background-image: url("../images/file/dark/wps.svg");
}
}
.page-login { .page-login {
.login-body { .login-body {
.login-box { .login-box {
@ -219,23 +285,4 @@ body.dark-mode-reverse {
} }
} }
} }
.page-file {
.file-wrapper {
.file-list {
> ul {
> li {
.file-icon {
.share-icon,
.share-avatar {
.taskfont {
color: #3a3a3a;
}
}
}
}
}
}
}
}
} }

68
resources/assets/sass/fileicon.scss vendored Normal file
View File

@ -0,0 +1,68 @@
.file-icon {
&:before {
content: "";
background-repeat: no-repeat;
background-size: contain;
background-image: url("../images/file/other.svg");
}
&.archive:before {
background-image: url("../images/file/archive.svg");
}
&.cad:before {
background-image: url("../images/file/cad.svg");
}
&.code:before {
background-image: url("../images/file/code.svg");
}
&.document:before {
background-image: url("../images/file/document.svg");
}
&.excel:before {
background-image: url("../images/file/excel.svg");
}
&.flow:before {
background-image: url("../images/file/flow.svg");
}
&.folder:before {
background-image: url("../images/file/folder.svg");
}
&.media:before {
background-image: url("../images/file/media.svg");
}
&.mind:before {
background-image: url("../images/file/mind.svg");
}
&.ofd:before {
background-image: url("../images/file/ofd.svg");
}
&.pdf:before {
background-image: url("../images/file/pdf.svg");
}
&.picture:before {
background-image: url("../images/file/picture.svg");
}
&.ppt:before {
background-image: url("../images/file/ppt.svg");
}
&.sheet:before {
background-image: url("../images/file/sheet.svg");
}
&.tif:before {
background-image: url("../images/file/tif.svg");
}
&.txt:before {
background-image: url("../images/file/txt.svg");
}
&.updir:before {
background-image: url("../images/file/updir.svg");
}
&.upload:before {
background-image: url("../images/file/upload.svg");
}
&.word:before {
background-image: url("../images/file/word.svg");
}
&.wps:before {
background-image: url("../images/file/wps.svg");
}
}

View File

@ -859,7 +859,7 @@
&.row-name { &.row-name {
padding-left: 56px; padding-left: 56px;
.item-title { .item-title {
color: #6C7D8C; color: #6b6e72;
} }
} }
&.row-column, &.row-column,

View File

@ -296,70 +296,7 @@
content: ""; content: "";
width: 22px; width: 22px;
height: 22px; height: 22px;
background-repeat: no-repeat;
background-size: contain;
margin-right: 8px; margin-right: 8px;
background-image: url("../images/file/other.svg");
}
&.archive:before {
background-image: url("../images/file/archive.svg");
}
&.cad:before {
background-image: url("../images/file/cad.svg");
}
&.code:before {
background-image: url("../images/file/code.svg");
}
&.document:before {
background-image: url("../images/file/document.svg");
}
&.excel:before {
background-image: url("../images/file/excel.svg");
}
&.flow:before {
background-image: url("../images/file/flow.svg");
}
&.folder:before {
background-image: url("../images/file/folder.svg");
}
&.media:before {
background-image: url("../images/file/media.svg");
}
&.mind:before {
background-image: url("../images/file/mind.svg");
}
&.ofd:before {
background-image: url("../images/file/ofd.svg");
}
&.pdf:before {
background-image: url("../images/file/pdf.svg");
}
&.picture:before {
background-image: url("../images/file/picture.svg");
}
&.ppt:before {
background-image: url("../images/file/ppt.svg");
}
&.sheet:before {
background-image: url("../images/file/sheet.svg");
}
&.tif:before {
background-image: url("../images/file/tif.svg");
}
&.txt:before {
background-image: url("../images/file/txt.svg");
}
&.updir:before {
background-image: url("../images/file/updir.svg");
}
&.upload:before {
background-image: url("../images/file/upload.svg");
}
&.word:before {
background-image: url("../images/file/word.svg");
}
&.wps:before {
background-image: url("../images/file/wps.svg");
} }
} }
.permission { .permission {
@ -448,11 +385,15 @@
display: inline-block; display: inline-block;
width: 64px; width: 64px;
height: 64px; height: 64px;
background-repeat: no-repeat;
background-size: contain;
margin-top: 12px; margin-top: 12px;
position: relative; position: relative;
background-image: url("../images/file/other.svg"); &:before {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.share-icon, .share-icon,
.share-avatar { .share-avatar {
position: absolute; position: absolute;
@ -476,66 +417,6 @@
&.shear { &.shear {
opacity: 0.38; opacity: 0.38;
} }
&.archive .file-icon {
background-image: url("../images/file/archive.svg");
}
&.cad .file-icon {
background-image: url("../images/file/cad.svg");
}
&.code .file-icon {
background-image: url("../images/file/code.svg");
}
&.document .file-icon {
background-image: url("../images/file/document.svg");
}
&.excel .file-icon {
background-image: url("../images/file/excel.svg");
}
&.flow .file-icon {
background-image: url("../images/file/flow.svg");
}
&.folder .file-icon {
background-image: url("../images/file/folder.svg");
}
&.media .file-icon {
background-image: url("../images/file/media.svg");
}
&.mind .file-icon {
background-image: url("../images/file/mind.svg");
}
&.ofd .file-icon {
background-image: url("../images/file/ofd.svg");
}
&.pdf .file-icon {
background-image: url("../images/file/pdf.svg");
}
&.picture .file-icon {
background-image: url("../images/file/picture.svg");
}
&.ppt .file-icon {
background-image: url("../images/file/ppt.svg");
}
&.sheet .file-icon {
background-image: url("../images/file/sheet.svg");
}
&.tif .file-icon {
background-image: url("../images/file/tif.svg");
}
&.txt .file-icon {
background-image: url("../images/file/txt.svg");
}
&.updir .file-icon {
background-image: url("../images/file/updir.svg");
}
&.upload .file-icon {
background-image: url("../images/file/upload.svg");
}
&.word .file-icon {
background-image: url("../images/file/word.svg");
}
&.wps .file-icon {
background-image: url("../images/file/wps.svg");
}
&.highlight { &.highlight {
background-color: #f4f5f7; background-color: #f4f5f7;
} }
@ -650,70 +531,7 @@
content: ""; content: "";
width: 20px; width: 20px;
height: 20px; height: 20px;
background-repeat: no-repeat;
background-size: contain;
margin-right: 8px; margin-right: 8px;
background-image: url("../images/file/other.svg");
}
&.archive:before {
background-image: url("../images/file/archive.svg");
}
&.cad:before {
background-image: url("../images/file/cad.svg");
}
&.code:before {
background-image: url("../images/file/code.svg");
}
&.document:before {
background-image: url("../images/file/document.svg");
}
&.excel:before {
background-image: url("../images/file/excel.svg");
}
&.flow:before {
background-image: url("../images/file/flow.svg");
}
&.folder:before {
background-image: url("../images/file/folder.svg");
}
&.media:before {
background-image: url("../images/file/media.svg");
}
&.mind:before {
background-image: url("../images/file/mind.svg");
}
&.ofd:before {
background-image: url("../images/file/ofd.svg");
}
&.pdf:before {
background-image: url("../images/file/pdf.svg");
}
&.picture:before {
background-image: url("../images/file/picture.svg");
}
&.ppt:before {
background-image: url("../images/file/ppt.svg");
}
&.sheet:before {
background-image: url("../images/file/sheet.svg");
}
&.tif:before {
background-image: url("../images/file/tif.svg");
}
&.txt:before {
background-image: url("../images/file/txt.svg");
}
&.updir:before {
background-image: url("../images/file/updir.svg");
}
&.upload:before {
background-image: url("../images/file/upload.svg");
}
&.word:before {
background-image: url("../images/file/word.svg");
}
&.wps:before {
background-image: url("../images/file/wps.svg");
} }
} }
} }

View File

@ -38,7 +38,7 @@
padding: 12px 0 0 32px; padding: 12px 0 0 32px;
> li { > li {
cursor: pointer; cursor: pointer;
color: #6C7D8C; color: #6b6e72;
list-style: none; list-style: none;
line-height: 42px; line-height: 42px;
padding: 0 20px; padding: 0 20px;