指标集管理中指标集类型改为树形结构

main
zhangxiaodi1 9 months ago
parent a605dd14da
commit 7b058fed2a

@ -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<string[]>([])
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<TableColumn[]>([
label: '指标集类型',
slots:{
default:(data)=>{
return <span>{indexType_param_LIST[parseInt(data.row.indexsetType) - 1]?.label}</span>
const node = indexType_param_LIST.value.filter(item=>{
return item.id == data.row.indexsetType
})[0];
return <span>{node?node.nodeName:''}</span>
}
}
},
@ -173,13 +181,29 @@ const searchSchema = reactive<FormSchema[]>([
{
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"
/>
<Detail v-if="actionType === 'detail'" :current-row="currentRow" />

@ -16,6 +16,10 @@ const props = defineProps({
actionType: {
type: String,
default: 'add'
},
indexTypeParam:{
type:Object,
default:()=>[]
}
})
@ -84,12 +88,22 @@ const formSchema = reactive<FormSchema[]>([
{
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',

Loading…
Cancel
Save