Browse Source

Merge branch 'qhse_file' of shuzhihua/pms-iot-vue into master

yanghao 1 week ago
parent
commit
740868fca4

File diff suppressed because it is too large
+ 532 - 289
src/views/pms/stat/rdkb/rd-Inventory-safety.vue


+ 22 - 3
src/views/pms/stat/rhkb/inventorySituation.vue

@@ -60,6 +60,7 @@ const trendChartRef = ref<HTMLDivElement>()
 
 
 let distributionChart: echarts.ECharts | null = null
 let distributionChart: echarts.ECharts | null = null
 let trendChart: echarts.ECharts | null = null
 let trendChart: echarts.ECharts | null = null
+let distributionResizeObserver: ResizeObserver | null = null
 
 
 const panelOptions: Array<{ label: string; value: ActivePanel }> = [
 const panelOptions: Array<{ label: string; value: ActivePanel }> = [
   { label: '存货分布', value: 'distribution' },
   { label: '存货分布', value: 'distribution' },
@@ -418,7 +419,7 @@ function getInventoryAgingOption(data: unknown): echarts.EChartsOption {
   const values = entries.map(({ value }) => yuanToWan(value))
   const values = entries.map(({ value }) => yuanToWan(value))
 
 
   return {
   return {
-    ...ANIMATION,
+    animation: false,
     grid: {
     grid: {
       ...THEME.grid,
       ...THEME.grid,
       top: layout.trendGridTop,
       top: layout.trendGridTop,
@@ -480,13 +481,16 @@ function getInventoryAgingOption(data: unknown): echarts.EChartsOption {
             { offset: 1, color: 'rgb(255 161 79 / 2%)' }
             { offset: 1, color: 'rgb(255 161 79 / 2%)' }
           ])
           ])
         },
         },
+        emphasis: {
+          disabled: true
+        },
         label: {
         label: {
           show: true,
           show: true,
           color: THEME.color.orange.line,
           color: THEME.color.orange.line,
           fontSize: layout.labelFontSize,
           fontSize: layout.labelFontSize,
           fontFamily: FONT_FAMILY,
           fontFamily: FONT_FAMILY,
           formatter(params: any) {
           formatter(params: any) {
-            return formatAmount(Number(params.value))
+            return `${formatAmount(Number(params.value))}万`
           }
           }
         }
         }
       }
       }
@@ -528,6 +532,13 @@ function resizeCharts() {
   trendChart?.resize()
   trendChart?.resize()
 }
 }
 
 
+function handleDistributionResize() {
+  if (!distributionChartRef.value || !distributionChart) return
+
+  distributionChart.resize()
+  renderDistributionChart()
+}
+
 function destroyCharts() {
 function destroyCharts() {
   distributionChart?.dispose()
   distributionChart?.dispose()
   trendChart?.dispose()
   trendChart?.dispose()
@@ -616,7 +627,13 @@ async function requestInventoryDetail() {
 }
 }
 
 
 onMounted(() => {
 onMounted(() => {
-  initDistributionChart()
+  nextTick(() => {
+    requestAnimationFrame(() => {
+      initDistributionChart()
+      distributionResizeObserver = new ResizeObserver(handleDistributionResize)
+      distributionResizeObserver.observe(distributionChartRef.value!)
+    })
+  })
   window.addEventListener('resize', resizeCharts)
   window.addEventListener('resize', resizeCharts)
   window.addEventListener('rhkb:resize', resizeCharts)
   window.addEventListener('rhkb:resize', resizeCharts)
 })
 })
@@ -640,6 +657,8 @@ watch(selectedDate, () => {
 onUnmounted(() => {
 onUnmounted(() => {
   window.removeEventListener('resize', resizeCharts)
   window.removeEventListener('resize', resizeCharts)
   window.removeEventListener('rhkb:resize', resizeCharts)
   window.removeEventListener('rhkb:resize', resizeCharts)
+  distributionResizeObserver?.disconnect()
+  distributionResizeObserver = null
   destroyCharts()
   destroyCharts()
 })
 })
 </script>
 </script>

File diff suppressed because it is too large
+ 508 - 294
src/views/pms/stat/rykb/inventory-situation.vue


Some files were not shown because too many files changed in this diff