From 7b058fed2a4c6bf20bff062cbbc3b11c1f577363 Mon Sep 17 00:00:00 2001 From: zhangxiaodi1 Date: Wed, 6 Nov 2024 19:11:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E9=9B=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=E6=8C=87=E6=A0=87=E9=9B=86=E7=B1=BB=E5=9E=8B=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=A0=91=E5=BD=A2=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataset/RepIndexSet/RepIndexSet.vue | 43 +++++++++++++++---- .../dataset/RepIndexSet/components/Write.vue | 26 ++++++++--- 2 files changed, 54 insertions(+), 15 deletions(-) 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',