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

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 RepSetRuleWrite from '@/views/dataset/RepSetRule/components/Write.vue'
import { RULE_TYPE_LIST } from '@/views/IndexProcess/constants'
import { getIndexType } from '@/api/dataset/RepIndexSet'
import { transfDictList } from '@/utils';
const route = useRoute();
const pageQuery = ref(route || null);
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 ids = ref<string[]>([])
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({
fetchDataApi: async () => {
@ -82,16 +96,31 @@ const tableColumns = reactive<TableColumn[]>([
},
{
field: 'indexType',
label: '指标类型'
label: '指标类型',
slots:{
default:(data)=>{
return <span>{data.row.indexType?indexType_param_LIST.value[data.row.indexType - 1]?.label:''}</span>
}
}
},
{
field: 'indexcalType',
label: '指标计算类型'
label: '指标计算类型',
slots:{
default:(data)=>{
return <span>{data.row.indexcalType?indexCalType_param_LIST.value[data.row.indexcalType - 1]?.label:''}</span>
}
}
},
{
field: 'indexdataType',
label: '指标数据类型'
label: '指标数据类型',
slots:{
default:(data)=>{
return <span>{data.row.indexdataType?indexDataType_param_LIST.value[data.row.indexdataType - 1]?.label:''}</span>
}
}
},
{
field: 'beginDate',

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

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

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

Loading…
Cancel
Save