diff --git a/src/components/Echart/PieChart.vue b/src/components/Echart/PieChart.vue index 95a44cc..6855601 100644 --- a/src/components/Echart/PieChart.vue +++ b/src/components/Echart/PieChart.vue @@ -153,7 +153,12 @@ */ hoverFormatter: { type: String, - default: '{b}
数量:{c}
占比:{d}%', + default: '', + }, + // 总计 + count: { + type: Number, + default: 0, }, }) @@ -190,17 +195,36 @@ // 标题 if (props.title) { option.title = { - show: false, - text: props.title, - textStyle: { - color: props.fontColor, - fontWeight: 'normal', - fontSize: 16, - }, - top: 0, - left: '35%', - textAlign: 'cenetr', + show: !!props.title, + // text: props.title, + // textStyle: { + // color: props.fontColor, + // fontWeight: 'normal', + // fontSize: 16, + // }, + // top: 0, + // left: '35%', + // textAlign: 'cenetr', // right: 'middle', + // text: `{name|${total}}\n{val| (处)}`, + text: `{name|总计}\n{val| ${props.data.reduce((pre, target) => pre + Number(target.value), 0)}}`, + top: 'center', + left: 'center', + textStyle: { + rich: { + name: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + padding: [10, 0], + }, + val: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + }, + }, + }, } } // 标题 @@ -219,10 +243,12 @@ startAngle: 140, right: props.right, label: { + // avoidLabelOverlap: true, show: props.labelShow, - position: props.labelPosition, - formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n{style2|{d}%}' : '{style1|{b}}\n{style2|{c}}'), - fontSize: 20, + // position: props.labelPosition, + // formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n\n{style2|{d}%}' : '{style1|{b}}\n\n{style2|{c}}'), + // formatter + fontSize: 14, fontWeight: 'bold', rich: { style1: { @@ -243,6 +269,14 @@ }, }, }, + labelLine: { + normal: { + show: true, + length: 25, + length2: 15, + smooth: true, + }, + }, data: props.data, } option.series = [series] diff --git a/src/components/Echart/PieChart.vue b/src/components/Echart/PieChart.vue index 95a44cc..6855601 100644 --- a/src/components/Echart/PieChart.vue +++ b/src/components/Echart/PieChart.vue @@ -153,7 +153,12 @@ */ hoverFormatter: { type: String, - default: '{b}
数量:{c}
占比:{d}%', + default: '', + }, + // 总计 + count: { + type: Number, + default: 0, }, }) @@ -190,17 +195,36 @@ // 标题 if (props.title) { option.title = { - show: false, - text: props.title, - textStyle: { - color: props.fontColor, - fontWeight: 'normal', - fontSize: 16, - }, - top: 0, - left: '35%', - textAlign: 'cenetr', + show: !!props.title, + // text: props.title, + // textStyle: { + // color: props.fontColor, + // fontWeight: 'normal', + // fontSize: 16, + // }, + // top: 0, + // left: '35%', + // textAlign: 'cenetr', // right: 'middle', + // text: `{name|${total}}\n{val| (处)}`, + text: `{name|总计}\n{val| ${props.data.reduce((pre, target) => pre + Number(target.value), 0)}}`, + top: 'center', + left: 'center', + textStyle: { + rich: { + name: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + padding: [10, 0], + }, + val: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + }, + }, + }, } } // 标题 @@ -219,10 +243,12 @@ startAngle: 140, right: props.right, label: { + // avoidLabelOverlap: true, show: props.labelShow, - position: props.labelPosition, - formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n{style2|{d}%}' : '{style1|{b}}\n{style2|{c}}'), - fontSize: 20, + // position: props.labelPosition, + // formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n\n{style2|{d}%}' : '{style1|{b}}\n\n{style2|{c}}'), + // formatter + fontSize: 14, fontWeight: 'bold', rich: { style1: { @@ -243,6 +269,14 @@ }, }, }, + labelLine: { + normal: { + show: true, + length: 25, + length2: 15, + smooth: true, + }, + }, data: props.data, } option.series = [series] diff --git a/src/router/modules/common.ts b/src/router/modules/common.ts index 7957fe2..20d7428 100644 --- a/src/router/modules/common.ts +++ b/src/router/modules/common.ts @@ -28,31 +28,31 @@ }, ], }, - { - path: '/resource', - component: Layout, - redirect: '/resource/list', - name: 'ResourceManage', - meta: { - title: '资源管理', - icon: 'ep:key', - auth: '/sys/resource', - }, - children: [ - { - path: 'list', - name: 'ResourceList', - component: () => import('@/views/system/resource/listResource.vue'), - meta: { - title: '资源管理', - auth: '/sys/resource', - sidebar: false, - breadcrumb: false, - activeMenu: '/resource', - }, - }, - ], - }, + // { + // path: '/resource', + // component: Layout, + // redirect: '/resource/list', + // name: 'ResourceManage', + // meta: { + // title: '资源管理', + // icon: 'ep:key', + // auth: '/sys/resource', + // }, + // children: [ + // { + // path: 'list', + // name: 'ResourceList', + // component: () => import('@/views/system/resource/listResource.vue'), + // meta: { + // title: '资源管理', + // auth: '/sys/resource', + // sidebar: false, + // breadcrumb: false, + // activeMenu: '/resource', + // }, + // }, + // ], + // }, { path: '/dept', component: Layout, diff --git a/src/components/Echart/PieChart.vue b/src/components/Echart/PieChart.vue index 95a44cc..6855601 100644 --- a/src/components/Echart/PieChart.vue +++ b/src/components/Echart/PieChart.vue @@ -153,7 +153,12 @@ */ hoverFormatter: { type: String, - default: '{b}
数量:{c}
占比:{d}%', + default: '', + }, + // 总计 + count: { + type: Number, + default: 0, }, }) @@ -190,17 +195,36 @@ // 标题 if (props.title) { option.title = { - show: false, - text: props.title, - textStyle: { - color: props.fontColor, - fontWeight: 'normal', - fontSize: 16, - }, - top: 0, - left: '35%', - textAlign: 'cenetr', + show: !!props.title, + // text: props.title, + // textStyle: { + // color: props.fontColor, + // fontWeight: 'normal', + // fontSize: 16, + // }, + // top: 0, + // left: '35%', + // textAlign: 'cenetr', // right: 'middle', + // text: `{name|${total}}\n{val| (处)}`, + text: `{name|总计}\n{val| ${props.data.reduce((pre, target) => pre + Number(target.value), 0)}}`, + top: 'center', + left: 'center', + textStyle: { + rich: { + name: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + padding: [10, 0], + }, + val: { + fontSize: 16, + fontWeight: 'bold', + color: '#000', + }, + }, + }, } } // 标题 @@ -219,10 +243,12 @@ startAngle: 140, right: props.right, label: { + // avoidLabelOverlap: true, show: props.labelShow, - position: props.labelPosition, - formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n{style2|{d}%}' : '{style1|{b}}\n{style2|{c}}'), - fontSize: 20, + // position: props.labelPosition, + // formatter: props.labelFormatter ? props.labelFormatter : (props.valueType == 'percentage' ? '{style1|{b}}\n\n{style2|{d}%}' : '{style1|{b}}\n\n{style2|{c}}'), + // formatter + fontSize: 14, fontWeight: 'bold', rich: { style1: { @@ -243,6 +269,14 @@ }, }, }, + labelLine: { + normal: { + show: true, + length: 25, + length2: 15, + smooth: true, + }, + }, data: props.data, } option.series = [series] diff --git a/src/router/modules/common.ts b/src/router/modules/common.ts index 7957fe2..20d7428 100644 --- a/src/router/modules/common.ts +++ b/src/router/modules/common.ts @@ -28,31 +28,31 @@ }, ], }, - { - path: '/resource', - component: Layout, - redirect: '/resource/list', - name: 'ResourceManage', - meta: { - title: '资源管理', - icon: 'ep:key', - auth: '/sys/resource', - }, - children: [ - { - path: 'list', - name: 'ResourceList', - component: () => import('@/views/system/resource/listResource.vue'), - meta: { - title: '资源管理', - auth: '/sys/resource', - sidebar: false, - breadcrumb: false, - activeMenu: '/resource', - }, - }, - ], - }, + // { + // path: '/resource', + // component: Layout, + // redirect: '/resource/list', + // name: 'ResourceManage', + // meta: { + // title: '资源管理', + // icon: 'ep:key', + // auth: '/sys/resource', + // }, + // children: [ + // { + // path: 'list', + // name: 'ResourceList', + // component: () => import('@/views/system/resource/listResource.vue'), + // meta: { + // title: '资源管理', + // auth: '/sys/resource', + // sidebar: false, + // breadcrumb: false, + // activeMenu: '/resource', + // }, + // }, + // ], + // }, { path: '/dept', component: Layout, diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 64bef89..11a218d 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -195,7 +195,7 @@