diff --git a/src/views/dataset/RepIndexSet/RepIndexSet.vue b/src/views/dataset/RepIndexSet/RepIndexSet.vue index fc872be..d879bce 100644 --- a/src/views/dataset/RepIndexSet/RepIndexSet.vue +++ b/src/views/dataset/RepIndexSet/RepIndexSet.vue @@ -25,14 +25,19 @@ import Detail from './components/Detail.vue' import { Upload } from '@/components/Upload' import { useRouter } from 'vue-router' import { getIndexType } from '@/api/dataset/RepIndexSet'; +import { + getIndexCategoryTreeApi +} from '@/api/dataset/IndexCategory' import { transfDictList } from '@/utils'; const router = useRouter(); const { t } = useI18n() const ids = ref([]) -let indexType_param_LIST = ref([]); +let indexType_param_LIST = ref([]);//处理后的指标类型列表 +let IndexTypeParamsList = ref([]);//处理之前的指标类型列表 let frequency_param_LIST = ref([]); + //获取字典项 const getDictInfoList = async ()=>{ const res = await getIndexType({ paramName: 'frequency_param', systemCode: 'ordb' }); @@ -107,7 +112,10 @@ const tableColumns = reactive([ label: '指标集类型', slots:{ default:(data)=>{ - return {indexType_param_LIST[parseInt(data.row.indexsetType) - 1]?.label} + const node = indexType_param_LIST.value.filter(item=>{ + return item.id == data.row.indexsetType + })[0]; + return {node?node.nodeName:''} } } }, @@ -173,13 +181,29 @@ const searchSchema = reactive([ { field: 'indexsetType', label: '指标集类型', - optionApi: async () => { - const res = await getIndexType({ paramName: 'indexType_param', systemCode: 'ordb' }); - indexType_param_LIST = transfDictList(res.body.result); - return indexType_param_LIST; - }, - value: '1', - component: 'Select' + colProps: { span: 100 }, + componentProps: { + checkStrictly: true, + nodeKey: 'id', + props: { children: 'childs', label: 'nodeName' }, + filterable: true, + multiple: true, + collapseTags: true, + showCheckbox: true, + style: { minWidth: '200px' }, + checkOnClickNode: true, + }, + component: 'TreeSelect', + optionApi: async () => { + const res = await getIndexCategoryTreeApi(); + IndexTypeParamsList.value = res; + indexType_param_LIST.value = res; + res.forEach(item=>{ + indexType_param_LIST.value = indexType_param_LIST.value.concat(item.childs); + }); + console.log(indexType_param_LIST,"indexType_param_LIST"); + return res; + } } ]) @@ -328,6 +352,7 @@ const exportExcel = async () => { v-if="actionType !== 'detail'" ref="writeRef" :current-row="currentRow" + :indexTypeParam = "IndexTypeParamsList" :action-type="actionType" /> diff --git a/src/views/dataset/RepIndexSet/components/Write.vue b/src/views/dataset/RepIndexSet/components/Write.vue index 27187bd..5977085 100644 --- a/src/views/dataset/RepIndexSet/components/Write.vue +++ b/src/views/dataset/RepIndexSet/components/Write.vue @@ -16,6 +16,10 @@ const props = defineProps({ actionType: { type: String, default: 'add' + }, + indexTypeParam:{ + type:Object, + default:()=>[] } }) @@ -84,12 +88,22 @@ const formSchema = reactive([ { field: 'indexsetType', label: '指标集类型', - optionApi: async () => { - const res = await getIndexType({ paramName: 'indexType_param', systemCode: 'ordb' }); - return transfDictList(res.body.result); - }, - value: '1', - component: 'Select' + componentProps: { + checkStrictly: true, + nodeKey: 'id', + props: { children: 'childs', label: 'nodeName' }, + filterable: true, + multiple: true, + collapseTags: true, + showCheckbox: true, + style: { minWidth: '200px' }, + checkOnClickNode: true, + }, + component: 'TreeSelect', + optionApi: async () => { + + return props.indexTypeParam; + } }, { field: 'modelCode',