|  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: "organnumchart", | 
|---|
|  |  |  | components: { | 
|---|
|  |  |  | Echart, | 
|---|
|  |  |  | Echart | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: { | 
|---|
|  |  |  | id: { | 
|---|
|  |  |  | type: String, | 
|---|
|  |  |  | default: "organnumcgart", | 
|---|
|  |  |  | default: "organnumcgart" | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | width: { | 
|---|
|  |  |  | type: String, | 
|---|
|  |  |  | default: "100%", | 
|---|
|  |  |  | default: "100%" | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | height: { | 
|---|
|  |  |  | type: String, | 
|---|
|  |  |  | default: "600px", | 
|---|
|  |  |  | default: "600px" | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cdata: { | 
|---|
|  |  |  | type: Array, | 
|---|
|  |  |  | default: () => [], | 
|---|
|  |  |  | default: () => [] | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | CommonOrgan: { | 
|---|
|  |  |  | type: Object | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | options: {}, | 
|---|
|  |  |  | options: {} | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created() {}, | 
|---|
|  |  |  | 
|---|
|  |  |  | resetOption(newData) { | 
|---|
|  |  |  | let organNameArr = []; | 
|---|
|  |  |  | let organeNumArr = []; | 
|---|
|  |  |  | let organeNumArrabandonCount = []; | 
|---|
|  |  |  | for (let i = 0; i < newData.length; i++) { | 
|---|
|  |  |  | organNameArr.push(newData[i].name); | 
|---|
|  |  |  | organeNumArr.push(newData[i].value); | 
|---|
|  |  |  | organeNumArrabandonCount.push(newData[i].value1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.options = { | 
|---|
|  |  |  | title: { | 
|---|
|  |  |  | text: "获取器官和组织的数量", | 
|---|
|  |  |  | text: | 
|---|
|  |  |  | "获取器官和组织的数量" + | 
|---|
|  |  |  | "(获取量:" + | 
|---|
|  |  |  | this.CommonOrgan.countSum + | 
|---|
|  |  |  | ";弃用量:" + | 
|---|
|  |  |  | this.CommonOrgan.abandonCountSum + | 
|---|
|  |  |  | ")", | 
|---|
|  |  |  | left: "center", | 
|---|
|  |  |  | top: "5%", | 
|---|
|  |  |  | textStyle: { | 
|---|
|  |  |  | color: "#566f94", | 
|---|
|  |  |  | fontSize: 16 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | tooltip: { | 
|---|
|  |  |  | trigger: "axis", | 
|---|
|  |  |  | axisPointer: { | 
|---|
|  |  |  | type: "shadow", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | type: "shadow" | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | grid: { | 
|---|
|  |  |  | top: "12%", | 
|---|
|  |  |  | left: "0", | 
|---|
|  |  |  | right: "0", | 
|---|
|  |  |  | bottom: "5%", | 
|---|
|  |  |  | containLabel: true, | 
|---|
|  |  |  | containLabel: true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | xAxis: { | 
|---|
|  |  |  | type: "category", | 
|---|
|  |  |  | data: organNameArr, | 
|---|
|  |  |  | axisLine: { | 
|---|
|  |  |  | show: false, | 
|---|
|  |  |  | show: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | axisLabel: { | 
|---|
|  |  |  | textStyle: { | 
|---|
|  |  |  | color: "#566f94", //更改坐标轴文字颜色 | 
|---|
|  |  |  | fontSize: 12, //更改坐标轴文字大小 | 
|---|
|  |  |  | fontSize: 12 //更改坐标轴文字大小 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | interval: 0, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | interval: 0 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | yAxis: { | 
|---|
|  |  |  | type: "value", | 
|---|
|  |  |  | // boundaryGap: [0, 0.01], | 
|---|
|  |  |  | show: false, | 
|---|
|  |  |  | show: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | series: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | name: "器官数量", | 
|---|
|  |  |  | name: "获取数量", | 
|---|
|  |  |  | type: "bar", | 
|---|
|  |  |  | //barWidth: 20, //柱图宽度 | 
|---|
|  |  |  | itemStyle: { | 
|---|
|  |  |  | 
|---|
|  |  |  | textStyle: { | 
|---|
|  |  |  | //数值样式 | 
|---|
|  |  |  | color: "#566f94", | 
|---|
|  |  |  | fontSize: 14, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | fontSize: 14 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data: organeNumArr, | 
|---|
|  |  |  | data: organeNumArr | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | { | 
|---|
|  |  |  | name: "弃用数量", | 
|---|
|  |  |  | type: "bar", | 
|---|
|  |  |  | //barWidth: 20, //柱图宽度 | 
|---|
|  |  |  | itemStyle: { | 
|---|
|  |  |  | normal: { | 
|---|
|  |  |  | label: { | 
|---|
|  |  |  | show: true, //开启显示 | 
|---|
|  |  |  | position: "top", //在上方显示 | 
|---|
|  |  |  | textStyle: { | 
|---|
|  |  |  | //数值样式 | 
|---|
|  |  |  | color: "#566f94", | 
|---|
|  |  |  | fontSize: 14 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | data: organeNumArrabandonCount | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ] | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.resetOption(newData); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | immediate: true, | 
|---|
|  |  |  | deep: true, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | deep: true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss" scoped> | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | <style lang="scss" scoped></style> | 
|---|