|
|
@@ -24,10 +24,19 @@ export default {
|
|
|
clickNodeList: Array
|
|
|
},
|
|
|
watch: {
|
|
|
- clickNodeList:{
|
|
|
- handler(newValue, old){
|
|
|
- console.log(newValue,old)
|
|
|
- this.init()
|
|
|
+ clickNodeList: {
|
|
|
+ handler(newValue, old) {
|
|
|
+ if (newValue) {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ treeData: {
|
|
|
+ handler(newValue, old) {
|
|
|
+ console.log(newValue)
|
|
|
+ if (newValue) {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -55,33 +64,125 @@ export default {
|
|
|
formatter: function(params) {
|
|
|
// 提示框浮层内容格式器,支持字符串模板和回调函数两种形式
|
|
|
// console.log('params:', params)
|
|
|
- return "<div style='display: flex;flex-direction: column;'>" +
|
|
|
- '<span>' +
|
|
|
- (that.type == 'placement' ? (params.data.TOP_NETWORK_DEEP - that.topDeep) : '') +
|
|
|
+ // return "<div style='display: flex;flex-direction: column;'>" +
|
|
|
+ // '<span>' +
|
|
|
+ // (that.type == 'placement' ? (params.data.TOP_NETWORK_DEEP - that.topDeep) : '') +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // params.data.USER_NAME +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // params.data.REAL_NAME +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // that.$t('atlas.location') +
|
|
|
+ // ': ' +
|
|
|
+ // (params.data.RELATIVE_LOCATION || '') +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // params.data.DEC_LV_NAME +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // that.$t('atlas.highest') +
|
|
|
+ // ': ' +
|
|
|
+ // params.data.EMP_LV_NAME + ',' + params.data.CROWN_LV_NAME +
|
|
|
+ // '</span>' +
|
|
|
+ // '<span>' +
|
|
|
+ // params.data.PERIOD_AT +
|
|
|
+ // '</span>' +
|
|
|
+ // '</div>'
|
|
|
+ const relationStr = "<div style='display: flex;flex-direction: column;'>" +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' + that.$t('atlas.numberLayers') + ': ' + '</span>' + '<span style="color: #000000;">' + (Number(params.data.TOP_NETWORK_DEEP) - Number(that.topDeep)) + '</span>' +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.memberCode') + ': ' +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
params.data.USER_NAME +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
+ '</div>' +
|
|
|
+
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.name') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
params.data.REAL_NAME +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
- that.$t('atlas.location') +
|
|
|
- ': ' +
|
|
|
- (params.data.RELATIVE_LOCATION || '') +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.level') + ': ' +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
params.data.DEC_LV_NAME +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
- that.$t('atlas.highest') +
|
|
|
- ': ' +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.highest') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
params.data.EMP_LV_NAME + ',' + params.data.CROWN_LV_NAME +
|
|
|
'</span>' +
|
|
|
- '<span>' +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.periodNumber') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
params.data.PERIOD_AT +
|
|
|
'</span>' +
|
|
|
+ '</div>' +
|
|
|
'</div>'
|
|
|
+ const networkStr = "<div style='display: flex;flex-direction: column;'>" +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.memberCode') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
+ params.data.USER_NAME +
|
|
|
+ '</span>' +
|
|
|
+ '</div>' +
|
|
|
+
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.name') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
+ params.data.REAL_NAME +
|
|
|
+ '</span>' +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.level') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
+ params.data.DEC_LV_NAME +
|
|
|
+ '</span>' +
|
|
|
+ '</div>' +
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.highest') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
+ params.data.EMP_LV_NAME + ',' + params.data.CROWN_LV_NAME +
|
|
|
+ '</span>' +
|
|
|
+ '</div>' +
|
|
|
+
|
|
|
+ '<div>' +
|
|
|
+ '<span style="color: #606266;">' +
|
|
|
+ that.$t('atlas.periodNumber') + ': ' +
|
|
|
+ '</span>' +
|
|
|
+ '<span style="color: #000000;">' +
|
|
|
+ params.data.PERIOD_AT +
|
|
|
+ '</span>' +
|
|
|
+ '</div>' +
|
|
|
+ '</div>'
|
|
|
+
|
|
|
+ return that.type === 'placement' ? relationStr : networkStr
|
|
|
},
|
|
|
// valueFormatter: function (value) { // tooltip 中数值显示部分的格式化回调函数
|
|
|
// return '$' + value.toFixed(2)
|
|
|
@@ -123,7 +224,7 @@ export default {
|
|
|
type: 'tree',
|
|
|
data: [this.treeData],
|
|
|
name: '树图',
|
|
|
- top: '10%', // 组件离容器上侧的距离,像素值20,或相对容器的百分比20%
|
|
|
+ top: '5%', // 组件离容器上侧的距离,像素值20,或相对容器的百分比20%
|
|
|
left: '5%', // 组件离容器左侧的距离
|
|
|
bottom: '1%', // 组件离容器下侧的距离
|
|
|
right: '2%', // 组件离容器右侧的距离
|
|
|
@@ -139,12 +240,12 @@ export default {
|
|
|
initialTreeDepth: -1, // 树图初始的展开层级(深度),根节点是0,不设置时全部展开
|
|
|
// symbol: 'emptyCircle', // 标记的图形,默认是emptyCircle;circle,rect,roundRect,triangle,diamond,pin,arrow,none
|
|
|
symbol: function(value, params) {
|
|
|
- // params.data节点的所有数据
|
|
|
- if (params.data.leaf == true) {
|
|
|
- return 'emptyCircle'
|
|
|
- } else if (params.data.leaf == false) {
|
|
|
- return 'circle'
|
|
|
- }
|
|
|
+ // params.data节点的所有数据
|
|
|
+ if (params.data.leaf == true) {
|
|
|
+ return 'emptyCircle'
|
|
|
+ } else if (params.data.leaf == false) {
|
|
|
+ return 'circle'
|
|
|
+ }
|
|
|
},
|
|
|
// symbolRotate: 270, // 配合arrow图形使用效果较好
|
|
|
symbolSize: 10, // 大于0时是圆圈,等于0时不展示,标记的大小
|