mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-25 16:25:07 +08:00
1. 统一删除 dialog-footer,包括代码生成的模版
2. 查询参数列表,改下 3. 简化 formatDate 4. 看看是不是有部分新增的 plain 不对 5. modelVisible 改成 dialogVisible?modelTitle 改成 dialogTitle
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog title="分配角色" v-model="modelVisible">
|
||||
<Dialog title="分配角色" v-model="dialogVisible">
|
||||
<el-form ref="formRef" :model="formData" label-width="80px" v-loading="formLoading">
|
||||
<el-form-item label="用户名称">
|
||||
<el-input v-model="formData.username" :disabled="true" />
|
||||
@ -15,7 +15,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="modelVisible = false">取 消</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
@ -26,7 +26,7 @@ import * as RoleApi from '@/api/system/role'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const modelVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
@ -39,7 +39,7 @@ const roleList = ref([]) // 角色的列表
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (row: UserApi.UserVO) => {
|
||||
modelVisible.value = true
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
// 设置数据
|
||||
formData.value.id = row.id
|
||||
@ -72,7 +72,7 @@ const submitForm = async () => {
|
||||
roleIds: formData.value.roleIds
|
||||
})
|
||||
message.success(t('common.updateSuccess'))
|
||||
modelVisible.value = false
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success', true)
|
||||
} finally {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog :title="modelTitle" v-model="modelVisible">
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
@ -91,7 +91,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="modelVisible = false">取 消</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
@ -105,8 +105,8 @@ import * as UserApi from '@/api/system/user'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const modelVisible = ref(false) // 弹窗的是否展示
|
||||
const modelTitle = ref('') // 弹窗的标题
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
@ -148,8 +148,8 @@ const postList = ref([]) // 岗位列表
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
modelVisible.value = true
|
||||
modelTitle.value = t('action.' + type)
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
@ -186,7 +186,7 @@ const submitForm = async () => {
|
||||
await UserApi.updateUser(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
modelVisible.value = false
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog title="用户导入" v-model="modelVisible" width="400">
|
||||
<Dialog title="用户导入" v-model="dialogVisible" width="400">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:action="importUrl + '?updateSupport=' + updateSupport"
|
||||
@ -35,7 +35,7 @@
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="modelVisible = false">取 消</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
@ -45,7 +45,7 @@ import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||
import download from '@/utils/download'
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const modelVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中
|
||||
const uploadRef = ref()
|
||||
const importUrl =
|
||||
@ -56,7 +56,7 @@ const updateSupport = ref(0) // 是否更新已经存在的用户数据
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = () => {
|
||||
modelVisible.value = true
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
@ -70,11 +70,16 @@
|
||||
>
|
||||
<Icon icon="ep:plus" /> 新增
|
||||
</el-button>
|
||||
<el-button type="info" plain @click="handleImport" v-hasPermi="['system:user:import']">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
@click="handleImport"
|
||||
v-hasPermi="['system:user:import']"
|
||||
>
|
||||
<Icon icon="ep:upload" /> 导入
|
||||
</el-button>
|
||||
<el-button
|
||||
type="warning"
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
|
Reference in New Issue
Block a user