产出品管理页面调整
This commit is contained in:
		
							parent
							
								
									79ac695e43
								
							
						
					
					
						commit
						f62526a22b
					
				| @ -33,10 +33,16 @@ export default { | |||||||
|       type: Boolean, |       type: Boolean, | ||||||
|       default: false, |       default: false, | ||||||
|     }, |     }, | ||||||
|  |     // 是否展示高亮圈圈 | ||||||
|     showMarkPoint: { |     showMarkPoint: { | ||||||
|       type: Boolean, |       type: Boolean, | ||||||
|       default: false, |       default: false, | ||||||
|     }, |     }, | ||||||
|  |     // 是否堆叠展示 | ||||||
|  |     isHorizontal: { | ||||||
|  |       type: Boolean, | ||||||
|  |       default: false, | ||||||
|  |     }, | ||||||
|   }, |   }, | ||||||
|   emits: ['click'], |   emits: ['click'], | ||||||
|   setup(props, { emit }) { |   setup(props, { emit }) { | ||||||
| @ -67,10 +73,6 @@ export default { | |||||||
|         type: 'value', |         type: 'value', | ||||||
|       }, |       }, | ||||||
|       series: [], |       series: [], | ||||||
|       isHorizontal: { |  | ||||||
|         type: Boolean, |  | ||||||
|         default: false, |  | ||||||
|       }, |  | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     watchEffect(() => { |     watchEffect(() => { | ||||||
| @ -108,8 +110,9 @@ export default { | |||||||
|       option.series = props.isSeries && option.series.length > 0 ? option.series : seriesData; |       option.series = props.isSeries && option.series.length > 0 ? option.series : seriesData; | ||||||
|       if (props.isHorizontal) { |       if (props.isHorizontal) { | ||||||
|         option.yAxis.data = xAxisData; |         option.yAxis.data = xAxisData; | ||||||
|       } else { |  | ||||||
|         option.xAxis.data = []; |         option.xAxis.data = []; | ||||||
|  |       } else { | ||||||
|  |         option.xAxis.data = xAxisData; | ||||||
|       } |       } | ||||||
|       console.log(option); |       console.log(option); | ||||||
|       setOptions(option); |       setOptions(option); | ||||||
|  | |||||||
| @ -11,8 +11,6 @@ | |||||||
| 
 | 
 | ||||||
| .custom-tooltip-container{ | .custom-tooltip-container{ | ||||||
|   border-radius: 8px !important; |   border-radius: 8px !important; | ||||||
|   padding: 6px 16px 6px 8px !important; |  | ||||||
|   background-color: rgba(0,0,0,0.7) !important; |  | ||||||
|   backdrop-filter: blur(8px) !important; |   backdrop-filter: blur(8px) !important; | ||||||
|   & span{ |   & span{ | ||||||
|     width: 8px !important; |     width: 8px !important; | ||||||
|  | |||||||
| @ -16,6 +16,15 @@ const props = defineProps({ | |||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | let values = reactive([]); | ||||||
|  | const getValue = (dataList) => { | ||||||
|  |   let arr = []; | ||||||
|  |   for (let i = 0; i < dataList.length; i++) { | ||||||
|  |     arr.push(dataList[i].value); | ||||||
|  |   } | ||||||
|  |   return arr; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| const state = reactive({ | const state = reactive({ | ||||||
|   data: [], |   data: [], | ||||||
|   option: { |   option: { | ||||||
| @ -45,10 +54,10 @@ const state = reactive({ | |||||||
|       extraCssText: 'backdrop-filter: blur(8px);', |       extraCssText: 'backdrop-filter: blur(8px);', | ||||||
|     }, |     }, | ||||||
|     barStyle: { |     barStyle: { | ||||||
|       barWidth: 10, |       barWidth: 14, | ||||||
|       itemStyle: { |       itemStyle: { | ||||||
|         borderWidth: 10, |         borderWidth: 14, | ||||||
|         borderRadius: [8, 8, 8, 8], // 设置柱子的圆角半径 |         borderRadius: [10, 10, 10, 10], // 设置柱子的圆角半径 | ||||||
|       }, |       }, | ||||||
|       color: { |       color: { | ||||||
|         type: 'linear', |         type: 'linear', | ||||||
| @ -86,25 +95,100 @@ const state = reactive({ | |||||||
|         show: false, |         show: false, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|     yAxis: { |     yAxis: [ | ||||||
|       type: 'category', |       { | ||||||
|       data: ['耿马镇', '勐撒镇', '勐永镇', '孟定镇', '大兴乡'], |         type: 'category', | ||||||
|       axisTick: { |         data: ['耿马镇', '勐撒镇', '勐永镇', '孟定镇', '大兴乡'], | ||||||
|         show: false, |         axisTick: { | ||||||
|  |           show: false, | ||||||
|  |         }, | ||||||
|  |         splitLine: { | ||||||
|  |           show: false, | ||||||
|  |         }, | ||||||
|  |         axisLine: { | ||||||
|  |           show: false, | ||||||
|  |         }, | ||||||
|       }, |       }, | ||||||
|       splitLine: { |       { | ||||||
|         show: false, |         // 右侧数量 | ||||||
|  |         type: 'category', | ||||||
|  |         inverse: true, | ||||||
|  |         offset: 10, | ||||||
|  |         axisTick: 'none', | ||||||
|  |         axisLine: 'none', | ||||||
|  |         show: true, | ||||||
|  |         axisLabel: { | ||||||
|  |           textStyle: { | ||||||
|  |             color: '#ffffff', | ||||||
|  |             fontSize: '16', | ||||||
|  |           }, | ||||||
|  |           formatter: function (value) { | ||||||
|  |             let str = '{title|' + value + '吨}'; | ||||||
|  |             return str; | ||||||
|  |           }, | ||||||
|  |           rich: { | ||||||
|  |             title: { | ||||||
|  |               color: '#fff', | ||||||
|  |               fontSize: 16, | ||||||
|  |             }, | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         data: [12000, 8000, 6000, 4000, 3500], | ||||||
|       }, |       }, | ||||||
|       axisLine: { |     ], | ||||||
|         show: false, |  | ||||||
|       }, |  | ||||||
|     }, |  | ||||||
|     series: [ |     series: [ | ||||||
|       { |       { | ||||||
|  |         name: '值', | ||||||
|         type: 'bar', |         type: 'bar', | ||||||
|         // barWidth: '40%', // 设置柱的宽度 |         zlevel: 1, | ||||||
|         // barMinHeight: 2, // 设置柱的最小高度 |         barBorderRadius: 10, | ||||||
|         // barGap: '20%', // 设置柱之间的间隙 |         itemStyle: { | ||||||
|  |           borderRadius: [10, 10, 10, 10], | ||||||
|  |           color: 'rgba(100, 200, 255, 0.3)', | ||||||
|  |         }, | ||||||
|  |         backgroundStyle: { | ||||||
|  |           color: 'rgba(100, 200, 255, 0.3)', | ||||||
|  |           borderRadius: [10, 10, 10, 10], // 必须与barBorderRadius保持一致 | ||||||
|  |         }, | ||||||
|  |         barWidth: 20, | ||||||
|  |         data: values, | ||||||
|  |         label: { | ||||||
|  |           position: [0, -16], | ||||||
|  |           align: 'left', | ||||||
|  |           show: true, | ||||||
|  |           formatter: (params) => { | ||||||
|  |             return params.name; | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         barMaxWidth: 40, | ||||||
|  |         markLine: { | ||||||
|  |           label: { | ||||||
|  |             color: '#26a69a', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         name: '背景', | ||||||
|  |         type: 'bar', | ||||||
|  |         barWidth: 20, | ||||||
|  |         barGap: '-100%', | ||||||
|  |         data: [], | ||||||
|  |         barBorderRadius: 30, | ||||||
|  |         itemStyle: { | ||||||
|  |           normal: { | ||||||
|  |             color: 'rgba(105,131,242,.3)', | ||||||
|  |             borderRadius: 10, | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|  |         label: { | ||||||
|  |           show: false, | ||||||
|  |         }, | ||||||
|  |         barMaxWidth: 40, | ||||||
|  |         markLine: { | ||||||
|  |           label: { | ||||||
|  |             color: '#26a69a', | ||||||
|  |           }, | ||||||
|  |         }, | ||||||
|       }, |       }, | ||||||
|     ], |     ], | ||||||
|   }, |   }, | ||||||
| @ -148,6 +232,7 @@ const loadData = (val) => { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |   values = getValue(state.data); | ||||||
|   console.log(val); |   console.log(val); | ||||||
| }; | }; | ||||||
| </script> | </script> | ||||||
|  | |||||||
| @ -23,6 +23,7 @@ const state = reactive({ | |||||||
|       containLabel: true, |       containLabel: true, | ||||||
|     }, |     }, | ||||||
|     tooltip: { |     tooltip: { | ||||||
|  |       show: true, | ||||||
|       trigger: 'axis', |       trigger: 'axis', | ||||||
|       axisPointer: { |       axisPointer: { | ||||||
|         type: 'shadow', |         type: 'shadow', | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 2090205686@qq.com
						2090205686@qq.com