修改代码格式

This commit is contained in:
FairyEver 2019-12-19 08:48:48 +08:00
parent 35f4ac5021
commit 7092dd54ad
9 changed files with 36 additions and 145 deletions

View File

@ -1,19 +1,8 @@
<template>
<div
class="d2-contentmenu-list"
@click="rowClick">
<div
v-for="item in menulist"
:key="item.value"
:data-value="item.value"
class="d2-contentmenu-item"
flex="cross:center main:center">
<d2-icon
v-if="item.icon"
:name="item.icon"/>
<div
class="d2-contentmenu-item-title"
flex-box="1">
<div class="d2-contentmenu-list" @click="rowClick">
<div v-for="item in menulist" :key="item.value" :data-value="item.value" class="d2-contentmenu-item" flex="cross:center main:center">
<d2-icon v-if="item.icon" :name="item.icon"/>
<div class="d2-contentmenu-item-title" flex-box="1">
{{item.title}}
</div>
</div>

View File

@ -1,8 +1,5 @@
<template>
<div
class="d2-contextmenu"
v-show="flag"
:style="style">
<div class="d2-contextmenu" v-show="flag" :style="style">
<slot/>
</div>
</template>

View File

@ -1,8 +1,5 @@
<template>
<el-tooltip
effect="dark"
:content="active ? '退出全屏' : '全屏'"
placement="bottom">
<el-tooltip effect="dark" :content="active ? '退出全屏' : '全屏'" placement="bottom">
<el-button class="d2-mr btn-text can-hover" type="text" @click="toggle">
<d2-icon v-if="active" name="compress"/>
<d2-icon v-else name="arrows-alt" style="font-size: 16px"/>

View File

@ -1,8 +1,5 @@
<template>
<el-dropdown
placement="bottom"
size="small"
@command="onChangeLocale">
<el-dropdown placement="bottom" size="small" @command="onChangeLocale">
<el-button class="d2-mr btn-text can-hover" type="text">
<d2-icon name="language" style="font-size: 16px;"/>
</el-button>

View File

@ -1,25 +1,10 @@
<template>
<el-tooltip
effect="dark"
:content="tooltipContent"
placement="bottom">
<el-button
class="d2-ml-0 d2-mr btn-text can-hover"
type="text"
@click="handleClick">
<el-badge
v-if="logLength > 0"
:max="99"
:value="logLengthError"
:is-dot="logLengthError === 0">
<d2-icon
:name="logLengthError === 0 ? 'dot-circle-o' : 'bug'"
style="font-size: 20px"/>
<el-tooltip effect="dark" :content="tooltipContent" placement="bottom">
<el-button class="d2-ml-0 d2-mr btn-text can-hover" type="text" @click="handleClick">
<el-badge v-if="logLength > 0" :max="99" :value="logLengthError" :is-dot="logLengthError === 0">
<d2-icon :name="logLengthError === 0 ? 'dot-circle-o' : 'bug'" style="font-size: 20px"/>
</el-badge>
<d2-icon
v-else
name="dot-circle-o"
style="font-size: 20px"/>
<d2-icon v-else name="dot-circle-o" style="font-size: 20px"/>
</el-button>
</el-tooltip>
</template>

View File

@ -1,39 +1,13 @@
<template>
<el-table
:data="list"
v-bind="table">
<el-table-column
prop="title"
align="center"
width="160"/>
<el-table-column
label="预览"
width="120">
<div
slot-scope="scope"
class="theme-preview"
:style="{
backgroundImage: `url(${$baseUrl}${scope.row.preview})`
}">
</div>
<el-table :data="list" v-bind="table">
<el-table-column prop="title" align="center" width="160"/>
<el-table-column label="预览" width="120">
<div slot-scope="scope" class="theme-preview" :style="{ backgroundImage: `url(${$baseUrl}${scope.row.preview})` }"/>
</el-table-column>
<el-table-column
prop="address"
align="center">
<el-table-column prop="address" align="center">
<template slot-scope="scope">
<el-button
v-if="activeName === scope.row.name"
type="success"
icon="el-icon-check"
round>
已激活
</el-button>
<el-button
v-else
round
@click="handleSelectTheme(scope.row.name)">
使用
</el-button>
<el-button v-if="activeName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button>
</template>
</el-table-column>
</el-table>

View File

@ -1,15 +1,7 @@
<template>
<div
class="panel-search"
flex="dir:top">
<div
class="panel-search__input-group"
flex-box="0"
flex="dir:top main:center cross:center"
@click.self="handlePanelClick">
<d2-icon-svg
class="panel-search__logo"
name="d2-admin-text"/>
<div class="panel-search" flex="dir:top">
<div class="panel-search__input-group" flex-box="0" flex="dir:top main:center cross:center" @click.self="handlePanelClick">
<d2-icon-svg class="panel-search__logo" name="d2-admin-text"/>
<el-autocomplete
class="panel-search__input"
ref="input"
@ -21,9 +13,7 @@
:clearable="true"
@keydown.esc.native="handleEsc"
@select="handleSelect">
<d2-panel-search-item
slot-scope="{ item }"
:item="item"/>
<d2-panel-search-item slot-scope="{ item }" :item="item"/>
</el-autocomplete>
<div class="panel-search__tip">
您可以使用快捷键
@ -33,10 +23,7 @@
关闭
</div>
</div>
<div
v-if="resultsList.length > 0"
class="panel-search__results-group"
flex-box="1">
<div v-if="resultsList.length > 0" class="panel-search__results-group" flex-box="1">
<el-card>
<div class="panel-search__results-group-inner">
<d2-panel-search-item

View File

@ -2,13 +2,8 @@
<div class="d2-multiple-page-control-group" flex>
<div class="d2-multiple-page-control-content" flex-box="1">
<div class="d2-multiple-page-control-content-inner">
<d2-contextmenu
:visible.sync="contextmenuFlag"
:x="contentmenuX"
:y="contentmenuY">
<d2-contextmenu-list
:menulist="tagName === '/index' ? contextmenuListIndex : contextmenuList"
@rowClick="contextmenuClick"/>
<d2-contextmenu :visible.sync="contextmenuFlag" :x="contentmenuX" :y="contentmenuY">
<d2-contextmenu-list :menulist="tagName === '/index' ? contextmenuListIndex : contextmenuList" @rowClick="contextmenuClick"/>
</d2-contextmenu>
<el-tabs
class="d2-multiple-page-control d2-multiple-page-sort"
@ -18,22 +13,12 @@
@tab-click="handleClick"
@edit="handleTabsEdit"
@contextmenu.native="handleContextmenu">
<el-tab-pane
v-for="page in opened"
:key="page.fullPath"
:label="page.meta.title || '未命名'"
:name="page.fullPath"/>
<el-tab-pane v-for="page in opened" :key="page.fullPath" :label="page.meta.title || '未命名'" :name="page.fullPath"/>
</el-tabs>
</div>
</div>
<div
class="d2-multiple-page-control-btn"
flex-box="0">
<el-dropdown
size="default"
split-button
@click="closeAll"
@command="command => handleControlItemClick(command)">
<div class="d2-multiple-page-control-btn" flex-box="0">
<el-dropdown size="default" split-button @click="closeAll" @command="command => handleControlItemClick(command)">
<d2-icon name="times-circle"/>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="left">

View File

@ -1,20 +1,11 @@
<template>
<div
class="d2-layout-header-aside-group"
:style="styleLayoutMainGroup"
:class="{grayMode: grayActive}">
<div class="d2-layout-header-aside-group" :style="styleLayoutMainGroup" :class="{grayMode: grayActive}">
<!-- 半透明遮罩 -->
<div class="d2-layout-header-aside-mask"></div>
<!-- 主体内容 -->
<div class="d2-layout-header-aside-content" flex="dir:top">
<!-- 顶栏 -->
<div
class="d2-theme-header"
:style="{
opacity: this.searchActive ? 0.5 : 1
}"
flex-box="0"
flex>
<div class="d2-theme-header" :style="{ opacity: this.searchActive ? 0.5 : 1 }" flex-box="0" flex>
<router-link to="/index" class="logo-group" :style="{width: asideCollapse ? asideWidthCollapse : asideWidth}" flex-box="0">
<img v-if="asideCollapse" :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
<img v-else :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/all.png`">
@ -39,14 +30,7 @@
<!-- 下面 主体 -->
<div class="d2-theme-container" flex-box="1" flex>
<!-- 主体 侧边栏 -->
<div
flex-box="0"
ref="aside"
class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1
}">
<div flex-box="0" ref="aside" class="d2-theme-container-aside" :style="{ width: asideCollapse ? asideWidthCollapse : asideWidth, opacity: this.searchActive ? 0.5 : 1 }">
<d2-menu-side/>
</div>
<!-- 主体 -->
@ -54,9 +38,7 @@
<!-- 搜索 -->
<transition name="fade-scale">
<div v-if="searchActive" class="d2-theme-container-main-layer" flex>
<d2-panel-search
ref="panelSearch"
@close="searchPanelClose"/>
<d2-panel-search ref="panelSearch" @close="searchPanelClose"/>
</div>
</transition>
<!-- 内容 -->
@ -136,11 +118,9 @@ export default {
* @description 最外层容器的背景图片样式
*/
styleLayoutMainGroup () {
return {
...this.themeActiveSetting.backgroundImage ? {
backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
} : {}
}
return this.themeActiveSetting.backgroundImage
? { backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')` }
: {}
}
},
methods: {