Browse Source

社区管理分类变动更新移动分类组件中的分类数据

yujinwen 2 months ago
parent
commit
00faaafb3e

+ 4 - 3
src/views/etaChart/components/ClassifyWrap.vue

@@ -138,6 +138,7 @@ function showClassifyOpt(data) {
   return (classifyActived.value === data.ChartClassifyId) && data.ChartClassifyId !== 0 && data.ChartInfoId === 0
 }
 
+const moveClassifyIns=useTemplateRef('moveClassifyIns')
 // 分类编辑
 const formEl = ref(null)
 const FORM_RULES = { name: [{ required: true, message: '名称不能为空' }] };
@@ -173,9 +174,8 @@ async function handleConfirmClassify() {
     MessagePlugin.success('操作成功')
     showEditClassify.value = false
     getClassify()
+    moveClassifyIns.value?.getClassifyOpts()
   }
-
-
 }
 function handleClassifyOpt(node, type) {
   const data=node.data
@@ -205,6 +205,7 @@ function handleClassifyOpt(node, type) {
       if (res.Ret === 200) {
         MessagePlugin.success('操作成功')
         getClassify()
+        moveClassifyIns.value?.getClassifyOpts()
       }
     })
   }
@@ -420,7 +421,7 @@ const showBatchMove = ref(false)
   </t-dialog>
 
   <!-- 批量移动图表 -->
-  <MoveClassify v-model:show="showBatchMove" @success="getClassify" />
+  <MoveClassify ref="moveClassifyIns" v-model:show="showBatchMove" @success="getClassify" />
 </template>
 
 <style lang="scss">

+ 4 - 0
src/views/etaChart/components/MoveClassify.vue

@@ -124,6 +124,10 @@ watch(
   }
 )
 
+defineExpose({
+  getClassifyOpts
+})
+
 const selectedRowKeys = ref([])
 let cancelSelectRowKeys=[]//取消选择的keys
 function tableSelectChange(value, ctx) {