Explorar el Código

优化soc统计图样式

yanghao hace 1 semana
padre
commit
995453d9d1
Se han modificado 2 ficheros con 18 adiciones y 1 borrados
  1. 4 0
      src/components/Echart/src/Echart.vue
  2. 14 1
      src/views/pms/qhse/socSummary/index.vue

+ 4 - 0
src/components/Echart/src/Echart.vue

@@ -93,6 +93,10 @@ const resizeHandler = debounce(() => {
   }
 }, 100)
 
+defineExpose({
+  resize: resizeHandler
+})
+
 const contentResizeHandler = async (e: TransitionEvent) => {
   if (e.propertyName === 'width') {
     resizeHandler()

+ 14 - 1
src/views/pms/qhse/socSummary/index.vue

@@ -14,7 +14,12 @@
               返回总览
             </el-button>
           </div>
-          <Echart :options="socChartOption" :height="240" @chart-click="handleChartClick" />
+          <Echart
+            ref="socChartRef"
+            :options="socChartOption"
+            :height="240"
+            @chart-click="handleChartClick"
+          />
         </div>
       </div>
 
@@ -203,6 +208,7 @@ const loading = ref(true) // 列表的加载中
 const list = ref([]) // 列表的数据
 const total = ref(0) // 列表的总页数
 const isLeftContentCollapsed = ref(false)
+const socChartRef = ref<{ resize: () => void } | null>(null)
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -506,6 +512,13 @@ const resetDrilldown = () => {
 }
 
 /** 初始化 **/
+watch(isLeftContentCollapsed, async () => {
+  await nextTick()
+  setTimeout(() => {
+    socChartRef.value?.resize()
+  }, 320)
+})
+
 onMounted(() => {
   getList()
   getStatic()