NEZ-1868 style:修改starred布局样式
This commit is contained in:
@@ -135,7 +135,7 @@
|
|||||||
}
|
}
|
||||||
.show-panel-name{
|
.show-panel-name{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0 7px;
|
padding: 0 5px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
max-width: 310px;
|
max-width: 310px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
@@ -144,3 +144,9 @@
|
|||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
color: $--color-text-primary;
|
color: $--color-text-primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.starred-pop{
|
||||||
|
padding: 8px 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
min-width: auto;
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
class="starred-tree"
|
class="starred-tree"
|
||||||
>
|
>
|
||||||
<div class="tree--node" slot-scope="{ node, data }">
|
<div class="tree--node" slot-scope="{ node, data }">
|
||||||
<span :title="data.chartNum?node.label + ' (' + data.chartNum +' charts)':''">{{ node.label }}</span>
|
<span :title="data.id?node.label + ' (' + data.chartNum +' charts)':''" :class="{'select-panel-title':data.id===0}">{{ node.label }}</span>
|
||||||
<el-row class="block-col-2" style="margin-left:10px">
|
<el-row class="block-col-2" style="margin-left:10px">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<template v-if="node.label!=='Starred'">
|
<template v-if="data.id">
|
||||||
<i v-if="data.starred" class="el-rate__icon el-icon-star-on" @click.stop="delStarred(data)"></i>
|
<i v-if="data.starred" class="el-rate__icon el-icon-star-on" @click.stop="delStarred(data)"></i>
|
||||||
<i v-else class="el-rate__icon el-icon-star-off" @click.stop="addStarred(data)"></i>
|
<i v-else class="el-rate__icon el-icon-star-off" @click.stop="addStarred(data)"></i>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
<el-tree
|
<el-tree
|
||||||
:data="panelData"
|
:data="treeData"
|
||||||
:draggable="!panelLock"
|
:draggable="!panelLock"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
node-key="id"
|
node-key="id"
|
||||||
ref="panelTree">
|
ref="panelTree">
|
||||||
<div class="tree--node" slot-scope="{ node, data }">
|
<div class="tree--node" slot-scope="{ node, data }">
|
||||||
<span :title="node.label + ' (' + data.chartNum +' charts)' ">{{ node.label }}</span>
|
<span :title="data.id?node.label + ' (' + data.chartNum +' charts)':''" :class="{'select-panel-title':data.id===0}">{{ node.label }}</span>
|
||||||
<el-row class="block-col-2" style="margin-left:10px">
|
<el-row class="block-col-2" style="margin-left:10px">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
||||||
@@ -69,8 +69,10 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
<template v-if="data.id">
|
||||||
<i v-if="data.starred" class="el-rate__icon el-icon-star-on" @click.stop="delStarred(data)"></i>
|
<i v-if="data.starred" class="el-rate__icon el-icon-star-on" @click.stop="delStarred(data)"></i>
|
||||||
<i v-else class="el-rate__icon el-icon-star-off" @click.stop="addStarred(data)"></i>
|
<i v-else class="el-rate__icon el-icon-star-off" @click.stop="addStarred(data)"></i>
|
||||||
|
</template>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -119,6 +121,14 @@ export default {
|
|||||||
this.panel = JSON.parse(JSON.stringify(n))
|
this.panel = JSON.parse(JSON.stringify(n))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
panelData: {
|
||||||
|
immediate: true,
|
||||||
|
handler (n) {
|
||||||
|
if (n) {
|
||||||
|
this.treeData[0].children = n
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* panel: {
|
/* panel: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -134,9 +144,19 @@ export default {
|
|||||||
return {
|
return {
|
||||||
popBox: { show: false },
|
popBox: { show: false },
|
||||||
panel: { id: 0, name: '' },
|
panel: { id: 0, name: '' },
|
||||||
|
// 全部列表
|
||||||
|
treeData: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
name: 'All Panels',
|
||||||
|
children: []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 收藏夹列表
|
||||||
starredData: [
|
starredData: [
|
||||||
{
|
{
|
||||||
name: 'Starred',
|
id: 0,
|
||||||
|
name: 'Starred Panels',
|
||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -263,7 +283,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 确认选择某个节点,与父组件交互
|
// 确认选择某个节点,与父组件交互
|
||||||
selectPanel (data, checked, child) {
|
selectPanel (data, checked, child) {
|
||||||
if (data.name === 'Starred') {
|
// 判断是否点击的Starred Panels或All Panels
|
||||||
|
if (!data.id) {
|
||||||
|
this.$refs.panelTree.setCurrentKey(this.showPanel)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.$emit('selectPanel', data)
|
this.$emit('selectPanel', data)
|
||||||
@@ -277,12 +299,18 @@ export default {
|
|||||||
.starred-tree>>>.el-tree__empty-block{
|
.starred-tree>>>.el-tree__empty-block{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.select-panel-title{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
.el-rate__icon{
|
.el-rate__icon{
|
||||||
|
color: #C0C4CC !important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
}
|
}
|
||||||
.el-icon-star-on{
|
.el-icon-star-on{
|
||||||
color:#FF9219;
|
color:#FF9219 !important;
|
||||||
transform: scale(1.2);
|
transform: scale(1.2);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -24,9 +24,17 @@
|
|||||||
<template v-slot:trigger>
|
<template v-slot:trigger>
|
||||||
<i style="color: #BEBEBE" class="el-icon-menu"></i>
|
<i style="color: #BEBEBE" class="el-icon-menu"></i>
|
||||||
<span :title="showPanel.name + ' (' + showPanel.chartNum +' charts)' " class="show-panel-name">{{showPanel.name}}</span>
|
<span :title="showPanel.name + ' (' + showPanel.chartNum +' charts)' " class="show-panel-name">{{showPanel.name}}</span>
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
trigger="hover"
|
||||||
|
:content="$t('tip.addFavorites')"
|
||||||
|
popper-class="starred-pop"
|
||||||
|
>
|
||||||
|
<span slot="reference">
|
||||||
<i @click.stop="delStarred(showPanel)" v-if="showPanel.starred" class="el-rate__icon el-icon-star-on"></i>
|
<i @click.stop="delStarred(showPanel)" v-if="showPanel.starred" class="el-rate__icon el-icon-star-on"></i>
|
||||||
<i @click.stop="addStarred(showPanel)" v-else class="el-rate__icon el-icon-star-off"></i>
|
<i @click.stop="addStarred(showPanel)" v-else class="el-rate__icon el-icon-star-off"></i>
|
||||||
<i style="font-size: 12px;color: #BEBEBE;" class="nz-icon nz-icon-arrow-down"></i>
|
</span>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:tail>
|
<template v-slot:tail>
|
||||||
<div class="panel-select-tail">
|
<div class="panel-select-tail">
|
||||||
@@ -1059,12 +1067,13 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-rate__icon{
|
.el-rate__icon{
|
||||||
|
color: #C0C4CC !important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
transform: translateY(1px);
|
transform: translateY(1px);
|
||||||
}
|
}
|
||||||
.el-icon-star-on{
|
.el-icon-star-on{
|
||||||
color:#FF9219;
|
color:#FF9219 !important;
|
||||||
transform: translateY(1px) scale(1.2);
|
transform: translateY(1px) scale(1.2);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user