This commit is contained in:
shizhong 2023-06-13 10:56:20 +08:00
parent 38fa336816
commit 7cfb09fe3c
26 changed files with 173 additions and 126 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@ pnpm-debug
.idea .idea
.history .history
yarn.lock
*.iml

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -37,7 +37,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -50,8 +50,8 @@ import * as UserApi from '@/api/system/user'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -72,8 +72,8 @@ const userList = ref([]) // 用户列表
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -108,7 +108,7 @@ const submitForm = async () => {
await UserGroupApi.updateUserGroup(data) await UserGroupApi.updateUserGroup(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible" width="600"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="600">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -117,7 +117,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -129,8 +129,8 @@ import * as FormApi from '@/api/bpm/form'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -154,8 +154,8 @@ const formList = ref([]) // 流程表单的下拉框的数据
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -203,7 +203,7 @@ const submitForm = async () => {
await ModelApi.updateModelApi(data) await ModelApi.updateModelApi(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="导入流程" v-model="modelVisible" width="400"> <Dialog title="导入流程" v-model="dialogVisible" width="400">
<div> <div>
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
@ -45,7 +45,7 @@
</div> </div>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -53,7 +53,7 @@
import { getAccessToken, getTenantId } from '@/utils/auth' import { getAccessToken, getTenantId } from '@/utils/auth'
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // const formLoading = ref(false) //
const formData = ref({ const formData = ref({
key: '', key: '',
@ -72,7 +72,7 @@ const fileList = ref([]) // 文件列表
/** 打开弹窗 */ /** 打开弹窗 */
const open = async () => { const open = async () => {
modelVisible.value = true dialogVisible.value = true
resetForm() resetForm()
} }
defineExpose({ open }) // open defineExpose({ open }) // open

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="转派审批人" v-model="modelVisible" width="500"> <Dialog title="转派审批人" v-model="dialogVisible" width="500">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -20,7 +20,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -28,7 +28,7 @@
import * as TaskApi from '@/api/bpm/task' import * as TaskApi from '@/api/bpm/task'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // const formLoading = ref(false) //
const formData = ref({ const formData = ref({
id: '', id: '',
@ -43,7 +43,7 @@ const userList = ref<any[]>([]) // 用户列表
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id: string) => { const open = async (id: string) => {
modelVisible.value = true dialogVisible.value = true
resetForm() resetForm()
formData.value.id = id formData.value.id = id
// //
@ -62,7 +62,7 @@ const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
await TaskApi.updateTaskAssignee(formData.value) await TaskApi.updateTaskAssignee(formData.value)
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <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 ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="任务名称" prop="taskDefinitionName"> <el-form-item label="任务名称" prop="taskDefinitionName">
<el-input v-model="formData.taskDefinitionName" placeholder="请输入流标标识" disabled /> <el-input v-model="formData.taskDefinitionName" placeholder="请输入流标标识" disabled />
@ -93,7 +93,7 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -109,7 +109,7 @@ import * as UserGroupApi from '@/api/bpm/userGroup'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formData = ref({ const formData = ref({
type: Number(undefined), type: Number(undefined),
@ -171,7 +171,7 @@ const open = async (modelId: string, row: TaskAssignRuleApi.TaskAssignVO) => {
formData.value.scripts.push(...row.options) formData.value.scripts.push(...row.options)
} }
// //
modelVisible.value = true dialogVisible.value = true
// //
roleOptions.value = await RoleApi.getSimpleRoleList() roleOptions.value = await RoleApi.getSimpleRoleList()
@ -232,7 +232,7 @@ const submitForm = async () => {
await TaskAssignRuleApi.updateTaskAssignRule(data) await TaskAssignRuleApi.updateTaskAssignRule(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800"> <Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500" width="800">
<el-descriptions border :column="1"> <el-descriptions border :column="1">
<el-descriptions-item label="日志主键" min-width="120"> <el-descriptions-item label="日志主键" min-width="120">
{{ detailData.id }} {{ detailData.id }}
@ -45,13 +45,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as ApiAccessLog from '@/api/infra/apiAccessLog' import * as ApiAccessLog from '@/api/infra/apiAccessLog'
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const detailLoading = ref(false) // const detailLoading = ref(false) //
const detailData = ref() // const detailData = ref() //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (data: ApiAccessLog.ApiAccessLogVO) => { const open = async (data: ApiAccessLog.ApiAccessLogVO) => {
modelVisible.value = true dialogVisible.value = true
// //
detailLoading.value = true detailLoading.value = true
try { try {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800"> <Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500" width="800">
<el-descriptions border :column="1"> <el-descriptions border :column="1">
<el-descriptions-item label="日志主键" min-width="120"> <el-descriptions-item label="日志主键" min-width="120">
{{ detailData.id }} {{ detailData.id }}
@ -60,13 +60,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as ApiErrorLog from '@/api/infra/apiErrorLog' import * as ApiErrorLog from '@/api/infra/apiErrorLog'
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const detailLoading = ref(false) // const detailLoading = ref(false) //
const detailData = ref() // const detailData = ref() //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (data: ApiErrorLog.ApiErrorLogVO) => { const open = async (data: ApiErrorLog.ApiErrorLogVO) => {
modelVisible.value = true dialogVisible.value = true
// //
detailLoading.value = true detailLoading.value = true
try { try {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="导入表" v-model="modelVisible" width="800px"> <Dialog title="导入表" v-model="dialogVisible" width="800px">
<!-- 搜索栏 --> <!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="数据源" prop="dataSourceConfigId"> <el-form-item label="数据源" prop="dataSourceConfigId">
@ -69,7 +69,7 @@ import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const dbTableLoading = ref(true) // const dbTableLoading = ref(true) //
const dbTableList = ref<CodegenApi.DatabaseTableVO[]>([]) // const dbTableList = ref<CodegenApi.DatabaseTableVO[]>([]) //
const queryParams = reactive({ const queryParams = reactive({
@ -103,7 +103,7 @@ const open = async () => {
// //
dataSourceConfigList.value = await DataSourceConfigApi.getDataSourceConfigList() dataSourceConfigList.value = await DataSourceConfigApi.getDataSourceConfigList()
queryParams.dataSourceConfigId = dataSourceConfigList.value[0].id as number queryParams.dataSourceConfigId = dataSourceConfigList.value[0].id as number
modelVisible.value = true dialogVisible.value = true
// //
await getList() await getList()
} }
@ -111,7 +111,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 关闭弹窗 */ /** 关闭弹窗 */
const close = () => { const close = () => {
modelVisible.value = false dialogVisible.value = false
tableList.value = [] tableList.value = []
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<Dialog <Dialog
title="代码预览" title="代码预览"
v-model="modelVisible" v-model="dialogVisible"
align-center align-center
width="80%" width="80%"
class="app-infra-codegen-preview-container" class="app-infra-codegen-preview-container"
@ -61,7 +61,7 @@ import * as CodegenApi from '@/api/infra/codegen'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const loading = ref(false) // const loading = ref(false) //
const preview = reactive({ const preview = reactive({
fileTree: [], // fileTree: [], //
@ -86,7 +86,7 @@ interface filesType {
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id: number) => { const open = async (id: number) => {
modelVisible.value = true dialogVisible.value = true
try { try {
loading.value = true loading.value = true
// //

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -36,7 +36,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -47,8 +47,8 @@ import * as ConfigApi from '@/api/infra/config'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -71,8 +71,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async (type: string, id?: number) => { const openModal = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -105,7 +105,7 @@ const submitForm = async () => {
await ConfigApi.updateConfig(data) await ConfigApi.updateConfig(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -22,7 +22,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -32,8 +32,8 @@ import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref<DataSourceConfigApi.DataSourceConfigVO>({ const formData = ref<DataSourceConfigApi.DataSourceConfigVO>({
@ -53,8 +53,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async (type: string, id?: number) => { const openModal = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -87,7 +87,7 @@ const submitForm = async () => {
await DataSourceConfigApi.updateDataSourceConfig(data) await DataSourceConfigApi.updateDataSourceConfig(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
:limit="1" :limit="1"
@ -24,7 +24,7 @@
</el-upload> </el-upload>
<template #footer> <template #footer>
<el-button @click="submitFileForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitFileForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
@ -36,8 +36,8 @@ import { getAccessToken } from '@/utils/auth'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const url = import.meta.env.VITE_UPLOAD_URL const url = import.meta.env.VITE_UPLOAD_URL
const headers = { Authorization: 'Bearer ' + getAccessToken() } const headers = { Authorization: 'Bearer ' + getAccessToken() }
@ -46,8 +46,8 @@ const uploadRef = ref()
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async () => { const openModal = async () => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.fileUpload') dialogTitle.value = t('action.fileUpload')
} }
defineExpose({ openModal }) // openModal defineExpose({ openModal }) // openModal
@ -71,7 +71,7 @@ const submitFileForm = () => {
/** 文件上传成功处理 */ /** 文件上传成功处理 */
const handleFileSuccess = () => { const handleFileSuccess = () => {
// //
modelVisible.value = false dialogVisible.value = false
formLoading.value = false formLoading.value = false
unref(uploadRef)?.clearFiles() unref(uploadRef)?.clearFiles()
// //

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -94,7 +94,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -105,8 +105,8 @@ import * as FileConfigApi from '@/api/infra/fileConfig'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -137,8 +137,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const openModal = async (type: string, id?: number) => { const openModal = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -171,7 +171,7 @@ const submitForm = async () => {
await FileConfigApi.updateFileConfig(data) await FileConfigApi.updateFileConfig(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="任务详细" v-model="modelVisible" width="700px"> <Dialog title="任务详细" v-model="dialogVisible" width="700px">
<el-descriptions border :column="1"> <el-descriptions border :column="1">
<el-descriptions-item label="任务编号" min-width="60"> <el-descriptions-item label="任务编号" min-width="60">
{{ detailData.id }} {{ detailData.id }}
@ -47,14 +47,14 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as JobApi from '@/api/infra/job' import * as JobApi from '@/api/infra/job'
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const detailLoading = ref(false) // const detailLoading = ref(false) //
const detailData = ref({}) // const detailData = ref({}) //
const nextTimes = ref([]) // const nextTimes = ref([]) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id: number) => { const open = async (id: number) => {
modelVisible.value = true dialogVisible.value = true
// //
if (id) { if (id) {
detailLoading.value = true detailLoading.value = true

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -41,7 +41,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button type="primary" @click="submitForm" :loading="formLoading"> </el-button> <el-button type="primary" @click="submitForm" :loading="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
@ -50,8 +50,8 @@ import * as JobApi from '@/api/infra/job'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -72,8 +72,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -106,7 +106,7 @@ const submitForm = async () => {
await JobApi.updateJob(data) await JobApi.updateJob(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog title="任务详细" v-model="modelVisible" width="700px"> <Dialog title="任务详细" v-model="dialogVisible" width="700px">
<el-descriptions border :column="1"> <el-descriptions border :column="1">
<el-descriptions-item label="日志编号" min-width="60"> <el-descriptions-item label="日志编号" min-width="60">
{{ detailData.id }} {{ detailData.id }}
@ -36,13 +36,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as JobLogApi from '@/api/infra/jobLog' import * as JobLogApi from '@/api/infra/jobLog'
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const detailLoading = ref(false) // const detailLoading = ref(false) //
const detailData = ref({}) // const detailData = ref({}) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id: number) => { const open = async (id: number) => {
modelVisible.value = true dialogVisible.value = true
// //
if (id) { if (id) {
detailLoading.value = true detailLoading.value = true

View File

@ -0,0 +1,44 @@
export const parseTime = (time) => {
if (!time) {
return null
}
const format = '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time
.replace(new RegExp(/-/gm), '/')
.replace('T', ' ')
.replace(new RegExp(/\.[\d]{3}/gm), '')
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -46,7 +46,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -58,8 +58,8 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -81,8 +81,8 @@ const categoryTree = ref<any[]>([]) // 分类树
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -117,7 +117,7 @@ const submitForm = async () => {
await ProductCategoryApi.updateCategory(data) await ProductCategoryApi.updateCategory(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -17,7 +17,7 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</div> </div>
</template> </template>
</Dialog> </Dialog>
@ -27,8 +27,8 @@ import * as PropertyApi from '@/api/mall/product/property'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -42,8 +42,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -76,7 +76,7 @@ const submitForm = async () => {
await PropertyApi.updateProperty(data) await PropertyApi.updateProperty(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -110,7 +110,7 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
/** 查询参数列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -19,7 +19,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -28,8 +28,8 @@ import * as PropertyApi from '@/api/mall/product/property'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -46,8 +46,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, propertyId: number, id?: number) => { const open = async (type: string, propertyId: number, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
formData.value.propertyId = propertyId formData.value.propertyId = propertyId
@ -81,7 +81,7 @@ const submitForm = async () => {
await PropertyApi.updatePropertyValue(data) await PropertyApi.updatePropertyValue(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -108,7 +108,7 @@ const queryParams = reactive({
const queryFormRef = ref() // const queryFormRef = ref() //
const propertyOptions = ref([]) // const propertyOptions = ref([]) //
/** 查询参数列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -64,7 +64,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -73,8 +73,8 @@ import * as AccountApi from '@/api/mp/account'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -98,8 +98,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
@ -132,7 +132,7 @@ const submitForm = async () => {
await AccountApi.updateAccount(data) await AccountApi.updateAccount(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="modelTitle" v-model="modelVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
@ -13,7 +13,7 @@
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <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> </template>
</Dialog> </Dialog>
</template> </template>
@ -22,8 +22,8 @@ import * as MpTagApi from '@/api/mp/tag'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
@ -37,8 +37,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, accountId: number, id?: number) => { const open = async (type: string, accountId: number, id?: number) => {
modelVisible.value = true dialogVisible.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
formData.value.accountId = accountId formData.value.accountId = accountId
@ -72,7 +72,7 @@ const submitForm = async () => {
await MpTagApi.updateTag(data) await MpTagApi.updateTag(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {

View File

@ -46,7 +46,7 @@
</ContentWrap> </ContentWrap>
<!-- 添加/修改的弹窗 --> <!-- 添加/修改的弹窗 -->
<XModal id="templateModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> <XModal id="templateModel" :loading="modelLoading" v-model="dialogVisible" :title="dialogTitle">
<!-- 表单添加/修改 --> <!-- 表单添加/修改 -->
<Form <Form
ref="formRef" ref="formRef"
@ -70,7 +70,7 @@
@click="submitForm()" @click="submitForm()"
/> />
<!-- 按钮关闭 --> <!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> <XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template> </template>
</XModal> </XModal>
@ -132,8 +132,8 @@ const [registerTable, { reload, deleteData }] = useXTable({
}) })
// //
const modelVisible = ref(false) // const dialogVisible = ref(false) //
const modelTitle = ref('edit') // const dialogTitle = ref('edit') //
const modelLoading = ref(false) // loading const modelLoading = ref(false) // loading
const actionType = ref('') // const actionType = ref('') //
const actionLoading = ref(false) // Loading const actionLoading = ref(false) // Loading
@ -143,9 +143,9 @@ const detailData = ref() // 详情 Ref
// //
const setDialogTile = (type: string) => { const setDialogTile = (type: string) => {
modelLoading.value = true modelLoading.value = true
modelTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
actionType.value = type actionType.value = type
modelVisible.value = true dialogVisible.value = true
} }
// //
@ -188,7 +188,7 @@ const submitForm = async () => {
await NotifyTemplateApi.updateNotifyTemplateApi(data) await NotifyTemplateApi.updateNotifyTemplateApi(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
modelVisible.value = false dialogVisible.value = false
} finally { } finally {
actionLoading.value = false actionLoading.value = false
// //