update 树样式
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 329 B |
@@ -444,3 +444,69 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*树节点样式*/
|
||||||
|
.ant-tree li .ant-tree-node-content-wrapper {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*展开收起按钮颜色*/
|
||||||
|
.ant-tree.ant-tree-show-line li span.ant-tree-switcher {
|
||||||
|
color: #86909c;
|
||||||
|
}
|
||||||
|
|
||||||
|
//子节点前面文件图标的颜色
|
||||||
|
.ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
|
||||||
|
color: #1D2129;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-tree-title {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件夹节点使用自定义
|
||||||
|
.tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 16px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
flex: 1;
|
||||||
|
width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-node-custom-title {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 鼠标移入树节点样式修改
|
||||||
|
.ant-tree li .ant-tree-node-content-wrapper:hover {
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0 0 4px 0 rgba(0,0,0,0.1);
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
opacity: 1;
|
||||||
|
margin-left: -24px;
|
||||||
|
padding-left: 29px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
const system = require('./system/en.js')
|
const system = require('./system/en.js')
|
||||||
const personalCenter = require('./personalCenter/en.js')
|
const personalCenter = require('./personalCenter/en.js')
|
||||||
|
const standardRegulationLibrary = require('./standardRegulationLibrary/en-us')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 共用
|
// 共用
|
||||||
@@ -486,5 +487,7 @@ module.exports = {
|
|||||||
// 系统管理
|
// 系统管理
|
||||||
system,
|
system,
|
||||||
// 个人中心
|
// 个人中心
|
||||||
personalCenter
|
personalCenter,
|
||||||
|
// 标准法规库
|
||||||
|
standardRegulationLibrary
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports = {
|
||||||
|
// 国内标准
|
||||||
|
domesticStandard: {
|
||||||
|
treeSearchPlaceholder: 'Please enter the tree system' // 请输入树状图体系
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports = {
|
||||||
|
// 国内标准
|
||||||
|
domesticStandard: {
|
||||||
|
treeSearchPlaceholder: '请输入树状图体系'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
const system = require('./system/zh.js')
|
const system = require('./system/zh.js')
|
||||||
const personalCenter = require('./personalCenter/zh.js')
|
const personalCenter = require('./personalCenter/zh.js')
|
||||||
|
const standardRegulationLibrary = require('./standardRegulationLibrary/zh-cn')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 共用
|
// 共用
|
||||||
@@ -496,5 +497,7 @@ module.exports = {
|
|||||||
// 系统管理
|
// 系统管理
|
||||||
system,
|
system,
|
||||||
// 个人中心
|
// 个人中心
|
||||||
personalCenter
|
personalCenter,
|
||||||
|
// 标准法规库
|
||||||
|
standardRegulationLibrary
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ export const ConfigurableTableMixin = {
|
|||||||
item.width = 215
|
item.width = 215
|
||||||
item.title = item.dbFieldTxt
|
item.title = item.dbFieldTxt
|
||||||
item.dataIndex = item.dbFieldName
|
item.dataIndex = item.dbFieldName
|
||||||
item.align = 'left'
|
|
||||||
tempColumns.push(item)
|
tempColumns.push(item)
|
||||||
})
|
})
|
||||||
if (this.showAction && this.operateColumn) {
|
if (this.showAction && this.operateColumn) {
|
||||||
|
|||||||
@@ -1,13 +1,155 @@
|
|||||||
<template>
|
<template>
|
||||||
<div></div>
|
<a-card :bordered="false" class="page-left-right-layout">
|
||||||
|
<div class="page-left-box">
|
||||||
|
<!-- $t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')-->
|
||||||
|
<a-input-search v-model="treeInput" :placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
|
||||||
|
@search="handleTableSearch" />
|
||||||
|
<img src="">
|
||||||
|
<a-tree :show-line="true" :show-icon="true" :tree-data=treeData>
|
||||||
|
<template #iconCustom="{title}">
|
||||||
|
<div class="tree-node">
|
||||||
|
<img src="@/assets/image/common/iconTreeFolder.png" class="tree-node-icon" />
|
||||||
|
<a-tooltip>
|
||||||
|
<template #title>
|
||||||
|
{{ title }}
|
||||||
|
</template>
|
||||||
|
<span class="tree-node-title">{{ title }}</span>
|
||||||
|
</a-tooltip>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #custom="{title, key}">
|
||||||
|
<div class="tree-operate-node" @mouseenter="handleTreeMouseover(key)" @mouseleave="handleTreeMouseout(key)">
|
||||||
|
<a-tooltip>
|
||||||
|
<template #title>
|
||||||
|
{{ title }}
|
||||||
|
</template>
|
||||||
|
<span class="tree-node-custom-title">{{ title }}</span>
|
||||||
|
</a-tooltip>
|
||||||
|
<template v-if="key === mouseInNodeKey">
|
||||||
|
<a-button icon="plus" class="tree-operate-node-btn">
|
||||||
|
</a-button>
|
||||||
|
<a-button class="tree-operate-node-btn">
|
||||||
|
<img src="@/assets/image/common/iconTreeEdit.png" />
|
||||||
|
</a-button>
|
||||||
|
<a-button class="tree-operate-node-btn">
|
||||||
|
<img src="@/assets/image/common/iconTreeDelete.png" />
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-tree>
|
||||||
|
</div>
|
||||||
|
<div class="page-right-box"></div>
|
||||||
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import '@assets/less/common.less'
|
||||||
|
|
||||||
|
const apiTreeData = [
|
||||||
|
{
|
||||||
|
title: 'parent 1',
|
||||||
|
key: '0-0',
|
||||||
|
child: [
|
||||||
|
{
|
||||||
|
title: '张晨成',
|
||||||
|
key: '0-0-0',
|
||||||
|
disabled: true,
|
||||||
|
child: [
|
||||||
|
{ title: 'leaf', key: '0-0-0-0' },
|
||||||
|
{ title: 'leaf', key: '0-0-0-1' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'parent 1-1',
|
||||||
|
key: '0-0-1',
|
||||||
|
child: [{ key: '0-0-1-0', title: 'zcvc' }]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DomesticStandardList'
|
name: 'DomesticStandardList',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
treeInput: null, // 树查询绑定值
|
||||||
|
treeData: [],
|
||||||
|
mouseInNodeKey: null // 鼠标悬浮的节点key值
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.initTreeData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initTreeData () {
|
||||||
|
this.treeData = this.dealTreeData(apiTreeData)
|
||||||
|
console.log(this.treeData)
|
||||||
|
},
|
||||||
|
dealTreeData (treeData) {
|
||||||
|
return treeData.map(item => {
|
||||||
|
if (item.child && item.child.length > 0) {
|
||||||
|
item.scopedSlots = { title: 'iconCustom' }
|
||||||
|
item.children = this.dealTreeData(item.child)
|
||||||
|
} else {
|
||||||
|
item.scopedSlots = { title: 'custom' }
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleTableSearch () {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleTreeMouseover (key) {
|
||||||
|
this.mouseInNodeKey = key
|
||||||
|
},
|
||||||
|
handleTreeMouseout (key) {
|
||||||
|
if (this.mouseInNodeKey === key) {
|
||||||
|
this.mouseInNodeKey = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="less">
|
||||||
|
/deeo/ .ant-tree li span.ant-tree-iconEle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-icon {
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-operate-node {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&-btn {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
background: rgba(213, 44, 38, 0.08);
|
||||||
|
border-radius: 2px 2px 2px 2px;
|
||||||
|
border: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 4px;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
/deep/ .anticon {
|
||||||
|
margin-top: 2px;
|
||||||
|
color: #D52C26;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 13px;
|
||||||
|
height: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user