fix: dict

pull/12/head
xingyu 2023-05-14 16:36:27 +08:00
parent 181b43dbd6
commit 7c8aeb8998
44 changed files with 150 additions and 158 deletions

View File

@ -19,13 +19,13 @@ export interface DictDataType {
cssClass: string
}
export const getDictOptions = (dictType: string) => {
return dictStore.getDictMap[dictType]
export function getDictDatas(dictType: string) {
return dictStore.getDictMap[dictType] || []
}
export const getDictOpts = (dictType: string) => {
export function getDictOpts(dictType: string) {
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictOptions(dictType)
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) {
dictOptions.forEach((dict: DictDataType) => {
if (typeof dict.value === 'number') {
@ -50,36 +50,29 @@ export const getDictOpts = (dictType: string) => {
return dictOption
}
export const getStrDictOptions = (dictType: string) => {
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictOptions(dictType)
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) {
dictOptions.forEach((dict: DictDataType) => {
dictOption.push({
...dict,
value: dict.value + ''
value:
valueType === 'string'
? dict.value + ''
: valueType === 'boolean'
? dict.value + '' === 'true'
? true
: false
: parseInt(dict.value + '')
})
})
}
return dictOption
}
export const getBoolDictOptions = (dictType: string) => {
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictOptions(dictType)
if (dictOptions && dictOptions.length > 0) {
dictOptions.forEach((dict: DictDataType) => {
dictOption.push({
...dict,
value: dict.value + '' === 'true' ? true : false
})
})
}
return dictOption
}
export const getDictObj = (dictType: string, value: any) => {
const dictOptions: DictDataType[] = getDictOptions(dictType)
export function getDictObj(dictType: string, value: any) {
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions) {
dictOptions.forEach((dict: DictDataType) => {
if (dict.value === value.toString()) {

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -47,7 +47,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { getListSimpleUsers } from '@/api/system/user'
let users: any[] = []
@ -80,7 +80,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -129,7 +129,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
}
]

View File

@ -2,7 +2,7 @@ import { getSimpleForms } from '@/api/bpm/form'
import { updateModelState } from '@/api/bpm/model'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { useMessage } from '@/hooks/web/useMessage'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { Button, Switch } from 'ant-design-vue'
import { h } from 'vue'
@ -132,7 +132,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'category',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.BPM_MODEL_CATEGORY)
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)
},
colProps: { span: 8 }
}
@ -165,7 +165,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.BPM_MODEL_CATEGORY)
options: getDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)
}
},
{
@ -179,7 +179,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
ifShow: ({ values }) => !!values.id,
componentProps: {
options: getDictOpts(DICT_TYPE.BPM_MODEL_FORM_TYPE)
options: getDictOptions(DICT_TYPE.BPM_MODEL_FORM_TYPE)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -60,7 +60,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.BPM_OA_LEAVE_TYPE)
options: getDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)
},
colProps: { span: 8 }
},
@ -75,7 +75,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
options: getDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -73,7 +73,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.USER_TYPE)
options: getDictOptions(DICT_TYPE.USER_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -76,7 +76,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.USER_TYPE)
options: getDictOptions(DICT_TYPE.USER_TYPE)
},
colProps: { span: 8 }
},
@ -103,7 +103,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'processStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS)
options: getDictOptions(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS)
},
colProps: { span: 8 }
}

View File

@ -1,6 +1,6 @@
import { getDataSourceConfigList } from '@/api/infra/dataSourceConfig'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
const dataSourceConfigs = await getDataSourceConfigList()
@ -104,7 +104,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -2,7 +2,7 @@ import { listSimpleDictType } from '@/api/system/dict/type'
import { listSimpleMenus } from '@/api/system/menu'
import { FormSchema } from '@/components/Form'
import { BasicColumn } from '@/components/Table'
import { getDictOpts, DICT_TYPE } from '@/utils/dict'
import { getDictOptions, DICT_TYPE } from '@/utils/dict'
async function getDictTypeOptions() {
const dictTypeOptions: any[] = []
@ -59,7 +59,7 @@ export const basicInfoSchemas: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
},
colProps: { span: 12 }
},
@ -69,7 +69,7 @@ export const basicInfoSchemas: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE)
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_FRONT_TYPE)
},
colProps: { span: 12 }
},
@ -79,7 +79,7 @@ export const basicInfoSchemas: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_CODEGEN_SCENE)
options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
},
colProps: { span: 12 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -76,7 +76,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_CONFIG_TYPE)
options: getDictOptions(DICT_TYPE.INFRA_CONFIG_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -55,7 +55,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'storage',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_FILE_STORAGE)
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE)
},
colProps: { span: 8 }
},
@ -87,7 +87,7 @@ export const formSchema: FormSchema[] = [
required: true,
dynamicDisabled: ({ values }) => !!values.id,
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_FILE_STORAGE)
options: getDictOptions(DICT_TYPE.INFRA_FILE_STORAGE)
}
},
{

View File

@ -1,6 +1,6 @@
import { DescItem } from '@/components/Description'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { useComponentRegister } from '@/components/Form'
import { CronTab } from '@/components/CronTab'
@ -54,7 +54,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_JOB_STATUS)
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS)
},
colProps: { span: 8 }
},

View File

@ -1,6 +1,6 @@
import { DescItem } from '@/components/Description'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -78,7 +78,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_JOB_STATUS)
options: getDictOptions(DICT_TYPE.INFRA_JOB_STATUS)
},
colProps: { span: 8 }
},

View File

@ -1,6 +1,5 @@
import { getDictOpts } from '@/utils/dict'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { getSimpleAccounts } from '@/api/mp/account'
export enum MsgType {
@ -121,7 +120,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.MP_MESSAGE_TYPE)
options: getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE)
},
colProps: { span: 8 }
},

View File

@ -3,7 +3,7 @@ import { getMerchantListByName } from '@/api/pay/merchant'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { PayChannelEnum } from '@/enums/systemEnum'
import { useMessage } from '@/hooks/web/useMessage'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { Tag, Switch } from 'ant-design-vue'
import { h } from 'vue'
@ -168,7 +168,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -210,7 +210,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -84,7 +84,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'payed',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_BOOLEAN_STRING)
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)
},
colProps: { span: 8 }
}

View File

@ -1,7 +1,7 @@
import { changeMerchantStatus } from '@/api/pay/merchant'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { useMessage } from '@/hooks/web/useMessage'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { Switch } from 'ant-design-vue'
import { h } from 'vue'
@ -97,7 +97,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -140,7 +140,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,7 +1,7 @@
import { getMerchantListByName } from '@/api/pay/merchant'
import { DescItem } from '@/components/Description'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -128,7 +128,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'channelCode',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)
options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)
},
colProps: { span: 8 }
},
@ -149,7 +149,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_ORDER_STATUS)
options: getDictOptions(DICT_TYPE.PAY_ORDER_STATUS)
},
colProps: { span: 8 }
},
@ -158,7 +158,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'refundStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_ORDER_REFUND_STATUS)
options: getDictOptions(DICT_TYPE.PAY_ORDER_REFUND_STATUS)
},
colProps: { span: 8 }
},
@ -167,7 +167,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'notifyStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS)
options: getDictOptions(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS)
},
colProps: { span: 8 }
},

View File

@ -1,7 +1,7 @@
import { getMerchantListByName } from '@/api/pay/merchant'
import { DescItem } from '@/components/Description'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -143,7 +143,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'channelCode',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)
options: getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)
},
colProps: { span: 8 }
},
@ -152,7 +152,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_REFUND_ORDER_TYPE)
options: getDictOptions(DICT_TYPE.PAY_REFUND_ORDER_TYPE)
},
colProps: { span: 8 }
},
@ -173,7 +173,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_REFUND_ORDER_STATUS)
options: getDictOptions(DICT_TYPE.PAY_REFUND_ORDER_STATUS)
},
colProps: { span: 8 }
},
@ -182,7 +182,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'notifyStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS)
options: getDictOptions(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS)
},
colProps: { span: 8 }
},

View File

@ -49,7 +49,7 @@ import { Card, List } from 'ant-design-vue'
import { Description } from '@/components/Description'
import { descSchema } from './submit.data'
import { getOrder, submitOrder } from '@/api/pay/order'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { useRoute } from 'vue-router'
import alipay_qr from '@/assets/images/pay/icon/alipay_qr.svg'
import alipay_app from '@/assets/images/pay/icon/alipay_app.svg'
@ -85,7 +85,7 @@ const otherPayChannels = ref<any[]>([])
function initPayChannels() {
//
for (const dict of getDictOpts(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)) {
for (const dict of getDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)) {
const payChannel = {
name: dict.label,
code: dict.value as string

View File

@ -1,7 +1,7 @@
import { listSimpleDept } from '@/api/system/dept'
import { getListSimpleUsers } from '@/api/system/user'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
let userOptions: any[] = []
@ -70,7 +70,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -147,7 +147,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
}
]

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const dataColumns: BasicColumn[] = [
{
@ -67,7 +67,7 @@ export const dataSearchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -112,7 +112,7 @@ export const dataFormSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const typeColumns: BasicColumn[] = [
{
@ -47,7 +47,7 @@ export const typeSearchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -78,7 +78,7 @@ export const typeFormSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -51,7 +51,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_ERROR_CODE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_ERROR_CODE_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -102,7 +102,7 @@ export const formSchema: FormSchema[] = [
field: 'sslEnable',
component: 'Switch',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_BOOLEAN_STRING)
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)
}
}
]

View File

@ -1,6 +1,5 @@
import { getDictOpts } from '@/utils/dict'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { getSimpleMailAccountList } from '@/api/system/mail/account'
export const columns: BasicColumn[] = [
@ -76,7 +75,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'sendStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_MAIL_SEND_STATUS)
options: getDictOptions(DICT_TYPE.SYSTEM_MAIL_SEND_STATUS)
},
colProps: { span: 8 }
},
@ -91,7 +90,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.USER_TYPE)
options: getDictOptions(DICT_TYPE.USER_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,6 +1,6 @@
import { getSimpleMailAccountList } from '@/api/system/mail/account'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -83,7 +83,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -151,7 +151,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,6 +1,6 @@
import { listSimpleMenus } from '@/api/system/menu'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { SystemMenuTypeEnum } from '@/enums/systemEnum'
export const columns: BasicColumn[] = [
@ -63,7 +63,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -100,7 +100,7 @@ export const formSchema: FormSchema[] = [
defaultValue: '0',
component: 'RadioButtonGroup',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_MENU_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE)
},
colProps: { lg: 24, md: 24 }
},
@ -160,7 +160,7 @@ export const formSchema: FormSchema[] = [
defaultValue: 0,
helpMessage: '选择停用时,路由将不会出现在侧边栏,也不能被访问',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -49,7 +49,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -75,7 +75,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_NOTICE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_NOTICE_TYPE)
}
},
{
@ -84,7 +84,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -93,7 +93,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'templateType',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -44,7 +44,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'readStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.INFRA_BOOLEAN_STRING)
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)
},
colProps: { span: 8 }
},
@ -93,7 +93,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
}
},
{
@ -102,7 +102,7 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -71,7 +71,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -120,7 +120,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)
}
},
{
@ -129,7 +129,7 @@ export const formSchema: FormSchema[] = [
component: 'RadioGroup',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -79,7 +79,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -131,7 +131,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{
@ -154,7 +154,7 @@ export const formSchema: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE),
options: getDictOptions(DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE),
mode: 'multiple'
}
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -61,7 +61,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'userType',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.USER_TYPE)
options: getDictOptions(DICT_TYPE.USER_TYPE)
},
colProps: { span: 8 }
}

View File

@ -1,6 +1,5 @@
import { getDictOpts } from '@/utils/dict'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -80,7 +79,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_OPERATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_OPERATE_TYPE)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -63,7 +63,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
}
@ -101,7 +101,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { SystemDataScopeEnum } from '@/enums/systemEnum'
export const columns: BasicColumn[] = [
@ -67,7 +67,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -111,7 +111,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{
@ -173,7 +173,7 @@ export const dataScopeFormSchema: FormSchema[] = [
required: true,
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_DATA_SCOPE)
options: getDictOptions(DICT_TYPE.SYSTEM_DATA_SCOPE)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -61,7 +61,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -92,7 +92,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -70,7 +70,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -101,7 +101,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
required: true,
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
}
},
{
@ -110,7 +110,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,5 +1,5 @@
import { getSimpleSmsChannels } from '@/api/system/sms/smsChannel'
import { getDictOpts } from '@/utils/dict'
import { getDictOptions } from '@/utils/dict'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE } from '@/utils/dict'
@ -105,7 +105,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'sendStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_SEND_STATUS)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_SEND_STATUS)
},
colProps: { span: 8 }
},
@ -120,7 +120,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'receiveStatus',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS)
},
colProps: { span: 8 }
},

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -67,7 +67,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'type',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)
},
colProps: { span: 8 }
},
@ -76,7 +76,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -97,7 +97,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'channelId',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)
},
colProps: { span: 8 }
},
@ -128,7 +128,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)
options: getDictOptions(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE)
}
},
{
@ -155,7 +155,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{

View File

@ -1,6 +1,6 @@
import { getTenantPackageList } from '@/api/system/tenantPackage'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -96,7 +96,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -185,7 +185,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
}
]

View File

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
@ -47,7 +47,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -84,7 +84,7 @@ export const formSchema: FormSchema[] = [
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
}
]

View File

@ -4,7 +4,7 @@ import { useMessage } from '@/hooks/web/useMessage'
import { listSimpleDept } from '@/api/system/dept'
import { listSimplePosts } from '@/api/system/post'
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getDictOpts } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { updateUserStatus } from '@/api/system/user'
import { listSimpleRoles } from '@/api/system/role'
@ -100,7 +100,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'status',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
},
colProps: { span: 8 }
},
@ -173,13 +173,14 @@ export const formSchema: FormSchema[] = [
field: 'sex',
component: 'Select',
componentProps: {
options: getDictOpts(DICT_TYPE.SYSTEM_USER_SEX)
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX)
}
},
{
label: '岗位',
field: 'postIds',
component: 'ApiSelect',
defaultValue: [],
componentProps: {
api: () => listSimplePosts(),
labelField: 'name',
@ -191,8 +192,9 @@ export const formSchema: FormSchema[] = [
label: '状态',
field: 'status',
component: 'Select',
defaultValue: 0,
componentProps: {
options: getDictOpts(DICT_TYPE.COMMON_STATUS)
options: getDictOptions(DICT_TYPE.COMMON_STATUS)
}
},
{