指标定义,指标分类管理字段下拉回显

main
zhangxiaodi1 9 months ago
parent 4a10a84ab6
commit 764b52d86f

@ -26,17 +26,31 @@ import { saveRepDataProblemApi } from '@/api/reporting/RepDataProblem/RepDataPro
import {useRoute} from "vue-router" import {useRoute} from "vue-router"
import RepSetRuleWrite from '@/views/dataset/RepSetRule/components/Write.vue' import RepSetRuleWrite from '@/views/dataset/RepSetRule/components/Write.vue'
import { RULE_TYPE_LIST } from '@/views/IndexProcess/constants' import { RULE_TYPE_LIST } from '@/views/IndexProcess/constants'
import { getIndexType } from '@/api/dataset/RepIndexSet'
import { transfDictList } from '@/utils';
const route = useRoute(); const route = useRoute();
const pageQuery = ref(route || null); const pageQuery = ref(route || null);
const indexsetCode = pageQuery.value?.query?.indexsetCode; const indexsetCode = pageQuery.value?.query?.indexsetCode;
let indexType_param_LIST = ref([]);
let indexCalType_param_LIST = ref([]);
let indexDataType_param_LIST = ref([]);
const { t } = useI18n() const { t } = useI18n()
const ids = ref<string[]>([]) const ids = ref<string[]>([])
const ruleConfigRef = ref<ComponentRef<typeof RuleConfig>>() const ruleConfigRef = ref<ComponentRef<typeof RuleConfig>>()
//
const getDictInfoList = async ()=>{
const indexType = await getIndexType({ paramName: 'indexType_param', systemCode: 'ordb' });
indexType_param_LIST.value = transfDictList(indexType.body.result);
const indexCalType = await getIndexType({ paramName: 'indexCalType_param', systemCode: 'ordb' });
indexCalType_param_LIST.value = transfDictList(indexCalType.body.result);
const indexDataType = await getIndexType({ paramName: 'indexDataType_param', systemCode: 'ordb' });
indexDataType_param_LIST.value = transfDictList(indexDataType.body.result);
}
getDictInfoList();
const { tableRegister, tableState, tableMethods } = useTable({ const { tableRegister, tableState, tableMethods } = useTable({
fetchDataApi: async () => { fetchDataApi: async () => {
@ -82,16 +96,31 @@ const tableColumns = reactive<TableColumn[]>([
}, },
{ {
field: 'indexType', field: 'indexType',
label: '指标类型' label: '指标类型',
slots:{
default:(data)=>{
return <span>{data.row.indexType?indexType_param_LIST.value[data.row.indexType - 1]?.label:''}</span>
}
}
}, },
{ {
field: 'indexcalType', field: 'indexcalType',
label: '指标计算类型' label: '指标计算类型',
slots:{
default:(data)=>{
return <span>{data.row.indexcalType?indexCalType_param_LIST.value[data.row.indexcalType - 1]?.label:''}</span>
}
}
}, },
{ {
field: 'indexdataType', field: 'indexdataType',
label: '指标数据类型' label: '指标数据类型',
slots:{
default:(data)=>{
return <span>{data.row.indexdataType?indexDataType_param_LIST.value[data.row.indexdataType - 1]?.label:''}</span>
}
}
}, },
{ {
field: 'beginDate', field: 'beginDate',

@ -3,6 +3,8 @@ import { Form, FormSchema } from '@/components/Form'
import { useForm } from '@/hooks/web/useForm' import { useForm } from '@/hooks/web/useForm'
import { PropType, reactive, watch } from 'vue' import { PropType, reactive, watch } from 'vue'
import { useValidator } from '@/hooks/web/useValidator' import { useValidator } from '@/hooks/web/useValidator'
import { getIndexType } from '@/api/dataset/RepIndexSet';
import { transfDictList } from '@/utils';
const { required } = useValidator() const { required } = useValidator()
@ -26,7 +28,8 @@ const formSchema = reactive<FormSchema[]>([
label: '主键', label: '主键',
component: 'Input', component: 'Input',
hidden: true hidden: true
},{ },
{
field: 'indexsetCode', field: 'indexsetCode',
label: '指标集编码', label: '指标集编码',
component: 'Input', component: 'Input',
@ -48,6 +51,7 @@ const formSchema = reactive<FormSchema[]>([
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYYMMDD', valueFormat: 'YYYYMMDD',
style:{width:'100%'}
}, },
}, },
{ {
@ -56,6 +60,7 @@ const formSchema = reactive<FormSchema[]>([
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYYMMDD', valueFormat: 'YYYYMMDD',
style:{width:'100%'}
}, },
}, },
{ {
@ -149,26 +154,32 @@ const formSchema = reactive<FormSchema[]>([
{ {
field: 'indexType', field: 'indexType',
label: '指标类型', label: '指标类型',
component: 'Select', optionApi: async () => {
componentProps: { const indexType = await getIndexType({ paramName: 'indexType_param', systemCode: 'ordb' });
return transfDictList(indexType.body.result);
}, },
value: '1',
component: 'Select'
}, },
{ {
field: 'indexcalType', field: 'indexcalType',
label: '指标计算类型', label: '指标计算类型',
component: 'Input', optionApi: async () => {
componentProps: { const indexCalType = await getIndexType({ paramName: 'indexCalType_param', systemCode: 'ordb' });
return transfDictList(indexCalType.body.result);
}, },
value: '1',
component: 'Select'
}, },
{ {
field: 'indexdataType', field: 'indexdataType',
label: '指标数据类型', label: '指标数据类型',
component: 'Input', optionApi: async () => {
componentProps: { const indexDataType = await getIndexType({ paramName: 'indexDataType_param', systemCode: 'ordb' });
return transfDictList(indexDataType.body.result);
}, },
value: '1',
component: 'Select'
}, },
{ {
field: 'indexdataPrecision', field: 'indexdataPrecision',

@ -43,11 +43,14 @@ const { getStorage } = useStorage()
const userInfo = getStorage(appStore.getUserInfo) const userInfo = getStorage(appStore.getUserInfo)
let frequency_param_LIST = ref([]); let frequency_param_LIST = ref([]);
let indexType_param_LIST = ref([]);
// //
const getDictInfoList = async ()=>{ const getDictInfoList = async ()=>{
const res = await getIndexType({ paramName: 'frequency_param', systemCode: 'ordb' }); const res = await getIndexType({ paramName: 'frequency_param', systemCode: 'ordb' });
frequency_param_LIST.value = transfDictList(res.body.result); frequency_param_LIST.value = transfDictList(res.body.result);
const indexType = await getIndexType({ paramName: 'indexType_param', systemCode: 'ordb' });
indexType_param_LIST.value = transfDictList(indexType.body.result);
} }
getDictInfoList(); getDictInfoList();
@ -109,7 +112,12 @@ const tableColumns = reactive<TableColumn[]>([
}, },
{ {
field: 'indexType', field: 'indexType',
label: '指标类型' label: '指标类型',
slots:{
default:(data)=>{
return <span>{data.row.indexType?indexType_param_LIST.value[data.row.indexType - 1]?.label:''}</span>
}
}
}, },
{ {
field: 'frequency', field: 'frequency',

@ -71,12 +71,12 @@ const formSchema = reactive<FormSchema[]>([
{ {
field: 'frequency', field: 'frequency',
label: '频度', label: '频度',
optionApi: async () => { optionApi: async () => {
const res = await getIndexType({ paramName: 'frequency_param', systemCode: 'ordb' }); const res = await getIndexType({ paramName: 'frequency_param', systemCode: 'ordb' });
return transfDictList(res.body.result); return transfDictList(res.body.result);
}, },
value: '1', value: '1',
component: 'Select' component: 'Select'
}, },
{ {
field: 'indexsetType', field: 'indexsetType',

Loading…
Cancel
Save