1. 统一删除 dialog-footer,包括代码生成的模版

2. 查询参数列表,改下
3. 简化 formatDate
4. 看看是不是有部分新增的 plain 不对
5. modelVisible 改成 dialogVisible?modelTitle 改成 dialogTitle
This commit is contained in:
YunaiV
2023-04-02 23:52:56 +08:00
parent 87a5ddfd2c
commit 0d6ecfb45c
77 changed files with 363 additions and 341 deletions

View File

@ -11,7 +11,7 @@
</ContentWrap>
<!-- 表单保存的弹窗 -->
<Dialog title="保存表单" v-model="modelVisible" width="600">
<Dialog title="保存表单" v-model="dialogVisible" width="600">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="表单名" prop="name">
<el-input v-model="formData.name" placeholder="请输入表单名" />
@ -33,7 +33,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>
@ -48,7 +48,7 @@ const message = useMessage() // 消息
const { query } = useRoute() // 路由
const designer = ref() // 表单设计器
const modelVisible = ref(false) // 弹窗是否展示
const dialogVisible = ref(false) // 弹窗是否展示
const formLoading = ref(false) // 表单的加载中:提交的按钮禁用
const formData = ref({
name: '',
@ -63,7 +63,7 @@ const formRef = ref() // 表单 Ref
/** 处理保存按钮 */
const handleSave = () => {
modelVisible.value = true
dialogVisible.value = true
}
/** 提交表单 */
@ -85,7 +85,7 @@ const submitForm = async () => {
await FormApi.updateForm(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
} finally {
formLoading.value = false
}

View File

@ -20,7 +20,7 @@
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" @click="openForm()" v-hasPermi="['bpm:form:create']">
<el-button type="primary" plain @click="openForm" v-hasPermi="['bpm:form:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
</el-form-item>

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -37,7 +37,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>
@ -50,8 +50,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({
@ -72,8 +72,8 @@ const userList = 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()
// 修改时,设置数据
@ -108,7 +108,7 @@ const submitForm = async () => {
await UserGroupApi.updateUserGroup(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {

View File

@ -43,6 +43,7 @@
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['bpm:user-group:create']"
>

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible" width="600">
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600">
<el-form
ref="formRef"
:model="formData"
@ -117,7 +117,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>
@ -129,8 +129,8 @@ import * as FormApi from '@/api/bpm/form'
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({
@ -154,8 +154,8 @@ const formList = 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()
// 修改时,设置数据
@ -203,7 +203,7 @@ const submitForm = async () => {
await ModelApi.updateModel(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="导入流程" v-model="modelVisible" width="400">
<Dialog title="导入流程" v-model="dialogVisible" width="400">
<div>
<el-upload
ref="uploadRef"
@ -45,7 +45,7 @@
</div>
<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>
@ -53,7 +53,7 @@
import { getAccessToken, getTenantId } from '@/utils/auth'
const message = useMessage() // 消息弹窗
const modelVisible = ref(false) // 弹窗的是否展示
const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) // 表单的加载中
const formData = ref({
key: '',
@ -72,7 +72,7 @@ const fileList = ref([]) // 文件列表
/** 打开弹窗 */
const open = async () => {
modelVisible.value = true
dialogVisible.value = true
resetForm()
}
defineExpose({ open }) // 提供 open 方法,用于打开弹窗

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="转派审批人" v-model="modelVisible" width="500">
<Dialog title="转派审批人" v-model="dialogVisible" width="500">
<el-form
ref="formRef"
:model="formData"
@ -20,7 +20,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>
@ -28,7 +28,7 @@
import * as TaskApi from '@/api/bpm/task'
import * as UserApi from '@/api/system/user'
const modelVisible = ref(false) // 弹窗的是否展示
const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) // 表单的加载中
const formData = ref({
id: '',
@ -43,7 +43,7 @@ const userList = ref<any[]>([]) // 用户列表
/** 打开弹窗 */
const open = async (id: string) => {
modelVisible.value = true
dialogVisible.value = true
resetForm()
formData.value.id = id
// 获得用户列表
@ -62,7 +62,7 @@ const submitForm = async () => {
formLoading.value = true
try {
await TaskApi.updateTaskAssignee(formData.value)
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="修改任务规则" v-model="modelVisible" width="600">
<Dialog title="修改任务规则" v-model="dialogVisible" width="600">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="任务名称" prop="taskDefinitionName">
<el-input v-model="formData.taskDefinitionName" placeholder="请输入流标标识" disabled />
@ -93,7 +93,7 @@
<!-- 操作按钮 -->
<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>
@ -109,7 +109,7 @@ import * as UserGroupApi from '@/api/bpm/userGroup'
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const modelVisible = ref(false) // 弹窗的是否展示
const dialogVisible = ref(false) // 弹窗的是否展示
const formLoading = ref(false) // 表单的加载中1修改时的数据加载2提交的按钮禁用
const formData = ref({
type: Number(undefined),
@ -171,7 +171,7 @@ const open = async (modelId: string, row: TaskAssignRuleApi.TaskAssignVO) => {
formData.value.scripts.push(...row.options)
}
// 打开弹窗
modelVisible.value = true
dialogVisible.value = true
// 获得角色列表
roleOptions.value = await RoleApi.getSimpleRoleList()
@ -232,7 +232,7 @@ const submitForm = async () => {
await TaskAssignRuleApi.updateTaskAssignRule(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
} finally {