diff --git a/src/api/system/role/index.ts b/src/api/system/role/index.ts index 9692548a..902d5ca6 100644 --- a/src/api/system/role/index.ts +++ b/src/api/system/role/index.ts @@ -10,20 +10,13 @@ export interface RoleVO { createTime: Date } -export interface RolePageReqVO extends PageParam { - name?: string - code?: string - status?: number - createTime?: Date[] -} - export interface UpdateStatusReqVO { id: number status: number } // 查询角色列表 -export const getRolePageApi = async (params: RolePageReqVO) => { +export const getRolePage = async (params: PageParam) => { return await request.get({ url: '/system/role/page', params }) } @@ -33,26 +26,33 @@ export const getSimpleRoleList = async (): Promise => { } // 查询角色详情 -export const getRoleApi = async (id: number) => { +export const getRole = async (id: number) => { return await request.get({ url: '/system/role/get?id=' + id }) } // 新增角色 -export const createRoleApi = async (data: RoleVO) => { +export const createRole = async (data: RoleVO) => { return await request.post({ url: '/system/role/create', data }) } // 修改角色 -export const updateRoleApi = async (data: RoleVO) => { +export const updateRole = async (data: RoleVO) => { return await request.put({ url: '/system/role/update', data }) } // 修改角色状态 -export const updateRoleStatusApi = async (data: UpdateStatusReqVO) => { +export const updateRoleStatus = async (data: UpdateStatusReqVO) => { return await request.put({ url: '/system/role/update-status', data }) } // 删除角色 -export const deleteRoleApi = async (id: number) => { +export const deleteRole = async (id: number) => { return await request.delete({ url: '/system/role/delete?id=' + id }) } +// 导出角色 +export const exportRole = (params) => { + return request.download({ + url: '/system/role/export-excel', + params + }) +} diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 04eb4d9e..cb8ff559 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -100,7 +100,6 @@ declare module '@vue/runtime-core' { ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default'] Search: typeof import('./../components/Search/src/Search.vue')['default'] SignalAndMessage: typeof import('./../components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue')['default'] - Src: typeof import('./../components/RightToolbar/src/index.vue')['default'] Sticky: typeof import('./../components/Sticky/src/Sticky.vue')['default'] Table: typeof import('./../components/Table/src/Table.vue')['default'] Tooltip: typeof import('./../components/Tooltip/src/Tooltip.vue')['default'] diff --git a/src/views/system/notice/form.vue b/src/views/system/notice/form.vue index 141dd131..87e75623 100644 --- a/src/views/system/notice/form.vue +++ b/src/views/system/notice/form.vue @@ -46,7 +46,6 @@ - diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 12ef7845..0e75d67d 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -14,6 +14,7 @@ placeholder="请输入角色名称" clearable @keyup.enter="handleQuery" + class="!w-240px" /> @@ -22,10 +23,11 @@ placeholder="请输入角色标识" clearable @keyup.enter="handleQuery" + class="!w-240px" /> - + 搜索 重置 - + 新增 - + @@ -90,12 +97,11 @@ 编辑 - 菜单权限 - { - dialogTitle.value = t('action.' + type) - actionType.value = type - modelVisible.value = true -} +const queryFormRef = ref() // 搜索的表单 +const exportLoading = ref(false) // 导出的加载中 /** 查询角色列表 */ const getList = async () => { @@ -203,9 +197,14 @@ const resetQuery = () => { /** 添加/修改操作 */ const formRef = ref() -const openModal = (type: string, id?: number) => { - setDialogTile('编辑') - formRef.value.openModal(type, id) +const openForm = (type: string, id?: number) => { + formRef.value.open(type, id) +} + +/** 数据权限操作 */ +const menuPermissionFormRef = ref() +const handleScope = async (type: string, row: RoleApi.RoleVO) => { + menuPermissionFormRef.value.openForm(type, row) } /** 删除按钮操作 */ @@ -228,20 +227,14 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await RoleApi.exportPostApi(queryParams) + const data = await RoleApi.exportRole(queryParams) download.excel(data, '角色列表.xls') } catch { } finally { exportLoading.value = false } } -/** 数据权限操作 */ -const menuPermissionFormRef = ref() -// 权限操作 -const handleScope = async (type: string, row: RoleApi.RoleVO) => { - menuPermissionFormRef.value.openModal(type, row) -} /** 初始化 **/ onMounted(() => { getList() diff --git a/src/views/system/sms/template/SmsTemplateForm.vue b/src/views/system/sms/template/SmsTemplateForm.vue index e6bdce6c..03684215 100644 --- a/src/views/system/sms/template/SmsTemplateForm.vue +++ b/src/views/system/sms/template/SmsTemplateForm.vue @@ -44,7 +44,7 @@ {{ dict.label }} @@ -96,7 +96,7 @@ const formRules = reactive({ channelId: [{ required: true, message: '短信渠道编号不能为空', trigger: 'change' }] }) const formRef = ref() // 表单 Ref -const channelList = ref([]) // 短信渠道列表 +const channelList = ref([]) // 短信渠道列表 const open = async (type: string, id?: number) => { modelVisible.value = true diff --git a/src/views/system/sms/template/index.vue b/src/views/system/sms/template/index.vue index f43b8f62..906436a5 100644 --- a/src/views/system/sms/template/index.vue +++ b/src/views/system/sms/template/index.vue @@ -166,12 +166,7 @@ width="180" :formatter="dateFormatter" /> - +