refactor: dict

This commit is contained in:
xingyu
2022-11-16 23:15:14 +08:00
parent 7c0c123b9a
commit 7455348a6e
39 changed files with 155 additions and 54 deletions

View File

@ -33,7 +33,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number'
},
{
label: '备注',

View File

@ -41,7 +41,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number'
},
{
label: '备注',

View File

@ -41,6 +41,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '流程分类',
field: 'category',
dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
dictData: 'number',
search: {
show: true
}

View File

@ -28,6 +28,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '流程分类',
field: 'category',
dictType: DICT_TYPE.BPM_MODEL_CATEGORY,
dictData: 'number',
search: {
show: true
}
@ -40,6 +41,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS,
dictData: 'number',
search: {
show: true
}
@ -48,6 +50,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '结果',
field: 'result',
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
dictData: 'number',
search: {
show: true
}

View File

@ -29,7 +29,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: '结果',
field: 'result',
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
dictData: 'number'
},
{
label: '审批意见',

View File

@ -26,6 +26,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '用户类型',
field: 'userType',
dictType: DICT_TYPE.USER_TYPE,
dictData: 'number',
search: {
show: true
}

View File

@ -69,6 +69,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '处理状态',
field: 'processStatus',
dictType: DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -52,6 +52,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '系统内置',
field: 'type',
dictType: DICT_TYPE.INFRA_CONFIG_TYPE,
dictData: 'number',
search: {
show: true
}

View File

@ -48,6 +48,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '存储器',
field: 'storage',
dictType: DICT_TYPE.INFRA_FILE_STORAGE,
dictData: 'number',
search: {
show: true
}
@ -55,7 +56,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: '主配置',
field: 'primary',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictData: 'number'
},
{
label: t('form.remark'),

View File

@ -37,6 +37,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.INFRA_JOB_STATUS,
dictData: 'number',
form: {
show: false
},

View File

@ -74,6 +74,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.INFRA_JOB_LOG_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -45,6 +45,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -51,6 +51,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -82,7 +82,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: '回调商户状态',
field: 'notifyStatus',
dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS
dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS,
dictData: 'number'
},
{
label: '支付金额',
@ -109,6 +110,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '支付状态',
field: 'status',
dictType: DICT_TYPE.PAY_ORDER_STATUS,
dictData: 'number',
search: {
show: true
}
@ -137,6 +139,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '退款状态',
field: 'refundStatus',
dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -67,6 +67,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '退款类型',
field: 'type',
dictType: DICT_TYPE.PAY_REFUND_ORDER_TYPE,
dictData: 'number',
search: {
show: true
}
@ -75,6 +76,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.PAY_REFUND_ORDER_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -96,7 +96,8 @@ export const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number'
},
{
label: t('form.remark'),

View File

@ -40,7 +40,8 @@ const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number'
},
{
label: t('common.createTime'),

View File

@ -22,6 +22,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '错误码类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_ERROR_CODE_TYPE,
dictData: 'number',
isSearch: true
},
{

View File

@ -12,7 +12,8 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '日志类型',
field: 'logType',
dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE
dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE,
dictData: 'number'
},
{
title: '用户名称',
@ -26,19 +27,26 @@ const crudSchemas = reactive<VxeCrudSchema>({
},
{
title: '浏览器',
field: 'userAgent' // TODO 星语调宽一点UA 稍微多展示一点,虽然最终都会缩略
field: 'userAgent',
table: {
width: 100
}
},
{
title: '登陆结果',
field: 'result',
dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT
dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT,
dictData: 'number'
},
{
title: '登录日期', // TODO 星语:有点窄,看看咋调宽一点,避免日期展示不全
title: '登录日期',
field: 'createTime',
formatter: 'formatDate',
isSearch: true,
table: {
width: 100
},
search: {
show: true,
itemRender: {
name: 'XDataTimePicker'
}

View File

@ -25,12 +25,14 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '公告类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE
dictType: DICT_TYPE.SYSTEM_NOTICE_TYPE,
dictData: 'number'
},
{
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{

View File

@ -45,6 +45,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{

View File

@ -26,6 +26,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '用户类型',
field: 'userType',
dictType: DICT_TYPE.USER_TYPE,
dictData: 'number',
isSearch: true
},
{

View File

@ -21,6 +21,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '操作类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_OPERATE_TYPE,
dictData: 'number',
isSearch: true
},
{

View File

@ -36,6 +36,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{

View File

@ -26,7 +26,8 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '角色类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_ROLE_TYPE
dictType: DICT_TYPE.SYSTEM_ROLE_TYPE,
dictData: 'number'
},
{
title: '角色标识',
@ -41,6 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{

View File

@ -154,6 +154,7 @@ const setDialogTile = (type: string) => {
// 新增操作
const handleCreate = () => {
tags.value = null
setDialogTile('create')
}
@ -162,6 +163,7 @@ const handleUpdate = async (rowId: number) => {
setDialogTile('update')
// 设置数据
const res = await SensitiveWordApi.getSensitiveWordApi(rowId)
tags.value = res.tags
unref(formRef)?.setValues(res)
}
@ -175,6 +177,7 @@ const submitForm = async () => {
// 提交请求
try {
const data = unref(formRef)?.formModel as SensitiveWordVO
data.tags = tags.value
if (actionType.value === 'create') {
await SensitiveWordApi.createSensitiveWordApi(data)
ElMessage.success(t('common.createSuccess'))

View File

@ -39,6 +39,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -34,6 +34,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{

View File

@ -23,18 +23,21 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '短信渠道',
field: 'channelId',
dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
dictData: 'number',
isSearch: true
},
{
title: '发送状态',
field: 'sendStatus',
dictType: DICT_TYPE.SYSTEM_SMS_SEND_STATUS,
dictData: 'number',
isSearch: true
},
{
title: '接收状态',
field: 'receiveStatus',
dictType: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS,
dictData: 'number',
isSearch: true
},
{
@ -46,6 +49,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '短信类型',
field: 'templateType',
dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
dictData: 'number',
isSearch: true
},
{

View File

@ -156,18 +156,18 @@ const handleCreate = () => {
// 修改操作
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
// 设置数据
const res = await SmsTemplateApi.getSmsTemplateApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
// 详情操作
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
// 设置数据
const res = await SmsTemplateApi.getSmsTemplateApi(rowId)
detailData.value = res
setDialogTile('detail')
}
// 删除操作

View File

@ -46,6 +46,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: '短信类型',
field: 'type',
dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
dictData: 'number',
table: {
width: 80
}
@ -54,6 +55,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
table: {
width: 80
}

View File

@ -106,6 +106,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: '租户状态',
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -39,6 +39,7 @@ const crudSchemas = reactive<CrudSchema[]>([
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
search: {
show: true
}

View File

@ -71,6 +71,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
title: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
dictData: 'number',
isSearch: true
},
{