优化增加下拉选项

main
yangyuanshuai 9 months ago
parent 062a9283db
commit 9a8ac95db5

@ -47,8 +47,8 @@ export const exportExcelApi = (params: any) => {
return request.doExport({ url: '/RepTemplate/sdi/reporting/RepTemplate/RepTemplateExportXls', params });
};
/** 获取某个字典 */
export const getCsckCheckType = ({ paramName, systemCode }): Promise<IResponse> => {
/** 获取报告分类 */
export const getCategory = ({ paramName, systemCode }): Promise<IResponse> => {
return request.postJson({
url: '/param/spi/param/systemparam',
data: {

@ -53,4 +53,4 @@ export type FormModel = {
tDescription?: string
/** 所属机构 */
organCode?: string
}
}

@ -19,7 +19,7 @@ import RuleConfig from './components/Ruleconfig.vue'
import Write from './components/Write.vue'
import { Dialog } from '@/components/Dialog'
import { getWidth } from '@/utils';
import { method } from 'lodash-es'
import { INDEX_CATAGOTY_LIST } from './constants'
const { t } = useI18n()
/**
@ -197,7 +197,9 @@ const indexDefineSearchSchema = reactive<FormSchema[]>([
{
field: 'tCategory',
label: '指标计算类型',
componentProps: {},
componentProps: {
options:INDEX_CATAGOTY_LIST
},
component: 'Select'
},
{

@ -0,0 +1,11 @@
//指标计算类型
export const INDEX_CATAGOTY_LIST = [
{
value:"1",
label:"自动"
},
{
value:"0",
label:"手动"
},
]

@ -17,11 +17,12 @@ import { FormSchema } from '@/components/Form'
import { ContentWrap } from '@/components/ContentWrap'
import Write from './components/Write.vue'
import { Dialog } from '@/components/Dialog'
import { getWidth } from '@/utils';
import { getWidth, transfDictList } from '@/utils';
import Detail from './components/Detail.vue'
import { useValidator } from '@/hooks/web/useValidator'
import { getOrganTree } from '@/api/common'
import { getLoginOrganCodeByUserInfo } from '@/utils/auth'
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate'
const { t } = useI18n();
const { required } = useValidator();
@ -142,8 +143,12 @@ const searchSchema = reactive<FormSchema[]>([
{
field: 'tCategory',
label: '报告分类',
componentProps: {},
component: 'Select'
optionApi: async () => {
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
return transfDictList(res.body.result);
},
value: '1',
component: 'Select'
},
{
field: 'tName',

@ -6,19 +6,21 @@ import {
delRepTemplateListApi,
delRepTemplateApi,
queryRepTemplateApi,
getCategory,
} from '@/api/reporting/RepTemplate/RepTemplate'
import { TableData } from '@/api/reporting/RepTemplate/RepTemplate/types'
import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n'
import { Table, TableColumn } from '@/components/Table'
import { ElButton, ElLink, ElLoading, ElPopconfirm, ElMessage } from 'element-plus'
import { ElButton, ElLink, ElLoading, ElPopconfirm, ElMessage, ElTag } from 'element-plus'
import { Search } from '@/components/Search'
import { FormSchema } from '@/components/Form'
import { ContentWrap } from '@/components/ContentWrap'
import Write from './components/Write.vue'
import { Dialog } from '@/components/Dialog'
import { getWidth } from '@/utils';
import { getWidth, transfDictList } from '@/utils';
import Detail from './components/Detail.vue'
import { REPORTING_TATUS_LIST } from './constants'
const { t } = useI18n()
@ -68,10 +70,6 @@ const tableColumns = reactive<TableColumn[]>([
field: 'uploadUser',
label: '上传人'
},
{
field: 'tStatus',
label: '状态'
},
{
field: 'tVersion',
label: '版本'
@ -88,6 +86,19 @@ const tableColumns = reactive<TableColumn[]>([
field: 'tDescription',
label: '描述'
},
{
field: 'tStatus',
label: '状态',
formatter:(row:Recordable,_:TableColumn) =>{
const state=REPORTING_TATUS_LIST.find((item)=>item.value===row.tStatus)
if(state&&state.value =='1'){
return <ElTag type="primary">{state.label}</ElTag>
}
else{
return <ElTag type="info">停用</ElTag>
}
}
},
{
field: 'action',
label: t('tableDemo.action'),
@ -127,8 +138,12 @@ const searchSchema = reactive<FormSchema[]>([
{
field: 'tCategory',
label: '报告分类',
componentProps: {},
component: 'Select'
component: 'Select',
optionApi: async () => {
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
return transfDictList(res.body.result);
},
value: '1'
},
{
field: 'createUser',
@ -242,7 +257,6 @@ const disabled = ref(true)
const onSelectionChange = (selection: TableData[]) => {
disabled.value = selection.length === 0
}
</script>
<template>

@ -4,6 +4,9 @@ import { useForm } from '@/hooks/web/useForm'
import { PropType, reactive, watch } from 'vue'
import { useValidator } from '@/hooks/web/useValidator'
import { ElButton, ElMessage, ElMessageBox } from 'element-plus';
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate';
import { transfDictList } from '@/utils';
import { REPORTING_STATUS_LIST } from '../constants';
const { required } = useValidator()
@ -33,9 +36,11 @@ const formSchema = reactive<FormSchema[]>([
field: 'tCategory',
label: '报告分类',
component: 'Select',
componentProps: {
},
optionApi: async () => {
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' });
return transfDictList(res.body.result);
},
value: '1'
},
{
field: 'createUser',
@ -58,8 +63,9 @@ const formSchema = reactive<FormSchema[]>([
label: '报告状态',
component: 'Select',
componentProps: {
options:REPORTING_STATUS_LIST
},
value:'1'
},
{
field: 'tDescription',

@ -0,0 +1,11 @@
//报告状态选择列表
export const REPORTING_STATUS_LIST = [
{
value:"1",
label:"启用"
},
{
value:"0",
label:"停用"
},
]
Loading…
Cancel
Save