From 764b52d86f11ac5f0f8c7ecd46e90ac8a0a51b77 Mon Sep 17 00:00:00 2001 From: zhangxiaodi1 Date: Mon, 11 Nov 2024 21:02:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=AE=9A=E4=B9=89=EF=BC=8C?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=88=86=E7=B1=BB=E7=AE=A1=E7=90=86=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=B8=8B=E6=8B=89=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataset/CodeRepItem/CodeRepItem.vue | 37 +++++++++++++++++-- .../dataset/CodeRepItem/components/Write.vue | 31 +++++++++++----- .../dataset/IndexClassMs/IndexClassMs.vue | 10 ++++- .../dataset/RepIndexSet/components/Write.vue | 12 +++--- 4 files changed, 69 insertions(+), 21 deletions(-) diff --git a/src/views/dataset/CodeRepItem/CodeRepItem.vue b/src/views/dataset/CodeRepItem/CodeRepItem.vue index 256f6f8..1e41dda 100644 --- a/src/views/dataset/CodeRepItem/CodeRepItem.vue +++ b/src/views/dataset/CodeRepItem/CodeRepItem.vue @@ -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([]) const ruleConfigRef = ref>() +//获取字典项 +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([ }, { field: 'indexType', - label: '指标类型' + label: '指标类型', + slots:{ + default:(data)=>{ + return {data.row.indexType?indexType_param_LIST.value[data.row.indexType - 1]?.label:''} + } + } }, { field: 'indexcalType', - label: '指标计算类型' + label: '指标计算类型', + slots:{ + default:(data)=>{ + return {data.row.indexcalType?indexCalType_param_LIST.value[data.row.indexcalType - 1]?.label:''} + } + } }, { field: 'indexdataType', - label: '指标数据类型' + label: '指标数据类型', + slots:{ + default:(data)=>{ + return {data.row.indexdataType?indexDataType_param_LIST.value[data.row.indexdataType - 1]?.label:''} + } + } }, { field: 'beginDate', diff --git a/src/views/dataset/CodeRepItem/components/Write.vue b/src/views/dataset/CodeRepItem/components/Write.vue index 960c996..63d83e7 100644 --- a/src/views/dataset/CodeRepItem/components/Write.vue +++ b/src/views/dataset/CodeRepItem/components/Write.vue @@ -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([ label: '主键', component: 'Input', hidden: true - },{ + }, + { field: 'indexsetCode', label: '指标集编码', component: 'Input', @@ -48,6 +51,7 @@ const formSchema = reactive([ component: 'DatePicker', componentProps: { valueFormat: 'YYYYMMDD', + style:{width:'100%'} }, }, { @@ -56,6 +60,7 @@ const formSchema = reactive([ component: 'DatePicker', componentProps: { valueFormat: 'YYYYMMDD', + style:{width:'100%'} }, }, { @@ -149,26 +154,32 @@ const formSchema = reactive([ { 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', diff --git a/src/views/dataset/IndexClassMs/IndexClassMs.vue b/src/views/dataset/IndexClassMs/IndexClassMs.vue index bb55f47..594b6fc 100644 --- a/src/views/dataset/IndexClassMs/IndexClassMs.vue +++ b/src/views/dataset/IndexClassMs/IndexClassMs.vue @@ -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([ }, { field: 'indexType', - label: '指标类型' + label: '指标类型', + slots:{ + default:(data)=>{ + return {data.row.indexType?indexType_param_LIST.value[data.row.indexType - 1]?.label:''} + } + } }, { field: 'frequency', diff --git a/src/views/dataset/RepIndexSet/components/Write.vue b/src/views/dataset/RepIndexSet/components/Write.vue index dab1af8..036f9b1 100644 --- a/src/views/dataset/RepIndexSet/components/Write.vue +++ b/src/views/dataset/RepIndexSet/components/Write.vue @@ -71,12 +71,12 @@ const formSchema = reactive([ { 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',