|
|
@@ -5,11 +5,11 @@
|
|
|
</header>
|
|
|
<main class="safety-platform-container__main flex">
|
|
|
<div class="nav">
|
|
|
- <el-button type="primary" :icon="Plus" @click="addTeam('parent')"> 添加组织 </el-button>
|
|
|
+ <el-button type="primary" :icon="Plus" @click="addTeam('parent')"> 添加组织</el-button>
|
|
|
|
|
|
<div class="collapse-wrapper">
|
|
|
- <!-- 组织树 -->
|
|
|
- <el-collapse v-model="activeName" accordion v-if="fetchSafetyOrganizationList.length > 0">
|
|
|
+ <!-- 组织树v-model="activeName"-->
|
|
|
+ <el-collapse accordion v-if="fetchSafetyOrganizationList.length > 0">
|
|
|
<CollapseItem
|
|
|
v-for="item in fetchSafetyOrganizationList"
|
|
|
:key="item.id"
|
|
|
@@ -56,7 +56,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { onMounted, reactive, ref, defineComponent } from 'vue';
|
|
|
+ import { onMounted, reactive, ref, provide } from 'vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
@@ -98,6 +98,8 @@ const position = ref('left')
|
|
|
const fetchSafetyOrganizationList = ref<any[]>([]);
|
|
|
|
|
|
const activeName = ref('');
|
|
|
+ // 给组件递归时使用
|
|
|
+// provide('activeName', activeName)
|
|
|
|
|
|
const level = ref(1)
|
|
|
// 日期范围(用于日期选择器)
|
|
|
@@ -226,7 +228,7 @@ const formatTreeData = (tree)=> {
|
|
|
// 默认选择第一个组织
|
|
|
if(res[0].orgId){
|
|
|
treeNodePreview(res[0])
|
|
|
- activeName.value = res[0].orgId
|
|
|
+ activeName.value = String(res[0].orgId)
|
|
|
tableQuery.queryParam.classifyName = res[0].orgId
|
|
|
}
|
|
|
|
|
|
@@ -296,6 +298,7 @@ const formatTreeData = (tree)=> {
|
|
|
const querySafetyTeamData = (value) => {
|
|
|
// console.log('查询', value);
|
|
|
tableQuery.queryParam.classifyName = value.orgId;
|
|
|
+ activeName.value = String(value.orgId)
|
|
|
treeNodePreview(value)
|
|
|
};
|
|
|
|