diff --git a/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue b/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue index 2e55512cc..abb23f50c 100644 --- a/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue +++ b/yudao-ui-admin-vue3/src/components/Descriptions/src/Descriptions.vue @@ -116,7 +116,7 @@ const toggleClick = () => { {{ dayjs(data[item.field]).format(item.dateFormat) }} - + {{ data[item.field] }} diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts index f439b7798..701162c4b 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeCrudSchemas.ts @@ -24,20 +24,20 @@ export type VxeCrudSchema = { columns: VxeCrudColumns[] } type VxeCrudColumns = Omit & { - field: string - title?: string - formatter?: VxeColumnPropTypes.Formatter - isSearch?: boolean - search?: CrudSearchParams - isTable?: boolean - table?: CrudTableParams - isForm?: boolean - form?: CrudFormParams - isDetail?: boolean - detail?: CrudDescriptionsParams - print?: CrudPrintParams - children?: VxeCrudColumns[] - dictType?: string + field: string // 字段名 + title?: string // 标题名 + formatter?: VxeColumnPropTypes.Formatter // vxe formatter格式化 + isSearch?: boolean // 是否在查询显示 + search?: CrudSearchParams // 查询的详细配置 + isTable?: boolean // 是否在列表显示 + table?: CrudTableParams // 列表的详细配置 + isForm?: boolean // 是否在表单显示 + form?: CrudFormParams // 表单的详细配置 + isDetail?: boolean // 是否在详情显示 + detail?: CrudDescriptionsParams // 详情的详细配置 + print?: CrudPrintParams // vxe 打印的字段 + children?: VxeCrudColumns[] // 子级 + dictType?: string // 字典类型 } type CrudSearchParams = { @@ -189,6 +189,7 @@ const filterTableSchema = (crudSchema: VxeCrudSchema): VxeGridPropTypes.Columns tableSchemaItem.showOverflow = 'tooltip' if (schemaItem?.formatter) { tableSchemaItem.formatter = schemaItem.formatter + tableSchemaItem.width = 160 } if (schemaItem?.dictType) { tableSchemaItem.cellRender = { @@ -222,6 +223,7 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { eachTree(crudSchema.columns, (schemaItem: VxeCrudColumns) => { // 判断是否显示 if (schemaItem?.isForm !== false) { + // 默认为 input let component = schemaItem?.form?.component || 'Input' const options: ComponentOptions[] = [] let comonentProps = {} @@ -232,15 +234,14 @@ const filterFormSchema = (crudSchema: VxeCrudSchema): FormSchema[] => { comonentProps = { options: options } - if (!(schemaItem.form && schemaItem.form.component)) component = 'Select' + if (!(schemaItem.form && schemaItem.form.component)) component = 'SelectV2' } const formSchemaItem = { - // 默认为 input - component: component, - componentProps: comonentProps, ...schemaItem.form, field: schemaItem.field, - label: schemaItem.form?.label || schemaItem.title + label: schemaItem.form?.label || schemaItem.title, + component: component, + componentProps: comonentProps } formSchema.push(formSchemaItem) diff --git a/yudao-ui-admin-vue3/src/locales/en.ts b/yudao-ui-admin-vue3/src/locales/en.ts index df1a5a611..5b81f29dc 100644 --- a/yudao-ui-admin-vue3/src/locales/en.ts +++ b/yudao-ui-admin-vue3/src/locales/en.ts @@ -17,6 +17,7 @@ export default { cancel: 'Cancel', close: 'Close', reload: 'Reload current', + success: 'Success', closeTab: 'Close current', closeTheLeftTab: 'Close left', closeTheRightTab: 'Close right', diff --git a/yudao-ui-admin-vue3/src/locales/zh-CN.ts b/yudao-ui-admin-vue3/src/locales/zh-CN.ts index 77ee81554..b16c67718 100644 --- a/yudao-ui-admin-vue3/src/locales/zh-CN.ts +++ b/yudao-ui-admin-vue3/src/locales/zh-CN.ts @@ -17,6 +17,7 @@ export default { cancel: '取消', close: '关闭', reload: '重新加载', + success: '成功', closeTab: '关闭标签页', closeTheLeftTab: '关闭左侧标签页', closeTheRightTab: '关闭右侧标签页', diff --git a/yudao-ui-admin-vue3/src/utils/dict.ts b/yudao-ui-admin-vue3/src/utils/dict.ts index 2cab7e176..a5d714abd 100644 --- a/yudao-ui-admin-vue3/src/utils/dict.ts +++ b/yudao-ui-admin-vue3/src/utils/dict.ts @@ -16,8 +16,8 @@ export interface DictDataType { dictType: string label: string value: string | number | boolean - colorType: ElementPlusInfoType | '' | 'default' | 'primary' - cssClass: string + colorType?: ElementPlusInfoType | '' | 'default' | 'primary' + cssClass?: string } export const getDictOptions = (dictType: string) => { @@ -41,10 +41,11 @@ export const getIntDictOptions = (dictType: string) => { }) } }) + console.log(dictOptions) return dictOptions } -export const getDictObj = (dictType: string, value: string) => { +export const getDictObj = (dictType: string, value: string | number | boolean) => { const dictOptions: DictDataType[] = getDictOptions(dictType) dictOptions.forEach((dict: DictDataType) => { if (dict.value === value) { diff --git a/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts b/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts index b1195534d..7da01c887 100644 --- a/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/oauth2/client/client.data.ts @@ -45,18 +45,24 @@ const crudSchemas = reactive({ }, { title: '访问令牌的有效期', - field: 'accessTokenValiditySeconds' // TODO @星语:数字输入框 + field: 'accessTokenValiditySeconds', + form: { + component: 'InputNumber' + } }, { title: '刷新令牌的有效期', - field: 'refreshTokenValiditySeconds' // TODO @星语:数字输入框 + field: 'refreshTokenValiditySeconds', + form: { + component: 'InputNumber' + } }, { title: '授权类型', field: 'authorizedGrantTypes', dictType: DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE, form: { - component: 'Select' // TODO @星语:多选 + component: 'SelectV2' // TODO @星语:多选 } }, { @@ -102,7 +108,7 @@ const crudSchemas = reactive({ { title: t('common.createTime'), field: 'createTime', - formatter: 'formatDate', // TODO @星语:宽度,保证时间可以展示出来 + formatter: 'formatDate', isForm: false } ] diff --git a/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue b/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue index ad8e707dc..37ba5f90c 100644 --- a/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue @@ -57,7 +57,6 @@ :rules="rules" /> - { // 强退操作 const handleForceLogout = (rowId: number) => { message - .delConfirm() + .confirm('是否要强制退出用户') .then(async () => { await TokenApi.deleteAccessTokenApi(rowId) - message.success(t('common.delSuccess')) // TODO 星语:提示内容不对 + message.success(t('common.success')) }) .finally(() => { // 刷新列表 diff --git a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue index de84537ff..686aeb985 100644 --- a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue @@ -45,6 +45,7 @@ // 全局相关的 import import { ref } from 'vue' import { useI18n } from '@/hooks/web/useI18n' +import { useMessage } from '@/hooks/web/useMessage' import { useVxeGrid } from '@/hooks/web/useVxeGrid' import { VxeGridInstance } from 'vxe-table' // 业务相关的 import @@ -53,6 +54,7 @@ import { allSchemas } from './operatelog.data' import download from '@/utils/download' const { t } = useI18n() // 国际化 +const message = useMessage() // 消息弹窗 // 列表相关的变量 const xGrid = ref() // 列表 Grid Ref const { gridOptions } = useVxeGrid({ @@ -73,13 +75,14 @@ const handleDetail = (row: OperateLogApi.OperateLogVO) => { } // 导出操作 -// TODO @星语:导出需要有二次确认哈 const handleExport = async () => { - const queryParams = Object.assign( - {}, - JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈? - ) - const res = await OperateLogApi.exportOperateLogApi(queryParams) - download.excel(res, '岗位列表.xls') + message.exportConfirm().then(async () => { + const queryParams = Object.assign( + {}, + JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈? + ) + const res = await OperateLogApi.exportOperateLogApi(queryParams) + download.excel(res, '岗位列表.xls') + }) }