Skip to content

Commit 0c71d0d

Browse files
committed
Merge remote-tracking branch 'origin/dev' into dev
2 parents 636e07f + 1a43113 commit 0c71d0d

File tree

12 files changed

+87
-127
lines changed

12 files changed

+87
-127
lines changed

src/api/system/role/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ export interface RoleVO {
1010
createTime: Date
1111
}
1212

13-
export interface RolePageReqVO extends PageParam {
14-
name?: string
15-
code?: string
16-
status?: number
17-
createTime?: Date[]
18-
}
19-
2013
export interface UpdateStatusReqVO {
2114
id: number
2215
status: number
2316
}
2417

2518
// 查询角色列表
26-
export const getRolePageApi = async (params: RolePageReqVO) => {
19+
export const getRolePage = async (params: PageParam) => {
2720
return await request.get({ url: '/system/role/page', params })
2821
}
2922

@@ -33,26 +26,33 @@ export const getSimpleRoleList = async (): Promise<RoleVO[]> => {
3326
}
3427

3528
// 查询角色详情
36-
export const getRoleApi = async (id: number) => {
29+
export const getRole = async (id: number) => {
3730
return await request.get({ url: '/system/role/get?id=' + id })
3831
}
3932

4033
// 新增角色
41-
export const createRoleApi = async (data: RoleVO) => {
34+
export const createRole = async (data: RoleVO) => {
4235
return await request.post({ url: '/system/role/create', data })
4336
}
4437

4538
// 修改角色
46-
export const updateRoleApi = async (data: RoleVO) => {
39+
export const updateRole = async (data: RoleVO) => {
4740
return await request.put({ url: '/system/role/update', data })
4841
}
4942

5043
// 修改角色状态
51-
export const updateRoleStatusApi = async (data: UpdateStatusReqVO) => {
44+
export const updateRoleStatus = async (data: UpdateStatusReqVO) => {
5245
return await request.put({ url: '/system/role/update-status', data })
5346
}
5447

5548
// 删除角色
56-
export const deleteRoleApi = async (id: number) => {
49+
export const deleteRole = async (id: number) => {
5750
return await request.delete({ url: '/system/role/delete?id=' + id })
5851
}
52+
// 导出角色
53+
export const exportRole = (params) => {
54+
return request.download({
55+
url: '/system/role/export-excel',
56+
params
57+
})
58+
}

src/types/auto-components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ declare module '@vue/runtime-core' {
100100
ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default']
101101
Search: typeof import('./../components/Search/src/Search.vue')['default']
102102
SignalAndMessage: typeof import('./../components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue')['default']
103-
Src: typeof import('./../components/RightToolbar/src/index.vue')['default']
104103
Sticky: typeof import('./../components/Sticky/src/Sticky.vue')['default']
105104
Table: typeof import('./../components/Table/src/Table.vue')['default']
106105
Tooltip: typeof import('./../components/Tooltip/src/Tooltip.vue')['default']

src/views/system/notice/form.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
<script setup lang="ts">
4747
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
4848
import * as NoticeApi from '@/api/system/notice'
49-
5049
const { t } = useI18n() // 国际化
5150
const message = useMessage() // 消息弹窗
5251

src/views/system/role/MenuPermissionForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ import type { FormExpose } from '@/components/Form'
9696
import { handleTree, defaultProps } from '@/utils/tree'
9797
import { SystemDataScopeEnum } from '@/utils/constants'
9898
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
99-
import { listSimpleMenusApi } from '@/api/system/menu'
100-
import { listSimpleDeptApi } from '@/api/system/dept'
99+
import * as MenuApi from '@/api/system/menu'
100+
import * as DeptApi from '@/api/system/dept'
101101
import * as PermissionApi from '@/api/system/permission'
102102
// ========== CRUD 相关 ==========
103103
const actionLoading = ref(false) // 遮罩层
@@ -131,7 +131,7 @@ const openModal = async (type: string, row: RoleApi.RoleVO) => {
131131
actionScopeType.value = type
132132
dialogScopeVisible.value = true
133133
if (type === 'menu') {
134-
const menuRes = await listSimpleMenusApi()
134+
const menuRes = await MenuApi.getSimpleMenusList()
135135
treeOptions.value = handleTree(menuRes)
136136
const role = await PermissionApi.listRoleMenusApi(row.id)
137137
if (role) {
@@ -140,7 +140,7 @@ const openModal = async (type: string, row: RoleApi.RoleVO) => {
140140
})
141141
}
142142
} else if (type === 'data') {
143-
const deptRes = await listSimpleDeptApi()
143+
const deptRes = await DeptApi.getSimpleDeptList()
144144
treeOptions.value = handleTree(deptRes)
145145
const role = await RoleApi.getRole(row.id)
146146
dataScopeForm.dataScope = role.dataScope

src/views/system/role/RoleForm.vue

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<Dialog :title="dialogTitle" v-model="modelVisible" width="800">
2+
<Dialog :title="modelTitle" v-model="modelVisible">
33
<el-form
44
ref="formRef"
55
:model="formData"
@@ -10,9 +10,6 @@
1010
<el-form-item label="角色名称" prop="name">
1111
<el-input v-model="formData.name" placeholder="请输入角色名称" />
1212
</el-form-item>
13-
<el-form-item label="角色类型" prop="type">
14-
<el-input :model-value="formData.type" placeholder="请输入角色类型" height="150px" />
15-
</el-form-item>
1613
<el-form-item label="角色标识" prop="code">
1714
<el-input :model-value="formData.code" placeholder="请输入角色标识" height="150px" />
1815
</el-form-item>
@@ -22,10 +19,10 @@
2219
<el-form-item label="状态" prop="status">
2320
<el-select v-model="formData.status" placeholder="请选择状态" clearable>
2421
<el-option
25-
v-for="dict in getDictOptions(DICT_TYPE.COMMON_STATUS)"
26-
:key="parseInt(dict.value)"
22+
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
23+
:key="dict.value"
2724
:label="dict.label"
28-
:value="parseInt(dict.value)"
25+
:value="dict.value"
2926
/>
3027
</el-select>
3128
</el-form-item>
@@ -34,35 +31,25 @@
3431
</el-form-item>
3532
</el-form>
3633
<template #footer>
37-
<div class="dialog-footer">
38-
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
39-
<el-button @click="modelVisible = false">取 消</el-button>
40-
</div>
34+
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
35+
<el-button @click="modelVisible = false">取 消</el-button>
4136
</template>
4237
</Dialog>
4338
</template>
4439
<script setup lang="ts">
45-
import { getDictOptions } from '@/utils/dict'
46-
import { CommonStatusEnum } from '@/utils/constants'
47-
import type { FormExpose } from '@/components/Form'
4840
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
41+
import { CommonStatusEnum } from '@/utils/constants'
4942
import * as RoleApi from '@/api/system/role'
50-
// ========== CRUD 相关 ==========
51-
const dialogTitle = ref('edit') // 弹出层标题
52-
const formRef = ref<FormExpose>() // 表单 Ref
5343
const { t } = useI18n() // 国际化
54-
const dataScopeDictDatas = ref()
5544
const message = useMessage() // 消息弹窗
5645
5746
const modelVisible = ref(false) // 弹窗的是否展示
5847
const modelTitle = ref('') // 弹窗的标题
5948
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
6049
const formType = ref('') // 表单的类型:create - 新增;update - 修改
61-
6250
const formData = ref({
6351
id: undefined,
6452
name: '',
65-
type: '',
6653
code: '',
6754
sort: undefined,
6855
status: CommonStatusEnum.ENABLE,
@@ -75,9 +62,10 @@ const formRules = reactive({
7562
status: [{ required: true, message: '岗位状态不能为空', trigger: 'change' }],
7663
remark: [{ required: false, message: '岗位内容不能为空', trigger: 'blur' }]
7764
})
65+
const formRef = ref() // 表单 Ref
7866
7967
/** 打开弹窗 */
80-
const openModal = async (type: string, id?: number) => {
68+
const open = async (type: string, id?: number) => {
8169
modelVisible.value = true
8270
modelTitle.value = t('action.' + type)
8371
formType.value = type
@@ -92,6 +80,7 @@ const openModal = async (type: string, id?: number) => {
9280
}
9381
}
9482
}
83+
9584
/** 重置表单 */
9685
const resetForm = () => {
9786
formData.value = {
@@ -104,7 +93,8 @@ const resetForm = () => {
10493
}
10594
formRef.value?.resetFields()
10695
}
107-
defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
96+
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
97+
10898
/** 提交表单 */
10999
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
110100
const submitForm = async () => {
@@ -130,19 +120,4 @@ const submitForm = async () => {
130120
formLoading.value = false
131121
}
132122
}
133-
134-
const init = () => {
135-
dataScopeDictDatas.value = getIntDictOptions(DICT_TYPE.SYSTEM_DATA_SCOPE)
136-
}
137-
// ========== 初始化 ==========
138-
onMounted(() => {
139-
init()
140-
})
141123
</script>
142-
<style scoped>
143-
.card {
144-
width: 100%;
145-
max-height: 400px;
146-
overflow-y: scroll;
147-
}
148-
</style>

src/views/system/role/index.vue

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
placeholder="请输入角色名称"
1515
clearable
1616
@keyup.enter="handleQuery"
17+
class="!w-240px"
1718
/>
1819
</el-form-item>
1920
<el-form-item label="角色标识" prop="code">
@@ -22,10 +23,11 @@
2223
placeholder="请输入角色标识"
2324
clearable
2425
@keyup.enter="handleQuery"
26+
class="!w-240px"
2527
/>
2628
</el-form-item>
2729
<el-form-item label="状态" prop="status">
28-
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
30+
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
2931
<el-option
3032
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
3133
:key="dict.value"
@@ -48,7 +50,12 @@
4850
<el-form-item>
4951
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
5052
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
51-
<el-button type="primary" @click="openModal('create')" v-hasPermi="['system:role:create']">
53+
<el-button
54+
type="primary"
55+
plain
56+
@click="openForm('create')"
57+
v-hasPermi="['system:role:create']"
58+
>
5259
<Icon icon="ep:plus" class="mr-5px" /> 新增
5360
</el-button>
5461
<el-button
@@ -66,7 +73,7 @@
6673

6774
<!-- 列表 -->
6875
<ContentWrap>
69-
<el-table v-loading="loading" :data="list" align="center">
76+
<el-table v-loading="loading" :data="list">
7077
<el-table-column label="角色编号" align="center" prop="id" />
7178
<el-table-column label="角色名称" align="center" prop="name" />
7279
<el-table-column label="角色类型" align="center" prop="type" />
@@ -90,12 +97,11 @@
9097
<el-button
9198
link
9299
type="primary"
93-
@click="openModal('update', scope.row.id)"
100+
@click="openForm('update', scope.row.id)"
94101
v-hasPermi="['system:role:update']"
95102
>
96103
编辑
97104
</el-button>
98-
<!-- 操作:菜单权限 -->
99105
<el-button
100106
link
101107
type="primary"
@@ -106,7 +112,6 @@
106112
>
107113
菜单权限
108114
</el-button>
109-
<!-- 操作:数据权限 -->
110115
<el-button
111116
link
112117
type="primary"
@@ -149,18 +154,12 @@ import MenuPermissionForm from './MenuPermissionForm.vue'
149154
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
150155
import { dateFormatter } from '@/utils/formatTime'
151156
import download from '@/utils/download'
152-
153157
const message = useMessage() // 消息弹窗
154158
const { t } = useI18n() // 国际化
159+
155160
const loading = ref(true) // 列表的加载中
156161
const total = ref(0) // 列表的总页数
157162
const list = ref([]) // 列表的数据
158-
const dialogTitle = ref('编辑') // 弹出层标题
159-
const actionType = ref('') // 操作按钮的类型
160-
const modelVisible = ref(false) // 是否显示弹出层
161-
const queryFormRef = ref() // 搜索的表单
162-
const exportLoading = ref(false) // 导出的加载中
163-
164163
const queryParams = reactive({
165164
pageNo: 1,
166165
pageSize: 10,
@@ -169,13 +168,8 @@ const queryParams = reactive({
169168
status: undefined,
170169
createTime: []
171170
})
172-
173-
// 设置标题
174-
const setDialogTile = (type: string) => {
175-
dialogTitle.value = t('action.' + type)
176-
actionType.value = type
177-
modelVisible.value = true
178-
}
171+
const queryFormRef = ref() // 搜索的表单
172+
const exportLoading = ref(false) // 导出的加载中
179173
180174
/** 查询角色列表 */
181175
const getList = async () => {
@@ -203,9 +197,14 @@ const resetQuery = () => {
203197
204198
/** 添加/修改操作 */
205199
const formRef = ref()
206-
const openModal = (type: string, id?: number) => {
207-
setDialogTile('编辑')
208-
formRef.value.openModal(type, id)
200+
const openForm = (type: string, id?: number) => {
201+
formRef.value.open(type, id)
202+
}
203+
204+
/** 数据权限操作 */
205+
const menuPermissionFormRef = ref()
206+
const handleScope = async (type: string, row: RoleApi.RoleVO) => {
207+
menuPermissionFormRef.value.openForm(type, row)
209208
}
210209
211210
/** 删除按钮操作 */
@@ -228,20 +227,14 @@ const handleExport = async () => {
228227
await message.exportConfirm()
229228
// 发起导出
230229
exportLoading.value = true
231-
const data = await RoleApi.exportPostApi(queryParams)
230+
const data = await RoleApi.exportRole(queryParams)
232231
download.excel(data, '角色列表.xls')
233232
} catch {
234233
} finally {
235234
exportLoading.value = false
236235
}
237236
}
238-
/** 数据权限操作 */
239-
const menuPermissionFormRef = ref()
240237
241-
// 权限操作
242-
const handleScope = async (type: string, row: RoleApi.RoleVO) => {
243-
menuPermissionFormRef.value.openModal(type, row)
244-
}
245238
/** 初始化 **/
246239
onMounted(() => {
247240
getList()

src/views/system/sms/template/SmsTemplateForm.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<el-radio
4545
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
4646
:key="dict.value"
47-
:label="parseInt(dict.value)"
47+
:label="parseInt(dict.value as string)"
4848
>
4949
{{ dict.label }}
5050
</el-radio>
@@ -96,7 +96,7 @@ const formRules = reactive({
9696
channelId: [{ required: true, message: '短信渠道编号不能为空', trigger: 'change' }]
9797
})
9898
const formRef = ref() // 表单 Ref
99-
const channelList = ref([]) // 短信渠道列表
99+
const channelList = ref<SmsChannelApi.SmsChannelVO[]>([]) // 短信渠道列表
100100
101101
const open = async (type: string, id?: number) => {
102102
modelVisible.value = true

0 commit comments

Comments
 (0)